@font-face {
  font-family: "Exo 2";
  src: url("fonts/Exo2-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/*
 * Ink and paper are cool and quiet so the three signals stand out:
 *   indigo = progress, orange = a running timer, gold = a goal reached.
 * Projects carry no colour of their own; with 700+ of them it would only be noise.
 * Text pairs meet WCAG AA (4.5:1), field borders and icons 3:1, in both themes.
 */
:root {
  --bg: #f2f3f6;
  --surface: #ffffff;
  --ink: #151a2d;
  --muted: #5a6178;
  --faint: #666d84;
  --line: #dde0e8;
  --field-line: #8a90a3;
  --accent: #3b4cca;
  --accent-ink: #ffffff;
  --accent-soft: #e6e9fb;
  --run: #c2410c;
  --run-ink: #a8380a;
  --run-on: #ffffff;
  --run-soft: #fdeee6;
  --gold: #9a6a10;
  --gold-soft: #f8edd3;
  --gold-ink: #2a1d03;
  --danger: #c0262d;
  --radius-xl: 22px;
  --radius-lg: 14px;
  --radius-sm: 8px;
  --lift: 0 1px 2px rgb(21 26 45 / 0.05), 0 10px 28px -14px rgb(21 26 45 / 0.22);
  --font: "Exo 2", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
/* Dark tokens, used by "Mørk" and by "Auto" when the system is dark. Keep both blocks identical. */
:root[data-theme="dark"] {
  --bg: #10131c;
  --surface: #191d29;
  --ink: #e7e9f1;
  --muted: #a0a6ba;
  --faint: #8189a0;
  --line: #2b3142;
  --field-line: #666e85;
  --accent: #8d9bff;
  --accent-ink: #10131c;
  --accent-soft: #232a4d;
  --run: #ff8a4c;
  --run-ink: #ff9a62;
  --run-on: #1b0e06;
  --run-soft: #33221a;
  --gold: #f0c454;
  --gold-soft: #352c16;
  --gold-ink: #211803;
  --danger: #ff8a85;
  --lift: 0 1px 2px rgb(0 0 0 / 0.35), 0 12px 32px -14px rgb(0 0 0 / 0.7);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10131c;
    --surface: #191d29;
    --ink: #e7e9f1;
    --muted: #a0a6ba;
    --faint: #8189a0;
    --line: #2b3142;
    --field-line: #666e85;
    --accent: #8d9bff;
    --accent-ink: #10131c;
    --accent-soft: #232a4d;
    --run: #ff8a4c;
    --run-ink: #ff9a62;
    --run-on: #1b0e06;
    --run-soft: #33221a;
    --gold: #f0c454;
    --gold-soft: #352c16;
    --gold-ink: #211803;
    --danger: #ff8a85;
    --lift: 0 1px 2px rgb(0 0 0 / 0.35), 0 12px 32px -14px rgb(0 0 0 / 0.7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
.ah-body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ah-loading { padding: 3rem; text-align: center; color: var(--muted); }
[hidden] { display: none !important; }

/* Brand */
.ah-brand { display: inline-flex; align-items: center; gap: 0.1rem; font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }
.ah-brand > span:last-child { font-weight: 400; color: var(--accent); }
.ah-mark { display: inline-flex; color: var(--accent); margin-right: 0.45rem; }
.ah-mark svg { width: 1.55rem; height: 1.55rem; }
.ah-brand-lg { font-size: 2.1rem; }
.ah-brand-lg .ah-mark svg { width: 2.3rem; height: 2.3rem; }

/* Top bar */
.ah-top {
  display: flex; align-items: center; gap: 1.5rem;
  max-width: 1120px; margin: 0 auto; padding: 1.1rem 1.25rem;
}
.ah-top .ah-nav { margin-left: auto; }
.ah-tabs { display: flex; gap: 0.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.ah-tab { border: 0; background: none; border-radius: 999px; padding: 0.35rem 0.95rem; cursor: pointer; color: var(--muted); font-weight: 500; }
.ah-tab:hover { color: var(--ink); }
.ah-tab.is-active { background: var(--ink); color: var(--surface); }
.ah-nav { display: flex; gap: 1.1rem; align-items: center; font-size: 0.9rem; flex-wrap: wrap; justify-content: flex-end; }
.ah-nav a { color: var(--muted); text-decoration: none; }
.ah-nav a:hover { color: var(--ink); }
.ah-user { font-weight: 600; }

.ah-main { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem 4rem; }
#view-track { max-width: 960px; }

.ah-icon, .ah-ghost {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm);
  height: 2.25rem; cursor: pointer;
}
.ah-icon { width: 2.25rem; font-size: 1.2rem; line-height: 1; }
.ah-ghost { padding: 0 0.9rem; }
.ah-icon:hover, .ah-ghost:hover { border-color: var(--muted); }

/* ---------- Hero: the week dial ---------- */
.ah-hero {
  display: grid; grid-template-columns: 188px minmax(0, 1fr); gap: 2rem; align-items: center;
  background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--lift);
  padding: 1.4rem 1.75rem 1.4rem 1.4rem; margin: 0.5rem 0 1.25rem;
}
.ah-dial-wrap { position: relative; width: 188px; aspect-ratio: 1; }
.ah-dial { display: block; width: 100%; height: 100%; overflow: visible; }
.ah-seg-track, .ah-seg { fill: none; stroke-width: 13; stroke-linecap: round; }
.ah-seg-track { stroke: var(--line); }
.ah-seg { stroke: var(--accent); }
.ah-dial.is-done .ah-seg { stroke: var(--gold); }
.ah-seg-today { fill: var(--ink); }
.ah-dial-center {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; pointer-events: none;
}
.ah-dial-center > * { pointer-events: auto; }
.ah-dial-center strong {
  font-size: 2.35rem; font-weight: 300; letter-spacing: -0.035em; line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
}
.ah-goal {
  border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 0.9rem; padding: 0.15rem 0.4rem;
  border-radius: 6px; margin-top: 0.25rem; text-decoration: underline dotted; text-underline-offset: 3px;
}
.ah-goal:hover { color: var(--ink); background: var(--bg); }
.ah-goal-edit { color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; }
.ah-goal-edit input {
  width: 3.6rem; text-align: center; border: 1px solid var(--accent); border-radius: 6px; background: var(--bg);
  padding: 0.1rem 0.2rem; font-variant-numeric: tabular-nums;
}

.ah-week-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.ah-week-head h1 { font-size: 1.4rem; font-weight: 650; letter-spacing: -0.015em; margin: 0 0.25rem; }

.ah-stats { display: flex; flex-wrap: wrap; gap: 0.6rem 1.75rem; }
.ah-stat { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.ah-stat > svg {
  flex: none; width: 2.3rem; height: 2.3rem; padding: 0.5rem; border-radius: 50%;
  background: var(--bg); color: var(--muted); fill: currentColor;
}
.ah-stat strong { display: block; font-weight: 600; font-size: 0.95rem; line-height: 1.25; }
.ah-stat em { display: block; font-style: normal; color: var(--muted); font-size: 0.82rem; line-height: 1.3; }
.ah-stat-streak > svg { color: var(--line); }
.ah-stat-streak.is-lit > svg { color: var(--run); background: var(--run-soft); }
.ah-stat.is-gold > svg { color: var(--gold); background: var(--gold-soft); }

/* ---------- Days ---------- */
.ah-days {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.35rem;
  margin-bottom: 1.25rem;
}
.ah-day {
  border: 1px solid transparent; background: none; cursor: pointer; text-align: left; border-radius: var(--radius-lg);
  padding: 0.55rem 0.7rem 0.7rem; display: flex; flex-direction: column; gap: 0.15rem; min-width: 0;
}
.ah-day span { display: flex; align-items: center; gap: 0.25rem; font-size: 0.82rem; color: var(--muted); white-space: nowrap; }
.ah-day span svg { width: 0.95rem; height: 0.95rem; color: var(--accent); }
.ah-day strong {
  font-size: 1.55rem; font-weight: 300; font-variant-numeric: tabular-nums lining-nums; letter-spacing: -0.02em; line-height: 1.15;
}
.ah-day.is-zero strong { color: var(--faint); font-weight: 250; }
.ah-day.is-weekend strong { font-size: 1.25rem; }
.ah-day.is-today span { color: var(--accent); font-weight: 600; }
.ah-day:hover:not(.is-active) { background: var(--surface); }
.ah-day.is-active { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ah-day-bar { display: block; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 0.3rem; }
.ah-day-bar b { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.4s ease; }

/* ---------- Running timer: the one loud thing besides the dial ---------- */
.ah-live {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 1rem; align-items: center;
  background: var(--run-soft); border-radius: var(--radius-lg); padding: 0.9rem 1rem 0.9rem 1.2rem; margin-bottom: 1rem;
}
.ah-live-dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--run); box-shadow: 0 0 0 0 var(--run); animation: ah-ping 1.8s ease-out infinite; }
@keyframes ah-ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--run) 55%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
.ah-live-info { min-width: 0; }
.ah-live-info strong { display: block; font-weight: 600; }
.ah-live-info span { display: block; color: var(--muted); font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ah-live-time {
  font-size: 2.1rem; font-weight: 300; letter-spacing: -0.03em; color: var(--run-ink); line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
}
.ah-live-time small { display: block; font-size: 0.8rem; letter-spacing: 0; color: var(--muted); font-weight: 400; margin-top: 0.3rem; text-align: right; }
.ah-live-stop {
  border: 0; border-radius: 999px; background: var(--run); color: var(--run-on); font-weight: 600; cursor: pointer;
  height: 2.5rem; padding: 0 1.15rem;
}
.ah-live-stop:hover { filter: brightness(1.08); }

/* ---------- Form ---------- */
.ah-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem 1.2rem;
}
.ah-form-head { display: flex; align-items: center; gap: 0.5rem 1rem; flex-wrap: wrap; margin-bottom: 0.85rem; }
.ah-form-title { font-weight: 650; }
.ah-form.is-editing { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ah-recent { display: flex; align-items: center; gap: 0.4rem; width: 100%; overflow-x: auto; scrollbar-width: none; padding: 1px; }
.ah-recent::-webkit-scrollbar { display: none; }
.ah-recent.is-hidden { display: none; }
.ah-recent-label { color: var(--muted); font-size: 0.82rem; margin-right: 0.15rem; }
.ah-chip {
  flex: none; display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0; max-width: 14rem; line-height: 1.25; text-align: left;
  border: 1px solid var(--line); background: var(--bg); border-radius: var(--radius-sm); padding: 0.35rem 0.7rem;
  cursor: pointer; font-size: 0.84rem; white-space: nowrap;
}
.ah-chip:hover { border-color: var(--muted); background: var(--surface); }
.ah-chip strong { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ah-chip span { color: var(--muted); font-size: 0.78rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

.ah-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
.ah-span2 { grid-column: span 2; }
.ah-span3 { grid-column: span 3; }
.ah-span4 { grid-column: 1 / -1; }
/* Kunde -> projekt -> opgave, narrowing left to right. */
.ah-pick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr); gap: 0.75rem; }
.ah-field select:disabled { opacity: 0.55; cursor: not-allowed; }
.ah-field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.ah-field > span { font-size: 0.82rem; color: var(--muted); }
.ah-field select, .ah-field input, .ah-field textarea {
  width: 100%; border: 1px solid var(--field-line); border-radius: var(--radius-sm);
  background: var(--surface); padding: 0.55rem 0.7rem; min-height: 2.6rem;
}
.ah-field textarea { resize: vertical; min-height: 2.6rem; }
.ah-field select:focus, .ah-field input:focus, .ah-field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
/* Start, slut and Tid sit together; Tid stays the big number. */
.ah-times { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr); gap: 0.6rem; align-items: end; }
.ah-times input { font-variant-numeric: tabular-nums lining-nums; }
#f-start, #f-end { font-size: 1.1rem; text-align: center; }
#f-hours { font-size: 1.35rem; font-variant-numeric: tabular-nums lining-nums; text-align: right; }
#f-hours.is-derived, #e-hours:disabled, #f-hours:disabled { color: var(--muted); background: transparent; border-style: dashed; }

.ah-actions { display: flex; justify-content: flex-end; align-items: center; gap: 0.6rem; margin-top: 0.9rem; }
.ah-err { color: var(--danger); font-size: 0.9rem; margin-right: auto; }
.ah-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border: 0; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-ink);
  padding: 0 1.2rem; height: 2.6rem; font-weight: 600; cursor: pointer; text-decoration: none;
}
.ah-primary:hover { filter: brightness(1.08); }
.ah-primary:disabled { opacity: 0.6; cursor: progress; }
.ah-primary.is-timer::before {
  content: ""; width: 0; height: 0; border-left: 8px solid currentColor;
  border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}

/* ---------- Entries ---------- */
.ah-list { margin-top: 1.5rem; }
.ah-entry {
  position: relative;
  display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: center;
  padding: 0.95rem 0.25rem 0.95rem 1.1rem; border-bottom: 1px solid var(--line);
}
.ah-entry::before {
  content: ""; position: absolute; left: 0.2rem; top: 1.05rem; bottom: 1.05rem; width: 4px; border-radius: 2px;
  background: var(--line);
}
.ah-entry-proj strong { font-weight: 600; }
.ah-entry-proj span { color: var(--muted); margin-left: 0.35rem; font-size: 0.9rem; }
.ah-entry-task { font-size: 0.9rem; color: var(--muted); }
.ah-entry-notes { margin: 0.25rem 0 0; max-width: 62ch; white-space: pre-line; }
.ah-entry-when { display: flex; flex-direction: column; align-items: flex-end; gap: 0.1rem; }
.ah-entry-span { font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.ah-entry.is-running .ah-entry-span { color: var(--run-ink); }
.ah-entry-time {
  font-size: 1.5rem; font-weight: 300; font-variant-numeric: tabular-nums lining-nums; letter-spacing: -0.02em; min-width: 4.5ch; text-align: right;
}
.ah-entry-acts { display: flex; gap: 0.25rem; align-items: center; }
.ah-timer {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  height: 2.2rem; padding: 0 0.9rem; cursor: pointer; font-size: 0.88rem; font-weight: 600;
}
.ah-timer:hover { border-color: var(--muted); }
.ah-link {
  border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0.4rem 0.5rem; font-size: 0.88rem;
  text-decoration: none;
}
.ah-link:hover { color: var(--ink); text-decoration: underline; }
.ah-link.danger:hover { color: var(--danger); }

.ah-entry.is-running .ah-entry-time { color: var(--run-ink); font-weight: 400; }
.ah-entry.is-running .ah-timer { background: var(--run); border-color: var(--run); color: var(--run-on); }
.ah-entry.is-running::before { background: var(--run); }
@keyframes ah-pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) {
  .ah-live-dot { animation: none; }
  .ah-day-bar b { transition: none; }
}
.ah-entry.is-editing { opacity: 0.45; }

.ah-daytotal { display: flex; justify-content: flex-end; gap: 0.6rem; padding: 0.9rem 0.25rem; color: var(--muted); }
.ah-daytotal strong { color: var(--ink); font-variant-numeric: tabular-nums lining-nums; }
.ah-empty { color: var(--muted); padding: 2rem 0.25rem; }

/* ---------- Login ---------- */
.ah-login-body { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.ah-login {
  width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 1rem;
  background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--lift);
  padding: 2.25rem 2rem 2rem; position: relative; overflow: hidden;
}
.ah-login-dial { position: absolute; right: -70px; top: -70px; width: 220px; height: 220px; color: var(--accent-soft); pointer-events: none; }
.ah-login > :not(.ah-login-dial) { position: relative; }
.ah-login-lead { color: var(--muted); margin: 0 0 0.5rem; max-width: 30ch; }
.ah-alert { background: var(--bg); border-left: 3px solid var(--danger); padding: 0.7rem 0.9rem; margin: 0; border-radius: 4px; }
.ah-google { height: 3rem; }
.ah-login .ah-link { padding: 0; align-self: flex-start; }

/* ---------- Toast & confetti ---------- */
.ah-toast {
  position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: var(--surface); padding: 0.7rem 1.1rem; border-radius: var(--radius-sm);
  font-size: 0.92rem; z-index: 50; max-width: calc(100% - 2rem);
}
.ah-toast.is-win { background: var(--gold-soft); color: var(--gold-ink); box-shadow: inset 0 0 0 1.5px var(--gold), var(--lift); font-weight: 600; padding: 0.85rem 1.3rem; border-radius: 999px; }
.ah-confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 60; }

/* ---------- Oversigt ---------- */
.ah-btn { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); height: 2.6rem; }
.ah-filters {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.6rem 0.75rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0.9rem 1rem;
  margin: 0.5rem 0 1.75rem;
}
.ah-filters .ah-field select, .ah-filters .ah-field input { background: var(--bg); min-height: 2.4rem; padding: 0.4rem 0.6rem; }
.ah-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ah-table .ah-act { width: 1%; text-align: right; white-space: nowrap; padding-left: 0; }
.ah-table .ah-act .ah-link { padding: 0.1rem 0.4rem; }
.ah-table tr:not(:hover) .ah-act .ah-link { opacity: 0.55; }
.ah-table tr.ah-edit-row > td { background: var(--accent-soft); padding: 0.9rem 1rem; }
.ah-edit-head { margin-bottom: 0.6rem; }
.ah-edit-head .ah-sub { margin: 0 0 0 0.4rem; display: inline; }
.ah-edit-grid { display: grid; grid-template-columns: 9.5rem minmax(0, 2fr) minmax(0, 1.2fr) 15rem; gap: 0.6rem; }
.ah-edit-times { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
.ah-edit-times input { text-align: center; font-variant-numeric: tabular-nums lining-nums; }
.ah-table .ah-cell-span { color: var(--muted); font-variant-numeric: tabular-nums lining-nums; }
.ah-edit-grid .ah-field select, .ah-edit-grid .ah-field input, .ah-edit-grid .ah-field textarea { background: var(--surface); min-height: 2.4rem; padding: 0.4rem 0.6rem; }
.ah-edit-notes { grid-column: 1 / -1; }
.ah-edit #e-hours { text-align: right; font-variant-numeric: tabular-nums lining-nums; }
.ah-edit .ah-actions { margin-top: 0.75rem; }
.ah-edit .ah-actions .danger { margin-right: 0; }
@media (max-width: 720px) {
  .ah-edit-grid { grid-template-columns: 1fr 1fr; }
  .ah-edit-grid .ah-field:nth-child(2) { grid-column: 1 / -1; }
  .ah-edit-times { grid-column: 1 / -1; }
  .ah-edit .ah-actions { flex-wrap: wrap; }
}

@media (min-width: 1100px) {
  .ah-filters { grid-template-columns: 1.1fr 1.1fr 1.1fr 1fr 1.25fr 1.1fr 1fr; }
  .ah-filters input[type="date"] { padding-left: 0.45rem; padding-right: 0.3rem; }
}
.ah-report { transition: opacity 0.15s; }
.ah-report.is-loading { opacity: 0.45; pointer-events: none; }

.ah-report-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.ah-total strong { font-size: 3.2rem; font-weight: 250; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums lining-nums; }
.ah-total > span { color: var(--muted); font-size: 1rem; margin-left: 0.35rem; }
.ah-sub { color: var(--muted); font-size: 0.9rem; margin: 0.35rem 0 0; }
.ah-exports { display: flex; gap: 0.5rem; }

.ah-budget { border-left: 3px solid var(--accent); padding: 0.2rem 0 0.2rem 1rem; margin-bottom: 1.75rem; max-width: 760px; }
.ah-budget.is-warn { border-left-color: var(--run); }
.ah-budget.is-over { border-left-color: var(--danger); }
.ah-budget-text span { color: var(--muted); margin-left: 0.4rem; font-size: 0.9rem; }
.ah-meter { position: relative; height: 10px; background: var(--line); border-radius: 5px; margin: 0.6rem 0; }
.ah-meter i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 5px; }
.ah-budget.is-warn .ah-meter i { background: var(--run); }
.ah-budget.is-over .ah-meter i { background: var(--danger); }
.ah-meter b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); transform: translateX(-1px); }
.ah-budget-facts { margin: 0; font-size: 0.93rem; }

.ah-chart { margin-bottom: 2rem; }
.ah-bars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 4px; height: 180px; align-items: end; border-bottom: 1px solid var(--line); }
.ah-bar { display: grid; grid-template-rows: 1.2rem 1fr; height: 100%; position: relative; }
.ah-bar i { display: block; align-self: end; justify-self: center; width: min(100%, 64px); background: var(--accent); border-radius: 4px 4px 0 0; opacity: 0.8; }
.ah-bar:hover i { opacity: 1; }
.ah-bar-val { font-size: 0.72rem; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; overflow: hidden; align-self: end; }
.ah-bar-label { position: absolute; top: 100%; left: 0; right: 0; text-align: center; font-size: 0.72rem; color: var(--muted); padding-top: 0.3rem; white-space: nowrap; }
.ah-chart { padding-bottom: 1.4rem; }

.ah-breakdowns { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem 2.5rem; margin-bottom: 2.25rem; }
.ah-break h3 { font-size: 0.95rem; margin: 0 0 0.5rem; }
.ah-break ol { list-style: none; margin: 0; padding: 0; }
.ah-break-row {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 4.5rem; gap: 0.75rem; align-items: center;
  width: 100%; border: 0; background: none; text-align: left; padding: 0.4rem 0.25rem; cursor: pointer; border-radius: 6px;
}
.ah-break-row:hover { background: var(--surface); }
.ah-break-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ah-break-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.ah-break-bar i { display: block; height: 100%; background: var(--accent); }
.ah-break-val { font-variant-numeric: tabular-nums lining-nums; min-width: 4.5ch; text-align: right; }

.ah-h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
.ah-note { background: var(--surface); border-left: 3px solid var(--run); padding: 0.6rem 0.9rem; font-size: 0.9rem; }
.ah-table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.ah-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.ah-table th { text-align: left; font-weight: 600; font-size: 0.8rem; color: var(--muted); padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ah-table td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.ah-table tr:last-child td { border-bottom: 0; }
.ah-table .n { text-align: right; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.ah-table .nowrap { white-space: nowrap; }
.ah-table tr.is-selected td { background: var(--accent-soft); }
.ah-cb { width: 2.25rem; }
.ah-cb input { width: 1rem; height: 1rem; accent-color: var(--accent); }
.ah-cell-main { display: block; }
.ah-cell-sub { display: block; font-size: 0.8rem; color: var(--muted); }
.ah-cell-notes { min-width: 16rem; max-width: 34rem; white-space: pre-line; }
.ah-dot { display: inline-block; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--run); margin-right: 0.4rem; vertical-align: middle; }

.ah-move {
  position: sticky; top: 0.5rem; z-index: 5; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  background: var(--ink); color: var(--surface); border-radius: var(--radius-lg); padding: 0.6rem 0.75rem 0.6rem 1rem; margin-bottom: 0.75rem;
}
.ah-move[hidden] { display: none; }
.ah-move .ah-sub { color: inherit; opacity: 0.7; margin: 0; }
.ah-move-label { margin-left: 0.5rem; opacity: 0.7; font-size: 0.9rem; }
.ah-move select { border: 0; border-radius: var(--radius-sm); padding: 0.4rem 0.5rem; background: var(--surface); color: var(--ink); max-width: 16rem; }
.ah-move .ah-link { color: inherit; opacity: 0.8; }


/* ---------- Theme switch (Auto / Lys / Mørk) ---------- */
.ah-theme { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.ah-theme button {
  border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 999px;
  font-size: 0.8rem; padding: 0.2rem 0.65rem; line-height: 1.4;
}
.ah-theme button:hover { color: var(--ink); }
.ah-theme button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.ah-login .ah-theme { align-self: flex-start; margin-top: 0.5rem; }

/* Small screens */
@media (max-width: 720px) {
  .ah-top { flex-wrap: wrap; gap: 0.75rem; }
  .ah-user { display: none; }
  .ah-nav { gap: 0.75rem; }
  .ah-tabs { order: 3; width: 100%; justify-content: stretch; }
  .ah-tab { flex: 1; }
  .ah-filters { grid-template-columns: 1fr 1fr; }
  .ah-report-head { align-items: flex-start; }
  .ah-break-row { grid-template-columns: minmax(0, 1fr) 4rem 4rem; }
  .ah-total strong { font-size: 2.4rem; }
  .ah-hero { grid-template-columns: 1fr; justify-items: center; gap: 1.1rem; padding: 1.25rem 1rem; }
  .ah-dial-wrap { width: 168px; }
  .ah-dial-center strong { font-size: 2.05rem; }
  .ah-hero-main { width: 100%; }
  .ah-week-head { justify-content: center; }
  .ah-week-head h1 { font-size: 1.15rem; width: 100%; text-align: center; order: -1; margin-bottom: 0.25rem; }
  .ah-stats { flex-direction: column; gap: 0.6rem; }
  .ah-grid { grid-template-columns: 1fr 1fr; }
  .ah-span2 { grid-column: span 2; }
  .ah-span3 { grid-column: span 1; }
  .ah-pick { grid-template-columns: 1fr; gap: 0.6rem; }
  .ah-recent { margin-left: 0; width: 100%; }
  .ah-days { overflow-x: auto; grid-template-columns: repeat(7, minmax(4.4rem, 1fr)); }
  .ah-day strong { font-size: 1.25rem; }
  .ah-day.is-weekend strong { font-size: 1.1rem; }
  .ah-live { grid-template-columns: auto minmax(0, 1fr) auto; }
  .ah-live-time { font-size: 1.7rem; }
  .ah-live-stop { grid-column: 1 / -1; }
  .ah-entry { grid-template-columns: 1fr auto; }
  .ah-entry-acts { grid-column: 1 / -1; justify-content: flex-start; margin-left: -0.5rem; }
}


/* ---------- Del (shared links) ---------- */
.ah-share-intro h1 { font-size: 1.35rem; font-weight: 650; letter-spacing: -0.015em; margin: 0.5rem 0 0.25rem; }
.ah-share-intro .ah-sub { max-width: 64ch; margin-bottom: 1.25rem; }
.ah-share-form { display: flex; flex-direction: column; gap: 1rem; }
.ah-field > span em { font-style: normal; opacity: 0.75; }
.ah-share-period { display: grid; grid-template-columns: minmax(0, 1fr) 11rem 11rem; gap: 0.75rem; align-items: end; }
.ah-seg-btns { display: flex; flex-wrap: wrap; gap: 0.35rem; align-self: end; padding-bottom: 0.15rem; }
.ah-seg-btns button {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px;
  height: 2.2rem; padding: 0 0.85rem; cursor: pointer; font-size: 0.88rem; font-weight: 500;
}
.ah-seg-btns button:hover { color: var(--ink); border-color: var(--muted); }
.ah-seg-btns button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.ah-share-form > .ah-sub { margin: -0.4rem 0 0; }
.ah-share-opts { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.ah-check { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.93rem; }
.ah-check input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); margin: 0; }
.ah-share-form .ah-actions { margin-top: 0; }

.ah-share-list { margin-top: 2rem; }
.ah-share-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center;
  padding: 1rem 0.25rem; border-bottom: 1px solid var(--line);
}
.ah-share-item.is-fresh { background: var(--accent-soft); border-radius: var(--radius-lg); padding-left: 1rem; padding-right: 0.75rem; border-bottom-color: transparent; }
.ah-share-main { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.ah-share-main strong { font-weight: 600; }
.ah-share-main > span { color: var(--muted); font-size: 0.9rem; }
.ah-share-main .ah-share-meta { font-size: 0.8rem; }
.ah-share-url {
  margin-top: 0.4rem; width: 100%; max-width: 40rem; border: 1px dashed var(--field-line, var(--line)); border-radius: var(--radius-sm);
  background: transparent; padding: 0.35rem 0.6rem; font-size: 0.82rem; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ah-share-acts { display: flex; gap: 0.4rem; align-items: center; }
.ah-share-acts .ah-btn { height: 2.25rem; padding: 0 0.9rem; }
.ah-share-item.is-revoked { opacity: 0.6; }
.ah-share-old { margin-top: 1.25rem; }
.ah-share-old summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; padding: 0.4rem 0.25rem; }

/* The public page a client sees. */
.ah-share { max-width: 1040px; }
.ah-share-kicker { margin: 0.5rem 0 0.1rem; color: var(--accent); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; }
.ah-share-title { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 0.75rem; }
.ah-break-row.is-static { cursor: default; }
.ah-break-row.is-static:hover { background: none; }
.ah-table tfoot td { font-weight: 650; border-top: 1px solid var(--ink); border-bottom: 0; }
.ah-share-foot { color: var(--muted); font-size: 0.82rem; margin-top: 1.5rem; }

@media (max-width: 720px) {
  .ah-share-period { grid-template-columns: 1fr 1fr; }
  .ah-seg-btns { grid-column: 1 / -1; }
  .ah-share-item { grid-template-columns: 1fr; }
  .ah-share-acts { flex-wrap: wrap; }
}

/* ---------- Admin: viewing another employee ---------- */
.ah-who { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }
.ah-who select {
  border: 1px solid var(--field-line, var(--line)); border-radius: 999px; background: var(--surface); color: var(--ink);
  height: 2rem; padding: 0 0.75rem; font-weight: 600; max-width: 16rem;
}
.ah-who-note {
  margin: 0 0 0.75rem; padding: 0.55rem 0.8rem; border-radius: var(--radius-sm); font-size: 0.9rem;
  background: var(--run-soft); color: var(--ink); border-left: 3px solid var(--run);
}
.ah-who-note[hidden] { display: none; }
.ah-who-note .ah-link { padding: 0 0.25rem; color: var(--ink); text-decoration: underline; }
.is-other .ah-form { border-color: var(--run); }
