/*
 * Fælles udseende for hele siden (UI/Projektstyring UI.pdf).
 * Farver og afstande er variabler herunder - ret dem her, så ændres hele siden.
 * Modul-specifik styling kan lægges i egne filer under assets/css/.
 */

@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Flader og tekst (lys tilstand) */
    --bg: #f6f7f9;              /* baggrund bag paneler */
    --sidebar-bg: #fbfbfc;
    --surface: #ffffff;         /* paneler og kort */
    --surface-2: #f3f4f6;
    --text: #18181b;
    --text-2: var(--text-2);          /* sekundær tekst */
    --muted: #6b7080;
    --faint: var(--faint);
    --line: #e6e7eb;
    --line-strong: #d4d6dc;
    --hover: #f0f1f4;
    --active: #eceffd;          /* aktivt menupunkt/fane */
    --icon: #52525b;
    --input-bg: #ffffff;
    --topbar-bg: rgba(246, 247, 249, .85);
    --backdrop: rgba(24, 24, 27, .35);
    --mix-base: #ffffff;        /* basen, projektfarver blandes med (lyse toner) */
    --on-strong: #ffffff;       /* tekst på mørk/stærk baggrund */

    /* Accent (knapper, links, aktiv fane) */
    --accent: #3b55e6;
    --accent-hover: #2f47d0;
    --accent-ink: #ffffff;
    --accent-soft: #eef0fd;
    --link: #2f4bd6;

    /* Statusfarver (pills, beskeder) */
    --ok: #e7f6ec;      --ok-ink: #1a7f3c;
    --warn: #fdf0e3;    --warn-ink: #b4580a;
    --error: #fde8e8;   --error-ink: #c22727;
    --neutral: #f0f1f3; --neutral-ink: #52525b;
    --info: #eef0fd;    --info-ink: #2f4bd6;
    --status-border: #a1a1aa;
    --risk-soft: var(--risk-soft); --risk-line: var(--risk-line); --risk-fill: var(--risk-fill);
    --other-month: #fafafb;
    --banner-bg: #fde68a; --banner-ink: #713f12;

    /* Projektfarver (prikker og bjælker) */
    --project-blue: #5b6cf0;
    --project-orange: #e8892c;
    --project-teal: #26a69a;
    --project-magenta: #c25bc2;
    --project-gray: #8b8f99;

    --radius: 12px;
    --radius-sm: 7px;
    --sidebar-width: 252px;
    --topbar-height: 56px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
    --shadow-hover: 0 6px 16px rgba(16, 24, 40, .09);
    --shadow-lg: 0 16px 40px rgba(16, 24, 40, .18);
    color-scheme: light;

    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    -webkit-text-size-adjust: 100%;
}

/* Mørk tilstand: valgt med knappen (data-theme="dark"), eller enhedens indstilling, når intet er valgt. */
:root[data-theme="dark"] {
    --bg: #0f1115;
    --sidebar-bg: #13161b;
    --surface: #181b21;
    --surface-2: #20242c;
    --text: #e8eaef;
    --text-2: #c4c8d1;
    --muted: #959cab;
    --faint: #5b6170;
    --line: #2a2f38;
    --line-strong: #3a414d;
    --hover: #222730;
    --active: #232b45;
    --icon: #aab0bd;
    --input-bg: #13161b;
    --topbar-bg: rgba(15, 17, 21, .85);
    --backdrop: rgba(0, 0, 0, .55);
    --mix-base: #181b21;
    --on-strong: #0f1115;
    --accent: #5068f0;
    --accent-hover: #6178f3;
    --accent-ink: #ffffff;
    --accent-soft: #1f2746;
    --link: #93a5ff;
    --ok: #13301f;      --ok-ink: #63d394;
    --warn: #3a2a12;    --warn-ink: #f2a957;
    --error: #3d1a1a;   --error-ink: #ff8a8a;
    --neutral: #262a33; --neutral-ink: #b9bfcb;
    --info: #1f2746;    --info-ink: #a3b1ff;
    --status-border: #6b7280;
    --risk-soft: #2a1616; --risk-line: #5c2a2a; --risk-fill: #7a3434;
    --other-month: #14171c;
    --banner-bg: #4a3b0c; --banner-ink: #fde68a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-hover: 0 6px 18px rgba(0, 0, 0, .45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0f1115;
        --sidebar-bg: #13161b;
        --surface: #181b21;
        --surface-2: #20242c;
        --text: #e8eaef;
        --text-2: #c4c8d1;
        --muted: #959cab;
        --faint: #5b6170;
        --line: #2a2f38;
        --line-strong: #3a414d;
        --hover: #222730;
        --active: #232b45;
        --icon: #aab0bd;
        --input-bg: #13161b;
        --topbar-bg: rgba(15, 17, 21, .85);
        --backdrop: rgba(0, 0, 0, .55);
        --mix-base: #181b21;
        --on-strong: #0f1115;
        --accent: #5068f0;
        --accent-hover: #6178f3;
        --accent-ink: #ffffff;
        --accent-soft: #1f2746;
        --link: #93a5ff;
        --ok: #13301f;      --ok-ink: #63d394;
        --warn: #3a2a12;    --warn-ink: #f2a957;
        --error: #3d1a1a;   --error-ink: #ff8a8a;
        --neutral: #262a33; --neutral-ink: #b9bfcb;
        --info: #1f2746;    --info-ink: #a3b1ff;
        --status-border: #6b7280;
        --risk-soft: #2a1616; --risk-line: #5c2a2a; --risk-fill: #7a3434;
        --other-month: #14171c;
        --banner-bg: #4a3b0c; --banner-ink: #fde68a;
        --shadow: 0 1px 2px rgba(0, 0, 0, .35);
        --shadow-hover: 0 6px 18px rgba(0, 0, 0, .45);
        --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--link); }
img, svg { vertical-align: middle; }
.icon { flex-shrink: 0; }

h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 16px; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 28px 0 12px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
.muted { color: var(--muted); font-size: .9rem; }
code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .88em; }

/* ---------- Tilgængelighed ---------- */
.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;
}
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--text); color: var(--on-strong); padding: 8px 12px; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.test-banner {
    position: sticky; top: 0; z-index: 60;
    background: var(--banner-bg); color: var(--banner-ink); text-align: center;
    font-size: .85rem; font-weight: 600; padding: 4px 12px;
}

/* ---------- App-skal: sidebar + hovedkolonne ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-width); flex-shrink: 0;
    background: var(--sidebar-bg); border-right: 1px solid var(--line);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    padding: 14px 12px calc(12px + env(safe-area-inset-bottom));
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 16px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name { color: var(--text); font-weight: 650; text-decoration: none; }

.sidebar-nav { flex: 1; }
.nav-heading { margin: 18px 10px 6px; font-size: .78rem; color: var(--muted); font-weight: 500; }
.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-item {
    display: flex; align-items: center; gap: 10px; min-height: 36px;
    padding: 6px 10px; border-radius: 8px;
    color: var(--text-2); text-decoration: none; font-size: .93rem;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.is-active { background: var(--active); color: var(--link); font-weight: 600; }
.nav-item.is-active .icon { color: var(--link); }
.nav-item .icon { color: var(--icon); }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge {
    background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 600;
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
}
.dot { width: 9px; height: 9px; border-radius: 3px; background: var(--dot, var(--project-gray)); flex-shrink: 0; display: inline-block; }

.user-card { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 14px 6px 2px; margin-top: 16px; }
.user-text { flex: 1; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { color: var(--muted); font-size: .78rem; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 12px;
    min-height: var(--topbar-height); padding: 8px 24px;
    background: var(--topbar-bg); backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
}
.breadcrumbs { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; font-size: .93rem; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--text); }
.crumb-sep { color: var(--line-strong); }
.crumb-current { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb-sub { color: var(--muted); margin-left: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.content { padding: 28px 24px 64px; width: 100%; max-width: 1280px; }

/* Mobilmenu (checkbox + labels, virker uden JavaScript) */
.nav-open { position: fixed; top: 10px; left: 10px; width: 1px; height: 1px; opacity: 0; }
/* .icon-button står længere nede og ville ellers vise knapperne på store skærme. */
.icon-button.nav-toggle, .icon-button.nav-close, .nav-backdrop { display: none; }
.nav-open:focus-visible ~ .main-col .nav-toggle { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 899px) {
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; height: auto;
        transform: translateX(-105%); transition: transform .2s ease;
        box-shadow: var(--shadow-lg); padding-top: calc(14px + env(safe-area-inset-top));
    }
    .nav-open:checked ~ .sidebar { transform: none; }
    .nav-open:checked ~ .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: var(--backdrop); }
    .icon-button.nav-toggle, .icon-button.nav-close { display: inline-grid; }
    .nav-close { margin-left: auto; }
    .topbar { padding: calc(8px + env(safe-area-inset-top)) 12px 8px; }
    .content { padding: 20px 16px calc(48px + env(safe-area-inset-bottom)); }
    .topbar-actions .btn span { display: none; } /* kun ikon på smalle skærme */
}
@media (min-width: 900px) {
    .nav-open { display: none; }
}

/* ---------- Offentlige sider (login, opsætning) ---------- */
.public-main { max-width: 440px; margin: 0 auto; padding: 48px 16px; }
.public-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 24px; color: var(--text); font-weight: 650; text-decoration: none; font-size: 1.05rem; }
.public-main .card { max-width: none !important; }

/* ---------- Knapper ---------- */
.btn, .button, button.primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 38px; padding: 8px 14px; border-radius: 8px;
    border: 1px solid transparent; font: inherit; font-size: .9rem; font-weight: 550;
    text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn-primary, .button, button.primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover, .button:hover, button.primary:hover { background: var(--accent-hover); }
.btn-secondary, .button.secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover, .button.secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--surface); color: var(--error-ink); border-color: var(--line-strong); }
.btn-danger:hover { background: var(--error); }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: .82rem; }
button.primary { margin-top: 16px; }
.icon-button {
    display: inline-grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0;
    border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-button:hover { background: var(--hover); color: var(--text); }
.link, nav a.link { color: var(--link); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.link:hover { text-decoration: underline; }
form.inline { display: inline; margin: 0; }

/* ---------- Kort, paneler og layoutgitter ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.panel-head a { font-size: .88rem; text-decoration: none; }
.panel-body { padding: 0 16px 16px; }
.panel-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 1099px) { .grid-main { grid-template-columns: minmax(0, 1fr); } }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- Pills, chips, faner ---------- */
.pill, .badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .76rem; font-weight: 600; padding: 2px 9px; border-radius: 999px;
    background: var(--neutral); color: var(--neutral-ink); white-space: nowrap;
}
.pill-ok, .badge.published { background: var(--ok); color: var(--ok-ink); }
.pill-warn, .badge.hidden { background: var(--warn); color: var(--warn-ink); }
.pill-error { background: var(--error); color: var(--error-ink); }
.pill-info { background: var(--info); color: var(--info-ink); }
.pill-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 12px;
    border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface);
    color: var(--text); text-decoration: none; font-size: .88rem;
}
.chip:hover { background: var(--surface-2); }
.chip.is-active { background: var(--text); border-color: var(--text); color: var(--on-strong); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab {
    display: inline-flex; align-items: center; gap: 6px; padding: 10px 10px; margin-bottom: -1px;
    color: var(--muted); text-decoration: none; font-size: .92rem; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); font-weight: 550; border-bottom-color: var(--text); }
.tab-count { color: var(--muted); font-size: .78rem; }

.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 9px; }
.segmented a { padding: 5px 12px; border-radius: 7px; color: var(--muted); text-decoration: none; font-size: .88rem; }
.segmented a.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 550; }

/* ---------- Avatarer ---------- */
.avatar {
    --avatar-hue: 230;
    width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
    display: inline-grid; place-items: center;
    font-size: .66rem; font-weight: 700; letter-spacing: .02em;
    background: hsl(var(--avatar-hue) 70% 92%); color: hsl(var(--avatar-hue) 45% 32%);
}
.avatar-dark { background: var(--text); color: var(--on-strong); }
.avatar-lg { width: 32px; height: 32px; font-size: .75rem; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ---------- Opgave-ikoner: status og prioritet ---------- */
.status-icon { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; display: inline-block; border: 1.5px solid var(--status-border); }
.status-backlog { border-style: dashed; }
.status-in_progress { border-color: #d9730d; background: linear-gradient(90deg, transparent 50%, #d9730d 50%); box-shadow: inset 0 0 0 2px var(--surface); }
.status-review { border-color: var(--accent); background: conic-gradient(var(--accent) 0 75%, transparent 75% 100%); box-shadow: inset 0 0 0 2px var(--surface); }
.status-done { border-color: var(--ok-ink); background: var(--ok-ink); box-shadow: inset 0 0 0 3px var(--surface); }

.prio-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.prio-bars i { width: 3px; border-radius: 1px; background: var(--line-strong); }
.prio-bars i:nth-child(1) { height: 5px; }
.prio-bars i:nth-child(2) { height: 8px; }
.prio-bars i:nth-child(3) { height: 12px; }
.prio-bars.p1 i:nth-child(-n+1), .prio-bars.p2 i:nth-child(-n+2), .prio-bars.p3 i:nth-child(-n+3), .prio-bars.p4 i { background: var(--text); }
.prio-bars.p4 i { background: var(--error-ink); }

.task-key { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .8rem; color: var(--muted); }
.is-overdue { color: var(--error-ink); font-weight: 600; }

/* ---------- Fremdriftsbjælke ---------- */
.progress { height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--text); border-radius: inherit; }

/* ---------- Beskeder ---------- */
.flash { padding: 10px 14px; border-radius: var(--radius-sm); margin: 0 0 16px; font-size: .92rem; }
.flash-ok { background: var(--ok); color: var(--ok-ink); }
.flash-warn { background: var(--warn); color: var(--warn-ink); }
.flash-error { background: var(--error); color: var(--error-ink); }
.empty-state { text-align: center; color: var(--muted); padding: 40px 16px; }

/* ---------- Formularer ---------- */
label { display: block; font-weight: 550; font-size: .9rem; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
    width: 100%; min-height: 42px; padding: 9px 11px;
    border: 1px solid var(--line-strong); border-radius: 8px;
    font: inherit; font-size: 16px; /* 16 px: iPhone zoomer ikke ind ved fokus */
    background: var(--input-bg); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
textarea { min-height: 160px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); vertical-align: -3px; margin-right: 6px; }
.check-label { display: flex; align-items: center; min-height: 44px; margin: 8px 0 4px; font-weight: 400; cursor: pointer; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 20px; }
.form-actions button.primary { margin-top: 0; }
.field-hint { color: var(--muted); font-weight: 400; }

/* ---------- Tabeller ---------- */
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .82rem; color: var(--muted); font-weight: 550; background: var(--sidebar-bg); }
.table-scroll { overflow-x: auto; }

.page-body p { margin: 0 0 1em; }

/* ---------- Redigeringsblyant (edit_link) - mindst 32 px, så den er let at ramme på mobil ---------- */
.edit-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; margin-left: 4px; border-radius: 6px;
    color: var(--muted); vertical-align: middle; text-decoration: none;
}
.edit-link:hover { color: var(--accent); background: var(--surface-2); }
.edit-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (pointer: coarse) { .edit-link { width: 44px; height: 44px; } }
/* Rødt kryds ved blyanten (K-61): sletter = skjuler, kan gendannes i Papirkurven. */
.delete-form { display: inline; margin: 0; }
.delete-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; margin-left: 2px; padding: 0; border: 0; border-radius: 6px;
    background: transparent; color: var(--error-ink); vertical-align: middle; cursor: pointer;
}
.delete-link:hover { color: var(--error-ink); background: var(--error); }
.delete-link:focus-visible { outline: 2px solid var(--error-ink); outline-offset: 2px; }
@media (pointer: coarse) { .delete-link { width: 44px; height: 44px; } }
.board-card-top .delete-link { width: 28px; height: 28px; margin: -6px -8px -6px 0; }
.title-row { display: flex; align-items: center; gap: 4px; }
.title-row h1 { margin: 0; }
.title-row + * { margin-top: 16px; }

/* =====================================================================
   Projektstyring (projects-modulet)
   ===================================================================== */

/* Projektliste */
.project-row { flex-wrap: wrap; }
.project-row:first-child { border-top: 0; }
.project-row-main { flex: 1 1 240px; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.project-row-name { color: var(--text); font-weight: 600; text-decoration: none; }
.project-row-name:hover { text-decoration: underline; }
.project-row-desc { flex-basis: 100%; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-row-period { min-width: 150px; }
.is-inactive { opacity: .6; }

/* Projektside: hoved og detaljer */
.project-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.project-head h1 { margin: 0; }
.project-head .title-row { flex-wrap: wrap; gap: 10px; }
.project-head .title-row + * { margin-top: 4px; }
.project-head p { margin: 4px 0 0; }
.project-head-text { min-width: 0; }
.project-tile {
    width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center;
    background: color-mix(in srgb, var(--dot) 14%, var(--mix-base)); color: var(--dot);
}
.details { display: grid; grid-template-columns: 110px 1fr; gap: 10px 12px; margin: 0; padding: 0 16px 16px; font-size: .9rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; display: flex; align-items: center; gap: 8px; min-width: 0; }

/* Formularer */
.form-card { max-width: 720px; }
.color-picker { border: 0; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.color-picker legend { font-weight: 550; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.color-option { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; min-height: 44px; }
.color-option input { margin: 0; }
.project-row-progress { display: inline-flex; align-items: center; gap: 8px; width: 140px; }
.project-row-progress .progress { flex: 1; }

/* Opgaverækker (Hjem, Mine opgaver, projektside) */
.task-row { gap: 12px; min-height: 52px; }
.task-row .task-key { width: 64px; flex-shrink: 0; }
.task-row-title { flex: 1 1 200px; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.task-row-title a { color: var(--text); text-decoration: none; font-weight: 500; }
.task-row-title a:hover { text-decoration: underline; }
.task-row-sub { flex-basis: 100%; color: var(--muted); font-size: .8rem; }
.task-row-status { width: 96px; font-size: .82rem; }
.task-row-project { display: inline-flex; align-items: center; gap: 6px; width: 170px; font-size: .85rem; color: var(--text-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.task-row-due { width: 70px; font-size: .85rem; text-align: left; }
.task-row.is-done .task-row-title a { color: var(--muted); }
.avatar-placeholder { width: 26px; flex-shrink: 0; }
@media (max-width: 699px) {
    .task-row { flex-wrap: wrap; gap: 6px 10px; }
    .task-row-title { flex-basis: calc(100% - 100px); order: -1; }
    .task-row-project, .task-row-status { width: auto; }
}

/* Statusfordeling på projektsiden */
.status-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.status-bar span { display: block; height: 100%; }
.status-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0; margin: 10px 0 0; font-size: .85rem; color: var(--text-2); }
.status-legend li { display: inline-flex; align-items: center; gap: 6px; }

/* Tavle */
.board-head { margin: -8px 0 20px; }
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 16px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.board-column { min-width: 0; border-radius: var(--radius); padding: 4px; transition: background .15s; }
.board-column.is-drop-target { background: var(--accent-soft); }
.board-column-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; }
.board-column-head h2 { margin: 0; font-size: .95rem; }
.board-column-head .icon-button { margin-left: auto; }
.board-cards { display: grid; gap: 10px; min-height: 60px; }
.board-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px 14px; box-shadow: var(--shadow); display: grid; gap: 8px; cursor: grab;
}
.board-card:hover { border-color: var(--line-strong); }
.board-card.is-dragging { opacity: .5; }
.board-card.is-done .board-card-title { color: var(--muted); }
.board-card-top { display: flex; align-items: center; gap: 8px; }
.board-card-top .prio-bars { margin-left: auto; }
.board-card-top .edit-link { width: 28px; height: 28px; margin: -6px -8px -6px 0; }
.board-card-title { color: var(--text); font-weight: 600; text-decoration: none; line-height: 1.35; }
.board-card-title:hover { text-decoration: underline; }
.board-card-blocked { justify-self: start; }
.board-card-meta { display: flex; align-items: center; gap: 10px; font-size: .82rem; flex-wrap: wrap; }
.board-card-project { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); margin-right: auto; min-width: 0; }
.board-card-move summary { cursor: pointer; color: var(--muted); font-size: .8rem; list-style: none; display: inline-block; padding: 2px 0; }
.board-card-move summary::-webkit-details-marker { display: none; }
.board-card-move summary::before { content: "⇄ "; }
.board-card-move form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
@media (max-width: 899px) { .board { grid-template-columns: repeat(4, minmax(78vw, 1fr)); scroll-snap-type: x mandatory; } .board-column { scroll-snap-align: start; } }

/* Opgaveside */
.comment { align-items: flex-start; }
.comment-meta { margin: 0 0 2px; font-size: .88rem; }
.comment-body { margin: 0; white-space: normal; }
.comment-form { flex-direction: column; align-items: stretch; }
.comment-form textarea { min-height: 90px; }
.comment-form .btn { align-self: flex-start; }
.move-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.done-list summary { cursor: pointer; list-style: none; }
.done-list summary::-webkit-details-marker { display: none; }

/* Hjem */
.pill-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 12px 12px; }
.pill-tab { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: .88rem; }
.pill-tab:hover { background: var(--surface-2); }
.pill-tab.is-active { background: var(--active); color: var(--text); font-weight: 550; }
.pill-tab-count { font-size: .72rem; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--line); color: var(--neutral-ink); display: inline-grid; place-items: center; }
.pill-tab.is-active .pill-tab-count { background: var(--text); color: var(--on-strong); }

.week { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 0 12px 12px; }
.week-day { background: var(--surface-2); border-radius: 8px; padding: 10px; min-height: 120px; display: grid; align-content: start; gap: 6px; }
.week-day.is-today { box-shadow: inset 0 0 0 2px var(--accent); }
.week-day-name { margin: 0 0 2px; font-size: .82rem; font-weight: 600; }
.week-item { display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; text-decoration: none; color: var(--text); font-size: .8rem; }
.week-item:hover { border-color: var(--line-strong); }
.week-item.is-risk { background: var(--error); border-color: var(--risk-line); color: var(--error-ink); }
.week-item-title { font-weight: 550; }
@media (max-width: 699px) { .week { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.attention, .activity { align-items: flex-start; }
.attention p, .activity p { margin: 0; font-size: .88rem; }
.attention a { font-size: .85rem; text-decoration: none; }
.attention-title { font-weight: 550; }
.attention-icon { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; display: grid; place-items: center; background: var(--warn); color: var(--warn-ink); }
.attention-icon.is-blocked { background: var(--error); color: var(--error-ink); }

.health { display: grid; gap: 6px; }
.health-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.health-head a { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 550; font-size: .92rem; }
.health-progress { display: flex; align-items: center; gap: 10px; }
.health-progress .progress { flex: 1; }
.health p { margin: 0; font-size: .8rem; }

/* Tidslinje */
.timeline-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.timeline-nav { display: flex; align-items: center; gap: 8px; }
.timeline-nav .icon-button { border: 1px solid var(--line-strong); background: var(--surface); }
.timeline-range { font-size: 1.15rem; margin: 0 0 0 8px; }
.timeline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.timeline-legend { list-style: none; display: flex; gap: 14px; margin: 0 8px 0 0; padding: 0; font-size: .8rem; color: var(--muted); }
.timeline-legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend-bar { width: 18px; height: 8px; border-radius: 3px; background: color-mix(in srgb, var(--project-blue) 55%, var(--mix-base)); }
.legend-diamond { width: 9px; height: 9px; background: var(--text); transform: rotate(45deg); }

.timeline-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.timeline { --label-w: 380px; position: relative; min-width: 1080px; }
.tl-row { display: grid; grid-template-columns: var(--label-w) 1fr; min-height: 44px; border-top: 1px solid var(--line); }
.tl-head { border-top: 0; background: var(--sidebar-bg); font-size: .8rem; }
.tl-label { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-right: 1px solid var(--line); min-width: 0; color: var(--muted); }
.tl-track { position: relative; display: block; min-width: 0;
    background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
    background-size: calc(100% / var(--weeks)) 100%; }
.tl-weeks { display: grid; grid-template-columns: repeat(var(--weeks), 1fr); background-image: none; }
.tl-week { padding: 8px 10px; border-left: 1px solid var(--line); display: grid; color: var(--muted); }
.tl-week strong { color: var(--text); font-weight: 600; }
.tl-week.is-current { background: var(--accent-soft); }
.tl-week.is-current strong { color: var(--accent); }

.tl-group > summary { list-style: none; cursor: pointer; background: var(--sidebar-bg); }
.tl-group > summary::-webkit-details-marker { display: none; }
.tl-group:not([open]) > summary .icon { transform: rotate(-90deg); }
.tl-project .tl-label { color: var(--text); font-weight: 600; }
.tl-project-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-span { position: absolute; top: 50%; height: 5px; margin-top: -2px; border-radius: 3px; background: color-mix(in srgb, var(--dot) 45%, var(--mix-base)); }

.tl-phase { padding-left: 38px; gap: 4px; color: var(--text); }
.tl-phase .edit-link, .tl-phase .delete-link { width: 26px; height: 26px; margin: 0; flex: none; }
.tl-phase-name { flex: 1; min-width: 0; color: var(--text); text-decoration: none; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-phase-name:hover { text-decoration: underline; }
.tl-dates { font-size: .75rem; white-space: nowrap; }

.tl-bar {
    position: absolute; top: 9px; bottom: 9px; border-radius: 5px; overflow: hidden; text-decoration: none;
    background: color-mix(in srgb, var(--dot) 18%, var(--mix-base)); display: flex; align-items: center;
}
.tl-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--dot) 55%, var(--mix-base)); }
.tl-bar-label { position: relative; padding: 0 8px; font-size: .75rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-bar.is-risk { background: var(--error); }
.tl-bar.is-risk .tl-bar-fill { background: var(--risk-fill); }
.tl-milestone { position: absolute; top: 50%; display: flex; align-items: center; gap: 8px; transform: translate(-6px, -50%); text-decoration: none; color: var(--text); white-space: nowrap; font-size: .78rem; font-weight: 600; }
.tl-diamond { width: 11px; height: 11px; background: var(--text); transform: rotate(45deg); flex-shrink: 0; }
.tl-milestone.is-risk { color: var(--error-ink); }
.tl-milestone.is-risk .tl-diamond { background: var(--error-ink); }
.tl-milestone.is-reached .tl-diamond { background: var(--ok-ink); }
.tl-today {
    position: absolute; top: 0; bottom: 0; width: 2px; pointer-events: none;
    left: calc(var(--label-w) + (100% - var(--label-w)) * var(--today)); background: var(--accent);
}

.timeline-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 16px; }
.timeline-card p { margin: 0 0 4px; }
.timeline-card-kicker { font-size: .8rem; color: var(--muted); }
.timeline-card-title { font-weight: 600; }
.timeline-card.is-risk { background: var(--risk-soft); border-color: var(--risk-line); }
.timeline-card.is-risk .timeline-card-kicker { color: var(--error-ink); }

/* Milepæle på projektsiden */
.milestones { list-style: none; display: flex; padding: 4px 16px 18px; margin: 0; overflow-x: auto; }
.milestone-step { flex: 1 1 0; min-width: 110px; position: relative; font-size: .82rem; }
.milestone-step::before { content: ""; position: absolute; top: 9px; left: 20px; right: 0; height: 2px; background: var(--line-strong); }
.milestone-step:last-child::before { display: none; }
.milestone-step.is-reached::before { background: var(--ok-ink); }
.milestone-dot { position: relative; z-index: 1; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line-strong); color: var(--on-strong); margin-bottom: 8px; }
.milestone-step.is-reached .milestone-dot { background: var(--ok-ink); border-color: var(--ok-ink); }
.milestone-step.is-next .milestone-dot { border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); background: var(--accent); }
.milestone-step.is-risk .milestone-dot { border-color: var(--error-ink); }
.milestone-step p { margin: 0; }
.milestone-step a { color: var(--text); text-decoration: none; font-weight: 600; }

/* Underprojekter (K-56) */
.project-row.is-child { padding-left: 40px; background: var(--sidebar-bg); }
.project-row.is-child .project-row-name::before { content: "↳ "; color: var(--muted); }
.subproject-row { flex-wrap: wrap; }
.subproject-row .project-row-name { flex: 1 1 160px; }

/* Opgavesiden pr. emne (K-57) */
.task-table-panel .panel-head h2 { display: flex; align-items: center; gap: 8px; }
.task-table-panel .panel-head h2 a { color: var(--text); text-decoration: none; }
.quick-add { display: grid; grid-template-columns: minmax(200px, 1fr) 170px 120px 160px auto; gap: 8px; padding: 0 16px 14px; align-items: center; }
@media (max-width: 899px) { .quick-add { grid-template-columns: 1fr 1fr; } .quick-add-title { grid-column: 1 / -1; } }
.task-table { border: 0; border-radius: 0; }
.task-table th, .task-table td { vertical-align: middle; padding: 8px 10px; }
.task-table select, .task-table input[type=date] { min-height: 36px; padding: 5px 8px; width: auto; min-width: 120px; }
.task-table-title { min-width: 220px; }
.task-table-title a { color: var(--text); font-weight: 500; text-decoration: none; margin-left: 6px; }
.task-table-title a:hover { text-decoration: underline; }
.task-table tr.is-done .task-table-title a { color: var(--muted); text-decoration: line-through; }
.task-table tr.is-saving { opacity: .55; }
.task-table input.is-overdue { color: var(--error-ink); border-color: var(--error-ink); font-weight: 600; }
.task-table-actions { white-space: nowrap; text-align: right; }
.task-table-actions form { display: inline; }
.has-autosave .autosave-button { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.has-autosave .autosave-button:focus { position: static; width: auto; height: auto; clip: auto; }

/* Kalender (K-58) */
.calendar-filter { display: flex; gap: 6px; align-items: center; }
.calendar-filter select { width: auto; min-height: 38px; padding: 6px 10px; }
.calendar-legend { margin: 0 0 12px; }
.cal-swatch { width: 14px; height: 10px; border-radius: 3px; background: var(--accent-soft); border-left: 3px solid var(--accent); }
.calendar {
    display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px;
}
.cal-weekday { background: var(--sidebar-bg); padding: 8px 10px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.cal-day { background: var(--surface); min-height: 118px; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.is-other-month { background: var(--other-month); }
.cal-day.is-other-month .cal-day-number { color: var(--faint); }
.cal-day-head { display: flex; align-items: center; justify-content: space-between; }
.cal-day-number { font-size: .82rem; font-weight: 600; padding: 2px 6px; border-radius: 6px; }
.cal-day.is-today .cal-day-number { background: var(--accent); color: var(--accent-ink); }
.cal-day-weekday { display: none; }
.cal-add { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); opacity: 0; }
.cal-day:hover .cal-add, .cal-add:focus { opacity: 1; }
.cal-add:hover { background: var(--surface-2); color: var(--text); }
@media (pointer: coarse) { .cal-add { opacity: 1; width: 36px; height: 36px; } }
.cal-item {
    display: flex; align-items: center; gap: 5px; min-width: 0;
    padding: 2px 6px; border-radius: 5px; font-size: .76rem; line-height: 1.35; color: var(--text); text-decoration: none;
}
.cal-item:hover { background: var(--surface-2); }
.cal-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-time { color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.cal-item.is-event { background: color-mix(in srgb, var(--dot) 12%, var(--mix-base)); border-left: 3px solid var(--dot); }
.cal-item.is-milestone { font-weight: 600; }
.cal-item.is-milestone .tl-diamond { width: 8px; height: 8px; }
.cal-item.is-milestone.is-risk { color: var(--error-ink); background: var(--error); }
.cal-item.is-milestone.is-risk .tl-diamond { background: var(--error-ink); }
.cal-item.is-milestone.is-reached .tl-diamond { background: var(--ok-ink); }
.cal-item.is-task.is-done .cal-text { text-decoration: line-through; color: var(--muted); }
.cal-item.is-task.is-overdue .cal-text { color: var(--error-ink); font-weight: 600; }
.calendar-empty { margin-top: 12px; }
@media (max-width: 699px) {
    .calendar { display: block; background: none; border: 0; }
    .cal-weekday, .cal-day:not(.has-items):not(.is-today) { display: none; }
    .cal-day { min-height: 0; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; padding: 10px; }
    .cal-day-weekday { display: inline; }
    .cal-item { font-size: .9rem; padding: 6px 8px; }
}
.week-item.is-event { border-left: 3px solid var(--accent); }


/* =====================================================================
   Udseende: dybde, detaljer og lys/mørk tilstand
   ===================================================================== */
body { transition: background-color .2s ease; }
.brand { padding: 6px 8px 18px; }
.brand-name, .public-brand {
    font-size: 1.2rem; font-weight: 750; letter-spacing: .02em; text-decoration: none; color: var(--text);
}
.sidebar { border-right-color: var(--line); }
.nav-item { transition: background-color .12s ease, color .12s ease; }
.topbar { border-bottom-color: var(--line); }
.page-head h1 { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; }
.panel, .card { border-color: var(--line); box-shadow: var(--shadow); }
.panel-head h2, .panel-head h3 { font-weight: 650; }
.btn-primary, .button, button.primary { box-shadow: 0 1px 2px rgba(16, 24, 40, .14), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn, .button, button.primary, .chip, .icon-button { transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease, transform .12s ease; }
.btn-primary:active, button.primary:active { transform: translateY(1px); }
.board-card, .week-item, .project-row { transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease; }
.board-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.week-item:hover { box-shadow: var(--shadow); }
.project-tile { border-radius: 12px; }
th { background: var(--sidebar-bg); }
input:hover, select:hover, textarea:hover { border-color: var(--status-border); }

/* Avatarer i mørk tilstand: mørkere baggrund, lysere bogstaver */
:root[data-theme="dark"] .avatar:not(.avatar-dark) { background: hsl(var(--avatar-hue) 35% 24%); color: hsl(var(--avatar-hue) 75% 82%); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .avatar:not(.avatar-dark) { background: hsl(var(--avatar-hue) 35% 24%); color: hsl(var(--avatar-hue) 75% 82%); }
}

/* Knap til lys/mørk tilstand: månen vises i lys tilstand, solen i mørk */
.theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-dark { display: none; }
:root[data-theme="dark"] .theme-icon-light { display: inline; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-icon-dark { display: none; }
    :root:not([data-theme="light"]) .theme-icon-light { display: inline; }
}

/* Offentlige sider (login, opret bruger) */
.public-main { padding-top: 56px; }
.public-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.public-main .card { padding: 28px; box-shadow: var(--shadow-hover); }

/* =====================================================================
   Forside (K-54, K-59): Denne uge, Alle opgaver, Seneste aktivitet
   ===================================================================== */
.js-only { display: none !important; }
.has-js .js-only { display: inline-flex !important; }
.has-js .js-hide { display: none; }
.dashboard-grid { grid-template-columns: minmax(0, 1fr) 340px; }
@media (max-width: 1099px) { .dashboard-grid { grid-template-columns: minmax(0, 1fr); } }

/* "Vis opgaver for" (én dropdown, der gælder Denne uge og Alle opgaver) */
.person-picker { display: flex; align-items: center; gap: 8px; }
.person-picker label { margin: 0; font-size: .88rem; font-weight: 550; color: var(--text-2); white-space: nowrap; }
.person-picker select { width: auto; min-width: 180px; min-height: 40px; font-weight: 550; }
@media (max-width: 699px) { .person-picker { width: 100%; } .person-picker select { flex: 1; min-width: 0; } }

/* Denne uge */
.week.week-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
/* Lange ord (fx "kravspecifikation") brydes i stedet for at stikke ud af den smalle dagkolonne. */
.week.week-7 { gap: 6px; padding: 0 10px 10px; }
.week-7 .week-item { min-width: 0; padding: 6px 7px; font-size: .75rem; }
/* Orddeling med bindestreg, hvor browseren kan; ellers brydes et ord kun, hvis det ikke kan være på linjen. */
.week-7 .week-item-title { overflow-wrap: anywhere; hyphens: auto; -webkit-hyphens: auto; }
.week-7 .week-day { min-height: 140px; padding: 6px; }
.week-day.is-weekend { background: var(--other-month); }
.week-task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 2px; }
.week-task-meta .muted { white-space: nowrap; }
.week-task-meta .avatar { width: 20px; height: 20px; font-size: .58rem; margin-left: auto; }
.week-task-meta .pill { margin-left: auto; font-size: .66rem; padding: 0 6px; }
.week-item.is-done .week-item-title { text-decoration: line-through; color: var(--muted); }
/* Med aktivitetsskinnen til højre er der kun plads til 7 dagkolonner på meget brede skærme. */
@media (max-width: 1599px) { .week.week-7 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 699px) { .week.week-7 { grid-template-columns: 1fr; } .week-7 .week-day { min-height: 0; } }

/* Alle opgaver: filtre og handlinger */
.task-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 0 16px 12px; }
.filter-menu { position: relative; }
.filter-menu > summary { list-style: none; }
.filter-menu > summary::-webkit-details-marker { display: none; }
.filter-groups {
    position: absolute; z-index: 15; top: calc(100% + 6px); left: 0; min-width: 520px;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px 16px;
}
.filter-groups fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.filter-groups legend { font-weight: 600; font-size: .82rem; margin-bottom: 6px; padding: 0; }
.filter-groups label { font-weight: 400; font-size: .88rem; margin: 0; padding: 4px 0; display: flex; align-items: center; gap: 2px; }
@media (max-width: 699px) { .filter-groups { position: static; min-width: 0; grid-template-columns: 1fr; margin-top: 8px; box-shadow: none; } .filter-menu { flex-basis: 100%; } }
.inline-field { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: .88rem; font-weight: 500; color: var(--text-2); }
.inline-field select { width: auto; min-height: 34px; padding: 4px 8px; font-size: .88rem; }
.inline-field input[type=checkbox] { margin: 0; }

.bulk-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
    padding: 10px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--sidebar-bg);
    position: sticky; top: var(--topbar-height); z-index: 10;
}
.bulk-select-all { margin: 0; font-size: .85rem; font-weight: 500; align-items: center; gap: 4px; }
.bulk-count { font-size: .82rem; margin-right: 4px; }
.bulk-group { display: inline-flex; gap: 4px; align-items: center; }
.bulk-group select { width: auto; min-height: 30px; padding: 3px 6px; font-size: .82rem; }
.bulk-bar .btn:disabled { opacity: .45; cursor: not-allowed; }

.dash-group-head { display: flex; align-items: center; gap: 8px; margin: 0; padding: 14px 16px 6px; font-size: .92rem; font-weight: 650; cursor: default; list-style: none; }
.dash-group-head::-webkit-details-marker { display: none; }
.dash-task {
    display: grid; grid-template-columns: auto auto minmax(0, 1fr) 140px auto; align-items: center; gap: 4px 12px;
    padding: 10px 16px; border-top: 1px solid var(--line); transition: background-color .12s ease;
}
.dash-task:hover { background: var(--hover); }
.dash-task.is-selected { background: var(--active); }
.dash-check { margin: 0; }
.dash-task-main { min-width: 0; }
.dash-task-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.dash-task-title a { color: var(--text); font-weight: 550; text-decoration: none; }
.dash-task-title a:hover { text-decoration: underline; }
.dash-task.is-done .dash-task-title a { color: var(--muted); text-decoration: line-through; }
.dash-task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: .8rem; margin-top: 3px; }
.dash-task-meta .icon { vertical-align: -2px; }
.dash-task-project { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.dash-task-who { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .85rem; }
.dash-task-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-task.is-mine .dash-task-name { font-weight: 600; }
.dash-task-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
@media (max-width: 799px) {
    .dash-task { grid-template-columns: auto auto minmax(0, 1fr); }
    .dash-task-who { grid-column: 3; }
    .dash-task-actions { grid-column: 1 / -1; justify-content: flex-start; padding-left: 42px; }
}

/* Seneste aktivitet */
/* Fra 1100 px er Seneste aktivitet en fast skinne helt ude ved højre skærmkant (som et spejl af sidebaren):
   fuld højde under topbaren og egen rullebjælke. Indholdet får plads ved siden af. Smallere: under opgaverne. */
:root { --activity-width: 360px; --banner-height: 0px; }
body:has(.test-banner) { --banner-height: 26px; }
@media (min-width: 1100px) {
    .content:has(.dashboard-grid) { max-width: none; padding-right: calc(var(--activity-width) + 28px); }
    .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
    .dashboard-grid > aside {
        position: fixed; z-index: 15; right: 0; bottom: 0; width: var(--activity-width);
        top: calc(var(--topbar-height) + var(--banner-height));
        overflow-y: auto; background: var(--sidebar-bg); border-left: 1px solid var(--line);
    }
    .activity-panel { margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
    .activity-panel .panel-head { position: sticky; top: 0; z-index: 1; background: var(--sidebar-bg); border-bottom: 1px solid var(--line); }
    .activity-panel .activity-line:first-of-type { border-top: 0; }
}
.activity-line { display: flex; gap: 10px; align-items: flex-start; padding: 10px 16px; border-top: 1px solid var(--line); }
.activity-line p { margin: 0; font-size: .86rem; line-height: 1.4; }
.activity-line a { color: var(--text); font-weight: 500; text-decoration: none; }
.activity-line a:hover { text-decoration: underline; color: var(--link); }
.activity-detail { color: var(--text-2); font-style: italic; }
.activity-group > summary { cursor: pointer; border-top: 1px solid var(--line); background: var(--sidebar-bg); padding: 10px 16px; }

/* =====================================================================
   Logbog (logbook-modulet, K-60)
   ===================================================================== */
.log-filters { display: grid; grid-template-columns: minmax(180px, 2fr) repeat(4, minmax(130px, 1fr)) auto; gap: 0 12px; align-items: end; }
.log-filters label { margin-top: 0; }
.log-filter-actions { display: flex; gap: 6px; }
@media (max-width: 899px) { .log-filters { grid-template-columns: 1fr 1fr; } .log-filters > div:first-child { grid-column: 1 / -1; } }
.log-export { margin-top: 24px; }
.log-export .panel-head h2 { display: flex; align-items: center; gap: 8px; }
.log-export-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.log-month { margin: 28px 0 10px; font-size: 1rem; color: var(--muted); font-weight: 600; text-transform: capitalize; }
.log-entry { scroll-margin-top: calc(var(--topbar-height) + 16px); }
.log-entry:target { box-shadow: 0 0 0 2px var(--accent); }
.log-entry-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 10px; }
.log-entry-date {
    width: 48px; flex-shrink: 0; text-align: center; border-radius: 10px; padding: 6px 0;
    background: var(--accent-soft); color: var(--link); line-height: 1.1;
}
.log-day { display: block; font-size: 1.25rem; font-weight: 700; }
.log-mon { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.log-entry-title { flex: 1; min-width: 0; }
.log-entry-title h3 { margin: 0 0 4px; font-size: 1.05rem; }
.log-entry-title p { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.log-body { line-height: 1.6; overflow-wrap: break-word; color: var(--text); }
.log-body-details > summary { list-style: none; cursor: pointer; }
.log-body-details > summary::-webkit-details-marker { display: none; }
.log-body-details[open] > summary .log-body { display: none; }
.log-more { display: inline-block; margin-top: 6px; color: var(--link); font-size: .88rem; font-weight: 500; }
.log-more-open, .log-body-details[open] .log-more-closed { display: none; }
.log-body-details[open] .log-more-open { display: inline; }
.log-textarea { min-height: 320px; line-height: 1.6; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 24px 0; }

/* Prioritet, status og fremdrift (K-52). Farverne genbruger statusvariablerne, så mørk tilstand følger med.
   Kritisk = rød, Høj = orange, Mellem = blå, Lav = grå. Teksten står altid ved siden af farven. */
.prio-pill, .status-pill {
    display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px;
    font-size: .75rem; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.prio-1 { --prio-bg: var(--neutral); --prio-ink: var(--neutral-ink); }
.prio-2 { --prio-bg: var(--info);    --prio-ink: var(--info-ink); }
.prio-3 { --prio-bg: var(--warn);    --prio-ink: var(--warn-ink); }
.prio-4 { --prio-bg: var(--error);   --prio-ink: var(--error-ink); }
.prio-pill { background: var(--prio-bg); color: var(--prio-ink); }
.prio-pill .prio-bars i, .prio-compact .prio-bars i { background: color-mix(in srgb, var(--prio-ink) 30%, transparent); }
:is(.prio-pill, .prio-compact) .prio-bars.p1 i:nth-child(-n+1),
:is(.prio-pill, .prio-compact) .prio-bars.p2 i:nth-child(-n+2),
:is(.prio-pill, .prio-compact) .prio-bars.p3 i:nth-child(-n+3),
:is(.prio-pill, .prio-compact) .prio-bars.p4 i { background: var(--prio-ink); }
.prio-compact { display: inline-flex; }
/* Farvet venstrekant på rækker og kort efter prioritet */
.prio-edge-1 { box-shadow: inset 3px 0 0 var(--line-strong); }
.prio-edge-2 { box-shadow: inset 3px 0 0 var(--info-ink); }
.prio-edge-3 { box-shadow: inset 3px 0 0 var(--warn-ink); }
.prio-edge-4 { box-shadow: inset 3px 0 0 var(--error-ink); }
.board-card.prio-edge-1, .board-card.prio-edge-2, .board-card.prio-edge-3, .board-card.prio-edge-4 { border-left-width: 3px; box-shadow: var(--shadow); }
.board-card.prio-edge-2 { border-left-color: var(--info-ink); }
.board-card.prio-edge-3 { border-left-color: var(--warn-ink); }
.board-card.prio-edge-4 { border-left-color: var(--error-ink); }
/* Tabelrækker kan ikke have skygge i alle browsere - kanten lægges på første celle. */
.task-table tr[class*="prio-edge-"] { box-shadow: none; }
.task-table tr.prio-edge-1 td:first-child { box-shadow: inset 3px 0 0 var(--line-strong); }
.task-table tr.prio-edge-2 td:first-child { box-shadow: inset 3px 0 0 var(--info-ink); }
.task-table tr.prio-edge-3 td:first-child { box-shadow: inset 3px 0 0 var(--warn-ink); }
.task-table tr.prio-edge-4 td:first-child { box-shadow: inset 3px 0 0 var(--error-ink); }

.status-pill-backlog     { background: var(--neutral); color: var(--neutral-ink); }
.status-pill-in_progress { background: var(--warn);    color: var(--warn-ink); }
.status-pill-review      { background: var(--info);    color: var(--info-ink); }
.status-pill-done        { background: var(--ok);      color: var(--ok-ink); }

.task-progress { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.task-progress .progress { width: 56px; }
.task-progress .progress > span { background: var(--accent); }
.task-progress-value { min-width: 2.6em; font-variant-numeric: tabular-nums; }

.progress-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.progress-form .progress-lg { flex-basis: 100%; height: 10px; }
.progress-form .progress-lg > span { background: var(--accent); transition: width .1s linear; }
.progress-form input[type=range] { flex: 1 1 180px; min-height: 44px; accent-color: var(--accent); }
.progress-number { display: inline-flex; align-items: center; gap: 4px; }
.progress-number input { width: 5.5em; }

.comment-form-date { display: flex; align-items: center; gap: 10px; }
.comment-form-date label { margin: 0; }
.comment-form-date input { width: auto; }
.comment-main { flex: 1; min-width: 0; }
.check-label-sm { min-height: 32px; margin: 6px 0 0; font-size: .88rem; }
@media (pointer: coarse) { .check-label-sm { min-height: 44px; } }

/* Denne uge / måned (K-54): "Uge | Måned", bladring og "Vis for" i panelets hoved. */
.week-head { flex-wrap: wrap; gap: 8px 16px; }
.week-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-left: auto; }
.week-controls .icon-button { border: 1px solid var(--line-strong); background: var(--surface); }
.week-controls .person-picker select { min-width: 140px; min-height: 36px; }
.week-controls .segmented a { min-height: 32px; display: inline-flex; align-items: center; }
@media (pointer: coarse) { .week-controls .segmented a { min-height: 44px; } }
.week.week-month { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.week-month .week-day { min-height: 110px; }
.week-month .week-day.is-other-month { opacity: .55; }
.week-month-weekday { margin: 0; font-size: .75rem; font-weight: 600; color: var(--muted); text-align: center; }
.week-month .week-day-name { font-weight: 500; color: var(--text-2); }
.week-month .week-day.is-today .week-day-name { color: var(--accent); font-weight: 700; }
.week-item.prio-edge-1, .week-item.prio-edge-2, .week-item.prio-edge-3, .week-item.prio-edge-4 { box-shadow: none; border-left-width: 3px; }
.week-item.prio-edge-2 { border-left-color: var(--info-ink); }
.week-item.prio-edge-3 { border-left-color: var(--warn-ink); }
.week-item.prio-edge-4 { border-left-color: var(--error-ink); }
@media (max-width: 1599px) { .week.week-7.week-month { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
@media (max-width: 899px) {
    .week.week-7.week-month { grid-template-columns: 1fr; }
    .week-month-weekday, .week-month .week-day.is-other-month { display: none; }
    .week-month .week-day:not(:has(.week-item)) { display: none; }
    .week-month .week-day.is-today { display: grid; }
}
.filter-groups .status-pill, .filter-groups .prio-pill { margin-left: 4px; }
.bulk-bar input[type=date] { width: auto; min-height: 34px; }

/* Review-indbakke og "Kræver din opmærksomhed" (K-63) */
.review-list { display: grid; gap: 12px; }
.review-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; }
.panel .review-card { border-width: 0 0 1px; border-radius: 0; }
.review-card.needs-action { box-shadow: inset 3px 0 0 var(--accent); }
.review-head { display: grid; gap: 4px; }
.review-task { margin: 0; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.review-task a { color: var(--text); text-decoration: none; }
.review-task a:hover { text-decoration: underline; }
.review-route { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .9rem; }
.review-route .status-pill { margin-left: auto; }
.review-thread { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--line); display: grid; gap: 10px; }
.review-meta { margin: 0; font-size: .82rem; }
.review-message { margin: 2px 0 0; white-space: normal; overflow-wrap: anywhere; }
.review-event-close .review-meta, .review-event-withdraw .review-meta { color: var(--muted); }
.review-form { display: grid; gap: 6px; }
.review-form label { margin: 0; }
.review-form textarea { min-height: 70px; }
.review-form .btn, .review-send .btn { justify-self: start; }
.review-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.review-send { flex-direction: column; align-items: stretch; gap: 8px; }
.review-send-to { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.review-send-to label { margin: 0; }
.review-send-to select { width: auto; min-width: 160px; }
.review-send textarea { min-height: 70px; }
.attention-row { gap: 10px; color: var(--text); text-decoration: none; }
.attention-row:hover { background: var(--hover); }
.attention-text { flex: 1; min-width: 0; font-size: .9rem; }
.attention-task { font-weight: 600; }

/* Interaktiv Gantt (K-55): "+ fase" pr. projekt, farveprikker, træk i bjælker og kanter. */
.tl-add { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin-left: auto; border-radius: 6px; color: var(--muted); }
.tl-add:hover { color: var(--accent); background: var(--surface-2); }
.tl-colors { position: relative; flex: none; }
.tl-colors > summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 6px; cursor: pointer; }
.tl-colors > summary::-webkit-details-marker { display: none; }
.tl-colors > summary:hover { background: var(--surface-2); }
.tl-colors > summary .dot { width: 12px; height: 12px; }
.tl-color-menu { position: absolute; z-index: 5; top: 30px; right: 0; display: flex; gap: 6px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); }
.tl-color-menu button { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid var(--surface); background: var(--dot, var(--surface-2)); box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; }
.tl-color-menu button.is-active { box-shadow: 0 0 0 2px var(--text); }
.tl-color-menu .tl-color-default { background: repeating-linear-gradient(45deg, var(--surface-2) 0 4px, var(--line-strong) 4px 6px); }
@media (pointer: coarse) { .tl-color-menu button { width: 36px; height: 36px; } }
.has-js .tl-bar[data-phase], .has-js .tl-milestone[data-phase] { cursor: grab; touch-action: pan-y; }
.tl-bar.is-dragging, .tl-milestone.is-dragging { cursor: grabbing; opacity: .85; outline: 2px dashed var(--accent); outline-offset: 2px; z-index: 3; }
.tl-handle { display: none; position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 2; }
.has-js .tl-handle { display: block; }
.tl-handle-start { left: 0; }
.tl-handle-end { right: 0; }
.tl-handle:hover { background: color-mix(in srgb, var(--dot) 70%, transparent); }
@media (pointer: coarse) { .tl-handle { display: none !important; } }
.timeline-hint { margin: 8px 0 0; font-size: .82rem; }

/* Faser i kalenderen (K-58): farvede bånd over de dage, fasen dækker. */
.cal-phase { display: block; margin: 0 -6px; padding: 1px 6px; font-size: .72rem; font-weight: 600; line-height: 1.5; text-decoration: none;
    color: var(--text); background: color-mix(in srgb, var(--dot) 28%, var(--mix-base)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-phase.is-start { margin-left: 0; border-top-left-radius: 5px; border-bottom-left-radius: 5px; box-shadow: inset 3px 0 0 var(--dot); }
.cal-phase.is-end { margin-right: 0; border-top-right-radius: 5px; border-bottom-right-radius: 5px; }
.cal-phase:hover { background: color-mix(in srgb, var(--dot) 45%, var(--mix-base)); }
.cal-swatch.is-phase { background: color-mix(in srgb, var(--project-blue) 35%, var(--mix-base)); }

/* Heatmap (K-64) som på GitHub. Trin 0-4 blandes fra accentfarven, så mørk tilstand følger med. */
.hm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.hm-stats .card { padding: 12px 16px; }
.hm-stats p { margin: 0; }
.hm-stat { font-size: 1.5rem; font-weight: 700; }
.hm-panel { padding: 16px; }
.hm-scroll { overflow-x: auto; padding-bottom: 4px; }
.hm-grid { --cell: 16px; display: grid; grid-template-columns: 32px repeat(var(--weeks), var(--cell)); grid-template-rows: 18px repeat(7, var(--cell)); gap: 3px; width: max-content; }
.hm-corner { grid-row: 1; grid-column: 1; }
.hm-month { grid-row: 1; font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: visible; }
.hm-weekday { grid-column: 1; font-size: .7rem; color: var(--muted); line-height: var(--cell); }
.hm-cell { display: block; width: var(--cell, 14px); height: var(--cell, 14px); padding: 0; border: 0; border-radius: 3px; cursor: pointer; background: var(--surface-2); outline: 1px solid color-mix(in srgb, var(--text) 6%, transparent); outline-offset: -1px; }
.hm-cell.l1 { background: color-mix(in srgb, var(--ok-ink) 30%, var(--surface-2)); }
.hm-cell.l2 { background: color-mix(in srgb, var(--ok-ink) 55%, var(--surface-2)); }
.hm-cell.l3 { background: color-mix(in srgb, var(--ok-ink) 78%, var(--surface-2)); }
.hm-cell.l4 { background: var(--ok-ink); }
.hm-cell.is-future { background: transparent; outline: none; cursor: default; }
.hm-cell.is-today { box-shadow: 0 0 0 2px var(--accent); }
button.hm-cell:hover { box-shadow: 0 0 0 2px var(--text); }
button.hm-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hm-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 10px; font-size: .75rem; }
.hm-legend .hm-cell { cursor: default; }
@media (pointer: coarse) { .hm-grid { --cell: 18px; } }

/* Projekternes fremdrift på Hjem (K-54): én cirkel pr. hovedprojekt i projektets farve. */
.progress-rings { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 0 16px 16px; }
.progress-ring-card { display: grid; justify-items: center; gap: 4px; padding: 14px 10px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; text-align: center; }
.progress-ring-card:hover { border-color: var(--dot); box-shadow: var(--shadow); }
.progress-ring { transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 8; }
.progress-ring-track { stroke: var(--surface-2); }
.progress-ring-value { stroke: var(--dot); stroke-linecap: round; transition: stroke-dasharray .4s ease; }
.progress-ring-text { transform: rotate(90deg); transform-origin: 40px 40px; fill: var(--text); font-size: 17px; font-weight: 700; text-anchor: middle; dominant-baseline: central; }
.progress-ring-name { font-weight: 650; font-size: .9rem; overflow-wrap: anywhere; }
.progress-ring-sub { font-size: .75rem; }
@media (max-width: 499px) { .progress-rings { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Mål-side (K-65) */
.goals-toc { padding: 14px 18px; }
.goals-toc ol { margin: 0; padding-left: 20px; columns: 2 220px; column-gap: 32px; }
.goals-toc li { padding: 3px 0; break-inside: avoid; }
.goal-section { scroll-margin-top: 72px; }
.goal-section .panel-body { display: grid; gap: 10px; }
.goal-section p, .goal-section h3 { margin: 0; }
.goal-section h3 { font-size: .98rem; margin-top: 6px; }
.goal-list { margin: 0; padding-left: 22px; display: grid; gap: 4px; }
.goal-sublist { margin: 6px 0 0; padding-left: 18px; font-size: .9em; color: var(--text-2); }
.goal-callout { padding: 10px 14px; border-radius: 8px; background: var(--accent-soft); }
.goal-callout.is-important { background: var(--error); border-left: 4px solid var(--error-ink); display: grid; gap: 6px; }
.goal-dates { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.goal-dates li { display: grid; gap: 2px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); border-left: 4px solid var(--warn-ink); background: var(--surface); }
.goal-dates strong { font-size: 1.35rem; color: var(--warn-ink); }
.goal-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.goal-table th, .goal-table td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.goal-table th { background: var(--surface-2); font-weight: 650; }
.reading-tips { margin: 0; display: grid; gap: 8px; }
.reading-tip { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 10px 14px; border-radius: 8px; }
.reading-tip dt { font-weight: 700; }
.reading-tip dd { margin: 0; }
.reading-tip.is-example { background: var(--info); }
.reading-tip.is-good { background: var(--ok); }
.reading-tip.is-bad { background: var(--warn); }
@media (max-width: 599px) { .reading-tip { grid-template-columns: 1fr; gap: 4px; } }
.title-row-action { margin-left: 8px; }
