/* ipynbtopdfscanner — app shell */

:root {
  --bg: #f6f4ef;
  --bg-2: #efece4;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #1b1b1f;
  --ink-2: #45454f;
  --muted: #6e6e7a;
  --line: #e4e0d6;
  --line-2: #d6d1c4;
  --accent: #e8590c;
  --accent-2: #c94a06;
  --accent-soft: #fdeadf;
  --accent-ink: #ffffff;
  --accent-text: #b8460a;   /* orange for small text: 4.9:1 on the page */
  --btn-bg: #c2410c;        /* white text on it: 5.2:1 */
  --btn-bg-hover: #a8380a;
  --ok: #2f9e44;
  --danger: #d6336c;
  --shadow: 0 1px 2px rgba(30, 25, 15, 0.06), 0 8px 24px rgba(30, 25, 15, 0.08);
  --shadow-lg: 0 24px 64px rgba(30, 25, 15, 0.18);
  --paper-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 10px 30px rgba(40, 30, 10, 0.12);
  --gap-bg: #e9e6df;
  --gap-ink: #8a857a;
  --radius: 14px;
  --top-h: 58px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141417; --bg-2: #1b1b20; --surface: #1e1e23; --surface-2: #232329;
    --ink: #ededf0; --ink-2: #c9c9d1; --muted: #9a9aa6; --line: #2c2c34; --line-2: #3a3a44;
    --accent: #ff7a33; --accent-2: #ff8f52; --accent-soft: #3a2418; --accent-ink: #1a0d05;
    --accent-text: #ff8a4c; --btn-bg: #ff7a33; --btn-bg-hover: #ff8f52;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
    --paper-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 12px 36px rgba(0, 0, 0, 0.55);
    --gap-bg: #0f0f12; --gap-ink: #77778a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141417; --bg-2: #1b1b20; --surface: #1e1e23; --surface-2: #232329;
  --ink: #ededf0; --ink-2: #c9c9d1; --muted: #9a9aa6; --line: #2c2c34; --line-2: #3a3a44;
  --accent: #ff7a33; --accent-2: #ff8f52; --accent-soft: #3a2418; --accent-ink: #1a0d05;
    --accent-text: #ff8a4c; --btn-bg: #ff7a33; --btn-bg-hover: #ff8f52;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
  --paper-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 12px 36px rgba(0, 0, 0, 0.55);
  --gap-bg: #0f0f12; --gap-ink: #77778a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.9em; background: var(--bg-2); padding: 0.08em 0.35em; border-radius: 5px; }

svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* pointer-type helpers */
.only-coarse { display: none; }
@media (pointer: coarse) { .only-coarse { display: inline; } .only-fine { display: none; } }
.only-mobile { display: none !important; }
@media (max-width: 860px) { .only-mobile { display: flex !important; } .only-desktop { display: none !important; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; letter-spacing: -0.005em; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.08s, box-shadow 0.15s;
  user-select: none;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--btn-bg); color: var(--accent-ink); box-shadow: 0 6px 18px -6px rgba(232, 89, 12, 0.6); }
.btn-primary:hover { background: var(--btn-bg-hover); }
.btn-soft { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-soft:hover { border-color: var(--ink-2); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid transparent; background: transparent; color: var(--ink-2);
}
.icon-btn:hover { background: var(--bg-2); color: var(--ink); }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 10px; }
.icon-btn.sm svg { width: 18px; height: 18px; }
.icon-btn.btn-soft { background: var(--surface); border-color: var(--line-2); width: 48px; height: 48px; }
.link { background: none; border: 0; padding: 0; color: var(--accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; }
.brand-mark { color: var(--accent); display: grid; }
.brand-mark svg { width: 32px; height: 32px; stroke: none; }
.brand-name { font-weight: 500; font-size: 17px; letter-spacing: -0.02em; }
.brand-name b { font-weight: 800; }
.files { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px; }
.files::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none; max-width: 240px;
  height: 34px; padding: 0 6px 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 500;
}
.chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.active { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); }
.chip .x { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); padding: 0; }
.chip .x:hover { background: var(--bg-2); color: var(--ink); }
.chip .x svg { width: 14px; height: 14px; }
.topbar-actions { display: flex; gap: 4px; margin-left: auto; flex: none; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}
@media (max-width: 520px) {
  .brand-name { font-size: 15px; }
  body:has(#workspace:not([hidden])) .brand-name { display: none; } /* room for the file tabs */
}

/* ---------- landing ---------- */
.landing { max-width: 1120px; margin: 0 auto; padding: 0 20px 40px; }
.hero { text-align: center; padding: clamp(36px, 8vw, 84px) 0 40px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px;
  padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; font-weight: 500; color: var(--ink-2);
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(47, 158, 68, 0.15); }
.hero h1 {
  font-size: clamp(34px, 6.4vw, 64px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 800;
  margin: 0 auto 18px; max-width: 14ch;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { font-size: clamp(16px, 2.1vw, 19px); color: var(--ink-2); max-width: 600px; margin: 0 auto 34px; }

.drop {
  position: relative; max-width: 640px; margin: 0 auto;
  padding: 38px 24px 34px; border-radius: 22px;
  background: var(--surface); border: 2px dashed var(--line-2);
  box-shadow: var(--shadow);
  cursor: pointer; transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--surface-2); }
.drop.over { transform: scale(1.01); }
.drop-icon { width: 68px; height: 68px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 20px; background: var(--accent-soft); color: var(--accent); }
.drop-icon svg { width: 38px; height: 38px; stroke-width: 2.2; }
.drop-title { font-size: 20px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.01em; }
.drop-sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.hero-alt { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

.features { padding: 30px 0 10px; }
.features h2 { text-align: center; font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.02em; margin: 0 0 26px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.feature-grid article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 18px; }
.feature-grid h3 { font-size: 16px; margin: 10px 0 6px; letter-spacing: -0.01em; }
.feature-grid p { margin: 0; color: var(--ink-2); font-size: 14px; }
.f-ic { font-size: 22px; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--bg-2); font-weight: 700; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 34px 0 10px; }
.h1-kicker { display: block; font-size: clamp(14px, 1.6vw, 17px); font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 10px; }

/* home: how it works, FAQ, guides */
.how, .home-faq, .home-guides { max-width: 860px; margin: 0 auto; padding: 34px 0 6px; }
.how h2, .home-faq h2, .home-guides h2 { text-align: center; font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.02em; margin: 0 0 22px; }
.how-steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.how-steps li { counter-increment: step; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 18px 64px; }
.how-steps li::before { content: counter(step); position: absolute; left: 18px; top: 18px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--btn-bg); color: var(--accent-ink); font-weight: 800; }
.how-steps b { display: block; font-size: 16px; margin-bottom: 4px; }
.how-steps span { color: var(--ink-2); font-size: 14px; }
.home-faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 18px; margin: 8px 0; }
.home-faq summary { cursor: pointer; font-weight: 700; padding: 12px 0; font-size: 15.5px; }
.home-faq details p { margin: 0 0 14px; color: var(--ink-2); }
.home-guides .guide-list { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.more-guides { text-align: center; margin: 16px 0 0; }
.more-guides a, .site-foot a { color: var(--accent-text); }

/* ---------- workspace ---------- */
.workspace {
  display: grid; grid-template-columns: 340px minmax(0, 1fr);
  height: calc(100vh - var(--top-h)); height: calc(100dvh - var(--top-h));
}
.panel {
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 18px 20px 28px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h2 { font-size: 17px; margin: 0; letter-spacing: -0.01em; }
.panel-actions { display: grid; gap: 8px; margin-bottom: 18px; }
.sheet-handle { display: none; }
.group { padding: 14px 0; border-top: 1px solid var(--line); }
.group h3 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.field output { color: var(--accent-text); font-weight: 700; }
select {
  width: 100%; height: 42px; padding: 0 36px 0 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface-2); appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
}
input[type="range"] { width: 100%; accent-color: var(--accent); height: 28px; }
.field input[type="text"] {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface-2); font-size: 14.5px;
}
.field input[type="text"]::placeholder { color: var(--muted); opacity: 0.8; }
.field input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
@media (pointer: coarse) { .field input[type="text"], select { font-size: 16px; } }

.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn-sm svg { width: 18px; height: 18px; }
@media (max-width: 520px) { #installBtn span { display: none; } #installBtn { padding: 0 9px; } }

/* recent notebooks */
.recent { max-width: 640px; margin: 30px auto 0; text-align: left; }
.recent-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.recent-head h2 { font-size: 15px; margin: 0; letter-spacing: -0.01em; }
.recent-head .link { font-size: 13px; }
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.recent-item { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.recent-item:hover { border-color: var(--line-2); }
.recent-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; background: none; text-align: left; border-radius: 12px; }
.recent-open svg { color: var(--accent); width: 22px; height: 22px; }
.recent-open span { display: grid; min-width: 0; }
.recent-open b { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-open small { color: var(--muted); font-size: 12.5px; }
.recent-x { flex: none; margin-right: 6px; }
.recent-x svg { width: 16px; height: 16px; }
.recent .hint, .recent-on { text-align: center; }

.seg { display: flex; padding: 3px; gap: 3px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button { flex: 1; height: 36px; border: 0; border-radius: 8px; background: transparent; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

.switch { display: flex; align-items: center; gap: 12px; min-height: 40px; font-size: 14px; color: var(--ink); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { position: relative; flex: none; width: 40px; height: 24px; border-radius: 999px; background: var(--line-2); transition: background 0.18s; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.18s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch.is-locked { opacity: 0.55; cursor: default; }
.hint { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.reset { display: block; margin: 16px auto 0; font-size: 13px; color: var(--muted); }

.viewer { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.viewer-bar { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--bg); }
.doc-meta { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; white-space: nowrap; overflow: hidden; }
.doc-meta b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.doc-meta span { color: var(--muted); font-size: 13px; }
.zoom { display: flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 2px; }
.zoom-val { min-width: 54px; height: 34px; border: 0; background: transparent; font-size: 13px; font-weight: 600; color: var(--ink-2); border-radius: 8px; }
.zoom-val:hover { background: var(--bg-2); }
.tap-tip { margin: 0; padding: 8px 18px 0; font-size: 12.5px; color: var(--muted); }
.scroller { flex: 1; overflow: auto; padding: 18px 24px 60px; overscroll-behavior: contain; }
.paper-wrap { position: relative; margin: 0 auto; }
.paper-wrap .paper { box-shadow: var(--paper-shadow); }
.busy {
  position: absolute; top: 62px; left: 50%; transform: translateX(-50%); z-index: 5;
  display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 600; box-shadow: var(--shadow);
}

.cell-tool {
  position: absolute; z-index: 4; transform: translate(-100%, 0);
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  white-space: nowrap; width: max-content;
  border-radius: 999px; border: 0; background: #1b1b1f; color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.cell-tool svg { width: 16px; height: 16px; }
.cell-tool:hover { background: var(--accent); }

/* ---------- mobile layout ---------- */
@media (max-width: 860px) {
  :root { --top-h: 54px; }
  .workspace { display: block; height: auto; }
  .viewer { min-height: calc(100dvh - var(--top-h)); }
  .viewer-bar { position: sticky; top: var(--top-h); z-index: 6; padding: 8px 12px; }
  .tap-tip { padding: 8px 12px 0; }
  .scroller { overflow: visible; padding: 12px 8px calc(96px + env(safe-area-inset-bottom)); }
  .panel {
    position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
    max-height: 84dvh; border-right: 0; border-radius: 22px 22px 0 0;
    padding: 6px 18px calc(28px + env(safe-area-inset-bottom));
    box-shadow: var(--shadow-lg);
    transform: translateY(105%); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    visibility: hidden;
  }
  .panel.open { transform: none; visibility: visible; }
  .sheet-handle { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 6px auto 10px; }
  .actionbar {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    gap: 8px; align-items: center;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .actionbar .btn { min-height: 50px; }
  .actionbar .grow { flex: 1; font-size: 16px; }
  .scrim { position: fixed; inset: 0; z-index: 45; background: rgba(10, 8, 4, 0.42); }
}

/* ---------- dialogs / overlays ---------- */
.dlg {
  width: min(480px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--line); border-radius: 20px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
.dlg::backdrop { background: rgba(10, 8, 4, 0.45); backdrop-filter: blur(2px); }
.dlg form { padding: 22px 22px 18px; }
.dlg h2 { margin: 0 0 6px; font-size: 19px; letter-spacing: -0.01em; }
.dlg input[type="url"] {
  width: 100%; height: 48px; margin-top: 12px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface-2); font-size: 15px;
}
.dlg input[type="url"]:focus { outline: 2px solid var(--accent); border-color: transparent; }
.dlg .err { color: var(--danger); font-size: 13.5px; margin: 10px 0 0; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.menu { display: grid; gap: 6px; margin-top: 12px; }
.menu-item {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; text-align: left;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2);
}
.menu-item:hover { border-color: var(--accent); }
.menu-item svg { color: var(--accent); width: 22px; height: 22px; }
.menu-item span { display: grid; }
.menu-item small { color: var(--muted); font-size: 12.5px; }
.steps { padding-left: 20px; margin: 12px 0; color: var(--ink-2); }
.steps li { margin: 6px 0; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.check input { accent-color: var(--accent); width: 18px; height: 18px; }

.progress { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(10, 8, 4, 0.5); backdrop-filter: blur(3px); }
.progress-card { width: min(380px, 100%); text-align: center; padding: 28px 24px 20px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-lg); }
.progress-ring { height: 52px; display: grid; place-items: center; }
.progress-title { font-size: 18px; font-weight: 700; margin: 12px 0 14px; }
.bar { height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width 0.2s; }
.progress-sub { color: var(--muted); font-size: 13.5px; margin: 10px 0 14px; }
.progress-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.done-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: rgba(47, 158, 68, 0.14); color: var(--ok); }
.done-ic svg { width: 28px; height: 28px; stroke-width: 2.6; }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; display: inline-block; }
.spinner.lg { width: 40px; height: 40px; border-width: 4px; color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

.dragover { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; background: rgba(232, 89, 12, 0.12); backdrop-filter: blur(3px); pointer-events: none; }
.dragover > div { display: grid; place-items: center; gap: 8px; padding: 34px 48px; border-radius: 24px; border: 3px dashed var(--accent); background: var(--surface); color: var(--accent-text); font-weight: 700; font-size: 18px; box-shadow: var(--shadow-lg); }
.dragover p { margin: 0; }
.dragover svg { width: 48px; height: 48px; }

.toast {
  position: fixed; z-index: 130; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 24px);
  padding: 12px 14px 12px 18px; border-radius: 14px; background: #1b1b1f; color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3); animation: toast-in 0.22s ease-out;
}
.toast.error { background: #a61e4d; }
.toast button { flex: none; border: 0; background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 700; height: 32px; padding: 0 12px; border-radius: 9px; }
@media (max-width: 860px) { .toast { bottom: calc(86px + env(safe-area-inset-bottom)); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* cookie choice (only shown when Google Analytics is configured) */
.consent {
  position: fixed; z-index: 140; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(620px, calc(100vw - 24px)); display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 16px; border-radius: 16px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); font-size: 14px;
}
.consent p { margin: 0; flex: 1 1 300px; line-height: 1.45; }
.consent a { color: var(--accent-text); }
.consent-actions { display: flex; gap: 8px; margin-left: auto; }
@media (max-width: 860px) { body:has(#workspace:not([hidden])) .consent { bottom: calc(84px + env(safe-area-inset-bottom)); } }

#stageHost { position: fixed; left: 0; top: 0; width: 0; height: 0; overflow: visible; z-index: -1; pointer-events: none; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: 0.01ms !important; } }
