/* ==========================================================================
   TuckGem — single stylesheet
   1. Tokens          5. Demo window (app shell, screens, options, queue)
   2. Base            6. Simulated File Explorer
   3. Site chrome     7. Overlays (tour, guide, tips)
   4. Page sections   8. Checkout & legal pages
                      9. Responsive · 10. Reduced motion
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  color-scheme: dark;

  /* colour */
  --bg: #111113;
  --bg-raised: #17181c;
  --surface: #1b1c20;
  --surface-2: #222328;
  --surface-3: #2c2e35;
  --line: #2f3137;
  --line-strong: #43464e;
  --text: #f4f5f7;
  --text-2: #c6c8ce;
  --muted: #9a9ea8;
  --faint: #767a85;
  --accent: #8eb3ff;
  --accent-ink: #a9c1ff;
  --blue: #2a6df4;
  --blue-strong: #165dff;
  --blue-tint: #10203c;
  --outgoing: #1f3557;
  --incoming: #222327;
  --ok: #7fd3a3;
  --warn: #f2c46b;
  --danger: #ff9b9b;

  /* type */
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-display: clamp(44px, 5.4vw, 84px);
  --fs-h2: clamp(34px, 4.2vw, 58px);
  --fs-h3: clamp(20px, 1.7vw, 24px);
  --fs-lead: clamp(17px, 1.35vw, 19px);
  --fs-body: 16px;
  --fs-sm: 14px;
  --fs-xs: 12px;
  --tracking-tight: -0.045em;

  /* spacing scale (4-pt) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  --page-max: 1360px;
  --gutter: clamp(16px, 5vw, 72px);
  --section-y: clamp(64px, 8vw, 104px);

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --shadow-pop: 0 18px 45px #000b;

  /* demo window */
  --app-fs: 13px;
  --app-fs-sm: 12px;
  --app-fs-xs: 11px;
  --app-h: 760px;
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 100; padding: var(--sp-3); background: #fff; color: #000; }
.skip:focus { left: var(--sp-4); }

/* shared bits */
.eyebrow {
  display: flex; align-items: center; gap: var(--sp-3);
  margin: 0 0 var(--sp-4);
  color: var(--accent-ink);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
}
.eyebrow-line { width: 24px; height: 1px; background: currentColor; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-3);
  min-height: 48px; padding: 0 22px;
  border: 1px solid transparent; border-radius: var(--r-md);
  font-size: 15px; font-weight: 650; line-height: 1.2; text-align: center;
  transition: transform .2s, filter .2s, background .2s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.btn-primary { background: linear-gradient(135deg, #3e82ff, var(--blue-strong) 65%, #0649d9); color: #fff; box-shadow: inset 0 1px 0 #ffffff40, 0 8px 22px #0007; }
.btn-outline { background: var(--surface-2); border-color: var(--line-strong); color: #fff; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }
.text-link { font-size: var(--fs-sm); font-weight: 650; color: var(--text-2); }
.text-link:hover { color: #fff; }

/* 3. Site chrome ----------------------------------------------------------- */
.site-header {
  max-width: var(--page-max); height: 72px; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5);
  border-bottom: 1px solid #ffffff12;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 750; letter-spacing: -.03em; }
.site-nav { display: flex; gap: var(--sp-6); font-size: var(--fs-sm); color: var(--text-2); }
.site-nav a:hover { color: #fff; }
.header-action { padding: 9px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-md); font-size: 13px; font-weight: 650; white-space: nowrap; }
.header-action:hover { background: var(--surface-2); }

.site-footer {
  max-width: var(--page-max); margin: 0 auto; padding: var(--sp-6) var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); flex-wrap: wrap;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 13px;
}
.site-footer .brand { color: #fff; font-size: 18px; }
.footer-note { flex: 1 1 320px; max-width: 520px; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); }
.footer-links a:hover, .mail-link:hover { color: #fff; text-decoration: underline; }
.mail-link { color: var(--accent-ink); }

/* 4. Page sections --------------------------------------------------------- */
.section { max-width: var(--page-max); margin: 0 auto; padding: var(--section-y) var(--gutter); }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-5); margin-bottom: var(--sp-6); }
.section-head h2, .contact-section h2 { font-size: var(--fs-h2); line-height: 1.08; letter-spacing: var(--tracking-tight); margin-bottom: var(--sp-4); }
.section-head p:not(.eyebrow) { max-width: 600px; color: var(--muted); }
.section-count { font-size: var(--fs-xs); color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Hero */
.hero {
  max-width: var(--page-max); margin: 0 auto; padding: var(--sp-8) var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; gap: var(--sp-6);
  min-height: 640px; overflow: hidden;
}
.hero h1 { font-size: var(--fs-display); line-height: 1.02; letter-spacing: -.055em; margin-bottom: var(--sp-5); }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-lead { max-width: 540px; font-size: var(--fs-lead); color: var(--text-2); margin-bottom: var(--sp-4); }
.hero-scope {
  display: flex; gap: var(--sp-2); max-width: 540px; margin-bottom: var(--sp-6);
  padding: var(--sp-3) var(--sp-4); border: 1px solid #34445f; border-radius: var(--r-md); background: #141b29;
  color: var(--text-2); font-size: var(--fs-sm);
}
.hero-scope > span:first-child { flex: none; color: var(--accent); }
.hero-scope strong { color: #fff; font-weight: 650; }
.hero-actions { display: flex; align-items: center; gap: var(--sp-5); flex-wrap: wrap; }
.hero-proof { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); margin: var(--sp-7) 0 0; padding: 0; list-style: none; color: var(--faint); font-size: var(--fs-xs); letter-spacing: .06em; }

.hero-art { position: relative; height: 540px; display: grid; place-items: center; isolation: isolate; }
.art-glow { position: absolute; width: 66%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #2262b688 0, #1b3a7550 38%, transparent 73%); filter: blur(25px); }
.art-orbit { position: absolute; width: 96%; height: 66%; border: 1px solid #839ac230; border-radius: 50%; transform: rotate(-27deg); }
.art-orbit-two { width: 76%; height: 92%; border-color: #839ac218; transform: rotate(29deg); }
.art-caption { position: absolute; right: 4%; bottom: var(--sp-5); z-index: 3; display: grid; gap: 2px; text-align: right; color: var(--text-2); }
.art-caption span { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); }
.art-caption strong { font-size: var(--fs-sm); font-weight: 500; }

.logo-stage {
  position: relative; z-index: 2; width: min(80%, 460px); aspect-ratio: 1;
  padding: 0; border: 0; background: transparent; perspective: 850px; cursor: grab; touch-action: none;
  filter: drop-shadow(0 40px 32px #0009); animation: float 7s ease-in-out infinite;
}
.logo-stage:active { cursor: grabbing; }
.logo-stage:focus-visible { outline-offset: 6px; border-radius: 20px; }
.logo-object { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateZ(var(--rz, 0deg)) rotateX(var(--rx, -5deg)) rotateY(var(--ry, -10deg)); transition: transform .22s ease-out; }
.logo-stage.is-dragging .logo-object, .logo-stage.is-spinning .logo-object { transition: none; }
.logo-object img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; backface-visibility: hidden; pointer-events: none; }
.logo-front { transform: translateZ(8px); filter: drop-shadow(0 3px 2px #0005); }
.logo-back { transform: rotateY(180deg) translateZ(8px); filter: brightness(.72); }
.logo-depth { filter: brightness(.27) saturate(.7); opacity: .96; backface-visibility: visible !important; }
.depth-1 { transform: translateZ(-6px); }
.depth-2 { transform: translateZ(-2px); }
.depth-3 { transform: translateZ(2px); }
.depth-4 { transform: translateZ(6px); }
@keyframes float { 50% { transform: translateY(-12px); } }

/* Demo section wrapper */
.demo-section { background: linear-gradient(#151519, var(--bg)); }
.sim-notice {
  display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); align-items: baseline;
  margin-bottom: var(--sp-4); padding: var(--sp-3) var(--sp-4);
  border: 1px solid #5a4a22; border-radius: var(--r-md); background: #211c10;
  color: #e9dcc0; font-size: var(--fs-sm);
}
.sim-notice strong { color: var(--warn); }
.demo-after { display: grid; gap: var(--sp-4); justify-items: start; margin-top: var(--sp-5); }
.demo-disclaimer { max-width: 820px; color: var(--muted); font-size: 13px; }
.backup-tour-panel { width: 100%; max-width: 820px; padding: var(--sp-4) var(--sp-5); border: 1px solid #44618d; border-radius: var(--r-md); background: #172235; font-size: var(--fs-sm); }
.backup-tour-panel p { margin: var(--sp-2) 0 var(--sp-4); color: #c3d0e3; }

/* Story */
.story-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); margin-bottom: var(--sp-7); }
.story-grid article { padding-top: var(--sp-5); border-top: 1px solid var(--line-strong); }
.story-grid span { font-size: var(--fs-xs); color: var(--accent); font-variant-numeric: tabular-nums; }
.story-grid h3 { margin: var(--sp-4) 0 var(--sp-2); font-size: var(--fs-h3); letter-spacing: -.03em; }
.story-grid p { max-width: 360px; color: var(--muted); }

.scope-card {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: var(--sp-6);
  margin-bottom: var(--sp-5); padding: var(--sp-6);
  border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface);
}
.scope-card h3 { font-size: clamp(24px, 2.4vw, 32px); line-height: 1.15; letter-spacing: -.035em; margin-bottom: var(--sp-3); }
.scope-card > div > p:not(.eyebrow) { color: var(--muted); max-width: 440px; }
.scope-list { display: grid; gap: var(--sp-3); margin: 0; padding: 0; list-style: none; }
.scope-list li { position: relative; padding: var(--sp-3) var(--sp-4) var(--sp-3) 44px; border-radius: var(--r-md); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-sm); }
.scope-list li::before { position: absolute; left: var(--sp-4); top: var(--sp-3); font-weight: 700; }
.scope-list b { display: block; margin-bottom: 2px; color: #fff; font-size: var(--fs-sm); }
.scope-list .is-yes::before { content: '✓'; color: var(--ok); }
.scope-list .is-no::before { content: '✕'; color: var(--danger); }
.scope-list .is-info::before { content: 'ⓘ'; color: var(--accent); }

.use-case {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-6); align-items: end;
  padding: var(--sp-6); border-radius: var(--r-lg); background: linear-gradient(120deg, #1e2d47, #181a20 68%);
}
.use-case .eyebrow { margin-bottom: var(--sp-3); }
.use-case h3 { max-width: 440px; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.18; letter-spacing: -.035em; }
.use-case > p { max-width: 460px; color: var(--muted); }

/* Plans */
.plans-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.plan { display: flex; flex-direction: column; padding: var(--sp-6); border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); }
.plan-featured { border-color: #3769c0; background: linear-gradient(145deg, #1a2947, #1b1e28 62%); }
.plan-tag { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--accent-ink); }
.plan h3 { margin: var(--sp-4) 0 var(--sp-2); font-size: clamp(22px, 2vw, 28px); letter-spacing: -.035em; }
.plan-top p { color: var(--muted); }
.price { margin: var(--sp-5) 0 var(--sp-4); font-size: 38px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.price small { font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.plan ul { display: grid; gap: var(--sp-3); margin: 0 0 var(--sp-6); padding: 0; list-style: none; color: var(--text-2); font-size: 15px; }
.plan li { position: relative; padding-left: 26px; }
.plan li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); }
.plan .btn { margin-top: auto; }
.plan-top p { line-height: 1.6; }
.plan-list-title { margin-bottom: var(--sp-3); color: #fff; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.plan-cta-note { margin-bottom: var(--sp-4); color: var(--muted); font-size: var(--fs-sm); }
.plan ul + .plan-cta-note { margin-top: calc(var(--sp-2) - var(--sp-6)); }

.plan-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-5); }
.plan-picker p { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-4) var(--sp-5); border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--bg-raised); color: var(--text-2); font-size: 15px; }
.plan-picker b { flex: none; color: var(--accent-ink); font-size: var(--fs-sm); white-space: nowrap; }
.plan-picker b::before { content: '→ '; }

.compare-wrap { margin-top: var(--sp-7); }
.compare { width: 100%; border-collapse: collapse; font-size: 15px; }
.compare caption { margin-bottom: var(--sp-4); text-align: left; font-size: var(--fs-h3); font-weight: 700; letter-spacing: -.03em; }
.compare th, .compare td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare thead th { color: #fff; font-size: var(--fs-sm); border-bottom-color: var(--line-strong); }
.compare thead th small { margin-left: 6px; color: var(--muted); font-weight: 400; }
.compare thead th:last-child, .compare td:last-child { background: #16203a; }
.compare tbody th { width: 22%; color: var(--text-2); font-weight: 600; font-size: var(--fs-sm); }
.compare td { width: 39%; color: var(--text-2); }

.plan-limits { margin-top: var(--sp-6); padding: var(--sp-5) var(--sp-6); border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); }
.plan-limits h3 { margin-bottom: var(--sp-3); font-size: 18px; letter-spacing: -.02em; }
.plan-limits ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2) var(--sp-6); margin: 0; padding: 0; list-style: none; color: var(--text-2); font-size: var(--fs-sm); }
.plan-limits li { position: relative; padding-left: 22px; }
.plan-limits li::before { content: 'ⓘ'; position: absolute; left: 0; color: var(--accent); }
.mac-interest { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-6); margin-top: var(--sp-5); padding: var(--sp-6); border: 1px dashed #4a5672; border-radius: var(--r-lg); background: var(--bg-raised); }
.mac-copy h3 { margin-bottom: var(--sp-3); font-size: clamp(20px, 1.8vw, 24px); line-height: 1.2; letter-spacing: -.03em; }
.mac-copy > p:not(.eyebrow) { color: var(--muted); }
.mac-fields { display: grid; gap: var(--sp-2); align-content: start; }
.mac-fields label { color: var(--text-2); font-size: 13px; }
.mac-fields input, .mac-fields select { width: 100%; min-width: 0; margin-bottom: var(--sp-2); padding: 12px 14px; border: 1px solid #2a2d34; border-radius: var(--r-md); background: #15161a; color: var(--text); box-shadow: inset 2px 2px 6px #0006; font-size: 15px; }
.mac-consent { display: flex; gap: var(--sp-3); align-items: flex-start; margin: var(--sp-1) 0 var(--sp-2); color: var(--text-2); font-size: var(--fs-sm); cursor: pointer; }
.mac-consent input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--blue); }
.mac-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mac-interest { position: relative; }
.mac-interest.is-done #mac-feedback { color: var(--ok); font-size: var(--fs-sm); }
.mac-fields p { color: var(--muted); font-size: var(--fs-xs); }
.purchase-note { max-width: 820px; margin-top: var(--sp-5); color: var(--muted); font-size: 13px; }
.purchase-note a, .legal-body a, .checkout-card a:not(.btn) { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }

/* Contact */
.contact-section { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-8); }
.contact-section > div > p:not(.eyebrow) { max-width: 420px; color: var(--muted); }
.contact-card { display: grid; gap: var(--sp-3); align-self: start; padding: var(--sp-6); border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); }
.contact-card label { font-size: 13px; color: var(--text-2); }
.contact-card input, .contact-card select {
  width: 100%; min-width: 0; padding: 13px 14px;
  border: 1px solid #2a2d34; border-radius: var(--r-md); background: #15161a; color: var(--text);
  box-shadow: inset 2px 2px 6px #0006; font-size: 15px;
}
.contact-card label + select, .contact-card label + input { margin-bottom: var(--sp-2); }
.contact-card .btn { margin-top: var(--sp-2); }
.contact-card p { color: var(--muted); font-size: var(--fs-xs); }

/* 5. Demo window ----------------------------------------------------------- */
.demo-frame {
  position: relative; display: flex; flex-direction: column;
  height: var(--app-h); overflow: hidden;
  border: 1px solid #45464b; border-radius: var(--r-lg); background: var(--bg);
  box-shadow: 0 45px 90px #0008, 0 0 0 8px #ffffff05;
  font-size: var(--app-fs); line-height: 1.45;
}

/* demo buttons: the desktop app's raised slabs (soft_theme.py) -- a dark shadow falling to the lower right, a pale glow
   at the upper left, no outline; the main action fades from dark blue to grey, an action that ends or deletes from red */
.btn-app {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border: 0; border-radius: 11px; background: #2b3037;
  color: #f5f5f6; font-size: var(--app-fs-sm); font-weight: 600; white-space: nowrap;
  box-shadow: 1px 3px 3px #000000b8, -1px -1px 3px #ffffff2a;
}
.btn-app:not(:disabled):hover { background: #343c46; box-shadow: inset 0 0 0 1px #08090b, 1px 3px 3px #000000b8, -1px -1px 3px #ffffff2a; }
.btn-app:not(:disabled):active { background: #1b2027; box-shadow: inset 0 3px 6px #00000066, 0 1px 2px #ffffff20; }
.btn-app:disabled { background: #21242a; color: #777980; box-shadow: inset 0 3px 6px #00000055, 0 1px 2px #ffffff14; }
.btn-app:focus-visible { outline: 2px solid #7fa6ff; outline-offset: 2px; }
.btn-app-primary { background: linear-gradient(#2d5a9e, #2f3237); color: #fff; }
.btn-app-primary:not(:disabled):hover { background: linear-gradient(#376cb8, #383c43); }
.btn-app-danger { background: linear-gradient(#a5403c, #372f30); color: #fff; }
.btn-app-danger:not(:disabled):hover { background: linear-gradient(#bf4b46, #40383a); }
.icon-slot { display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; font-style: normal; }
.icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.icon.is-filled { fill: currentColor; stroke: none; }
.pre { white-space: pre-wrap; }
.btn-icon { width: 34px; padding: 0; }
.btn-icon-sm { display: grid; place-items: center; flex: none; width: 26px; height: 26px; padding: 0; border: 0; border-radius: var(--r-sm); background: #303847; color: #d7e4ff; font-size: 13px; }
.btn-icon-sm:hover { background: #465d83; }

.window-bar { flex: none; height: 44px; padding: 0 var(--sp-4); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #36373b; background: var(--surface-2); }
.window-name { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: var(--app-fs-sm); }
.window-name > span { color: var(--muted); }
.window-name .window-sim { margin-left: var(--sp-2); padding: 1px 8px; border: 1px solid #5a4a22; border-radius: 20px; color: var(--warn); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.window-controls { display: flex; gap: 18px; color: #c4c6cc; }
.window-controls i { font-style: normal; font-size: 18px; line-height: 1; }
.window-controls .window-close { transition: color .12s; }
.demo-frame .window-bar:hover .window-close { color: #e5534e; }

.app-layout { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: 216px minmax(0, 1fr); overflow: hidden; }

/* sidebar */
.app-sidebar { min-height: 0; margin: 10px; padding: 14px 8px 12px; display: flex; flex-direction: column; overflow: hidden auto; border: 1px solid #303137; border-radius: 12px; background: #191a1e; }
.app-logo { display: flex; align-items: center; gap: 10px; margin: 0 6px var(--sp-4); }
.app-logo b, .app-logo small { display: block; }
.app-logo b { font-size: 15px; }
.app-logo small { color: var(--muted); font-size: var(--app-fs-xs); }
.demo-tabs { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.app-nav {
  display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 0 12px;
  border: 0; border-radius: var(--r-sm); background: transparent; color: #a8aab1; text-align: left; font-size: var(--app-fs); white-space: nowrap;
}
.app-nav i { flex: none; width: 16px; height: 16px; font-style: normal; text-align: center; color: #b4bbcb; }
.app-nav i svg, .nav-chevron svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.app-nav:hover { background: #26272b; color: #fff; }
.app-nav.is-active { background: #2f3036; color: #fff; box-shadow: inset 3px 0 var(--blue-strong); }
.nav-chevron { display: grid; place-items: center; margin-left: auto; color: #a6a8b0; }
.nav-chevron svg { width: 13px; height: 13px; }
.app-collapse { margin-bottom: var(--sp-2); border-bottom: 1px solid #34363b; border-radius: 0; font-size: var(--app-fs-sm); }
.sidebar-lower { display: grid; gap: 3px; margin-top: auto; padding-top: var(--sp-3); border-top: 1px solid #34363b; }
.app-sidebar-foot { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid #33343a; text-align: center; color: var(--faint); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.app-sidebar-foot strong { display: block; color: #a9aab3; font-size: var(--app-fs-xs); font-weight: 500; letter-spacing: 0; text-transform: none; }

.demo-frame.is-menu-collapsed .app-layout { grid-template-columns: 68px minmax(0, 1fr); }
.demo-frame.is-menu-collapsed .app-logo { justify-content: center; margin-inline: 0; }
.demo-frame.is-menu-collapsed .app-logo > div,
.demo-frame.is-menu-collapsed .app-nav span,
.demo-frame.is-menu-collapsed .nav-chevron,
.demo-frame.is-menu-collapsed .app-sidebar-foot { display: none; }
.demo-frame.is-menu-collapsed .app-nav { justify-content: center; padding: 0; }

/* main column */
.app-main { min-width: 0; min-height: 0; padding: 22px 24px 0; display: flex; flex-direction: column; overflow: hidden; }
.app-crumb { flex: none; margin-bottom: var(--sp-2); color: var(--muted); font-size: var(--app-fs-xs); }
.app-crumb span { margin: 0 8px; color: #60626a; }
.app-screen { flex: 1 1 0; min-height: 0; padding-right: 6px; overflow: auto; scrollbar-gutter: stable; }
.app-title { flex: none; margin-bottom: var(--sp-4); font-size: 26px; line-height: 1.15; letter-spacing: -.035em; font-weight: 700; }
.app-banner { flex: none; margin-bottom: var(--sp-4); padding: 11px 14px; border-radius: 11px; background: linear-gradient(#0f1a2e, #0c1424); color: #c7d7ff; font-size: var(--app-fs-sm); box-shadow: 1px 3px 3px #00000099, -1px -1px 3px #ffffff14; }
.app-subhead { margin: 0 0 var(--sp-2); font-weight: 600; }
.app-status-row { flex: none; display: flex; align-items: center; gap: var(--sp-3); min-height: 52px; padding: 8px 0; border-top: 1px solid #36373c; }
.app-status { flex: 1; min-width: 0; color: var(--muted); font-size: var(--app-fs-xs); }
.app-status-row .mode-switch { flex: none; }

/* chats screen */
.app-search-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-bottom: var(--sp-3); }
.app-search-row label, .app-destination > span { color: #aaaeb8; font-size: var(--app-fs-sm); }
/* fields: sunk into the page, rounded, no outline (tokens.INSET, soft_theme 'soft' inset) */
.app-search-row input, .app-destination code, .field-select, .sample-login-fields input, .range-popup input {
  width: 100%; min-width: 0; height: 36px; padding: 0 12px;
  border: 0; border-radius: 11px; background: #181c22; color: #f4f6fa;
  box-shadow: inset 0 3px 6px #00000066, 0 1px 2px #ffffff1f; font-size: var(--app-fs);
}
.app-search-row input:focus, .field-select:focus, .range-popup input:focus { outline: none; box-shadow: inset 0 3px 6px #00000066, 0 0 0 1px #7197ff; }
.field-select { width: auto; padding-right: 34px; appearance: none; color-scheme: dark; cursor: pointer;
  background: #181c22 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 6.5 8 10l3.5-3.5' fill='none' stroke='%23a6a8b0' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center / 14px; text-align: left; }
.field-select:disabled { cursor: default; color: #a6a8b0; }
.app-search-row input::placeholder { color: #6c707b; }
.list-top { display: flex; justify-content: space-between; gap: 10px; padding: var(--sp-1) 0 10px; border-bottom: 1px solid #36373c; color: #a4a7b1; font-size: var(--app-fs-xs); }
.chat-list { min-height: 170px; }
.list-head { display: flex; justify-content: space-between; padding: 10px 12px 6px; color: #8e929f; font-size: var(--app-fs-xs); }
.chat-rows { display: grid; gap: 5px; }
.chat-row {
  width: 100%; display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px;
  border: 1px solid transparent; border-radius: var(--r-sm); background: #1e1f23; color: #eef0f4; text-align: left; font-size: var(--app-fs);
}
.chat-row:hover { background: #2b2e36; }
.chat-row[aria-pressed="true"] { background: #2f3036; }
.chat-type { display: flex; align-items: center; gap: 8px; width: 140px; color: #d9dbe0; white-space: nowrap; }
.chat-lock { font-size: 12px; }
.list-head span:last-child { width: 140px; }
.empty-state { display: grid; gap: 4px; padding: 36px var(--sp-4); text-align: center; color: #aaaeb7; }
.empty-state small { color: #777c89; font-size: var(--app-fs-xs); }
.app-destination { display: flex; align-items: center; gap: 10px; margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid #36373c; }
.app-destination code { flex: 1; display: flex; align-items: center; font-family: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-hint { margin: 10px 0 0; color: #9ca0aa; font-size: var(--app-fs-xs); }

/* option controls (shared by chats + reader) */
.app-pills { display: flex; align-items: flex-start; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.opt-control { position: relative; flex: 0 0 auto; }
.opt-button, .opt-panel-head {
  display: flex; align-items: center; gap: var(--sp-2); width: 100%; height: 36px; padding: 0 12px;
  border: 1px solid #55575d; border-radius: var(--r-sm); background: transparent; color: #f5f5f6;
  font-size: var(--app-fs-sm); font-weight: 700; text-align: center;
}
.opt-button { min-width: 128px; }
.opt-button:hover, .opt-control.is-open .opt-button { border-color: #8a8d94; background: #1c1d20; }
.opt-button i, .opt-panel-head i { color: #d9dbe0; }
.opt-label, .opt-panel-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-panel-head { text-align: left; }
.opt-panel {
  position: absolute; left: 0; top: calc(100% + 4px); z-index: 60; width: 240px; overflow: hidden;
  border: 1px solid #45495a; border-radius: var(--r-sm); background: #1f2024; box-shadow: var(--shadow-pop);
  animation: opt-reveal .16s ease-out;
}
.opt-history .opt-panel { width: 256px; }
.opt-panel-head { border: 0; border-radius: 0; box-shadow: none; }
.opt-panel-body { margin: 0 8px; padding: 8px 0; border-top: 1px solid #303137; }
.opt-choice { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 5px 8px; border-radius: var(--r-sm); color: #e5e7ec; font-size: var(--app-fs-sm); cursor: pointer; }
.opt-choice:hover { background: #30323a; }
.opt-choice input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: #3478ed; }
.opt-choice > span { margin-left: auto; font-size: 16px; }
.opt-media .opt-choice:first-child { margin-bottom: 5px; padding-bottom: 10px; border-bottom: 1px solid #383a42; border-radius: 0; }
.opt-size-label, .opt-size-ends { display: flex; justify-content: space-between; padding: 5px 7px; color: #aab0be; font-size: var(--app-fs-xs); }
.opt-size-label output { color: #e9edf3; font-weight: 700; }
.opt-size input[type=range] { width: calc(100% - 24px); margin: 10px 12px; accent-color: var(--accent); cursor: ew-resize; }
.opt-history-modes { display: flex; gap: 5px; }
.opt-history-modes button { flex: 1; min-width: 0; padding: 7px 3px; border: 0; border-radius: var(--r-sm); background: #111113; font-size: var(--app-fs-xs); }
.opt-history-modes button[aria-pressed=true] { background: #165dff; color: #fff; font-weight: 700; }
.opt-calendar-nav { display: grid; grid-template-columns: 26px 26px 1fr 26px 26px; align-items: center; margin-top: var(--sp-2); }
.opt-calendar-nav strong { text-align: center; font-size: var(--app-fs-xs); }
.opt-calendar-nav button, .opt-calendar-grid button { padding: 3px; border: 0; border-radius: 4px; background: transparent; color: #d5d9e2; }
.opt-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 28px; text-align: center; }
.opt-calendar-grid span { align-self: center; color: #9299a8; font-size: 10px; }
.opt-calendar-grid button:hover { background: #363a43; }
.opt-calendar-grid button.is-edge { background: #2868d5; color: #fff; }
.opt-calendar-grid button.is-range { background: #213a64; border-radius: 0; }
.opt-calendar-note { min-height: 18px; margin-top: var(--sp-2); text-align: center; color: #9ba4b5; font-size: 10px; }
@keyframes opt-reveal { from { opacity: 0; transform: translateY(-4px); } }

/* presets */
.preset-field { position: relative; flex: 0 0 auto; width: 200px; margin-left: auto; font-size: var(--app-fs-sm); }
.preset-face {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px;
  border: 1px solid #55575d; border-radius: var(--r-sm); background: transparent; cursor: text;
}
.preset-face:hover, .preset-field.is-open .preset-face { border-color: #8a8d94; }
.preset-face b { flex: 1; overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.preset-face input::placeholder { color: #a6a8b0; }
.preset-face input { display: none; width: 100%; min-width: 0; border: 0; background: transparent; color: #eee; font-size: var(--app-fs-sm); outline: none; }
.preset-field:focus-within input, .preset-field.is-open input { display: block; }
.preset-field:focus-within b, .preset-field.is-open b { display: none; }
.preset-popup { position: absolute; right: 0; top: 40px; z-index: 50; width: 100%; min-width: 200px; padding: 6px; border: 1px solid #45484e; border-radius: var(--r-sm); background: #242529; box-shadow: 0 12px 24px #0009; }
.preset-popup p { margin: 0; padding: 6px; color: #9a9ca4; }
.preset-match { display: flex; }
.preset-match button { padding: 7px 9px; border: 0; border-radius: 4px; background: transparent; }
.preset-match button:hover { background: #33363e; }
.preset-match button:first-child { flex: 1; overflow: hidden; text-align: left; text-overflow: ellipsis; }
.preset-match button:last-child:hover { color: #e5534e; }
.preset-actions { display: flex; gap: 6px; padding-top: 6px; }
.preset-actions .btn-app { flex: 1; height: 30px; }

/* reader screen */
.app-screen[data-panel="reader"].is-visible { display: flex; flex-direction: column; }
.app-screen[data-panel="reader"] > * { flex-shrink: 0; }
.reader-current { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); padding-bottom: var(--sp-3); border-bottom: 1px solid #3a3b42; }
.reader-current strong { overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.reader-fold { padding: 4px 0; border: 0; background: transparent; color: #b8c1d4; font-size: var(--app-fs-sm); white-space: nowrap; }
.reader-fold:hover { color: #fff; }
.reader-actions { display: flex; gap: var(--sp-2); margin-left: auto; }
.reader-subrow { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-3); margin: calc(-1 * var(--sp-1)) 0 var(--sp-3); }
.reader-hint { color: #a6a8b0; font-size: var(--app-fs-xs); }
.reader-action i svg { display: block; }
.reader-quick-start i { color: #8bb5ff; }
.app-screen .reader-layout { flex: 1 1 0; min-height: 200px; display: grid; grid-template-columns: 210px minmax(0, 1fr); overflow: hidden; border: 1px solid #36373c; border-radius: 9px; }
.reader-list { min-height: 0; padding: var(--sp-3) var(--sp-2); overflow-y: auto; border-right: 1px solid #36373c; background: #1b1c20; }
.reader-list > b { display: block; padding: 0 8px var(--sp-3); font-size: var(--app-fs-sm); }
.reader-chat { width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px; border: 0; border-radius: 7px; background: transparent; color: #eee; text-align: left; }
.reader-chat:hover { background: #2a2c32; }
.reader-chat.is-active { background: #34353a; }
.reader-chat > span:last-child { min-width: 0; }
.reader-chat strong, .reader-chat small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-chat strong { font-size: var(--app-fs-sm); }
.reader-chat small { color: #9497a0; font-size: var(--app-fs-xs); }
.avatar { display: grid; place-items: center; flex: 0 0 30px; height: 30px; border-radius: 8px; background: #506e91; font-size: var(--app-fs-sm); }
.avatar-notes { background: #6e567d; }
.avatar-protected { background: #5d4d27; font-size: 13px; }
.messages { min-width: 0; min-height: 0; padding: var(--sp-4); display: flex; flex-direction: column; gap: 10px; overflow-y: auto; scrollbar-gutter: stable; }
.reader-empty { margin: auto; max-width: 380px; text-align: center; color: #9ba8b9; white-space: pre-line; }
.reader-latest { flex: none; height: 34px; font-size: var(--app-fs-xs); }
.day-label { align-self: center; padding: 2px 0; color: #929dac; font-size: var(--app-fs-xs); }
.gap-line { display: grid; justify-items: center; gap: 8px; padding: 4px 0 6px; }
.gap-line > span { display: flex; align-items: center; gap: 12px; width: 100%; color: #a6a8b0; font-size: var(--app-fs-xs); }
.gap-line > span::before, .gap-line > span::after { content: ''; flex: 1; border-top: 1px solid #3a3a3e; }
.gap-line button { height: 28px; padding: 0 16px; border: 0; border-radius: 14px; background: #262628; color: #7fa6ff; font-size: var(--app-fs-sm); font-weight: 700; }
.gap-line button:hover { background: #303033; }
.gap-line small { color: #7fa6ff; font-size: 10px; }
.message { max-width: 82%; padding: 10px 12px; border-radius: 12px; background: var(--incoming); color: #e5e7ea; }
.message.out { align-self: flex-end; background: var(--outgoing); }
.message small { display: block; margin-top: 5px; color: #9cb1cf; font-size: 10px; }
.message .message-meta { display: flex; align-items: center; gap: 6px; }
.version-toggle { padding: 0 2px; border: 0; background: none; color: #7fa6ff; font-size: 11px; line-height: 1; }
.message > button { padding: 3px 0; border: 0; background: none; color: #9cbcff; font-size: var(--app-fs-xs); text-align: left; }
.message > button:hover { text-decoration: underline; }
.message.highlight { outline: 2px solid var(--accent); }
.message .version { display: grid; gap: 3px; margin-top: 7px; padding-top: 7px; border-top: 1px solid #7e9ccb55; color: #aeb6c4; }
.message .version b { color: #9ba8b9; font-size: 10px; font-weight: 600; }
.file-attachment { display: block; width: 100%; margin-top: 8px; padding: 8px; border: 1px solid #607ba088; border-radius: var(--r-sm); background: transparent; color: #c7d6e6; text-align: left; font-size: var(--app-fs-sm); }
.file-attachment small { display: block; margin-top: 3px; color: #7fa6ff; }
button.file-attachment:hover { border-color: #7fa6ff; }
.sample-media.is-pending img { filter: blur(3px) brightness(.55); }
.sample-media.is-clickable { cursor: pointer; }
.sample-media.is-pending .sample-media-caption { color: #7fa6ff; }
.sample-media { position: relative; max-width: 300px; margin-top: 9px; overflow: hidden; border-radius: 7px; background: #101820; }
.sample-media img { display: block; width: 100%; aspect-ratio: 1.8; object-fit: cover; }
.sample-media-caption { display: block; padding: 7px 9px; background: #172331; color: #b4c3d5; font-size: 10px; }
.sample-video img { animation: sample-pan 6s ease-in-out infinite alternate paused; }
.sample-video.is-playing img { animation-play-state: running; }
.sample-video-play { position: absolute; left: 12px; bottom: 38px; padding: 6px 12px; border: 1px solid #a6b9d766; border-radius: 20px; background: #111d30e8; color: #fff; font-size: var(--app-fs-xs); }
.sample-video.is-playing .sample-video-play { background: #245087e8; }
@keyframes sample-pan { to { transform: scale(1.12) translateX(-2%); } }
.protected-gate { display: grid; gap: var(--sp-4); justify-items: center; max-width: 360px; margin: auto; padding: var(--sp-5) var(--sp-3); text-align: center; }
.protected-gate strong { font-size: 15px; }
.protected-gate p { color: #c7ccd4; font-size: var(--app-fs-sm); white-space: pre-line; }
.protected-session { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid #6b5a2c; border-radius: 7px; background: #221e14; color: #ead9ad; font-size: var(--app-fs-xs); }
.protected-session .btn-app { height: 28px; font-size: var(--app-fs-xs); }

/* tools, activity, account, guide */
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.tool-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); align-items: start; gap: 18px; margin-bottom: 10px; }
.tool-row .btn-app, .tool-wide { width: 170px; }
.tool-row p { color: #a6a8b0; font-size: var(--app-fs-xs); }
.tool-foot { margin: var(--sp-4) 0; color: #a6a8b0; font-size: var(--app-fs-xs); }
.activity-list { margin: 0; padding-left: 18px; color: #b8bcc5; font-size: var(--app-fs-sm); }
.activity-list li { padding: 4px 0; }
/* account page, in the desktop app's order (library_ui.py) */
.acct { display: grid; justify-items: start; }
.acct > * { max-width: 100%; }
.check-row span { min-width: 0; }
.acct-title { margin: var(--sp-3) 0 6px; font-size: 14px; font-weight: 700; }
.acct-title:first-child { margin-top: 0; }
.acct-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.acct-note, .acct-muted { color: #a6a8b0; font-size: var(--app-fs-xs); }
.licence-row { margin-top: 10px; }
.licence-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.check-row { display: flex; align-items: center; gap: 12px; margin-top: var(--sp-4); color: #e6e8ed; font-size: var(--app-fs-sm); cursor: pointer; }
.check-row input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: #3a78d8; }
.speed-select { width: min(420px, 100%); }
.acct-muted { max-width: 480px; margin-top: 6px; }
.acct-bullets { margin: 6px 0 0; padding: 0; list-style: none; color: #a6a8b0; font-size: var(--app-fs-xs); }
.acct-bullets li { padding: 1px 0 1px 18px; text-indent: -12px; }
.acct-bullets li::before { content: '•'; display: inline-block; width: 12px; text-indent: 0; }
.acct-who { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid #36373c; }
.acct-who .acct-title { margin: 0 4px 0 0; }
.acct-who .field-select { width: 260px; }
.acct-new { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-3) 36px; margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid #26262a; }
.acct-new[hidden] { display: none; }
.sample-login-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.sample-login-fields label { display: grid; gap: 5px; color: #e6e8ed; font-size: var(--app-fs-sm); }
.sample-login-fields .login-wide { grid-column: 1 / -1; }
.sample-login-fields input { color: #8c98ac; }
.phone-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.phone-row .field-select { width: 100%; }
.acct-help p { color: #a6a8b0; font-size: var(--app-fs-xs); }
.acct-help-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.acct-wide { grid-column: 1 / -1; max-width: none; margin: 0; }
.sim-note { display: block; margin-top: var(--sp-4); color: #929eae; font-size: var(--app-fs-xs); }
.guide-grid article { padding: var(--sp-4); border: 1px solid #40434d; border-radius: 9px; background: #1d2028; }
.guide-grid strong { color: #dbe6ff; }
.guide-grid p { margin-top: var(--sp-2); color: #acb5c9; font-size: var(--app-fs-sm); }

/* bottom bar + queue */
.app-bottom { position: relative; flex: none; display: flex; align-items: center; gap: var(--sp-2); min-height: 60px; padding: 10px 14px; border-top: 1px solid #303135; background: var(--surface-2); }
.bottom-actions { display: flex; gap: var(--sp-2); }
.bar-button { height: 38px; gap: 8px; padding: 0 14px 0 10px; }
.bar-button-end { padding: 0 10px 0 14px; }
#start-backup .icon { fill: #123f96; stroke: #4f82d9; stroke-width: .9; }
#pause-backup .icon, #stop-backup .icon { fill: #16171a; stroke: #9a9da4; stroke-width: .9; }
#download-queue i { color: #c4c6cc; }
.bottom-selection, .bottom-storage { color: #9c9fa9; font-size: var(--app-fs-xs); white-space: nowrap; }
.bottom-selection { color: #d9dbe0; font-weight: 700; }
.bottom-storage { margin-left: auto; }
.queue-popover {
  position: absolute; right: 120px; bottom: calc(100% + 8px); z-index: 30;
  width: min(440px, calc(100% - 24px)); max-height: 440px; overflow: auto; padding: 14px;
  border: 1px solid #5b6580; border-radius: 12px; background: #1d2029; box-shadow: 0 22px 55px #000c;
}
.queue-head { display: flex; align-items: center; justify-content: space-between; }
.queue-head strong { font-size: 15px; }
.queue-caption { margin: 6px 0 12px; color: #aeb8c9; font-size: var(--app-fs-xs); }
.queue-list { display: grid; gap: 6px; }
.queue-row { display: flex; align-items: center; gap: var(--sp-2); padding: 9px; border: 1px solid #384154; border-radius: 7px; background: #242a37; }
.queue-row.is-active { border-color: #4f73b5; }
.queue-info { flex: 1; min-width: 0; }
.queue-info strong, .queue-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-info small { margin-top: 2px; color: #a9bde3; font-size: var(--app-fs-xs); }
.queue-bar { display: block; height: 3px; margin-top: 6px; overflow: hidden; border-radius: 2px; background: #33405a; }
.queue-bar i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.queue-cancel { color: var(--danger); }
.queue-empty { padding: 18px 5px; text-align: center; color: #aab3c3; }
#queue-finish { margin-top: 12px; }

/* 6. Simulated File Explorer ----------------------------------------------- */
.demo-frame.is-explorer > .window-bar, .demo-frame.is-explorer > .app-layout, .demo-frame.is-explorer > .app-bottom, .demo-frame.is-explorer > .workflow-guide + .app-layout { display: none; }
.explorer-shell { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: #191919; color: #f1f1f1; font-family: "Segoe UI", Arial, sans-serif; font-size: 12px; line-height: 1.3; }
.explorer-tabs { flex: none; display: flex; align-items: flex-end; gap: 5px; height: 39px; padding: 5px 6px 0; background: #101010; }
.explorer-tab { display: flex; align-items: center; gap: 9px; width: 220px; min-width: 0; height: 34px; padding: 0 12px; border-radius: 8px 8px 0 0; background: #202020; }
.explorer-tab > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-glyph { color: #f6c454; font-size: 16px; line-height: 1; }
.explorer-tab-x { margin-left: auto; color: #c7c7c7; font-size: 18px; font-weight: 300; }
.explorer-new-tab { padding: 0 9px 6px; color: #ddd; font-size: 20px; }
.explorer-window-controls { display: flex; align-self: stretch; align-items: center; margin-left: auto; color: #e7e7e7; }
.explorer-window-controls span { display: grid; place-items: center; width: 42px; height: 34px; font-size: 14px; }
.explorer-nav { flex: none; display: flex; align-items: center; gap: 6px; height: 50px; padding: 7px 12px; border-bottom: 1px solid #2a2a2a; background: #202020; }
.explorer-nav-decor, .explorer-nav > button { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border: 0; border-radius: 4px; background: transparent; color: #c6c6c6; font-size: 18px; }
.explorer-nav > button:hover { background: #343434; }
.explorer-address { flex: 1; display: flex; align-items: center; min-width: 0; height: 32px; padding: 0 9px; overflow: hidden; border-radius: 5px; background: #2d2d2d; white-space: nowrap; }
.explorer-address::before { content: '⌂'; margin-right: 10px; color: #d9d9d9; font-size: 19px; }
.explorer-address button { flex: none; padding: 3px 6px; border: 0; border-radius: 4px; background: none; color: #ececec; }
.explorer-address button:disabled { opacity: 1; color: #fff; }
.explorer-address button:not(:disabled):hover { background: #424242; }
.crumb-sep { padding: 0 2px; color: #999; }
.explorer-search { position: relative; display: flex; align-items: center; width: 220px; height: 32px; border-radius: 5px; background: #2d2d2d; }
.explorer-search input { width: 100%; height: 100%; padding: 0 30px 0 12px; border: 0; background: transparent; color: #fff; outline: 0; font-size: 12px; }
.explorer-search input::placeholder { color: #c4c4c4; }
.explorer-search > span:last-child { position: absolute; right: 10px; color: #e5e5e5; font-size: 17px; pointer-events: none; }
.explorer-commands { flex: none; display: flex; align-items: center; height: 44px; padding: 0 14px; overflow: hidden; border-bottom: 1px solid #323232; background: #1d1d1d; color: #cecece; white-space: nowrap; }
.explorer-commands > span { padding: 7px 10px; }
.explorer-commands small { color: #a4a4a4; }
.explorer-commands i { height: 24px; margin: 0 5px; border-left: 1px solid #393939; }
.explorer-commands .command-icon { color: #8fa8b7; font-size: 16px; }
.explorer-commands .command-more { font-size: 17px; }
.command-spacer { flex: 1; }
.explorer-body { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: 165px minmax(0, 1fr); overflow: hidden; }
.explorer-sidebar { display: flex; flex-direction: column; gap: 2px; padding: 8px 7px; overflow-y: auto; border-right: 1px solid #333; }
.side-row { display: block; width: 100%; padding: 8px 10px; overflow: hidden; border: 0; border-radius: 4px; background: transparent; color: #eee; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.side-current { background: #323232; }
.side-current:hover { background: #3d3d3d; }
.explorer-sidebar hr { width: 100%; margin: 8px 0; border: 0; border-top: 1px solid #353535; }
.explorer-sidebar small { padding: 6px 12px; color: #a8a8a8; font-size: 10px; }
.explorer-main { min-width: 0; min-height: 0; padding: 16px 18px 20px; overflow: auto; scrollbar-gutter: stable; }
.explorer-main-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.explorer-main-heading h3 { overflow: hidden; font-size: 17px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.explorer-main-heading > span { flex: none; color: #aaa; font-size: 11px; }
.folder-column-head, .folder-entry { display: grid; grid-template-columns: minmax(0, 1fr) 150px; align-items: center; gap: 14px; }
.folder-column-head { padding: 8px 12px; border-bottom: 1px solid #373737; color: #bdbdbd; font-size: 11px; }
.folder-entries { min-height: 180px; }
.folder-entry { width: 100%; padding: 9px 12px; border: 0; border-bottom: 1px solid #2b2b2b; background: transparent; color: #e9edf6; text-align: left; font-size: 12px; }
.folder-entry:hover, .folder-entry:focus-visible { background: #303030; outline: none; }
.folder-entry small { color: #9ca7bb; font-size: 11px; }
.folder-entry.is-hidden-file { opacity: .5; }
.folder-entry.is-hidden-file:hover { opacity: .8; }
.file-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-icon { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif; font-size: 18px; line-height: 1; }
.folder-detail { margin-top: 20px; padding: 12px 14px; border-left: 2px solid #5a9dbe; background: #242424; color: #c7c7c7; line-height: 1.55; }
.folder-footnote { margin-top: 12px; color: #9d9d9d; font-size: 11px; }
.explorer-no-results { padding: 36px 12px; text-align: center; color: #a9a9a9; }
.sample-file-preview { display: grid; gap: 14px; padding: 5px 2px 14px; }
.sample-preview-heading { color: #cfd7e8; font-weight: 600; }
.sample-preview-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 220px; padding: 24px; border: 1px solid #4c5360; border-radius: 7px; background: linear-gradient(150deg, #f4f6f9, #dfe5ed); color: #273143; text-align: center; box-shadow: 0 12px 26px #0005; }
.sample-preview-page > span { font-size: 40px; }
.sample-preview-page strong { margin-top: 9px; font-size: 16px; }
.sample-preview-page p { max-width: 400px; margin-top: 10px; color: #526177; line-height: 1.5; }
.sample-file-preview > button { justify-self: start; padding: 8px 12px; border: 1px solid #536985; border-radius: 5px; background: #26364e; color: #eaf2ff; }
.sample-file-preview > button:hover { background: #365478; }
.explorer-status { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 32px; padding: 5px 13px; border-top: 1px solid #353535; color: #b2b2b2; font-size: 11px; }
.explorer-status button { padding: 4px 8px; border: 1px solid #3c4b58; border-radius: 4px; background: #23303b; color: #c9dff0; font-size: 11px; }
.explorer-status button:hover { background: #2e4252; }

/* Media page (demo reader + How-it-works mock) */
.view-switch, .mode-switch { display: inline-flex; padding: 3px; border-radius: 11px; background: #181c22; box-shadow: inset 0 3px 6px #00000066, 0 1px 2px #ffffff1f; }
.view-switch button, .mode-switch button { min-width: 96px; height: 32px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: #e6e8ed; font-size: var(--app-fs-sm); font-weight: 700; }
.view-switch button[aria-pressed="true"], .mode-switch button[aria-pressed="true"] { background: linear-gradient(#2d5a9e, #2f3237); color: #fff; box-shadow: 1px 2px 3px #000000b8, -1px -1px 2px #ffffff2a; }
.media-page { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: #111113; color: #e9edf3; }
.media-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 0 var(--sp-3); border-bottom: 1px solid #26282e; }
.media-tabs { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.media-tab { flex: none; padding: 10px 10px 8px; border: 0; border-bottom: 2px solid transparent; background: none; color: #9a9ca4; font-size: var(--app-fs); font-weight: 600; white-space: nowrap; }
.media-tab:hover { color: #e9edf3; }
.media-tab[aria-selected="true"] { border-bottom-color: #3a78d8; color: #e9edf3; }
.media-check { flex: none; padding: 4px 6px; border: 0; border-radius: 4px; background: none; color: #9a9ca4; font-size: var(--app-fs-xs); white-space: nowrap; }
.media-check:hover { color: #e9edf3; }
.media-note { flex: none; padding: 6px var(--sp-3) 0; color: #9a9ca4; font-size: var(--app-fs-xs); }
.media-body { flex: 1; min-height: 0; padding: 0 var(--sp-3) var(--sp-3); overflow-y: auto; scrollbar-gutter: stable; }
.media-month { margin: var(--sp-3) 0 var(--sp-2); color: #e9edf3; font-size: 14px; font-weight: 600; }
.media-empty { margin: auto; padding: var(--sp-6) var(--sp-4); text-align: center; color: #9a9ca4; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 4px; }
.media-tile { position: relative; display: block; aspect-ratio: 1; overflow: hidden; padding: 0; border: 0; border-radius: 6px; background: linear-gradient(var(--sky1), var(--sky2)); cursor: pointer; }
.media-tile::before { content: ''; position: absolute; left: var(--sun); top: 18%; width: 24%; aspect-ratio: 1; border-radius: 50%; background: #fbe9b7; }
.media-tile::after { content: ''; position: absolute; inset: auto 0 0; height: var(--hill); background: var(--ground); clip-path: polygon(0 18%, 45% 0, 100% 22%, 100% 100%, 0 100%); }
span.media-tile { cursor: default; }
.media-tile:hover { filter: brightness(1.1); }
.tile-purple { --sky1: #a173d9; --sky2: #6b4aa6; --ground: #4e2378; }
.tile-green  { --sky1: #6ec08c; --sky2: #3f8a5c; --ground: #1b5e33; }
.tile-red    { --sky1: #d9694f; --sky2: #a8452f; --ground: #861d08; }
.tile-pink   { --sky1: #da7aa6; --sky2: #a84c78; --ground: #85284f; }
.tile-gold   { --sky1: #e8b85c; --sky2: #b88a2e; --ground: #8f610e; }
.tile-blue   { --sky1: #5a90de; --sky2: #2f62ad; --ground: #0c3b7d; }
.tile-slate  { --sky1: #8a94a6; --sky2: #5d6678; --ground: #333c50; }
.tile-teal   { --sky1: #4fb3b0; --sky2: #2a827f; --ground: #075e5e; }
.tile-badge { position: absolute; left: 6px; bottom: 6px; z-index: 1; padding: 1px 5px; border-radius: 4px; background: #000c; color: #fff; font-size: 10px; font-weight: 600; }
.tile-state { position: absolute; right: 6px; top: 6px; z-index: 1; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #000b; color: #fff; font-size: 12px; }
.tile-state.is-done { background: #2f8f5b; }
.media-tile.is-waiting, .media-tile.is-downloading { filter: saturate(.6); }
.media-list { display: grid; }
.media-row { display: flex; align-items: center; gap: var(--sp-3); width: 100%; padding: 8px 6px; border: 0; border-bottom: 1px solid #26282e; background: transparent; color: #e9edf3; text-align: left; }
.media-row:hover { background: #1b1c21; }
.media-row-icon { flex: none; width: 30px; text-align: center; font-size: 20px; }
.media-row-badge { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; color: #fff; font-weight: 700; }
.tone-green { background: #5aa477; } .tone-purple { background: #9a6cc9; } .tone-blue { background: #4f84cf; }
.media-row-text { flex: 1; min-width: 0; }
.media-row-text strong, .media-row-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-row-text strong { font-size: var(--app-fs); font-weight: 500; }
.media-row-text small { color: #9a9ca4; font-size: var(--app-fs-xs); }
.media-row-action { flex: none; color: #9a9ca4; font-size: var(--app-fs-xs); }
.media-row.is-downloading .media-row-action, .media-row.is-waiting .media-row-action { color: #8eb3ff; }
.media-row.is-done .media-row-action { color: var(--ok); }
.media-page .protected-gate { margin: auto; }
.messages > .protected-gate { flex: none; margin: 0 auto; }
.messages > .protected-gate:only-child { margin: auto; }

.feature-media { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: var(--sp-6); align-items: center; margin-bottom: var(--sp-5); padding: var(--sp-6); border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); }
.feature-media h3 { margin-bottom: var(--sp-3); font-size: clamp(24px, 2.4vw, 32px); line-height: 1.15; letter-spacing: -.035em; }
.feature-media-copy > p:not(.eyebrow) { color: var(--muted); }
.feature-media-copy b { color: var(--text); font-weight: 650; }
.feature-media-copy ul { display: grid; gap: var(--sp-2); margin: var(--sp-4) 0 var(--sp-5); padding: 0; list-style: none; color: var(--text-2); font-size: 15px; }
.feature-media-copy li { position: relative; padding-left: 22px; }
.feature-media-copy li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); }
.media-mock { padding-bottom: var(--sp-3); border: 1px solid #2a2c33; border-radius: var(--r-md); box-shadow: 0 30px 60px #0007; font-size: var(--app-fs); pointer-events: none; }
.media-mock .media-grid { grid-template-columns: repeat(4, 1fr); padding: 0 var(--sp-3); }
.media-mock .media-month { padding: 0 var(--sp-3); }
.also-new { margin-bottom: var(--sp-5); padding: var(--sp-5) var(--sp-6); border: 1px solid var(--line); border-radius: var(--r-lg); }
.also-new .eyebrow { margin-bottom: var(--sp-3); }
.also-new ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2) var(--sp-6); margin: 0; padding: 0; list-style: none; color: var(--text-2); font-size: var(--fs-sm); }
.also-new li { position: relative; padding-left: 20px; }
.also-new li::before { content: '•'; position: absolute; left: 4px; color: var(--accent); }

/* Sidebar Tools submenu */
.tools-sub { display: grid; gap: 1px; margin: -2px 0 4px 28px; }
.tools-sub button { padding: 6px 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: #a8aab1; font-size: var(--app-fs-xs); text-align: left; white-space: nowrap; }
.tools-sub button:hover { background: #26272b; color: #fff; }
.tool-group h4.is-flashed { color: #7fa6ff; }
.demo-frame.is-menu-collapsed .tools-sub { display: none !important; }

/* Tools page */
.tool-group { margin-bottom: var(--sp-5); }
.tool-group h4 { margin: 0 0 4px; font-size: 15px; }
.tool-group > p { margin-bottom: var(--sp-3); color: #a4a7af; font-size: var(--app-fs-sm); }
.export-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.export-row > .field-select { width: auto; max-width: 100%; }
.export-sep { align-self: stretch; margin: 2px 4px; border-left: 1px solid #36373c; }
.export-label { color: #a6a8b0; font-size: var(--app-fs-xs); }
.range-field { position: relative; }
.range-face { min-width: 200px; }
.range-popup { position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 40; display: grid; gap: 10px; width: 250px; padding: 14px; border: 1px solid #3a3a3e; border-radius: 14px; background: #1c1c1e; box-shadow: var(--shadow-pop); }
.range-popup label { display: grid; gap: 5px; color: #a6a8b0; font-size: var(--app-fs-xs); }
.range-popup input { color-scheme: dark; }
.range-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Dialogs: a rounded card with raised buttons (confirm_dialog.py, upgrade_dialog.py) */
.app-dialog-layer { position: absolute; inset: 0; z-index: 70; display: grid; place-items: center; padding: var(--sp-4); background: #0b0b0ccc; }
.app-dialog-layer[hidden] { display: none; }
.app-dialog { position: relative; display: grid; gap: 10px; width: min(440px, 100%); padding: 28px; border: 1px solid #3a3a3e; border-radius: 24px; background: #1c1c1e; box-shadow: 0 24px 60px #000c; animation: tip-in .16s ease-out; }
.app-dialog-title { font-size: 17px; }
.app-dialog-text { color: #a6a8b0; font-size: var(--app-fs-sm); white-space: pre-line; }
.app-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.app-dialog-actions .btn-app { height: 40px; }
.app-dialog.is-centred { justify-items: center; text-align: center; }
.app-dialog.is-centred .app-dialog-actions { width: 100%; }
.app-dialog-mark { color: #2f6fdc; font-size: 26px; font-weight: 700; line-height: 1; }
.app-dialog-close { position: absolute; top: 16px; right: 18px; border: 0; background: none; color: #a6a8b0; font-size: 14px; }
.app-dialog-close:hover { color: #fff; }

/* Reader: protected placeholders, text preview */
.placeholder-caption { margin: var(--sp-3) 0 0; color: #9a9ca4; font-size: var(--app-fs-xs); text-align: center; }
.message.is-placeholder { border: 1px dashed #5a4a22; background: transparent; color: #d3ccb9; font-style: italic; }
.preview-banner { padding: 8px 10px; border: 1px solid #36507d; border-radius: 7px; background: #15213a; color: #c9d8f5; font-size: var(--app-fs-xs); }

/* Queue: filters, selection, actions */
.queue-filters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.queue-chip { padding: 3px 9px; border: 1px solid #3a4560; border-radius: 20px; background: transparent; color: #b8c4da; font-size: var(--app-fs-xs); }
.queue-chip[aria-pressed="true"] { border-color: #5b7fc0; background: #2a3c5e; color: #fff; }
.queue-row > input[type="checkbox"] { flex: none; width: 15px; height: 15px; margin: 0; accent-color: #4785fb; }
.queue-name { display: block; max-width: 100%; overflow: hidden; padding: 0; border: 0; background: none; color: #eef0f4; font-weight: 700; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.queue-name:hover { color: #8eb3ff; text-decoration: underline; }
.queue-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: 12px; }
#queue-finish { margin-top: 0; }

/* 7. Overlays -------------------------------------------------------------- */
.workflow-tour {
  position: absolute; top: 64px; left: 50%; z-index: 50; transform: translateX(-50%);
  width: min(440px, calc(100% - 32px)); padding: var(--sp-5);
  border: 1px solid #6b89bf; border-radius: 14px; background: #1d2535; color: #f3f7ff;
  box-shadow: 0 0 0 200vmax #0009, 0 26px 60px #000c;
}
.tour-step { color: #9cbbff; font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.workflow-tour strong { display: block; margin: var(--sp-2) 0; font-size: 22px; line-height: 1.2; }
.workflow-tour p { margin-bottom: var(--sp-4); color: #b9c5db; }
.tour-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

.workflow-guide { flex: none; display: flex; align-items: center; gap: var(--sp-3); padding: 8px var(--sp-4); border-bottom: 1px solid #3c4f73; background: #1a2436; }
.workflow-guide span { color: #83aaff; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.workflow-guide strong { flex: 1; font-size: var(--app-fs-sm); font-weight: 550; }
.workflow-guide button { border: 0; background: none; color: #aeb9ce; font-size: 18px; line-height: 1; }

.feature-tip {
  position: fixed; z-index: 1000; width: min(280px, calc(100vw - 20px)); padding: 12px 14px;
  border: 1px solid #80aaf9; border-radius: 10px; background: linear-gradient(145deg, #243756, #182236); color: #f4f7ff;
  box-shadow: 0 18px 45px #000b; pointer-events: none; animation: tip-in .16s ease-out;
}
.feature-tip small { display: block; margin-bottom: 4px; color: #a8c4ff; font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.feature-tip span { display: block; font-size: 12px; line-height: 1.45; }
.is-tipped { outline: 2px solid #8db7ff; outline-offset: 2px; }
@keyframes tip-in { from { opacity: 0; transform: translateY(4px); } }

/* 8. Checkout & legal pages ------------------------------------------------ */
.page-narrow { max-width: 1080px; margin: 0 auto; padding: var(--sp-8) var(--gutter) calc(var(--sp-8) * 1.5); }
.page-narrow h1 { margin-bottom: var(--sp-4); font-size: clamp(38px, 5.5vw, 68px); line-height: 1.04; letter-spacing: -.05em; }
.page-lead { max-width: 620px; margin-bottom: var(--sp-6); color: var(--text-2); font-size: var(--fs-lead); }
.test-banner { margin-bottom: var(--sp-5); padding: var(--sp-3) var(--sp-4); border: 1px solid #5a4a22; border-radius: var(--r-md); background: #211c10; color: #e9dcc0; font-size: var(--fs-sm); }
.test-banner strong { color: var(--warn); }
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: var(--sp-5); align-items: start; }
.checkout-card { padding: var(--sp-6); border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); }
.checkout-card h2 { margin-bottom: var(--sp-4); font-size: 20px; letter-spacing: -.02em; }
.checkout-options { display: grid; gap: var(--sp-2); }
.checkout-option { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); width: 100%; padding: var(--sp-4); border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface-2); text-align: left; }
.checkout-option small { color: var(--muted); }
.checkout-option.is-active { border-color: #5387df; background: #1f3152; }
.checkout-facts { display: grid; gap: var(--sp-2); margin: var(--sp-5) 0 0; padding: 0; list-style: none; color: var(--text-2); font-size: var(--fs-sm); }
.checkout-facts li { position: relative; padding-left: 26px; }
.checkout-facts li::before { position: absolute; left: 0; font-weight: 700; }
.checkout-facts .is-yes::before { content: '✓'; color: var(--ok); }
.checkout-facts .is-no::before { content: '✕'; color: var(--danger); }
.checkout-facts .is-info::before { content: 'ⓘ'; color: var(--accent); }
.summary-line { display: flex; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-4) 0; border-bottom: 1px solid var(--line); }
.summary-total { font-size: 20px; font-weight: 700; }
.checkout-note { margin: var(--sp-4) 0; color: var(--muted); font-size: 13px; }
.checkout-ack { display: flex; gap: var(--sp-3); align-items: flex-start; margin-bottom: var(--sp-4); color: var(--text-2); font-size: var(--fs-sm); cursor: pointer; }
.checkout-ack input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--blue); }
.checkout-card .btn { width: 100%; }
.checkout-links { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-4); font-size: 13px; }

.legal-body { max-width: 680px; display: grid; gap: var(--sp-4); color: var(--text-2); }
.legal-status { display: inline-block; padding: 4px 12px; border: 1px solid #5a4a22; border-radius: 20px; background: #211c10; color: var(--warn); font-size: var(--fs-xs); font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }

/* 9. Responsive ------------------------------------------------------------ */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; min-height: 0; gap: 0; }
  .hero-art { height: 420px; width: 100%; max-width: 620px; margin: 0 auto; }
  .hero-proof { margin-top: var(--sp-6); }
  .app-layout { grid-template-columns: 180px minmax(0, 1fr); }
  .bottom-storage { display: none; }
  .bottom-selection { margin-right: auto; }
  .scope-card, .use-case, .contact-section, .feature-media { grid-template-columns: 1fr; gap: var(--sp-5); }
  .reader-action span { display: none; }
  .reader-action { width: 38px; padding: 0; }
  .acct-new { grid-template-columns: minmax(0, 1fr); }
  .checkout-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .site-nav { display: none; }
  .story-grid { grid-template-columns: 1fr; gap: var(--sp-5); }
  .plans-grid { grid-template-columns: 1fr; }
  .plan-picker, .plan-limits ul, .mac-interest, .also-new ul { grid-template-columns: 1fr; }
  /* comparison table stacks into one card per row */
  .compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .compare, .compare tbody, .compare tr, .compare th, .compare td { display: block; width: auto; }
  .compare caption { display: block; }
  .compare tbody th, .compare td { width: auto; }
  .compare tr { margin-bottom: var(--sp-3); overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--r-md); }
  .compare tbody th { padding-bottom: var(--sp-2); background: var(--surface-2); color: #fff; }
  .compare td { display: grid; grid-template-columns: 72px 1fr; gap: var(--sp-3); }
  .compare td::before { content: attr(data-plan); color: var(--accent-ink); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding-top: 2px; }
  .compare tr td:last-child { border-bottom: 0; }
  .section-count { display: none; }

  /* demo collapses its own sidebar into an icon rail */
  .app-layout, .demo-frame.is-menu-collapsed .app-layout { grid-template-columns: 64px minmax(0, 1fr); }
  .app-logo { justify-content: center; margin-inline: 0; }
  .app-logo > div, .app-nav span, .app-sidebar-foot, .app-collapse { display: none; }
  .tools-sub, .nav-chevron { display: none !important; }
  .app-nav { justify-content: center; padding: 0; }
  .app-sidebar { margin: 8px 0 8px 8px; padding: 10px 6px; }
  .app-main { padding: 16px 16px 0; }
  .explorer-sidebar { display: none; }
  .explorer-body { grid-template-columns: minmax(0, 1fr); }
  .explorer-commands > span:not(.command-icon):not(.command-more) small { display: none; }
  .explorer-search { width: 160px; }
  .app-bottom { flex-wrap: wrap; }
  .bottom-selection { display: none; }
}

@media (max-width: 640px) {
  :root { --app-h: 820px; }
  .site-header { height: 64px; }
  .hero { padding-top: var(--sp-7); padding-bottom: var(--sp-7); }
  .hero-art { height: 320px; }
  .art-caption { bottom: 0; }
  .hero-actions { gap: var(--sp-4); }
  .hero-actions .btn { width: 100%; }
  .section-head { margin-bottom: var(--sp-5); }
  .scope-card, .use-case, .plan, .plan-limits, .mac-interest, .feature-media, .also-new, .contact-card, .checkout-card { padding: var(--sp-5); }
  .plan-picker p { flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
  .contact-section { gap: var(--sp-5); }
  .site-footer { flex-direction: column; align-items: flex-start; }
  .footer-note { flex: none; }

  /* demo: tabs move to a top strip so content gets the full width */
  .demo-frame { border-radius: var(--r-md); box-shadow: 0 20px 50px #0008; }
  .window-bar { padding: 0 var(--sp-3); }
  .window-name > span:not(.window-sim) { display: none; }
  .window-controls { gap: 12px; }
  .app-layout, .demo-frame.is-menu-collapsed .app-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .app-sidebar { margin: 0; padding: 6px 8px; overflow: auto hidden; border: 0; border-bottom: 1px solid #303137; border-radius: 0; }
  .app-logo { display: none; }
  .demo-tabs, .sidebar-lower { flex-direction: row; gap: 4px; }
  .sidebar-lower { display: flex; margin: 0; padding: 0 0 0 4px; border: 0; border-left: 1px solid #34363b; }
  .app-nav { flex: none; gap: 6px; min-height: 34px; padding: 0 10px; font-size: var(--app-fs-sm); }
  .app-nav span { display: inline; }
  .app-nav.is-active { box-shadow: inset 0 -2px var(--blue); }
  .app-main { padding: 12px 12px 0; }
  .app-crumb { display: none; }
  .app-screen { padding-right: 0; }
  .app-title { font-size: 21px; margin-bottom: var(--sp-3); }
  .app-search-row { grid-template-columns: minmax(0, 1fr) auto; }
  .app-search-row label { display: none; }
  .app-pills { display: grid; grid-template-columns: 1fr 1fr; }
  .opt-button { min-width: 0; }
  .opt-panel, .opt-history .opt-panel { width: min(256px, calc(100vw - 48px)); }
  .opt-control:nth-child(even) .opt-panel { left: auto; right: 0; }
  .preset-field { grid-column: 1 / -1; width: 100%; margin: 0; }
  .list-top span:last-child, .list-head span:last-child { display: none; }
  .chat-row { flex-direction: column; gap: 2px; }
  .chat-type { width: auto; color: #a6a8b0; font-size: var(--app-fs-xs); }
  .app-status-row { flex-wrap: wrap; }
  .view-switch button, .mode-switch button { min-width: 0; }
  .tool-row { grid-template-columns: minmax(0, 1fr); gap: 6px; margin-bottom: 14px; }
  .acct-who .field-select, .speed-select { width: 100%; }
  .sample-login-fields, .phone-row { grid-template-columns: minmax(0, 1fr); }
  .app-dialog { padding: 22px; }
  .reader-current { flex-wrap: wrap; gap: var(--sp-2); }
  .reader-current strong { flex: 1 1 100%; }
  .reader-subrow { justify-content: space-between; }
  .export-row > * { flex: 1 1 100%; }
  .media-row-action { display: none; }
  .media-head { flex-wrap: wrap; row-gap: 0; }
  .media-tabs { flex: 1 1 100%; }
  .media-check { margin: 0 0 4px auto; }
  .media-grid { grid-template-columns: repeat(3, 1fr); }
  .media-mock .media-grid { grid-template-columns: repeat(3, 1fr); }
  .app-screen .reader-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .reader-list { display: flex; gap: 4px; padding: 6px; overflow: auto hidden; border-right: 0; border-bottom: 1px solid #36373c; }
  .reader-list > b, .reader-chat .avatar, .reader-chat small { display: none; }
  .reader-chat { flex: none; width: auto; padding: 6px 10px; }
  .messages { padding: var(--sp-3); }
  .message { max-width: 92%; }
  .guide-grid { grid-template-columns: 1fr; }
  .app-bottom { flex-wrap: wrap; padding: 8px; }
  .bottom-actions { flex: 1 1 100%; }
  .bottom-actions .btn-app { flex: 1; padding: 0 6px; font-size: var(--app-fs-xs); }
  .bottom-selection { display: none; }
  .queue-popover { left: 8px; right: 8px; width: auto; }
  .workflow-tour { top: 52px; }
  .workflow-guide { padding: 8px var(--sp-3); }
  .explorer-tab { width: auto; flex: 1; }
  .explorer-new-tab, .explorer-window-controls span:not(:last-child) { display: none; }
  .explorer-nav { gap: 2px; padding: 6px 8px; }
  .explorer-nav-decor { display: none; }
  .explorer-search { width: 110px; }
  .explorer-commands { overflow-x: auto; }
  .explorer-main { padding: 12px; }
  .folder-column-head, .folder-entry { grid-template-columns: minmax(0, 1fr) 96px; gap: 8px; }
  .explorer-status { flex-wrap: wrap; }
}

/* 10. Reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
