/*
 * ResumeForge: the tool's own components, styled in the site's design language (3 Nov 2026, on the UltraCompress Pro
 * template, after AgeCalc, QR Generator, Biodata Maker and Payslip Studio, whose shared block the first part of this
 * file copies; Biodata Maker's generic .note rule is left out, because here .note is a review note). Base:
 * /libs/site-pages.css (tokens, Inter and Space Grotesk, buttons, theme toggle, focus rings) and /libs/shared-nav.css
 * (the site's header and footer). The resume and letter pages themselves are paper.css, with fixed paper colours in
 * both themes. This file holds the toolbar, the tabs, the editor, the menus, the Design and Check views, the page
 * preview, the windows, the print layout and the information sections. Light is the default; dark applies when
 * <html> has no data-theme.
 */

/* ----- Tokens the tool adds ----- */
:root {
    --surface: #ffffff;
    --surface-2: #f3f4f8;
    --ring: rgba(139, 92, 246, 0.18);
    --app-max: 1600px;
    --radius-lg: 16px;
    --line: rgba(0, 0, 0, 0.1);
    --line-strong: rgba(0, 0, 0, 0.24);
    --ok: #166534;
    --ok-soft: rgba(22, 101, 52, 0.09);
    --bad: #b91c1c;
    --bad-soft: rgba(185, 28, 28, 0.08);
    --warn: #92400e;
    --warn-soft: rgba(217, 119, 6, 0.1);
    --stage: #f3f4f8;
}
:root:not([data-theme="light"]) {
    --surface: #14141f;
    --surface-2: rgba(255, 255, 255, 0.05);
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.26);
    --ok: #4ade80;
    --ok-soft: rgba(74, 222, 128, 0.1);
    --bad: #f87171;
    --bad-soft: rgba(248, 113, 113, 0.1);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.1);
    --stage: #1c1c2b;
}

/* ----- Page: full width, the page provides the side space ----- */
.container.app-container { max-width: calc(var(--app-max) + 2 * var(--content-gutter)); margin-top: 16px; }
@media (min-width: 640px) { .container.app-container { margin-top: 24px; } }

/* ----- The site header is the first thing on the page and stays at the top ----- */
body { padding-top: 0; }
body > header { position: sticky; top: 0; z-index: 50; }
header .site-nav { position: relative; top: auto; }
.theme-toggle { top: 90px; }
@media (max-width: 639.98px) { .theme-toggle { top: 75px; } } /* the header is 81 px tall from 640 px, 65 px below */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ----- Hero ----- */
.app-hero { margin: 0 0 2rem; text-align: center; }
.app-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 1.25rem; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--text-strong); }
.app-brand img { width: 44px; height: 44px; border-radius: 12px; display: block; }
.app-hero h1 { margin-bottom: 0.75rem; }
.app-tagline { color: var(--text-2); font-size: 1.125rem; line-height: 1.6; max-width: 46rem; margin: 0 auto; }

/* ----- Small helpers ----- */
main [hidden], .dialog [hidden] { display: none !important; } /* the script hides fields that carry their own display */
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.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; }
.muted { color: var(--text-2); }
.small { font-size: 0.9rem; }
.block { display: block; }
.hint { color: var(--text-3); font-size: 0.8rem; font-weight: 400; line-height: 1.45; }
.err { color: var(--bad); font-size: 0.85rem; font-weight: 600; }
.err:empty { display: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link:hover { color: var(--link-hover); }
code { font-size: 0.85em; padding: 1px 6px; border-radius: 6px; background: var(--code-bg); color: var(--code-text); }
kbd { font-family: inherit; font-size: 0.72rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text-strong); }

/* ----- Buttons ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 9999px; font-family: inherit; font-weight: 600; font-size: 0.95rem; line-height: 1.2; padding: 12px 24px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn .ico { width: 17px; height: 17px; }
.btn-primary { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text-strong); border: 1px solid var(--surface-border); padding: 11px 23px; }
.btn-secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--link); transform: translateY(-2px); }
.btn-danger { background: var(--surface); color: var(--danger); border: 1px solid rgba(185, 28, 28, 0.35); padding: 11px 23px; }
.btn-danger:hover:not(:disabled) { background: var(--danger-strong); color: #fff; border-color: transparent; transform: translateY(-2px); }
.btn-sm { font-size: 0.85rem; padding: 9px 16px; }
.btn-secondary.btn-sm, .btn-danger.btn-sm { padding: 8px 15px; }
.btn-stack { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); flex-shrink: 0; padding: 0; font-family: inherit; transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.icon-btn:hover { border-color: var(--brand); color: var(--link); background: var(--surface); }
.icon-btn.del:hover { border-color: var(--danger); color: var(--danger); }
.icon-btn:focus-visible, .link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Toolbar ----- */
.app-shell { margin: 0 0 3rem; scroll-margin-top: 90px; }
.app-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 0 0 1.25rem; }
.toolbar-left, .toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.status-pill { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 10px; border-radius: 9999px; border: 1px solid var(--tint-brand-border); background: var(--tint-brand); min-width: 220px; max-width: 100%; }
.status-icon { font-size: 1.3rem; line-height: 1; }
.status-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.status-main { font-weight: 700; font-size: 0.85rem; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-sub { font-size: 0.72rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 9999px; background: var(--surface-2); max-width: 100%; }
.view-tab { padding: 8px 16px; border: 0; border-radius: 9999px; background: transparent; font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; }
.view-tab:hover { color: var(--link); }
.view-tab.active { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.view-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.view[hidden] { display: none; }
.shell-hint { margin-top: 14px; }

/* ----- Cards ----- */
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.card-grid:empty { display: none; }
.card--wide { grid-column: span 2; }
.card--full { grid-column: 1 / -1; }
.card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); box-shadow: var(--surface-shadow); overflow: hidden; display: flex; flex-direction: column; min-width: 0; margin-bottom: 0; }
.view > .card { margin-bottom: 20px; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--surface-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-title { margin: 0; font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-note { font-size: 0.8125rem; color: var(--text-3); }
.card-body { padding: 16px 20px 20px; flex: 1; min-width: 0; }
.card-body > * + * { margin-top: 16px; }
.form-hint { font-size: 0.8rem; color: var(--text-3); margin: 10px 0 0; line-height: 1.5; }

/* ----- Fields ----- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.label { font-weight: 600; font-size: 0.85rem; color: var(--text-strong); }
.input, .select { width: 100%; min-width: 0; min-height: 44px; padding: 10px 14px; background: var(--field); border: 1px solid var(--field-border); border-radius: 12px; font-family: inherit; font-size: 0.95rem; color: var(--text); outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.input::placeholder { color: var(--placeholder); }
.input[aria-invalid="true"] { border-color: var(--bad); }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.5; }
input[type="time"].input { color-scheme: light; width: 9em; }
:root:not([data-theme="light"]) input[type="time"].input { color-scheme: dark; }
.select { width: auto; max-width: 100%; appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; cursor: pointer; }
.select option { color: #0a0a14; background: #fff; }
.num-input { width: 7.5em; }
.num-input.wide { width: 10em; }
.check-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 0.925rem; color: var(--text); padding: 4px 0; }
.check-row input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex-shrink: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--surface); font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.seg button:hover { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.seg button[aria-checked="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--chip); font-family: inherit; font-size: 0.8rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.chip .ico { width: 15px; height: 15px; color: var(--link); }
.chip:hover { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Windows ----- */
.dialog { margin: auto; border: 1px solid var(--surface-border); border-radius: 20px; padding: 0; width: min(520px, calc(100vw - 16px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35); }
.dialog--narrow { width: min(420px, calc(100vw - 16px)); }
.dialog--wide { width: min(680px, calc(100vw - 16px)); }
.dialog::backdrop { background: rgba(10, 10, 20, 0.6); backdrop-filter: blur(6px); }
.dialog[open] { animation: pop 0.2s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } }
.dialog-head { padding: 18px 20px; border-bottom: 1px solid var(--surface-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-title { margin: 0; font-size: 1.15rem; }
.dialog-close { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text-strong); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: border-color 0.2s ease, color 0.2s ease; }
.dialog-close:hover { border-color: var(--brand); color: var(--link); }
.dialog-body { padding: 20px; overflow-y: auto; max-height: calc(100vh - 210px); display: flex; flex-direction: column; gap: 14px; }
.dialog-actions { padding: 14px 20px; border-top: 1px solid var(--surface-border); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.confirm-message { margin: 0; color: var(--text); }
.help-body h3 { margin: 6px 0 0; font-size: 1rem; }
.help-body p { margin: 0; color: var(--text-2); }

/* ----- Toasts ----- */
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { pointer-events: auto; background: #0a0a14; color: #fff; border: 1px solid rgba(255, 255, 255, 0.12); border-left: 4px solid var(--brand); border-radius: 14px; padding: 12px 16px; display: flex; align-items: center; gap: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3); min-width: 260px; max-width: 420px; font-size: 0.875rem; font-weight: 500; overflow-wrap: anywhere; animation: slideIn 0.3s ease; transition: opacity 0.3s ease, transform 0.3s ease; }
.toast button { background: none; border: 0; padding: 0; color: #c4b5fd; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; white-space: nowrap; }
.toast.leaving { opacity: 0; transform: translateX(40px); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.toast.good { border-left-color: #4ade80; }
.toast.bad { border-left-color: #f87171; }

/* ----- Information sections ----- */
.info-section { margin: 0 0 2.5rem; }
.info-section h2 { font-size: 1.75rem; margin: 0 0 1.25rem; }
.info-section .info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.info-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 1rem 0 1.5rem; }
.info-stack { display: grid; gap: 12px; }
.info-card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: 16px; box-shadow: var(--surface-shadow); padding: 20px; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.info-card:hover { transform: translateY(-4px); box-shadow: var(--surface-hover-shadow); }
.info-card--small { padding: 16px; box-shadow: none; }
.info-card h3 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.info-card p { color: var(--text-2); margin-bottom: 0.75rem; }
.info-card p:last-child { margin-bottom: 0; }
.step-card { position: relative; padding-top: 24px; }
.step-num { position: absolute; top: -16px; left: 20px; width: 34px; height: 34px; border-radius: 50%; background: var(--gradient-brand); color: #fff; font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 0.75rem; }
.step-head h3 { margin: 0; }
.step-emoji { font-size: 1.6rem; line-height: 1; }
.info-section details.info-card { padding: 0; }
.info-section details.info-card summary { cursor: pointer; padding: 16px 20px; font-weight: 600; color: var(--text-strong); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.info-section details.info-card summary::-webkit-details-marker { display: none; }
.info-section details.info-card summary::after { content: '+'; color: var(--link); font-weight: 700; font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.info-section details.info-card[open] summary::after { content: '\2212'; }
.info-section details.info-card p { padding: 0 20px 16px; margin: 0; color: var(--text-2); }

/* ===== ResumeForge components ===== */

/* ----- Toolbar, tabs and the check count ----- */
.app-toolbar .icon-btn { width: 40px; height: 40px; border-color: var(--surface-border); background: var(--surface); }
.app-toolbar .icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.app-toolbar .icon-btn:disabled:hover { border-color: var(--surface-border); color: var(--text-2); }
.part-seg { flex-wrap: nowrap; }
.part-seg button .ico { width: 16px; height: 16px; }
.app-shell > .view-tabs { margin: 0 0 1.25rem; display: flex; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.view-tab { display: inline-flex; align-items: center; gap: 6px; }
.tab-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 9999px; background: var(--danger-strong); color: #fff; font-size: 0.72rem; font-weight: 700; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.tab-badge[hidden] { display: none; }
@media (min-width: 1024px) { .view-tab.tab-preview { display: none; } }

/* ----- Layout: the editor on the left, the pages on the right from 1024 px; the Preview tab below ----- */
.app-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.preview-column { min-width: 0; display: none; }
body[data-view="preview"] .preview-column { display: block; }
body[data-view="preview"] #panel { display: none; }
@media (min-width: 1024px) {
    .app-layout { grid-template-columns: minmax(380px, 0.9fr) minmax(0, 1fr); }
    .preview-column, body[data-view="preview"] .preview-column { display: block; position: sticky; top: 97px; height: calc(100vh - 113px); }
    body[data-view="preview"] #panel { display: flex; }
    .preview-card { height: 100%; }
}
.preview-card .card-header { flex-shrink: 0; }
.desk-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.marks-btn { min-height: 36px; }
.marks-btn .ico { color: inherit; }
.marks-btn[aria-pressed="true"] { background: #b42318; border-color: #b42318; color: #fff; }
.marks-btn[aria-pressed="true"]:hover { color: #fff; }
.zoom { display: flex; align-items: center; gap: 4px; }
.zoom .icon-btn { width: 36px; height: 36px; border-color: var(--surface-border); background: var(--surface); }
.zoom-val { min-width: 58px; height: 36px; border: 1px solid var(--surface-border); border-radius: 10px; background: var(--surface); color: var(--text-strong); font-family: inherit; font-size: 0.85rem; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease; }
.zoom-val:hover { border-color: var(--brand); color: var(--link); }
.zoom-val:focus-visible, .desk-scroll:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.desk-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 16px 0 24px; background: var(--stage); scrollbar-width: thin; }
.pages { display: flex; flex-direction: column; align-items: center; gap: 18px; width: max-content; min-width: 100%; padding: 0 8px; }
.pages .page { box-shadow: 0 1px 2px rgba(10, 10, 20, 0.12), 0 8px 28px rgba(10, 10, 20, 0.14); zoom: var(--z, 1); }
.measure { position: absolute; left: -20000px; top: 0; visibility: hidden; pointer-events: none; contain: layout style; }
.panel .card-body { padding-top: 18px; }

/* ----- Write ----- */
.welcome { display: flex; flex-direction: column; gap: 14px; padding: 16px; margin-bottom: 18px; border-radius: 14px; background: var(--tint-brand); border: 1px solid var(--tint-brand-border); }
.welcome h3 { margin: 0; font-size: 1.15rem; }
.welcome p { margin: 0; }
.welcome .actions .btn { flex: 1 1 180px; }
.sec { border-bottom: 1px solid var(--line); }
.secs > .sec:first-child { border-top: 1px solid var(--line); }
.sec.drop-before { box-shadow: 0 -3px 0 var(--brand); }
.sec.drop-after { box-shadow: 0 3px 0 var(--brand); }
.sec.dragging { opacity: 0.45; }
.sec-head { display: flex; align-items: center; gap: 6px; min-height: 56px; }
.sec-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 0; border: 0; background: transparent; text-align: left; font-family: inherit; font-weight: 700; font-size: 1rem; color: var(--text-strong); cursor: pointer; }
.sec-toggle:hover .sec-title { color: var(--link); }
.sec-toggle > .ico { color: var(--link); }
.sec-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sec-count { color: var(--text-3); font-weight: 500; font-size: 0.85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sec-toggle .chev { margin-left: auto; color: var(--text-3); transition: transform 0.2s ease; }
.sec[data-open="true"] .sec-toggle .chev { transform: rotate(180deg); }
.sec.is-hidden .sec-title { color: var(--text-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.grip { width: 28px; height: 40px; display: inline-grid; place-items: center; color: var(--text-3); cursor: grab; border: 0; background: transparent; padding: 0; border-radius: 8px; flex: none; }
.grip:active { cursor: grabbing; }
.grip:hover { color: var(--link); }
.mini-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent; display: inline-grid; place-items: center; color: var(--text-3); padding: 0; flex: none; cursor: pointer; font-family: inherit; transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.mini-btn.on { color: var(--text-2); }
.mini-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--link); background: var(--surface); }
.mini-btn .ico { width: 17px; height: 17px; }
.sec-toggle:focus-visible, .item-toggle:focus-visible, .mini-btn:focus-visible, .grip:focus-visible, .photo-thumb:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sec-body { display: none; padding: 2px 0 20px; }
.sec[data-open="true"] .sec-body { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 480px) { .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.span2 { grid-column: 1 / -1; }
.select { width: 100%; }
.item { border: 1px solid var(--surface-border); border-radius: 14px; background: var(--surface); padding: 6px 6px 6px 14px; }
.item.is-hidden { border-style: dashed; }
.item.is-hidden .item-title { color: var(--text-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.item-head { display: flex; align-items: center; gap: 2px; }
.item-toggle { flex: 1; min-width: 0; border: 0; background: transparent; text-align: left; padding: 4px 0; min-height: 44px; display: flex; flex-direction: column; justify-content: center; font-family: inherit; color: var(--text); cursor: pointer; border-radius: 8px; }
.item-toggle:hover .item-title { color: var(--link); }
.item-title { font-weight: 700; font-size: 0.95rem; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { color: var(--text-3); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-body { display: none; padding: 8px 8px 10px 0; }
.item[data-open="true"] .item-body { display: flex; flex-direction: column; gap: 14px; }
.item-list { display: flex; flex-direction: column; gap: 8px; }
.add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.add-section-row { margin-top: 16px; }
.btn.add-btn { border-style: dashed; color: var(--text-2); }
.dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: end; }
.date-ok { color: var(--text-3); font-size: 0.8rem; min-height: 1.2em; font-variant-numeric: tabular-nums; }
.rich { display: flex; flex-direction: column; gap: 6px; }
.rich-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rich-bar .mini-btn { width: auto; min-width: 36px; padding: 0 10px; gap: 6px; display: inline-flex; align-items: center; font-size: 0.85rem; font-weight: 600; color: var(--text-strong); border-color: var(--chip-border); background: var(--surface); }
.rich-count { margin-left: auto; color: var(--text-3); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.rich textarea.input { min-height: 110px; overflow: hidden; resize: none; }
.chip-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 44px; padding: 5px; border: 1px solid var(--field-border); border-radius: 12px; background: var(--field); cursor: text; }
.chip-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.chip-box .chip { min-height: 30px; padding: 2px 4px 2px 12px; gap: 2px; background: var(--chip); color: var(--text-strong); cursor: default; }
.chip-box .chip:hover { transform: none; border-color: var(--chip-border); color: var(--text-strong); }
.chip-box .chip button { width: 26px; height: 26px; border: 0; background: transparent; border-radius: 50%; display: inline-grid; place-items: center; padding: 0; color: var(--text-3); cursor: pointer; }
.chip-box .chip button:hover { background: var(--tint-brand); color: var(--link); }
.chip-box .chip .ico { width: 13px; height: 13px; color: inherit; }
.chip-field { flex: 1; min-width: 140px; border: 0; outline: none; background: transparent; min-height: 30px; padding: 0 6px; font-family: inherit; font-size: 0.95rem; color: var(--text); }
.chip-field::placeholder { color: var(--placeholder); }
.links { display: flex; flex-direction: column; gap: 8px; }
.link-row { display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 6px; align-items: center; }
.link-row.kv { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) 36px; }
.photo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.photo-thumb { width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); border: 2px dashed rgba(139, 92, 246, 0.45); display: grid; place-items: center; overflow: hidden; color: var(--link); flex: none; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb.square { border-radius: 12px; }
.dz-group .hint, .field .hint { display: block; }

/* ----- Menus (section and entry menus, Add a section, verbs, Download) ----- */
.pop { position: fixed; z-index: 2500; min-width: 240px; max-width: min(360px, calc(100vw - 24px)); max-height: min(70vh, 520px); overflow-y: auto; background: var(--surface); border: 1px solid var(--surface-border); border-radius: 16px; box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22); padding: 6px; }
.pop.wide { max-width: min(460px, calc(100vw - 24px)); }
.pop[hidden] { display: none; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; background: transparent; border-radius: 10px; text-align: left; font-family: inherit; font-size: 0.925rem; font-weight: 500; color: var(--text); cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--tint-brand); color: var(--link); outline: none; }
.menu-item:disabled { opacity: 0.45; cursor: not-allowed; background: transparent; color: var(--text); }
.menu-item .ico { color: var(--link); }
.menu-item .mi-sub { display: block; color: var(--text-3); font-size: 0.78rem; font-weight: 400; }
.menu-item.danger, .menu-item.danger .ico { color: var(--bad); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-label { font-size: 0.78rem; color: var(--text-3); font-weight: 600; padding: 6px 12px 2px; }
.verb-group { padding: 6px 8px 8px; }
.verb-group .verb-head { margin: 0 0 8px; font-size: 0.8rem; font-weight: 600; color: var(--text-3); }
.verb-group .chips { gap: 6px; }
.verb-group .chip { padding: 6px 12px; }
.verb-hint { padding: 0 8px 8px; margin: 0; }

/* ----- Design ----- */
.dz { display: flex; flex-direction: column; gap: 26px; }
.dz-group { display: flex; flex-direction: column; gap: 10px; }
.dz-group > h3 { margin: 0; font-size: 1.05rem; }
.dz-group > p { margin: 0; }
.match-dz { padding-top: 14px; }
.tpl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
@media (min-width: 560px) and (max-width: 1023px), (min-width: 1280px) { .tpl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tpl-card { display: flex; flex-direction: column; gap: 6px; padding: 0; border: 0; background: transparent; text-align: left; min-width: 0; font-family: inherit; color: var(--text); cursor: pointer; }
.tpl-thumb { position: relative; width: 100%; aspect-ratio: 210 / 297; border-radius: 8px; overflow: hidden; background: #fff; border: 1px solid var(--surface-border); box-shadow: var(--surface-shadow); transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; }
.tpl-thumb.letter { aspect-ratio: 215.9 / 279.4; }
.tpl-card:hover .tpl-thumb { border-color: var(--brand); transform: translateY(-3px); box-shadow: var(--surface-hover-shadow); }
.tpl-card:focus-visible { outline: none; }
.tpl-card:focus-visible .tpl-thumb { outline: 2px solid var(--brand); outline-offset: 2px; }
.tpl-card[aria-pressed="true"] .tpl-thumb { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.tpl-thumb .page { position: absolute; left: 0; top: 0; transform-origin: 0 0; box-shadow: none; pointer-events: none; }
.tpl-name { font-weight: 700; font-size: 0.925rem; display: flex; align-items: center; gap: 6px; color: var(--text-strong); }
.tpl-name .ico { width: 16px; height: 16px; color: var(--ok); }
.tpl-desc { color: var(--text-3); font-size: 0.8rem; line-height: 1.35; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); padding: 0; background: var(--c); cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.swatch:hover { transform: translateY(-2px); }
.swatch[aria-checked="true"], .swatch-custom.on { box-shadow: 0 0 0 2px var(--brand); }
.swatch:focus-visible, .swatch-custom:focus-within { outline: 2px solid var(--brand); outline-offset: 3px; }
.swatch-custom { position: relative; overflow: hidden; background: conic-gradient(#d23b2f, #e8a33d, #3a9b5c, #2a6fd6, #7a4bc4, #d23b2f); }
.swatch-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.slider-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.slider-row output { font-variant-numeric: tabular-nums; color: var(--link); font-weight: 700; font-size: 0.875rem; }
.slider-row input { grid-column: 1 / -1; width: 100%; accent-color: var(--brand); min-height: 28px; }
.fit-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.fit-box p { flex: 1 1 200px; margin: 0; font-size: 0.875rem; color: var(--text-2); display: flex; gap: 8px; align-items: center; line-height: 1.5; }
.fit-box p .ico { color: var(--ok); }

/* ----- Check ----- */
.ck { display: flex; flex-direction: column; gap: 16px; }
.ck-summary { display: flex; flex-direction: column; gap: 8px; }
.ck-summary h3 { margin: 0; font-size: 1.1rem; }
.ck-summary p { margin: 0; }
.tally { display: flex; height: 8px; border-radius: 9999px; overflow: hidden; background: var(--line); gap: 2px; }
.tally span { display: block; height: 100%; }
.tally .t-fix { background: var(--bad); }
.tally .t-tip { background: #d97706; }
.tally .t-ok { background: var(--ok); }
.tally-key { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.82rem; color: var(--text-3); }
.tally-key b { color: var(--text-strong); font-variant-numeric: tabular-nums; }
.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.note { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 4px 12px; margin: 0; padding: 12px; border-radius: 14px; border: 1px solid var(--surface-border); background: var(--surface); color: var(--text); line-height: 1.5; cursor: pointer; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.note:hover { border-color: var(--brand); }
.note:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.note.flash { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.note-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; border: 2px solid var(--bad); color: var(--bad); font-variant-numeric: tabular-nums; }
.note.tip .note-n { border-color: var(--warn); color: var(--warn); }
.note.ok { cursor: default; }
.note.ok:hover { border-color: var(--surface-border); }
.note.ok .note-n { border-color: var(--ok); color: var(--ok); }
.note.ok .note-n .ico { width: 14px; height: 14px; stroke-width: 3; }
.note-title { font-weight: 700; font-size: 0.925rem; color: var(--text-strong); align-self: center; }
.note-text { grid-column: 2; color: var(--text-2); font-size: 0.875rem; }
.note q { quotes: '"' '"'; color: var(--text-strong); }
.note-actions { grid-column: 2; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.ok-list summary { cursor: pointer; font-weight: 600; font-size: 0.925rem; padding: 6px 0; color: var(--link); }
.ok-list .notes { margin-top: 6px; }
.kw-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.kw { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 4px 6px 4px 12px; border-radius: 9999px; font-size: 0.85rem; font-weight: 600; border: 1px dashed var(--line-strong); background: var(--surface); color: var(--text-strong); }
.kw.hit { border: 1px solid transparent; background: var(--ok-soft); padding: 4px 12px 4px 10px; }
.kw.hit .ico { color: var(--ok); width: 14px; height: 14px; stroke-width: 3; }
.kw button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent; display: inline-grid; place-items: center; padding: 0; color: var(--link); cursor: pointer; }
.kw button:hover { background: var(--tint-brand); }
.kw button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.kw button .ico { width: 15px; height: 15px; }
.kw-n { color: var(--text-3); font-size: 0.75rem; font-weight: 500; padding-right: 4px; font-variant-numeric: tabular-nums; }
.meter { height: 10px; border-radius: 9999px; background: var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--gradient-brand); border-radius: 9999px; transition: width 0.3s ease; }

/* ----- Windows: your resumes, import, the photo ----- */
.docs-lead { margin: 0; }
.dialog-sub { margin: 4px 0 0; font-size: 1rem; }
.doc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.doc-row { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 14px; border: 1px solid var(--surface-border); border-radius: 14px; background: var(--surface); margin: 0; }
.doc-row.current { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.doc-open { flex: 1; min-width: 0; border: 0; background: transparent; text-align: left; padding: 2px 0; font-family: inherit; color: var(--text); cursor: pointer; border-radius: 8px; }
.doc-open:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.doc-open b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-strong); }
.doc-open span { color: var(--text-3); font-size: 0.8rem; display: block; }
.dialog-actions:has([data-act="wipe"]) { justify-content: flex-start; }
.dialog textarea.input { min-height: 180px; }
.crop { width: 100%; max-width: 300px; aspect-ratio: 1; margin: 0 auto; border-radius: 14px; overflow: hidden; background: var(--surface-2); touch-action: none; cursor: grab; }
.crop:active { cursor: grabbing; }
.crop:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.crop canvas { width: 100%; height: 100%; display: block; }
.range-field input[type="range"] { width: 100%; accent-color: var(--brand); min-height: 28px; }
.plain-list { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); }
.plain-list li { margin: 0; color: var(--text-2); }
.help-body b { color: var(--text-strong); }

/* ----- Print: only the resume or letter pages ----- */
@media print {
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    html, body { background: #fff !important; padding: 0 !important; margin: 0 !important; display: block !important; min-height: 0 !important; }
    body::before { display: none !important; }
    body > *:not(main):not(.icon-sprite) { display: none !important; } /* the sprite holds the contact icons drawn on the page */
    main > *:not(.app-shell), .app-shell > *:not(.app-layout), .app-layout > *:not(.preview-column), .preview-card > *:not(.desk-scroll) { display: none !important; }
    main, .app-shell, .app-layout, .preview-column, .preview-card, .desk-scroll { display: block !important; position: static !important; height: auto !important; max-height: none !important; overflow: visible !important; padding: 0 !important; margin: 0 !important; background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; width: auto !important; max-width: none !important; }
    .pages { display: block !important; padding: 0 !important; gap: 0 !important; width: auto !important; min-width: 0 !important; }
    .pages .page { box-shadow: none !important; zoom: 1 !important; break-after: page; page-break-after: always; margin: 0 !important; }
    .pages .page:last-child { break-after: auto; page-break-after: auto; }
    .pm { display: none !important; }
    .pm-u { text-decoration: none !important; }
    ins.adsbygoogle, .google-auto-placed, .theme-toggle, #zdu-cookie-banner { display: none !important; }
}

/* ----- Tablets ----- */
@media (max-width: 1023px) {
    .info-section .info-grid { grid-template-columns: repeat(2, 1fr); }
    .info-three { grid-template-columns: 1fr; }
}

/* ----- Phones ----- */
@media (max-width: 639px) {
    .app-hero { margin-bottom: 1.5rem; }
    .app-tagline { font-size: 1rem; }
    .app-toolbar { gap: 10px; }
    .toolbar-left, .toolbar-right { width: 100%; }
    .toolbar-left .btn, .toolbar-right .btn { flex: 1 1 auto; }
    .status-pill { flex: 1 1 100%; min-width: 0; }
    .part-seg { flex: 1 1 100%; }
    .part-seg button { flex: 1; }
    .app-shell > .view-tabs { width: 100%; }
    .app-shell > .view-tabs .view-tab { flex: 1 1 auto; justify-content: center; padding: 8px 6px; font-size: 0.8rem; }
    .card-header { padding-left: 16px; padding-right: 16px; }
    .card-body { padding: 14px 16px 16px; }
    .desk-scroll { padding: 12px 0 16px; }
    .toasts { bottom: 16px; right: 16px; left: 16px; align-items: stretch; }
    .toast { min-width: 0; max-width: none; }
    .dialog-body, .dialog-head, .dialog-actions { padding-left: 16px; padding-right: 16px; }
    .info-section h2 { font-size: 1.4rem; }
    .info-section .info-grid, .info-three { grid-template-columns: 1fr; }
    .info-card { padding: 16px; }
    .step-num { left: 16px; }
    .link-row.kv { grid-template-columns: minmax(0, 1fr) 44px; }
    .link-row.kv > .input:first-child { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
    .btn, .info-card, .dialog, .toast, .chip, .seg button, .view-tab, .tpl-thumb, .swatch, .mini-btn, .note, .meter span, .sec-toggle .chev { transition: none; animation: none; }
}

/* Phones: 16 px text, 44 px tap targets (AdSense audit H-04, 8 Oct 2026). The resume pages and the template
   thumbnails are document previews and keep their own sizes. */
@media (max-width: 639.98px) {
    main button, main select, main summary, main [role="button"],
    main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]):not([type="color"]) { min-height: 44px; }
    main .icon-btn, main .mini-btn, .app-toolbar .icon-btn, .zoom .icon-btn, main .grip { min-width: 44px; min-height: 44px; }
    main .rich-bar .mini-btn { min-width: 44px; }
    main .marks-btn { min-height: 44px; }
    main .zoom-val { min-height: 44px; }
    main .check-row { min-height: 44px; align-items: center; }
    main input[type="range"], .dialog input[type="range"] { min-height: 44px; }
    main .seg button { min-width: 44px; min-height: 44px; }
    main .view-tab { min-height: 44px; }
    main .tpl-card { min-height: 44px; }
    main .chip-box .chip { min-height: 44px; }
    main .chip-box .chip button, main .kw button { width: 44px; height: 44px; }
    main .kw { min-height: 44px; }
    main :is(p, li, dd, td, figcaption, .form-hint, .hint, .date-ok, .item-sub, .item-title, .muted, .small, .sec-count, .tpl-desc,
        .tpl-name, .note-title, .note-text, .tally-key, .kw, .rich-count, .card-note, .label, .input, .select, .chip, .chip-field):not(.page *) { font-size: 1rem; }
    .pop .menu-item { min-height: 44px; font-size: 1rem; }
    .pop .menu-item .mi-sub, .pop .menu-label, .pop .verb-group .verb-head { font-size: 0.875rem; }
    .pop .chip { min-height: 44px; font-size: 1rem; }
    .dialog button, .dialog .btn, .dialog .doc-open { min-height: 44px; }
    .dialog .mini-btn, .dialog .dialog-close { width: 44px; height: 44px; }
    .dialog .check-row { min-height: 44px; align-items: center; }
    .dialog p, .dialog li, .dialog .form-hint, .dialog .doc-open span, .dialog .input { font-size: 1rem; }
}
