/* FilePort Pro — clean, light UI. No framework, no build step.
   Strict CSP (style-src 'self'): ALL styles live in this file — no inline
   style="" attributes, no <style> blocks.
   Design tokens per audit: --bg #F4F6FB, --accent #4F46E5, system font stack,
   4px spacing scale. */

:root {
  /* palette */
  --bg: #f4f6fb;
  --panel: #ffffff;
  --ink: #1b2233;
  --ink-soft: #3d465e;
  --muted: #5f6a85;
  --line: #e2e6f0;
  --line-strong: #d3d9e8;
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --accent-soft: #eef0fe;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --ok: #15803d;
  --ok-soft: #ecfdf5;
  --ok-line: #b7ecd3;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --warn-line: #fde68a;
  --header-bg: #151a2b;
  --header-ink: #eef0f8;
  --ad-bg: #f9fafc;
  --shadow-sm: 0 1px 2px rgba(23, 28, 55, 0.06);
  --shadow-md: 0 10px 30px rgba(23, 28, 55, 0.16);

  /* type */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* 4px spacing scale */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;
  --s10: 40px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container { width: min(960px, 100% - 2rem); margin: 0 auto; }

/* ---------- focus ring (all interactive elements) ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- header ---------- */
.site-header { background: var(--header-bg); color: var(--header-ink); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4); padding: var(--s3) 0;
}
.brand { display: flex; align-items: center; gap: var(--s2); font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }
.brand-mark {
  width: 1.75rem; height: 1.75rem; flex: none;
  border-radius: 0.5rem; background: var(--accent); color: #fff;
  padding: 0.32rem;
  stroke-width: 2.25;
}
.conn-status {
  display: flex; align-items: center; gap: 0.45rem;
  font-size: 0.82rem; color: #aab3cc; min-width: 0;
}
.conn-status__dot {
  width: 0.55rem; height: 0.55rem; border-radius: 50%; flex: none;
  background: #4a546e; transition: background 0.2s ease, box-shadow 0.2s ease;
}
.conn-status.connected .conn-status__dot {
  background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.22);
}
.conn-status.connected { color: #cfd6ea; }
#conn-status-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- hero (slim band) ---------- */
.hero { padding: var(--s8) 0 var(--s4); text-align: center; }
.hero h1 {
  font-size: clamp(1.6rem, 3.6vw, 2.2rem); line-height: 1.2;
  margin: 0 0 var(--s2); letter-spacing: -0.025em;
}
.tagline { color: var(--muted); max-width: 38rem; margin: 0 auto; font-size: 1rem; }

/* ---------- panels & form ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 0.9rem;
  padding: var(--s6); margin: var(--s4) 0; box-shadow: var(--shadow-sm);
}
/* 150ms entrance transition whenever a panel is revealed */
.panel:not(.hidden) { animation: panelIn 150ms ease-out; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4);
}
.panel h2 { margin: 0; font-size: 1.2rem; letter-spacing: -0.01em; }
.panel h3 { margin: var(--s4) 0 0.35rem; font-size: 1rem; }

.trust-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.74rem; font-weight: 600; color: var(--ok);
  background: var(--ok-soft); border: 1px solid var(--ok-line);
  border-radius: 999px; padding: 0.28rem 0.7rem;
}
.trust-chip svg { flex: none; }

.form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--s4);
}
.field { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.field-label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.field-label em { font-style: normal; font-weight: 400; color: var(--muted); }

input, select {
  font: inherit; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 0.55rem;
  padding: 0.72rem 0.8rem; background: #fff; width: 100%;
  min-height: 2.9rem; /* ≥44px touch target */
}
input::placeholder { color: #9aa3bd; }
input:focus, select:focus {
  outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent);
}

.field-input-wrap { position: relative; display: block; }
.field-input-wrap input { padding-right: 2.9rem; }
.reveal-btn {
  position: absolute; top: 50%; right: 0.35rem; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.3rem; height: 2.3rem; padding: 0;
  border: none; background: transparent; color: var(--muted);
  border-radius: 0.45rem; cursor: pointer;
}
.reveal-btn:hover { color: var(--ink); background: var(--bg); }

/* protocol-aware disclosure line */
.proto-warning {
  display: flex; align-items: flex-start; gap: 0.5rem;
  margin-top: var(--s4); padding: 0.65rem 0.85rem; border-radius: 0.55rem;
  font-size: 0.88rem; line-height: 1.45;
}
.proto-warning svg { flex: none; margin-top: 2px; }
.proto-warning--sftp { background: var(--ok-soft); border: 1px solid var(--ok-line); color: #14532d; }
.proto-warning--sftp svg { color: var(--ok); }
.proto-warning--ftp { background: var(--warn-bg); border: 1px solid var(--warn-line); color: #78350f; }
.proto-warning--ftp svg { color: var(--warn); }
.proto-warning__text strong { font-weight: 700; }

.connect-error {
  margin-top: var(--s4);
  padding: 0.65rem 0.85rem; border-radius: 0.55rem;
  border: 1px solid #f3c1c1; background: var(--danger-soft); color: #991b1b;
  font-size: 0.9rem;
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.55rem;
}
.connect-error .fp-forget-btn { margin: 0; }
.form-actions { margin-top: var(--s4); }

/* ---------- contact form (contact.html) ---------- */
/* Scoped to the contact page so the tools' plain textarea (checksum-calculator)
   keeps its default appearance. */
.contact-form .contact-message-field { margin-top: var(--s4); }
.contact-form textarea {
  font: inherit; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 0.55rem;
  padding: 0.72rem 0.8rem; background: #fff; width: 100%;
  min-height: 2.9rem; resize: vertical;
}
.contact-form textarea::placeholder { color: #9aa3bd; }
.contact-form textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent);
}
.contact-status {
  margin-top: var(--s4);
  padding: 0.65rem 0.85rem; border-radius: 0.55rem;
  font-size: 0.9rem; line-height: 1.45;
}
.contact-status--ok {
  background: var(--ok-soft); border: 1px solid var(--ok-line); color: #14532d;
}
.contact-status--err {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  background: var(--danger-soft); border: 1px solid #f3c1c1; color: #991b1b;
}

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  border-radius: 0.55rem; padding: 0.62rem 1.05rem; min-height: 2.7rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { background: #f2f4fa; }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-danger { background: #fff; border-color: #f2c8c8; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-icon svg { color: var(--muted); }
.btn-icon:hover svg { color: var(--ink); }
/* "Download all" (ZIP) toolbar button — download-tinted like .btn-download so
   it reads as a download action, distinct from the neutral up/refresh/upload
   and never competing with Disconnect. */
.btn-zip { color: var(--accent); border-color: #d5d9fb; }
.btn-zip svg { color: var(--accent); }
.btn-zip:hover { background: var(--accent-soft); border-color: #c4c9f5; }
.btn-zip:hover svg { color: var(--accent-dark); }
.btn-sm { padding: 0.5rem 0.75rem; font-size: 0.85rem; min-height: 0; }
#connect-btn { min-width: 10rem; }

/* ---------- how-it-works steps ---------- */
.steps-section { margin: var(--s6) 0 var(--s2); }
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4);
}
.step {
  display: flex; gap: var(--s3); align-items: flex-start;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 0.8rem; padding: var(--s5); box-shadow: var(--shadow-sm);
}
.step-num {
  flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 0.85rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.step-body strong { display: block; margin-bottom: 0.2rem; font-size: 0.98rem; }
.step-body h3 { display: block; margin: 0 0 0.2rem; font-size: 0.98rem; }
.step-body p { margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.5; }

/* ---------- ad slots (honest placeholders: empty + "Ad" chip, no fake content) ---------- */
.ad-slot {
  border: 1px solid var(--line); border-radius: 0.8rem;
  background: var(--ad-bg); position: relative; margin: var(--s5) 0;
  overflow: hidden;
}
.ad-slot--banner { min-height: 90px; }
.ad-slot--inline { margin: 0.15rem 0; min-height: 80px; border-radius: 0.6rem; }
.ad-slot__content { min-height: inherit; }
/* P4.5 ad-free Pro perk: html[data-pro] (set by /api/me in app.js and ads.js)
   hides every ad surface — banner, in-list rows, and their reserved space.
   Belt-and-suspenders on top of the render-side skip, so a Pro page never
   shows an ad even before JS finishes assembling a listing. */
html[data-pro] .ad-slot--banner,
html[data-pro] .ad-row,
html[data-pro] .ad-slot--inline { display: none !important; }
.ad-label {
  position: absolute; top: 0.55rem; right: 0.55rem; z-index: 1;
  display: inline-flex; align-items: center;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); background: var(--panel);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.18rem 0.5rem;
}

/* ---------- browser mode ---------- */
/* Landing chrome hides when connected; the banner then sits between the
   header and the file panel. The entire marketing wrapper (.landing) is
   hidden on connect — on disconnect the connect form is revealed again. */
body[data-mode="browser"] .landing { display: none; }
body[data-mode="browser"] .ad-slot--banner { margin-top: var(--s4); }

.browser-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4);
}
.crumbs {
  display: flex; align-items: center; gap: 0.1rem;
  flex: 1 1 16rem; min-width: 0;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: thin;
}
.crumb {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font: inherit; font-size: 0.9rem; color: var(--muted);
  background: transparent; border: none; border-radius: 0.4rem;
  padding: 0.4rem 0.45rem; cursor: pointer;
  white-space: nowrap; min-width: 0; max-width: 12rem;
  flex-shrink: 0; /* let overflow be detected so middle-collapse can engage */
  overflow: hidden; text-overflow: ellipsis;
}
.crumb:hover { color: var(--accent); background: var(--accent-soft); }
.crumb--last { color: var(--ink); font-weight: 600; }
.crumb--ellipsis { color: var(--accent); }
.crumb-sep { display: inline-flex; color: var(--line-strong); flex: none; }
.toolbar-buttons { display: flex; gap: var(--s2); flex-wrap: wrap; }

/* SFTP host-key fingerprint line */
.host-chip {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  background: var(--accent-soft); border: 1px solid #d5d9fb; color: #3730a3;
  border-radius: 0.55rem; padding: 0.5rem 0.8rem; margin-bottom: var(--s3);
  font-size: 0.82rem;
}
.host-chip__icon { display: inline-flex; color: var(--accent); flex: none; }
.host-chip__label {
  font-weight: 700; text-transform: uppercase; font-size: 0.68rem;
  letter-spacing: 0.07em; color: var(--accent);
}
.host-chip__fp {
  font-family: var(--font-mono); font-size: 0.8rem;
  background: #fff; border: 1px solid #d5d9fb; border-radius: 0.4rem;
  padding: 0.15rem 0.45rem; word-break: break-all;
}
.host-chip__hint { color: #5b5596; }
.host-chip__hint code {
  font-family: var(--font-mono); font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.75); border-radius: 0.25rem;
  padding: 0.05rem 0.3rem;
}

/* ---------- transfers (per-file upload/download progress) ---------- */
.transfers {
  display: flex; flex-direction: column; gap: 0.35rem;
  border: 1px solid var(--line); background: var(--panel);
  border-radius: 0.55rem; padding: 0.65rem 0.85rem; margin-bottom: var(--s4);
}
.transfers__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s2); flex-wrap: wrap;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted);
}
.transfers__hint {
  font-weight: 400; text-transform: none; letter-spacing: 0;
  color: var(--muted); font-size: 0.78rem;
}
/* Touch devices have no HTML5 drag & drop: hide the dnd hint and show the
   "tap Upload" variant. (hover: none) = the primary input is a touchscreen;
   desktop pointers keep the drag & drop hint. Pure CSS — no JS, CSP-safe. */
.transfers__hint--tap { display: none; }
@media (hover: none) {
  .transfers__hint--dnd { display: none; }
  .transfers__hint--tap { display: inline; }
}
.transfer {
  display: flex; flex-direction: column; gap: 0.3rem;
  padding: 0.35rem 0; border-top: 1px solid #eef0f6;
}
.transfer__main { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.transfer__icon { display: inline-flex; flex: none; }
.transfer__icon--up { color: var(--accent); }
.transfer__icon--down { color: var(--muted); }
.transfer__icon--zip { color: var(--accent); }
.transfer__name {
  font-size: 0.88rem; font-weight: 600; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.transfer__status {
  margin-left: auto; flex: none; font-size: 0.8rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.transfer__meta { font-size: 0.76rem; color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.transfer--done .transfer__status { color: var(--ok); font-weight: 700; }
.transfer--done .transfer__meta { display: none; }
.transfer--error .transfer__status { color: var(--danger); font-weight: 700; }
.transfer--error .transfer__meta { color: var(--danger); }
.transfer--error .progress { opacity: 0.4; }
/* ZIP job cancelled — neutral, never red: a cancelled job is not an error. */
.transfer--cancelled .transfer__status { color: var(--muted); font-weight: 700; }
.transfer--cancelled .progress { opacity: 0.4; }

/* In-row Cancel for ZIP jobs (subtle; hover turns danger-tinted). */
.btn-cancel {
  font: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer;
  color: var(--muted); background: transparent; border: 1px solid var(--line-strong);
  border-radius: 0.45rem; padding: 0.3rem 0.6rem; flex: none;
}
.btn-cancel:hover { color: var(--danger); border-color: #f2c8c8; background: var(--danger-soft); }

/* progress bars: indeterminate by default (animated strip); determinate once a
   byte sample arrives (animation off, width set from JS via CSSOM — the only
   CSP-safe way to size a bar under style-src 'self'). */
.progress {
  position: relative; height: 4px; border-radius: 999px;
  background: var(--line); overflow: hidden;
}
.progress__bar {
  position: absolute; top: 0; bottom: 0; left: 0; width: 35%;
  border-radius: 999px; background: var(--accent);
  animation: progressSlide 1.3s ease-in-out infinite;
}
.progress__bar--determinate { animation: none; transition: width 0.2s ease; }
@keyframes progressSlide {
  0% { left: -35%; }
  100% { left: 100%; }
}

/* drag & drop: dashed overlay while a file drag is over the browser panel.
   Tokens only: accent dashed border, accent-soft tint, 4px-scale spacing.
   pointer-events: none so it never swallows the drop itself; the ~92% tint
   keeps the folder context (breadcrumb, list) faintly visible while dragging. */
#browser-panel { position: relative; }
#browser-panel.drag-over::after {
  content: "Drop files to upload to this folder";
  position: absolute; inset: var(--s2); z-index: 6;
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--accent); border-radius: 0.7rem;
  background: rgba(238, 240, 254, 0.92); color: var(--accent);
  font-weight: 700; font-size: 0.95rem; text-align: center;
  padding: var(--s4); pointer-events: none;
}

/* ---------- file table ---------- */
.table-wrap { overflow-x: auto; }
.file-table { width: 100%; border-collapse: collapse; }
.file-table th {
  text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.6rem; white-space: nowrap;
}
.th-btn {
  font: inherit; font-size: inherit; letter-spacing: inherit; text-transform: inherit;
  color: inherit; background: transparent; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.3rem 0.2rem; margin: -0.3rem 0; border-radius: 0.3rem;
}
.th-btn:hover { color: var(--ink); }
.th-arrow { display: inline-flex; color: var(--accent); }
th[aria-sort="ascending"] .th-btn,
th[aria-sort="descending"] .th-btn { color: var(--ink); }
.file-table td {
  padding: 0.35rem 0.6rem; border-bottom: 1px solid #eef0f6;
  font-size: 0.92rem; vertical-align: middle;
}
.file-table tbody tr.entry:hover { background: #f6f7fc; }
.file-table tr.ad-row td { padding: 0.25rem 0.4rem; background: transparent; }
.col-name { width: 55%; min-width: 12rem; }
.col-size { width: 7rem; }
.col-type { width: 5rem; }
.col-modified { width: 11rem; }
.col-size, .col-type, .col-modified { white-space: nowrap; }
.col-action { text-align: right; white-space: nowrap; width: 1%; }
.col-size, .col-type, .col-modified { color: var(--muted); font-size: 0.85rem; }

.file-icon { display: inline-flex; flex: none; margin-right: 0.5rem; vertical-align: middle; }
.file-icon--dir { color: #d97706; }
.file-icon--link { color: var(--accent); }
.file-icon--file { color: #9aa3bd; }

.file-name-btn {
  display: inline-flex; align-items: center; max-width: 100%;
  font: inherit; font-size: 0.92rem; text-align: left;
  color: var(--ink); background: transparent; border: none; border-radius: 0.45rem;
  padding: 0.5rem 0.6rem; margin: -0.15rem -0.6rem; cursor: pointer;
  min-height: 44px; /* keyboard/pointer hit area */
}
.file-name-btn:hover { color: var(--accent); }
.file-name { overflow-wrap: anywhere; word-break: normal; min-width: 0; }
.btn-download { color: var(--accent); border-color: #d5d9fb; }
.btn-download:hover { background: var(--accent-soft); border-color: #c4c9f5; }

/* loading row + empty state */
.spinner-row td { text-align: center; padding: var(--s8) 0; color: var(--muted); font-size: 0.9rem; }
.spinner {
  display: inline-block; width: 18px; height: 18px; vertical-align: -4px; margin-right: 0.5rem;
  border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.table-state { padding: var(--s4) 0 0; }
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: var(--s2);
  text-align: center; color: var(--muted); padding: var(--s6) 0;
}
.empty-state svg { width: 44px; height: 44px; color: var(--line-strong); }
.empty-state__title { margin: 0; font-weight: 600; color: var(--ink-soft); font-size: 0.98rem; }
.empty-state__hint { margin: 0; font-size: 0.85rem; }

/* ---------- privacy / footer / toast ---------- */
.privacy-note { color: var(--muted); font-size: 0.8rem; margin: var(--s4) 0 0; }
.site-footer { margin-top: auto; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8rem; }
.site-footer .container { padding: var(--s4) 0; }
.site-footer p { margin: 0; }
.footer-links { margin-top: var(--s2); }
.footer-links a { color: var(--accent); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
/* A-Town JAM portfolio badge (light variant) */
.footer-badge { margin: var(--s5) 0 0; text-align: center; }
.footer-badge__img {
  display: block; width: 244px; max-width: 100%; height: auto; margin: 0 auto;
  transition: transform .15s ease, opacity .15s ease;
}
.footer-badge__link:hover .footer-badge__img { transform: translateY(-2px); opacity: 0.85; }
.footer-badge__link:focus-visible { outline: 2px solid var(--accent, #4f46e5); outline-offset: 3px; border-radius: 4px; }
@media (min-width: 641px) {
  /* Desktop: tagline + badge share the first row (badge top-aligned right);
     links sit on their own row below. */
  .site-footer .container { display: flex; flex-wrap: wrap; align-items: flex-start; }
  .site-footer .container > p:first-child { order: 1; flex: 1 1 auto; margin-right: var(--s4); }
  .footer-links { order: 3; flex: 1 0 100%; margin: var(--s2) 0 0; }
  .footer-badge { order: 2; margin: 0 0 0 auto; text-align: right; }
  .footer-badge__img { margin: 0 0 0 auto; }
}

/* ---------- privacy page ---------- */
.privacy-page h1 { font-size: 1.6rem; letter-spacing: -0.02em; margin: 0 0 var(--s2); }
.privacy-page .privacy-effective { color: var(--muted); font-size: 0.85rem; margin: 0 0 var(--s4); }
.privacy-page h2 { font-size: 1.05rem; margin: var(--s6) 0 var(--s2); }
.privacy-page p { margin: var(--s2) 0; }
.privacy-page ul { margin: var(--s2) 0; padding-left: 1.4rem; }
.privacy-page li { margin: 0.3rem 0; }
.privacy-page a { color: var(--accent); }
.privacy-page code { background: var(--bg); border: 1px solid var(--line); border-radius: 0.3rem; padding: 0.05rem 0.3rem; font-size: 0.85em; }

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.6rem;
  background: #232a3f; color: #fff; border-radius: 0.7rem;
  padding: 0.7rem 1.1rem; max-width: min(90vw, 34rem); z-index: 50;
  box-shadow: var(--shadow-md); font-size: 0.92rem;
}
.toast__icon { display: inline-flex; flex: none; }
.toast__icon--ok { color: #6ee7a0; }
.toast__icon--error { color: #fca5a5; }
.toast__icon--info { color: #93c5fd; }
.toast--ok { background: #14532d; }
.toast--error { background: #7f1d1d; }
.toast__text { min-width: 0; }

.hidden { display: none !important; }

/* visually hidden but still exposed to screen readers (aria-live regions) */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .progress__bar { animation: none; left: 0; width: 100%; opacity: 0.35; }
  .progress__bar--determinate { transition: none; }
  .spinner { animation-duration: 2s; }
  .panel:not(.hidden) { animation: none; }
}

/* ---------- mobile (≤640px) ---------- */
@media (max-width: 640px) {
  .hero { text-align: left; padding-top: var(--s6); }
  .hero .tagline { margin-left: 0; }
  .steps { grid-template-columns: 1fr; }
  .panel { padding: var(--s5); }
  .form-grid { grid-template-columns: 1fr; }
  #connect-btn { width: 100%; }
  .col-type, .col-modified { display: none; }
  /* Mobile table: let the name column flex (long names wrap instead of forcing
     horizontal scroll), slim the size column, and collapse the Download button
     to its icon — Name/Size/Action then fit 320px without overflow. */
  .col-name { min-width: 0; }
  .col-size { width: 5rem; }
  .btn-download span { display: none; }
  .btn-download { padding: 0.5rem 0.55rem; }
  /* Sort direction is still conveyed via aria-sort; hiding the arrow keeps the
     NAME header from forcing the table wider than the viewport. */
  .file-table .th-arrow { display: none; }
  /* Transfer rows keep a ~44px minimum height for comfortable touch reading. */
  .transfer { min-height: 44px; }
  /* ZIP status lines are long ("Packaging 12 of 47 files"); on mobile the JS
     shortens the text to "12 of 47", and this belt-and-braces truncation keeps
     any residual long line (e.g. a failure reason) inside 320px. */
  .transfer__status {
    font-size: 0.72rem; max-width: 9rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .browser-toolbar { flex-direction: column; align-items: stretch; }
  .crumbs { flex-basis: auto; width: 100%; }
  .toolbar-buttons .btn-label { display: none; }
  .toolbar-buttons .btn { padding: 0.6rem 0.7rem; }
  /* bottom-sheet toast with safe-area inset */
  .toast {
    left: 0.75rem; right: 0.75rem; bottom: 0; transform: none;
    width: auto; max-width: none;
    border-radius: 0.8rem 0.8rem 0 0;
    padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom));
  }
}

/* ---- delete (row selection + dialog) ---- */
.col-select { width: 2.5rem; padding-left: .6rem; padding-right: .25rem; }
.col-select input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--danger); cursor: pointer; }
.btn-delete { white-space: nowrap; }
.toolbar-msg { margin: .5rem 0 0; padding: .55rem .8rem; border-radius: .5rem; font-size: .875rem;
  background: var(--danger-soft); border: 1px solid #f3c1c1; color: #991b1b; }
.delete-dialog { border: none; border-radius: .75rem; padding: 1.25rem 1.4rem; max-width: 26rem; width: calc(100vw - 2rem);
  box-shadow: 0 18px 50px rgba(15, 23, 42, .25); color: var(--text, #0f172a); }
.delete-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.delete-dialog__title { margin: 0 0 .5rem; font-size: 1.1rem; }
.delete-dialog__count { margin: 0 0 .6rem; font-size: .9rem; opacity: .85; }
.delete-dialog__names { margin: 0 0 .8rem; padding-left: 1.2rem; font-size: .9rem; }
.delete-dialog__names li { margin: .15rem 0; word-break: break-all; }
.delete-dialog__more { list-style: none; margin-left: -1.2rem; opacity: .7; font-style: italic; }
.delete-dialog__warn { margin: 0 0 1rem; font-size: .875rem; background: var(--danger-soft);
  border: 1px solid #f3c1c1; border-radius: .5rem; padding: .6rem .75rem; color: #991b1b; }
.delete-dialog__actions { display: flex; gap: .6rem; justify-content: flex-end; }
.transfer--delete { border-bottom: 1px solid rgba(15, 23, 42, .08); padding: .5rem 0; }
.transfer--delete .transfer__meta--block { display: block; white-space: normal; word-break: break-word; line-height: 1.4; }
@media (max-width: 640px) {
  .col-select { width: 2rem; padding-left: .35rem; padding-right: .15rem; }
  .btn-delete { padding-left: .6rem; padding-right: .6rem; }
}

/* ---- delete in-progress interstitial (blocking scrim, debounced) ---- */
.delete-progress { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .45); pointer-events: auto; }
.delete-progress__card { display: flex; align-items: center; gap: .9rem; background: var(--panel);
  border: 1px solid var(--line); border-radius: .75rem; padding: 1.1rem 1.5rem; box-shadow: var(--shadow-md);
  color: var(--ink); max-width: min(90vw, 24rem); }
.delete-progress__card .spinner { margin: 0; }
.delete-progress__msg { margin: 0; font-size: .98rem; font-weight: 600; }
.delete-progress__hint { margin: .15rem 0 0; font-size: .8rem; color: var(--muted); }

/* ============================================================================
   HOMEPAGE REDESIGN (owner marketing-first brief; app stays on this page)
   ========================================================================== */
/* Pro accent tokens (also used by Pro pages; declared here so homepage Pro
   buttons render without loading /pro.css) */
:root {
  --pro-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --pro-soft: #f5f3ff;
  --pro-line: #ddd6fe;
  --pro-ink: #4c1d95;
}

/* ---- hero + CTAs (scoped to the homepage landing wrapper so the shared
   .hero on other pages, e.g. /pro, keeps its original slim styling) ---- */
.landing .hero { padding: var(--s10) 0 var(--s6); }
.landing .hero h1 {
  font-size: clamp(1.9rem, 4.6vw, 3rem); line-height: 1.15;
  margin: 0 auto var(--s4); letter-spacing: -0.03em; max-width: 46rem;
}
.landing .hero .tagline { font-size: 1.05rem; max-width: 40rem; }
.hero-cta {
  display: flex; gap: var(--s3); justify-content: center;
  margin-top: var(--s6); flex-wrap: wrap;
}
.btn-lg { padding: 0.85rem 1.6rem; font-size: 1.02rem; min-height: 3.1rem; }
.hero-cta .btn-ghost { border-color: var(--line-strong); background: #fff; }
.hero-cta .btn-ghost:hover { background: #f2f4fa; }
.btn-pro { background: var(--pro-grad); border: none; color: #fff; }
.btn-pro:hover { filter: brightness(1.06); }

/* ---- trust strip ---- */
.trust-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s4);
  margin: var(--s4) 0 var(--s6);
}
.trust-item {
  background: var(--panel); border: 1px solid var(--line); border-radius: 0.8rem;
  padding: var(--s5); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: var(--s2);
}
.trust-item__icon { display: inline-flex; color: var(--accent); }
.trust-item__title { margin: 0; font-size: 0.95rem; display: flex; align-items: center; gap: 0.5rem; }
.trust-item__title svg { flex: none; }
.trust-item__desc { margin: 0; color: var(--muted); font-size: 0.84rem; line-height: 1.5; }

/* ---- product / demo: connect form + preview ----- */
.demo-grid {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--s5); align-items: start; margin: var(--s5) 0 var(--s6);
}
#connect-panel { margin: 0; }
.demo-visual {
  border: 1px solid var(--line); border-radius: 0.9rem;
  background: var(--panel); box-shadow: var(--shadow-md); overflow: hidden;
}
.demo-visual__bar {
  display: flex; align-items: center; gap: var(--s2);
  padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); background: var(--bg);
}
.demo-visual__bar .conn-status { margin-left: auto; color: var(--ok); }
.demo-visual__bar .conn-status.connected .conn-status__dot { background: var(--ok); }
.demo-visual__dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--line-strong); }
.demo-visual__body { padding: var(--s4) var(--s5) var(--s5); }
.demo-visual .crumbs { margin-bottom: var(--s3); flex: none; }
.demo-file {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0; border-top: 1px solid #eef0f6; font-size: 0.9rem;
}
.demo-file:first-of-type { border-top: none; }
.demo-file--dir { font-weight: 600; }
.demo-file__meta { margin-left: auto; color: var(--muted); font-size: 0.78rem; }
.demo-progress {
  height: 5px; border-radius: 999px; background: var(--line);
  overflow: hidden; margin-top: var(--s4); position: relative;
}
.demo-progress__bar { position: absolute; top: 0; bottom: 0; left: 0; width: 64%; background: var(--accent); border-radius: 999px; }
.demo-visual__cap { margin: var(--s3) 0 0; color: var(--muted); font-size: 0.82rem; }

/* ---- generic section headings ---- */
.section-title { margin: var(--s8) 0 var(--s4); font-size: 1.35rem; letter-spacing: -0.02em; }
.section-sub { color: var(--muted); margin: 0 0 var(--s5); max-width: 46rem; }
#features h2, #protocols h2, #use-cases h2, #security h2, #pricing h2 { font-size: 1.35rem; letter-spacing: -0.02em; margin: 0 0 var(--s2); }

/* ---- comparison table (FTP/SFTP + Free/Pro) ---- */
.compare-wrap { overflow-x: auto; }
.compare { width: 100%; border-collapse: collapse; margin: var(--s4) 0; }
.compare th, .compare td { padding: 0.72rem 0.8rem; border-bottom: 1px solid var(--line); text-align: left; font-size: 0.9rem; vertical-align: top; }
.compare thead th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.compare .col-feature { width: 40%; min-width: 12rem; color: var(--ink-soft); }
.compare .col-pro { background: var(--pro-soft); border-left: 1px solid var(--pro-line); width: 30%; }
.compare thead .col-pro { background: var(--pro-grad); color: #fff; border: none; }
.compare .pro-extra { color: var(--pro-ink); font-weight: 700; }
.compare td.col-pro { color: var(--ink); }

/* ---- capabilities + use cases ---- */
.cap-list { list-style: none; margin: 0 0 var(--s4); padding: 0; display: grid; gap: var(--s4); }
.cap-list li { padding-left: 1.4rem; position: relative; color: var(--ink-soft); line-height: 1.55; }
.cap-list li::before {
  content: ""; position: absolute; left: 0; top: 0.4rem;
  width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--accent);
}
.cap-list li strong { color: var(--ink); }
.usecase-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s4); }
.usecase-card {
  background: var(--bg); border: 1px solid var(--line); border-radius: 0.8rem;
  padding: var(--s5);
}
.usecase-card h3 { margin: 0 0 0.35rem; font-size: 0.98rem; }
.usecase-card p { margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.5; }

/* ---- FAQ (reuse Pro page typography) ---- */
.faq-q { margin: var(--s5) 0 0.3rem; font-size: 1.05rem; }
.faq-a { margin: 0 0 var(--s4); color: var(--ink-soft); font-size: 0.94rem; }
.faq-a code { font-family: var(--font-mono); font-size: 0.85em; background: var(--bg); border: 1px solid var(--line); border-radius: 0.3rem; padding: 0.05rem 0.3rem; }

/* ---- final CTA ---- */
.final-cta {
  text-align: center; background: var(--panel); border: 1px solid var(--line);
  border-radius: 0.9rem; padding: var(--s10) var(--s6); margin: var(--s6) 0;
  box-shadow: var(--shadow-sm);
}
.final-cta h2 { margin: 0 0 var(--s2); font-size: 1.5rem; letter-spacing: -0.02em; }
.final-cta__main > p { color: var(--muted); margin: 0 0 var(--s4); }
.final-cta__soon { margin: var(--s8) auto 0; color: var(--muted); max-width: 34rem; }

/* ---- homepage responsive ---- */
@media (max-width: 900px) {
  .trust-strip { grid-template-columns: repeat(2, 1fr); }
  .demo-grid { grid-template-columns: 1fr; }
  .demo-visual { order: 2; }
}
@media (max-width: 640px) {
  .landing .hero { padding-top: var(--s6); }
  .hero-cta .btn-lg { width: 100%; }
  .trust-strip { grid-template-columns: 1fr; margin-bottom: var(--s4); }
  .final-cta { padding: var(--s8) var(--s4); }
  .compare .col-feature { min-width: 9rem; }
}
