/* ═══════════════════════════════════════════════════════════════
   FileIsLove — Product craft
   Paper studio. Clear hierarchy. 8px grid. No friction chrome.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Surfaces — parchment paper */
  --bg: #e8d9bc;
  --bg-deep: #dfcba8;
  --sheet: #faf3e6;
  --sheet-2: #fffaf0;
  --ink: #241c15;
  --ink-2: #5a4f44;
  --ink-3: #8a7d70;
  --line: rgba(36, 28, 21, 0.1);
  --line-2: rgba(36, 28, 21, 0.16);
  --seal: #a33c2c;
  --seal-soft: rgba(163, 60, 44, 0.1);
  --gold: #a8843a;
  --ok: #2d6b4f;
  --ok-soft: rgba(45, 107, 79, 0.1);
  --danger: #9b3a3a;
  --pen: #35516a;

  --shadow-xs: 0 1px 2px rgba(36, 28, 21, 0.05);
  --shadow-sm: 0 2px 4px rgba(36, 28, 21, 0.05), 0 8px 20px -12px rgba(36, 28, 21, 0.18);
  --shadow-md: 0 4px 8px rgba(36, 28, 21, 0.06), 0 16px 32px -16px rgba(36, 28, 21, 0.22);

  --font: "DM Sans", system-ui, -apple-system, sans-serif;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-full: 999px;
  --topbar: 64px;
  --content: 1040px;
  --tool-width: 680px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* legacy aliases used in tools */
  --bg-elev: var(--sheet);
  --bg-card: var(--sheet-2);
  --bg-soft: var(--bg-deep);
  --bg-hover: #d6c4a0;
  --text: var(--ink);
  --text-2: var(--ink-2);
  --text-3: var(--ink-3);
  --ink-2: var(--ink-2);
  --ink-3: var(--ink-3);
  --ink-invert: var(--sheet-2);
  --accent: var(--seal);
  --accent-soft: var(--seal-soft);
  --accent-glow: rgba(163, 60, 44, 0.14);
  --accent-text: var(--seal);
  --border: var(--line);
  --border-strong: var(--line-2);
  --green: var(--ok);
  --shadow: var(--shadow-md);
  --brand: var(--seal);
  --brand-2: var(--seal);
  --r: var(--radius);
  --r-sm: var(--radius-sm);
}

[data-theme="dark"] {
  --bg: #161310;
  --bg-deep: #1e1915;
  --sheet: #231e19;
  --sheet-2: #2b241e;
  --ink: #f2e8d9;
  --ink-2: #b5a898;
  --ink-3: #7d7266;
  --line: rgba(242, 232, 217, 0.09);
  --line-2: rgba(242, 232, 217, 0.15);
  --seal: #e08b7a;
  --seal-soft: rgba(224, 139, 122, 0.12);
  --gold: #c9a85a;
  --ok: #5cba8e;
  --ok-soft: rgba(92, 186, 142, 0.12);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 8px 20px -12px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 16px 36px -16px rgba(0, 0, 0, 0.55);
  --bg-elev: var(--sheet);
  --bg-card: var(--sheet-2);
  --bg-soft: var(--bg-deep);
  --ink-invert: #161310;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.011em;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--pen); text-underline-offset: 3px; }
a:hover { color: var(--seal); }
img, canvas { max-width: 100%; display: block; }
[hidden] { display: none !important; }
::selection { background: var(--seal-soft); color: var(--ink); }

/* Quiet parchment ground — texture, not gimmick */
.page-ground {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 100% 70% at 50% -15%, rgba(255, 250, 240, 0.55), transparent 55%),
    url("../assets/parchment.jpg");
  background-size: auto, 380px;
  opacity: 0.55;
  mix-blend-mode: multiply;
}
[data-theme="dark"] .page-ground {
  opacity: 0.25;
  mix-blend-mode: soft-light;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
  z-index: 1000;
  background: var(--ink);
  color: var(--sheet-2);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
}
.skip-link:focus { left: 12px; }

/* ════════════════════════════════════════
   TOPBAR — 3 zones: brand | search | actions
   ════════════════════════════════════════ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px) saturate(1.05);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--content);
  margin: 0 auto;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(200px, 400px) minmax(100px, 1fr);
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-5);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
  color: inherit;
  min-width: 0;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--sheet) url("../assets/wax-seal.jpg") center/cover;
  border: 1.5px solid color-mix(in srgb, var(--gold) 45%, var(--line-2));
  box-shadow: var(--shadow-xs);
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  line-height: 1.15;
}
.brand-name {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 550;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand-name span,
.brand-logotype-wrap .fil-logotype-love {
  color: var(--seal);
  font-style: italic;
}
.brand-logotype-wrap {
  display: block;
  line-height: 0;
  color: var(--ink);
}
.brand-logotype-wrap .fil-logotype {
  display: block;
  height: 20px;
  width: auto;
  max-width: 132px;
}
.brand-tag {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.search-wrap {
  position: relative;
  width: 100%;
  justify-self: center;
}
.search-wrap input {
  width: 100%;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line-2);
  background: var(--sheet-2);
  padding: 0 48px 0 40px;
  outline: none;
  font-size: 14px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-wrap input::placeholder { color: var(--ink-3); }
.search-wrap input:hover { border-color: color-mix(in srgb, var(--ink) 22%, var(--line)); }
.search-wrap input:focus {
  border-color: color-mix(in srgb, var(--seal) 40%, var(--line-2));
  box-shadow: 0 0 0 3px var(--seal-soft);
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  display: grid;
  place-items: center;
  pointer-events: none;
}
.search-icon svg { width: 16px; height: 16px; }
.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  border: 1px solid var(--line);
  background: var(--bg-deep);
  padding: 2px 6px;
  border-radius: 4px;
}

.topbar-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line-2);
  background: var(--sheet-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink-2);
  box-shadow: var(--shadow-xs);
  transition: color 0.15s, border-color 0.15s, transform 0.15s;
}
.icon-btn:hover {
  color: var(--ink);
  border-color: var(--ink-3);
  transform: translateY(-1px);
}
.icon-btn svg { width: 18px; height: 18px; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

/* ════════════════════════════════════════
   MAIN
   ════════════════════════════════════════ */
main {
  position: relative;
  z-index: 1;
  max-width: var(--content);
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-8);
}
.view { animation: fade 0.28s var(--ease) both; }
@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ════════════════════════════════════════
   HERO — calm, readable, no gimmicks
   ════════════════════════════════════════ */
.hero {
  padding: var(--space-5) 0 var(--space-6);
  max-width: 560px;
}
.hero-inner { display: flex; flex-direction: column; gap: 0; }
.hero-eyebrow {
  margin: 0 0 var(--space-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.hero-title {
  margin: 0 0 var(--space-4);
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.hero-lede {
  margin: 0 0 var(--space-5);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 34em;
}
.hero-meta {
  display: flex;
  gap: 0;
  background: var(--sheet-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  width: fit-content;
}
.hero-meta-item {
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 84px;
  border-right: 1px solid var(--line);
}
.hero-meta-item:last-child { border-right: 0; }
.hero-meta-item strong {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.hero-meta-item span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ════════════════════════════════════════
   CATEGORY NAV — sticky wayfinding
   ════════════════════════════════════════ */
.home-nav {
  position: sticky;
  top: var(--topbar);
  z-index: 40;
  margin: 0 0 var(--space-5);
  padding: var(--space-3) 0;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.cat-tab {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cat-tab:hover {
  color: var(--ink-2);
  background: color-mix(in srgb, var(--sheet) 70%, transparent);
}
.cat-tab.is-active {
  color: var(--sheet-2);
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: var(--shadow-xs);
}

/* Recent */
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 var(--space-3);
}
.recent-row { margin-bottom: var(--space-6); }
.recent-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line-2);
  background: var(--sheet-2);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover {
  transform: translateY(-1px);
  border-color: var(--ink-3);
  color: var(--ink);
}
.chip-icon .fil-icon svg {
  width: 14px;
  height: 14px;
  color: var(--ink-3);
}

/* ════════════════════════════════════════
   TOOL GRID — equal rhythm cards
   ════════════════════════════════════════ */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-3);
}
.tools-group {
  margin-bottom: var(--space-7);
  grid-column: 1 / -1;
}
.tools-group-head {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
}
.section-title,
.tools-group h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.tools-group-sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ink-3);
  max-width: 40em;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 152px;
  padding: 18px;
  text-align: left;
  color: inherit;
  cursor: pointer;
  background: var(--sheet-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s;
}
.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--ink) 18%, var(--line-2));
}
.tool-card:active { transform: translateY(0); }
.tool-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.tool-card .icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  color: var(--ink-2);
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tool-card:hover .icon {
  background: var(--seal-soft);
  color: var(--seal);
  border-color: color-mix(in srgb, var(--seal) 25%, var(--line));
}
.tool-card h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.tool-card p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tool-card .meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
}
.badge-local {
  color: var(--ok);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.meta-short {
  font-weight: 500;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fil-icon { display: inline-flex; line-height: 0; color: inherit; }
.fil-icon svg { width: 20px; height: 20px; display: block; }
.tool-card .icon .fil-icon svg { width: 18px; height: 18px; }

.empty-state {
  grid-column: 1 / -1;
  padding: var(--space-7) var(--space-5);
  text-align: center;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--sheet);
}
.empty-state .empty-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--bg-deep);
  color: var(--ink-3);
  border: 1px solid var(--line);
}
.empty-state .empty-icon svg { width: 20px; height: 20px; }
.empty-state strong { color: var(--ink); }
.muted { color: var(--ink-3); font-size: 13px; }
.empty { text-align: center; color: var(--ink-3); padding: 24px; }

/* ════════════════════════════════════════
   TOOL WORKSPACE — task-focused column
   ════════════════════════════════════════ */
.tool-shell {
  max-width: var(--tool-width);
  margin: 0 auto;
}
.tool-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px 0 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line-2);
  background: var(--sheet-2);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: color 0.15s, border-color 0.15s, transform 0.15s;
}
.back-btn:hover {
  color: var(--ink);
  border-color: var(--ink-3);
  transform: translateY(-1px);
}
.tool-chrome-trail {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tool-pill {
  height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: var(--radius-full);
  background: var(--bg-deep);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.tool-local-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ok);
}

.tool-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--line);
}
.tool-icon-lg {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--sheet-2);
  border: 1px solid var(--line-2);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}
.tool-icon-lg svg { width: 24px; height: 24px; }
.tool-titles h1 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.tool-titles p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.5;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ════════════════════════════════════════
   COMPONENTS — shared UI primitives
   ════════════════════════════════════════ */
.panel {
  background: var(--sheet-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.panel h3 {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.dropzone {
  position: relative;
  border: 1.5px dashed var(--line-2);
  border-radius: 16px;
  background: var(--sheet-2);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.dropzone:hover,
.dropzone.is-drag {
  border-style: solid;
  border-color: var(--seal);
  background: color-mix(in srgb, var(--sheet-2) 90%, #fff);
  box-shadow: 0 0 0 4px var(--seal-soft), var(--shadow-sm);
}
.dropzone .dz-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.dropzone .dz-icon svg { width: 24px; height: 24px; }
.dropzone:hover .dz-icon {
  color: var(--seal);
  background: var(--seal-soft);
  border-color: color-mix(in srgb, var(--seal) 30%, var(--line));
}
.dropzone h3 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--ink);
}
.dropzone p { margin: 0; color: var(--ink-2); font-size: 14px; }
.dropzone .hint {
  margin-top: 12px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 140px; }
.field label { font-size: 12px; font-weight: 650; color: var(--ink-2); }
.field input,
.field select,
.field textarea {
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--sheet);
  padding: 0 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea {
  height: auto;
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: color-mix(in srgb, var(--seal) 40%, var(--line-2));
  box-shadow: 0 0 0 3px var(--seal-soft);
}
.field.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: auto;
  height: 40px;
}
.field.checkbox input {
  width: 15px;
  height: 15px;
  accent-color: var(--seal);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-full);
  border: 0;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--ink);
  color: var(--sheet-2);
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn-secondary {
  background: var(--sheet-2);
  color: var(--ink);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--ink-3);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--bg-deep); color: var(--ink); }
.btn-danger {
  background: rgba(155, 58, 58, 0.08);
  color: var(--danger);
  border: 1px solid rgba(155, 58, 58, 0.2);
}
.btn-curve { /* alias */ }
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--sheet);
  border: 1px solid var(--line);
}
.file-item .fi-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--sheet-2);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-2);
}
.file-item .fi-meta { flex: 1; min-width: 0; }
.file-item .fi-name {
  font-weight: 650;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-item .fi-sub { font-size: 11.5px; color: var(--ink-3); }
.file-item .fi-actions { display: flex; gap: 2px; }
.icon-mini {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.icon-mini:hover { background: var(--sheet-2); color: var(--ink); }

.file-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--sheet-2);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-xs);
}
.file-chip-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.04em;
  background: var(--bg-deep);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.file-chip-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-chip-meta strong {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-chip-meta span { font-size: 11px; color: var(--ink-3); }

.progress-wrap {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--sheet-2);
  box-shadow: var(--shadow-xs);
}
.progress-bar {
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--bg-deep);
  overflow: hidden;
}
.progress-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--seal);
  transition: width 0.25s var(--ease);
}
.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 650;
}

.result-card,
.result-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--sheet-2);
  border: 1px solid color-mix(in srgb, var(--ok) 28%, var(--line));
  box-shadow: var(--shadow-sm);
}
.result-bar {
  position: sticky;
  bottom: 12px;
  z-index: 30;
}
.result-bar-icon,
.result-card .rc-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ok-soft);
  color: var(--ok);
  font-weight: 700;
  flex-shrink: 0;
}
.result-bar-body,
.result-card .rc-body { flex: 1; min-width: 140px; }
.result-bar-body strong,
.result-card h4 {
  margin: 0 0 2px;
  font-size: 13.5px;
  font-weight: 700;
}
.result-bar-body span,
.result-card p {
  margin: 0;
  font-size: 12px;
  color: var(--ink-2);
}
.result-bar-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.steps-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 4px;
}
.step-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-3);
}
.step-pill .step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  color: var(--ink-3);
}
.step-pill.is-active { color: var(--ink); }
.step-pill.is-active .step-num {
  background: var(--ink);
  color: var(--sheet-2);
  border-color: transparent;
}
.step-pill.is-done { color: var(--ok); }
.step-pill.is-done .step-num {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: transparent;
}
.step-line {
  width: 16px;
  height: 1px;
  background: var(--line);
}

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-full);
  background: var(--bg-deep);
  border: 1px solid var(--line);
  gap: 2px;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  padding: 7px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-weight: 650;
  font-size: 12.5px;
}
.seg button.is-active {
  background: var(--sheet-2);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.mode-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.mode-card {
  text-align: left;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: var(--sheet);
  cursor: pointer;
  color: inherit;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.mode-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.mode-card.is-active {
  border-color: color-mix(in srgb, var(--seal) 45%, var(--line));
  background: var(--seal-soft);
  box-shadow: 0 0 0 3px var(--seal-soft);
}
.mode-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.mode-card-top strong { font-size: 13px; font-weight: 700; }
.mode-card p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-2);
}
.mode-badge {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--ink);
  color: var(--sheet-2);
}
.mode-badge-alt {
  background: var(--sheet-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.preset-btn {
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--sheet);
  cursor: pointer;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-xs);
}
.preset-btn strong { font-size: 13px; font-weight: 700; }
.preset-btn span { font-size: 11px; color: var(--ink-3); line-height: 1.3; }
.preset-btn:hover { border-color: var(--ink-3); }
.preset-btn.is-active {
  border-color: color-mix(in srgb, var(--seal) 45%, var(--line));
  background: var(--seal-soft);
  box-shadow: 0 0 0 3px var(--seal-soft);
}

.callout {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--sheet);
  border: 1px solid var(--line);
}
.callout p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.45;
}
.callout-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--bg-deep);
  color: var(--ink-3);
  border: 1px solid var(--line);
}
.callout-ok {
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 25%, var(--line));
}
.callout-ok .callout-icon { color: var(--ok); border-color: transparent; background: color-mix(in srgb, var(--ok) 12%, var(--sheet)); }
.callout-warn {
  background: rgba(166, 124, 42, 0.1);
  border-color: rgba(166, 124, 42, 0.25);
}

.filmstrip-wrap { padding: 14px; min-width: 0; }
.filmstrip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.filmstrip-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.filmstrip-head h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.filmstrip-count {
  font-size: 12px;
  font-weight: 650;
  color: var(--seal);
}
.filmstrip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}
.film-card {
  position: relative;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--sheet);
  overflow: hidden;
  cursor: grab;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s, opacity 0.15s;
}
.film-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.film-card.is-selected {
  border-color: var(--film-tint, var(--seal));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--film-tint, var(--seal)) 28%, transparent);
}
.film-card:not(.is-selected) {
  opacity: 0.55;
}
.film-card:not(.is-selected) .film-thumb {
  filter: grayscale(0.35);
}
.film-card.is-focus {
  outline: 2px solid var(--ink-2);
  outline-offset: 2px;
}
.film-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--film-tint, var(--seal));
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.film-ord {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(20, 16, 12, 0.72);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.film-thumb {
  aspect-ratio: 3/4;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.film-thumb canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.film-placeholder {
  font-family: var(--display);
  font-size: 18px;
  color: #ccc;
}
.film-bar {
  padding: 6px 8px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-weight: 650;
  color: var(--ink-2);
}
.film-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.film-check {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  min-width: 0;
}
.film-check input {
  accent-color: var(--seal);
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.film-ghost { opacity: 0.4; }
.film-chosen { cursor: grabbing; }
.film-drag { opacity: 0.92; }

/* Merge / organize workspace: filmstrip + live preview */
.merge-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.9fr);
  gap: 14px;
  align-items: start;
}
@media (max-width: 860px) {
  .merge-workspace {
    grid-template-columns: 1fr;
  }
}
.live-preview {
  padding: 14px;
  position: sticky;
  top: 12px;
}
.live-preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.live-preview-head h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.live-preview-meta {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-preview-body {
  background: #f4f1ea;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 10px;
  overflow: auto;
}
.live-preview-canvas {
  max-width: 100%;
  height: auto;
  box-shadow: var(--shadow-sm);
  background: #fff;
}

/* Stats + next-step assists */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 10px;
}
.stat-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--sheet);
  min-width: 72px;
}
.stat-val {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}
.stat-lab {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.next-steps {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--sheet) 88%, var(--seal-soft));
}
.next-steps-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.next-steps-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.next-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--sheet);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
a.next-chip { color: inherit; }
.next-chip:hover {
  border-color: var(--seal);
  box-shadow: var(--shadow-xs);
  transform: translateY(-1px);
}
button.next-chip {
  font: inherit;
}

/* Before / After quality compare (compress, etc.) */
.ba-compare-host { margin: 8px 0 12px; }
.ba-compare { padding: 14px; }
.ba-compare h3 {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.ba-compare-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}
@media (max-width: 640px) {
  .ba-compare-row { grid-template-columns: 1fr; }
}
.ba-side {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f4f1ea;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.ba-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--seal);
}
.ba-canvas {
  width: 100%;
  height: auto;
  background: #fff;
  box-shadow: var(--shadow-xs);
  border-radius: 2px;
}
.ba-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
}
.thumb {
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--sheet-2);
  overflow: hidden;
  cursor: grab;
  box-shadow: var(--shadow-xs);
}
.thumb.selected {
  outline: 2px solid var(--seal);
  border-color: transparent;
}
.thumb canvas,
.thumb img {
  width: 100%;
  height: auto;
  background: #fff;
}
.thumb .t-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 650;
  color: var(--ink-2);
}
.sortable-ghost { opacity: 0.35; }

.page-canvas-wrap { padding: 12px; }
.page-canvas-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.page-canvas-stage {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #fff;
  touch-action: none;
  border: 1px solid var(--line-2);
}
.page-canvas,
.page-canvas-overlay {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}
.page-canvas-overlay {
  position: absolute;
  left: 0;
  top: 0;
  cursor: crosshair;
}

.sig-pad {
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: crosshair;
  touch-action: none;
  width: 100%;
  max-width: 480px;
  height: 160px;
  box-shadow: var(--shadow-xs);
}

.batch-queue h3 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.batch-list { display: flex; flex-direction: column; gap: 8px; }
.batch-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--sheet);
  border: 1px solid var(--line);
}
.batch-status {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  background: var(--bg-deep);
  color: var(--ink-3);
  border: 1px solid var(--line);
}
.batch-running .batch-status {
  color: var(--seal);
  background: var(--seal-soft);
  border-color: transparent;
}
.batch-done .batch-status {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: transparent;
}
.batch-error .batch-status {
  color: var(--danger);
  background: rgba(155, 58, 58, 0.1);
  border-color: transparent;
}
.batch-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.batch-meta strong {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.batch-meta span { font-size: 11px; color: var(--ink-3); }

.convert-preview .convert-preview-body {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 0 0;
}
.convert-preview canvas {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  background: #fff;
}
.preview-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--sheet);
  padding: 12px;
  overflow: auto;
  max-height: 420px;
}
.preview-box canvas {
  margin: 0 auto;
  box-shadow: var(--shadow-xs);
}
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--seal); }
.range-val {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
  min-width: 44px;
  text-align: right;
}
.split-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.seo-block {
  margin-top: var(--space-8);
  padding: var(--space-6);
  background: var(--sheet-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.seo-block h2 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 500;
}
.seo-block h3 {
  margin: 22px 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.seo-block p,
.seo-block li {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.6;
}
.seo-block ul { padding-left: 18px; }
.faq details {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 14px;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq details p { margin: 8px 0 0; }

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  margin-top: var(--space-6);
}
.footer-inner {
  max-width: var(--content);
  margin: 0 auto;
  padding: var(--space-5) var(--space-5) var(--space-7);
  text-align: center;
}
.footer-brand {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--ink-2);
}
.footer-brand strong { color: var(--ink); font-weight: 700; }
.footer-meta {
  margin: 0;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

/* Modals */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(36, 28, 21, 0.35);
  backdrop-filter: blur(4px);
}
[data-theme="dark"] .modal-backdrop { background: rgba(0, 0, 0, 0.55); }
.modal.panel,
.cmdk.panel {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  max-height: min(80vh, 600px);
  overflow: auto;
  box-shadow: var(--shadow-md);
  animation: fade 0.2s var(--ease);
  background: var(--sheet-2);
  border: 1px solid var(--line-2);
  border-radius: 16px;
}
.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--sheet);
  color: var(--ink-2);
  cursor: pointer;
}
.privacy-list {
  padding-left: 18px;
  color: var(--ink-2);
}
.privacy-list li { margin-bottom: 8px; }

.cmdk { padding: 0 !important; overflow: hidden; display: flex; flex-direction: column; }
.cmdk-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.cmdk-input-row input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 15px;
  height: 28px;
}
.cmdk-input-row kbd {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
  background: var(--sheet);
}
.cmdk-list {
  overflow: auto;
  max-height: 400px;
  padding: 6px;
}
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.cmdk-item:hover,
.cmdk-item.is-active { background: var(--bg-deep); }
.cmdk-item .ci-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--sheet);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.cmdk-item .ci-icon svg { width: 18px; height: 18px; }
.cmdk-item .ci-title {
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: -0.015em;
}
.cmdk-item .ci-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  font-family: var(--mono);
}

.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(340px, calc(100vw - 32px));
}
.toast {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--sheet-2);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 650;
  animation: fade 0.2s var(--ease);
}
.toast.ok { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.toast.err { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid color-mix(in srgb, var(--sheet-2) 30%, transparent);
  border-top-color: var(--sheet-2);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.fil-docx-render-root,
.fil-docx-render-root .docx-wrapper {
  background: #fff !important;
  color: #000 !important;
}
.fil-docx-render-root section.docx {
  background: #fff !important;
  box-shadow: none !important;
  margin: 0 !important;
}

.btn:focus-visible,
.tool-card:focus-visible,
.mode-card:focus-visible,
.preset-btn:focus-visible,
.cat-tab:focus-visible,
.icon-btn:focus-visible,
.dropzone:focus-within,
.chip:focus-visible,
.back-btn:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 2px;
}

.noscript-banner {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-2);
}

@media (max-width: 720px) {
  .topbar-inner {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding: 0 14px;
  }
  .brand-tag { display: none; }
  .search-kbd { display: none; }
  main { padding: 24px 14px 64px; }
  .split-view { grid-template-columns: 1fr; }
  .hero-meta { width: 100%; }
  .hero-meta-item { flex: 1; min-width: 0; padding: 12px 14px; }
  .result-bar { border-radius: 14px; }
  .actions .btn-primary { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .view,
  .tool-card,
  .toast {
    animation: none !important;
  }
  .tool-card:hover,
  .chip:hover,
  .btn:hover:not(:disabled),
  .back-btn:hover,
  .icon-btn:hover {
    transform: none;
  }
}
