/* =========================================================================
   FileVault Studio — stylesheet
   High-tech dashboard aesthetic · dark & light themes · fully responsive
   ========================================================================= */

/* ----------------------------- Design tokens ---------------------------- */
:root {
  --accent: #6366f1;
  --accent-2: #06b6d4;
  --accent-grad: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  --accent-grad-soft: linear-gradient(135deg, rgba(99,102,241,.16), rgba(6,182,212,.16));

  --success: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --ff: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --shadow-sm: 0 1px 2px rgba(2, 6, 23, .25);
  --shadow-md: 0 10px 30px -12px rgba(2, 6, 23, .5);
  --maxw: 1200px;
  --transition: .18s cubic-bezier(.4, 0, .2, 1);
}

/* Dark (default) */
:root,
:root[data-theme="dark"] {
  --bg: #070b18;
  --bg-grad: radial-gradient(1200px 600px at 15% -10%, rgba(99,102,241,.16), transparent 60%),
             radial-gradient(1000px 500px at 100% 0%, rgba(6,182,212,.12), transparent 55%),
             #070b18;
  --surface: #0f1730;
  --surface-2: #131d3a;
  --surface-3: #182448;
  --border: rgba(148, 163, 216, .14);
  --border-strong: rgba(148, 163, 216, .28);
  --text: #e8edff;
  --text-dim: #97a3c9;
  --text-faint: #6b7699;
  --overlay: rgba(3, 6, 18, .6);
  color-scheme: dark;
}

/* Light */
:root[data-theme="light"] {
  --bg: #eef1f8;
  --bg-grad: radial-gradient(1200px 600px at 15% -10%, rgba(99,102,241,.10), transparent 60%),
             radial-gradient(1000px 500px at 100% 0%, rgba(6,182,212,.10), transparent 55%),
             #eef1f8;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --surface-3: #eef2f9;
  --border: rgba(15, 23, 42, .10);
  --border-strong: rgba(15, 23, 42, .18);
  --text: #0d1530;
  --text-dim: #4a5578;
  --text-faint: #7a83a3;
  --overlay: rgba(15, 23, 42, .35);
  --shadow-md: 0 12px 30px -14px rgba(30, 41, 90, .35);
  color-scheme: light;
}

/* ------------------------------- Base ----------------------------------- */
* { box-sizing: border-box; }
/* The `hidden` attribute must win over author `display:flex/grid` rules
   (e.g. .action-bar, .global-progress) — author styles otherwise beat the
   UA stylesheet's `[hidden]{display:none}`. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--ff);
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-3); padding: .1em .4em; border-radius: 6px; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(16px, 4vw, 28px); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ------------------------------- Header --------------------------------- */
.app-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 18px;
  padding-block: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-logo { display: grid; place-items: center; filter: drop-shadow(0 6px 14px rgba(99,102,241,.35)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.brand-accent { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { font-size: .72rem; color: var(--text-faint); font-weight: 500; }

.header-tagline {
  margin: 0 auto; display: flex; align-items: center; gap: 9px;
  font-size: .9rem; color: var(--text-dim);
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--accent-grad-soft);
}
.header-tagline strong { color: var(--text); }
.header-tagline i { width: 18px; height: 18px; color: var(--accent-2); }

.header-actions { flex-shrink: 0; margin-left: auto; }
.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: var(--transition);
}
.icon-btn:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.icon-btn i { width: 20px; height: 20px; }
.theme-icon-light { display: none; }
:root[data-theme="light"] .theme-icon-dark { display: none; }
:root[data-theme="light"] .theme-icon-light { display: block; }

.trust-strip {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding-bottom: 14px;
}
.trust-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .78rem; font-weight: 600; color: var(--text-dim);
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
}
.trust-pill i { width: 15px; height: 15px; color: var(--accent); }

/* -------------------------------- Ads ----------------------------------- */
.ad-slot {
  position: relative; display: block; margin: 18px 0;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2);
  min-height: 96px; padding: 22px 14px 14px;
  overflow: hidden;
}
.ad-slot .ad-label {
  position: absolute; top: 7px; left: 12px;
  font-size: .62rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-faint);
}
.ad-banner { text-align: center; }
.ad-native { min-height: 220px; }
.ad-slot ins { min-height: 60px; }

/* -------------------------------- Tabs ---------------------------------- */
.tabs {
  display: flex; gap: 8px; margin-top: 20px; padding-bottom: 4px;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 11px 18px; border-radius: 12px; cursor: pointer;
  font-family: inherit; font-size: .92rem; font-weight: 600;
  color: var(--text-dim); background: var(--surface); border: 1px solid var(--border);
  transition: var(--transition);
}
.tab i { width: 17px; height: 17px; }
.tab:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.tab.is-active {
  color: #fff; border-color: transparent;
  background: var(--accent-grad);
  box-shadow: 0 8px 22px -8px rgba(99,102,241,.6);
}

/* --------------------------- Two-level tool nav ------------------------- */
.toolnav { margin-top: 20px; display: flex; flex-direction: column; gap: 14px; }
.cat-tabs { display: flex; gap: 10px; }
.cat-tab {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 11px 20px; border-radius: 12px; font-family: inherit; font-size: .95rem; font-weight: 700;
  color: var(--text-dim); background: var(--surface); border: 1px solid var(--border); transition: var(--transition);
}
.cat-tab i { width: 18px; height: 18px; }
.cat-tab:hover { color: var(--text); border-color: var(--border-strong); }
.cat-tab.is-active { color: #fff; border-color: transparent; background: var(--accent-grad); box-shadow: 0 8px 22px -8px rgba(99,102,241,.6); }

.tool-chips { display: flex; flex-wrap: wrap; gap: 16px 24px; }
.chip-group { display: flex; flex-direction: column; gap: 8px; }
.chip-group-label { font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); padding-left: 2px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; white-space: nowrap;
  padding: 8px 14px; border-radius: 10px; font-family: inherit; font-size: .84rem; font-weight: 600;
  color: var(--text-dim); background: var(--surface); border: 1px solid var(--border); transition: var(--transition);
}
.chip i { width: 15px; height: 15px; }
.chip:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.chip.is-active { color: #fff; border-color: transparent; background: var(--accent-grad); box-shadow: 0 6px 16px -8px rgba(99,102,241,.6); }
.chip.is-active i { color: #fff; }

/* Caveat / info banner */
.tool-note {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--warn) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  color: var(--text-dim); font-size: .84rem; line-height: 1.5;
}
.tool-note i { width: 17px; height: 17px; color: var(--warn); flex-shrink: 0; margin-top: 2px; }

/* ----------------------------- Workspace -------------------------------- */
.workspace {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px; margin-top: 22px; margin-bottom: 40px; align-items: start;
}
.work-main { min-width: 0; }

.tool-head { margin-bottom: 16px; }
.tool-title { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; }
.tool-desc { color: var(--text-dim); margin: 0; max-width: 60ch; }

/* Controls */
.controls-panel {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 18px;
}
.controls-panel:empty { display: none; }
.ctrl { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ctrl-label { font-size: .82rem; font-weight: 600; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.ctrl-label i { width: 15px; height: 15px; color: var(--accent); }
.ctrl-hint { font-size: .72rem; color: var(--text-faint); }

.ctrl-row { display: flex; gap: 10px; }
.ctrl-row > * { flex: 1; min-width: 0; }

input[type="number"], input[type="text"], select {
  width: 100%; font-family: inherit; font-size: .92rem;
  padding: 10px 12px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: var(--transition);
}
input[type="number"]:focus, input[type="text"]:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.2);
}
select { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2397a3c9' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px;
}

/* Range slider */
.range-wrap { display: flex; align-items: center; gap: 12px; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; flex: 1; height: 6px; border-radius: 999px;
  background: var(--surface-3); cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-grad); border: 2px solid var(--surface); box-shadow: var(--shadow-sm); cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--surface);
  background: var(--accent); cursor: pointer;
}
.range-val { min-width: 46px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Toggle switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3);
  border: 1px solid var(--border); position: relative; transition: var(--transition); flex-shrink: 0;
}
.switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--text-dim); transition: var(--transition);
}
.switch input:checked + .switch-track { background: var(--accent-grad); border-color: transparent; }
.switch input:checked + .switch-track::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(99,102,241,.3); }
.switch-text { font-size: .85rem; color: var(--text); }

/* ----------------------------- Dropzone --------------------------------- */
.dropzone {
  position: relative; border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface); cursor: pointer; transition: var(--transition);
  padding: clamp(28px, 6vw, 56px) 20px; text-align: center; overflow: hidden;
}
.dropzone::before {
  content: ""; position: absolute; inset: 0; background: var(--accent-grad-soft); opacity: 0; transition: var(--transition);
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); outline: none; }
.dropzone:hover::before { opacity: .5; }
.dropzone.is-drag { border-color: var(--accent); border-style: solid; transform: scale(1.005); }
.dropzone.is-drag::before { opacity: 1; }
.dz-inner { position: relative; z-index: 1; }
.dz-icon {
  width: 66px; height: 66px; margin: 0 auto 14px; display: grid; place-items: center;
  border-radius: 20px; background: var(--accent-grad); color: #fff;
  box-shadow: 0 14px 30px -10px rgba(99,102,241,.6);
}
.dz-icon i { width: 30px; height: 30px; }
.dz-title { font-size: 1.15rem; font-weight: 700; margin: 0 0 4px; }
.dz-sub { color: var(--text-dim); margin: 0 0 8px; font-size: .92rem; }
.dz-browse { color: var(--accent-2); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.dz-formats { font-size: .76rem; color: var(--text-faint); letter-spacing: .04em; margin: 0; }

/* ---------------------------- Action bar -------------------------------- */
.action-bar {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  margin-top: 18px;
}
.action-left, .action-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.batch-stat { font-size: .84rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: inherit; font-size: .92rem; font-weight: 650;
  padding: 11px 18px; border-radius: 12px; border: 1px solid transparent;
  transition: var(--transition); white-space: nowrap;
}
.btn i { width: 17px; height: 17px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: 0 10px 24px -10px rgba(99,102,241,.7); }
.btn-primary:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 14px 30px -10px rgba(99,102,241,.8); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:not(:disabled):hover { border-color: var(--accent); color: var(--accent-2); }
.btn-ghost { background: transparent; color: var(--text-dim); border-color: var(--border); }
.btn-ghost:hover { color: var(--danger); border-color: var(--danger); }
.btn-sm { padding: 7px 12px; font-size: .82rem; border-radius: 9px; }

/* --------------------------- Global progress ---------------------------- */
.global-progress { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.gp-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.gp-fill { height: 100%; width: 0; background: var(--accent-grad); transition: width .25s ease; }
.gp-text { font-size: .82rem; color: var(--text-dim); font-variant-numeric: tabular-nums; min-width: 90px; text-align: right; }

/* ----------------------------- File list -------------------------------- */
.file-list { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.file-card {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: var(--transition); animation: cardIn .3s ease both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.file-card:hover { border-color: var(--border-strong); }

.file-thumb {
  width: 64px; height: 64px; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--surface-3); display: grid; place-items: center; flex-shrink: 0;
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb i { width: 26px; height: 26px; color: var(--text-faint); }

.file-info { min-width: 0; }
.file-name { font-weight: 650; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 5px; font-size: .8rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.file-size-orig.reduced { text-decoration: line-through; opacity: .65; }
.file-arrow { color: var(--text-faint); }
.file-size-new { color: var(--success); font-weight: 700; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: .7rem; font-weight: 700; letter-spacing: .02em;
}
.badge i { width: 12px; height: 12px; }
.badge-ready { background: color-mix(in srgb, var(--text-faint) 20%, transparent); color: var(--text-dim); }
.badge-processing { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-2); }
.badge-done { background: color-mix(in srgb, var(--success) 20%, transparent); color: var(--success); }
.badge-error { background: color-mix(in srgb, var(--danger) 22%, transparent); color: var(--danger); }
.badge-save { background: var(--accent-grad); color: #fff; }

/* per-file progress */
.file-progress { grid-column: 1 / -1; height: 5px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 2px; }
.file-progress-fill { height: 100%; width: 0; background: var(--accent-grad); transition: width .2s ease; }

.file-actions { display: flex; align-items: center; gap: 8px; }
.file-actions .btn { padding: 8px 12px; }
.mini-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim); cursor: pointer;
  transition: var(--transition);
}
.mini-btn:hover { color: var(--text); border-color: var(--border-strong); }
.mini-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.mini-btn i { width: 16px; height: 16px; }

/* ----------------------------- Results ---------------------------------- */
.results-panel {
  margin-top: 26px; padding: 20px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.results-title { display: flex; align-items: center; gap: 9px; font-size: 1.1rem; }
.results-title i { width: 20px; height: 20px; color: var(--accent-2); }
.results-body { margin-top: 14px; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.result-thumb {
  border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2);
}
.result-thumb img { width: 100%; height: 130px; object-fit: contain; background: var(--surface-3); display: block; }
.result-thumb .rt-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; }
.result-thumb .rt-name { font-size: .72rem; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.result-file {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.result-file .rf-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-grad); color: #fff; flex-shrink: 0; }
.result-file .rf-icon i { width: 24px; height: 24px; }
.result-file .rf-info { flex: 1; min-width: 0; }
.result-file .rf-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-file .rf-meta { font-size: .8rem; color: var(--text-dim); }
.text-preview {
  margin-top: 10px; max-height: 200px; overflow: auto; font-family: var(--mono); font-size: .78rem;
  color: var(--text-dim); background: var(--surface-3); padding: 12px; border-radius: var(--radius-sm);
  white-space: pre-wrap; word-break: break-word;
}

/* ----------------------------- Sidebar ---------------------------------- */
.work-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 96px; }
.side-card {
  padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.side-card-title { display: flex; align-items: center; gap: 8px; font-size: .95rem; margin-bottom: 12px; }
.side-card-title i { width: 17px; height: 17px; color: var(--accent); }
.side-steps { margin: 0; padding-left: 20px; color: var(--text-dim); font-size: .86rem; display: flex; flex-direction: column; gap: 6px; }
.side-note { margin: 14px 0 0; padding: 12px; border-radius: var(--radius-sm); background: var(--accent-grad-soft); font-size: .8rem; color: var(--text-dim); display: flex; gap: 8px; }
.side-note i { width: 16px; height: 16px; color: var(--accent-2); flex-shrink: 0; margin-top: 2px; }

.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; font-size: .86rem; color: var(--text-dim); border-bottom: 1px solid var(--border); }
.stat-row:last-child { border-bottom: none; }
.stat-row strong { color: var(--text); font-variant-numeric: tabular-nums; }
.stat-row.highlight strong { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 1.05rem; }

/* ------------------------------- SEO ------------------------------------ */
.seo { margin: 20px auto 40px; }
.seo-article {
  padding: clamp(24px, 5vw, 44px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  max-width: 900px; margin-inline: auto;
}
.seo-article h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); }
.seo-article h3 { font-size: 1.2rem; margin-top: 1.6em; color: var(--text); }
.seo-article p, .seo-article li { color: var(--text-dim); }
.seo-article strong { color: var(--text); }
.seo-article em { color: var(--accent-2); font-style: normal; font-weight: 600; }
.seo-article ul { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.faq-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
  overflow: hidden; transition: var(--transition);
}
.faq-item[open] { border-color: var(--border-strong); }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 15px 18px; font-weight: 650; color: var(--text);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-size: 1.3rem; color: var(--accent); font-weight: 400; transition: var(--transition); line-height: 1;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-body { padding: 0 18px 16px; }
.faq-body p { margin: 0; }

/* ------------------------------ Footer ---------------------------------- */
.app-footer { border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 60%, transparent); margin-top: 20px; }
.footer-inner { padding-block: 28px; display: flex; flex-direction: column; gap: 12px; }
.footer-brand { display: flex; flex-direction: column; gap: 4px; }
.footer-brand strong { font-size: 1.1rem; font-weight: 800; }
.footer-brand span { color: var(--text-dim); font-size: .88rem; }
.footer-legal { color: var(--text-faint); font-size: .8rem; margin: 0; max-width: 70ch; }

/* ------------------------------ Toasts ---------------------------------- */
.toast-host {
  position: fixed; bottom: 20px; right: 20px; z-index: 100;
  display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100vw - 40px));
}
.toast {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: var(--shadow-md); font-size: .88rem; color: var(--text);
  animation: toastIn .28s ease both;
}
.toast i { width: 18px; height: 18px; flex-shrink: 0; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.info i { color: var(--accent-2); }
.toast.leaving { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* --------------------------- Responsive --------------------------------- */
@media (max-width: 960px) {
  .workspace { grid-template-columns: 1fr; }
  .work-side { position: static; flex-direction: column; }
  .header-tagline { display: none; }
}
@media (max-width: 560px) {
  .header-inner { gap: 10px; }
  .brand-sub { display: none; }
  .file-card { grid-template-columns: 52px minmax(0, 1fr); }
  .file-thumb { width: 52px; height: 52px; }
  .file-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .action-bar { flex-direction: column; align-items: stretch; }
  .action-left, .action-right { justify-content: space-between; }
  .trust-strip { gap: 7px; }
  .trust-pill { font-size: .72rem; padding: 5px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
