/*!
 * HireReady — editorial theme. Ivory paper, ink black, electric vermilion.
 * Designed & built by Kumar Nikhil.
 */
:root {
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 10px;
  --radius-sm: 6px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow: 0 1px 0 rgba(23, 20, 15, .04), 0 8px 24px -12px rgba(23, 20, 15, .25);
  --shadow-paper: 0 1px 2px rgba(0, 0, 0, .08), 0 18px 40px -18px rgba(40, 28, 10, .45);
}
html[data-theme="paper"] {
  --bg: #F6F1E7; --bg2: #EFE8DA; --card: #FFFCF5; --ink: #17140F; --muted: #5C564B; --line: #DDD3C1; --line2: #CBBFAA;
  --accent: #E5372B; --accent-ink: #B9261C; --accent-soft: #FBE3DF; --on-accent: #FFFFFF;
  --ok: #1E7A4C; --ok-soft: #DFF1E6; --warn: #8E5B00; --warn-soft: #F8EBCF; --bad: #B9261C; --bad-soft: #FADDD9; --info: #2D5D8F; --info-soft: #E1EAF4;
  --focus: #1F5FAD; --hl-hit: #CDEFD9; --hl-miss: #FBD3CC; --grain: .06;
  color-scheme: light;
}
html[data-theme="midnight"] {
  --bg: #11131A; --bg2: #161923; --card: #1B1F2A; --ink: #ECE7DD; --muted: #ABA597; --line: #2D3242; --line2: #3B4257;
  --accent: #FF5A47; --accent-ink: #FF8576; --accent-soft: #3A1D1C; --on-accent: #16090A;
  --ok: #5FD39C; --ok-soft: #173326; --warn: #F0B54A; --warn-soft: #3A2C10; --bad: #FF7B6E; --bad-soft: #3D1D1B; --info: #8EB8F0; --info-soft: #1B2840;
  --focus: #8EB8F0; --hl-hit: #1F4A33; --hl-miss: #5A2522; --grain: .0;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 28px -14px rgba(0, 0, 0, .8);
  --shadow-paper: 0 2px 4px rgba(0, 0, 0, .4), 0 22px 50px -20px rgba(0, 0, 0, .9);
  color-scheme: dark;
}
html[data-theme="contrast"] {
  --bg: #000000; --bg2: #000000; --card: #000000; --ink: #FFFFFF; --muted: #F0F0F0; --line: #FFFFFF; --line2: #FFFFFF;
  --accent: #FFD400; --accent-ink: #FFD400; --accent-soft: #000000; --on-accent: #000000;
  --ok: #7CFF8A; --ok-soft: #000000; --warn: #FFD400; --warn-soft: #000000; --bad: #FF8A80; --bad-soft: #000000; --info: #9AD0FF; --info-soft: #000000;
  --focus: #FFD400; --hl-hit: #005A1E; --hl-miss: #7A0000; --grain: 0;
  --shadow: none; --shadow-paper: 0 0 0 2px #FFFFFF;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg);
  background-image: radial-gradient(rgba(120, 95, 50, var(--grain)) 1px, transparent 1px); background-size: 4px 4px;
  min-height: 100vh; display: flex; flex-direction: column;
}
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 2.6vw, 2.4rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .75em; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
code, kbd { font-family: var(--mono); font-size: .9em; }
kbd { border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 4px; padding: 0 .35em; background: var(--card); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
html[data-theme="contrast"] :focus-visible { outline-width: 4px; }
.sr-only { position: absolute !important; 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: 1rem; top: -3rem; z-index: 100; background: var(--ink); color: var(--bg); padding: .5rem 1rem; border-radius: var(--radius-sm); transition: top .2s; }
.skip:focus { top: .6rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.row { display: flex; align-items: center; }
.gap { gap: .5rem; }
.wrap { flex-wrap: wrap; }
.noscript { padding: 1rem; background: var(--accent-soft); text-align: center; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ top bar */
.topbar {
  position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem;
  padding: .6rem clamp(.8rem, 2vw, 1.6rem); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--line);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) { .topbar { background: var(--bg); } }
.brand { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.logo { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 10px; transition: transform .25s var(--ease); }
.logo:hover { transform: rotate(-6deg) scale(1.04); }
.logo:active { transform: scale(.94); }
.logo-paper { fill: var(--card); stroke: var(--ink); stroke-width: 2.2; }
.logo-lines { stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; }
.logo-dot { fill: var(--accent); }
.logo-tick { fill: none; stroke: var(--on-accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.logo.spin-once { animation: spin 0.9s var(--ease); }
@keyframes spin { to { transform: rotate(360deg); } }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.wordmark { font-family: var(--serif); font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; }
.wordmark em { font-style: italic; color: var(--accent-ink); }
.tagline { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32ch; min-height: 1.2em; }
.caret { display: inline-block; width: 1px; height: 1em; background: var(--accent); margin-left: 2px; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.tabs { display: flex; gap: .15rem; justify-content: center; overflow-x: auto; scrollbar-width: none; padding: .2rem; }
.tabs::-webkit-scrollbar { display: none; }
.tabs [role=tab] {
  position: relative; font: inherit; font-size: .92rem; font-weight: 550; color: var(--muted); background: none; border: 0; padding: .5rem .8rem; border-radius: 999px; cursor: pointer; white-space: nowrap;
  transition: color .2s, background .2s;
}
.tabs [role=tab]:hover { color: var(--ink); background: var(--bg2); }
.tabs [role=tab][aria-selected="true"] { color: var(--ink); }
.tabs [role=tab][aria-selected="true"]::after { content: ""; position: absolute; left: .8rem; right: .8rem; bottom: .22rem; height: 2px; background: var(--accent); border-radius: 2px; animation: inkline .45s var(--ease); transform-origin: left; }
@keyframes inkline { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.top-actions { display: flex; align-items: center; gap: .6rem; }
.privacy-pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--ok); background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); padding: .2rem .6rem; border-radius: 999px; white-space: nowrap; }
.theme-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--card); }
.theme-switch button { background: none; border: 0; padding: 4px; border-radius: 999px; cursor: pointer; display: grid; place-items: center; }
.theme-switch button[aria-pressed="true"] { background: var(--bg2); box-shadow: inset 0 0 0 1.5px var(--accent); }
.sw { width: 16px; height: 16px; border-radius: 50%; display: block; border: 1px solid rgba(0, 0, 0, .3); }
.sw-paper { background: linear-gradient(135deg, #F6F1E7 50%, #E5372B 50%); }
.sw-midnight { background: linear-gradient(135deg, #11131A 50%, #FF5A47 50%); }
.sw-contrast { background: linear-gradient(135deg, #000 50%, #FFD400 50%); }

/* ------------------------------------------------------------------ layout */
main { flex: 1; width: 100%; max-width: 1560px; margin: 0 auto; padding: 1rem clamp(.7rem, 2vw, 1.6rem) 2rem; outline: none; }
.view.enter { animation: inkReveal .55s var(--ease) backwards; }
@keyframes inkReveal {
  from { opacity: 0; transform: perspective(1600px) rotateY(-6deg) translateX(-10px); clip-path: inset(0 100% 0 0); }
  60% { opacity: 1; }
  to { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
}
.view-head { max-width: 80ch; margin: .4rem 0 1.1rem; }
.view-head h1 { position: relative; display: inline-block; }
.view-head h1::after { content: ""; position: absolute; left: 0; bottom: -.15em; height: .18em; width: 100%; background: var(--accent); opacity: .85; transform-origin: left; animation: inkline .8s .15s var(--ease) both; border-radius: 2px; }
.view-head p { color: var(--muted); font-size: 1.02rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.card + .card { margin-top: .9rem; }
.card-title { font-size: 1.1rem; display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.hint { font-family: var(--sans); font-size: .76rem; font-weight: 400; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem .9rem; }

/* ------------------------------------------------------------------ buttons & inputs */
.btn {
  font: inherit; font-size: .9rem; font-weight: 560; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; cursor: pointer; white-space: nowrap;
  color: var(--ink); background: var(--card); border: 1px solid var(--line2); border-radius: 999px; padding: .45rem .95rem; line-height: 1.2;
  transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s; position: relative; overflow: hidden; text-decoration: none;
}
.btn:hover { border-color: var(--ink); transform: translateY(-1px); box-shadow: 0 4px 10px -6px rgba(0, 0, 0, .35); }
.btn:active { transform: translateY(0) scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-accent:hover { border-color: var(--accent-ink); background: var(--accent-ink); color: var(--on-accent); }
html[data-theme="contrast"] .btn-accent:hover { background: #fff; color: #000; }
.btn-accent::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s var(--ease); }
.btn-accent:hover::after { transform: translateX(120%); }
.btn-ink { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg2); border-color: var(--line2); }
.btn-danger, .btn.danger:hover { color: var(--bad); border-color: var(--bad); }
.btn-danger { background: var(--bad-soft); }
.btn-icon { padding: .35rem .6rem; min-width: 2.2rem; font-size: 1.05rem; }
.btn-sm { font-size: .8rem; padding: .28rem .7rem; }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.icon-btn:hover:not(:disabled) { background: var(--bg2); color: var(--ink); border-color: var(--line); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn.danger:hover { color: var(--bad); }
.icon-btn[aria-pressed="false"] { color: var(--bad); }
.drag { cursor: grab; }
.drag:active { cursor: grabbing; }
.link-btn { font: inherit; font-size: .86rem; background: none; border: 0; color: var(--accent-ink); cursor: pointer; padding: 0 .2rem; text-decoration: underline; text-underline-offset: 3px; }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
input[type=text], input[type=email], input[type=tel], input[type=number], select, textarea {
  font: inherit; font-size: .93rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line2); border-radius: var(--radius-sm); padding: .45rem .6rem; width: 100%;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
html[data-theme="paper"] input[type=text], html[data-theme="paper"] input[type=email], html[data-theme="paper"] input[type=tel], html[data-theme="paper"] input[type=number], html[data-theme="paper"] select, html[data-theme="paper"] textarea { background: #FFFEFB; }
textarea { resize: vertical; line-height: 1.5; min-height: 2.6em; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
input.invalid, input[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-soft); }
input:disabled { opacity: .55; }
input[type=range] { accent-color: var(--accent); width: 100%; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; }
input[type=color] { width: 2.4rem; height: 2rem; border: 1px solid var(--line2); border-radius: 6px; background: none; padding: 2px; cursor: pointer; }
.field { display: flex; flex-direction: column; gap: .28rem; min-width: 0; margin: 0; border: 0; padding: 0; }
.field > label, .field > span, .field legend { font-size: .8rem; font-weight: 600; color: var(--muted); }
.field legend { margin-bottom: .3rem; }
.field-wide { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: .5rem; font-size: .88rem; grid-column: 1 / -1; cursor: pointer; }
label.inline { display: inline-flex; align-items: center; gap: .4rem; font-size: .84rem; color: var(--muted); font-weight: 600; }
label.inline select { width: auto; }
.flash { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 20%, 60% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 45%, transparent); } }
.badge { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 650; padding: .12rem .5rem; border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); background: var(--card); white-space: nowrap; }
.badge:empty { display: none; }
.badge-ok { color: var(--ok); background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.badge-warn { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.badge-bad { color: var(--bad); background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; padding: .18rem .55rem; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); }
.chip-btn { font: inherit; font-size: .8rem; cursor: pointer; color: var(--ink); transition: transform .12s, background .15s; }
.chip-btn:hover { background: var(--accent-soft); border-color: var(--accent); transform: translateY(-1px); }
.chips { list-style: none; padding: 0; margin: 0 0 .5rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.chip-hit { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 40%, transparent); color: var(--ink); }
.chip-miss { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 40%, transparent); color: var(--ink); }
.chip.soft { border-style: dashed; }
.chip .req { font-size: .62rem; font-weight: 700; text-transform: uppercase; background: var(--bad); color: var(--card); border-radius: 4px; padding: 0 .25rem; }
html[data-theme="contrast"] .chip .req { color: #000; }
.chip .cnt { font-size: .7rem; color: var(--muted); }

/* ------------------------------------------------------------------ docbar */
.docbar { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; margin-bottom: .9rem; padding: .55rem .7rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.doc-left { display: flex; align-items: center; gap: .6rem; min-width: 0; flex-wrap: wrap; }
.resume-select { width: auto; max-width: 300px; font-family: var(--serif); font-weight: 600; font-size: 1rem; }
.save-state { font-size: .76rem; color: var(--ok); display: inline-flex; align-items: center; gap: .3rem; }
.save-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.save-state.pulse { color: var(--warn); }
.doc-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: "\25BE"; font-size: .75em; margin-left: .2rem; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 270px; background: var(--card); border: 1px solid var(--line2); border-radius: var(--radius); box-shadow: var(--shadow-paper); padding: .35rem; display: flex; flex-direction: column; animation: drop .18s var(--ease); }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.menu-pop button { font: inherit; text-align: left; background: none; border: 0; border-radius: 8px; padding: .5rem .7rem; cursor: pointer; color: var(--ink); display: flex; flex-direction: column; }
.menu-pop button:hover, .menu-pop button:focus-visible { background: var(--bg2); }
.menu-pop small { color: var(--muted); font-size: .76rem; }
.mini-score { display: inline-flex; align-items: baseline; gap: .3rem; border: 1px solid var(--line2); background: var(--card); border-radius: 999px; padding: .3rem .75rem; cursor: pointer; font: inherit; color: var(--ink); transition: transform .15s; }
.mini-score:hover { transform: translateY(-1px); }
.mini-num { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; }
.mini-lbl { font-size: .72rem; color: var(--muted); }
.mini-score.ok .mini-num { color: var(--ok); } .mini-score.warn .mini-num { color: var(--warn); } .mini-score.bad .mini-num { color: var(--bad); }

/* ------------------------------------------------------------------ builder split */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 1.1rem; align-items: start; }
.pane-preview { position: sticky; top: 74px; max-height: calc(100vh - 86px); overflow: auto; padding: 0 .2rem .6rem; border-radius: var(--radius); }
.mobile-switch { display: none; }
.preview-bar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: center; padding: .5rem .6rem; margin-bottom: .6rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.zoomctl input { width: 110px; }
.paper-stack { --paper-w: 760px; display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: .6rem 0 .8rem; position: relative; }
.paper { width: min(100%, var(--paper-w)); position: relative; background: #fff; border-radius: 2px; box-shadow: var(--shadow-paper); transform-origin: left center; }
.paper svg { display: block; width: 100%; height: auto; }
.paper text { white-space: pre; }
.page-no { position: absolute; right: .5rem; bottom: -1.35rem; font-size: .72rem; color: var(--muted); }
.paper-stack.flip .paper { animation: pageflip .7s var(--ease) both; }
.paper-stack.flip .paper:nth-child(2) { animation-delay: .08s; }
@keyframes pageflip { from { transform: perspective(1800px) rotateY(70deg); opacity: .2; } to { transform: none; opacity: 1; } }
.view.drop { outline: 3px dashed var(--accent); outline-offset: 6px; border-radius: var(--radius); }

/* editor cards */
.contact-card { margin-bottom: .9rem; }
.sec-list { display: flex; flex-direction: column; gap: .9rem; }
.sec-card { padding: .7rem .9rem .9rem; transition: box-shadow .2s, opacity .2s; }
.sec-card.is-hidden { opacity: .6; border-style: dashed; }
.sec-head { display: flex; align-items: center; gap: .4rem; margin-bottom: .6rem; }
.sec-title { font-family: var(--serif) !important; font-size: 1.12rem !important; font-weight: 650; background: transparent !important; border-color: transparent !important; padding: .2rem .4rem !important; flex: 1; min-width: 0; }
.sec-title:hover { border-color: var(--line2) !important; }
.sec-title:focus { background: var(--bg) !important; border-color: var(--focus) !important; }
.type-tag { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 .35rem; }
.sec-tools, .item-tools { display: inline-flex; gap: .1rem; margin-left: auto; }
.item-list { display: flex; flex-direction: column; gap: .55rem; }
details.item { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
html[data-theme="paper"] details.item { background: #FBF7EE; }
details.item > summary { list-style: none; display: flex; align-items: center; gap: .4rem; padding: .35rem .5rem; cursor: pointer; border-radius: var(--radius-sm); }
details.item > summary::-webkit-details-marker { display: none; }
details.item > summary::before { content: "\25B8"; color: var(--muted); transition: transform .2s; font-size: .8rem; }
details.item[open] > summary::before { transform: rotate(90deg); }
details.item > summary:hover { background: var(--bg2); }
.item-title { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.item-body { padding: .4rem .7rem .8rem; }
.add-item { margin-top: .6rem; }
.add-sec { margin-top: .9rem; }
.add-sec > label { font-weight: 650; font-family: var(--serif); font-size: 1.05rem; display: block; margin-bottom: .4rem; }
.add-sec select { max-width: 320px; }
.empty-mini { font-size: .86rem; color: var(--muted); font-style: italic; margin: .2rem 0; }
.meter { font-size: .76rem; color: var(--muted); margin-top: .2rem; }
.meter.ok { color: var(--ok); } .meter.warn { color: var(--warn); }
.drag-ghost { opacity: .4; outline: 2px dashed var(--accent); }

/* bullet coach */
.coach { margin-top: .45rem; padding: .6rem .7rem; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--accent); font-size: .85rem; animation: drop .2s var(--ease); }
.coach-head { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .3rem; }
.coach-score { font-family: var(--serif); font-weight: 700; }
.coach-score.ok { color: var(--ok); } .coach-score.warn { color: var(--warn); } .coach-score.bad { color: var(--bad); }
.coach-issues { margin: .2rem 0 .4rem; padding-left: 1.1rem; }
.coach-issues li { margin: .1rem 0; }
.coach-issues .lv-fail { color: var(--bad); } .coach-issues .lv-warn { color: var(--warn); } .coach-issues .lv-info { color: var(--muted); }
.coach-rewrite { background: var(--bg2); border-radius: 6px; padding: .4rem .55rem; margin: .3rem 0; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.coach-rewrite q { font-style: italic; flex: 1 1 200px; }
.coach-verbs { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin-top: .3rem; }
.coach-tools { display: flex; gap: .3rem; margin-top: .4rem; }
.ok-line { color: var(--ok); }
.preview-line { background: var(--bg2); border-radius: 6px; padding: .5rem .6rem; }

/* ------------------------------------------------------------------ templates */
.tpl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.1rem; align-items: start; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.tpl-card { font: inherit; text-align: left; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem; cursor: pointer; display: flex; flex-direction: column; gap: .6rem; box-shadow: var(--shadow); transition: transform .25s var(--ease), box-shadow .25s, border-color .2s; }
.tpl-card:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: var(--shadow-paper); }
.tpl-card.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), var(--shadow-paper); }
.tpl-thumb { display: block; background: #fff; border-radius: 3px; overflow: hidden; aspect-ratio: 612 / 792; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.tpl-thumb svg { width: 100%; height: 100%; display: block; }
.tpl-meta { display: flex; flex-direction: column; gap: .3rem; }
.tpl-meta strong { font-family: var(--serif); font-size: 1.1rem; }
.tpl-meta .badge { align-self: flex-start; }
.tpl-blurb { font-size: .82rem; color: var(--muted); }
.design { position: sticky; top: 80px; display: flex; flex-direction: column; gap: .8rem; }
.design output { font-weight: 700; color: var(--ink); }
.swatches { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--card); background: var(--sw); box-shadow: 0 0 0 1px var(--line2); cursor: pointer; transition: transform .15s; }
.swatch:hover { transform: scale(1.12); }
.swatch.on { box-shadow: 0 0 0 2px var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 999px; padding: 2px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: .3rem .9rem; border-radius: 999px; font-size: .86rem; }
.seg input:checked + span { background: var(--ink); color: var(--bg); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); }

/* ------------------------------------------------------------------ score lab */
.score-top { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 1.2rem; align-items: center; margin-bottom: 1rem; }
.gauge-wrap { text-align: center; }
.gauge { width: 100%; max-width: 360px; display: block; margin: 0 auto; overflow: visible; }
.g-track { fill: none; stroke: var(--bg2); stroke-width: 16; }
.g-bad, .g-warn, .g-ok { fill: none; stroke-width: 10; stroke-linecap: butt; }
.g-bad { stroke: var(--bad); } .g-warn { stroke: var(--warn); } .g-ok { stroke: var(--ok); }
.g-tick { stroke: var(--muted); stroke-width: 1.4; }
.g-lbl { font-size: 9px; fill: var(--muted); font-family: var(--sans); }
.g-needle { transform-box: view-box; transform-origin: 100px 100px; transition: transform 1.3s cubic-bezier(.34, 1.56, .64, 1); }
.g-needle-path { fill: var(--ink); }
.g-hub { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.g-num { font-family: var(--serif); font-weight: 700; font-size: 30px; fill: var(--ink); }
.grade { display: flex; flex-direction: column; gap: .2rem; margin-top: .2rem; }
.grade-name { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; }
.grade-quip { color: var(--muted); font-size: .9rem; }
.score-side h2 { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.estimate { background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); border-radius: var(--radius-sm); padding: .55rem .7rem; font-size: .9rem; }
.tally { display: flex; gap: .5rem; flex-wrap: wrap; margin: .6rem 0; font-size: .85rem; font-weight: 650; }
.tally span { padding: .15rem .6rem; border-radius: 999px; }
.t-pass { background: var(--ok-soft); color: var(--ok); } .t-warn { background: var(--warn-soft); color: var(--warn); } .t-fail { background: var(--bad-soft); color: var(--bad); } .t-info { background: var(--info-soft); color: var(--info); }
.checks { display: flex; flex-direction: column; gap: .5rem; }
details.check { background: var(--card); border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
details.check.st-pass { border-left-color: var(--ok); } details.check.st-warn { border-left-color: var(--warn); } details.check.st-fail { border-left-color: var(--bad); } details.check.st-info { border-left-color: var(--info); }
details.check > summary { list-style: none; display: grid; grid-template-columns: 26px minmax(150px, 1.1fr) 38px 90px 44px minmax(0, 2fr); gap: .6rem; align-items: center; padding: .55rem .8rem; cursor: pointer; }
details.check > summary::-webkit-details-marker { display: none; }
.st-ic { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; }
.st-pass .st-ic { color: var(--ok); background: var(--ok-soft); } .st-warn .st-ic { color: var(--warn); background: var(--warn-soft); } .st-fail .st-ic { color: var(--bad); background: var(--bad-soft); } .st-info .st-ic { color: var(--info); background: var(--info-soft); }
.ck-label { font-weight: 650; }
.ck-w { font-size: .75rem; color: var(--muted); font-family: var(--mono); }
.ck-bar { height: 6px; border-radius: 99px; background: var(--bg2); overflow: hidden; }
.ck-bar i { display: block; height: 100%; background: currentColor; border-radius: 99px; transform-origin: left; animation: grow .9s var(--ease) both; }
.st-pass .ck-bar { color: var(--ok); } .st-warn .ck-bar { color: var(--warn); } .st-fail .ck-bar { color: var(--bad); } .st-info .ck-bar { color: var(--info); }
@keyframes grow { from { transform: scaleX(0); } }
.ck-pct { font-family: var(--mono); font-size: .8rem; text-align: right; }
.ck-sum { font-size: .86rem; color: var(--muted); min-width: 0; }
.ck-body { padding: 0 .9rem .8rem 3rem; font-size: .9rem; }
.findings { margin: .3rem 0 0; padding-left: 1.1rem; }
.findings li { margin: .25rem 0; }
.ats-pre { white-space: pre-wrap; font-family: var(--mono); font-size: .82rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem; max-height: 55vh; overflow: auto; }

/* ------------------------------------------------------------------ JD */
.jd-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.jd-lib { position: sticky; top: 80px; }
.jd-list { list-style: none; padding: 0; margin: 0 0 .8rem; display: flex; flex-direction: column; gap: .35rem; }
.jd-pick { font: inherit; width: 100%; display: flex; justify-content: space-between; align-items: center; gap: .5rem; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .45rem .6rem; cursor: pointer; color: var(--ink); }
.jd-pick:hover { border-color: var(--line2); }
.jd-pick.on { border-color: var(--accent); background: var(--accent-soft); }
.jd-name { font-size: .88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mini-h { font-size: .95rem; margin-top: 1rem; }
.cmp { width: 100%; border-collapse: collapse; font-size: .8rem; }
.cmp th, .cmp td { border-bottom: 1px solid var(--line); padding: .3rem .25rem; text-align: left; vertical-align: top; }
.cmp thead th { color: var(--muted); font-weight: 600; }
.jd-summary .rings { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.ring { width: 120px; height: 120px; flex: none; }
.r-track { fill: none; stroke: var(--bg2); stroke-width: 10; }
.r-val { fill: none; stroke-width: 10; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 1.2s var(--ease); animation: ringIn 1.2s var(--ease); }
@keyframes ringIn { from { stroke-dashoffset: 264; } }
.r-val.ok { stroke: var(--ok); } .r-val.warn { stroke: var(--warn); } .r-val.bad { stroke: var(--bad); }
.ring text { font-family: var(--serif); font-weight: 700; font-size: 20px; fill: var(--ink); }
.jd-cols { margin-top: .9rem; }
.jd-cols .card + .card { margin-top: 0; }
.warn-card { border-color: var(--warn); background: var(--warn-soft); }
.sugs li { margin: .35rem 0; }
.where summary { cursor: pointer; font-size: .85rem; color: var(--accent-ink); font-weight: 600; }
.where-list { font-size: .82rem; padding-left: 1.1rem; margin: .4rem 0 0; }
.where-list li { margin: .15rem 0; }
.sbs h4 { font-family: var(--sans); font-size: .85rem; color: var(--muted); }
.hl-box { white-space: pre-wrap; font-size: .85rem; line-height: 1.6; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem; max-height: 460px; overflow: auto; }
mark { color: var(--ink); border-radius: 3px; padding: 0 .1em; }
mark.m-hit { background: var(--hl-hit); }
mark.m-miss { background: var(--hl-miss); }

/* ------------------------------------------------------------------ cover */
.cover-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 1.1rem; align-items: start; }
.cover-grid .card + .card { margin-top: 0; }
.cover-grid .card { display: flex; flex-direction: column; gap: .8rem; }
.cl-tpls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.cl-tpl { position: relative; cursor: pointer; }
.cl-tpl input { position: absolute; opacity: 0; }
.cl-tpl span { display: flex; flex-direction: column; border: 1px solid var(--line2); border-radius: var(--radius-sm); padding: .55rem .7rem; transition: border-color .15s, background .15s; }
.cl-tpl small { color: var(--muted); font-size: .78rem; }
.cl-tpl input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.cl-tpl input:focus-visible + span { outline: 3px solid var(--focus); }
#cl-text { font-family: var(--serif); font-size: 1rem; line-height: 1.6; min-height: 420px; }

/* ------------------------------------------------------------------ PDF editor */
.pe-toolbar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .55rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); position: sticky; top: 70px; z-index: 5; }
.pe-sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 .2rem; }
.pe-tools { display: inline-flex; flex-wrap: wrap; gap: .2rem; }
.pe-tool { font: inherit; font-size: .78rem; display: inline-flex; align-items: center; gap: .3rem; padding: .35rem .55rem; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--ink); cursor: pointer; }
.pe-tool:hover { background: var(--bg2); }
.pe-tool[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.pe-prop { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; color: var(--muted); font-weight: 600; }
.pe-prop select, .pe-prop input[type=number] { width: auto; padding: .25rem .35rem; font-size: .82rem; }
.pe-prop input[type=number] { width: 4.2rem; }
.pe-prop input[type=range] { width: 80px; }
.pe-zoom { font-family: var(--mono); font-size: .8rem; min-width: 3.2rem; text-align: center; }
.pe-note { font-size: .8rem; color: var(--muted); margin: .5rem .2rem; }
.pe-body { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 1rem; align-items: start; }
.pe-thumbs { position: sticky; top: 140px; max-height: calc(100vh - 160px); overflow: auto; }
.pe-thumb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.pe-thumb-list li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .4rem; }
.pe-thumb { background: none; border: 0; padding: 0; cursor: grab; display: grid; place-items: center; width: 100%; min-height: 60px; }
.pe-thumb canvas { box-shadow: 0 1px 4px rgba(0, 0, 0, .2); background: #fff; }
.pe-thumb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-top: .3rem; }
.pe-thumb-bar button { font: inherit; font-size: .78rem; background: var(--bg2); border: 1px solid var(--line); border-radius: 5px; padding: 0 .3rem; cursor: pointer; color: var(--ink); line-height: 1.5; }
.pe-thumb-bar button:disabled { opacity: .3; }
.pe-num { font-size: .75rem; font-weight: 700; margin-right: auto; }
.pe-stage { display: flex; flex-direction: column; align-items: center; gap: 1.2rem; min-height: 420px; padding: .6rem 0 2rem; border-radius: var(--radius); outline: none; overflow-x: auto; }
.pe-stage.drop { outline: 3px dashed var(--accent); }
.pe-page { position: relative; background: #fff; box-shadow: var(--shadow-paper); flex: none; }
.pe-page canvas { display: block; }
.pe-overlay { position: absolute; inset: 0; touch-action: none; }
.pe-stage[data-tool="text"] .pe-overlay { cursor: text; }
.pe-stage[data-tool="highlight"] .pe-overlay, .pe-stage[data-tool="whiteout"] .pe-overlay, .pe-stage[data-tool="draw"] .pe-overlay { cursor: crosshair; }
.pe-ink { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.pe-stroke { pointer-events: visibleStroke; cursor: move; }
.pe-stroke.sel { filter: drop-shadow(0 0 2px #1F5FAD); }
.pe-a { position: absolute; cursor: move; outline: 1px dashed transparent; white-space: pre-wrap; word-break: break-word; padding: 1px; user-select: none; }
.pe-a:hover { outline-color: rgba(31, 95, 173, .6); }
.pe-a.sel { outline: 1.5px solid #1F5FAD; }
.pe-a.editing { cursor: text; outline: 2px solid #1F5FAD; user-select: text; background: rgba(255, 255, 255, .6); }
.pe-whiteout { background: #fff; }
.pe-whiteout.sel, .pe-whiteout:hover { outline: 1.5px dashed #1F5FAD; }
.pe-image img { width: 100%; height: 100%; display: block; pointer-events: none; }
.pe-handle { position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; background: #1F5FAD; border: 2px solid #fff; border-radius: 3px; cursor: nwse-resize; display: none; }
.pe-a.sel .pe-handle { display: block; }
.pe-rotbadge { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); background: rgba(23, 20, 15, .85); color: #fff; font-size: .75rem; padding: .25rem .6rem; border-radius: 999px; pointer-events: none; white-space: nowrap; }
.sig-pad { width: 100%; max-width: 560px; height: auto; aspect-ratio: 560 / 200; background: #fff; border: 1px dashed var(--line2); border-radius: var(--radius-sm); touch-action: none; cursor: crosshair; display: block; margin: .5rem 0; }
.empty-state { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty-state h3 { color: var(--ink); }
.empty-ill { font-size: 2.4rem; font-family: var(--serif); color: var(--accent); margin-bottom: .3rem; animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px) rotate(-4deg); } }

/* ------------------------------------------------------------------ about & footer */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.about-grid .card + .card { margin-top: 0; }
.ticks { padding-left: 1.1rem; }
.ticks li { margin: .3rem 0; }
.credits-card { border-top: 4px solid var(--accent); }
.big-credit { font-family: var(--serif); font-size: 1.3rem; }
.gratitude { font-family: var(--serif); font-style: italic; color: var(--muted); }
.more { font-weight: 650; }
.footer { border-top: 1px solid var(--line); padding: 1.4rem clamp(.8rem, 2vw, 1.6rem) 2rem; text-align: center; font-size: .88rem; background: var(--bg2); }
.footer p { margin: .35rem auto; max-width: 90ch; }
.quip { font-family: var(--serif); font-size: 1.02rem; }
.quip-label { font-family: var(--sans); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-ink); font-weight: 700; }
#quip.ink { animation: inkReveal .8s var(--ease); display: inline-block; }
.kbd-table th { text-align: left; padding: .25rem 1rem .25rem 0; white-space: nowrap; }

/* ------------------------------------------------------------------ toasts & modal */
.toasts { position: fixed; z-index: 90; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; max-width: min(440px, calc(100vw - 2rem)); }
.toast { display: flex; align-items: flex-start; gap: .55rem; background: var(--ink); color: var(--bg); border-radius: var(--radius); padding: .7rem .8rem; box-shadow: var(--shadow-paper); font-size: .88rem; animation: toastIn .35s var(--ease); }
html[data-theme="contrast"] .toast { background: #000; color: #fff; border: 2px solid #fff; }
.toast.out { opacity: 0; transform: translateX(20px); transition: all .35s var(--ease); }
.toast-ic { flex: none; margin-top: 1px; }
.toast-ok .toast-ic { color: #6FDCA3; } .toast-error .toast-ic { color: #FF8C80; } .toast-warn .toast-ic { color: #F5C15A; } .toast-info .toast-ic { color: #9CC3F2; }
.toast-msg { flex: 1; }
.toast-act { font: inherit; font-weight: 700; background: none; border: 1px solid currentColor; color: inherit; border-radius: 999px; padding: .1rem .6rem; cursor: pointer; white-space: nowrap; }
.toast-x { background: none; border: 0; color: inherit; font-size: 1.2rem; line-height: 1; cursor: pointer; opacity: .7; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-wrap { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 1rem; }
.modal-back { position: absolute; inset: 0; background: rgba(15, 12, 8, .45); backdrop-filter: blur(2px); animation: fade .2s; }
.modal { position: relative; width: min(560px, 100%); max-height: calc(100vh - 2rem); display: flex; flex-direction: column; background: var(--card); color: var(--ink); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow-paper); animation: modalIn .28s var(--ease); }
.modal.wide { width: min(900px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1.1rem .4rem; }
.modal-head h2 { margin: 0; font-size: 1.25rem; }
.modal-body { padding: .4rem 1.1rem 1rem; overflow: auto; display: flex; flex-direction: column; gap: .6rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .7rem 1.1rem 1rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-wrap.out .modal { opacity: 0; transform: translateY(8px) scale(.98); transition: all .18s; }
.modal-wrap.out .modal-back { opacity: 0; transition: opacity .18s; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) rotateX(8deg); } }
@keyframes fade { from { opacity: 0; } }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.choice { font: inherit; text-align: left; display: flex; flex-direction: column; gap: .25rem; padding: .8rem; border: 1px solid var(--line2); border-radius: var(--radius); background: var(--bg); color: var(--ink); cursor: pointer; transition: transform .2s var(--ease), border-color .2s; }
.choice:hover { transform: translateY(-3px); border-color: var(--accent); }
.choice span { font-size: .8rem; color: var(--muted); }
.warn-list { color: var(--warn); margin: 0; padding-left: 1.1rem; font-size: .88rem; }
.import-ta { font-family: var(--mono); font-size: .8rem; }

/* ------------------------------------------------------------------ easter egg */
.hired-stamp { position: absolute; top: 120px; left: 50%; z-index: 5; font-family: var(--serif); font-weight: 800; font-size: clamp(3rem, 9vw, 6rem); letter-spacing: .1em; color: var(--accent); border: 8px double var(--accent); padding: .1em .4em; border-radius: 10px; transform: translateX(-50%) rotate(-14deg); mix-blend-mode: multiply; animation: stamp .5s cubic-bezier(.2, 1.6, .4, 1) both, fadeOut .6s 3.4s forwards; pointer-events: none; }
@keyframes stamp { from { transform: translateX(-50%) rotate(-14deg) scale(3); opacity: 0; } to { transform: translateX(-50%) rotate(-14deg) scale(1); opacity: .92; } }
@keyframes fadeOut { to { opacity: 0; } }
.planes { position: fixed; inset: 0; pointer-events: none; z-index: 95; overflow: hidden; }
.planes span { position: absolute; bottom: -40px; width: 22px; height: 22px; background: var(--accent); clip-path: polygon(0 50%, 100% 0, 70% 100%, 55% 62%); animation: fly 3s var(--ease) forwards; transform: rotate(var(--rot)); }
.planes span:nth-child(3n) { background: var(--ink); } .planes span:nth-child(3n+1) { background: var(--ok); }
@keyframes fly { to { transform: translate(120px, -110vh) rotate(calc(var(--rot) + 200deg)); opacity: .2; } }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .topbar { grid-template-columns: auto 1fr; }
  .tabs { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  .tpl-layout { grid-template-columns: 1fr; }
  .design { position: static; }
}
@media (max-width: 980px) {
  .split { grid-template-columns: 1fr; }
  .mobile-switch { display: flex; gap: .3rem; margin-bottom: .7rem; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px; width: max-content; }
  .mobile-switch button { font: inherit; font-weight: 600; background: none; border: 0; border-radius: 999px; padding: .4rem 1.2rem; cursor: pointer; color: var(--muted); }
  .mobile-switch button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
  .split[data-mobile="edit"] .pane-preview { display: none; }
  .split[data-mobile="preview"] .pane-edit { display: none; }
  .pane-preview { position: static; max-height: none; }
  .jd-grid, .cover-grid, .score-top { grid-template-columns: 1fr; }
  .jd-lib { position: static; }
  details.check > summary { grid-template-columns: 26px 1fr 38px 44px; }
  details.check > summary .ck-bar { display: none; }
  details.check > summary .ck-sum { grid-column: 2 / -1; }
  .ck-body { padding-left: 1rem; }
}
@media (max-width: 700px) {
  body { font-size: 14.5px; }
  .grid2, .cl-tpls, .choice-grid { grid-template-columns: 1fr; }
  .privacy-pill { display: none; }
  .doc-actions .btn { padding: .4rem .7rem; }
  .pe-body { grid-template-columns: 1fr; }
  .pe-thumbs { position: static; max-height: none; }
  .pe-thumb-list { flex-direction: row; overflow-x: auto; }
  .pe-thumb-list li { flex: none; width: 150px; }
  .pe-toolbar { position: static; }
  .tagline { max-width: 22ch; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .caret { display: none; }
}
@media print {
  .topbar, .footer, .docbar, .mobile-switch, .pane-edit, .preview-bar, .toasts { display: none !important; }
  .split { display: block; }
  .pane-preview { position: static; max-height: none; overflow: visible; }
  .paper { box-shadow: none; page-break-after: always; width: 100% !important; }
  .page-no { display: none; }
  body { background: #fff; }
}

/* ===== all-device hardening ===== */
html { overflow-x: clip; }
.topbar, .topbar > * { min-width: 0; }
.tabs { justify-content: flex-start; min-width: 0; max-width: 100%; -webkit-overflow-scrolling: touch; }
@media (min-width: 981px) { .tabs { justify-content: safe center; } }
.split, .split > *, .pane, .pane * { min-width: 0; }
.pane { overflow-wrap: anywhere; }
@media (max-width: 980px) { .split { grid-template-columns: minmax(0, 1fr); } }
input, select, textarea { max-width: 100%; }
