/* Resume Studio — Soft Productivity Minimalism.
   Off-white page, white cards with whisper-soft shadows, light gray blocks
   instead of borders, pastel tints for meaning, a deeper lavender for primary
   actions and a deeper mint for success. Pillowy corners, generous spacing,
   gentle motion. Dark mode keeps the same pastels as soft tints on charcoal.

   Light palette                       Dark palette
   Page        #FAFAF8                 Page        #17171C
   Card        #FFFFFF                 Card        #1F1F26
   Block       #F4F4F1                 Block       #27272F
   Text        #333333                 Text        #E8E8EE
   Lavender    #EEEAFD / #7B6AE8       Lavender    tint / #9D8EFF
   Mint        #E3F4EB / #4FAE85       Mint        tint / #6CC9A0
   Peach       #FDEBE1                 Peach       tint
   Sky         #E3F0FC                 Sky         tint
   Yellow      #FBF3D3                 Yellow      tint                     */

@font-face { font-family: "Jakarta"; src: url("/static/fonts/plus-jakarta-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url("/static/fonts/plus-jakarta-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url("/static/fonts/plus-jakarta-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url("/static/fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url("/static/fonts/plus-jakarta-sans-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --page: #fafaf8;
  --surface: #ffffff;
  --block: #f4f4f1;
  --block-2: #ecece8;
  --ink: #333333;
  --ink-2: #6b6b72;
  --ink-3: #9b9ba2;
  --line: rgba(51, 51, 51, 0.06);

  --lavender: #eeeafd;
  --lavender-ink: #5b4bc4;
  --mint: #e3f4eb;
  --mint-ink: #2f7a57;
  --peach: #fdebe1;
  --peach-ink: #b05a2e;
  --sky: #e3f0fc;
  --sky-ink: #2f6ca8;
  --yellow: #fbf3d3;
  --yellow-ink: #87670c;
  --yellow-strong: #f5e3a0;

  --primary: #7b6ae8;
  --primary-hover: #6d5bdf;
  --primary-soft: rgba(123, 106, 232, 0.16);
  --success: #4fae85;
  --danger: #c2554a;
  --warn: #b0701c;

  --shadow: 0 1px 2px rgba(40, 40, 60, 0.04), 0 8px 24px rgba(40, 40, 60, 0.05);
  --shadow-hover: 0 2px 4px rgba(40, 40, 60, 0.05), 0 14px 34px rgba(40, 40, 60, 0.09);
  --shadow-pop: 0 4px 10px rgba(40, 40, 60, 0.06), 0 28px 64px rgba(40, 40, 60, 0.16);
  --paper-shadow: 0 1px 3px rgba(40, 40, 60, 0.06), 0 14px 40px rgba(40, 40, 60, 0.1);

  --sans: "Jakarta", "Plus Jakarta Sans", ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --r-card: 24px;
  --r-block: 18px;
  --r-field: 14px;
  --r-row: 14px;
  --ease: cubic-bezier(0.22, 0.8, 0.3, 1);
  --on-primary: #ffffff;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #17171c;
    --surface: #1f1f26;
    --block: #27272f;
    --block-2: #30303a;
    --ink: #e8e8ee;
    --ink-2: #a8a8b3;
    --ink-3: #74747f;
    --line: rgba(255, 255, 255, 0.05);

    --lavender: rgba(157, 142, 255, 0.16);
    --lavender-ink: #bdb3ff;
    --mint: rgba(108, 201, 160, 0.15);
    --mint-ink: #8fdcb8;
    --peach: rgba(255, 165, 125, 0.15);
    --peach-ink: #ffbb98;
    --sky: rgba(120, 175, 240, 0.15);
    --sky-ink: #a3cbf6;
    --yellow: rgba(240, 205, 95, 0.14);
    --yellow-ink: #ecd384;
    --yellow-strong: rgba(240, 205, 95, 0.3);

    --primary: #9d8eff;
    --primary-hover: #b0a3ff;
    --primary-soft: rgba(157, 142, 255, 0.2);
    --success: #6cc9a0;
    --danger: #f08a80;
    --warn: #e5b45c;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.18);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.3), 0 14px 34px rgba(0, 0, 0, 0.28);
    --shadow-pop: 0 4px 10px rgba(0, 0, 0, 0.35), 0 28px 64px rgba(0, 0, 0, 0.5);
    --paper-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 14px 40px rgba(0, 0, 0, 0.35);
    --on-primary: #17171c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #17171c;
  --surface: #1f1f26;
  --block: #27272f;
  --block-2: #30303a;
  --ink: #e8e8ee;
  --ink-2: #a8a8b3;
  --ink-3: #74747f;
  --line: rgba(255, 255, 255, 0.05);

  --lavender: rgba(157, 142, 255, 0.16);
  --lavender-ink: #bdb3ff;
  --mint: rgba(108, 201, 160, 0.15);
  --mint-ink: #8fdcb8;
  --peach: rgba(255, 165, 125, 0.15);
  --peach-ink: #ffbb98;
  --sky: rgba(120, 175, 240, 0.15);
  --sky-ink: #a3cbf6;
  --yellow: rgba(240, 205, 95, 0.14);
  --yellow-ink: #ecd384;
  --yellow-strong: rgba(240, 205, 95, 0.3);

  --primary: #9d8eff;
  --primary-hover: #b0a3ff;
  --primary-soft: rgba(157, 142, 255, 0.2);
  --success: #6cc9a0;
  --danger: #f08a80;
  --warn: #e5b45c;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.18);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.3), 0 14px 34px rgba(0, 0, 0, 0.28);
  --shadow-pop: 0 4px 10px rgba(0, 0, 0, 0.35), 0 28px 64px rgba(0, 0, 0, 0.5);
  --paper-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 14px 40px rgba(0, 0, 0, 0.35);
  --on-primary: #17171c;
    color-scheme: dark;
}

/* ------------------------------------------------------------- base */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.6 var(--sans);
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
::selection { background: var(--primary-soft); }
a { color: var(--primary); text-decoration: none; font-weight: 500; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--primary-soft) !important; }
h1, h2, h3 { margin: 0; color: var(--ink); }
h1 { font-size: 32px; line-height: 1.2; font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: 19px; line-height: 1.35; font-weight: 700; letter-spacing: -0.015em; }
h3 { font-size: 13px; font-weight: 600; }
p { margin: 0; }
code { font: 13px var(--mono); padding: 3px 8px; border-radius: 8px; background: var(--block); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); font-size: 13px; }
.hidden { display: none !important; }
.wallpaper { display: none; }

/* ------------------------------------------------------------- shell */
.shell { min-height: 100vh; }
.rail {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  width: 248px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 28px 18px 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 26px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand:hover { color: var(--ink); }
.app-icon { flex: none; width: 34px; height: 34px; border-radius: 11px; box-shadow: var(--shadow); }
.rail a[data-nav], .rail-link {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 46px;
  padding: 0 10px;
  border-radius: 16px;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 600;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.rail a[data-nav] svg, .rail-link svg {
  width: 32px;
  height: 32px;
  padding: 7px;
  flex: none;
  border-radius: 11px;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  background: var(--tile, var(--block));
  stroke: var(--tile-ink, var(--ink-2));
  transition: transform 0.25s var(--ease);
}
.rail a[data-nav="library"] { --tile: var(--lavender); --tile-ink: var(--lavender-ink); }
.rail a[data-nav="jobs"] { --tile: var(--peach); --tile-ink: var(--peach-ink); }
.rail a[data-nav="resumes"] { --tile: var(--mint); --tile-ink: var(--mint-ink); }
.rail a[data-nav="templates"] { --tile: var(--sky); --tile-ink: var(--sky-ink); }
.rail a[data-nav="settings"] { --tile: var(--yellow); --tile-ink: var(--yellow-ink); }
.rail a[data-nav]:hover, .rail-link:hover { color: var(--ink); background: var(--block); }
.rail a[data-nav]:hover svg { transform: scale(1.06) rotate(-3deg); }
.rail a[data-nav].active { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.rail-foot { margin-top: auto; display: grid; gap: 10px; }
.rail-note { margin: 0 6px; padding: 10px 12px; border-radius: 14px; font-size: 12.5px; line-height: 1.45; color: var(--yellow-ink); background: var(--yellow); }
.rail-note:empty { display: none; }
.me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 16px;
  color: var(--ink);
  transition: background-color 0.2s var(--ease);
}
.me:hover { background: var(--block); color: var(--ink); }
.me:empty { display: none; }
.me-text { display: grid; line-height: 1.3; min-width: 0; }
.me-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-sub { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.rail-signout { margin: 0; }
button.rail-link {
  width: 100%;
  height: 40px;
  background: none;
  box-shadow: none;
  justify-content: flex-start;
  font-size: 14px;
}
button.rail-link svg { width: 28px; height: 28px; padding: 6px; }
button.rail-link:hover { transform: none; box-shadow: none; }

main { margin-left: 248px; padding: 0 44px 88px 28px; min-width: 0; outline: none; max-width: 1640px; }
main:focus, main:focus-visible { box-shadow: none !important; }
main > * { animation: rise 0.42s var(--ease) both; }
main > *:nth-child(2) { animation-delay: 0.04s; }
main > *:nth-child(3) { animation-delay: 0.08s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 40px 0 28px;
}
.page-head .sub { margin-top: 8px; color: var(--ink-2); max-width: 64ch; }
.page-head .faint { margin-bottom: 4px; font-size: 13.5px; }

/* ------------------------------------------------------------- avatars & presence */
.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 0 0 2px var(--surface);
}
.avatar-md { width: 36px; height: 36px; font-size: 13px; }
.avatar-sm { width: 26px; height: 26px; font-size: 11px; }
.tint-lavender { background: var(--lavender); color: var(--lavender-ink); }
.tint-mint { background: var(--mint); color: var(--mint-ink); }
.tint-peach { background: var(--peach); color: var(--peach-ink); }
.tint-sky { background: var(--sky); color: var(--sky-ink); }
.tint-yellow { background: var(--yellow); color: var(--yellow-ink); }
.avatar.writer { position: relative; background: var(--lavender); }
.avatar.writer svg { width: 15px; height: 15px; fill: var(--primary); }
.presence .avatar.writer::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0;
  animation: ping 1.8s var(--ease) infinite;
}
@keyframes ping { 0% { opacity: 0.55; transform: scale(0.85); } 100% { opacity: 0; transform: scale(1.35); } }
.presence {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 34px;
  padding: 0 14px 0 5px;
  border-radius: 999px;
  background: var(--lavender);
  color: var(--lavender-ink);
  font-size: 13px;
  font-weight: 600;
}
.typing { display: inline-flex; gap: 3px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.35; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 0.9; transform: translateY(-2px); } }

/* ------------------------------------------------------------- illustrations */
.illo { display: flex; justify-content: center; margin-bottom: 14px; }
.illo svg { width: 200px; height: auto; overflow: visible; }
.illo .i-line { fill: none; stroke: var(--ink-2); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.illo .i-paper.i-line, .illo .i-mint.i-line, .illo .i-peach.i-line, .illo .i-yellow.i-line { stroke: var(--ink-2); }
.illo .i-paper { fill: var(--surface); }
.illo .i-lavender { fill: var(--lavender); }
.illo .i-mint { fill: var(--mint); }
.illo .i-peach { fill: var(--peach); }
.illo .i-sky { fill: var(--sky); }
.illo .i-yellow { fill: var(--yellow-strong); }
.illo .i-shadow { fill: var(--block-2); }
.illo .i-mint-stroke { stroke: var(--success); }
.illo .i-lavender-stroke { stroke: var(--primary); }
.illo svg { animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-4px); } }

/* ------------------------------------------------------------- controls */
button, .btn {
  font: 600 14px/1 var(--sans);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: var(--block);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
button:hover, .btn:hover { background: var(--block-2); color: var(--ink); transform: translateY(-1px); }
button:active, .btn:active { transform: scale(0.97); }
button:disabled { opacity: 0.45; cursor: default; transform: none; }
button.primary, .btn.primary {
  color: var(--on-primary);
  background: var(--primary);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 30%, transparent);
}
button.primary:hover, .btn.primary:hover { color: var(--on-primary); background: var(--primary-hover); box-shadow: 0 10px 22px color-mix(in srgb, var(--primary) 34%, transparent); }
button.quiet { background: transparent; color: var(--ink-2); padding: 0 12px; }
button.quiet:hover { background: var(--block); color: var(--ink); transform: none; }
button.small, .btn.small { height: 32px; padding: 0 14px; font-size: 13px; }
button.quiet.small { padding: 0 10px; }
button.danger, .danger { color: var(--danger); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

label.field, div.field { display: block; }
.field > span { display: block; margin: 0 0 7px 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=search], select, textarea {
  font: 500 15px/1.5 var(--sans);
  color: var(--ink);
  width: 100%;
  padding: 10px 15px;
  border: 1.5px solid transparent;
  border-radius: var(--r-field);
  background: var(--block);
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); font-weight: 400; }
input:hover, select:hover, textarea:hover { background: var(--block-2); }
input:focus, select:focus, textarea:focus {
  outline: none;
  background: var(--surface);
  border-color: color-mix(in srgb, var(--primary) 45%, transparent);
  box-shadow: 0 0 0 4px var(--primary-soft);
}
select {
  -webkit-appearance: none;
  appearance: none;
  height: 44px;
  padding-top: 0;
  padding-bottom: 0;
  padding-right: 40px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%239b9ba2' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px;
}
.builder-toolbar select, .page-head select, .add-row select { height: 40px; border-radius: 999px; padding-left: 18px; }
textarea { resize: vertical; line-height: 1.6; }
input[type=file] { font: 500 14px var(--sans); color: var(--ink-2); max-width: 100%; }
input[type=file]::file-selector-button {
  font: 600 14px var(--sans);
  height: 40px;
  margin-right: 14px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  color: var(--on-primary);
  background: var(--primary);
  cursor: pointer;
}
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 18px; height: 18px; margin: 0; flex: none; cursor: pointer; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.stack { display: grid; gap: 22px; }
.inline-check { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.help { font-size: 13px; color: var(--ink-3); margin: 7px 0 0 4px; }

.panel { background: var(--surface); border-radius: var(--r-card); padding: 30px 32px; box-shadow: var(--shadow); }
.panel + .panel, .panel + details.panel, details.panel + .panel { margin-top: 22px; }
.panel > h2 { margin-bottom: 18px; }
details.panel { padding-top: 22px; padding-bottom: 22px; }
details.panel > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 700 !important;
}
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::before {
  content: "";
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 10px;
  background: var(--block) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4.5 3l3 3-3 3' fill='none' stroke='%239b9ba2' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
  transition: transform 0.3s var(--ease);
}
details.panel[open] > summary::before { transform: rotate(90deg); }
details.panel[open] > :not(summary) { animation: rise 0.35s var(--ease) both; }
.empty { padding: 48px 32px; text-align: center; color: var(--ink-2); }
.empty h2 { margin-bottom: 8px; font-size: 22px; }
.empty .btn-row { justify-content: center; margin-top: 24px; }
.panel.empty.soft { background: transparent; box-shadow: none; padding-top: 32px; }

.pill { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--block); color: var(--ink-2); }
.pill.must { background: var(--lavender); color: var(--lavender-ink); }
.status-ready { color: var(--success); font-weight: 600; }
.status-error { color: var(--danger); font-weight: 600; }
.status-running, .status-queued { color: var(--warn); font-weight: 600; }

/* Segmented control: the appearance switch. */
.segmented { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--block); }
.segmented button { height: 32px; padding: 0 14px; font-size: 13px; background: transparent; color: var(--ink-2); }
.segmented button:hover { background: transparent; color: var(--ink); transform: none; }
.segmented button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.segmented svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.segmented svg [fill="currentColor"] { fill: currentColor; }
.rail .theme-switch { margin: 0 6px; justify-self: start; }
.rail .theme-switch button { width: 40px; padding: 0; }

/* ------------------------------------------------------------- toasts, dialogs, spinners */
#toasts { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: grid; gap: 10px; width: min(380px, calc(100vw - 48px)); }
.toast {
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  border-left: 0;
  animation: toast-in 0.45s var(--ease) both;
}
.toast::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 10px; border-radius: 50%; background: var(--success); vertical-align: 1px; }
.toast.error { background: var(--surface); color: var(--danger); }
.toast.error::before { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } }

dialog {
  border: 0;
  border-radius: 28px;
  padding: 0;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}
dialog[open] { animation: pop 0.35s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
dialog::backdrop { background: rgba(30, 30, 45, 0.22); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog .dlg-head { padding: 28px 30px 0; }
dialog .dlg-head h2 { font-size: 21px; }
dialog .dlg-body { padding: 16px 30px 22px; overflow: auto; max-height: calc(100vh - 230px); }
dialog .dlg-foot { padding: 16px 22px 20px; display: flex; justify-content: flex-end; gap: 10px; background: var(--block); }
pre.doc-text { white-space: pre-wrap; font: 14.5px/1.7 var(--sans); margin: 0; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid var(--lavender);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  flex: none;
  vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------- library */
.lib { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 26px; align-items: start; }
.lib-list {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 12px;
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.lib-group { margin-top: 16px; }
.lib-group-head { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 6px 12px; }
.lib-group-head h3 { font-size: 12.5px; color: var(--ink-3); font-weight: 700; }
button.lib-item {
  display: block;
  width: 100%;
  height: auto;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--r-row);
  background: none;
  white-space: normal;
  line-height: 1.35;
}
button.lib-item:hover { background: var(--block); transform: none; }
button.lib-item:active { transform: scale(0.99); }
.lib-item .t { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.lib-item .m { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 500; color: var(--ink-3); }
button.lib-item.active { background: var(--lavender); }
button.lib-item.active .t { color: var(--lavender-ink); }
.lib-item.dragging { opacity: 0.4; }
.lib-item.drop-before { box-shadow: inset 0 3px 0 var(--primary); }
.lib-item.never .t { color: var(--ink-3); text-decoration: line-through; }

.editor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 26px; }
.editor-head h2 { font-size: 24px; }
.save-state { font-size: 13px; font-weight: 500; color: var(--ink-3); min-width: 64px; text-align: right; }
.facts { display: grid; gap: 10px; }
.fact { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; }
.fact textarea { min-height: 46px; }
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 7px;
  border: 1.5px solid transparent;
  border-radius: var(--r-field);
  background: var(--block);
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.chips:focus-within { background: var(--surface); border-color: color-mix(in srgb, var(--primary) 45%, transparent); box-shadow: 0 0 0 4px var(--primary-soft); }
.chip { display: inline-flex; align-items: center; gap: 2px; height: 30px; padding: 0 4px 0 13px; border-radius: 999px; background: var(--sky); color: var(--sky-ink); font-size: 13.5px; font-weight: 600; animation: pop 0.25s var(--ease) both; }
.chip button { height: 22px; width: 22px; padding: 0; border-radius: 50%; background: none; color: inherit; font-size: 15px; }
.chip button:hover { background: color-mix(in srgb, var(--sky-ink) 15%, transparent); transform: none; }
.chips input, .chips input:focus, .chips input:hover { border: 0; box-shadow: none; background: transparent; flex: 1; min-width: 140px; padding: 4px 8px; }
.drop {
  border: 2px dashed color-mix(in srgb, var(--primary) 30%, transparent);
  border-radius: var(--r-block);
  padding: 28px;
  text-align: center;
  color: var(--lavender-ink);
  font-weight: 600;
  background: var(--lavender);
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.drop:hover { border-color: var(--primary); }
.drop.over { border-color: var(--primary); transform: scale(1.01); }
.doc-list { display: grid; gap: 8px; margin-top: 12px; }
.doc-list:empty { display: none; }
.doc-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 10px 9px 16px; border-radius: var(--r-row); background: var(--block); }
.doc-row .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vis { display: flex; gap: 22px; flex-wrap: wrap; }
.links { display: grid; gap: 10px; }
.link-row { display: grid; grid-template-columns: 180px 1fr auto; gap: 10px; }

.proposal { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 14px 16px; margin-bottom: 8px; border-radius: var(--r-row); background: var(--block); align-items: start; cursor: pointer; }
.proposal input { margin-top: 3px; }
.proposal .src { margin-top: 4px; font-size: 12.5px; color: var(--ink-3); }

/* ------------------------------------------------------------- jobs */
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden; }
.table th, .table td { text-align: left; padding: 15px 22px; vertical-align: top; }
.table th { font-size: 12.5px; font-weight: 700; color: var(--ink-3); background: var(--block); }
.table td { border-top: 1px solid var(--line); }
.table tr.clickable { cursor: pointer; }
.table tr.clickable td { transition: background-color 0.2s var(--ease); }
.table tr.clickable:hover td { background: var(--block); }
.panel .table { box-shadow: none; border-radius: var(--r-block); }
.req-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.req-list li { display: grid; grid-template-columns: 60px 1fr; gap: 12px; align-items: baseline; }
.kw-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.job-text { white-space: pre-wrap; font: 14.5px/1.75 var(--sans); max-height: 460px; overflow: auto; padding: 20px 22px; background: var(--block); border-radius: var(--r-block); }

/* ------------------------------------------------------------- resume builder */
.builder-toolbar { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.builder-toolbar select { width: auto; }
.builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 42%); gap: 26px; align-items: start; }
.side { position: sticky; top: 24px; display: grid; gap: 14px; align-content: start; }
.side-tabs { justify-self: start; }
.side > section { animation: rise 0.3s var(--ease) both; }

.cov {
  max-height: calc(100vh - 100px);
  overflow: auto;
  padding: 22px 20px;
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13.5px;
}
.cov:empty { display: none; }
.cov h3 { margin-bottom: 10px; font-size: 13.5px; font-weight: 700; }
.cov section + section { margin-top: 24px; }
.cov .req { display: grid; grid-template-columns: 14px 1fr; gap: 10px; margin-bottom: 10px; line-height: 1.45; }
.dot { width: 11px; height: 11px; border-radius: 50%; margin-top: 4px; border: 2.5px solid var(--block-2); }
.dot.covered { background: var(--success); border-color: var(--success); }
.dot.partial { background: linear-gradient(90deg, var(--warn) 50%, transparent 50%); border-color: var(--warn); }
.dot.gap { border-color: var(--peach-ink); }
.kw { display: inline-flex; align-items: center; height: 26px; margin: 0 5px 6px 0; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.kw.on { background: var(--mint); color: var(--mint-ink); }
.kw.off { background: var(--block); color: var(--ink-3); }
.cov .gap-advice { padding: 12px 14px; margin-bottom: 10px; border-radius: 14px; background: var(--peach); color: var(--ink-2); }
.cov .gap-advice strong { color: var(--peach-ink); }

.modules { display: grid; }
.module { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow); margin-bottom: 22px; transition: opacity 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.module:hover { box-shadow: var(--shadow-hover); }
.module.off { opacity: 0.55; }
.module.busy { pointer-events: none; }
.module.busy .module-body { opacity: 0.45; transition: opacity 0.3s var(--ease); }
.module-head { display: flex; gap: 8px; align-items: center; padding: 18px 18px 6px 20px; flex-wrap: wrap; }
.module-head input.heading {
  flex: 1;
  min-width: 150px;
  width: auto;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.015em;
  padding: 4px 10px;
  margin-left: -10px;
  background: transparent;
}
.module-head input.heading:hover { background: var(--block); }
.module-head input.heading:focus { background: var(--surface); }
.module-head .tools { display: flex; gap: 2px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.module-head .inline-check { margin: 0 8px 0 4px; font-size: 13px; }
.module-body { padding: 10px 22px 24px; }
.regen-bar { display: flex; gap: 10px; padding: 12px; margin: 8px 18px 4px; border-radius: var(--r-block); background: var(--lavender); animation: rise 0.3s var(--ease) both; }
.regen-bar input { background: var(--surface); }
.item .regen-bar { margin: 10px 0 0; }
.lock-on { color: var(--lavender-ink) !important; background: var(--lavender) !important; }

.item + .item { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.item-head { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.item-name { min-width: 0; }
.item-head .who { font-weight: 700; }
.item-head .where { color: var(--ink-2); font-weight: 500; }
.item-head .when { color: var(--ink-3); font-size: 13px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.item-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 34px; }
.item-tools { display: flex; gap: 2px; margin-left: auto; flex: none; }
.item-sub { font-size: 13px; color: var(--ink-2); min-width: 0; }
.bullets { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.bullet { display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: start; padding: 9px 8px; border-radius: var(--r-row); transition: background-color 0.2s var(--ease); }
.bullet:hover { background: var(--block); }
.bullet > input[type=checkbox] { margin-top: 3px; }
.bullet .text { font-size: 15px; line-height: 1.6; padding: 0 6px; border-radius: 8px; outline: none; white-space: pre-wrap; }
.bullet .text:focus { background: var(--surface); box-shadow: 0 0 0 2px var(--primary-soft); }
.bullet.off .text { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--block-2); }
.bullet .side { display: flex; gap: 2px; align-items: center; opacity: 0; transition: opacity 0.2s var(--ease); }
.bullet:hover .side, .bullet:focus-within .side, .bullet .side.keep { opacity: 1; }
button.src-btn { height: 26px; padding: 0 11px; font-size: 12px; background: var(--yellow); color: var(--yellow-ink); }
button.src-btn:hover { background: var(--yellow-strong); color: var(--yellow-ink); }
button.src-btn.none { background: var(--peach); color: var(--peach-ink); }
.flag { grid-column: 2 / 4; font-size: 13px; font-weight: 500; color: var(--peach-ink); padding-left: 6px; }
.evidence {
  grid-column: 2 / 4;
  margin: 6px 0 4px 6px;
  padding: 14px 16px;
  border-radius: var(--r-block);
  background: var(--yellow);
  font-size: 13.5px;
  display: grid;
  gap: 12px;
  animation: rise 0.3s var(--ease) both;
}
.evidence .from { font-size: 12px; font-weight: 700; color: var(--yellow-ink); }
.evidence .quote { font-size: 14px; line-height: 1.65; color: var(--ink); }
.evidence mark { background: var(--yellow-strong); color: inherit; padding: 1px 3px; border-radius: 4px; }
.pin-on { color: var(--lavender-ink) !important; background: var(--lavender) !important; }
.add-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.add-row select { width: auto; max-width: 340px; }
.summary-text { min-height: 84px; }
.skill-row { display: grid; grid-template-columns: 180px 1fr auto; gap: 10px; margin-bottom: 10px; }

.preview { display: grid; gap: 12px; }
.preview-frame { width: 100%; height: calc(100vh - 160px); min-height: 520px; border: 0; border-radius: var(--r-block); background: #fff; box-shadow: var(--paper-shadow); }
.preview-empty { height: 360px; display: grid; place-items: center; text-align: center; padding: 28px; border-radius: var(--r-card); background: var(--block); color: var(--ink-2); }
.build-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13.5px; min-height: 40px; }
.build-errors { font: 12.5px/1.6 var(--mono); color: var(--danger); background: var(--peach); padding: 14px 16px; border-radius: var(--r-block); white-space: pre-wrap; }
.building { text-align: center; padding-top: 40px; padding-bottom: 40px; }
.building .presence { margin: 22px auto 6px; }
.progress { list-style: none; padding: 0; margin: 18px auto 0; display: grid; gap: 10px; max-width: 420px; text-align: left; }
.progress li { display: flex; gap: 12px; align-items: center; color: var(--ink-2); font-weight: 500; animation: rise 0.35s var(--ease) both; }
.progress li::before { content: ""; width: 20px; height: 20px; flex: none; border-radius: 50%; }
.progress li.done::before { background: var(--mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.2l2 2 4-4.4' fill='none' stroke='%234fae85' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; }
.progress li.now { color: var(--ink); font-weight: 600; }
.progress li.now::before { background: var(--lavender); box-shadow: inset 0 0 0 6px var(--lavender), inset 0 0 0 10px var(--primary); animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(0.85); } }

/* ------------------------------------------------------------- templates */
.tpl { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 26px; align-items: start; }
.tpl > aside { display: grid; gap: 4px; padding: 12px; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); }
.tpl > aside > button.small { margin-top: 12px; justify-self: start; }
.tpl-files { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tpl-files button.on { background: var(--sky); color: var(--sky-ink); }
textarea.code { font: 13px/1.65 var(--mono); min-height: 60vh; tab-size: 2; white-space: pre; }
.code-hint { white-space: pre-wrap; font: 12.5px/1.7 var(--mono); color: var(--ink-2); background: var(--block); padding: 14px 16px; border-radius: var(--r-block); }

/* ------------------------------------------------------------- sign-in */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-panel {
  width: min(400px, 100%);
  padding: 40px 36px 34px;
  border-radius: 32px;
  text-align: center;
  background: var(--surface);
  box-shadow: var(--shadow-hover);
  animation: pop 0.5s var(--ease) both;
}
.login-icon { display: block; margin: 0 auto 18px; width: 64px; height: 64px; border-radius: 20px; box-shadow: var(--shadow-hover); }
.login-panel h1 { font-size: 26px; }
.login-sub { margin: 6px 0 26px; }
.login-panel form { text-align: left; }
.login-panel button.primary { width: 100%; height: 46px; font-size: 15px; }
.login-panel pre { margin: 14px 0; text-align: left; }
.login-panel .status-error { text-align: center; font-size: 13.5px; }


/* ------------------------------------------------------------- writing assistant */
.assist-fab {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 40;
  height: 50px;
  padding: 0 20px 0 10px;
  gap: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
  animation: rise 0.4s var(--ease) both;
}
.assist-fab:hover { background: var(--surface); box-shadow: var(--shadow-pop), 0 0 0 4px var(--primary-soft); }
.assist-fab .avatar { width: 32px; height: 32px; }
.assist-fab .avatar svg { width: 17px; height: 17px; }
body:has(.assist-fab:not(.hidden)) #toasts { bottom: 96px; }

.assist {
  position: fixed;
  z-index: 50;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: min(440px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  animation: slide-in 0.38s var(--ease) both;
}
@keyframes slide-in { from { opacity: 0; transform: translateX(24px); } }
.assist-head { display: flex; align-items: center; gap: 12px; padding: 18px 16px 14px 20px; }
.assist-head .avatar.writer svg { width: 18px; height: 18px; }
.assist-title { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.assist-title strong { font-size: 16px; }
.assist-ctx { font-size: 12.5px; font-weight: 600; color: var(--lavender-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.assist-head .close { font-size: 20px; width: 36px; padding: 0; }

.assist-msgs { flex: 1; overflow: auto; padding: 6px 20px 18px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.assist-intro { margin: auto 0; text-align: center; padding: 20px 6px; animation: rise 0.4s var(--ease) both; }
.assist-hero { width: 64px; height: 64px; margin-bottom: 14px; }
.assist-hero svg { width: 30px !important; height: 30px !important; }
.assist-intro h3 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.assist-intro p { font-size: 14px; margin: 0 auto; max-width: 34ch; }
.starters { display: grid; gap: 8px; margin-top: 20px; }
button.starter { justify-content: flex-start; height: auto; min-height: 44px; padding: 10px 16px; border-radius: 16px; background: var(--lavender); color: var(--lavender-ink); text-align: left; white-space: normal; line-height: 1.35; }
button.starter:hover { background: var(--lavender); color: var(--lavender-ink); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 35%, transparent); }

.msg { display: grid; gap: 8px; animation: rise 0.3s var(--ease) both; }
.msg.user { justify-items: end; }
.msg .bubble { max-width: 88%; padding: 11px 15px; font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user .bubble { background: var(--lavender); color: var(--ink); border-radius: 18px 18px 6px 18px; }
.msg.assistant .bubble { justify-self: start; background: var(--block); border-radius: 18px 18px 18px 6px; }
.msg.assistant .bubble.error { background: var(--peach); color: var(--peach-ink); }
.msg .presence { justify-self: start; }

.proposals { display: grid; gap: 10px; }
.proposal-card { display: grid; gap: 8px; padding: 14px 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow), 0 0 0 1px var(--line); animation: pop 0.3s var(--ease) both; transition: opacity 0.3s var(--ease); }
.proposal-card.applied { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--success) 45%, transparent); }
.proposal-card.dismissed { opacity: 0.55; padding: 8px 16px; box-shadow: none; background: var(--block); }
.proposal-top { display: flex; align-items: center; gap: 8px; }
.proposal-top .pill { height: 24px; font-size: 12px; }
.proposal-before { font-size: 13px; color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--block-2); }
.proposal-text { font-size: 14.5px; line-height: 1.55; font-weight: 500; }
.proposal-reason { font-size: 12.5px; color: var(--ink-3); }
.proposal-card .flag, .proposal-flag { grid-column: auto; padding: 0; }
.chip.static { padding: 0 12px; }
.applied-note { font-size: 13px; font-weight: 700; color: var(--success); }
.applied-note::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--success); }
button.apply-all { justify-self: start; }

.assist-compose { display: flex; align-items: flex-end; gap: 10px; padding: 12px 14px 14px 16px; background: var(--block); }
.assist-compose textarea { resize: none; min-height: 46px; max-height: 160px; background: var(--surface); border-radius: 20px; padding: 12px 16px; }
.assist-compose textarea:hover { background: var(--surface); }
button.send { width: 46px; height: 46px; padding: 0; flex: none; }
button.send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
button.ask::before { content: ""; width: 14px; height: 14px; margin-right: -2px; background: var(--primary); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3.5l1.9 5.1 5.1 1.9-5.1 1.9L12 17.5l-1.9-5.1L5 10.5l5.1-1.9z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3.5l1.9 5.1 5.1 1.9-5.1 1.9L12 17.5l-1.9-5.1L5 10.5l5.1-1.9z'/%3E%3C/svg%3E") center / contain no-repeat; }
button.ask { color: var(--lavender-ink); }
button.assist-inline { background: var(--lavender); color: var(--lavender-ink); }
button.assist-inline:hover { background: var(--lavender); color: var(--lavender-ink); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 30%, transparent); }

@media (max-width: 920px) {
  .assist-fab { right: 16px; bottom: calc(92px + env(safe-area-inset-bottom)); height: 46px; }
  .assist-fab span:last-child { display: none; }
  .assist-fab { padding: 0 7px; }
  .assist { top: 8vh; right: 0; bottom: 0; left: 0; width: 100%; border-radius: 28px 28px 0 0; animation-name: sheet-up; }
  @keyframes sheet-up { from { opacity: 0; transform: translateY(30px); } }
}

/* ------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .builder { grid-template-columns: 1fr; }
  .side { position: static; }
  .cov { max-height: none; }
  .preview-frame { height: 82vh; }
}
@media (max-width: 920px) {
  .rail {
    inset: auto 50% calc(14px + env(safe-area-inset-bottom)) auto;
    width: auto;
    max-width: calc(100vw - 24px);
    flex-direction: row;
    gap: 2px;
    padding: 6px;
    border-radius: 999px;
    transform: translateX(50%);
    background: var(--surface);
    box-shadow: var(--shadow-pop);
  }
  .rail .brand, .rail-note, .rail .theme-switch, .me { display: none; }
  .rail a[data-nav], .rail-link { flex-direction: column; justify-content: center; gap: 2px; height: 58px; min-width: 60px; padding: 0 6px; border-radius: 22px; font-size: 10.5px; }
  .rail a[data-nav] svg, .rail-link svg { width: 30px; height: 30px; padding: 6px; }
  .rail a[data-nav].active { box-shadow: none; background: var(--block); }
  .rail-foot { margin: 0; display: flex; }
  button.rail-link { width: auto; height: 58px; justify-content: center; }
  main { margin-left: 0; padding: 0 18px calc(110px + env(safe-area-inset-bottom)); }
  .page-head { padding: 28px 0 20px; }
  h1 { font-size: 27px; }
  .panel { padding: 24px 20px; }
  .lib, .builder, .tpl { grid-template-columns: 1fr; }
  .lib-list, .cov { position: static; max-height: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .link-row, .skill-row { grid-template-columns: 1fr; }
  #toasts { right: 12px; bottom: calc(96px + env(safe-area-inset-bottom)); width: calc(100vw - 24px); }
}
@media (max-width: 420px) {
  .rail a[data-nav], .rail-link { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .spinner { animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
}
