/* Your CV Studio — application chrome */
:root {
  --bg: #E9EBEE;
  --panel: #FFFFFF;
  --panel-2: #F5F6F8;
  --ink: #15171C;
  --ink-2: #3A3F4A;
  --muted: #6A707C;
  --line: #D9DCE2;
  --line-2: #E8EAEE;
  --accent: #2B47C9;
  --accent-ink: #FFFFFF;
  --accent-soft: #E8ECFB;
  --warn: #8A5A00;
  --warn-bg: #FFF5DC;
  --warn-line: #EDCB7E;
  --info-bg: #EEF2FA;
  --good: #1D7A4C;
  --danger: #B42318;
  --shadow: 0 1px 2px rgba(18, 22, 32, .06), 0 10px 30px rgba(18, 22, 32, .08);
  --page-shadow: 0 1px 2px rgba(18, 22, 32, .12), 0 12px 32px rgba(18, 22, 32, .14);
  --ui: 'Instrument Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --display: 'Instrument Serif', Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1115; --panel: #171A20; --panel-2: #1D2027; --ink: #ECEEF2; --ink-2: #C3C8D2; --muted: #8B92A0;
    --line: #2B3039; --line-2: #22262E; --accent: #8A9DFF; --accent-ink: #0D1022; --accent-soft: #222A4A;
    --warn: #F1C46A; --warn-bg: #2A2314; --warn-line: #5B4720; --info-bg: #1C2231; --good: #58C28E; --danger: #FF8A80;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
    --page-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1115; --panel: #171A20; --panel-2: #1D2027; --ink: #ECEEF2; --ink-2: #C3C8D2; --muted: #8B92A0;
  --line: #2B3039; --line-2: #22262E; --accent: #8A9DFF; --accent-ink: #0D1022; --accent-soft: #222A4A;
  --warn: #F1C46A; --warn-bg: #2A2314; --warn-line: #5B4720; --info-bg: #1C2231; --good: #58C28E; --danger: #FF8A80;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--ui); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.i { width: 16px; height: 16px; flex: none; }
.muted { color: var(--muted); }

.app { height: 100%; display: grid; grid-template-rows: auto 1fr; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 18px; padding: 10px 20px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); background: var(--panel); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.brand { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.wordmark { font-family: var(--display); font-style: italic; font-size: 27px; line-height: 1; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.cv-switch { position: relative; }
.switch-btn { max-width: 240px; }
.switch-btn #switchLabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps { display: flex; gap: 4px; margin-left: auto; margin-right: auto; background: var(--panel-2); border: 1px solid var(--line-2); padding: 3px; border-radius: 999px; }
.step { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 6px 14px 6px 8px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 500; white-space: nowrap; }
.step .n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; background: var(--line-2); color: var(--ink-2); }
.step.active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.step.active .n { background: var(--accent); color: var(--accent-ink); }
.step:disabled { opacity: .45; cursor: default; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.save-state { font-size: 12px; color: var(--muted); white-space: nowrap; }
/* language toggle: a compact "globe EN" button; the real select sits invisibly on top so the list shows full names */
.lang-pick { position: relative; display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 7px 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--muted); cursor: pointer; flex: none; }
.lang-pick:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
.lang-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.lang-pick .chev { width: 13px; height: 13px; }
.lang-code { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; color: var(--ink); }
.lang-select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; font-size: 14px; }
.export-wrap { position: relative; }

/* ---------- buttons & controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); padding: 7px 13px; border-radius: 8px; cursor: pointer; font-weight: 500; line-height: 1.2; white-space: nowrap; }
.btn:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.06); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-lg { padding: 11px 18px; font-size: 15px; border-radius: 10px; }
.btn-mini { padding: 3px 8px; font-size: 12px; border-radius: 6px; }
.btn-link { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font-weight: 500; }
.icon-btn { width: 28px; height: 28px; display: inline-grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--panel-2); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }
.select { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 28px 6px 10px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 7.5l5 5 5-5' fill='none' stroke='%236A707C' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 7px center; background-size: 15px; max-width: 100%; cursor: pointer; }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .15s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + span { opacity: .45; cursor: not-allowed; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); padding: 5px 10px; cursor: pointer; color: var(--muted); font-weight: 500; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-checked="true"] { background: var(--accent-soft); color: var(--accent); }

/* ---------- menus ---------- */
.menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 280px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 50; }
.menu-right { left: auto; right: 0; }
.menu button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.menu button:hover, .menu button:focus-visible { background: var(--panel-2); }
.menu button span { font-size: 12px; color: var(--muted); }
.menu-label { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 6px 4px; }
.menu .cv-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.menu .cv-row.current { background: var(--accent-soft); }
.menu .cv-row .meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.menu .sub { display: flex; gap: 6px; padding: 4px 10px 8px; align-items: center; flex-wrap: wrap; }
.menu .sub .select { flex: 1; min-width: 0; }
.menu input.rename { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: var(--panel); }

/* ---------- views ---------- */
.view { min-height: 0; }
.comments-card { grid-column: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.comments-head h2 { font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.1; margin: 0 0 4px; }
.comments-head p { margin: 0; max-width: 64ch; }
.comment-form { display: flex; flex-direction: column; gap: 10px; }
.comment-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.comment-list { display: flex; flex-direction: column; gap: 10px; }
.comment { border-top: 1px solid var(--line-2); padding-top: 10px; display: flex; flex-direction: column; gap: 3px; }
.comment-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 12px; color: var(--muted); }
.comment-meta b { color: var(--ink); font-size: 13px; }
.comment-style { align-self: flex-start; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.comment p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); }
/* about / FAQ section under the tool (English only) */
.landing { grid-column: 1; order: 3; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); min-width: 0; }
html:not([lang^="en"]) .landing { display: none; }
.landing h2 { font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.12; margin: 26px 0 10px; }
.landing h2:first-child { margin-top: 0; }
.landing p { margin: 0 0 12px; max-width: 68ch; }
.landing .how { list-style: none; counter-reset: s; padding: 0; margin: 16px 0 4px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.landing .how li { counter-increment: s; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.landing .how li::before { content: counter(s); width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 600; display: grid; place-items: center; margin-bottom: 4px; }
.landing .how span, .landing .prof-list li, .landing .why li { color: var(--ink-2); }
.landing .prof-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 22px; }
.landing .prof-list li { padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.landing .prof-list b, .landing .why b { display: block; color: var(--ink); }
.landing .why { padding-left: 18px; margin: 0; display: grid; gap: 10px; max-width: 72ch; }
.landing .faq details { border-bottom: 1px solid var(--line-2); padding: 10px 0; }
.landing .faq summary { cursor: pointer; font-weight: 600; }
.landing .faq details p { margin: 8px 0 2px; color: var(--ink-2); }
.landing .foot { margin: 22px 0 0; font-size: 13px; }
.landing .foot a { color: inherit; }
@media (max-width: 700px) { .landing .how, .landing .prof-list { grid-template-columns: 1fr; } .landing { padding: 18px; } .landing h2 { font-size: 24px; } }
.view-paste { display: grid; grid-template-columns: minmax(0, 1fr) 480px; gap: 28px; padding: 28px 32px; overflow: auto; align-items: start; max-width: 1360px; width: 100%; margin: 0 auto; }
.paste-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.paste-head h1 { font-family: var(--display); font-weight: 400; font-size: 38px; line-height: 1.08; letter-spacing: -0.01em; margin: 0 0 10px; text-wrap: balance; max-width: 22ch; }
.lede { color: var(--ink-2); margin: 0 0 6px; max-width: 64ch; }
.fld-label { font-weight: 600; font-size: 13px; }
.fld-label.inline { font-weight: 500; color: var(--muted); }
.paste-input { width: 100%; min-height: 380px; height: 52vh; resize: vertical; border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--panel-2); font: 13px/1.55 ui-monospace, 'Cascadia Mono', Consolas, monospace; color: var(--ink); }
.paste-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--panel); }
.paste-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.paste-left, .paste-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.paste-aside { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 0; display: flex; flex-direction: column; gap: 10px; }
.aside-label { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mini-preview { position: relative; overflow: hidden; border-radius: 4px; box-shadow: var(--page-shadow); background: #fff; }
.mini-preview .cv-page { transform-origin: top left; position: absolute; top: 0; left: 0; }

/* edit view */
.view-edit { display: grid; grid-template-columns: minmax(360px, 470px) minmax(0, 1fr); min-height: 0; }
.mobile-tabs { display: none; }
.editor { overflow: auto; background: var(--panel); border-right: 1px solid var(--line); padding: 18px 18px 80px; }
.preview-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.stylebar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 20px; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.sb-group { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sb-label { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sb-group .select { min-width: 150px; }
#catSelect { min-width: 210px; }
.accent-row { display: flex; align-items: center; gap: 6px; }
input[type="color"] { width: 36px; height: 30px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); cursor: pointer; }
.sb-pages { margin-left: auto; align-self: center; }
.page-count { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-variant-numeric: tabular-nums; padding: 5px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line-2); }
.page-count.over { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.page-warn { margin: 12px 20px 0; padding: 9px 12px; border-radius: 10px; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn); font-size: 13px; }
.pages-scroll { flex: 1; overflow: auto; padding: 24px; }
.pages { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.pv-wrap { position: relative; flex: none; box-shadow: var(--page-shadow); background: #fff; }
.pv-wrap .cv-page { transform-origin: top left; position: absolute; top: 0; left: 0; }
.pv-num { position: absolute; right: 0; top: calc(100% + 4px); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- editor ---------- */
.ed-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ed-head h2 { font-family: var(--display); font-weight: 400; font-size: 26px; margin: 0; line-height: 1.1; }
.checks-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); white-space: nowrap; }
.checks-badge.ok { background: var(--panel-2); color: var(--good); border-color: var(--line-2); }
.polish-toggle { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }

.notes { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.note { font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--info-bg); color: var(--ink-2); display: flex; gap: 8px; align-items: flex-start; }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note .x { margin-left: auto; }

.card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); margin-bottom: 10px; }
.card.hidden-sec { opacity: .62; }
.card-head { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 4px; }
.card-head .title-input { flex: 1; min-width: 0; border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 4px 6px; font-weight: 600; font-size: 14px; }
.card-head .title-input:hover { border-color: var(--line-2); }
.card-head .title-input:focus { border-color: var(--accent); outline: none; background: var(--panel); }
.card-head .kind { font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.card-body { padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.card.collapsed .card-body { display: none; }
.handle { cursor: grab; color: var(--muted); }
.handle:active { cursor: grabbing; }
.col-group { margin: 18px 0 8px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.col-group h3 { margin: 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.col-group .hint { font-size: 12px; color: var(--muted); }
.sec-list { min-height: 12px; }
.add-sec { display: flex; gap: 8px; margin: 6px 0 4px; }
.add-sec .select { flex: 1; min-width: 0; }
.sortable-ghost { opacity: .35; }
.sortable-chosen { box-shadow: var(--shadow); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fld { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fld > span { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.fld input, .fld textarea, .row-input { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: var(--panel); width: 100%; min-width: 0; }
.fld textarea, textarea.row-input { resize: vertical; min-height: 38px; line-height: 1.45; field-sizing: content; }
.fld input:focus, .fld textarea:focus, .row-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fld.missing input, .row-input.missing { border-color: var(--warn-line); background: var(--warn-bg); }
.span2 { grid-column: 1 / -1; }

.photo-row { display: flex; align-items: center; gap: 12px; padding: 4px 0; flex-wrap: wrap; }
.photo-thumb { width: 44px; height: 44px; border-radius: 50%; background: var(--panel-2) center/cover; border: 1px solid var(--line); flex: none; }
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.opt-row .lbl { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.tip { position: relative; display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--line); font-size: 11px; font-weight: 600; color: var(--muted); cursor: help; background: var(--panel); }
.tip:hover::after, .tip:focus::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: 260px; padding: 9px 11px; border-radius: 8px; background: var(--ink); color: var(--panel); font-size: 12px; font-weight: 400; line-height: 1.45; z-index: 30; box-shadow: var(--shadow); white-space: normal; }

.entry { border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px 10px; background: var(--panel-2); display: flex; flex-direction: column; gap: 8px; }
.entry-head { display: flex; align-items: center; gap: 4px; }
.entry-head .summary { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-head .summary .d { font-weight: 400; color: var(--muted); }
.entry.collapsed .entry-body { display: none; }
.entry-body { display: flex; flex-direction: column; gap: 8px; }
.flag { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 6px 9px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.flag .btn-link { color: var(--warn); text-decoration: underline; margin-left: auto; }
.rows { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: flex-start; gap: 4px; }
.row .handle { margin-top: 6px; }
.row .icon-btn { margin-top: 5px; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.add-row { align-self: flex-start; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sugg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 4px 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--ink-2); border: 1px solid transparent; max-width: 100%; }
.sugg.metric { background: var(--panel); border-color: var(--line); color: var(--muted); }
.sugg b { font-weight: 600; color: var(--accent); }
.sugg button { border: 0; border-radius: 999px; padding: 2px 8px; cursor: pointer; font-size: 12px; font-weight: 600; background: var(--panel); color: var(--ink); }
.sugg button.acc { background: var(--accent); color: var(--accent-ink); }
.sugg button.rej { background: transparent; color: var(--muted); padding: 2px 6px; }
.unsorted textarea { font: 12.5px/1.5 ui-monospace, Consolas, monospace; }

/* export view */
.view-export { overflow: auto; padding: 32px; }
.export-card { max-width: 980px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 30px; box-shadow: var(--shadow); }
.export-card h1 { font-family: var(--display); font-weight: 400; font-size: 38px; margin: 0 0 6px; }
.export-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.ex-tile { text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; color: var(--ink-2); }
.ex-tile:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ex-tile b { font-size: 16px; color: var(--ink); }
.ex-kind { align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .12em; padding: 3px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.fname { font-size: 12px; color: var(--muted); background: var(--panel-2); padding: 4px 8px; border-radius: 6px; align-self: flex-start; overflow-wrap: anywhere; }
.export-checks { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }

/* payment */
.pay-card { width: min(440px, 100%); display: flex; flex-direction: column; gap: 10px; }
.pay-card p { margin: 0; }
.pay-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pay-price { font-family: var(--display); font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.pay-list { margin: 4px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.pay-list li { position: relative; padding-left: 24px; }
.pay-list li::before { content: ''; position: absolute; left: 3px; top: 4px; width: 10px; height: 6px; border-left: 2px solid var(--good); border-bottom: 2px solid var(--good); transform: rotate(-45deg); }
.btn-paypal { background: #FFC439; border-color: #FFC439; color: #111; font-weight: 600; }
.btn-paypal:hover { border-color: #F2B21F; background: #F2B21F; }
.btn-paypal:disabled { opacity: .6; cursor: wait; }
.pay-small { font-size: 12px; }
.pay-status { font-size: 12px; padding: 6px 10px 4px; color: var(--muted); }
.pay-status b { color: var(--ink); }
.pay-status.paid b { color: var(--good); }
.pay-status.big { padding: 10px 12px; margin-top: 10px; border-radius: 10px; background: var(--panel-2); font-size: 14px; }
.pay-status:empty { display: none; }

/* modal & toast */
.modal { position: fixed; inset: 0; background: rgba(12, 14, 20, .5); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal-card { background: var(--panel); border-radius: 16px; padding: 22px; width: min(460px, 100%); box-shadow: var(--shadow); }
.modal-card.small { width: min(380px, 100%); }
.modal-card h2 { margin: 0 0 4px; font-size: 18px; }
.crop-stage { margin: 14px auto; width: min(320px, 100%); aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #111; touch-action: none; }
.crop-stage canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.zoom-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.zoom-row input { flex: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); z-index: 120; max-width: min(560px, calc(100% - 32px)); font-size: 13px; }

.measure { position: absolute; left: -20000px; top: 0; visibility: hidden; pointer-events: none; }
#print-root { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .save-state { display: none; }
}
@media (max-width: 1100px) {
  .view-paste { grid-template-columns: 1fr; }
  .paste-aside { display: none; }
  .brand-sub { display: none; }
  /* steps move to their own row so longer languages (German, Polish) never push the bar wider than the window */
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .steps { order: 3; width: 100%; justify-content: space-between; margin: 0; }
  .top-actions { margin-left: auto; }
}
@media (max-width: 900px) {
  .step { padding: 6px 10px 6px 6px; font-size: 13px; }
  .view-edit { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .mobile-tabs { display: flex; gap: 4px; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
  .mt { flex: 1; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 7px; font-weight: 500; }
  .mt.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
  .view-edit[data-pane="editor"] .preview-pane { display: none; }
  .view-edit[data-pane="preview"] .editor { display: none; }
  .editor { border-right: 0; padding: 16px 16px 80px; }
  .view-paste, .view-export { padding: 16px; }
  .paste-card, .export-card, .comments-card { padding: 18px; }
  .paste-head h1, .export-card h1 { font-size: 30px; }
  .export-grid { grid-template-columns: 1fr; }
  .pages-scroll { padding: 16px; }
  .stylebar { padding: 12px 16px; }
  /* Phones: the whole page scrolls, so the top bar slides away and the review gets the full screen.
     The Edit / Preview tabs stay pinned to the top. */
  html, body { height: auto; }
  .app { height: auto; min-height: 100%; min-height: 100dvh; }
  .view-edit { display: block; }
  .mobile-tabs { position: sticky; top: 0; z-index: 15; }
  .editor, .pages-scroll { overflow: visible; }
  .view-paste, .view-export { overflow: visible; }
}
@media (max-width: 480px) {
  .grid2 { grid-template-columns: 1fr; }
  .brand { display: none; }
  .switch-btn { max-width: 190px; }
  .cv-switch { min-width: 0; flex: 1; }
  .menu { min-width: 0; width: calc(100vw - 32px); }
  .step { font-size: 12px; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- print ---------- */
@media print {
  html, body { height: auto; background: #fff !important; margin: 0; }
  .app, .modal, .toast, .measure { display: none !important; }
  #print-root { display: block; }
  #print-root .cv-page { break-after: page; page-break-after: always; margin: 0; }
  #print-root .cv-page:last-child { break-after: auto; page-break-after: auto; }
}
