/* mumus shared base styles: design tokens, reset, typography, form controls, components, banners, cookie consent.
   Loaded on every page (templates/base.html.twig); app.css adds the app, site.css the public website. No inline styles (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);   /* decorative glow only; the visible ring is the outline below */
    --focus-color: #315C43;   /* focus outline: 7.7:1 on cream/white, survives forced-colors */
    --pill-status-bg: #EEF6D3; --pill-status-fg: var(--lime-ink);
    --pill-done-bg: #d3f0dc; --pill-done-fg: #136c2e;
    --pill-high-bg: #fbeccb; --pill-high-fg: #8a5a00;
    --pill-critical-bg: #fbdcdc; --pill-critical-fg: #a1121b;
    --label-filter: none;
    --mark-bg: #f4f0a8;
    --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);
        --focus-color: #D4ED69;
        --pill-status-bg: #3B4520; --pill-status-fg: var(--lime);
        --pill-done-bg: #173b24; --pill-done-fg: #6fdc8c;
        --pill-high-bg: #3d2f10; --pill-high-fg: #e3b341;
        --pill-critical-bg: #4a1d22; --pill-critical-fg: #ff8a8a;
        --label-filter: saturate(.9) brightness(.85);
        --mark-bg: #5c5520;
        --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);
    --focus-color: #D4ED69;
    --pill-status-bg: #3B4520; --pill-status-fg: var(--lime);
    --pill-done-bg: #173b24; --pill-done-fg: #6fdc8c;
    --pill-high-bg: #3d2f10; --pill-high-fg: #e3b341;
    --pill-critical-bg: #4a1d22; --pill-critical-fg: #ff8a8a;
    --label-filter: saturate(.9) brightness(.85);
    --mark-bg: #5c5520;
    --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; }
[hidden] { display: none !important; } /* component display rules (flex/grid) must never show a hidden element */
/* 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; } }


/* ---------- 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;
}
/* Own chevron with room to breathe: the native arrow ignores padding and sits on the border. */
select:not([multiple]):not([size]) {
    appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8f86' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 14px 14px;
}
select::-ms-expand { display: none; }
/* Focus (WCAG 2.4.7 / 2.4.11): a real outline (visible at >= 3:1 and kept in forced-colors mode); the glow is decoration. */
:focus-visible { outline: 2px solid var(--focus-color); outline-offset: 2px; }
input:focus, select:focus, textarea:focus { border-color: var(--link); box-shadow: var(--focus); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus-color); outline-offset: 1px; }
main:focus-visible, [tabindex="-1"]:focus-visible { outline: none; } /* programmatic focus targets (skip link, headings) */
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 28px 4px 8px; background-position: right 8px center; background-size: 12px 12px; }
.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: var(--pill-status-bg); color: var(--pill-status-fg); }
.pill-done { background: var(--pill-done-bg); color: var(--pill-done-fg); }
/* Status badge (board column name, ui.status()): always one line; long custom names end in an ellipsis (title = full name). */
.pill-col { display: inline-block; max-width: min(16em, 100%); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; line-height: 1.5; }
td.cell-status { width: 1%; white-space: nowrap; }
.pill.via { background: color-mix(in srgb, var(--accent, #7c5cff) 14%, transparent); color: var(--text); font-weight: 600; }
.pill-high { background: var(--pill-high-bg); color: var(--pill-high-fg); }
.pill-critical { background: var(--pill-critical-bg); color: var(--pill-critical-fg); }

.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; }


/* Logo (ui.logo macro: website, auth pages, e-mail previews). */
.logo { display: inline-flex; }
.logo img { height: auto; max-width: 100%; }

/* 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; }

/* ---------- Operator maintenance / announcement banners (app and public site) ---------- */
.maintenance-banner { display: flex; gap: 12px; align-items: flex-start; padding: 10px 28px; font-size: .9rem; line-height: 1.45; border-bottom: 1px solid var(--border); border-left: 4px solid var(--border); background: var(--tint-blue); color: var(--text); }
.maintenance-banner[hidden] { display: none; }
.maintenance-banner.maintenance-info { border-left-color: #3B78C4; }
.maintenance-banner.maintenance-warning { background: var(--tint-orange); border-left-color: #D9822B; }
.maintenance-banner.maintenance-critical { background: var(--tint-red); border-left-color: var(--danger); font-weight: 600; }
.maintenance-text { margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.maintenance-text a { font-weight: 650; color: inherit; text-decoration: underline; }
.maintenance-dismiss { flex: none; min-width: 28px; min-height: 28px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; color: inherit; font-size: 1.15rem; line-height: 1; cursor: pointer; }
.maintenance-dismiss:hover { background: rgba(0, 0, 0, .07); }
.maintenance-dismiss:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }
@media (max-width: 720px) { .maintenance-banner { padding: 10px 16px; } }
.subscribe-anyway { border-top: 1px solid var(--border); padding-top: 4px; }
.subscribe-anyway[open] > summary { margin-bottom: 8px; }

/* ---------- Cookie consent (public site and app) ---------- */
.consent { position: fixed; z-index: 100; left: 16px; bottom: 16px; width: min(440px, calc(100vw - 32px)); padding: 20px 22px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .06); font-size: .9rem; line-height: 1.5; }
.consent[hidden], .consent [hidden] { display: none !important; } /* component display rules must not override [hidden] */
.consent:not([hidden]) { animation: consent-in .22s ease-out; }
@keyframes consent-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .consent:not([hidden]) { animation: none; } }
.consent-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.consent-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--tint-lime); color: var(--forest); flex: none; }
.consent h2 { margin: 0; font-size: 1.02rem; letter-spacing: -.01em; }
.consent-text { margin: 0 0 14px; color: var(--muted); }
.consent-prefs { display: grid; gap: 8px; margin: 0 0 14px; }
.consent-option { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); cursor: default; }
label.consent-option { cursor: pointer; }
.consent-option strong { display: block; font-size: .88rem; }
.consent-option p { margin: 2px 0 0; font-size: .8rem; color: var(--muted); }
.consent-always { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 600; color: var(--link); white-space: nowrap; }
.consent-switch { appearance: none; flex: none; width: 40px; height: 22px; margin: 0; border-radius: 999px; background: color-mix(in srgb, var(--muted) 55%, transparent); position: relative; cursor: pointer; transition: background .15s; }
.consent-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.consent-switch:checked { background: var(--forest); }
.consent-switch:checked::after { transform: translateX(18px); }
.consent-switch:focus-visible { outline: 2px solid var(--focus-color); outline-offset: 2px; }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.consent-btn { justify-content: center; padding: 10px 14px; background: var(--forest); border-color: var(--forest); color: #fff; }
.consent-btn:hover { background: var(--forest-700); border-color: var(--forest-700); }
.consent-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: .8rem; }
.consent-foot .link { font-size: .82rem; font-weight: 600; }
.consent-links { color: var(--muted); }
.consent-links a { color: var(--muted); }
@media (max-width: 480px) { .consent { left: 8px; right: 8px; bottom: 8px; width: auto; } .consent-actions { grid-template-columns: 1fr; } }

/* ---------- Beta badge + banner (APP_BETA) ---------- */
.beta-pill { display: inline-flex; align-items: center; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--lime); color: var(--charcoal); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; line-height: 1.5; vertical-align: middle; }
.beta-bar { margin: 0; padding: 8px 16px; text-align: center; font-size: .85rem; background: var(--charcoal); color: #f2f3ea; }
.beta-bar .beta-pill { margin: 0 6px 0 0; }
.beta-bar a { color: var(--lime); font-weight: 600; }
.link-button { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

/* Disclosure menus (<details class="menu">): app menus, website language menu. */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; 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: 34px; 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; }
