/*
 * CV Maker
 * Layout: one column built for a phone held in one hand; on wide screens the
 * live CV sits beside the form. Material: the paper sheet, a ballpoint-blue pen
 * colour for actions, and a yellow highlighter for progress and focus.
 */

@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("../fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("../fonts/atkinson-hyperlegible-next-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("../fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --ink: #131b25;
  --muted: #536173;
  --line: #d3dae3;
  --field-border: #66727f;
  --pen: #1f56a3;
  --pen-strong: #17437f;
  --pen-ink: #ffffff;
  --pen-soft: #e4ecf8;
  --marker: #ffd84a;
  --marker-hl: rgba(255, 216, 74, 0.75);
  --focus: #ffd84a;
  --focus-ink: #131b25;
  --ok: #19733f;
  --warn: #8a5300;
  --warn-soft: #fff3d6;
  --danger: #b3261e;
  --sheet-shadow: 0 1px 2px rgba(19, 27, 37, 0.08), 0 8px 24px rgba(19, 27, 37, 0.08);
  --font: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 8px;
  --bar-h: 56px;
  --gutter: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e131a; --surface: #171e28; --surface-2: #1d2531; --ink: #e8edf3; --muted: #9eabbb; --line: #2c3746; --field-border: #8794a5;
    --pen: #8ab4ee; --pen-strong: #b0cdf5; --pen-ink: #0b1422; --pen-soft: #1d2d45; --marker: #e9c53a; --marker-hl: rgba(233, 197, 58, 0.32);
    --focus: #e9c53a; --focus-ink: #0e131a; --ok: #6fcf97; --warn: #f0be62; --warn-soft: #2e2512; --danger: #ff8f86;
    --sheet-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e131a; --surface: #171e28; --surface-2: #1d2531; --ink: #e8edf3; --muted: #9eabbb; --line: #2c3746; --field-border: #8794a5;
  --pen: #8ab4ee; --pen-strong: #b0cdf5; --pen-ink: #0b1422; --pen-soft: #1d2d45; --marker: #e9c53a; --marker-hl: rgba(233, 197, 58, 0.32);
  --focus: #e9c53a; --focus-ink: #0e131a; --ok: #6fcf97; --warn: #f0be62; --warn-soft: #2e2512; --danger: #ff8f86;
  --sheet-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.5 var(--font);
  min-height: 100vh;
  overflow-x: hidden;
}
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: var(--pen); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.icon { width: 20px; height: 20px; flex: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--marker); color: var(--focus-ink); border: 0; padding: 10px 14px; border-radius: var(--radius); font-weight: 700; }
.skip:focus { top: 8px; }

/* ---------- Top bar ---------- */
.bar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.bar-in { height: var(--bar-h); max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; margin-right: auto; padding: 6px 2px; border-radius: 6px; }
.brand .logo { width: 28px; height: 28px; color: var(--pen); }
.bar-tools { display: flex; align-items: center; gap: 6px; }
.lang-select { appearance: none; -webkit-appearance: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 15px; font-weight: 600; min-height: 40px; cursor: pointer; }
.menu-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; min-height: 44px; padding: 0 8px; border-radius: var(--radius); font-weight: 600; cursor: pointer; }
.menu-btn:hover { background: var(--surface-2); }
.menu-text { font-size: 15px; }

.example-banner { background: var(--marker); color: var(--focus-ink); }
.banner-in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-block: 10px; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); font-size: 15px; }
.banner-in p { flex: 1 1 220px; }
.example-banner .btn { background: var(--focus-ink); color: var(--marker); border-color: var(--focus-ink); }
.storage-warning { background: var(--warn-soft); color: var(--warn); padding: 10px var(--gutter); font-size: 15px; text-align: center; }

/* ---------- Layout ---------- */
.layout { max-width: 1180px; margin: 0 auto; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
.main-col { min-width: 0; max-width: 600px; margin: 0 auto; }
.side { display: none; }
.page { padding-block: 20px 120px; display: flex; flex-direction: column; gap: 20px; }
body[data-route="home"] .page, body[data-route="menu"] .page, body[data-route="about"] .page, body[data-route="welcome"] .page { padding-bottom: 48px; }

@media (min-width: 1000px) {
  .layout.with-side { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 48px; align-items: start; }
  .layout.with-side .main-col { margin: 0; }
  .side { display: block; position: sticky; top: calc(var(--bar-h) + 24px); padding-block: 24px; max-height: calc(100vh - var(--bar-h) - 24px); overflow: auto; }
}

/* ---------- Type ---------- */
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.015em; }
h1:focus { outline: none; }
.lead { color: var(--muted); font-size: 17px; margin-top: 6px; }
.muted { color: var(--muted); font-size: 15px; }
.eyebrow { font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.page-head { display: flex; flex-direction: column; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: var(--radius); border: 2px solid transparent; font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer; line-height: 1.2; text-align: center; }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.grow { flex: 1 1 auto; }
.btn.primary { background: var(--pen); color: var(--pen-ink); border-color: var(--pen); box-shadow: 0 2px 0 var(--pen-strong); }
.btn.primary:hover { background: var(--pen-strong); border-color: var(--pen-strong); }
.btn.primary:active { transform: translateY(1px); box-shadow: none; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--field-border); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.link { background: transparent; color: var(--pen); text-decoration: underline; text-underline-offset: 3px; min-height: 44px; padding-inline: 6px; }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.add { background: var(--pen-soft); color: var(--pen-strong); border: 2px solid transparent; }
.btn.add:hover { border-color: var(--pen); }
.btn[disabled] { opacity: 0.65; cursor: progress; }
.danger-text { color: var(--danger) !important; }
.btn.link.danger-text { align-self: flex-start; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); cursor: pointer; color: var(--ink); }
.icon-btn[disabled] { opacity: 0.35; cursor: default; }
.stack { display: flex; flex-direction: column; gap: 10px; }

.up { align-self: flex-start; display: inline-flex; align-items: center; gap: 2px; margin: -6px 0 -8px -8px; padding: 8px 10px 8px 4px; min-height: 44px; border: 0; background: none; color: var(--pen); font-weight: 600; font-size: 16px; cursor: pointer; border-radius: var(--radius); }
.up:hover span { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Bottom bar ---------- */
.bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.bottom-in { max-width: 600px; margin: 0 auto; display: flex; gap: 10px; padding-block: 10px; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
.bottom-in .btn { min-width: 0; }
.bottom-in .btn.secondary { flex: 0 1 auto; }
@media (min-width: 1000px) {
  .bottom-bar { position: sticky; bottom: 0; background: transparent; border: 0; padding-bottom: 20px; }
  .bottom-in { padding: 0; max-width: none; }
  .page { padding-bottom: 24px; }
}

/* ---------- Home ---------- */
.home-head { display: flex; flex-direction: column; gap: 2px; }
.progress { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.progress-track { height: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.progress-track span { display: block; height: 100%; background: var(--marker); border-right: 2px solid color-mix(in srgb, var(--marker) 70%, #8a6a00); transition: width 0.4s ease; min-width: 0; }
.progress-label { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }

.cta { display: flex; align-items: center; gap: 14px; background: var(--pen); color: var(--pen-ink); text-decoration: none; padding: 18px; border-radius: 12px; box-shadow: 0 2px 0 var(--pen-strong); }
.cta > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cta-title { font-size: 19px; font-weight: 700; }
.cta-sub { font-size: 15px; opacity: 0.9; }
.cta .icon { width: 24px; height: 24px; }
.cta:hover { background: var(--pen-strong); }

.group { display: flex; flex-direction: column; gap: 8px; }
.group h2 { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding-left: 2px; }
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rows li + li { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; text-decoration: none; color: var(--ink); min-height: 64px; }
.row:hover { background: var(--surface-2); }
.row:focus-visible { outline-offset: -3px; }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-weight: 700; }
.row-sub { color: var(--muted); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--muted); }
.mark { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--field-border); display: grid; place-items: center; }
.mark .icon { width: 16px; height: 16px; }
.mark.done { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.mark.partly { border-color: var(--pen); background: linear-gradient(90deg, var(--pen-soft) 50%, transparent 50%); }
.saved-note { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 14px; }
.saved-note .icon { width: 16px; height: 16px; }

/* ---------- Section and entry forms ---------- */
.tip { background: var(--surface); border-left: 4px solid var(--marker); padding: 12px 14px; border-radius: 0 var(--radius) var(--radius) 0; font-size: 16px; color: var(--ink); }
.tip strong { margin-right: 2px; }
.fields { display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { font-weight: 700; font-size: 17px; padding: 0; }
.field > legend { margin-bottom: 6px; }
.hint { color: var(--muted); font-size: 15px; }
input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; font-size: 17px; background: var(--surface); color: var(--ink);
  border: 2px solid var(--field-border); border-radius: 6px;
}
textarea { resize: vertical; line-height: 1.45; min-height: 96px; }
select { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; }
select:disabled { opacity: 0.5; cursor: default; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.75; }
input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-weight: 700; font-size: 15px; }
.counter { font-size: 14px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.counter .over { color: var(--warn); font-weight: 700; }

.example { font-size: 15px; }
.example summary { cursor: pointer; color: var(--pen); font-weight: 600; width: fit-content; padding: 4px 0; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.example summary::-webkit-details-marker { display: none; }
.example summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s; }
.example[open] summary::before { transform: rotate(45deg); }
.example-body { margin-top: 6px; padding: 10px 12px; background: var(--surface-2); border-radius: 6px; border: 1px dashed var(--line); font-style: italic; color: var(--muted); }

.date-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: 1; min-width: 0; }
.period { gap: 10px; }
.period-row { display: flex; align-items: center; gap: 10px; }
.period-label { width: 4.5em; flex: none; color: var(--muted); font-size: 15px; }

.check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-weight: 400 !important; padding: 4px 0; }
.check input, .choice input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--pen); }
.choices { gap: 8px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer; min-height: 52px; }
.choice:has(input:checked) { border-color: var(--pen); background: var(--pen-soft); }

/* Chips */
.chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border: 2px solid var(--pen); color: var(--ink); border-radius: 6px; padding-left: 12px; font-weight: 600; max-width: 100%; }
.chip span { overflow-wrap: anywhere; padding-block: 6px; }
.chip button { border: 0; background: none; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; color: var(--muted); border-radius: 4px; }
.chip button .icon { width: 16px; height: 16px; }
.chip-add { display: flex; gap: 8px; }
.chip-add input { flex: 1; min-width: 0; }
.ideas-hint { margin-top: 6px; }
.ideas { display: flex; flex-wrap: wrap; gap: 8px; }
.idea { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 6px 12px 6px 8px; border: 1px dashed var(--field-border); border-radius: 6px; background: transparent; cursor: pointer; font-size: 15px; color: var(--ink); }
.idea .icon { width: 16px; height: 16px; color: var(--pen); }
.idea:hover { border-style: solid; border-color: var(--pen); }

/* Entries */
.entries-block { display: flex; flex-direction: column; gap: 12px; }
.entries { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.entry-card { display: flex; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.entry-link { flex: 1; min-width: 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink); }
.entry-link:hover { background: var(--surface-2); }
.entry-link:focus-visible { outline-offset: -3px; }
.entry-title { font-weight: 700; overflow-wrap: anywhere; }
.entry-meta { color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.entry-tools { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 6px; border-left: 1px solid var(--line); }
.entry-tools .icon-btn { width: 40px; height: 36px; border: 0; }
.empty { color: var(--muted); padding: 16px; border: 1px dashed var(--line); border-radius: 10px; text-align: center; font-size: 16px; }

/* ---------- Preview ---------- */
.checks { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.checks h2 { font-size: 18px; }
.checks ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checks li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; font-size: 16px; }
.checks li .icon { color: var(--warn); margin-top: 2px; }
.checks li.blocking .icon { color: var(--danger); }
.checks li.blocking span { font-weight: 700; }
.checks li a { font-weight: 700; padding: 0 2px; }
.checks.ok p { display: flex; gap: 10px; align-items: flex-start; }
.checks.ok .icon { color: var(--ok); }
@keyframes flash { 0%, 100% { background: transparent; } 30% { background: var(--marker-hl); } }
.checks li.flash { animation: flash 1.2s ease 2; border-radius: 6px; }

.preview-controls { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.segmented { border: 0; margin: 0; padding: 0; display: inline-flex; flex-wrap: wrap; gap: 0; }
.segmented legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px; border: 2px solid var(--field-border); background: var(--surface); font-weight: 600; }
.segmented label:first-of-type span { border-radius: 6px 0 0 6px; }
.segmented label:last-of-type span { border-radius: 0 6px 6px 0; margin-left: -2px; }
.segmented input:checked + span { background: var(--pen); border-color: var(--pen); color: var(--pen-ink); position: relative; z-index: 1; }
.segmented input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.field.compact { flex: 1 1 180px; }
.field.compact label { font-size: 15px; }

/* ---------- CV sheet (drawn at 595px = A4 width in PDF points, then scaled) ---------- */
.sheet-frame { position: relative; width: 100%; overflow: hidden; border-radius: 4px; box-shadow: var(--sheet-shadow); background: #fff; }
.sheet-scale { width: 595px; transform-origin: 0 0; }
.cv-sheet { width: 595px; min-height: 842px; background: #fff; color: #222830; padding: 58px 56px 60px; font: 9.8px/13.6px Helvetica, Arial, "Liberation Sans", sans-serif; text-align: left; }
.cv-sheet p { margin: 0 0 4px; }
.cv-head { border-bottom: 1.4px solid #1f57a3; padding-bottom: 12px; }
.cv-name { font-size: 23px; line-height: 1.15; font-weight: 700; color: #141c26; margin: 0 0 6px; letter-spacing: 0; }
.cv-contact { color: #5c6675; font-size: 9.5px; margin: 0 !important; }
.cv-contact span + span::before { content: "|"; margin: 0 8px; color: #9aa3ae; }
.cv-section { margin-top: 17px; }
.cv-section h3 { font-size: 9px; font-weight: 700; color: #1f57a3; text-transform: uppercase; letter-spacing: 1.1px; padding-bottom: 4px; border-bottom: 0.5px solid #ccd3dd; margin: 0 0 8px; }
.cv-entry + .cv-entry { margin-top: 9px; }
.cv-entry-head { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.cv-entry-head strong { font-size: 10.4px; color: #222830; }
.cv-date { color: #5c6675; font-size: 9.2px; white-space: nowrap; }
.cv-sub { font-style: italic; color: #5c6675; font-size: 9.4px; }
.cv-entry ul { margin: 2px 0 2px; padding-left: 13px; }
.cv-entry li { margin: 0; padding-left: 0; }
.cv-entry li::marker { color: #5c6675; }
.cv-label { font-style: italic; color: #5c6675; font-size: 9.4px; }
.cv-classic { font-family: "Times New Roman", Times, "Liberation Serif", serif; font-size: 10.8px; line-height: 14.2px; color: #141414; padding: 60px 62px 62px; }
.cv-classic .cv-head { text-align: center; border-bottom: 0.8px solid #1a1a1a; padding-bottom: 10px; }
.cv-classic .cv-name { font-size: 25px; color: #0d0d0d; }
.cv-classic .cv-contact { font-size: 10.2px; color: #404040; }
.cv-classic .cv-contact span + span::before { content: "•"; margin: 0 6px; color: #404040; }
.cv-classic .cv-section { margin-top: 16px; }
.cv-classic .cv-section h3 { color: #0d0d0d; font-size: 11.2px; letter-spacing: 0.9px; border-bottom: 0.6px solid #404040; }
.cv-classic .cv-entry-head strong { font-size: 11.2px; color: #141414; }
.cv-classic .cv-date, .cv-classic .cv-sub, .cv-classic .cv-label { color: #404040; font-size: 10.3px; }

.preview .sheet-frame { margin-inline: auto; }
.sheet-frame.mini { height: 230px; border-radius: 6px; }
.sheet-frame.mini::after { content: ""; position: absolute; inset: auto 0 0 0; height: 70px; background: linear-gradient(transparent, var(--bg)); }

/* ---------- Welcome ---------- */
.welcome { gap: 22px; }
.welcome-art { transform: rotate(-1.5deg); margin: 4px 6px 0; }
.welcome-copy { display: flex; flex-direction: column; gap: 16px; }
.welcome h1 { font-size: 32px; }
.points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.points li { display: flex; gap: 10px; align-items: flex-start; }
.points .icon { color: var(--ok); margin-top: 3px; }
.privacy { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 15px; justify-content: center; }
.privacy .icon { width: 18px; height: 18px; }
label.btn { cursor: pointer; }

/* ---------- Menu and about ---------- */
.menu-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.menu-list li + li { border-top: 1px solid var(--line); }
.menu-list button, .menu-list a, .menu-list label { width: 100%; display: flex; gap: 14px; align-items: flex-start; padding: 16px; background: none; border: 0; text-align: left; text-decoration: none; color: var(--ink); cursor: pointer; min-height: 56px; }
.menu-list button:hover, .menu-list a:hover, .menu-list label:hover { background: var(--surface-2); }
.menu-list .icon { margin-top: 2px; color: var(--pen); }
.menu-list .danger-text .icon { color: var(--danger); }
.menu-list span { display: flex; flex-direction: column; }
.menu-title { font-weight: 700; }
.menu-sub { color: var(--muted); font-size: 15px; }
.prose { display: flex; flex-direction: column; gap: 14px; max-width: 62ch; }

/* ---------- Dialog and toast ---------- */
.dialog { border: 0; border-radius: 14px; padding: 22px; max-width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
.dialog::backdrop { background: rgba(10, 15, 22, 0.55); }
.dialog h2 { font-size: 20px; margin-bottom: 8px; }
.dialog p { color: var(--muted); }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); z-index: 40; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: var(--radius); font-size: 16px; max-width: min(520px, calc(100vw - 32px)); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; overflow-wrap: anywhere; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { border-left: 6px solid var(--marker); }
.toast.ok { border-left: 6px solid var(--ok); }

#print-root { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block; }
  #print-root .cv-sheet { width: 210mm; min-height: auto; zoom: 1.333; }
  .cv-section, .cv-entry { break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media (max-width: 380px) {
  .menu-text { display: none; }
  h1 { font-size: 25px; }
  .bottom-in .btn { padding-inline: 12px; font-size: 16px; }
}

/* Preview size toggle and empty sheet */
.sheet-tools { display: flex; justify-content: flex-end; margin-bottom: -12px; }
.sheet-frame.zoomed { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.cv-empty { display: grid; place-items: center; text-align: center; color: #6b7480; font: 16px/1.5 var(--font); }
.cv-empty p { max-width: 30ch; }

/* Bottom bar: "Next" over the section name, so long names in any language fit on one row */
.btn.next { justify-content: space-between; text-align: left; padding-block: 6px; }
.next-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.next-text small { font-size: 13px; font-weight: 600; opacity: 0.85; }
.next-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bottom-in .btn.secondary { padding-inline: 12px 16px; gap: 4px; white-space: nowrap; }
.choice { font-weight: 400 !important; }
