/* mumus design system (mumus.app). No inline styles anywhere (strict CSP). */
:root {
    /* mumus brand: warm charcoal, soft cream, forest-green actions, electric-lime highlights.
       Lime is a highlight (selection markers, badges, mascot), never a large background and never the only signal:
       it has 1.2:1 against cream, so it always sits next to text, a tint or a forest/charcoal element. */
    --lime: #D4ED69;          /* brand accent: charcoal text on it (11.5:1) */
    --lime-600: #B9D44A;
    --forest: #315C43;        /* primary actions, selected controls: white text on it (7.7:1) */
    --forest-700: #274A36;
    --lime-ink: #315C43;      /* readable "brand" text colour on light surfaces = forest */
    --charcoal: #252821;
    --ink: #252821;
    --nav: #252821;
    --nav-2: #33372E;

    --bg: #F7F7F0;            /* soft cream page */
    --surface: #ffffff;       /* cards, ticket details */
    --surface-2: #EFF0E6;
    --sidebar: #FBFBF6;
    --nav-text: #3E4238;
    --nav-active-bg: #EEF5CC;
    --tint-lime: #EEF5CC; --tint-blue: #E3EEFB; --tint-orange: #FCEBD9; --tint-red: #FBE3E4; --tint-violet: #ECE6F8; --tint-green: #DFEDE3; --ink-green: #315C43;
    --ink-blue: #1D5FA8; --ink-orange: #9A4D07; --ink-red: #B4232C; --ink-violet: #5B3FA0;
    --text: #252821;
    --muted: #646A5C;          /* muted olive grey: ≥ 4.8:1 on cream, white and --surface-2 (WCAG AA) */
    --warning-text: #8A6100;   /* readable warning text on light surfaces */
    --border: #DDDFD4;         /* pale stone */
    --accent: var(--forest);   /* primary button / selected control background */
    --accent-hover: var(--forest-700);
    --on-accent: #ffffff;
    --link: var(--forest);
    /* Functional colours stay separate from the brand: red = error, amber = warning, blue = information. */
    --danger: #C4262E;
    --success: #2F6B45;
    --warning: #B07A00;
    --info: #1D5FA8;
    --focus: 0 0 0 3px rgba(49, 92, 67, .40);
    --radius: 6px;            /* compact: small radii, clear borders, restrained shadows */
    --shadow: 0 1px 2px rgba(37, 40, 33, .06);
    --shadow-lg: 0 10px 28px rgba(37, 40, 33, .16);
    color-scheme: light;
}

/* Dark theme: follows the OS unless the user picked a theme (html[data-theme], see theme_controller.js). */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme=light]) {
        --bg: #191B16;
        --surface: #21241E;
        --surface-2: #2A2D26;
        --sidebar: #1D1F1A;
        --nav-text: #C9CCBE;
        --nav-active-bg: #2E3519;
        --tint-lime: #2E3519; --tint-blue: #172A40; --tint-orange: #3A2612; --tint-red: #3D1A1E; --tint-violet: #2A2140; --tint-green: #1C3326; --ink-green: #8FD3A6;
        --ink-blue: #7DB4F0; --ink-orange: #F0A65E; --ink-red: #FF8A8F; --ink-violet: #B9A2F0;
        --text: #ECEDE4;
        --muted: #A6AB9C;
        --border: #363A30;
        --accent: #3F7757;
        --accent-hover: #4A8664;
        --on-accent: #ffffff;
        --link: var(--lime);
        --danger: #ff6b6b;
        --success: #6FC08C;
        --warning: #d29922;
        --warning-text: #d29922;
        --info: #7DB4F0;
        --focus: 0 0 0 3px rgba(212, 237, 105, .45);
        --shadow: 0 1px 2px rgba(0, 0, 0, .4);
        --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
        color-scheme: dark;
    }
}
:root[data-theme=dark] {
    --bg: #191B16;
    --surface: #21241E;
    --surface-2: #2A2D26;
    --sidebar: #1D1F1A;
    --nav-text: #C9CCBE;
    --nav-active-bg: #2E3519;
    --tint-lime: #2E3519; --tint-blue: #172A40; --tint-orange: #3A2612; --tint-red: #3D1A1E; --tint-violet: #2A2140; --tint-green: #1C3326; --ink-green: #8FD3A6;
    --ink-blue: #7DB4F0; --ink-orange: #F0A65E; --ink-red: #FF8A8F; --ink-violet: #B9A2F0;
    --text: #ECEDE4;
    --muted: #A6AB9C;
    --border: #363A30;
    --accent: #3F7757;
    --accent-hover: #4A8664;
    --on-accent: #ffffff;
    --link: var(--lime);
    --danger: #ff6b6b;
    --success: #6FC08C;
    --warning: #d29922;
    --warning-text: #d29922;
    --info: #7DB4F0;
    --focus: 0 0 0 3px rgba(212, 237, 105, .45);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 1.75rem 0 .75rem; }
h3 { font-size: .95rem; margin: 1rem 0 .5rem; }
p { margin: 0 0 .75rem; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.break { word-break: break-all; }
.icon { flex: none; vertical-align: middle; }
.hidden { display: none !important; }
/* Theme-dependent images (logos, screenshots): both are in the DOM, CSS shows the right one. */
.dark-only { display: none !important; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme=light]) .dark-only { display: revert !important; }
    :root:not([data-theme=light]) .light-only { display: none !important; }
}
:root[data-theme=dark] .dark-only { display: revert !important; }
:root[data-theme=dark] .light-only { display: none !important; }
.visually-hidden { position: absolute !important; 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: 12px; top: 12px; z-index: 100; background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 6px; font-weight: 600; transform: translateY(-200%); }
.skip-link:focus { transform: none; box-shadow: var(--shadow-lg); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* ---------- App shell (sidebar + top bar) ---------- */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 18px 14px; gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; padding: 2px 10px 12px; }
.brand:hover { text-decoration: none; }
.nav-body { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-section { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 16px 12px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-section:first-child { margin-top: 4px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 12px; border-radius: 6px; color: var(--nav-text); font: inherit; font-size: .9rem; font-weight: 500; background: none; border: 0; cursor: pointer; text-align: left; }
.nav-link .icon { color: var(--muted); }
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--nav-active-bg); color: var(--text); font-weight: 650; }
.nav-link.active .icon { color: var(--link); }
.nav-link.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--lime); }
.nav-dot { width: 20px; height: 20px; border-radius: 6px; display: inline-grid; place-items: center; font-size: .68rem; font-weight: 800; color: #fff; flex: none; }
.nav-new { color: var(--link); font-weight: 600; }
.nav-new .icon { color: var(--link); }
.nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 21px; padding-left: 12px; border-left: 1px solid var(--border); }
.nav-sub .nav-link { padding: 5px 10px; font-size: .84rem; }
.nav-sub .nav-link.current { color: var(--link); font-weight: 650; }
.nav-promo { display: grid; gap: 2px; padding: 14px; border-radius: 6px; color: var(--text); background: linear-gradient(135deg, var(--tint-lime), var(--tint-blue)); border: 1px solid var(--border); font-size: .8rem; margin-top: 12px; }
.nav-promo:hover { text-decoration: none; border-color: var(--link); }
.nav-promo span:last-child { color: var(--muted); }
.nav-promo-icon { width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; background: var(--surface); color: var(--link); margin-bottom: 6px; box-shadow: var(--shadow); }
.badge { margin-left: auto; background: #D92D35; color: #fff; font-size: .7rem; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.nav-scrim { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; height: 64px; padding: 0 28px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar-icon { position: relative; width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: inline-flex; align-items: center; font-size: 1.05rem; }
.topbar-icon:hover { background: var(--surface-2); text-decoration: none; }
.topbar-dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: #D92D35; box-shadow: 0 0 0 2px var(--surface); }
.nav-toggle { display: none; }
.user-menu > summary { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 6px; color: var(--text); margin-left: 6px; }
.user-menu > summary:hover { background: var(--surface-2); }
.user-menu-text { display: grid; line-height: 1.25; max-width: 200px; }
.user-menu-text strong { font-size: .88rem; }
.user-menu-text span { font-size: .75rem; color: var(--muted); }
.user-menu-body { top: 52px; width: 270px; padding: 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.user-menu-body > a, .user-menu-body button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 6px; color: var(--text); font-size: .88rem; font-weight: 500; border: 0; background: none; }
.user-menu-body > a:hover, .user-menu-body button:hover { background: var(--surface-2); text-decoration: none; }
.user-menu-body form { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
.user-menu-head { display: flex; gap: 10px; align-items: center; padding: 8px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }

/* Page title row: part of the content area, not a separate band. */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 26px 28px 0; }
.page-header h1 { font-size: 1.45rem; font-weight: 750; letter-spacing: -.02em; }
.page-header .crumbs { font-size: .82rem; color: var(--muted); margin-bottom: 2px; }
.page-header .actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.content { padding: 22px 28px 48px; max-width: 1440px; width: 100%; }
.content.wide { max-width: none; }
.content.narrow { max-width: 760px; }

@media (max-width: 960px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: 280px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
    .shell.open .sidebar { transform: none; }
    .shell.open .nav-scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(15, 18, 22, .45); }
    .nav-toggle { display: inline-flex; }
    .topbar, .content, .page-header { padding-left: 16px; padding-right: 16px; }
    .user-menu-text { display: none; }
}

/* ---------- Public pages (login, invitation, 2FA) ---------- */
body.public { display: flex; justify-content: center; }
body.public .main { width: 100%; max-width: 460px; padding: 8vh 16px 48px; }
body.public .content { padding: 0; }
.login-logo { display: block; margin: 0 auto 1.75rem; text-align: center; }
.login-logo img { max-width: 100%; height: auto; }

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 12px; }
.card-header h2, .card-header h3 { margin: 0; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row > input:not([type=checkbox]):not([type=radio]), .row > select { width: auto; flex: 1 1 200px; }
ul.stack { list-style: none; padding: 0; margin: 0; }
.board-toolbar form { flex: 1 1 320px; flex-wrap: nowrap; }
.spread { justify-content: space-between; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }
.divider { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

label, legend { font-weight: 600; font-size: .85rem; display: block; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input:not([type]), select, textarea {
    width: 100%; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px;
}
input:focus, select:focus, textarea:focus, button:focus-visible, .button:focus-visible { outline: none; box-shadow: var(--focus); border-color: var(--link); }
input[type=checkbox], input[type=radio] { accent-color: var(--forest); width: 16px; height: 16px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.help { font-size: .8rem; color: var(--muted); margin-top: 4px; }
form ul { color: var(--danger); margin: 4px 0; padding-left: 1rem; font-size: .85rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }

button, .button { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .9rem; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 8px 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
button:hover, .button:hover { background: var(--surface-2); text-decoration: none; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.primary:hover { background: var(--accent-hover); }
.danger-button { color: var(--danger); }
.link { background: none; border: 0; padding: 0; color: var(--link); font-weight: 500; }
.link:hover { background: none; text-decoration: underline; }
.danger { color: var(--danger) !important; }
.button.small, button.small { padding: 4px 10px; font-size: .8rem; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; border: 1px solid var(--border); background: var(--surface); }
.flash-error { border-color: var(--danger); color: var(--danger); }
.flash-success { border-color: var(--success); color: var(--success); }
.flash-info { border-color: var(--link); }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.table th:first-child { border-top-left-radius: 8px; } .table th:last-child { border-top-right-radius: 8px; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table tr:last-child td { border-bottom: 0; }
.table select { width: auto; padding: 4px 8px; }
.table-wrap { overflow-x: auto; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.pill-status { background: #EEF6D3; color: var(--lime-ink); }
.pill-done { background: #d3f0dc; color: #136c2e; }
.pill.via { background: color-mix(in srgb, var(--accent, #7c5cff) 14%, transparent); color: var(--text); font-weight: 600; }
.pill-high { background: #fbeccb; color: #8a5a00; }
.pill-critical { background: #fbdcdc; color: #a1121b; }
@media (prefers-color-scheme: dark) {
    .pill-status { background: #3B4520; color: var(--lime); }
    .pill-done { background: #173b24; color: #6fdc8c; }
    .pill-high { background: #3d2f10; color: #e3b341; }
    .pill-critical { background: #4a1d22; color: #ff8a8a; }
}

.avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; color: #fff; flex: none; overflow: hidden; }
.avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-xl { width: 96px; height: 96px; font-size: 32px; }
.avatar-sm { width: 22px; height: 22px; font-size: 9px; }
.avatar-md { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.avatar-empty { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--border); }
.hue-0 { background: #5E7D0A; } .hue-1 { background: #2f7f7a; } .hue-2 { background: #b4446c; } .hue-3 { background: #4c5fd3; }
.hue-4 { background: #a95817; } .hue-5 { background: #267a44; } .hue-6 { background: #8e44ad; } .hue-7 { background: #1f6fb2; }
.hue-8 { background: #a2462e; } .hue-9 { background: #3c7d2a; } .hue-10 { background: #6b4f9e; } .hue-11 { background: #0f7c8c; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty img { width: 96px; margin-bottom: 12px; }

/* ---------- Dashboard ---------- */
.project-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; color: inherit; transition: transform .1s, box-shadow .1s; }
.project-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.project-preview { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--ink), var(--charcoal)); display: flex; align-items: center; justify-content: center; color: var(--lime); overflow: hidden; }
.project-preview img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.project-preview .placeholder { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .8rem; text-align: center; padding: 0 16px; }
.project-meta { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.project-meta strong { font-size: 1rem; }
.project-urls { font-size: .8rem; color: var(--muted); }
.stat-row { display: flex; gap: 12px; font-size: .8rem; color: var(--muted); }
.stat-row b { color: var(--text); }

/* ---------- Board ---------- */
.board-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.board-toolbar input[type=search] { max-width: 260px; }
.board-toolbar select { width: auto; }
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; min-height: 60vh; }
.column { flex: 0 0 300px; background: var(--surface-2); border-radius: 6px; padding: 10px; display: flex; flex-direction: column; max-height: calc(100vh - 210px); }
.column-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 10px; font-weight: 700; font-size: .85rem; }
.column-head .count { color: var(--muted); font-weight: 600; background: var(--surface); border-radius: 999px; padding: 0 8px; }
.cards { list-style: none; margin: 0; padding: 2px; min-height: 80px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.task-card { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; box-shadow: var(--shadow); border-left: 4px solid var(--lime); }
.task-card[draggable="true"] { cursor: grab; }
.task-card.dragging { opacity: .45; }
.task-card a { color: var(--text); display: block; font-weight: 500; }
.task-card a:hover { text-decoration: none; color: var(--link); }
.task-card .card-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: .75rem; color: var(--muted); }
.task-card .card-foot .avatar { margin-left: auto; }
.task-card.priority-high { border-left-color: var(--warning); }
.task-card.priority-critical { border-left-color: var(--danger); }
.task-card.priority-low { border-left-color: var(--border); }
.task-card.is-done { opacity: .75; }

/* ---------- Task page ---------- */
.task-number { color: var(--muted); font-weight: 600; }
.prose { line-height: 1.6; overflow-wrap: anywhere; }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 .75rem; }
.prose blockquote { margin: 0 0 .75rem; padding-left: 12px; border-left: 3px solid var(--lime); color: var(--muted); }
.prose pre { background: var(--surface-2); padding: 10px; border-radius: 6px; overflow-x: auto; }
.video { width: 100%; max-height: 70vh; border-radius: 6px; background: #000; display: block; }
.video-card { padding: 12px; }
.screenshot { max-width: 100%; border: 1px solid var(--border); border-radius: var(--radius); display: block; }
.side-props { display: flex; flex-direction: column; gap: 14px; }
.side-props label { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.timeline .event { display: flex; gap: 10px; font-size: .85rem; color: var(--muted); align-items: center; padding-left: 4px; }
.timeline .comment { display: flex; gap: 10px; }
.timeline .bubble { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 10px 14px; }
.timeline .who { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: .82rem; margin: 0; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; overflow-wrap: anywhere; }
.log { max-height: 320px; overflow: auto; font-size: 12px; background: var(--surface-2); padding: 10px; border-radius: 6px; white-space: pre-wrap; word-break: break-all; margin: 8px 0 0; }
.lvl-error { color: var(--danger); }
.lvl-warn { color: var(--warning); }
details summary { cursor: pointer; font-weight: 600; font-size: .85rem; margin-top: 10px; }

/* ---------- Rich text editor ---------- */
.rte { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.rte-toolbar { display: flex; gap: 2px; padding: 4px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.rte-toolbar button { padding: 4px 8px; font-size: .8rem; border: 0; background: none; border-radius: 6px; min-width: 30px; justify-content: center; }
.rte-toolbar button:hover, .rte-toolbar button.active { background: var(--surface-2); }
.rte-area { min-height: 140px; max-height: 480px; overflow-y: auto; padding: 10px 12px; outline: none; }
.rte-area:empty::before { content: attr(data-placeholder); color: var(--muted); }
.rte:focus-within { box-shadow: var(--focus); border-color: var(--link); }
.rte-small .rte-area { min-height: 70px; }

/* ---------- Settings ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; font-size: .9rem; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--link); border-bottom-color: var(--link); }
.url-list { display: flex; flex-direction: column; gap: 6px; }
.url-row { display: flex; gap: 6px; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.steps li { counter-increment: step; display: flex; gap: 14px; align-items: flex-start; }
.steps li::before { content: counter(step); flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.qr { background: #fff; padding: 8px; border-radius: 6px; width: 236px; }
.codes { display: grid; grid-template-columns: repeat(2, max-content); gap: 6px 24px; font: 15px ui-monospace, monospace; background: var(--surface-2); padding: 14px 18px; border-radius: 6px; }
.notification { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; border-bottom: 1px solid var(--border); }
.notification:last-child { border-bottom: 0; }
.notification.unread .notif-text { font-weight: 600; }
.notification .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 8px; flex: none; }
.notification.read .dot { visibility: hidden; }
.matrix th, .matrix td { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.role-desc { font-size: .78rem; color: var(--muted); }

/* ---------- Project navigation ---------- */
.project-header { padding-bottom: 0; }
.project-tabs { flex-basis: 100%; margin: 6px 0 0; }
.project-tabs a { display: inline-flex; align-items: center; gap: 6px; }
.header-search input { width: 240px; padding: 6px 10px; }
.content.narrow-wide { max-width: 900px; }
.spacer { flex: 1; }
.flush { margin: 0; }
.label { display: block; font-weight: 600; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.quick-add { margin-bottom: 16px; max-width: 720px; }
.quick-add > input:not([type=hidden]) { flex: 1 1 320px; }
.icon-button { padding: 3px 5px; border: 0; background: none; color: var(--muted); border-radius: 6px; }
.icon-button:hover { background: var(--surface-2); color: var(--text); }
input[type=date] { width: 100%; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 7px 8px; }
input.is-overdue { border-color: var(--danger); color: var(--danger); }
input[type=tel] { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; flex: 1 1 200px; }

/* ---------- Labels: tags + epics (fixed palette; no inline styles) ---------- */
.tag, .epic-chip { display: inline-flex; align-items: center; max-width: 100%; font-size: .7rem; font-weight: 700; line-height: 1.5; padding: 0 7px; border-radius: 5px; background: var(--surface-2); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag::before { content: "#"; opacity: .6; margin-right: 1px; }
.epic-chip { border-radius: 999px; }
.epic-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 5px; flex: none; }
.epic-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 4px; flex: none; }
.tag-c0, .epic-c0 { background: #EEF5CC; color: #315C43; } .epic-swatch.epic-c0 { background: #B9D44A; }
.tag-c1, .epic-c1 { background: #d5efed; color: #1f615d; } .epic-swatch.epic-c1 { background: #2f7f7a; }
.tag-c2, .epic-c2 { background: #f6dbe5; color: #8c2f51; } .epic-swatch.epic-c2 { background: #b4446c; }
.tag-c3, .epic-c3 { background: #dfe3fa; color: #3a49a8; } .epic-swatch.epic-c3 { background: #5b6ee1; }
.tag-c4, .epic-c4 { background: #f8e3d0; color: #8a4510; } .epic-swatch.epic-c4 { background: #c26a1f; }
.tag-c5, .epic-c5 { background: #d6efdf; color: #1d6a3a; } .epic-swatch.epic-c5 { background: #2d8a4e; }
.tag-c6, .epic-c6 { background: #ecdcf3; color: #6c2f86; } .epic-swatch.epic-c6 { background: #8e44ad; }
.tag-c7, .epic-c7 { background: #d7e7f5; color: #18568a; } .epic-swatch.epic-c7 { background: #1f6fb2; }
.tag-c8, .epic-c8 { background: #f4dcd5; color: #823520; } .epic-swatch.epic-c8 { background: #a2462e; }
.tag-c9, .epic-c9 { background: #fbf0c9; color: #7a5b00; } .epic-swatch.epic-c9 { background: #bf8700; }
.tag-c10, .epic-c10 { background: #e3dcf0; color: #4f3a78; } .epic-swatch.epic-c10 { background: #6b4f9e; }
.tag-c11, .epic-c11 { background: #e4e7e9; color: #3c3f43; } .epic-swatch.epic-c11 { background: #687076; }
@media (prefers-color-scheme: dark) {
    .tag, .epic-chip { filter: saturate(.9) brightness(.85); }
}
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.tag-list a:hover { text-decoration: none; }
.card-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }

/* ---------- Board extras ---------- */
.column-head { gap: 6px; }
.column-head .column-name { flex: 1; }
.column-grip { cursor: grab; color: var(--muted); display: inline-flex; }
.column.dragging { opacity: .5; }
.column-add { background: transparent; border: 2px dashed var(--border); justify-content: flex-start; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; color: var(--muted); display: inline-flex; padding: 2px 4px; border-radius: 6px; margin: 0; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { background: var(--surface); color: var(--text); }
.menu-body { position: absolute; right: 0; top: 26px; z-index: 20; width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow-lg); padding: 10px; font-weight: 400; }
.task-card { position: relative; }
.task-card .card-foot { flex-wrap: wrap; }
.task-card .card-foot .avatar-stack { margin-left: auto; }
.task-card .card-foot .avatar { margin-left: 0; }
.task-card .card-action { opacity: 0; transition: opacity .1s; }
.task-card:hover .card-action, .task-card:focus-within .card-action { opacity: 1; }
.activity-dot { position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; border-radius: 50%; background: #e5484d; border: 2px solid var(--surface); box-shadow: 0 0 0 3px rgba(229, 72, 77, .18); }
.task-card.is-unseen { box-shadow: var(--shadow), 0 0 0 1px rgba(229, 72, 77, .35); }
.due { display: inline-flex; align-items: center; gap: 3px; }
.due-soon { color: var(--warning-text); font-weight: 700; }
.due-overdue { color: var(--danger); font-weight: 700; }
.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack .avatar + .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-more { background: var(--surface-2); color: var(--muted); }

/* ---------- Panels (collapsible) ---------- */
.panel > summary.panel-head { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; font-weight: 700; font-size: .95rem; }
.panel > summary.panel-head::-webkit-details-marker { display: none; }
.panel > summary.panel-head span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.panel > summary.panel-head::after { content: "▾"; color: var(--muted); transition: transform .15s; margin-left: 4px; }
.panel:not([open]) > summary.panel-head::after { transform: rotate(-90deg); }
.panel[open] > summary.panel-head { margin-bottom: 12px; }
.count { color: var(--muted); font-weight: 600; font-size: .8rem; background: var(--surface-2); border-radius: 999px; padding: 0 8px; margin-left: auto; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0 12px; }
.section-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.segmented a { padding: 4px 10px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.segmented a.active { background: var(--surface-2); color: var(--text); }
.segmented a:hover { text-decoration: none; color: var(--text); }

/* ---------- Attachments ---------- */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.file-grid-compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 10px; }
.file-tile { position: relative; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.file-thumb { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; background: var(--surface-2); color: var(--muted); overflow: hidden; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.file-icon { font-size: 28px; display: inline-flex; }
.file-badge { position: absolute; left: 6px; bottom: 6px; font-size: .68rem; font-weight: 700; background: rgba(0, 0, 0, .65); color: #fff; padding: 1px 6px; border-radius: 4px; }
.file-meta { padding: 6px 8px; display: flex; flex-direction: column; min-width: 0; }
.file-name { font-size: .82rem; font-weight: 600; color: var(--text); }
.file-delete { position: absolute; top: 4px; right: 4px; }
.file-delete .icon-button { background: var(--surface); box-shadow: var(--shadow); }
.upload-row { margin-top: 12px; }
.upload-row input[type=file], .file-pick input[type=file] { font-size: .8rem; max-width: 100%; }
.file-pick { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; color: var(--muted); margin: 0; }
.screenshot-link { display: block; }

/* ---------- History ---------- */
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; }
.history li { display: flex; gap: 10px; font-size: .85rem; align-items: flex-start; }
.history li > div { min-width: 0; }
.diff { margin-top: 4px; }
.diff summary { font-size: .78rem; margin: 0; color: var(--link); }
.diff-old, .diff-new { border-radius: 6px; padding: 6px 8px; margin-top: 6px; font-size: .8rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff-old { background: rgba(209, 36, 47, .07); }
.diff-new { background: rgba(26, 127, 55, .08); }
.diff p { margin: 2px 0 0; }

/* ---------- Pickers (assignees, tags) ---------- */
.picker > summary { display: flex; align-items: center; gap: 8px; margin: 0; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-weight: 400; font-size: .9rem; min-width: 0; }
.picker > summary.small { border: 0; padding: 2px 0; color: var(--link); font-size: .82rem; }
.picker-body { display: flex; flex-direction: column; gap: 6px; padding: 10px; margin-top: 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); max-height: 280px; overflow-y: auto; }
.picker-body .check { font-size: .88rem; }

/* ---------- Epics ---------- */
.progress { width: 100%; height: 8px; border: 0; border-radius: 999px; overflow: hidden; background: var(--surface-2); appearance: none; }
.progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
.progress::-webkit-progress-value { background: var(--forest); border-radius: 999px; }
.progress::-moz-progress-bar { background: var(--forest); border-radius: 999px; }
.epic-title { margin: 0 0 4px; }
.epic-tasks { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; }
.epic-tasks li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .84rem; padding: 4px 6px; border-radius: 6px; }
.epic-tasks li.current { background: var(--surface-2); font-weight: 600; }
.epic-tasks li a { color: var(--text); }
.epic-list { display: flex; flex-direction: column; gap: 10px; }
.epic-list .card + .card { margin-top: 0; }
.epic-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; align-items: center; color: inherit; }
.epic-row:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.epic-row.is-closed { opacity: .65; }
.epic-row-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.epic-row-meta { display: grid; grid-template-columns: 90px minmax(80px, 1fr) auto auto; gap: 12px; align-items: center; font-size: .82rem; color: var(--muted); }
@media (max-width: 760px) { .epic-row, .epic-row-meta { grid-template-columns: 1fr; } }
.epic-heading { display: flex; align-items: center; gap: 10px; }
.swatches { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.swatches legend { margin-bottom: 6px; }
.swatch-option { display: inline-flex; margin: 0; cursor: pointer; }
.swatch-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch-option .epic-swatch { width: 22px; height: 22px; border-radius: 6px; border: 2px solid transparent; }
.swatch-option input:checked + .epic-swatch { border-color: var(--text); }
.swatch-option input:focus-visible + .epic-swatch { box-shadow: var(--focus); }
.task-table td { vertical-align: middle; }
.task-table .card-labels { margin: 0; }

/* ---------- Search ---------- */
.search-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.search-results { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.search-results .card + .card { margin-top: 0; }
.search-title { font-weight: 600; }
.snippet { margin: 6px 0; color: var(--text); }
mark { background: #f4f0a8; color: inherit; border-radius: 3px; padding: 0 2px; }
@media (prefers-color-scheme: dark) { mark { background: #5c5520; } }
.section-gap { margin-top: 20px; }

/* ---- AI assistants (MCP) page ---- */
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 700; margin-bottom: 6px; }
.stack-tight { display: grid; gap: 6px; }
.check-columns { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; padding-left: 26px; }
pre.cmd { font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 10px 12px; border-radius: 6px; white-space: pre-wrap; word-break: break-all; margin: 0; }

/* ---- Auth pages (login, sign-up, password reset) ---- */
.logo { display: inline-flex; }
.logo img { height: auto; max-width: 100%; }
body.auth { background:
    radial-gradient(40% 40% at 15% 10%, color-mix(in srgb, var(--lime) 22%, transparent), transparent 70%),
    radial-gradient(35% 35% at 90% 90%, color-mix(in srgb, var(--lime) 12%, transparent), transparent 70%),
    var(--bg); background-attachment: fixed; }
body.auth .main { max-width: 440px; padding-top: 6vh; }
.auth-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.auth-logo:hover { text-decoration: none; }
.theme-toggle { width: 40px; height: 40px; justify-content: center; padding: 0; border-radius: 6px; font-size: 1.05rem; }
.auth-card { padding: 28px; border-radius: 6px; box-shadow: var(--shadow-lg); gap: 1rem; }
.auth-card h1 { font-size: 1.55rem; letter-spacing: -.02em; margin-bottom: 4px; }
.auth-card input:not([type=checkbox]) { padding: 10px 12px; }
.auth-icon { width: 48px; height: 48px; border-radius: 6px; display: grid; place-items: center; font-size: 1.4rem; background: color-mix(in srgb, var(--lime) 25%, transparent); color: var(--link); }
button.big, .button.big { width: 100%; justify-content: center; padding: 11px 16px; font-size: 1rem; }
.center { text-align: center; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.field-error { color: var(--danger); font-size: .85rem; margin: 6px 0 0; }
[aria-invalid=true] { border-color: var(--danger) !important; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.check span { font-weight: 400; }

/* WCAG 1.4.1: links inside running text are underlined (not distinguished by colour alone). */
p a:not(.button):not(.btn), li a:not(.button):not(.nav-link), td a:not(.button), .help a, .check a, .prose a, .flash a { text-decoration: underline; text-underline-offset: .15em; }

/* ---------- Admin components (dashboard, cards, modal) ---------- */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -2px 0 16px; }
.card-head h2 { margin: 0; font-size: 1rem; font-weight: 700; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush > .card-head { padding: 18px 20px 0; margin-bottom: 14px; }
.card-flush .table th:first-child, .card-flush .table td:first-child { padding-left: 20px; }
.card-flush .table th:last-child, .card-flush .table td:last-child { padding-right: 20px; }
.card-flush .table th { border-radius: 0; }
.card-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px; color: var(--muted); text-align: center; }
.card-empty p { margin: 0; }
.nowrap { white-space: nowrap; }
.tint-lime { background: var(--tint-lime); color: var(--link); }
.tint-blue { background: var(--tint-blue); color: var(--ink-blue); }
.tint-orange { background: var(--tint-orange); color: var(--ink-orange); }
.tint-red { background: var(--tint-red); color: var(--ink-red); }
.tint-violet { background: var(--tint-violet); color: var(--ink-violet); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.stat-card { position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat-card::after { content: ""; position: absolute; right: -28px; top: -28px; width: 96px; height: 96px; border-radius: 50%; background: var(--surface-2); opacity: .7; }
.stat-icon { width: 52px; height: 52px; border-radius: 6px; display: grid; place-items: center; z-index: 1; }
.stat-body { z-index: 1; min-width: 0; }
.stat-label { margin: 0; font-size: .84rem; font-weight: 600; color: var(--muted); }
.stat-value { margin: 0; font-size: 1.85rem; line-height: 1.15; font-weight: 750; letter-spacing: -.02em; }
.stat-foot { grid-column: 1 / -1; margin: 10px 0 0; padding-top: 12px; border-top: 1px dashed var(--border); font-size: .8rem; z-index: 1; }
.trend { display: inline-block; font-weight: 700; font-size: .75rem; padding: 2px 8px; border-radius: 999px; }
.trend-good, .trend-down { background: var(--tint-green); color: var(--ink-green); }
.trend-bad, .trend-up { background: var(--tint-red); color: var(--ink-red); }
.trend-flat { background: var(--surface-2); color: var(--muted); }
@media (max-width: 1200px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .stat-grid { grid-template-columns: 1fr; gap: 14px; } }

.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.dash-col .card + .card { margin-top: 0; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
.task-cell a { display: block; color: var(--text); font-weight: 600; text-decoration: none; }
.task-cell a:hover { color: var(--link); text-decoration: underline; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.project-tile { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; color: var(--text); background: var(--surface); transition: box-shadow .15s, transform .15s; }
.project-tile:hover { text-decoration: none; box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.project-thumb { aspect-ratio: 16 / 7; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--border); }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.project-initial { width: 44px; height: 44px; border-radius: 6px; font-size: 1.2rem; }
.project-info { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; min-width: 0; }
.project-info .pill { flex: none; }

.truncate-block { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.due-list, .feed, .people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.due-list li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.due-list li:first-child { padding-top: 0; }
.due-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.due-list a { color: var(--text); font-weight: 600; text-decoration: none; }
.due-list a:hover { color: var(--link); text-decoration: underline; }
.date-chip { flex: none; width: 46px; height: 48px; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--tint-blue); color: var(--ink-blue); font-size: .68rem; font-weight: 700; text-transform: uppercase; line-height: 1.1; }
.date-chip b { font-size: 1.05rem; }
.date-chip.is-overdue { background: var(--tint-red); color: var(--ink-red); }
.feed li { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.feed li:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 32px; bottom: 4px; width: 2px; background: var(--border); }
.feed li:last-child { padding-bottom: 0; }
.feed-text { min-width: 0; font-size: .86rem; }
.feed-text p { margin: 0 0 2px; color: var(--muted); }
.feed-text p strong { color: var(--text); }
.feed-text a { color: var(--link); }
.people li { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); }
.people li:first-child { padding-top: 0; }
.people li:last-child { border-bottom: 0; padding-bottom: 0; }
.people strong { font-size: .9rem; }
.welcome { display: flex; justify-content: space-between; gap: 32px; align-items: center; padding: 32px; background: linear-gradient(120deg, var(--surface), var(--tint-lime)); }
.welcome h2 { margin-top: 0; font-size: 1.4rem; }
.welcome .steps { margin: 18px 0 22px; }
@media (max-width: 700px) { .welcome img { display: none; } }

/* ---- Profile ---- */
.profile-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .profile-grid { grid-template-columns: 1fr; } }
.profile-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 0 20px; overflow: hidden; }
.profile-cover { width: 100%; height: 84px; background: linear-gradient(120deg, var(--lime), #6FA8DC); margin-bottom: -48px; }
.profile-card .avatar-xl { box-shadow: 0 0 0 4px var(--surface); font-size: 30px; }
.profile-card h2 { margin: 8px 0 0; font-size: 1.1rem; }
.profile-card .memberships { list-style: none; margin: 10px 0 0; padding: 12px 20px 0; border-top: 1px solid var(--border); width: 100%; display: grid; gap: 8px; text-align: left; font-size: .85rem; }
.profile-card .memberships li { display: flex; justify-content: space-between; gap: 8px; }
.avatar-form { display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 6px 20px 0; width: 100%; }
.avatar-form input[type=file] { font-size: .8rem; max-width: 100%; }
.avatar-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

/* ---- Modal (native <dialog>) ---- */
.modal { width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(16, 24, 40, .28); }
.modal::backdrop { background: rgba(15, 18, 22, .5); backdrop-filter: blur(2px); }
.modal[open] { animation: modal-in .16s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-panel { display: flex; flex-direction: column; max-height: calc(100vh - 50px); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 24px 14px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 1.2rem; }
.modal-head .icon-button { font-size: 1rem; width: 34px; height: 34px; justify-content: center; }
.modal-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; overflow-y: auto; }
.modal-main { padding: 20px 24px; }
.modal-side { padding: 20px 24px; background: var(--surface-2); border-left: 1px solid var(--border); }
.modal-body:not(:has(.modal-side)) { grid-template-columns: 1fr; }
.modal-foot { display: flex; gap: 8px; align-items: center; padding: 14px 24px; border-top: 1px solid var(--border); }
.modal .rte-area { min-height: 160px; }
@media (max-width: 760px) { .modal-body { grid-template-columns: 1fr; } .modal-side { border-left: 0; border-top: 1px solid var(--border); } }
.label-like { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 4px; }
.req { color: var(--danger); }
.option-list { display: flex; flex-direction: column; gap: 2px; max-height: 168px; overflow-y: auto; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 6px; }
.option-list-tags { flex-direction: row; flex-wrap: wrap; gap: 4px 10px; }
.check.option { padding: 4px 6px; border-radius: 6px; font-size: .86rem; min-width: 0; }
.check.option:hover { background: var(--surface-2); }
.input-sm { padding: 6px 9px !important; font-size: .85rem; }
.column-add-task { margin-top: 8px; width: 100%; justify-content: center; border: 1px dashed var(--border); background: transparent; color: var(--muted); font-weight: 600; font-size: .84rem; }
.column-add-task:hover { background: var(--surface); color: var(--text); border-color: var(--link); }
.project-tabs { margin-top: 12px; }
.content.mid { max-width: 1100px; }
/* Stand-alone titles in lists/tables are clearly links by position and hover; no underline needed. */
.dash-table td.task-cell a, .due-list li .truncate-block a { text-decoration: none; }
.dash-table td.task-cell a:hover, .due-list li .truncate-block a:hover { text-decoration: underline; }
.profile-grid > .card { margin-top: 0; }
.file-input-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-button { cursor: pointer; margin: 0; font-size: .8rem; }
.file-input-hidden:focus-visible + .file-button { box-shadow: var(--focus); }
.modal-body { grid-template-columns: minmax(0, 1fr) 300px; }
.task-card li a, .cards .task-card > a { text-decoration: none; }
.cards .task-card > a:hover { text-decoration: underline; }
input[type=file] { font: inherit; font-size: .84rem; color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-size: .82rem; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 6px 12px; margin-right: 10px; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--surface-2); }

/* ---------- Billing ---------- */
.billing-banner { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 10px 28px; font-size: .88rem; border-bottom: 1px solid var(--border); background: var(--tint-blue); color: var(--text); }
.billing-banner.billing-readonly { background: var(--tint-orange); }
.billing-banner a { font-weight: 650; }
.billing-grid { align-items: start; }
.price-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.price-option { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.price-option.recommended { border-color: var(--forest); box-shadow: 0 0 0 1px var(--forest); }
.price-option h3 { margin: 0; font-size: 1rem; }
.price-option .price { margin: 0; font-size: 1.1rem; }
.price-option .price strong { font-size: 1.6rem; }
.progress-warn::-webkit-progress-value { background: var(--warning); }
.progress-warn::-moz-progress-bar { background: var(--warning); }
.progress-danger::-webkit-progress-value { background: var(--danger); }
.progress-danger::-moz-progress-bar { background: var(--danger); }
@media (max-width: 720px) { .billing-banner { padding: 10px 16px; } }

/* ---------- Cookie consent (public site and app) ---------- */
.consent { position: fixed; z-index: 100; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin-inline: auto; padding: 18px 20px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: 0 18px 50px -20px rgba(0, 0, 0, .45); font-size: .92rem; }
.consent h2 { margin: 0 0 6px; font-size: 1rem; }
.consent p { margin: 0 0 12px; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.consent-actions button { flex: 1 1 180px; }
.link-button { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

/* ---------- Admin console + charts (palette validated: blue #2a78d6 / orange #eb6834, dark #3987e5 / #d95926) ---------- */
:root { --series-1: #2a78d6; --series-2: #eb6834; }
:root[data-theme=dark] { --series-1: #3987e5; --series-2: #d95926; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) { --series-1: #3987e5; --series-2: #d95926; } }
.admin-stats { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.admin-stats .stat-card { grid-template-columns: 1fr; }
.admin-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.admin-dl dt { color: var(--muted); font-weight: 600; }
.admin-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.table tr.current td { background: var(--surface-2); }
.viz { margin: 0; }
.viz-title { font-weight: 650; margin-bottom: 10px; }
.viz-bars { width: 100%; height: 140px; display: block; }
.viz-bar { fill: var(--series-1); }
.viz-hit-area { fill: transparent; }
.viz-hit:hover .viz-bar, .viz-hit:focus .viz-bar { fill: color-mix(in srgb, var(--series-1) 75%, var(--surface)); }
.viz-hit:focus { outline: none; }
.viz-hit:focus .viz-hit-area { fill: var(--surface-2); }
.viz-axis { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.viz-axis-labels { display: flex; justify-content: space-between; margin-top: 4px; }
.viz-heat { width: 100%; max-width: 520px; aspect-ratio: 1; display: block; }
.viz-page { fill: var(--surface-2); stroke: var(--border); }
.viz-grid { stroke: var(--border); stroke-dasharray: 6 8; }
.viz-dot { fill: var(--series-1); fill-opacity: .18; }
.viz-dot-rage { fill: var(--series-2); fill-opacity: .55; stroke: var(--surface); stroke-width: 2; }
.viz-legend { display: flex; gap: 16px; }
.viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.viz-key { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.viz-key-click { background: var(--series-1); }
.viz-key-rage { background: var(--series-2); }
.funnel { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.funnel li { display: grid; grid-template-columns: minmax(140px, 1.3fr) 2fr auto; gap: 12px; align-items: center; font-size: .88rem; }
.funnel-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.flow { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: start; }
.flow-center { align-self: center; color: var(--muted); }
@media (max-width: 720px) { .flow { grid-template-columns: 1fr; } .funnel li { grid-template-columns: 1fr; gap: 4px; } }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }

/* Widget handoff (QR code) */
.handoff { max-width: 460px; margin: 0 auto; text-align: center; }
.handoff .handoff-qr { display: block; margin: 8px auto; background: #fff; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); }
.handoff details input { width: 100%; margin-top: 8px; }
