/* ---------- CV PRO ----------
   Design tokens first: every colour, size and timing below comes from these. Contrast is checked against
   WCAG AA (4.5:1 for text) on the surfaces each token is used on. */

/* Plus Jakarta Sans (SIL Open Font License 1.1), self-hosted so no visitor's IP goes to Google. */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Colour – the existing identity (dark slate sidebar, blue-grey accent), tuned for contrast. */
  --sidebar: #1f2d37;
  --sidebar-2: #2a3a46;
  --sidebar-text: #dbe4ea;
  --sidebar-muted: #a7b7c1;      /* 6.6:1 on --sidebar */
  --accent: #3d6274;             /* 6.4:1 on white – links, primary buttons */
  --accent-strong: #2e4d5c;
  --accent-soft: #e4edf1;
  --bg: #f5f7f9;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --text: #16212a;
  --muted: #4e5d68;              /* 6.9:1 on white, 6.5:1 on --bg */
  --line: #dee3e8;
  --border: #c9d1d8;             /* inputs and buttons */
  --border-strong: #9aa7b1;
  --red: #b42318;  --red-soft: #fdecea;  --red-text: #7a1f1a;
  --amber: #8a5a00; --amber-soft: #fff4d6; --amber-text: #6b4500; --amber-line: #e7c66b;
  --green: #1d7a45; --green-soft: #e6f5ec; --green-text: #14532d;
  --info-soft: #eef2f6;
  --focus: #2b6cb0;              /* focus ring: visible on white, --bg and --accent-soft */

  /* Type – one family, a fixed scale, 16px base (also stops iOS zooming into fields). */
  --font: "Plus Jakarta Sans", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: Consolas, "SF Mono", Menlo, monospace;
  --fs-xs: 12px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 28px;
  --lh: 1.5;

  /* Space, shape, depth, motion. */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  --radius-sm: 6px; --radius: 10px; --radius-lg: 14px; --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(16, 24, 32, .06), 0 4px 16px rgba(16, 24, 32, .05);
  --shadow-lg: 0 8px 28px rgba(16, 24, 32, .16);
  --t-fast: 150ms; --t: 200ms; --ease: cubic-bezier(.2, .8, .2, 1);
  --touch: 44px;                 /* minimum target on touch screens */

  /* Controls: buttons are tinted (never white with a border – that's what fields look like). */
  --radius-ctl: 12px;
  --btn-tonal: #e3ecf1;          /* --accent-strong on it: 7.4:1 */
  --btn-tonal-hover: #d3e1e9;
  --btn-disabled: #eceff2;
  --btn-disabled-text: #7d8a94;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: var(--fs-md); line-height: var(--lh); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1 { font-size: var(--fs-2xl); line-height: 1.2; margin: 2px 0 4px; letter-spacing: -.015em; }
h2 { font-size: var(--fs-lg); line-height: 1.3; margin: 2px 0 0; }
h3 { font-size: var(--fs-md); line-height: 1.35; margin: 0 0 var(--sp-2); }
h4 { font-size: var(--fs-xs); margin: 18px 0 var(--sp-2); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
code { background: var(--code-bg); padding: 1px 5px; border-radius: 4px; font-size: var(--fs-xs); }
small, .small { font-size: var(--fs-xs); }
small { display: block; color: var(--muted); margin-top: 4px; }
.muted { color: var(--muted); }
.eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.boot, .placeholder { margin: auto; padding: 60px 20px; text-align: center; color: var(--muted); }
.boot { margin-top: 40vh; }

/* Visible focus for keyboard users everywhere; the mouse doesn't get rings. */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
.sidebar :focus-visible { outline-color: #8cc4ff; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Icons (Icon.razor): inherit colour, sized to the text. */
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.icon.filled { fill: currentColor; }

/* ---------- Controls ---------- */
input, textarea, select { width: 100%; font: inherit; font-size: var(--fs-md); color: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); margin-bottom: var(--sp-2); min-height: var(--touch); transition: border-color var(--t-fast); }
input:hover, textarea:hover, select:hover { border-color: var(--border-strong); }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--accent-soft); outline-offset: 0; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: #6b7883; }
input[type=checkbox], input[type=radio] { min-height: 0; width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
textarea { resize: vertical; line-height: var(--lh); }
textarea.todo { background: #fffaf0; border-color: var(--amber-line); }
/* Buttons – one system, three looks, so a button never looks like a field:
   primary  = solid accent: the one main action in a place (Lav, Gem, PDF).
   default  = tonal (tinted, no border): every other action. Fields are white with a border – buttons never are.
   ghost    = accent text, no fill: low-priority actions (Annuller, Luk, Fjern) next to a stronger one.
   danger   = tinted red: destructive actions. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: var(--fs-sm); font-weight: 650; min-height: var(--touch); padding: 10px 16px; border-radius: var(--radius-ctl); border: 1px solid transparent; background: var(--btn-tonal); color: var(--accent-strong); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease), box-shadow var(--t-fast); -webkit-tap-highlight-color: transparent; }
.btn:hover { background: var(--btn-tonal-hover); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { background: var(--btn-disabled); color: var(--btn-disabled-text); border-color: transparent; box-shadow: none; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 2px rgba(16, 24, 32, .14), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.primary:disabled { background: var(--btn-disabled); color: var(--btn-disabled-text); box-shadow: none; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.ghost:disabled { background: transparent; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: var(--fs-xs); }
.btn.block { width: 100%; margin-top: 4px; }
.btn.grow { flex: 1; }
.btn.icon-only { padding: 0; width: var(--touch); }
.btn.small.icon-only { width: 36px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: var(--sp-2); }
.row.spread { justify-content: space-between; }
.push { margin-left: auto; }
.segmented { display: inline-flex; background: var(--track); border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: var(--sp-2); }
.segmented button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: var(--fs-sm); border: 0; background: transparent; min-height: 38px; padding: 6px 14px; border-radius: 8px; cursor: pointer; color: var(--muted); transition: background-color var(--t-fast), color var(--t-fast); }
.segmented button:hover { color: var(--text); }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.segmented.small { margin-bottom: 0; }
.field { margin-bottom: var(--sp-4); }
.field > label, .field > .field-label, details.field > summary { display: block; font-weight: 600; margin-bottom: 6px; cursor: default; }
details.field > summary { cursor: pointer; color: var(--muted); min-height: var(--touch); display: flex; align-items: center; }
.field label em { font-weight: 400; color: var(--muted); }
.field-help { display: block; font-size: var(--fs-xs); color: var(--muted); margin: -2px 0 var(--sp-2); }
.dropzone { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); text-align: center; border: 1.5px dashed var(--border); border-radius: var(--radius); padding: 18px; color: var(--muted); cursor: pointer; position: relative; margin-bottom: 10px; background: var(--surface-2); transition: border-color var(--t-fast), color var(--t-fast); }
.dropzone:hover, .dropzone:focus-within { border-color: var(--accent); color: var(--accent); }
.dropzone.small { padding: 10px; }
.dropzone input, .hidden-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; margin: 0; }
label.btn { position: relative; }
label.btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.alert { padding: 10px 12px; border-radius: 8px; margin: var(--sp-2) 0; font-size: var(--fs-sm); }
.alert.error { background: var(--red-soft); color: var(--red-text); }
.alert.ok { background: var(--green-soft); color: var(--green-text); }
.alert.info { background: var(--info-soft); }
/* A written application that couldn't be saved (Workspace): one line each for what, why and where it is kept, then the buttons. */
.alert.unsaved-held { display: grid; gap: 4px; margin: var(--sp-2) 16px 0; }
.alert.unsaved-held small { color: inherit; opacity: .85; }
.alert.unsaved-held .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: var(--sp-4); }
.card.flush { padding: 0; overflow: hidden; }
.badge { font-style: normal; font-size: var(--fs-xs); font-weight: 700; color: #fff; border-radius: 10px; padding: 0 7px; margin-left: 4px; }
.badge.red { background: var(--red); } .badge.amber { background: var(--amber); }
.tag { font-size: var(--fs-xs); background: var(--accent-soft); color: var(--accent-strong); border-radius: 6px; padding: 2px 7px; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 272px 1fr; height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-text); padding: 18px 14px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; font-size: var(--fs-sm); }
/* Nothing in the sidebar may shrink: with many applications or a short screen the list would be squeezed and run over
   the menu below it. The sidebar scrolls instead. */
.sidebar > * { flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: var(--fs-lg); letter-spacing: .04em; color: #fff; margin-bottom: var(--sp-2); }
.brand .logo { background: var(--accent); color: var(--on-accent); border-radius: 7px; padding: 2px 7px; }
.brand.big { font-size: var(--fs-2xl); justify-content: center; }
.brand.small { font-size: var(--fs-md); margin: 0; color: var(--text); }
.menu-close { display: none; margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; width: var(--touch); height: var(--touch); border-radius: 8px; align-items: center; justify-content: center; }
.menu-close:hover { background: var(--sidebar-2); }
.side-label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--sidebar-muted); margin-top: 10px; }
.people { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.person { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 68px; padding: 8px 4px; border-radius: var(--radius); border: 1px solid transparent; background: transparent; color: inherit; font: inherit; font-size: var(--fs-xs); cursor: pointer; text-decoration: none; transition: background-color var(--t-fast); }
.person img, .person .initials { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.person .initials { display: flex; align-items: center; justify-content: center; background: var(--sidebar-2); font-weight: 700; font-size: var(--fs-md); }
.person:hover { background: var(--sidebar-2); }
.person.active { background: var(--sidebar-2); border-color: #6f93a3; }
.person.active img { box-shadow: 0 0 0 2px #6f93a3; }
.sidebar .btn.primary { margin-top: 6px; background: #4f7385; border-color: #4f7385; }
.sidebar .btn.primary:hover { background: #5d8496; border-color: #5d8496; }
.history { display: flex; flex-direction: column; gap: 2px; min-height: 40px; }
.history-item { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 9px 10px; border-radius: 8px; color: var(--sidebar-text); text-decoration: none; transition: background-color var(--t-fast); }
.history-item b { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item span { grid-column: 1; font-size: var(--fs-xs); color: var(--sidebar-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item small { grid-column: 2; grid-row: 1; margin: 0; color: var(--sidebar-muted); }
.history-item:hover { background: var(--sidebar-2); }
.history-item.active { background: #4f7385; color: #fff; }
.history-item.active span, .history-item.active small { color: #eef4f7; }
.side-nav { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: var(--sp-3); border-top: 1px solid var(--sidebar-2); }
.side-nav a { display: flex; align-items: center; gap: 10px; min-height: var(--touch); color: var(--sidebar-text); text-decoration: none; padding: 8px 10px; border-radius: 8px; transition: background-color var(--t-fast); }
.side-nav a:hover, .side-nav a.active { background: var(--sidebar-2); color: #fff; }
.main { overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.mobile-bar { display: none; }
/* Phones: the tab bar is the main menu, so the side menu keeps only people, applications and "Mere". */
.narrow-nav { display: none; }
@media (max-width: 980px) {
  .sidebar .wide-nav { display: none; }
  .side-nav .narrow-nav { display: block; margin: 0 0 4px; }
}
.who-chip { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: var(--touch); padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; transition: background-color var(--t-fast); }
.who-chip:hover, .who-chip[aria-expanded="true"] { background: var(--accent-soft); }
.who-chip img, .who-chip .initials { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.who-chip .initials { display: flex; align-items: center; justify-content: center; background: var(--accent-soft); font-size: var(--fs-xs); font-weight: 700; }
.who-chip svg { width: 16px; height: 16px; color: var(--muted); }
.sidebar .muted.small { color: var(--sidebar-muted); }

/* ---------- Workspace ---------- */
.workspace { flex: 1; display: grid; grid-template-columns: minmax(380px, 480px) 1fr; min-height: 0; }
.panel { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-right: 1px solid var(--line); }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 18px 20px 12px; }
.steps { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.step { font: inherit; font-weight: 600; font-size: var(--fs-sm); background: none; border: 0; border-bottom: 2px solid transparent; min-height: var(--touch); padding: 10px 8px; color: var(--muted); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.step span { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 50%; background: var(--track); font-size: var(--fs-xs); color: var(--text); }
.step.active { color: var(--text); border-bottom-color: var(--accent); }
.step.active span { background: var(--accent); color: var(--on-accent); }
.step:disabled { opacity: .5; cursor: not-allowed; }
.panel-body { flex: 1; overflow-y: auto; padding: 18px 20px 28px; }
.matches, .issues, .questions, .template-list { list-style: none; padding: 0; margin: 0; }
.matches li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.matches li small { margin-top: 2px; }
.matches .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; }
.matches .covered .dot { background: var(--green); } .matches .partial .dot { background: #b77900; } .matches .missing .dot { background: var(--red); }
.questions li { padding: 10px 12px; background: var(--amber-soft); border-radius: 8px; margin-bottom: 6px; font-size: var(--fs-sm); }
.questions-help { color: var(--muted); font-size: var(--fs-xs); }
.issues li { padding: 10px 12px; border-radius: 8px; margin-bottom: 6px; font-size: var(--fs-sm); }
.issues .error { background: var(--red-soft); } .issues .warning { background: var(--amber-soft); } .issues .info { background: var(--info-soft); }
.issues blockquote { margin: 4px 0 0; font-style: italic; color: var(--muted); }
.bullet { position: relative; margin-bottom: 10px; }
.bullet textarea { padding-right: 64px; margin-bottom: 2px; }
.bullet .tools { position: absolute; right: 6px; top: 6px; display: flex; gap: 2px; }
.bullet .tools button { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 1px 7px; cursor: pointer; }
.bullet .source { font-size: var(--fs-xs); margin-top: 0; }
.chips-edit { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-edit button { font: inherit; font-size: var(--fs-xs); border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-pill); min-height: 32px; padding: 4px 12px; cursor: pointer; color: var(--muted); }
.chips-edit button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); font-weight: 600; }

.preview-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; }
.toolbar { display: flex; align-items: center; gap: var(--sp-2) var(--sp-3); flex-wrap: wrap; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.toolbar .segmented { margin: 0; }
.toolbar-group { display: flex; align-items: center; gap: var(--sp-2); }
/* Workspace preview toolbar: document | layout | edit | export – the export group keeps right, groups wrap whole. */
.toolbar .toolbar-export { margin-left: auto; }
.toolbar .hint { white-space: normal; max-width: 220px; }
.name-input { width: auto; flex: 1; min-width: 160px; margin: 0; font-weight: 600; }
.preview { flex: 1; width: 100%; border: 0; background: #d9dde1; min-height: 300px; }
.preview.tall { height: 75vh; display: block; }
.empty-preview { margin: auto; text-align: center; color: var(--muted); padding: 30px; }
.empty-preview .paper { width: 170px; height: 240px; margin: 0 auto 18px; background: #fff; border-radius: 4px; box-shadow: var(--shadow); background-image: linear-gradient(90deg, var(--accent-soft) 0 32%, transparent 32%), repeating-linear-gradient(180deg, transparent 0 18px, #eef1f4 18px 22px); }
.empty-state { margin: auto; max-width: 440px; text-align: center; padding: 40px 20px; }

/* On phones the workspace shows one thing at a time: the form or the document. */
.view-switch { display: none; }

/* ---------- Pages ---------- */
.page-wrap { flex: 1; overflow-y: auto; padding: 28px 32px 44px; position: relative; } /* positioned: the page's .visually-hidden children must not stretch the document (a second scrollbar) */
.page-wrap.narrow { max-width: 780px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-4); margin-bottom: 20px; }
.page-head p { max-width: 640px; margin: 4px 0 0; }
.avatar-lg { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow); }
.two-col { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 20px; align-items: start; }
.col.wide { min-width: 0; }
textarea.json { font-family: var(--mono); font-size: var(--fs-xs); line-height: 1.5; }
textarea.code { margin: 0; border-radius: 0; border-width: 0 0 1px; }
.source { max-height: 300px; overflow: auto; white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: var(--fs-xs); }
.template-list li { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); padding: 8px 6px; border-radius: 8px; }
.template-list li.active { background: var(--accent-soft); }
.code-box { font-family: var(--mono); font-size: var(--fs-lg); letter-spacing: .04em; background: #f3f6f8; border: 1px dashed #b9c6ce; border-radius: 8px; padding: 12px; text-align: center; margin: 8px 0; word-break: break-all; }

/* ---------- Family setup ---------- */
.setup { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, #1f2d37 0%, #3d5d6d 100%); }
.setup-card { width: 100%; max-width: 780px; }
/* The join question (JoinConfirm): one card, so a narrower column. */
.setup-card.join-confirm { max-width: 520px; }
.setup .lead { text-align: center; color: #dbe4ea; margin: 4px 0 22px; font-size: var(--fs-md); }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.code-input { font-family: var(--mono); text-transform: uppercase; letter-spacing: .03em; }

/* ---------- Blazor ---------- */
/* Dark text on the light bar in every theme, including dark mode (B74). */
#blazor-error-ui { color-scheme: light only; background: lightyellow; color: #1f2d37; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); box-sizing: border-box; display: none; left: 0; padding: 0.6rem 1.25rem 0.7rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
#blazor-error-ui a { color: #0b4f8a; }
/* Local Debug builds with the test AI on (MainLayout): a small fixed tab on every screen. Clicks pass through it. */
.test-ai-strip { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 1001; pointer-events: none; padding: 2px 10px; border: 1px solid var(--amber-line); border-top: 0; border-radius: 0 0 8px 8px; background: var(--amber-soft); color: var(--amber-text); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.blazor-error-boundary { background: #b32121; padding: 1rem; color: white; }
.blazor-error-boundary::after { content: "Der skete en fejl."; }
html[lang="en"] .blazor-error-boundary::after { content: "Something went wrong."; }

/* ---------- Template tuning ---------- */
.tune { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.swatch { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--muted); }
.swatch input[type=color] { width: 36px; height: 36px; min-height: 0; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; background: none; }
.swatch select { width: auto; margin: 0; padding: 4px 6px; font-size: var(--fs-xs); min-height: 36px; }
.feedback { display: flex; gap: var(--sp-2); }
.feedback input { margin: 0; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.compare.single { grid-template-columns: 1fr; }
.compare-col { background: #d9dde1; display: flex; flex-direction: column; min-width: 0; }
.compare-label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface); padding: 6px 12px; }
.example-img { height: 75vh; overflow: auto; padding: 16px; }
.example-img img { width: 100%; display: block; box-shadow: 0 4px 24px rgba(0,0,0,.18); }
@media (max-width: 1280px) { .compare { grid-template-columns: 1fr; } }

/* ---------- Settings / profile update ---------- */
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; margin-top: 6px; cursor: pointer; min-height: var(--touch); }
.check input { width: 18px; margin: 3px 0 0; }
.key-row { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.key-row input { margin-top: 8px; }
.suggestions { list-style: none; padding: 0; margin: 0; }
.suggestions li { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.suggestions li.off { opacity: .55; }
.suggestions input[type=checkbox] { margin: 3px 0 0; }
.suggestions .what { font-weight: 600; }
.suggestions li > div { flex: 1 1 auto; min-width: 0; }
.suggestions .suggestion-text { width: 100%; margin: 4px 0 0; }
.suggestions .detail { font-size: var(--fs-sm); margin-top: 2px; }
.suggestions blockquote { margin: 6px 0 0; padding-left: 8px; border-left: 3px solid var(--accent-soft); color: var(--muted); font-size: var(--fs-xs); }
.suggestions .warn { color: var(--amber-text); font-size: var(--fs-xs); margin-top: 4px; }
.suggestions .before { color: var(--muted); }
.suggestions .own-choice { font-size: var(--fs-xs); font-weight: 600; margin-top: 4px; }
.file-list { list-style: none; padding: 0; margin: 0 0 10px; font-size: var(--fs-xs); color: var(--muted); }
.hint { white-space: nowrap; }
.form-row { display: grid; grid-template-columns: 1.3fr 1.3fr 1fr auto; gap: 6px; align-items: start; }
.form-row input { margin-bottom: 6px; }
h3.spaced { margin-top: 18px; }
@media (max-width: 700px) { .form-row { grid-template-columns: 1fr; } }

/* ---------- Status & follow-up ---------- */
.status-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 20px 12px; }
.status-select { width: auto; margin: 0; min-height: 36px; padding: 5px 10px; font-weight: 600; font-size: var(--fs-sm); border-radius: var(--radius-pill); }
.status-select.status-sent { background: #e8f0fe; border-color: #8ab4f8; }
.status-select.status-interview { background: var(--amber-soft); border-color: var(--amber-line); }
.status-select.status-rejected { background: #f1f3f4; color: var(--muted); }
.status-select.status-offer { background: var(--green-soft); border-color: #7cc49a; }
.followup { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--muted); }
.followup input { width: auto; margin: 0; min-height: 36px; padding: 4px 8px; font-size: var(--fs-sm); }
.warn-tag { background: var(--amber-soft); color: var(--amber-text); }
.history-item em.status-dot { grid-column: 2; grid-row: 2; justify-self: end; font-style: normal; font-size: 11px; font-weight: 700; border-radius: 8px; padding: 0 6px; background: var(--sidebar-2); color: #dbe4ea; }
.history-item em.status-interview { background: #7a5a00; color: #fff3c4; }
.history-item em.status-offer { background: #1f6f43; color: #e6f5ec; }
.history-item em.status-rejected { opacity: .75; }
.history-item em.due { background: #c2413b; color: #fff; }
.questions li input { margin: 6px 0 0; background: var(--surface); }
.cost { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.spend { display: flex; gap: 24px; margin: 8px 0; }
.spend div { display: flex; flex-direction: column; gap: 2px; }
.spend b { font-size: var(--fs-lg); }
.star { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: var(--fs-xs); font-weight: 600; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-pill); min-height: 36px; padding: 4px 12px; cursor: pointer; color: var(--muted); }
.star.on { background: var(--amber-soft); border-color: var(--amber-line); color: var(--amber-text); }

/* ---------- Editing in the preview ---------- */
.panel-head .grow { flex: 1; min-width: 0; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.btn.icon { padding: 0; width: var(--touch); }
.edit-hint { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--muted); background: var(--surface); border-bottom: 1px solid var(--line); padding: 6px 16px; }
/* flex: none – a panel keeps its height in the preview column and pushes the hint and the document down; it never
   shrinks under its content (which then ran over the hint bar). */
.content-panel { flex: none; background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 16px; max-height: 45vh; overflow-y: auto; box-shadow: 0 6px 12px rgba(16,24,32,.06); }
.content-panel .field { margin-bottom: 10px; }
.content-panel .field.highlight { background: var(--accent-soft); border-radius: 8px; padding: 8px; }
/* The look picker ("Udseende"): layout, colour, typeface, density and photo for the built-in CV and letter. */
.look-panel .look-group { margin: 0 0 var(--sp-3); }
.look-panel .field-label { display: block; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.look-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.look-opt { font: inherit; font-size: var(--fs-sm); min-height: 34px; padding: 4px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); cursor: pointer; }
.look-opt:hover { border-color: var(--border-strong); }
/* Chosen: the text colour as background, the surface colour as text – readable in light and dark mode. */
.look-opt.on { background: var(--text); border-color: var(--text); color: var(--surface); font-weight: 600; }
.look-swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface); background: var(--swatch); box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; }
.look-swatch.on { box-shadow: 0 0 0 2px var(--text); } /* the gap is --surface, the ring --text: visible in both modes */
.look-opt:focus-visible, .look-swatch:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.look-panel > .btn { margin-top: 2px; }

/* ---------- Statistics ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: var(--sp-4); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.kpi span { font-size: var(--fs-xs); color: var(--muted); }
.kpi b { font-size: 26px; }
.kpi b.small-b { font-size: var(--fs-md); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--sp-4); }
table.stats { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.stats th { text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.stats td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
small.inline { display: inline; margin: 0; }
.followups { list-style: none; padding: 0; margin: 0; }
.followups li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.followups small { margin: 0; }

.danger-zone { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.btn.danger { color: var(--red); border-color: #e7b4b0; }
.btn.danger:hover { background: var(--red-soft); }

/* An h1 that keeps the look of a section heading (one h1 per page, for screen readers and focus on navigation). */
.h2 { font-size: var(--fs-lg); margin: 2px 0 0; letter-spacing: 0; }
.field-warn { display: block; margin-top: 4px; color: var(--amber-text); }

/* Messages that stay visible whatever is folded or scrolled away. */
.toasts { position: fixed; z-index: 900; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; margin: 0; box-shadow: var(--shadow-lg); animation: toast-in var(--t) var(--ease); }
.toast > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-close { background: none; border: 0; color: inherit; cursor: pointer; width: 32px; height: 32px; margin: -6px -6px -6px 0; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.toast-close:hover { background: rgba(0,0,0,.06); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.sidebar-backdrop { display: none; }

/* ---------- Tablet and phone ---------- */
@media (max-width: 980px) {
  .app { display: block; height: auto; min-height: 100vh; }
  /* The closed drawer is also hidden from the tab order (B46): visibility hides it after the slide-out finishes. */
  .sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; width: 288px; transform: translateX(-100%); visibility: hidden; transition: transform var(--t) var(--ease), visibility 0s linear var(--t); box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .sidebar.open { transform: none; visibility: visible; transition: transform var(--t) var(--ease), visibility 0s; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 19; background: rgba(0,0,0,.35); }
  .menu-close { display: inline-flex; }
  .main { overflow: visible; min-height: 100vh; }
  .mobile-bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
  .workspace { display: flex; flex-direction: column; }
  .panel { border-right: 0; }
  .panel-body { overflow: visible; }
  .preview-pane { min-height: calc(100vh - 122px); min-height: calc(100dvh - 122px); border-top: 1px solid var(--line); } /* mobile bar + view switch */
  .two-col, .setup-grid { grid-template-columns: 1fr; }
  .page-wrap { padding: 20px 16px 32px; overflow: visible; }
  .page-head { flex-wrap: wrap; }

  /* One view at a time: a sticky switch between the form and the document. */
  .view-switch { display: flex; position: sticky; top: 61px; z-index: 9; background: var(--bg); padding: 8px 12px; border-bottom: 1px solid var(--line); }
  .view-switch .segmented { display: flex; width: 100%; margin: 0; }
  .view-switch .segmented button { flex: 1; min-height: var(--touch); }
  .view-switch .badge { margin-left: 0; }
  .toolbar { padding: 8px 12px; }
  .edit-hint { padding: 6px 12px; }
  .workspace.show-doc .panel { display: none; }
  .workspace.show-form .preview-pane { display: none; }
}

/* Phones: the toolbar stacks into full-width rows, with the downloads sharing the last one. */
@media (max-width: 600px) {
  .toolbar > .segmented { display: flex; width: 100%; }
  .toolbar > .segmented button { flex: 1; }
  .toolbar-layout { flex: 1 1 100%; }
  .toolbar .hint { max-width: none; flex: 1; }
  .toolbar .toolbar-export { flex: 1 1 100%; margin-left: 0; }
  .toolbar-export .btn { flex: 1; }
}

/* Touch screens: every target at least 44 px. */
@media (pointer: coarse) {
  .btn.small, .status-select, .followup input, .star, .swatch select, .segmented button { min-height: var(--touch); }
  .btn.small.icon-only { width: var(--touch); }
  .chips-edit button { min-height: 40px; }
  .look-opt, .look-swatch { min-height: var(--touch); }
  .look-swatch { width: var(--touch); }
  .swatch input[type=color] { width: var(--touch); height: var(--touch); }
}

/* Respect "reduce motion". */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Page additions (icons, tables, headings) ---------- */
.toast-close { width: var(--touch); height: var(--touch); margin: -10px -10px -10px 0; }
.template-list .link { min-height: var(--touch); display: inline-flex; align-items: center; text-align: left; }
.h3 { font-size: var(--fs-md); line-height: 1.35; margin: 0 0 var(--sp-2); }
table.stats tbody th { text-align: left; text-transform: none; letter-spacing: 0; font-size: var(--fs-sm); color: inherit; font-weight: 600; border-bottom: 1px solid var(--line); padding: 8px 4px; }
.tag .icon, .file-list .icon, .warn .icon { margin-right: 4px; }

/* ---------- ATS match & interview ---------- */
/* Three steps must fit a 375px phone: they wrap rather than scroll sideways. */
.steps { flex-wrap: wrap; }

/* ATS meter (step 2). Text colours are the status *-text tokens on their *-soft surfaces (≥ 7:1). */
.ats-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); padding: var(--sp-4); margin-bottom: var(--sp-4); }
.ats-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2) var(--sp-3); flex-wrap: wrap; }
.ats-title { margin: 0; }
.ats-score { font-size: var(--fs-sm); }
.ats-score b { font-size: var(--fs-2xl); font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.ats-meter { height: 10px; margin: var(--sp-2) 0; border-radius: var(--radius-pill); background: var(--track); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.ats-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width var(--t) var(--ease); }
.ats-meter.high > span { background: var(--green); }
.ats-meter.mid > span { background: var(--amber); }
.ats-meter.low > span { background: var(--red); }
.ats-explain { margin: 0 0 var(--sp-2); font-size: var(--fs-sm); color: var(--muted); }
/* "Ord fra opslaget i dit CV: 9 af 12" – a plain count, no meter (package 12). */
.ats-count { margin: var(--sp-2) 0; font-size: var(--fs-md); font-weight: 700; font-variant-numeric: tabular-nums; }
.ats-group-title { margin-top: var(--sp-4); }
.ats-group-help { margin: -4px 0 var(--sp-2); font-size: var(--fs-xs); color: var(--muted); }
/* A 44 px touch area without pushing the line apart: padding out, the same margin back in. */
.ats-group-help .link { font-weight: 600; display: inline-block; padding: 12px 2px; margin: -12px 0; }
.ats-chips, .evidence-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ats-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 4px 10px; border-radius: var(--radius-pill); border: 1px solid; font-size: var(--fs-xs); font-weight: 600; overflow-wrap: anywhere; }
.ats-chip.in-cv { background: var(--green-soft); color: var(--green-text); border-color: #9fd3b4; }
.ats-chip.can-add { background: var(--amber-soft); color: var(--amber-text); border-color: var(--amber-line); }
.ats-chip.missing { background: var(--surface); color: var(--muted); border-color: var(--border); border-style: dashed; }

/* Interview preparation (step 3). */
.interview-note { display: flex; gap: var(--sp-2); align-items: flex-start; margin: 0 0 var(--sp-4); }
.interview-note .icon { margin-top: 2px; }
.interview-prep { margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.interview-title { margin: 0; }
.interview-meta { margin: 2px 0 0; font-size: var(--fs-sm); }
.interview-list { margin: 0 0 var(--sp-2); padding-left: 20px; font-size: var(--fs-sm); }
.interview-list li { margin-bottom: 4px; }
.interview-questions { display: flex; flex-direction: column; gap: var(--sp-2); }
.interview-q { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.interview-q[open] { border-color: var(--border); box-shadow: var(--shadow); }
.interview-q > summary { display: flex; align-items: flex-start; gap: var(--sp-2); min-height: var(--touch); padding: 10px 12px; cursor: pointer; list-style: none; font-weight: 600; font-size: var(--fs-sm); border-radius: var(--radius); }
.interview-q > summary::-webkit-details-marker { display: none; }
.interview-q > summary::before { content: ""; flex: none; width: 8px; height: 8px; margin: 6px 4px 0 2px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform var(--t-fast) var(--ease); }
.interview-q[open] > summary::before { transform: rotate(45deg); }
.interview-q > summary:hover { background: var(--surface-2); }
.interview-q-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.interview-q > summary .tag { flex: none; max-width: 40%; overflow-wrap: anywhere; font-weight: 600; }
.interview-q-body { padding: 0 12px 12px 30px; font-size: var(--fs-sm); }
.interview-q-body h5 { margin: var(--sp-3) 0 4px; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.interview-q-body p { margin: 0 0 var(--sp-2); }
.evidence-chips li { max-width: 100%; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent-strong); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.interview-warn { display: flex; gap: var(--sp-2); align-items: flex-start; margin: var(--sp-3) 0 0; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--amber-line); background: var(--amber-soft); color: var(--amber-text); }
.interview-warn .icon { margin-top: 2px; }
.interview-warn ul { margin: 0; padding: 0; list-style: none; }
.practice-label { display: block; font-weight: 600; margin-bottom: 6px; }
.interview-q-body textarea { margin-bottom: var(--sp-2); }
.interview-feedback { margin-top: var(--sp-3); padding: 10px 12px; border-radius: 8px; background: var(--info-soft); }
.interview-feedback h5 { margin-top: 0; }
.interview-feedback p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }

@media (max-width: 600px) {
  .interview-q-body { padding-left: 12px; }
  .interview-q > summary { flex-wrap: wrap; }
  .interview-q > summary .tag { max-width: none; }
  .interview-q-body .btn { width: 100%; }
}

/* ---------- Open on the phone (QR) ---------- */
.qr-pair { display: flex; flex-direction: column; gap: var(--sp-2); margin: var(--sp-3) 0; }
.qr-panel { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: flex-start; }
/* Always dark on white, whatever the theme: phone cameras need the contrast. */
.qr-code { width: 220px; max-width: 100%; aspect-ratio: 1; background: #fff; border-radius: var(--radius); padding: 4px; box-shadow: var(--shadow); }
.qr-code svg { display: block; width: 100%; height: 100%; }
.qr-text { display: flex; flex-direction: column; gap: var(--sp-2); flex: 1 1 220px; min-width: 0; }
.qr-text select { min-height: var(--touch); }
.warn-text { display: flex; gap: 6px; align-items: flex-start; color: var(--amber-text); }
.warn-text svg { flex: none; margin-top: 2px; }

/* ---------- One-click keywords and skills ---------- */
button.ats-chip { font: inherit; font-size: var(--fs-xs); font-weight: 600; min-height: 32px; cursor: pointer; user-select: none; transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
button.ats-chip:hover { box-shadow: var(--shadow); }
button.ats-chip:active { transform: scale(.97); }
button.ats-chip.missing:hover { color: var(--text); border-color: var(--border-strong); }
.chips-edit button { user-select: none; }
.add-skill { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); }
.add-skill input { flex: 1 1 auto; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) { button.ats-chip { transition: none; } button.ats-chip:active { transform: none; } }

/* In-app question before a new skill goes into the profile (native confirm() is blocked in some browsers). */
.ats-confirm { margin: var(--sp-3) 0; padding: var(--sp-3); border: 1px solid var(--amber-line); background: var(--amber-soft); border-radius: var(--radius); }
.ats-confirm p { margin: 0 0 var(--sp-2); font-size: var(--fs-sm); color: var(--text); }
.ats-confirm-evidence { display: block; width: 100%; margin: 0 0 4px; }
.ats-confirm-why { display: block; margin: 0 0 var(--sp-2); font-size: var(--fs-xs); color: var(--amber-text); }
.ats-chip.in-cv.unsupported { background: var(--red-soft); color: var(--red-text); border-color: var(--red); }
.ats-unsupported-help { display: flex; gap: 6px; align-items: flex-start; margin: var(--sp-2) 0; color: var(--red-text); }

/* ---------- Show / hide profile items in this CV ---------- */
.visible-group { display: block; margin: var(--sp-2) 0 4px; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.visible-row { display: flex; align-items: center; gap: var(--sp-2); width: 100%; min-height: var(--touch); padding: 6px var(--sp-2); margin-bottom: 4px; font: inherit; text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: background var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease); }
.visible-row:hover { background: var(--surface-2); }
.visible-row > svg { flex: none; color: var(--accent); }
.visible-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.visible-text b { font-size: var(--fs-sm); overflow-wrap: anywhere; }
.visible-text small { color: var(--muted); font-size: var(--fs-xs); }
.visible-state { flex: none; font-size: var(--fs-xs); font-weight: 600; color: var(--accent-strong); }
.visible-row.is-hidden { border-style: dashed; background: transparent; }
.visible-row.is-hidden .visible-text, .visible-row.is-hidden > svg { opacity: .55; }
.visible-row.is-hidden .visible-text b { text-decoration: line-through; }
.visible-row.is-hidden .visible-state { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .visible-row { transition: none; } }

/* ---------- Toggle chips: one click on, one click off ---------- */
.chips-edit button { display: inline-flex; align-items: center; gap: 4px; }
.chips-edit button svg { width: 14px; height: 14px; flex: none; }
/* A chip that is in the CV turns "remove"-red on hover, so the next click's effect is visible before it happens. */
@media (hover: hover) {
  button.ats-chip.in-cv:hover, .chips-edit button.on:hover { background: var(--red-soft); color: var(--red-text); border-color: currentColor; }
}
/* No page scrolling behind the open menu on phones. */
@media (max-width: 980px) { body:has(.sidebar.open) { overflow: hidden; } }

/* =====================================================================
   Mobile-first sizing (phones first, then wider screens)
   ===================================================================== */
.narrow-only { display: none; }
@media (max-width: 600px) {
  .wide-only { display: none; }
  .narrow-only { display: inline; }
}

/* Phones and tablets: the page scrolls, never a frame or panel inside it. The preview frame grows to the document's
   height (app.js sets it), and the Indhold panel grows with its content. */
@media (max-width: 980px) {
  .preview { min-height: 0; flex: none; }
  .preview-pane .preview { height: auto; }
  .content-panel { max-height: none; overflow: visible; }
  .example-img { height: auto; max-height: none; }
  .compare-col { min-height: 0; }
}

/* Phones: a compact document toolbar – document switch, then layout + edit in one row – and the downloads in a bar
   at the bottom of the screen, where the thumb is. */
@media (max-width: 600px) {
  .toolbar { gap: var(--sp-2); }
  .toolbar-layout { flex: 1 1 auto; min-width: 0; }
  .toolbar-layout .btn.small { flex: none; }
  .toolbar > .toolbar-group[role=group] { flex: none; }
  .toolbar .toolbar-export {
    position: fixed; z-index: 8; left: 0; right: 0; bottom: 0; margin: 0;
    display: flex; gap: var(--sp-2); padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px);
    border-top: 1px solid var(--line); box-shadow: 0 -6px 16px rgba(16,24,32,.06);
  }
  .toolbar-export .btn.icon-only { flex: none; width: var(--touch); }
  .workspace.show-doc .preview-pane { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .edit-hint { padding: 6px 12px; }

  /* Templates: the AI wish and its button stack, so the text field gets the full width. */
  .feedback { flex-direction: column; }
  .feedback .btn { width: 100%; }

  /* Profile: each education / job is one grouped block – title row (with remove), then place and period. */
  .form-row {
    grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; align-items: center;
    padding: 10px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2);
  }
  .form-row input { margin: 0; min-width: 0; grid-column: 1 / -1; }
  .form-row > input:nth-of-type(1) { font-weight: 600; }
  .form-row:has(> .btn) > input:nth-of-type(1) { grid-column: 1; }
  .form-row > .btn { grid-column: 2; grid-row: 1; }

  .code-box { font-size: var(--fs-md); letter-spacing: 0; }
}

/* Phones: switches never wider than the screen – they shrink and share the width. */
@media (max-width: 600px) {
  .segmented { display: flex; max-width: 100%; }
  .segmented button { flex: 1 1 0; min-width: 0; padding-inline: 8px; }
}
/* Very narrow phones: the stats tables tighten up, and if a column still doesn't fit the card scrolls sideways
   instead of the whole page. */
@media (max-width: 400px) {
  table.stats th { letter-spacing: 0; text-transform: none; }
  table.stats th, table.stats td { padding-inline: 3px; }
  .card:has(> table.stats) { overflow-x: auto; }
}

/* ---------- Dictation (mic) ---------- */
.label-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: 4px; }
.label-row > label { margin: 0; flex: 1 1 auto; min-width: 0; }
.mic { display: inline-flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; max-width: 100%; }
.mic-button { gap: 6px; }
.mic.listening .mic-button { background: var(--red-soft); color: var(--red-text); border-color: currentColor; }
.mic.listening .mic-button svg { animation: mic-pulse 1.2s ease-in-out infinite; }
.mic-live { font-size: var(--fs-xs); color: var(--muted); font-style: italic; max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mic-error { font-size: var(--fs-xs); color: var(--red-text); }
@keyframes mic-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .mic.listening .mic-button svg { animation: none; } }

/* ---------- "Spørg mig om ordene" ---------- */
.probe-start { margin-top: var(--sp-3); }
.probe-hint-text { display: block; margin-top: 4px; color: var(--muted); font-size: var(--fs-xs); }
.probe-list { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: var(--sp-3); }
.probe { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-3); }
.probe h5 { margin: 0 0 4px; font-size: var(--fs-md); }
.probe p { margin: 0 0 var(--sp-2); font-size: var(--fs-sm); }
.probe .probe-examples { color: var(--muted); font-size: var(--fs-xs); }
.probe label { font-weight: 600; font-size: var(--fs-sm); }
.probe textarea { width: 100%; }
.probe-match { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-2); margin-bottom: var(--sp-2); border-radius: var(--radius-sm); background: var(--green-soft); color: var(--green-text); font-size: var(--fs-xs); }
.probe-match q { font-style: italic; }
.probe-list .suggestions-card { margin: 0; }

/* Missing headline after a CV import: type it here instead of in the JSON. */
.headline-fix { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3); margin-bottom: var(--sp-3); border: 1px solid var(--amber-line); background: var(--amber-soft); border-radius: var(--radius); }
.headline-fix label { font-weight: 600; margin: 0; }
.headline-fix small { color: var(--muted); }

/* ---------- Live writing (streamed answer) ---------- */
.live-writing { margin-top: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); font-size: var(--fs-sm); max-height: 60vh; overflow-y: auto; overscroll-behavior: contain; }
.live-status { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); font-weight: 700; color: var(--accent-strong); text-transform: uppercase; letter-spacing: .04em; margin-bottom: var(--sp-2); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: mic-pulse 1s ease-in-out infinite; }
.live-job { color: var(--muted); font-size: var(--fs-xs); margin-bottom: 4px; }
.live-headline { margin: 0 0 var(--sp-2); font-size: var(--fs-lg); }
.live-writing p { margin: 0 0 var(--sp-2); }
.live-writing ul { margin: 0 0 var(--sp-2); padding-left: 1.2em; }
.live-writing li { margin-bottom: 4px; }
.live-writing h5 { margin: var(--sp-3) 0 var(--sp-2); font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.live-now::after { content: "▍"; margin-left: 1px; color: var(--accent); animation: mic-pulse .8s steps(1) infinite; }
@media (prefers-reduced-motion: reduce) { .live-dot, .live-now::after { animation: none; } }
/* ---------- New application: guided flow ---------- */
/* A slim three-part progress line with the step names under it. */
.wizard-progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; list-style: none; margin: 0; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); font-size: var(--fs-xs); font-weight: 650; letter-spacing: .02em; color: var(--muted); }
.wizard-progress li { position: relative; display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; padding-top: 12px; }
.wizard-progress li::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; border-radius: 999px; background: var(--track); }
.wizard-progress li::after { content: ""; position: absolute; inset: 0 auto auto 0; height: 4px; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-strong)); transition: width .45s var(--ease); }
.wizard-progress li.done::after, .wizard-progress li.current::after { width: 100%; }
.wizard-progress li > span { display: inline-flex; flex: none; width: 18px; height: 18px; align-items: center; justify-content: center; border-radius: 50%; background: var(--track); color: var(--muted); font-size: 11px; }
.wizard-progress li > span svg { width: 12px; height: 12px; }
.wizard-progress li.current { color: var(--text); }
.wizard-progress-label { font-size: inherit; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wizard-progress li.current > span, .wizard-progress li.done > span { background: var(--accent); color: var(--on-accent); }

.wizard-step { animation: wizard-in .32s var(--ease) both; }
@keyframes wizard-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.wizard-head { margin: var(--sp-2) 0 var(--sp-5); }
.wizard-kicker { display: inline-block; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.wizard-title { margin: 0 0 6px; font-size: var(--fs-2xl); line-height: 1.15; letter-spacing: -.02em; font-weight: 750; }
/* Focus lands on the title at each step change; a ring only when the keyboard moved it. */
.wizard-title:focus:not(:focus-visible) { outline: none; }
.wizard-lead { margin: 0; color: var(--muted); font-size: var(--fs-md); max-width: 46ch; }
.wizard-step textarea, .wizard-step input[type=url] { border-radius: var(--radius-lg); padding: 14px 16px; font-size: var(--fs-md); background: var(--surface); box-shadow: var(--shadow); }
.wizard-step .dropzone { min-height: 160px; border-radius: var(--radius-lg); }

/* One posting field: the live hint under it, and the quiet switch to screenshots (and back). 16px text keeps iOS from zooming in. */
.posting-hint { display: flex; align-items: center; gap: 6px; margin: 8px 2px 0; font-size: var(--fs-sm); color: var(--muted); min-height: 1.5em; overflow-wrap: anywhere; }
.posting-hint.found { color: var(--accent); font-weight: 600; }
.posting-hint svg { width: 16px; height: 16px; flex: none; }
.posting-alt { margin-top: var(--sp-2); min-height: var(--touch); max-width: 100%; white-space: normal; }
#job-text { min-height: 9em; max-width: 100%; font-size: max(16px, var(--fs-md)); }
@media (max-width: 600px) { .posting-alt { width: 100%; justify-content: center; } }

/* The screenshot drop zone: content centred both ways (".field > label" would otherwise make it a block). */
.field > label.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-weight: 500; cursor: pointer; }
.dropzone > span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.dropzone > span small { color: var(--muted); font-weight: 400; }
.dropzone svg { width: 22px; height: 22px; }
.field > label.dropzone.small { flex-direction: row; min-height: 0; }
.wizard-step .dropzone.small { min-height: 0; }
/* Picked screenshots, numbered in the order they are sent. */
.shots { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--sp-2); }
.shot { position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); box-shadow: var(--shadow); }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.shot-no { position: absolute; top: 6px; left: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: var(--on-accent); font-size: var(--fs-xs); font-weight: 700; }
.shot-tools { position: absolute; inset: auto 0 0 0; display: flex; justify-content: flex-end; gap: 2px; padding: 4px; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }
.shot-tools button { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .92); color: #16212a; cursor: pointer; }
.shot-tools button:disabled { opacity: .35; cursor: default; }
.shot-tools svg { width: 16px; height: 16px; }
/* "Få det meste ud af CV PRO": in the empty document pane on wide screens, under the step on phones. */
.empty-preview .start-checklist { text-align: left; max-width: 440px; margin: var(--sp-6) auto 0; }
@media (min-width: 981px) { .checklist-narrow { display: none; } }
.checklist-narrow .start-checklist { margin-top: var(--sp-8); }

.btn.lg { min-height: 52px; padding: 12px 20px; font-size: var(--fs-md); border-radius: 14px; }
.wizard-actions { display: flex; gap: var(--sp-2); margin: var(--sp-5) 0 var(--sp-4); }
.wizard-go:not(:disabled) { background: linear-gradient(135deg, var(--accent), var(--accent-strong)); box-shadow: 0 6px 18px rgba(46, 77, 92, .28), inset 0 1px 0 rgba(255, 255, 255, .14); }
.wizard-go:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(46, 77, 92, .32), inset 0 1px 0 rgba(255, 255, 255, .14); }
.wizard-trust { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 0 var(--sp-4); font-size: var(--fs-xs); color: var(--muted); }
.wizard-trust svg { width: 14px; height: 14px; color: var(--green); }

.wizard-summary { margin: 0 0 var(--sp-5); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.wizard-summary > div { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3); padding: 14px var(--sp-4); }
.wizard-summary > div + div { border-top: 1px solid var(--line); }
.wizard-summary dt { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.wizard-summary dt svg { width: 16px; height: 16px; color: var(--accent); }
.wizard-summary dd { margin: 0; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wizard-summary dd.muted { font-weight: 400; white-space: normal; font-size: var(--fs-sm); }
.wizard-edit { font: inherit; font-size: var(--fs-sm); font-weight: 650; color: var(--accent); background: none; border: 0; padding: 6px 8px; border-radius: 8px; cursor: pointer; min-height: 36px; }
.wizard-edit:hover { background: var(--accent-soft); }
@media (prefers-reduced-motion: reduce) { .wizard-step { animation: none; } .wizard-progress li::after { transition: none; } }

/* Phones: the next step sits at the bottom, by the thumb, above the tab bar. */
@media (max-width: 980px) {
  .wizard-actions { position: sticky; bottom: var(--tabbar-h, 0px); z-index: 4; margin: var(--sp-5) calc(-1 * var(--sp-4)) 0; padding: var(--sp-3) var(--sp-4); background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .wizard-title { font-size: var(--fs-xl); }
  .wizard-summary > div { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "dt edit" "dd dd"; row-gap: 2px; }
  .wizard-summary dt { grid-area: dt; } .wizard-summary dd { grid-area: dd; } .wizard-edit { grid-area: edit; }
}

/* The old two-column layout (focus layout switched off in Settings), wide screens: while the first draft is written,
   the text fills the empty preview pane as a page; the copy in the form is hidden. Phones keep it in the form (the
   pane is hidden there while the form shows). The focus layout has no pane: see below. */
.live-pane { flex: 1; min-height: 0; overflow-y: auto; padding: var(--sp-5) var(--sp-4); }
.live-writing.in-pane { max-width: 760px; margin: 0 auto; max-height: none; overflow: visible; padding: var(--sp-5) var(--sp-6); font-size: var(--fs-md); line-height: 1.6; }
.live-writing.in-pane .live-headline { font-size: var(--fs-xl); }
@media (min-width: 981px) { .live-writing.pane-twin { display: none; } }
@media (max-width: 980px) { .live-pane { display: none; } }

/* ---------- Wide screens: top bar and drawer on every page ----------
   No permanent side menu: it opens as the drawer phones have, from the top bar's "Menu" (MainLayout). The top bar
   holds the brand and what the page puts there (an open application's title, status and "Mere"; the new-application
   flow's progress in the focus layout). */
.top-bar { display: none; }
@media (min-width: 981px) {
  .app { grid-template-columns: 1fr; }
  /* The same drawer as in the ≤ 980px block: hidden from the tab order while closed (B46), scroll lock while open. */
  .sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; width: 288px; transform: translateX(-100%); visibility: hidden; transition: transform var(--t) var(--ease), visibility 0s linear var(--t); box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .sidebar.open { transform: none; visibility: visible; transition: transform var(--t) var(--ease), visibility 0s; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 19; background: rgba(0,0,0,.35); }
  .menu-close { display: inline-flex; }
  body:has(.sidebar.open) { overflow: hidden; }

  .top-bar { display: flex; align-items: center; gap: var(--sp-3); flex: none; height: 48px; padding: 0 var(--sp-3) 0 var(--sp-2); background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 12; }
  .top-bar-start { display: flex; align-items: center; gap: var(--sp-2); flex: none; }
  .top-bar .top-menu { color: var(--muted); }
  .top-bar .top-menu:hover { color: var(--text); }
  .top-bar-page { flex: 1; min-width: 0; display: flex; }
  .top-bar-page:empty { display: none; }

  /* Pages: one centred column instead of a column against the old side menu. */
  .page-wrap { padding-inline: max(32px, calc((100% - 1200px) / 2)); }
  .page-wrap.narrow { max-width: none; padding-inline: max(32px, calc((100% - 780px) / 2)); }
}

/* ---------- Focus layout: "Ny ansøgning" as one centred column (wide screens only; phones are unchanged) ----------
   MainLayout puts "focus" on .app while the new-application flow shows (AppState.Focus): the guide bar and the empty
   document pane are gone, and the top bar shows the flow's progress in the middle. */
@media (min-width: 981px) {
  .app.focus .guide-bar { display: none; }

  /* Menu and brand left, the flow's progress in the middle of the page (the left column grows before they overlap). */
  .app.focus .top-bar.focus-bar { display: grid; grid-template-columns: 1fr minmax(0, 560px) 1fr; gap: var(--sp-4); height: auto; min-height: 64px; padding: 0 var(--sp-5); }
  .focus-bar .wizard-progress { grid-column: 2; padding: 0 0 2px; border-bottom: 0; }
  .app.focus .panel > .wizard-progress { display: none; }

  .app.focus .workspace { grid-template-columns: 1fr; }
  .app.focus .panel { border-right: 0; }
  .app.focus .panel-head { width: 100%; max-width: 800px; margin: 0 auto; padding-top: var(--sp-8); text-align: center; }
  .app.focus .panel-head h1 { font-size: var(--fs-lg); }
  .app.focus .panel-body { padding-bottom: var(--sp-8); }
  .app.focus .wizard-step { max-width: 760px; margin: 0 auto; }
  .app.focus .wizard-head { text-align: center; margin-bottom: var(--sp-6); }
  .app.focus .wizard-title { font-size: clamp(32px, 1.6vw + 16px, 44px); }
  .app.focus .wizard-lead { margin: 0 auto; max-width: 56ch; font-size: var(--fs-lg); }
  /* Under step 1 and under the last step, as on phones: there is no document pane beside the form. */
  .app.focus .checklist-narrow { display: block; }
  .app.focus .live-writing.pane-twin { display: block; }
}

/* ---------- An open application on wide screens: the document, one toolbar row, one side sheet ----------
   .workspace.has-doc (Workspace.razor). The document column is the page; one toolbar row that never wraps; one side
   sheet on the right for the panel's steps, Udseende, Indhold, Versioner or Tjek (sheet-*), beside the document from
   1280px and over it (with a scrim) below that. The document and the sheet are the only things that scroll. */
:root { --toolbar-h: 52px; --sheet-w: 420px; }
.app-bar, .review-dock, .sheet-scrim, .sheet-close { display: none; }
@media (max-width: 980px) { .tb-wide { display: none !important; } }
@media (min-width: 981px) {
  .tb-narrow { display: none !important; }

  /* No new application here: the panel (its flow) comes first again, as before the sheet moved it after the document. */
  .workspace:not(.has-doc) > .panel { order: -1; }

  .workspace.has-doc { display: block; position: relative; }
  .workspace.has-doc > .preview-pane { position: static; height: 100%; container: doc / inline-size; }
  /* auto, not 100%: the frame narrows when the sheet sits beside it (its margin), and app.js fits the page again. */
  .workspace.has-doc .preview { width: auto; }

  /* The toolbar: one row, never wrapping; it spans the width over the sheet, so its right end stays in reach. */
  .workspace.has-doc .toolbar { flex-wrap: nowrap; height: var(--toolbar-h); padding: 0 var(--sp-3); gap: var(--sp-2); position: relative; z-index: 8; }
  .workspace.has-doc .toolbar > * { flex: none; }
  .workspace.has-doc .toolbar .hint { white-space: nowrap; max-width: none; }
  .look-name { display: inline-block; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
  .workspace.has-doc .toolbar .toolbar-side { margin-left: auto; gap: var(--sp-2); }
  .workspace.has-doc .toolbar .toolbar-export { margin-left: 0; gap: 0; }
  .workspace.has-doc .toolbar-export #pdf-button { border-radius: var(--radius-ctl) 0 0 var(--radius-ctl); min-height: 36px; padding: 6px 14px; }
  .workspace.has-doc .toolbar-export .split { border-radius: 0 var(--radius-ctl) var(--radius-ctl) 0; min-height: 36px; width: 32px; border-left: 1px solid color-mix(in srgb, var(--on-accent) 30%, transparent); }
  .workspace.has-doc .toolbar-export .split .icon { width: 16px; height: 16px; }
  .pop-panel .tb-overflow { display: none; }
  /* A narrower row: the ATS hint goes first (the ATS button says it too), then the layout's name, then Udseende and
     Indhold move into "Mere" – the row never wraps (about 800px is the least it needs). */
  @container doc (max-width: 1300px) { .toolbar .hint { display: none; } }
  @container doc (max-width: 1200px) { .toolbar .look-name { display: none; } }
  @container doc (max-width: 1100px) {
    .toolbar .tb-fold { display: none; }
    .pop-panel .tb-overflow { display: flex; }
  }

  /* The sheet: the panel (its tabs and body), or one of the panes that phones show above the document. */
  .workspace.has-doc > .panel,
  .workspace.has-doc .sheet-pane {
    position: absolute; z-index: 6; top: var(--toolbar-h); right: 0; bottom: 0; width: var(--sheet-w); max-width: 100%;
    margin: 0; max-height: none; background: var(--surface); border: 0; border-left: 1px solid var(--line);
    box-shadow: -8px 0 24px rgba(16, 24, 32, .08);
  }
  .workspace.has-doc .sheet-pane { overflow-y: auto; overscroll-behavior: contain; padding: var(--sp-4) var(--sp-5) var(--sp-6); }
  .workspace.has-doc > .panel { border-right: 0; }
  .workspace.has-doc:not(.sheet-review) > .panel,
  .workspace.has-doc:not(.sheet-docreview) .ai-review { display: none; }
  .workspace.has-doc .panel-head, .workspace.has-doc .status-bar { display: none; }
  .workspace.has-doc .panel-body { overscroll-behavior: contain; }
  /* The sheet's tabs: no step numbers (they are not a sequence), a close button at the end. */
  .workspace.has-doc .steps { flex-wrap: nowrap; align-items: center; padding: 0 var(--sp-2) 0 var(--sp-4); }
  .workspace.has-doc .step > span { display: none; }
  .workspace.has-doc .sheet-close { display: inline-flex; margin-left: auto; }
  /* Fields in the sheet grow with their text: one scroll, the sheet's (app.js does it where field-sizing is missing). */
  .workspace.has-doc > .panel textarea { max-height: none; }
  .workspace.has-doc > .panel .live-writing { max-height: none; overflow: visible; }
  @supports (field-sizing: content) {
    .workspace.has-doc > .panel textarea { field-sizing: content; min-height: 88px; overflow-y: hidden; resize: none; }
  }

  /* Beside the document from 1280px: everything under the toolbar makes room for the sheet. */
  .sheet-scrim { position: absolute; z-index: 5; inset: var(--toolbar-h) 0 0 0; background: rgba(16, 24, 32, .28); }
  .workspace.has-doc .sheet-scrim { display: block; }

  /* The review dock: a slim line under the document while the sheet is closed. */
  .workspace.has-doc .review-dock { display: flex; }
  .workspace.has-doc.sheet-open .review-dock { display: none; }
}
@media (min-width: 1280px) {
  .workspace.has-doc .sheet-scrim { display: none; }
  .workspace.has-doc.sheet-open > .preview-pane > :not(.toolbar):not(.sheet-pane) { margin-right: var(--sheet-w); }
}
@media (min-width: 981px) and (prefers-reduced-motion: no-preference) {
  .workspace.has-doc > .panel, .workspace.has-doc .sheet-pane { animation: sheet-in var(--t) var(--ease); }
}
@keyframes sheet-in { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }

/* The application in the top bar: title on one line, status pill, "Mere". */
@media (min-width: 981px) {
  .app-bar { display: flex; align-items: center; gap: var(--sp-3); flex: 1; min-width: 0; padding-left: var(--sp-3); border-left: 1px solid var(--line); }
  .app-title { display: flex; align-items: baseline; gap: var(--sp-2); flex: 0 1 auto; min-width: 0; margin: 0; font-size: var(--fs-md); font-weight: 650; letter-spacing: 0; line-height: 1.3; }
  .app-person { flex: none; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .app-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-name .muted { font-weight: 500; }
  .app-status { flex: none; }
  .app-more { flex: none; margin-left: auto; }
}
.status-pill { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: var(--fs-xs); font-weight: 700; min-height: 30px; padding: 3px 10px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.status-pill:hover, .status-pill.on { border-color: var(--border-strong); }
.status-pill .icon { width: 14px; height: 14px; color: var(--muted); }
.status-pill .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-pill.status-sent .status-dot { background: var(--focus); }
.status-pill.status-interview .status-dot { background: var(--amber); }
.status-pill.status-offer .status-dot { background: var(--green); }
.status-pill.due { border-color: var(--amber-line); background: var(--amber-soft); color: var(--amber-text); }
.pill-due { font-weight: 600; }
.status-options { border: 0; margin: 0 0 var(--sp-3); padding: 0; display: grid; gap: 2px; }
.status-options legend { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; padding: 0; }
.status-opt { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 4px 8px; border-radius: var(--radius-sm); font-size: var(--fs-sm); cursor: pointer; }
.status-opt:hover { background: var(--surface-2); }
.status-opt input { margin: 0; }
.app-status .pop-panel { width: 260px; padding: var(--sp-3); }
.app-status .mini-field input { width: 100%; }
.app-status .warn-tag { display: inline-block; margin-top: var(--sp-2); }

/* Small panels under a button (Popover.razor): "Mere", "Hent PDF ▾", the status pill, the application's "Mere". */
.pop { position: relative; display: inline-flex; }
.pop-panel { position: absolute; z-index: 18; top: calc(100% + 6px); right: 0; min-width: 240px; max-width: min(340px, calc(100vw - 24px)); padding: 6px; display: grid; gap: 2px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); text-align: left; }
.pop-panel.start { right: auto; left: 0; }
.pop-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; min-height: 40px; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: inherit; font-size: var(--fs-sm); font-weight: 600; text-align: left; cursor: pointer; }
.pop-item .icon { margin-top: 2px; color: var(--muted); }
.pop-item small { display: block; margin: 1px 0 0; font-weight: 400; color: var(--muted); }
.pop-item:hover:not(:disabled) { background: var(--surface-2); }
.pop-item:disabled { color: var(--btn-disabled-text); cursor: not-allowed; }
.pop-item[aria-pressed="true"] .icon { color: var(--amber); }
.pop-item.danger, .pop-item.danger .icon { color: var(--red); }
.pop-item.danger:hover { background: var(--red-soft); }
.pop-sep { height: 1px; margin: 4px 6px; background: var(--line); }
.pop-note { margin: 4px 10px 6px; font-size: var(--fs-xs); color: var(--red-text); }

/* The review dock (ReviewDock.razor). */
.review-dock { flex: none; align-items: center; gap: var(--sp-3); min-height: 44px; padding: 4px var(--sp-3) 4px var(--sp-4); background: var(--surface); border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.review-dock .dock-text { flex: 1; min-width: 0; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-dock .dock-text .icon { margin-right: 4px; }
.review-dock.done .dock-text { color: var(--green-text); font-weight: 600; }
.review-dock .dock-count { flex: none; font: inherit; font-size: var(--fs-xs); font-weight: 700; padding: 4px 10px; min-height: 30px; border: 0; border-radius: var(--radius-pill); background: var(--amber-soft); color: var(--amber-text); cursor: pointer; }
.review-dock .dock-count:hover { background: color-mix(in srgb, var(--amber-soft) 80%, var(--amber)); }

/* ---------- One page ---------- */
.page-fit { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: 8px 16px; background: var(--amber-soft); color: var(--amber-text); border-bottom: 1px solid var(--amber-line); font-size: var(--fs-sm); }
.page-fit > span { display: inline-flex; align-items: center; gap: 6px; }
/* Two pages in "at most two" mode (package 12): a calm status, not a warning. */
.page-fit.calm { background: var(--surface-2); color: var(--text); border-bottom-color: var(--line); }
.page-fit.proposal { display: block; color: var(--text); }
.page-fit.proposal ul { margin: 6px 0; padding-left: 1.2em; }
/* A list item can be a place in the document ("<company> › punkt 2"): a long name wraps instead of widening the box on a phone. */
.page-fit.proposal li { margin-bottom: 2px; overflow-wrap: anywhere; }
.page-fit.proposal small { display: block; color: var(--muted); margin-bottom: 6px; }
/* A PDF shrunk to save a page waits for the person's choice (package 12): three buttons that wrap whole on a phone. */
.page-fit.pdf-held b { display: block; margin-bottom: 6px; }
.page-fit.pdf-held .row { flex-wrap: wrap; }
.match-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
/* Must-have / nice-to-have and the posting's own sentence on a requirement (package 11). */
.matches li > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.req-importance { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 600; line-height: 1.6; vertical-align: 1px; white-space: nowrap; }
.req-importance.must { background: var(--accent-soft); color: var(--accent-strong); }
.req-importance.nice { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.req-quote { margin-top: 4px; font-size: var(--fs-xs); }
.req-quote > summary { cursor: pointer; color: var(--accent-strong); font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }
.req-quote > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
.req-quote blockquote { margin: 4px 0 0; padding-left: 8px; border-left: 3px solid var(--accent-soft); color: var(--muted); font-style: italic; }
.matches .probe-list { margin-top: var(--sp-2); }

/* ---------- "Tjek dokumentet" ---------- */
.doc-review { padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); box-shadow: 0 6px 12px rgba(16,24,32,.06); }
.doc-review-overall { margin: 6px 0 8px; }
.doc-review-list { margin: 0 0 8px; padding-left: 1.3em; display: flex; flex-direction: column; gap: 10px; }
.doc-review-list blockquote { margin: 6px 0; padding: 6px 10px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.review-kind { display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 700; background: var(--info-soft); color: var(--accent-strong); }
.review-kind.kind-repetition, .review-kind.kind-tone { background: var(--amber-soft); color: var(--amber-text); }
.review-kind.kind-relevance { background: var(--green-soft); color: var(--green-text); }
.doc-review.versions .chips-edit { margin: 6px 0 8px; }
.version-pieces { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 10px; }
.version-pieces blockquote { margin: 4px 0 6px; padding: 6px 10px; border-left: 3px solid var(--border-strong); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ---------- Getting started: guide bar, hints, checklist ---------- */
.guide-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); padding: 10px 16px; background: var(--accent-soft); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.guide-progress { display: flex; gap: 6px; flex: none; }
.guide-dot { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--border-strong); background: var(--surface); color: #fff; }
.guide-dot svg { width: 13px; height: 13px; }
.guide-dot.done { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.guide-dot.now { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.guide-text { flex: 1 1 260px; min-width: 0; }
.guide-text span { color: var(--muted); }
.tip { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-2); margin: var(--sp-2) 0; padding: 10px 12px; border-radius: var(--radius); background: var(--info-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); font-size: var(--fs-sm); white-space: normal; }
.tip > svg { flex: none; margin-top: 2px; color: var(--accent); }
.tip > span { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.tip .btn { flex: none; margin-left: auto; }
.start-checklist { margin: var(--sp-5) 0 var(--sp-4); }
.start-checklist h3 { margin: 0; font-size: var(--fs-md); }
.start-checklist ul { list-style: none; padding: 0; margin: var(--sp-2) 0 0; display: flex; flex-direction: column; gap: 6px; }
.start-checklist li { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); }
.start-checklist li > span:nth-child(2) { flex: 1 1 auto; min-width: 0; }
.start-checklist li small { display: block; color: var(--muted); }
.start-checklist li.done b { text-decoration: line-through; color: var(--muted); }
.check-box { flex: none; width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.start-checklist li.done .check-box { background: var(--green-text); border-color: var(--green-text); }
.check-box svg { width: 12px; height: 12px; }
.guide-bar.done { padding-block: 6px; }
.guide-bar.done .guide-text { display: flex; align-items: center; gap: 6px; }
.guide-bar.done .guide-text svg { color: var(--green-text); flex: none; }
@media (max-width: 600px) {
  .guide-bar { padding: 8px 12px; }
  .guide-bar:not(.done) .guide-text { flex-basis: 100%; }
  .guide-bar:not(.done) .guide-text span { display: block; font-size: var(--fs-xs); }
}

/* Phones: the three steps share the width on one line (wrapping put "Samtale" on a line of its own). */
@media (max-width: 600px) {
  .steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding: 0 8px; }
  .step { justify-content: center; gap: 4px; padding: 8px 2px; font-size: var(--fs-xs); min-width: 0; white-space: nowrap; }
  .step span { width: 20px; height: 20px; flex: none; }
  .step .badge { margin-left: 0; padding: 0 5px; min-width: 16px; font-size: 10px; }
}

/* ---------- "Ret før download" – first in Match & tjek ---------- */
.must-fix { margin-bottom: var(--sp-4); padding: var(--sp-3); border: 1px solid #f0a29c; background: var(--red-soft); border-radius: var(--radius); }
.must-fix h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: var(--fs-md); color: var(--red-text); }
.must-fix > p { margin: 0 0 var(--sp-2); color: var(--text); }
.must-fix ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.must-fix li { background: var(--surface); border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); }
.must-fix blockquote { margin: 6px 0; padding: 4px 10px; border-left: 3px solid var(--red-text); color: var(--muted); }
.must-fix .row { flex-wrap: wrap; gap: 6px; }
/* AI fact-check findings: the same card, amber – a warning to look at, never a block. */
.must-fix.ai-findings { border-color: var(--amber-line); background: var(--amber-soft); }
.must-fix.ai-findings h3 { color: var(--amber-text); }
.must-fix.ai-findings blockquote { border-left-color: var(--amber-line); }
.must-fix.ai-findings .row { align-items: center; }

/* ---------- Profile as cards ---------- */
.profile-cards { display: flex; flex-direction: column; gap: var(--sp-4); }
.profile-cards .card { margin: 0; }
.profile-cards h3 { margin-top: 0; }
.pe-line { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 6px; }
.pe-line > input, .pe-line > textarea { flex: 1 1 auto; min-width: 0; margin: 0; }
.pe-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 var(--sp-3); }
/* A job is a card: closed it is one line (company, title · period, points); open, its fields and points. */
.pe-job { border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: var(--sp-2); background: var(--surface-2); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.pe-job.open { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow); }
.pe-job-toggle { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: var(--sp-3); padding: 14px var(--sp-4); min-height: 60px; cursor: pointer; border-radius: var(--radius-lg); }
.pe-job-toggle:hover { background: var(--accent-soft); }
.pe-job-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pe-job-title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pe-job-title b { font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-job-title small { color: var(--muted); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-tag { flex: none; font-size: var(--fs-xs); font-weight: 650; padding: 3px 10px; border-radius: 999px; background: var(--track); color: var(--muted); white-space: nowrap; }
.pe-tag.warn { background: var(--amber-soft); color: var(--amber-text); }
.pe-chevron { flex: none; width: 18px; height: 18px; color: var(--muted); transition: transform var(--t) var(--ease); }
.pe-job.open .pe-chevron { transform: rotate(180deg); }
.pe-job-body { padding: 0 var(--sp-4) var(--sp-4); animation: wizard-in .25s var(--ease) both; }
/* Company and title side by side, the period on its own line, so nothing is cut off. */
.pe-job-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 var(--sp-3); margin-bottom: var(--sp-2); }
.pe-job-head .field { margin-bottom: var(--sp-2); }
.pe-job-head .pe-period { grid-column: 1 / -1; }
.pe-job-head input { margin: 0; }
.pe-bullets { list-style: none; padding: 0; margin: 0 0 6px; }
/* A fact and the small note on where it came from (FactOrigin); the one-time review of older facts. */
.pe-fact { margin-bottom: 8px; }
.pe-fact .pe-line { margin-bottom: 2px; }
.pe-origin { display: block; padding-left: 2px; }
.fact-review { border-color: var(--amber-soft); }
.fact-review-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--sp-2); }
.fact-review-head h2 { margin: 0; flex: 1 1 240px; }
.fact-review-list { list-style: none; padding: 0; margin: var(--sp-3) 0 0; display: grid; gap: var(--sp-3); }
.fact-review-list li { display: grid; gap: 6px; padding-bottom: var(--sp-3); border-bottom: 1px solid var(--line); }
.fact-review-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.fact-review-list textarea { width: 100%; margin: 0; }
.pe-empty { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--radius); border: 1px dashed var(--border); background: var(--surface-2); color: var(--muted); font-size: var(--fs-sm); }
.pe-empty > span { display: flex; gap: 6px; align-items: flex-start; }
.pe-skill-group { margin-bottom: var(--sp-2); }
.pe-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); font-size: var(--fs-xs); }
.pe-chip button { all: unset; cursor: pointer; display: inline-flex; padding: 4px; border-radius: 50%; color: var(--muted); }
.pe-chip button:hover, .pe-chip button:focus-visible { background: var(--red-soft); color: var(--red-text); }
.pe-chip button svg { width: 12px; height: 12px; }
.profile-cards .add-skill select { flex: none; width: auto; margin: 0; }
/* The save button floats over the cards on its own – no full-width backdrop, which read as a dark band
   sliding over the content while scrolling. Only the button and the note take clicks. */
.profile-save { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-3); padding: var(--sp-3) 0; pointer-events: none; }
.profile-save > * { pointer-events: auto; }
.profile-save .btn { box-shadow: var(--shadow-lg); }
.profile-save .muted { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; box-shadow: var(--shadow); }
/* "Før du sender": the posting's deadline, practical asks (ticked off) and direct questions → letter paragraph. */
.posting-check { margin: 0 0 var(--sp-4); padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); display: grid; gap: var(--sp-3); }
.pc-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; }
.pc-head h3 { margin: 0; font-size: var(--fs-md); }
.pc-deadline { font-size: var(--fs-xs); font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--track); color: var(--text); white-space: nowrap; }
.pc-deadline.soon { background: var(--amber-soft); color: var(--amber-text); }
.pc-deadline.over { background: var(--red-soft); color: var(--red-text); }
.pc-reading { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.pc-asks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pc-ask { display: flex; align-items: center; gap: 10px; min-height: var(--touch); padding: 6px 10px; border-radius: var(--radius); cursor: pointer; font-size: var(--fs-sm); font-weight: 500; transition: background-color var(--t-fast); }
.pc-ask:hover { background: var(--surface-2); }
.pc-ask input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.pc-ask svg { flex: none; width: 16px; height: 16px; color: var(--accent); }
.pc-ask.done span { text-decoration: line-through; color: var(--muted); }
.pc-questions { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.pc-questions li { display: grid; gap: 6px; justify-items: start; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line); border-left-width: 3px; }
.pc-questions li.answered { border-left-color: var(--green); }
.pc-questions li.missing { border-left-color: var(--red); background: var(--red-soft); }
.pc-q { font-weight: 600; font-size: var(--fs-sm); }
.pc-link { all: unset; display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 650; color: var(--green-text); cursor: pointer; border-radius: 6px; padding: 2px 4px; margin-left: -4px; }
.pc-link:hover { background: var(--green-soft); }
.pc-link:focus-visible { outline: 2px solid var(--focus); }
.pc-link svg { width: 14px; height: 14px; }
.pc-miss { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 700; color: var(--red-text); }
.pc-miss svg { width: 14px; height: 14px; }
.pc-note { color: var(--text); font-size: var(--fs-xs); }
.pc-stale { display: flex; align-items: center; gap: 6px; margin: 0; font-size: var(--fs-xs); color: var(--amber-text); }
.pc-stale svg { width: 14px; height: 14px; }
.pc-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: var(--sp-2); }

/* Profile overview: a ring with how ready the profile is, then at most three next steps. */
.profile-overview { padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.po-score { display: flex; align-items: center; gap: var(--sp-4); }
.po-score h2 { margin: 0 0 2px; }
.po-score p { margin: 0; }
.po-meter { --p: 0; flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--track) 0); position: relative; }
.po-meter::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.po-meter b { position: relative; font-size: var(--fs-lg); font-weight: 800; font-variant-numeric: tabular-nums; }
.po-meter b small { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
.profile-overview .headline-fix { margin: 0; }
.profile-overview .issues { margin: 0; }
/* Saving happens by itself; the head says where it stands. */
.page-head-side { display: flex; align-items: center; gap: var(--sp-3); }
.save-status { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: var(--fs-xs); font-weight: 650; color: var(--muted); white-space: nowrap; }
.save-status svg { width: 14px; height: 14px; }
.save-status.saved { color: var(--green-text); border-color: transparent; background: var(--green-soft); }
.save-status.failed, .save-status.manual { color: var(--red-text); border-color: transparent; background: var(--red-soft); }
.save-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: mic-pulse 1s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .save-dot { animation: none; } }
/* "Opdatér med nye oplysninger": one button on every screen until pressed (it was open on wide screens and made the profile page a wall of cards). */
.update-card:not(.open) { padding: 0; }
.update-toggle { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: var(--sp-3); padding: 14px var(--sp-4); min-height: 60px; cursor: pointer; border-radius: var(--radius-lg); }
.update-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.update-toggle > svg:first-child { flex: none; width: 22px; height: 22px; color: var(--accent); }
.update-toggle > span { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.update-toggle small { color: var(--muted); font-size: var(--fs-xs); }
.update-chevron { flex: none; width: 18px; height: 18px; color: var(--muted); transition: transform var(--t) var(--ease); }
.update-card.open .update-chevron { transform: rotate(180deg); }
.update-card.open .update-toggle { padding: 0 0 var(--sp-3); min-height: 0; }
.update-card:not(.open) .update-body { display: none; }
.update-title { display: none; }
@media (max-width: 980px) {
  .page-head-side { width: 100%; justify-content: space-between; }
}
.advanced summary { cursor: pointer; font-weight: 600; min-height: var(--touch); display: flex; align-items: center; }
@media (max-width: 600px) {
  .pe-job-head { grid-template-columns: 1fr; }
  .profile-cards .add-skill { flex-wrap: wrap; }
}

/* Profile: the cards need room. Next to the upload column they got ~260 px on a laptop – so the two columns
   only sit side by side on wide screens, and the profile cards get the wider one. */
.two-col { grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); }
@media (max-width: 1300px) { .two-col { grid-template-columns: minmax(0, 1fr); } }
.add-skill { flex-wrap: wrap; }
.add-skill input { flex: 1 1 180px; }

/* =====================================================================
   2026 component pass – clear affordances, one rhythm, aligned on phones
   ===================================================================== */

/* Shape: every control shares one radius; cards a little rounder. */
input, textarea, select { border-radius: var(--radius-ctl); }
.card { border-radius: 16px; }
.segmented { border-radius: 14px; }
.segmented button { border-radius: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* A native select gets one chevron of our own, so it reads as "pick from a list", not as a text field. */
select:not([multiple]) { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234e5d68' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }

/* Toggled buttons (Indhold, Versioner) show "on" as solid – unmistakably pressed. */
.btn.on, .btn.ghost.on { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.danger, .btn.ghost.danger { background: var(--red-soft); color: var(--red); border-color: transparent; }
.btn.danger:hover, .btn.ghost.danger:hover { background: #f9d9d5; }
.btn.danger:disabled { background: var(--btn-disabled); color: var(--btn-disabled-text); }
.btn.small { border-radius: 10px; }

/* Action rows: buttons in a group share the width evenly on phones – no ragged right edge. */
.actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }
.actions > .btn, .actions > label.btn { flex: 1 1 auto; }
@media (max-width: 600px) {
  .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions > .btn, .actions > label.btn { width: 100%; min-width: 0; }
  .actions > .full, .actions.stack > * { grid-column: 1 / -1; }
  .actions.stack { grid-template-columns: minmax(0, 1fr); }
}

/* Switch: an on/off setting looks like one (a checkbox is for picking items from a list). */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: var(--touch); margin-top: var(--sp-2); cursor: pointer; font-size: var(--fs-sm); font-weight: 500; }
.switch-row > span { flex: 1 1 auto; min-width: 0; }
.switch-row small { margin-top: 2px; }
input[type=checkbox].switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 48px; height: 28px; min-height: 0; margin: 0; border: 0; border-radius: 999px; background: #c5ced5; cursor: pointer; transition: background-color var(--t) var(--ease); }
input[type=checkbox].switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform var(--t) var(--ease); }
input[type=checkbox].switch:checked { background: var(--accent); }
input[type=checkbox].switch:checked::after { transform: translateX(20px); }
input[type=checkbox].switch:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Section text inside cards: one readable size (12px grey paragraphs were hard to read on a phone). */
.card > p.muted.small, .card .lead-text { font-size: var(--fs-sm); line-height: 1.55; margin: 0 0 var(--sp-3); }
.card > h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.card-sub { margin: var(--sp-5) 0 var(--sp-2); padding-top: var(--sp-4); border-top: 1px solid var(--line); font-size: var(--fs-md); }
.status-pill { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 650; padding: 3px 10px; border-radius: 999px; background: var(--btn-disabled); color: var(--muted); vertical-align: 2px; margin-left: 6px; }
.status-pill.ok { background: var(--green-soft); color: var(--green-text); }
details.more { margin-top: var(--sp-4); border-top: 1px solid var(--line); }
details.more > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-height: 52px; cursor: pointer; font-weight: 650; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: ""; flex: none; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform var(--t-fast) var(--ease); margin-right: 4px; }
details.more[open] > summary::after { transform: rotate(-135deg); }
details.more > summary small { display: block; font-weight: 400; margin: 0; }
.key-field { display: flex; gap: var(--sp-2); align-items: stretch; margin-top: var(--sp-2); }
.key-field input { flex: 1 1 auto; min-width: 0; margin: 0; }
.key-field .btn { flex: none; }
.key-row .actions { margin-top: var(--sp-2); }
.danger-zone { margin-top: var(--sp-5); padding: var(--sp-4); border: 1px solid #f0c4c0; border-top: 1px solid #f0c4c0; border-radius: var(--radius); background: #fffafa; }
.danger-zone h4 { margin: 0 0 var(--sp-2); color: var(--red-text); }
.danger-zone .actions { margin-top: var(--sp-2); }
.danger-zone small { margin-top: var(--sp-2); }
.code-box { border-radius: var(--radius-ctl); }

/* Workspace head: status and follow-up are labelled fields side by side, the example star is a real button. */
.status-bar { display: flex; align-items: flex-end; gap: var(--sp-3); flex-wrap: wrap; padding: 0 20px 14px; }
.mini-field { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-xs); font-weight: 650; color: var(--muted); margin: 0; }
.mini-field select, .mini-field input { width: auto; min-width: 150px; margin: 0; min-height: 40px; padding-block: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.status-select { border-radius: var(--radius-ctl); }
.star { border-radius: var(--radius-ctl); border-color: transparent; background: var(--btn-tonal); color: var(--accent-strong); min-height: 40px; font-size: var(--fs-sm); }
.star.on { background: var(--amber-soft); border-color: var(--amber-line); color: var(--amber-text); }
.btn.icon-only.danger-icon { color: var(--red); background: transparent; }
.btn.icon-only.danger-icon:hover { background: var(--red-soft); }
@media (max-width: 600px) {
  .panel-head { padding: 16px 16px 10px; }
  .status-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 16px 14px; gap: var(--sp-2) var(--sp-3); }
  .mini-field select, .mini-field input { width: 100%; min-width: 0; }
  .status-bar .star, .status-bar .warn-tag { grid-column: 1 / -1; justify-content: center; }
  .status-bar .warn-tag { text-align: center; padding: 6px; }
}

/* Document toolbar on phones: [CV | ATS | Ansøgning], then [layout v][+], then [Indhold][Tjek][undo][redo] – all edges aligned. */
@media (max-width: 600px) {
  .toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); padding: 10px 12px; }
  .toolbar > .segmented { width: 100%; }
  .toolbar-layout { display: flex; gap: var(--sp-2); }
  .toolbar-layout .hint { flex: 1 1 auto; font-size: var(--fs-xs); white-space: normal; align-self: center; }
  /* Text buttons keep their whole label and the row wraps instead of squeezing them under the undo arrows. */
  .toolbar > .toolbar-group[role=group] { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
  .toolbar > .toolbar-group[role=group] > .btn:not(.icon-only) { flex: 1 1 auto; min-width: max-content; white-space: nowrap; }
  .toolbar-layout #look-button { flex: 1 1 auto; justify-content: center; }
  /* Undo/redo lead the row, so a wrapped "Versioner" takes the second line instead of the two arrows alone. */
  .toolbar > .toolbar-group[role=group] > .btn.icon-only { order: -1; }
  .toolbar .btn.small { min-height: var(--touch); font-size: var(--fs-sm); }
  .toolbar .btn.small.icon-only { width: var(--touch); }
  .toolbar-export .btn { min-height: 48px; }

  /* "CV'et fylder 2 sider": the message first, the fix as a full-width button under it. */
  .page-fit { display: grid; grid-template-columns: minmax(0, 1fr); padding: 10px 12px; gap: var(--sp-2); }
  .page-fit .btn { width: 100%; min-height: var(--touch); font-size: var(--fs-sm); }
}

/* Phone top bar: a plain icon button, not a bordered box. */
.menu-toggle.btn { background: transparent; color: var(--text); }
.menu-toggle.btn:hover { background: var(--accent-soft); }

/* Stats: an odd last KPI fills its row instead of leaving a hole. */
@media (max-width: 600px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .page-head > .segmented { width: 100%; }
}
@media (max-width: 600px) { .toolbar-layout .btn.icon-only-narrow { flex: none; width: var(--touch); padding: 0; } }
/* The switch sits to the right of its text (.field > label would otherwise make it a block). */
.field > label.switch-row { display: flex; font-weight: 600; margin-bottom: 0; cursor: pointer; }

/* ---------- 6-sekunders-testen (Workspace › Match & tjek) ---------- */
.glance { margin: var(--sp-3) 0; padding: var(--sp-3) var(--sp-4); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); display: grid; gap: 2px; }
.glance-label { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: var(--sp-1); }
.glance-name { font-size: var(--fs-lg); line-height: 1.2; }
.glance-title { color: var(--accent); font-weight: 600; font-size: var(--fs-sm); }
.glance-text { margin: var(--sp-2) 0 0; font-size: var(--fs-sm); }
.glance-role { margin-top: var(--sp-2); font-weight: 700; font-size: var(--fs-sm); }
.glance-bullets { margin: 2px 0 0; padding-left: 18px; font-size: var(--fs-sm); color: var(--muted); }
.glance-skills { margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--muted); }
.impression-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.impression-checks li { display: grid; grid-template-columns: 20px 1fr; gap: var(--sp-2); align-items: start; font-size: var(--fs-sm); }
.impression-checks li > svg { margin-top: 2px; }
.impression-checks li.todo > svg { color: var(--amber); }
.impression-checks li.ok > svg { color: var(--green); }
.impression-checks small { display: block; color: var(--muted); }
.impression-checks .advice { display: block; margin-top: 2px; }
.impression-fine { margin-top: var(--sp-3); }
.impression-fine > summary { cursor: pointer; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); min-height: 32px; display: flex; align-items: center; }
.impression-fine > .impression-checks { margin-top: var(--sp-2); }

/* ---------- Kompetence-radar (Statistik) ---------- */
.radar-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2) var(--sp-3); flex-wrap: wrap; }
.radar-head h3 { margin: 0; }
.radar-score { font-size: var(--fs-sm); }
.radar-score b { font-size: var(--fs-2xl); font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.radar-group { margin-top: var(--sp-4); }
.radar-list { list-style: none; margin: 0 0 var(--sp-2); padding: 0; display: grid; gap: var(--sp-2); }
.radar-row { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; gap: var(--sp-3); align-items: center; font-size: var(--fs-sm); }
.radar-name { font-weight: 600; overflow-wrap: anywhere; }
.radar-bar { height: 8px; border-radius: var(--radius-pill); background: var(--track); overflow: hidden; }
.radar-bar > span { display: block; height: 100%; border-radius: inherit; }
.radar-row.gap .radar-bar > span { background: var(--amber); }
.radar-row.have .radar-bar > span { background: var(--green); }
.radar-count { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Phones: edit a text in a sheet (editor.js › openSheet) ---------- */
.edit-sheet-layer { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; }
.edit-sheet-backdrop { position: absolute; inset: 0; background: rgba(16, 24, 32, .45); }
.edit-sheet {
  position: relative; width: 100%; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-lg);
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 10px;
  animation: sheet-in var(--t) var(--ease);
}
.edit-sheet::before { content: ""; justify-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--line); }
@keyframes sheet-in { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .edit-sheet { animation: none; } }
.edit-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.edit-sheet-title { font-size: var(--fs-lg); }
.edit-sheet-x { width: var(--touch); height: var(--touch); border: 0; background: none; color: var(--text); border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; margin-right: -10px; }
.edit-sheet-x svg { width: 20px; height: 20px; }
.edit-sheet-where { margin: -6px 0 0; font-size: var(--fs-sm); color: var(--muted); }
.edit-sheet-input { width: 100%; font: inherit; font-size: 16px; line-height: 1.5; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); resize: vertical; }
.edit-sheet-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.edit-sheet-live { display: grid; gap: 6px; }
.edit-sheet-live:empty { display: none; }
.edit-sheet-issue { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 10px; border-radius: var(--radius-sm); border-left: 3px solid #d9a400; background: var(--amber-soft); font-size: var(--fs-sm); }
.edit-sheet-issue.err { border-left-color: var(--red); background: var(--red-soft); }
.edit-sheet-issue span { flex: 1 1 200px; }
.edit-sheet-actions, .edit-sheet-styles { display: flex; flex-wrap: wrap; gap: 8px; }
.edit-sheet-actions .btn, .edit-sheet-styles .btn { min-height: var(--touch); }
.edit-sheet-actions svg { width: 16px; height: 16px; }
.edit-sheet-more { display: grid; gap: 8px; }
.edit-sheet-more:empty { display: none; }
.edit-sheet-sub { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.edit-sheet-choice { text-align: left; font: inherit; font-size: var(--fs-sm); line-height: 1.45; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--text); cursor: pointer; }
.edit-sheet-choice:focus-visible { outline: 2px solid var(--accent); }
.edit-sheet-choice-warn { display: block; margin-top: 6px; padding: 4px 8px; border-left: 3px solid #d9a400; border-radius: var(--radius-sm); background: var(--amber-soft); color: var(--amber-text); font-size: var(--fs-xs); }
.edit-sheet-main { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom)); background: var(--surface); padding-top: 4px; }
.edit-sheet-main .btn { min-height: 48px; justify-content: center; }
body.edit-sheet-open { overflow: hidden; }
/* "Det er sandt" (editor.js › openFactBox): the same sheet on phones, a centred dialog on wider screens. */
.fact-sheet-label { font-size: var(--fs-sm); font-weight: 600; }
.fact-sheet .btn[disabled] { opacity: .55; cursor: not-allowed; }
@media (min-width: 981px) {
  .fact-layer { align-items: center; justify-content: center; padding: 16px; }
  .fact-layer .edit-sheet { max-width: 520px; border-radius: var(--radius-lg); padding-bottom: 16px; }
  .fact-layer .edit-sheet::before { display: none; }
  .fact-layer .edit-sheet-main { position: static; }
}

/* ---------- Phones and tablets: a tab bar at the bottom, where the thumb is ---------- */
.tabbar { display: none; }
@media (max-width: 980px) {
  :root { --tabbar-h: calc(58px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; z-index: 15; left: 0; right: 0; bottom: 0;
    padding: 4px 4px env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px;
    border: 0; background: none; color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; text-decoration: none; border-radius: var(--radius-sm); cursor: pointer;
  }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .active { color: var(--accent); }
  .tabbar .new svg { background: var(--accent); color: var(--on-accent); border-radius: 50%; padding: 3px; width: 26px; height: 26px; }
  .main { padding-bottom: var(--tabbar-h); }
  .profile-save { bottom: var(--tabbar-h); }
  .toasts { bottom: calc(var(--tabbar-h) + 12px); left: 16px; right: 16px; width: auto; }
}
@media (max-width: 600px) {
  /* The downloads sit right above the tab bar. */
  .toolbar .toolbar-export { bottom: var(--tabbar-h); padding-bottom: 10px; }
  .workspace.show-doc .preview-pane { padding-bottom: 76px; }
  body:has(.toolbar-export) .toasts { bottom: calc(var(--tabbar-h) + 80px); }

  /* "Passer ikke på én side": one short line, the two choices side by side. */
  .page-fit { padding: 8px 12px; gap: 6px; }
  .page-fit .row { display: flex; gap: 8px; }
  .page-fit .row .btn { flex: 1 1 0; width: auto; }
  .page-fit.pdf-held .row .btn { flex: 1 1 auto; min-width: max-content; }
}

/* ---------- Match & tjek: overview and folded sections ---------- */
.overview { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.overview-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.overview-stat {
  display: grid; gap: 2px; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer; box-shadow: var(--shadow);
}
.overview-stat:hover { border-color: var(--border-strong); }
.overview-stat:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.overview-stat b { white-space: nowrap; font-size: var(--fs-2xl); font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.overview-stat b small { display: inline; font-size: var(--fs-md); font-weight: 700; color: var(--muted); }
.overview-stat span { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.overview-title { margin: var(--sp-1) 0 0; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.overview-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.overview-steps button {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: var(--touch);
  padding: 10px 12px 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  color: var(--text); font: inherit; font-size: var(--fs-sm); font-weight: 600; text-align: left; cursor: pointer;
}
.overview-steps button:hover { background: var(--surface-2); }
.overview-steps button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.overview-steps svg { flex: none; width: 18px; height: 18px; color: var(--muted); }
/* The match band (package 11): calm – a coloured edge and a word, never a meter, a number or a chance. */
.match-band { padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.match-band.strong { border-left-color: var(--green); }
.match-band.stretch { border-left-color: var(--amber); }
.match-band.weak { border-left-color: var(--red); }
.match-band-head { display: flex; align-items: baseline; justify-content: space-between; gap: 4px var(--sp-3); flex-wrap: wrap; }
.match-band-label { margin: 0; font-size: var(--fs-md); font-weight: 800; text-transform: none; letter-spacing: 0; color: var(--text); }
.match-band.strong .match-band-label { color: var(--green-text); }
.match-band.stretch .match-band-label { color: var(--amber-text); }
.match-band.weak .match-band-label { color: var(--red-text); }
/* A 44 px touch area without pushing the line apart. */
.match-band-head .link { font-size: var(--fs-sm); font-weight: 600; padding: 12px 2px; margin: -12px 0; }
.match-band-reasons { margin: 6px 0 0; padding-left: 1.2em; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.match-band-reasons li + li { margin-top: 2px; }
.match-band small { margin-top: 6px; font-size: var(--fs-xs); }
.overview-done { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 14px; border-radius: var(--radius); background: var(--green-soft); color: var(--green-text); font-weight: 600; font-size: var(--fs-sm); }

details.foldout > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: var(--touch); font-weight: 700; }
details.foldout > summary::-webkit-details-marker { display: none; }
details.foldout > summary::after { content: ""; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform var(--t-fast) var(--ease); }
details.foldout[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
details.foldout > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
.fold-count { font-weight: 600; font-size: var(--fs-sm); color: var(--muted); }
details.foldout.section { border-top: 1px solid var(--line); margin-top: var(--sp-3); padding-top: var(--sp-1); }
details.foldout.section > summary { font-size: var(--fs-md); }
details.foldout.section[open] > summary { margin-bottom: var(--sp-2); }
.ats-card details.foldout > summary { font-size: var(--fs-sm); }

/* ---------- Profil: jump between sections, heading levels ---------- */
.section-nav {
  position: sticky; top: 0; z-index: 4; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 0 0 var(--sp-3); padding: 8px 0 14px;
  /* Frosted rather than solid, and the lower edge fades out, so the cards slide under it without a hard band. */
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 8px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 8px), transparent);
}
.section-nav::-webkit-scrollbar { display: none; }
.section-nav a {
  flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: var(--fs-sm); font-weight: 600; text-decoration: none;
}
.section-nav a:hover { border-color: var(--border-strong); }
@media (max-width: 980px) { .section-nav { top: 61px; } }
@media (pointer: coarse) { .section-nav a { min-height: var(--touch); } }
.card > h2.h3 { font-size: var(--fs-lg); margin: 0 0 var(--sp-2); }
details.danger-zone > summary { cursor: pointer; font-weight: 700; color: var(--red-text); min-height: var(--touch); display: flex; align-items: center; }
details.danger-zone[open] > summary { margin-bottom: var(--sp-2); }

/* ---------- Skabeloner: gallery ---------- */
.gallery > h2 { margin: 0 0 var(--sp-3); }
.gallery-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: var(--sp-4); }
.gallery-card { display: grid; gap: 10px; align-content: start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.gallery-card.is-default { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
/* A4 page (794 px wide) shown at 172 px: scale .2166. */
.thumb { width: 172px; aspect-ratio: 210 / 297; justify-self: center; overflow: hidden; border-radius: 6px; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 32, .18); }
.thumb-frame { width: 794px; height: 1155px; border: 0; margin-top: -16px; transform: scale(.2166); transform-origin: 0 0; pointer-events: none; background: #fff; }
.gallery-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.gallery-meta b { flex: 1 1 100%; font-size: var(--fs-sm); }
.gallery-meta .tag.accent { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--accent-strong); }
.gallery-meta .tag svg { width: 12px; height: 12px; }
.gallery-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.gallery-actions .btn { flex: 1 1 auto; }
.back-link { margin-bottom: var(--sp-2); }
@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
  .thumb { width: 140px; }
  .thumb-frame { transform: scale(.1763); }
  .gallery-card { padding: 10px; }
}

/* ---------- Dark mode ---------- */
:root { color-scheme: light; --track: #e9edf0; --on-accent: #ffffff; --code-bg: #eef1f4; }
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --sidebar: #0c1318; --sidebar-2: #18242c; --sidebar-text: #dbe4ea; --sidebar-muted: #9fb0bb;
    --accent: #8ec3d9; --accent-strong: #b6dbea; --accent-soft: #1b313c; --on-accent: #0c1318;
    --bg: #0f161b; --surface: #162028; --surface-2: #1b2730; --text: #e7eef2; --muted: #a3b3bd;
    --line: #26343e; --border: #364652; --border-strong: #536673; --track: #26343e; --code-bg: #1f2d37;
    --red: #f2837a; --red-soft: #3a1e1c; --red-text: #f6bdb7;
    --amber: #e8b54f; --amber-soft: #352a12; --amber-text: #f3d793; --amber-line: #6e5520;
    --green: #63cf90; --green-soft: #15301f; --green-text: #a6e6bf;
    --info-soft: #1b2833; --focus: #8ab8ff; --btn-tonal: #1f3540; --btn-disabled: #202c35; --btn-disabled-text: #7c8c97; --btn-tonal-hover: #284452;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-lg: 0 10px 32px rgba(0, 0, 0, .55);
  }
  .sidebar .btn.primary, .history-item.active { background: #2f5566; border-color: #2f5566; color: #fff; }
  .sidebar .btn.primary:hover { background: #3a6678; border-color: #3a6678; }
  textarea.todo { background: #2c2513; }
  .code-box { background: var(--surface-2); border-color: var(--border); }
  .status-select.status-sent { background: #1b2b45; border-color: #3d5f96; }
  .status-select.status-rejected { background: var(--surface-2); }
  .danger-zone { background: #1f1615; border-color: #5a2a26; }
  .btn.danger:hover, .btn.ghost.danger:hover { background: #4a2420; }
  .preview, .compare-col { background: #0b1116; }
  .edit-sheet-backdrop { background: rgba(0, 0, 0, .6); }
  .tabbar { background: color-mix(in srgb, var(--surface) 94%, transparent); }
  img, .thumb { color-scheme: light; }
  .start-checklist li.done .check-box { color: var(--bg); }
}

/* ---------- Admin (founders only) ---------- */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--sp-4); align-items: start; }
.admin-grid .card { margin: 0; }
.admin-bars { list-style: none; margin: var(--sp-3) 0 0; padding: 0; display: grid; gap: 10px; }
.admin-bars li { display: grid; grid-template-columns: minmax(120px, 38%) 1fr 3ch; gap: var(--sp-3); align-items: center; font-size: var(--fs-sm); }
.admin-bars b { text-align: right; font-variant-numeric: tabular-nums; }
.admin-bar { height: 10px; border-radius: var(--radius-pill); background: var(--track); overflow: hidden; }
.admin-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.admin-columns { display: flex; align-items: flex-end; gap: 3px; height: 140px; margin-top: var(--sp-3); padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.admin-columns > span { flex: 1 1 0; min-width: 2px; border-radius: 3px 3px 0 0; background: var(--accent); opacity: .85; }
.admin-columns-axis { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--muted); margin-top: 4px; }
.admin-list { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: grid; }
.admin-list li { display: flex; justify-content: space-between; gap: var(--sp-3); padding: 8px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.admin-list li:last-child { border-bottom: 0; }
.admin-list b { font-variant-numeric: tabular-nums; }
.admin-claims { list-style: none; margin: var(--sp-2) 0; padding: 0; display: grid; gap: 8px; }
.admin-claims li { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); font-weight: 600; font-size: var(--fs-sm); }
.admin-claims .btn { flex: none; }
.founder-invite { max-width: 520px; margin: var(--sp-6) auto; display: grid; gap: var(--sp-3); }
.founder-invite h1 { margin: 0; }
@media (max-width: 600px) { .admin-grid { grid-template-columns: minmax(0, 1fr); } .admin-bars li { grid-template-columns: minmax(0, 1fr) 3ch; } .admin-bars .admin-bar { grid-column: 1 / -1; grid-row: 2; } }

/* ---------- App language switch ---------- */
.lang-switch { align-self: flex-start; }
.setup-lang { margin: 0 auto var(--sp-3); align-self: center; }

/* ---------- Own words kept in the profile (package 13) ---------- */
.save-own { margin: var(--sp-2) 0 0; }
.save-own-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.save-own-row select { flex: 1 1 12rem; min-width: 0; max-width: 100%; min-height: var(--touch); }
.save-own-row .btn { white-space: normal; text-align: left; }
.save-own-job { font-size: var(--fs-xs); color: var(--muted); }
.save-own-status { display: block; font-size: var(--fs-xs); margin-top: 4px; }
.save-own-status.is-error { color: var(--red-text); }
.own-edits { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: grid; gap: var(--sp-2); }
.own-edits li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.own-edit-texts { margin: 6px 0 var(--sp-2); }
.own-edit-texts dt { font-size: var(--fs-xs); color: var(--muted); margin-top: 6px; }
.own-edit-texts dd { margin: 2px 0 0; }
.own-edit-blocked { display: flex; gap: 6px; align-items: flex-start; margin: 0; color: var(--amber-text); }
.own-edit-confirm { margin-top: var(--sp-2); padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.own-edit-confirm .row { flex-wrap: wrap; }
.pe-context { display: flex; gap: 6px; align-items: center; }


/* ---------- Calm pass (UX test, 2026-11) ---------- */
/* One heading style and one close button (×, top right) for every side sheet: Udseende, Indhold, Versioner. */
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin: 0 0 var(--sp-3); }
.sheet-head > b { font-size: var(--fs-md); font-weight: 650; }
/* The one-line edit hint: dismissible, so it stops costing a bar once it has been read. */
.edit-hint .hint-dismiss { margin-left: auto; flex: none; }
/* Step 2 of the new application: optional fields fold away behind a "+" line. */
details.wizard-more { border-top: 1px solid var(--line); padding-top: var(--sp-1); margin-top: var(--sp-2); }
details.wizard-more > summary { list-style: none; color: var(--text); font-weight: 600; gap: var(--sp-2); }
details.wizard-more > summary::-webkit-details-marker { display: none; }
details.wizard-more > summary::before { content: "+"; display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; line-height: 1; padding-bottom: 2px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
details.wizard-more > summary { min-height: 44px; }
details.wizard-more[open] > summary::before { content: "–"; }
details.wizard-more > summary em { font-weight: 400; color: var(--muted); }
details.wizard-more > .label-row { justify-content: flex-end; }
/* Back / Next stay in reach on wide screens however long the step is. */
@media (min-width: 981px) {
  .app.focus .wizard-actions { position: sticky; bottom: 0; z-index: 4; margin-bottom: 0; padding: var(--sp-3) 0 var(--sp-4); background: linear-gradient(to top, var(--surface) 75%, transparent); }
}
.settings-tabs { margin: 0 0 var(--sp-4); }
/* The hint is one line that never wraps, so the paper does not jump 18px when the sheet narrows the row. */
.edit-hint .wide-only { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ats-explain-fold { margin: 0 0 var(--sp-2); }
/* Very wide screens: the bars keep to a readable width instead of pinning their ends to the screen edges. */
@media (min-width: 1700px) {
  :root { --chrome-pad: calc((100vw - 1560px) / 2); }
  .top-bar:not(.focus-bar) { padding-inline: var(--chrome-pad); }
  .workspace.has-doc .toolbar, .workspace.has-doc .review-dock, .workspace.has-doc .edit-hint { padding-inline: var(--chrome-pad); }
}

/* Profile: the result of saving suggestions, the confirmation for flagged ones, and a note that grows with its text. */
.result-card h3 { display: flex; align-items: center; gap: 8px; color: var(--green-text); }
.result-card h3 svg { color: var(--green); flex: none; }
.result-lines { margin: 0 0 var(--sp-3); padding-left: 1.2em; }
.confirm-flagged { margin: var(--sp-3) 0; padding: var(--sp-3); border: 1px solid var(--amber-line, var(--line)); background: var(--amber-soft); color: var(--amber-text); border-radius: var(--radius); }
.confirm-flagged p { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 var(--sp-2); font-weight: 600; }
.confirm-flagged:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.just-updated { outline: 3px solid var(--focus); outline-offset: 3px; transition: outline-color .6s; }
@supports (field-sizing: content) { #update-note { field-sizing: content; min-height: 6.5em; max-height: none; overflow-y: hidden; resize: none; } }
/* A pressed toolbar button is dark: its muted look name must stay readable on it. */
.btn.on .look-name, .btn.on .muted { color: inherit; opacity: .8; }

/* ---------- Action feedback (FeedbackHost): one message under the top bar, never stacked ---------- */
.feedback-host { position: fixed; z-index: 950; top: 3px; left: 50%; transform: translateX(-50%); width: min(780px, calc(100vw - 24px)); pointer-events: none; display: grid; gap: 6px; }
.feedback-host > div:empty { display: none; }
/* Sits inside the 48px top bar band (one line at this width, two at most), so it never covers the toolbar under it. */
.feedback { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-lg); font-size: 13px; line-height: 1.3; font-weight: 550; animation: toast-in var(--t) var(--ease); }
.feedback > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.feedback > svg { flex: none; width: 18px; height: 18px; }
.feedback .toast-close { margin: -4px 0; width: 30px; height: 30px; }
.feedback.success { border-color: var(--green-line, var(--line)); background: var(--green-soft); color: var(--green-text); }
.feedback.info { background: var(--surface); color: var(--text); }
.feedback.info > svg { color: var(--accent); }
.feedback.failure { border-color: var(--red-line, var(--line)); background: var(--red-soft); color: var(--red-text); }
@media (max-width: 980px) { .feedback-host { top: 8px; } }
@media (prefers-reduced-motion: reduce) { .feedback { animation: none; } }
/* A download button a red error blocks stays pressable (it says why) but looks held back. */
.is-blocked { opacity: .55; }

/* ---------- An imported application's own page (PastApplicationPage, /tidligere/{id}) ----------
   A plain reading page: the text from the person's files as escaped plain text in the page's one scroll (no inner
   scrollbar), a two-column form that stacks on phones, and the phone-only status card (the top bar has it on wide screens). */
.past-head { margin-bottom: var(--sp-4); }
.past-head h1 { margin: 2px 0 4px; }
.past-head p { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: 0; }
.past-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--sp-4); }
.past-form .field.wide { grid-column: 1 / -1; }
.past-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.past-meta .tag { overflow-wrap: anywhere; }
.past-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-sm); line-height: 1.6; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: var(--sp-3) var(--sp-4); margin-top: var(--sp-2); }
.past-app details.foldout > summary .h3 { margin: 0; }
@media (max-width: 700px) { .past-form { grid-template-columns: 1fr; } }
@media (min-width: 981px) { .past-narrow { display: none; } }

/* ---------- Adding earlier applications (ImportHistoryPage, /tidligere): the Fokus pattern, three steps ---------- */
.history-add { display: flex; align-items: center; gap: 6px; min-height: var(--touch); margin-top: 2px; padding: 6px 10px; border-radius: 8px; font-size: var(--fs-xs); color: var(--sidebar-muted); text-decoration: none; }
.history-add:hover, .history-add.active { color: var(--sidebar-text); background: var(--sidebar-2); }
.history-add .icon { width: 14px; height: 14px; }
.history-flow { max-width: 760px; margin: 0 auto; }
.wizard-progress.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.history-flow > .wizard-progress { margin-bottom: var(--sp-4); }
.history-drop { min-height: 160px; flex-direction: column; border-radius: var(--radius-lg); }
.history-progress { font-weight: 650; margin: 0 0 var(--sp-2); }
.history-bar { width: 100%; height: 8px; accent-color: var(--accent); }
.history-rows { list-style: none; margin: 0 0 var(--sp-3); padding: 0; display: grid; gap: var(--sp-3); }
.history-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-3) var(--sp-4); }
.history-row.off { background: var(--surface-2); }
.history-row-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.history-tick { display: flex; align-items: center; gap: 10px; min-height: var(--touch); font-weight: 650; cursor: pointer; min-width: 0; }
.history-tick span { overflow-wrap: anywhere; }
.history-fields { display: grid; grid-template-columns: 1.3fr 1.3fr 1fr 1fr; gap: 0 var(--sp-3); }
.history-fields label { display: grid; gap: 2px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.history-fields input, .history-fields select { font-size: var(--fs-sm); color: var(--text); }
.history-files { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.history-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 4px 2px 10px; border: 1px solid var(--line); border-radius: var(--radius-pill); font-size: var(--fs-xs); background: var(--surface-2); }
.history-chip .icon { width: 14px; height: 14px; color: var(--muted); }
.history-chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.history-chip .pop-panel { min-width: 220px; }
.stats-history { margin: -8px 0 var(--sp-4); }
@media (max-width: 980px) {
  .history-fields { grid-template-columns: 1fr 1fr; }
  .history-drop input { min-height: var(--touch); }
}
@media (max-width: 600px) { .history-fields { grid-template-columns: 1fr; } }
@media (min-width: 981px) { .app.focus .history-flow > .wizard-progress { display: none; } .app.focus .history-page { padding-top: var(--sp-8); } }
.history-notes p { margin: 0; }
.history-notes p + p { margin-top: 4px; }
.history-result .history-saved { list-style: none; margin: 0 0 var(--sp-3); padding: 0; display: grid; gap: 4px; }
.history-result .history-saved a { text-decoration: none; }
.history-result .history-saved a:hover b { text-decoration: underline; }
.history-result h1 { display: flex; align-items: center; gap: 8px; color: var(--green-text); }
.history-result h1 svg { color: var(--green); flex: none; }
