:root {
  color-scheme: dark;
  --ink: #111512;
  --surface: #181d19;
  --surface-2: #202621;
  --line: #343b35;
  --text: #f5f7f3;
  --muted: #a8b0a9;
  --lime: #c7ff4a;
  --lime-dark: #8cbd1f;
  --coral: #ff7a66;
  --amber: #ffbe55;
  --sky: #5cd6ff;
  --violet: #c08bff;
  --danger: #ff8d7d;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--ink);
  color: var(--text);
}

* { box-sizing: border-box; }
[hidden]:not([hidden="until-found"]) { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--ink);
  accent-color: var(--lime);
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
[tabindex="-1"]:focus { outline: none; }

/* Progressive enhancement fallback for browsers without accent-color (brand-consistent-forms) */
@supports not (accent-color: var(--lime)) {
  input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
  }
  input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, var(--lime) var(--progress, 80%), #343b35 var(--progress, 80%));
    border-radius: 4px;
  }
  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--lime);
    cursor: pointer;
    margin-top: -4px;
  }
  input[type="range"]::-moz-range-track {
    width: 100%;
    height: 8px;
    background: #343b35;
    border-radius: 4px;
  }
  input[type="range"]::-moz-range-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--lime);
    cursor: pointer;
  }
  input[type="range"]::-moz-range-progress {
    background-color: var(--lime);
    height: 8px;
    border-radius: 4px;
  }
}

.site-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: -.04em; font-size: 1.2rem; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--lime); color: var(--ink); font-weight: 900; }
.privacy-note { display: flex; align-items: center; gap: 9px; font-size: .84rem; color: var(--muted); }
.privacy-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 5px rgba(199,255,74,.1); }

/* Studio Switcher Tabs with CSS Anchor Positioning (anchor-positioning-tab-underline) */
.studio-nav { display: flex; align-items: center; }
.studio-tabs {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.studio-tabs::before {
  content: "";
  position: absolute;
  position-anchor: --active;
  inset-block-start: calc(anchor(bottom) + .1lh);
  inset-inline-start: anchor(left);
  inset-inline-end: anchor(right);
  block-size: .16lh;
  background: var(--lime);
  border-radius: 99px;
  pointer-events: none;
  @media (prefers-reduced-motion: no-preference) {
    transition: inset .2s;
  }
}
.studio-tab-item { margin: 0; border-radius: 10px; }
.studio-tab-item.active {
  anchor-name: --active;
  @supports not (position-anchor: auto) {
    border-bottom: .16lh var(--lime) solid;
  }
}
.studio-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: .83rem;
  font-weight: 750;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.studio-tab-btn:hover, .studio-tab-btn:focus-visible {
  color: var(--text);
  outline: none;
}
.studio-tab-item.active .studio-tab-btn {
  background: var(--surface-2);
  color: var(--text);
}
.studio-tab-item.active .studio-tab-btn svg {
  color: var(--lime);
}
.tab-pill {
  font-size: .66rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(199, 255, 74, .14);
  color: var(--lime);
}
.tab-pill-pdf {
  background: rgba(255, 122, 102, .16);
  color: var(--coral);
}

/* Route History, Back Button & Direct Section Link Bar */
.route-bar {
  width: min(1180px, calc(100% - 48px));
  margin: 14px auto 0;
  padding: 9px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.route-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.back-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: .75rem;
  font-weight: 750;
  cursor: pointer;
  transition: .18s;
}
.back-nav-btn:hover:not(:disabled) {
  border-color: var(--lime);
  color: var(--lime);
}
.back-nav-btn:disabled {
  opacity: .38;
  cursor: default;
}
.route-breadcrumbs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .76rem;
  color: var(--muted);
}
.route-breadcrumbs li + li::before {
  content: "/";
  margin-right: 7px;
  color: #545d55;
}
.route-breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 650;
}
.route-breadcrumbs a:hover {
  color: var(--text);
  text-decoration: underline;
}
.route-breadcrumbs span {
  color: var(--lime);
  font-weight: 750;
}
.route-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.route-slug {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .73rem;
  color: var(--muted);
  background: #131713;
  border: 1px solid var(--line);
  padding: 4px 9px;
  border-radius: 7px;
}
.copy-link-btn {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: .72rem;
  font-weight: 750;
  cursor: pointer;
  transition: .18s;
}
.copy-link-btn:hover {
  border-color: var(--lime);
  color: var(--lime);
}

main { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.studio-inner { width: 100%; }

.intro { display: grid; grid-template-columns: 1fr .82fr; gap: 44px; align-items: end; padding: 48px 0 38px; position: relative; }
.eyebrow, .step-label { color: var(--muted); text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 800; margin: 0 0 16px; }
.eyebrow::before { content: ""; display: inline-block; width: 26px; height: 2px; background: var(--lime); margin: 0 10px 3px 0; }
.pdf-eyebrow::before { background: var(--coral); }
h1, .hero-h1 { font-size: clamp(2.8rem, 6.4vw, 5.7rem); line-height: .92; letter-spacing: -.075em; margin: 0; max-width: 850px; font-weight: 850; width: fit-content; }
h1 span, .hero-h1 span { color: var(--lime); }
.intro-copy { font-size: 1.02rem; line-height: 1.65; color: var(--muted); max-width: 510px; margin: 0 0 14px; }
.advantage-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.advantage-pills span {
  font-size: .72rem;
  font-weight: 750;
  padding: 5px 10px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
}

/* PDF Command Bar: Category Pills + Instant Search */
.pdf-Command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.pdf-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.cat-pill {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
  border-radius: 99px;
  padding: 7px 13px;
  font-size: .76rem;
  font-weight: 750;
  cursor: pointer;
  transition: .18s;
}
.cat-pill:hover {
  color: var(--text);
  border-color: #555e56;
}
.cat-pill.active {
  background: var(--lime);
  color: var(--ink);
  border-color: var(--lime);
}
.pdf-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  min-width: 260px;
  flex: 0 1 300px;
}
.pdf-search-box:focus-within {
  border-color: var(--lime);
  color: var(--text);
}
.pdf-search-box input {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: .79rem;
  width: 100%;
  outline: none;
}

/* 16-Tool Selector Grid */
.pdf-tools-ribbon { margin-bottom: 24px; }
.pdf-tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.pdf-tool-card {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.pdf-tool-card:hover, .pdf-tool-card:focus-visible {
  border-color: #59635a;
  background: var(--surface-2);
  transform: translateY(-2px);
  outline: none;
}
.pdf-tool-card.active {
  border-color: var(--lime);
  background: linear-gradient(180deg, rgba(199, 255, 74, .09), rgba(32, 38, 33, .96));
  box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
}
.pdf-tool-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(199, 255, 74, .14);
  color: var(--lime);
}
.pdf-tool-icon[data-accent="coral"] { background: rgba(255, 122, 102, .15); color: var(--coral); }
.pdf-tool-icon[data-accent="amber"] { background: rgba(255, 190, 85, .15); color: var(--amber); }
.pdf-tool-icon[data-accent="lime"] { background: rgba(199, 255, 74, .15); color: var(--lime); }
.pdf-tool-icon[data-accent="sky"] { background: rgba(92, 214, 255, .15); color: var(--sky); }
.pdf-tool-icon[data-accent="violet"] { background: rgba(192, 139, 255, .15); color: var(--violet); }
.pdf-tool-meta { min-width: 0; }
.pdf-tool-meta strong { display: block; font-size: .86rem; font-weight: 800; letter-spacing: -.01em; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdf-tool-meta small { display: block; font-size: .71rem; color: var(--muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.workspace { display: grid; grid-template-columns: minmax(320px, .82fr) minmax(460px, 1.18fr); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: var(--surface); box-shadow: 0 36px 90px rgba(0,0,0,.25); }
.controls-card { padding: 28px; border-right: 1px solid var(--line); }
.step-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.step-head-row .step-label { margin-bottom: 0; }
.step-label span { color: var(--lime); margin-right: 9px; }
.sample-btn {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--lime);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: .72rem;
  font-weight: 750;
  cursor: pointer;
  transition: .18s;
}
.sample-btn:hover { border-color: var(--lime); background: rgba(199, 255, 74, .09); }

.drop-zone { width: 100%; min-height: 195px; border: 1.5px dashed #596159; border-radius: 16px; background: #131713; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; transition: .2s ease; padding: 22px; }
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.dragging { border-color: var(--lime); background: rgba(199,255,74,.035); outline: none; transform: translateY(-2px); }
.upload-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; background: var(--lime); color: var(--ink); margin-bottom: 3px; }
.drop-zone strong { font-size: 1.06rem; }
.drop-zone > span:not(.upload-icon) { color: var(--muted); font-size: .86rem; }
.drop-zone u { color: var(--text); text-underline-offset: 3px; }
.drop-zone .formats { margin-top: 10px; font-size: .67rem !important; letter-spacing: .06em; }

/* Source Queue inside PDF Controls */
.pdf-queue-wrap {
  margin-top: 16px;
  padding: 12px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: #131713;
}
.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .74rem;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 9px;
}
.text-link-btn {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-size: .74rem;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}
.text-link-btn:hover { text-decoration: underline; }
.pdf-source-list {
  display: grid;
  gap: 7px;
  max-height: 165px;
  overflow: auto;
}
.source-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.source-thumb {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  background: #101310;
  border: 1px solid #2e352f;
}
.source-meta { min-width: 0; }
.source-name {
  margin: 0 0 2px;
  font-size: .77rem;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.source-sub {
  font-size: .68rem;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: center;
}
.source-badge { color: var(--lime); font-weight: 700; }
.source-controls { display: inline-flex; align-items: center; gap: 4px; }
.mini-icon-btn {
  width: 25px;
  height: 25px;
  border-radius: 6px;
  border: 1px solid #454d46;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: .72rem;
  cursor: pointer;
  transition: .15s;
}
.mini-icon-btn:hover:not(:disabled) {
  border-color: var(--lime);
  color: var(--text);
  background: rgba(199, 255, 74, .08);
}
.mini-icon-btn:disabled { opacity: .3; cursor: default; }
.mini-icon-btn.remove:hover { border-color: var(--danger); color: var(--danger); background: rgba(255, 141, 125, .1); }

/* Interactive Visual Page Workbench */
.page-workbench {
  margin-top: 14px;
  padding: 12px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: #131713;
}
.workbench-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: .74rem;
  color: var(--muted);
  font-weight: 750;
  margin-bottom: 10px;
}
.workbench-head strong { color: var(--lime); }
.workbench-actions { display: flex; gap: 6px; }
.mini-pill-btn {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 7px;
  padding: 3px 8px;
  font-size: .69rem;
  font-weight: 700;
  cursor: pointer;
}
.mini-pill-btn:hover { border-color: var(--lime); color: var(--lime); }
.workbench-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding-right: 2px;
}
.wb-page-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.wb-thumb-wrap {
  width: 100%;
  height: 76px;
  display: grid;
  place-items: center;
  background: #101310;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.wb-thumb {
  max-width: 100%;
  max-height: 72px;
  object-fit: contain;
  transition: transform .2s ease;
}
.wb-page-num {
  font-size: .68rem;
  font-weight: 750;
  color: var(--muted);
}
.wb-controls {
  display: flex;
  gap: 3px;
  width: 100%;
  justify-content: center;
}
.wb-btn {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1px solid #414942;
  background: transparent;
  color: var(--muted);
  font-size: .65rem;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.wb-btn:hover:not(:disabled) { border-color: var(--lime); color: var(--lime); }
.wb-btn.danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }
.wb-btn:disabled { opacity: .3; cursor: default; }

.settings { margin-top: 24px; }
.quality-row { display: flex; justify-content: space-between; font-size: .88rem; font-weight: 700; }
.quality-row output { color: var(--lime); }
.range { width: 100%; accent-color: var(--lime); margin: 12px 0 3px; }
.range-labels { display: flex; justify-content: space-between; color: #798079; font-size: .7rem; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; padding-top: 20px; margin-top: 18px; border-top: 1px solid var(--line); cursor: pointer; }
.toggle-row.compact-toggle { padding-top: 14px; margin-top: 14px; }
.toggle-row strong { display: block; font-size: .86rem; }
.toggle-row small { display: block; color: var(--muted); margin-top: 3px; font-size: .73rem; }
.switch { position: relative; width: 42px; height: 24px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; background: #3d443e; border-radius: 30px; transition: .2s; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; background: white; border-radius: 50%; top: 3px; left: 3px; transition: .2s; }
.switch input:focus-visible + span { outline: 2px solid var(--lime); outline-offset: 3px; }
.switch input:checked + span { background: var(--lime); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--ink); }
.resize-fields { margin-top: 16px; }
.resize-fields label, .field-label { display: block; color: var(--muted); font-size: .74rem; font-weight: 650; margin-bottom: 6px; }
.input-suffix { display: flex; align-items: center; border: 1px solid var(--line); background: #131713; border-radius: 9px; overflow: hidden; }
.input-suffix:focus-within { border-color: var(--lime); }
.input-suffix input { flex: 1; min-width: 0; padding: 10px 12px; color: var(--text); border: 0; background: transparent; outline: none; font-size: .83rem; }
.input-suffix span { color: var(--muted); padding-right: 12px; font-size: .78rem; }
.config-hint { margin: 10px 0 0; font-size: .74rem; color: var(--muted); line-height: 1.48; }

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: #131713;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 14px;
}
.seg-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 7px;
  font-size: .77rem;
  font-weight: 750;
  cursor: pointer;
  transition: .18s;
}
.seg-btn.active { background: var(--surface-2); color: var(--lime); }

.compress-presets { display: grid; gap: 8px; }
.preset-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #131713;
  cursor: pointer;
  transition: .18s;
}
.preset-option:hover { border-color: #525b53; }
.preset-option:has(input:checked) {
  border-color: var(--lime);
  background: rgba(199, 255, 74, .05);
}
.preset-option input { accent-color: var(--lime); margin: 0; }
.preset-body strong { display: block; font-size: .82rem; margin-bottom: 2px; }
.preset-body small { display: block; font-size: .71rem; color: var(--muted); }
.preset-badge {
  font-size: .65rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--muted);
}
.preset-badge-lime { background: rgba(199, 255, 74, .15); color: var(--lime); }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-row-top { margin-top: 12px; }
.select-input {
  width: 100%;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #131713;
  color: var(--text);
  font-size: .81rem;
  outline: none;
}
.select-input:focus-visible { border-color: var(--lime); }

.code-textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #131713;
  color: var(--text);
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .77rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
}
.code-textarea:focus-visible { border-color: var(--lime); }

/* Signature Pad */
.sig-pad-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.sig-pad-header .field-label { margin-bottom: 0; }
.sig-canvas {
  width: 100%;
  height: 110px;
  background: #ffffff;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  cursor: crosshair;
  touch-action: none;
}

.primary-process-btn {
  margin-top: 20px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 13px 18px;
  background: var(--lime);
  color: var(--ink);
  font-size: .9rem;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  transition: transform .18s, background .18s, opacity .18s;
}
.primary-process-btn:hover:not(:disabled) {
  background: #dcff8d;
  transform: translateY(-1px);
}
.primary-process-btn:disabled { opacity: .5; cursor: not-allowed; }

.results-card { padding: 28px; min-height: 600px; display: flex; flex-direction: column; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.results-head .step-label { margin-bottom: 6px; }
.results-head h2 { margin: 0; font-size: 1.22rem; letter-spacing: -.025em; }
.results-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chain-action {
  border: 1px solid rgba(199, 255, 74, .45);
  background: rgba(199, 255, 74, .1);
  color: var(--lime);
  border-radius: 10px;
  padding: 9px 13px;
  font-size: .77rem;
  font-weight: 800;
  cursor: pointer;
  transition: .2s;
}
.chain-action:hover { background: rgba(199, 255, 74, .2); border-color: var(--lime); }
.secondary-action {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 10px;
  padding: 9px 13px;
  font-size: .77rem;
  font-weight: 750;
  cursor: pointer;
  transition: .2s;
}
.secondary-action:hover { color: var(--text); border-color: #5b645c; }
.download-all { border: 0; background: var(--lime); color: var(--ink); border-radius: 10px; padding: 10px 14px; font-size: .79rem; font-weight: 800; display: flex; align-items: center; gap: 7px; cursor: pointer; transition: .2s; }
.download-all:hover { background: #dcff8d; transform: translateY(-1px); }
.empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 410px; }
.empty-state h2 { margin: 26px 0 8px; font-size: 1.15rem; }
.empty-state p { max-width: 360px; color: var(--muted); line-height: 1.6; font-size: .87rem; margin: 0; }
.empty-visual { height: 96px; display: flex; align-items: center; position: relative; color: var(--lime); }
.file-card { width: 76px; height: 90px; border-radius: 10px; display: grid; place-items: end center; padding-bottom: 15px; border: 1px solid #4c544d; background: #242a25; color: var(--muted); font-size: .68rem; font-weight: 900; letter-spacing: .08em; box-shadow: 0 14px 32px rgba(0,0,0,.3); }
.file-back { transform: rotate(-8deg) translateX(13px); }
.file-front { border-color: var(--lime); color: var(--lime); transform: rotate(5deg) translateX(-5px); }
.empty-visual svg { margin-left: 12px; }
.summary { padding: 18px 0 14px; }
.summary > div:first-child { display: flex; justify-content: space-between; font-size: .77rem; color: var(--muted); }
.summary strong { color: var(--lime); }
.summary-track { height: 4px; background: #2f3530; border-radius: 4px; overflow: hidden; margin-top: 9px; }
.summary-track span { display: block; height: 100%; width: 0; background: var(--lime); border-radius: 4px; transition: width .35s; }
.result-list { display: grid; gap: 10px; overflow: auto; max-height: 440px; padding-right: 3px; }
.result-item { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px; animation: enter .28s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: #101310; }
.file-info { min-width: 0; }
.file-name { font-size: .85rem; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 0 7px; }
.file-meta { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; color: var(--muted); font-size: .72rem; }
.saving { color: var(--lime); font-weight: 750; }
.file-error { color: var(--danger); }
.item-action { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #505851; border-radius: 9px; background: transparent; cursor: pointer; transition: .2s; }
.item-action:hover { color: var(--ink); border-color: var(--lime); background: var(--lime); }
.item-action:disabled { cursor: wait; opacity: .4; }

/* Extracted Text Preview Panel */
.extracted-text-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #131713;
  padding: 12px;
}
.extracted-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .74rem;
  font-weight: 750;
  color: var(--muted);
  margin-bottom: 8px;
}
#extracted-text-output {
  margin: 0;
  max-height: 210px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .74rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
}

.details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 90px 0 70px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.details article { padding: 34px 34px 38px 0; }
.details article + article { border-left: 1px solid var(--line); padding-left: 34px; }
.details span { color: var(--lime); font-size: .72rem; font-weight: 800; }
.details h3 { font-size: 1rem; margin: 16px 0 8px; }
.details p { color: var(--muted); font-size: .85rem; line-height: 1.6; margin: 0; max-width: 310px; }

footer {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 48px;
  color: #767d77;
  font-size: .78rem;
}
.footer-brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
footer span { color: var(--text); font-weight: 800; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: .74rem;
  font-weight: 600;
  transition: color .15s;
}
.footer-links a:hover {
  color: var(--lime);
  text-decoration: underline;
}

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); padding: 11px 16px; border-radius: 9px; background: var(--text); color: var(--ink); font-weight: 700; font-size: .82rem; opacity: 0; pointer-events: none; transition: .25s; z-index: 5; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1040px) {
  .pdf-tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .site-header { flex-wrap: wrap; padding: 14px 0; }
  .intro { grid-template-columns: 1fr; padding-top: 42px; gap: 22px; }
  .workspace { grid-template-columns: 1fr; }
  .controls-card { border-right: 0; border-bottom: 1px solid var(--line); }
  .results-card { min-height: 520px; }
  .details { margin: 72px 0 56px; }
  .pdf-tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .site-header, .route-bar, main, footer { width: min(100% - 28px, 1180px); }
  .site-header { min-height: 70px; }
  .privacy-note { display: none; }
  .studio-nav { width: 100%; }
  .studio-tabs { width: 100%; justify-content: stretch; }
  .studio-tab-item { flex: 1; }
  .studio-tab-btn { width: 100%; justify-content: center; }
  .intro { padding: 34px 0 26px; }
  h1, .hero-h1 { font-size: clamp(2.5rem, 12vw, 3.9rem); }
  .intro-copy { font-size: .95rem; }
  .pdf-tool-grid { grid-template-columns: 1fr; }
  .workspace { border-radius: 16px; }
  .controls-card, .results-card { padding: 20px; }
  .drop-zone { min-height: 185px; }
  .results-card { min-height: 480px; }
  .results-head { align-items: flex-end; }
  .download-all { font-size: 0; padding: 10px; }
  .download-all svg { width: 20px; height: 20px; }
  .result-item { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; }
  .thumb { width: 48px; height: 48px; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .details { grid-template-columns: 1fr; }
  .details article, .details article + article { padding: 27px 0; border-left: 0; }
  .details article + article { border-top: 1px solid var(--line); }
  .footer-brand-row { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
