/* Content Studio — mirrors bulkscheduler.com's design system (frontend/tailwind.config.mjs):
   warm paper, ink greys, deep-teal accent, Fraunces display + Inter body,
   sharp 2px corners, print-like hairlines. Single light theme, like the main site. */

@font-face {
  font-family: "Fraunces"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/fonts/fraunces-variable-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("/fonts/inter-variable-latin.woff2") format("woff2");
}

:root {
  --paper: #FAF9F6; --raised: #FFFFFF; --sunken: #F4F2EC; --deep: #EDEAE1;
  --ink-900: #16150F; --ink-700: #3D3B36; --ink-500: #6B6862; --ink-400: #747066; --ink-300: #A8A497;
  --line: #E2DFD6; --line-strong: #CFCBBF; --line-faint: #EDEAE1;
  --accent: #1F5E56; --accent-600: #1A4F48; --accent-50: #EEF5F3; --accent-100: #D6E7E3;
  --processing: #2F6FB5; --published: #2E7D4F; --failed: #B3261E; --warn: #A66A00;
  --r: 2px;
  --shadow-card: 0 1px 2px rgba(22,21,15,0.05);
  --shadow-pop: 0 8px 28px rgba(22,21,15,0.10), 0 2px 6px rgba(22,21,15,0.06);
  --display: "Fraunces", ui-serif, Georgia, Cambria, serif;
  --sans: "Inter", ui-sans-serif, system-ui, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --tabbar-h: 62px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink-700);
  font: 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(rgba(22,21,15,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22,21,15,0.045) 1px, transparent 1px);
  background-size: 32px 32px;
}
h1, h2, h3 { color: var(--ink-900); margin: 0; }
h1 { font-family: var(--display); font-weight: 500; letter-spacing: -0.02em; line-height: 1.08; }
h1 em { font-style: normal; color: var(--accent); }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; }
.hidden { display: none !important; }
.spacer { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.meta { font-size: 13px; color: var(--ink-400); }
.small { font-size: 13px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; display: inline-block; }
.lede { color: var(--ink-500); max-width: 60ch; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  background: var(--raised); border-right: 1px solid var(--line);
  padding: 20px 14px; display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink-900); font-weight: 700; font-size: 17px; }
.brand img { display: block; }
.sidebar .brand { padding: 0 8px; }
.brand-sub { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-400); font-weight: 600; padding: 4px 8px 0 46px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 26px; }
.side-nav a, .tabbar a { display: flex; align-items: center; gap: 10px; color: var(--ink-500); font-weight: 500; }
.side-nav a { padding: 9px 10px; border-radius: var(--r); border-left: 2px solid transparent; }
.side-nav a:hover { background: var(--sunken); color: var(--ink-900); }
.side-nav a.active { background: var(--accent-50); color: var(--accent); border-left-color: var(--accent); }
.side-nav svg, .tabbar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sidebar-foot { margin-top: auto; display: grid; gap: 12px; padding: 14px 8px 0; border-top: 1px solid var(--line-faint); }
.foot-link { font-size: 13px; }
.lib-status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-500); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-300); flex: none; }
.dot.on { background: var(--published); }
.dot.wait { background: var(--warn); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; transform: scale(.8); } }

.topbar, .tabbar { display: none; }
.main { padding: 32px 40px 72px; max-width: 1000px; width: 100%; min-width: 0; margin: 0 auto; }
.view { display: none; animation: fadeIn .3s ease-out both; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } }
.page-title { font-size: 40px; margin: 10px 0 8px; }
.view > .lede { margin-bottom: 24px; }

.demo-banner {
  display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--warn);
  background: #FBF4E6; border: 1px solid #EBD9B4; border-radius: var(--r); padding: 8px 12px; margin-bottom: 28px;
}
.demo-banner .eyebrow-dot { background: var(--warn); }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px;
  border: 1px solid var(--line-strong); background: var(--raised); color: var(--ink-900);
  padding: 8px 16px; border-radius: var(--r); font-weight: 600; font-size: 14px; cursor: pointer;
  transition: background .15s, border-color .15s; white-space: nowrap;
}
.btn:hover { background: var(--sunken); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-600); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--ink-900); background: var(--raised);
  border: 1px solid var(--line-strong); border-radius: var(--r); padding: 8px 12px; min-height: 40px; min-width: 0;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, .chip:focus-visible, .pick:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.mono { font-family: var(--mono); }

.card {
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px 22px; box-shadow: var(--shadow-card); margin-bottom: 16px;
}
.note {
  font-size: 13px; color: var(--ink-500); background: var(--sunken); border-left: 2px solid var(--line-strong);
  padding: 10px 14px; margin-bottom: 16px;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; padding: 3px 8px; border-radius: var(--r); white-space: nowrap; border: 1px solid;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--published); border-color: rgba(46,125,79,.3); background: rgba(46,125,79,.06); }
.badge.missing { color: var(--warn); border-color: rgba(166,106,0,.3); background: rgba(166,106,0,.06); }
.badge.free { color: var(--accent); border-color: var(--accent-100); background: var(--accent-50); }
.badge.run { color: var(--processing); border-color: rgba(47,111,181,.3); background: rgba(47,111,181,.06); }
.badge.run::before { animation: pulse 2s ease-in-out infinite; }
.badge.stop { color: var(--ink-400); border-color: var(--line-strong); background: var(--sunken); }
.badge.fail { color: var(--failed); border-color: rgba(179,38,30,.3); background: rgba(179,38,30,.06); }
.err { color: var(--failed); }

/* ---------- dashboard ---------- */
.hero { text-align: center; margin: 8px auto 28px; max-width: 640px; }
.hero h1 { font-size: 54px; margin: 12px 0 14px; }
.hero .lede { margin: 0 auto; }
.category-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px;
  border: 1px solid var(--line-strong); background: var(--raised); color: var(--ink-700);
  padding: 6px 16px; border-radius: var(--r); cursor: pointer; font-weight: 500;
}
.chip .num { font-size: 11px; color: var(--ink-400); font-weight: 600; letter-spacing: .06em; }
.chip:hover { border-color: var(--ink-300); }
.chip.active { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
.chip.active .num { color: var(--accent-100); }

.composer {
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--r);
  box-shadow: var(--shadow-pop); margin-bottom: 20px;
}
.composer:focus-within { border-color: var(--accent); }
.composer textarea {
  display: block; width: 100%; border: 0; resize: vertical; min-height: 96px; padding: 16px 18px;
  font-size: 17px; line-height: 1.5; background: transparent;
}
.composer textarea:focus { outline: none; }
.composer-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 10px 12px; border-top: 1px solid var(--line-faint); background: var(--paper);
}
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--raised); }
.seg button {
  border: 0; background: transparent; color: var(--ink-500); padding: 6px 14px; min-height: 38px;
  font-weight: 600; font-size: 14px; cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button small { font-weight: 400; color: var(--ink-400); margin-left: 2px; }
.seg button.active { background: var(--accent); color: #fff; }
.seg button.active small { color: var(--accent-100); }
.field { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--raised); min-width: 0; }
.field-label { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-400); padding-left: 12px; white-space: nowrap; }
.field select { border: 0; background: transparent; font-size: 14px; font-weight: 500; min-height: 38px; padding: 6px 10px; max-width: 220px; cursor: pointer; }
.field select:focus { outline: none; }
.field:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.composer-go { margin-left: auto; }

/* suggestion */
.suggest-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.suggest-head h2 { font-family: var(--display); font-weight: 500; font-size: 24px; }
.suggest-list { display: grid; margin: 14px 0 18px; border-top: 1px solid var(--line-faint); }
.suggest-item { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-faint); }
.suggest-item .info { flex: 1; min-width: 0; }
.suggest-item b { color: var(--ink-900); }
.api-logo {
  width: 36px; height: 36px; border-radius: var(--r); display: grid; place-items: center; flex: none;
  font-weight: 700; font-size: 12px; color: #fff; letter-spacing: .02em;
}
.pipeline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; margin-top: 8px; }
.pipeline .step {
  display: inline-flex; align-items: center; gap: 6px; background: var(--paper);
  border: 1px solid var(--line); padding: 4px 10px; border-radius: var(--r); color: var(--ink-700);
}
.pipeline .step i { font-style: normal; font-size: 11px; font-weight: 600; color: var(--ink-400); }
.pipeline .step.end { background: var(--accent-50); border-color: var(--accent-100); color: var(--accent); font-weight: 600; }
.pipeline .arrow { color: var(--ink-300); }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 20px; }

/* when / schedules */
.when { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-faint); }
.when .meta { margin-top: 10px; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.slot { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--accent);
  background: var(--accent-50); border: 1px solid var(--accent-100); padding: 4px 6px 4px 10px; border-radius: var(--r); min-height: 32px; }
.sched .slot { padding-right: 10px; }
.slot button { border: 0; background: transparent; color: var(--accent); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
.slot-add { display: inline-flex; gap: 6px; align-items: center; }
.slot-add input { min-height: 32px; padding: 4px 8px; font-size: 14px; }
.stat-value.sm { font-family: var(--sans); font-size: 14px; font-weight: 600; line-height: 1.5; padding-top: 2px; overflow-wrap: anywhere; }
.sched.paused { opacity: .75; }

/* jobs */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 36px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.jobs { display: grid; gap: 12px; }
.job { margin: 0; }
.job-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.job-title { font-weight: 600; color: var(--ink-900); overflow-wrap: anywhere; }
.job-meta { font-size: 13px; color: var(--ink-400); margin-top: 2px; }
.job-side { display: flex; gap: 8px; align-items: center; flex: none; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 16px 0 12px; border-top: 1px solid var(--line-faint); border-bottom: 1px solid var(--line-faint); }
.stat { padding: 10px 0; }
.stat + .stat { padding-left: 16px; border-left: 1px solid var(--line-faint); }
.stat-label { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-400); }
.stat-value { font-family: var(--display); font-size: 22px; color: var(--ink-900); line-height: 1.3; }
.stat-value small { font-family: var(--sans); font-size: 13px; color: var(--ink-500); }
.progress { height: 6px; background: var(--sunken); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--processing); transition: width .5s; }
.job.done .progress > div { background: var(--published); }
.job-now { font-size: 13px; margin-top: 10px; color: var(--ink-700); }
.job-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(18px, 1fr)); gap: 3px; margin-top: 12px; }
.job-items span { height: 6px; border-radius: 1px; background: var(--deep); }
.job-items span.done { background: var(--published); }
.job-items span.fail { background: var(--failed); }
.job-items span.run { background: var(--processing); animation: pulse 1.6s ease-in-out infinite; }
details.log summary { cursor: pointer; font-size: 13px; color: var(--ink-500); margin-top: 12px; font-weight: 500; }
.log-lines {
  font: 12px/1.7 var(--mono); max-height: 200px; overflow: auto; color: var(--ink-700);
  background: var(--paper); border: 1px solid var(--line-faint); padding: 8px 12px; margin-top: 8px;
}
.vid-list { display: grid; gap: 8px; margin-top: 10px; }
.vid { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line-faint); background: var(--paper); }
.vid img, .vid-ph { width: 44px; height: 44px; object-fit: cover; flex: none; border-radius: var(--r); background: var(--deep); }
.vid-ph { display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--ink-400); }
.vid-info { flex: 1; min-width: 0; }
.vid-title { font-size: 14px; font-weight: 600; color: var(--ink-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; padding: 36px 16px; color: var(--ink-400); border: 1px dashed var(--line-strong); background: var(--raised); }

/* ---------- apis ---------- */
.library-card h2 { font-family: var(--display); font-weight: 500; font-size: 22px; margin: 6px 0 6px; }
.lib-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; margin-top: 16px; }
.key-box { display: flex; gap: 8px; }
.key-box input { flex: 1; font-family: var(--mono); font-size: 14px; background: var(--paper); }
.how { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
.how li { counter-increment: s; display: flex; gap: 12px; font-size: 14px; }
.how li::before {
  content: counter(s, decimal-leading-zero); font-size: 11px; font-weight: 600; color: var(--accent);
  border: 1px solid var(--accent-100); background: var(--accent-50); padding: 1px 6px; height: fit-content; border-radius: var(--r);
}
.lib-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-faint); font-size: 14px; }
.folder-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.folder-list span { font-size: 13px; padding: 3px 10px; border: 1px solid var(--line); background: var(--paper); border-radius: var(--r); }

.img-pick { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
.img-pick .pick { align-content: start; }
@media (max-width: 820px) { .img-pick { grid-template-columns: minmax(0, 1fr); } }
.api-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.api-card { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.api-card .top { display: flex; gap: 12px; align-items: flex-start; }
.api-card .top > div { flex: 1; min-width: 0; }
.api-card .role { font-size: 13px; color: var(--ink-500); }
.api-card .key-box input { font-size: 14px; }

/* ---------- categories ---------- */
.cat-list { display: grid; gap: 14px; }
.cat-card .cat-head { display: flex; align-items: baseline; gap: 12px; }
.cat-card .num { font-family: var(--display); font-size: 28px; color: var(--accent); line-height: 1; }
.cat-card h2 { font-family: var(--display); font-weight: 500; font-size: 26px; }
.cat-card .hint { color: var(--ink-500); font-size: 14px; margin: 6px 0 14px; }
.fmt-title { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-400); margin-top: 16px; }
.cat-card textarea { width: 100%; min-height: 80px; resize: vertical; margin-top: 8px; font-size: 15px; }

/* ---------- onboarding ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(22,21,15,.45); display: grid; place-items: center; padding: 16px; z-index: 60; }
.modal {
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-pop);
  width: min(600px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column;
}
.modal-body { padding: 0 28px; overflow: auto; }
.modal-body h2 { font-family: var(--display); font-weight: 500; font-size: 30px; margin: 8px 0 6px; }
.modal-body .lede { font-size: 14px; }
.steps-dots { display: flex; gap: 6px; padding: 24px 28px 16px; }
.steps-dots span { height: 3px; flex: 1; background: var(--deep); }
.steps-dots span.on { background: var(--accent); }
.modal-actions { display: flex; gap: 8px; padding: 20px 28px 24px; border-top: 1px solid var(--line-faint); margin-top: 22px; }
.pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.pick {
  border: 1px solid var(--line-strong); border-radius: var(--r); padding: 16px; cursor: pointer;
  background: var(--raised); text-align: left; color: var(--ink-700); display: grid; gap: 4px;
}
.pick:hover { border-color: var(--ink-300); }
.pick .num { font-family: var(--display); font-size: 22px; color: var(--ink-300); line-height: 1; }
.pick b { color: var(--ink-900); font-size: 16px; }
.pick span:last-child { font-size: 13px; color: var(--ink-500); }
.pick.active { border-color: var(--accent); background: var(--accent-50); box-shadow: inset 0 0 0 1px var(--accent); }
.pick.active .num { color: var(--accent); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70;
  background: var(--ink-900); color: #fff; font-size: 14px; padding: 10px 16px; border-radius: var(--r); box-shadow: var(--shadow-pop);
}

/* ---------- tablet ---------- */
@media (max-width: 1080px) {
  .main { padding: 28px 28px 64px; }
  .lib-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ---------- mobile ---------- */
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    position: sticky; top: 0; z-index: 40; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
    background: rgba(255,255,255,.95); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line);
  }
  .topbar .brand { font-size: 16px; }
  .topbar .lib-status { font-size: 12px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: rgba(255,255,255,.97); backdrop-filter: blur(6px); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { flex-direction: column; gap: 3px; justify-content: center; height: var(--tabbar-h); font-size: 11px; font-weight: 600; border-top: 2px solid transparent; }
  .tabbar a.active { color: var(--accent); border-top-color: var(--accent); }
  .tabbar svg { width: 20px; height: 20px; }
  .main { padding: 18px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); }
  .demo-banner { margin-bottom: 20px; align-items: flex-start; }
  .demo-banner .eyebrow-dot { margin-top: 7px; }

  .hero { text-align: left; margin-bottom: 20px; }
  .hero h1 { font-size: 38px; }
  .page-title { font-size: 32px; }
  .category-row { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px 4px; scrollbar-width: none; }
  .category-row::-webkit-scrollbar { display: none; }
  .chip { flex: none; }

  .composer textarea { min-height: 110px; padding: 14px; font-size: 16px; }
  .composer-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 10px; }
  .seg { grid-column: 1 / -1; }
  .seg button { flex: 1; }
  .field-folder { width: 100%; }
  .field-folder select { max-width: none; width: 100%; }
  .composer-go { grid-column: 1 / -1; margin: 0; width: 100%; min-height: 46px; font-size: 15px; }

  .card { padding: 16px; }
  .suggest-head h2 { font-size: 21px; }
  .actions .btn { flex: 1 1 auto; }
  .actions .spacer { display: none; }
  .job-head { flex-direction: column; }
  .job-side { width: 100%; justify-content: space-between; }
  .stat-value { font-size: 19px; }
  .stat + .stat { padding-left: 10px; }

  .api-grid { grid-template-columns: minmax(0, 1fr); }
  .key-box { flex-wrap: wrap; }
  .key-box input { flex: 1 1 100%; }
  .key-box .btn { flex: 1; }

  .modal-backdrop { padding: 0; place-items: end stretch; }
  .modal { width: 100%; max-height: 92dvh; border-radius: 10px 10px 0 0; animation: sheet .3s cubic-bezier(.22,1,.36,1) both; }
  @keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
  .modal-body, .steps-dots { padding-left: 18px; padding-right: 18px; }
  .modal-actions { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); }
  .modal-body h2 { font-size: 26px; }
  .pick-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .pick { padding: 12px; }
  .toast { bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 32px); }
}
@media (max-width: 380px) {
  .hero h1 { font-size: 32px; }
  .pick-grid { grid-template-columns: 1fr; }
  .field-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
