/* Hlídač Úkolů — warm paper background, one accent for priority, calm by design. */

/* Self-hosted fonts (SIL OFL 1.1, see fonts/OFL-*.txt): variable woff2 from Google Fonts, latin and latin-ext subsets only. */
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('../fonts/instrument-sans-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('../fonts/instrument-sans-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/instrument-serif-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/instrument-serif-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('../fonts/jetbrains-mono-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
    --bg: #F6F4EF;
    --bg-nav: #F1EEE7;
    --surface: #FFFFFF;
    --surface-2: #FBFAF7;
    --surface-3: #F6F4EF;
    --text: #1C1B19;
    --text-2: #4A4741;
    --muted: #6E6A62;
    --faint: #6F6B63;
    --border: #E6E2D9;
    --border-2: #D2CCBC;
    --line: #EFEBE3;
    --hover: #F1EDE4;
    --check: #8B8270;
    --field-border: #8F8674;
    --accent: #D9480F;
    --accent-text: #B23C0A;
    --accent-strong: #A3360A;
    --accent-bg: #FFF4EE;
    --accent-border: #F3D2C1;
    --accent-sel: #FCE9DF;
    --accent-chip: #FCE2D4;
    --on-accent: #FFFFFF;
    --done: #2F855A;
    --done-text: #276749;
    --done-bg: #EEF6F1;
    --done-border: #CBE4D5;
    --on-done: #FFFFFF;
    --agent: #5B5BD6;
    --agent-text: #4848C0;
    --agent-bg: #ECECFB;
    --agent-bubble: #F5F5FD;
    --agent-border: #E0E0F7;
    --group-bg: #E5EDF8;
    --group-text: #2D5A94;
    --inverse: #1C1B19;
    --inverse-text: #F6F4EF;
    --inverse-muted: #BDB7AB;
    --inverse-border: #4A4741;
    --inverse-accent: #FF9A66;
    --inverse-agent: #A9A9F5;
    --heat-0: #EFEBE3;
    --heat-1: #D3E9DB;
    --heat-2: #94C9A9;
    --heat-3: #2F855A;
    --on-heat-2: #1C1B19;
    --on-heat-3: #FFFFFF;
    --tier-master-bg: #FFF1CC;
    --tier-master-text: #7A5200;
    --tier-master-border: #EBCB7A;
    --tier-advanced-bg: #F0E8FB;
    --tier-advanced-text: #6232A0;
    --tier-advanced-border: #D7C3F2;
    --on-tier-advanced: #FFFFFF;
    --tier-basic-bg: #E1F3EF;
    --tier-basic-text: #1D6B61;
    --tier-basic-border: #B5DFD6;
    --tier-free-bg: #F1EFEA;
    --tier-free-text: #6E6A62;
    --tier-free-border: #DDD8CC;
    --shadow: 0 1px 2px rgba(28, 27, 25, 0.04);
    --shadow-lg: 0 12px 40px rgba(28, 27, 25, 0.12);
    --radius-card: 14px;
    --radius: 10px;
    --radius-row: 6px;
    --font: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --serif: 'Instrument Serif', Georgia, serif;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
    color-scheme: light;
}

/* js/theme.js sets data-theme from the choice in Settings → Display, or from the system. */
:root[data-theme="dark"] {
    --bg: #161513;
    --bg-nav: #1A1917;
    --surface: #1F1D1A;
    --surface-2: #24221F;
    --surface-3: #1A1917;
    --text: #EDEAE3;
    --text-2: #CFCAC0;
    --muted: #9A958B;
    --faint: #959188;
    --border: #2F2C28;
    --border-2: #423F39;
    --line: #2A2824;
    --hover: #282622;
    --check: #787369;
    --field-border: #757066;
    --accent: #FF7A3D;
    --accent-text: #FF9A66;
    --accent-strong: #FF9A66;
    --accent-bg: #2A1E17;
    --accent-border: #4A2D1E;
    --accent-sel: #3A2519;
    --accent-chip: #3A2519;
    --on-accent: #1C1B19;
    --done: #5FBF8A;
    --done-text: #7FD3A4;
    --done-bg: #17271E;
    --done-border: #24412F;
    --on-done: #1C1B19;
    --agent: #8D8DF2;
    --agent-text: #A9A9F7;
    --agent-bg: #24244A;
    --agent-bubble: #1F1F36;
    --agent-border: #31315A;
    --group-bg: #1B2838;
    --group-text: #8CB4E6;
    --inverse: #EDEAE3;
    --inverse-text: #1C1B19;
    --inverse-muted: #4A4741;
    --inverse-border: #BDB7AB;
    --inverse-accent: #B23C0A;
    --inverse-agent: #4848C0;
    --heat-0: #24221F;
    --heat-1: #1D3527;
    --heat-2: #2B6545;
    --heat-3: #5FBF8A;
    --on-heat-2: #EDEAE3;
    --on-heat-3: #1C1B19;
    --tier-master-bg: #3A2C0E;
    --tier-master-text: #F3C969;
    --tier-master-border: #5C4718;
    --tier-advanced-bg: #2B2140;
    --tier-advanced-text: #C9A8F5;
    --tier-advanced-border: #45346A;
    --on-tier-advanced: #1C1B19;
    --tier-basic-bg: #142E2A;
    --tier-basic-text: #7FD3C5;
    --tier-basic-border: #24504A;
    --tier-free-bg: #24221F;
    --tier-free-text: #9A958B;
    --tier-free-border: #3A3732;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
}

/* Palette "Modrá" (js/theme.js sets data-palette="blue"): cool white with navy ink in light, deep navy with white in dark.
   Priority turns cobalt, so agents move to violet and groups to teal to stay distinct from it. */
:root[data-palette="blue"] {
    --bg: #F4F7FC;
    --bg-nav: #ECF1F9;
    --surface: #FFFFFF;
    --surface-2: #F8FAFE;
    --surface-3: #EFF3FA;
    --text: #0E1A33;
    --text-2: #33425F;
    --muted: #56647F;
    --faint: #5B6984;
    --border: #DDE5F2;
    --border-2: #C3D0E6;
    --line: #E8EEF7;
    --hover: #E9EFF9;
    --check: #7D8BA6;
    --field-border: #7F8DA8;
    --accent: #1F5BD8;
    --accent-text: #1A4FBF;
    --accent-strong: #1743A3;
    --accent-bg: #EEF4FF;
    --accent-border: #C9DAFB;
    --accent-sel: #E1EBFE;
    --accent-chip: #DCE7FD;
    --on-accent: #FFFFFF;
    --done: #1F8A5B;
    --done-text: #17704A;
    --done-bg: #EAF6F0;
    --done-border: #C5E4D4;
    --on-done: #FFFFFF;
    --agent: #7A4FD6;
    --agent-text: #6A3EC6;
    --agent-bg: #F1ECFC;
    --agent-bubble: #F8F5FE;
    --agent-border: #E3D9F8;
    --group-bg: #E0F2F1;
    --group-text: #136B66;
    --inverse: #0E1A33;
    --inverse-text: #F4F7FC;
    --inverse-muted: #A9B5CC;
    --inverse-border: #33425F;
    --inverse-accent: #8CB4FF;
    --inverse-agent: #C3A8FF;
    --heat-0: #E8EEF7;
    --heat-1: #D1EBDD;
    --heat-2: #8FCBA9;
    --heat-3: #1F8A5B;
    --on-heat-2: #0E1A33;
    --on-heat-3: #FFFFFF;
    --tier-free-bg: #EFF3FA;
    --tier-free-text: #56647F;
    --tier-free-border: #D3DCEB;
    --shadow: 0 1px 2px rgba(14, 26, 51, 0.05);
    --shadow-lg: 0 12px 40px rgba(14, 26, 51, 0.14);
    --avatar-bg: #DCE5F5;
    --avatar-text: #0E1A33;
    --hero-bg: #0E1A33;
    --hero-text: #F4F7FC;
    --hero-muted: #A9B5CC;
    --swipe-1: #56647F;
    --swipe-2: #33425F;
    --swipe-3: #1B2A47;
}

:root[data-palette="blue"][data-theme="dark"] {
    --bg: #0B1426;
    --bg-nav: #0E182C;
    --surface: #121E36;
    --surface-2: #16233D;
    --surface-3: #0F1A30;
    --text: #EAF0FA;
    --text-2: #C4D0E4;
    --muted: #8E9BB5;
    --faint: #8A97B0;
    --border: #22314F;
    --border-2: #33456A;
    --line: #1C2A45;
    --hover: #1A2842;
    --check: #6F7FA0;
    --field-border: #5E6F92;
    --accent: #5B9BFF;
    --accent-text: #8AB8FF;
    --accent-strong: #8AB8FF;
    --accent-bg: #12264A;
    --accent-border: #234179;
    --accent-sel: #183262;
    --accent-chip: #1A3566;
    --on-accent: #0B1426;
    --done: #4FC28A;
    --done-text: #7DD8AA;
    --done-bg: #0F2A22;
    --done-border: #1D4A3A;
    --on-done: #0B1426;
    --agent: #A98BFF;
    --agent-text: #C2ADFF;
    --agent-bg: #241C48;
    --agent-bubble: #1A1838;
    --agent-border: #342A64;
    --group-bg: #0F2E33;
    --group-text: #7FD4CB;
    --inverse: #EAF0FA;
    --inverse-text: #0B1426;
    --inverse-muted: #44557A;
    --inverse-border: #A9B5CC;
    --inverse-accent: #1743A3;
    --inverse-agent: #5B34B8;
    --heat-0: #16233D;
    --heat-1: #173A33;
    --heat-2: #23664F;
    --heat-3: #4FC28A;
    --on-heat-2: #EAF0FA;
    --on-heat-3: #0B1426;
    --tier-free-bg: #16233D;
    --tier-free-text: #8E9BB5;
    --tier-free-border: #2A3A5A;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
    --avatar-bg: #2A3A5A;
    --avatar-text: #EAF0FA;
    --hero-bg: #060D1A;
    --hero-text: #EAF0FA;
    --hero-muted: #8E9BB5;
    --swipe-1: #4A5B7D;
    --swipe-2: #33456A;
    --swipe-3: #22314F;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}
a { color: var(--text); }
a:hover { color: var(--accent-text); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--agent); outline-offset: 2px; }
/* FocusOnNavigate moves the focus to the page's h1 for screen readers; the heading is not interactive, so no ring. */
h1:focus { outline: none; }
input::placeholder, textarea::placeholder { color: var(--faint); }
h1, h2, h3 { margin: 0; }
code, .mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Boot */
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 22px; font-weight: 700; }
.boot.loading { flex-direction: column; gap: 18px; padding: 0 16px; text-align: center; }
.boot-brand { display: flex; align-items: center; gap: 12px; }
.boot-progress { width: 160px; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.boot-progress > span { display: block; height: 100%; width: var(--blazor-load-percentage, 0%); border-radius: 2px; background: var(--text); transition: width 200ms ease; }
.boot-slow { margin: 0; max-width: 320px; font-size: 14px; font-weight: 400; color: var(--muted); }
.boot-mark, .logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--inverse); color: var(--inverse-text); display: flex; align-items: center; justify-content: center; }
#blazor-error-ui { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; padding: 12px 16px calc(12px + var(--safe-bottom)); background: var(--accent-bg); color: var(--accent-strong); border-top: 1px solid var(--accent-border); }
#blazor-error-ui .dismiss { float: right; background: none; border: 0; font-size: 20px; }

/* Shell */
.shell { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.split-view { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; }
.split-view.open { grid-template-columns: minmax(0, 1fr) 420px; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 28px 20px; border-right: 1px solid var(--border); background: var(--bg-nav); display: flex; flex-direction: column; gap: 26px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; text-decoration: none; }
.brand .logo-mark { width: 32px; height: 32px; border-radius: 9px; }
.nav-label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; color: var(--muted); padding: 0 12px 6px; text-transform: uppercase; }
.nav-links { display: flex; flex-direction: column; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--text-2); }
.nav-link:hover { background: var(--hover); color: var(--text); }
.nav-link.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 0 var(--border); }
.nav-link .count { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.nav-sub { padding: 8px 12px; font-size: 14px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-2); background: var(--surface); }
.chip-btn[aria-pressed="true"] { border-color: var(--inverse); background: var(--inverse); color: var(--inverse-text); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.agent-card { padding: 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-start; text-decoration: none; }
.agent-icon { width: 28px; height: 28px; border-radius: 8px; background: var(--agent-bg); color: var(--agent); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.me { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px; }
.me-name { min-width: 0; font-size: 13.5px; font-weight: 500; overflow-wrap: break-word; }
.me .icon-btn { width: 30px; height: 30px; }
/* The plan gets its own row under the name, so the limits are not squeezed between the avatar and the buttons. */
.me-plan { flex: 1 0 100%; padding-left: 38px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.me-plan a { display: inline-flex; text-decoration: none; border-radius: 999px; }
.me-plan a:hover .tier-pill { text-decoration: underline; }
.me-plan .tier-pill { height: 18px; padding: 0 7px; font-size: 10.5px; }
.me-plan-limits { font-size: 11.5px; line-height: 1.5; }
.me-plan-limits > span { white-space: nowrap; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--avatar-bg, #E2DCCF); color: var(--avatar-text, #1C1B19); display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600; flex: 0 0 auto; }
.main { min-width: 0; padding: 40px 32px 96px; }
.page { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.page.wide { max-width: 1080px; }
.page.medium { max-width: 920px; }
.tabbar { display: none; }
.fab { display: none; }
.offline-banner { position: sticky; top: 0; z-index: 30; background: var(--inverse); color: var(--inverse-text); text-align: center; font-size: 13.5px; padding: 8px 12px calc(8px); }
.offline-banner.quiet { font-size: 12.5px; padding: 4px 12px; }
.offline-banner button { background: none; border: 0; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; padding: 0 4px; }

/* Page header */
.eyebrow { font-size: 12.5px; font-weight: 600; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }
.display { margin: 2px 0 0; font-family: var(--serif); font-weight: 400; font-size: 52px; line-height: 1; letter-spacing: -0.01em; }
.display.md { font-size: 48px; }
.display.sm { font-size: 34px; line-height: 1.1; }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.lead { margin: 6px 0 0; color: var(--text-2); max-width: 620px; line-height: 1.5; }
.progress-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 180px; }
.progress { width: 180px; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.progress > div { height: 100%; border-radius: 3px; background: var(--done); transition: width 300ms ease; }

/* Buttons and fields */
.btn { height: 40px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--border-2); background: var(--surface); font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--hover); color: var(--text); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.btn.primary { border: 0; background: var(--inverse); color: var(--inverse-text); font-weight: 600; }
.btn.primary:hover { opacity: 0.92; color: var(--inverse-text); }
.btn.danger { color: var(--accent-strong); border-color: var(--accent-border); }
.btn.success { border: 0; background: var(--done); color: var(--on-done); font-weight: 600; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.block { width: 100%; height: 48px; border-radius: 11px; }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 0; background: var(--surface-3); display: inline-flex; align-items: center; justify-content: center; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13.5px; font-weight: 600; }
.input, .select, .textarea { height: 42px; border-radius: 9px; border: 1px solid var(--field-border); padding: 0 12px; background: var(--surface-2); outline: none; width: 100%; }
.input.lg { height: 46px; border-radius: 10px; padding: 0 14px; background: var(--surface); }
.textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--agent); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { box-shadow: 0 0 0 2px var(--agent); }
select.select, select.input { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%238C877E' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; background-size: 12px; cursor: pointer; }
select.select:disabled, select.input:disabled { cursor: default; opacity: 0.6; }
.hint { font-size: 12.5px; color: var(--muted); }
.error-text { font-size: 13.5px; color: var(--accent-strong); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--inverse); }
.card { border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--border); padding: 22px; }
.card.tight { padding: 14px 16px; }
.card h2 { font-size: 18px; font-weight: 600; }
.section-title { font-size: 18px; font-weight: 600; }
.alert { border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.alert.success { background: var(--done-bg); border: 1px solid var(--done-border); color: var(--done-text); }
.alert.warn { background: var(--accent-bg); border: 1px solid var(--accent-border); color: var(--accent-strong); }
.alert.info { background: var(--surface-3); border: 1px solid var(--border); color: var(--text-2); }
.kbd { font-size: 12px; color: var(--muted); border: 1px solid var(--border-2); border-radius: 5px; padding: 2px 6px; }
.pre { margin: 0; border-radius: 12px; background: #1C1B19; color: #EDEAE3; padding: 16px 18px; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; }
.table-wrap { border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--border); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 12px 8px; }
.table td { padding: 12px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 16px; }
.table th:last-child, .table td:last-child { padding-right: 16px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { height: 34px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; border: 1px solid var(--border-2); background: var(--surface); }
.tab[aria-selected="true"] { border-color: var(--inverse); background: var(--inverse); color: var(--inverse-text); }

/* Badges */
.badge { font-size: 12px; font-weight: 600; border-radius: 5px; padding: 2px 7px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.badge.group { color: var(--group-text); background: var(--group-bg); }
/* A group's own colour (any stored hex) never carries the text: a tint behind it and a dot in front, the name stays in the text colour. */
.badge.group.colored { color: var(--text); background: color-mix(in srgb, var(--group-color) 14%, transparent); }
.badge.group.colored::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--group-color); flex: 0 0 auto; }
.badge.agent { color: var(--agent-text); background: var(--agent-bg); }
/* Content written by an AI agent: robot + "agent <name>". A long name is cut so the badge never widens a row, a note or a toast on a phone; in a group it gets an outline, colleagues see it too. */
.badge.agent-badge { max-width: min(100%, 240px); min-width: 0; flex-shrink: 1; vertical-align: middle; }
.badge.agent-badge svg { flex: 0 0 auto; }
.badge.agent-badge.in-group { box-shadow: inset 0 0 0 1px var(--agent-text); }
.agent-badge-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge.rolled { color: var(--muted); border: 1px solid var(--border-2); font-weight: 500; padding: 1px 6px; }
.badge.prio { color: var(--accent-strong); background: var(--accent-chip); letter-spacing: 0.04em; font-size: 11px; }
.badge.done { color: var(--done-text); background: var(--done-bg); }
.badge.neutral { color: var(--text-2); background: var(--surface-3); }
.badge.due { color: var(--text-2); background: var(--surface-3); font-weight: 500; }
.badge.due.soon { color: var(--accent-strong); background: var(--accent-chip); font-weight: 600; }
.badge.due.overdue { color: var(--on-accent); background: var(--accent-strong); font-weight: 600; }
.badge.subtasks { color: var(--text-2); border: 1px solid var(--border-2); font-weight: 500; padding: 1px 6px; }
.badge.subtasks.complete { color: var(--done-text); background: var(--done-bg); border-color: var(--done-border); font-weight: 600; }
.row-meta.parent { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-count { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); }

/* Quick add */
.quick-add { display: flex; flex-direction: column; gap: 8px; position: relative; }
.quick-add-box { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 52px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border-2); box-shadow: var(--shadow); }
.quick-add-box input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font-size: 15px; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-left: 4px; }
.qchip { font-size: 12.5px; font-weight: 600; border-radius: 6px; padding: 3px 8px; border: 0; background: var(--surface-3); color: var(--text); display: inline-flex; align-items: center; gap: 5px; }
.qchip.prio { background: var(--accent-chip); color: var(--accent-strong); }
.qchip.group { background: var(--group-bg); color: var(--group-text); }
.qchip.backlog { color: var(--text-2); }
.qchip.due { background: var(--accent-chip); color: var(--accent-strong); }
.qchip.removable:hover { text-decoration: line-through; }
.qchip.removable::after { content: '×'; opacity: 0.6; }

/* Queue sections */
.section { border-radius: var(--radius-card); padding: 12px 8px 8px; }
.section.priority { background: var(--accent-bg); border: 1px solid var(--accent-border); }
.section.today { background: var(--surface); border: 1px solid var(--border); }
.section.backlog { padding: 4px 8px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px 6px; flex-wrap: wrap; }
.section-head h2 { font-size: 12.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.section.priority h2, .section.priority .section-note { color: var(--accent-text); }
.section.today h2 { color: var(--text-2); }
.section.backlog h2 { color: var(--muted); }
.section-note { font-size: 12.5px; color: var(--muted); }
.empty { padding: 10px 12px 12px; font-size: 14px; color: var(--muted); }
.skeleton { display: flex; flex-direction: column; gap: 10px; padding: 6px 0; }
.skeleton-bar { height: 40px; border-radius: 9px; background: var(--surface-3); animation: skeleton-pulse 1.4s ease-in-out infinite; }
.skeleton-bar:nth-child(3n) { width: 82%; }
.skeleton-bar:nth-child(3n + 1) { width: 64%; }
@keyframes skeleton-pulse { 50% { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) { .skeleton-bar { animation: none; } }
.load-error { display: flex; align-self: start; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-unavailable .cal-day:not(.future) { background: var(--surface-3); color: var(--muted); }
.section.drop-target, [data-section].drop-target { outline: 2px dashed var(--check); outline-offset: 2px; }
.done-toggle { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 8px; font-size: 13.5px; color: var(--done-text); font-weight: 600; text-align: left; }
.done-wrap { border-top: 1px solid var(--line); margin: 6px 4px 0; padding-top: 4px; }
.link-btn { background: none; border: 0; padding: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }

/* Task row */
.task-row { position: relative; border-radius: 9px; overflow: hidden; }
.task-row .row-content { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 2px 12px; border-radius: 9px; background: transparent; position: relative; z-index: 1; transition: background 150ms ease, transform 150ms ease; }
.section.today .task-row .row-content, .section.backlog .task-row .row-content { background: transparent; }
.task-row.selected .row-content { background: var(--hover); }
.section.priority .task-row.selected .row-content { background: var(--accent-sel); }
.task-row.keyboard .row-content { box-shadow: inset 0 0 0 2px var(--agent); }
.task-row.fresh .row-content { animation: fresh 2.4s ease; }
@keyframes fresh { 0% { background: var(--agent-bg); } 100% { background: transparent; } }
.task-row.completing .row-content { opacity: 0.85; }
.task-row.dragging { opacity: 0.5; }
.task-row.drop-target::before { content: ''; position: absolute; left: 12px; right: 12px; top: 0; height: 2px; background: var(--agent); z-index: 2; }
.task-row.lifted .row-content { background: var(--surface); box-shadow: var(--shadow-lg); }
.check-btn { flex: 0 0 auto; width: 36px; height: 36px; margin: -6px -4px -6px -8px; display: flex; align-items: center; justify-content: center; background: none; border: 0; padding: 0; }
.check-circle { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1.75px solid var(--check); background: var(--surface); transition: background 150ms ease, border-color 150ms ease; }
.check-circle.prio { border-color: var(--accent); }
.check-circle.on { border-color: var(--done); background: var(--done); color: var(--on-done); }
.check-btn:hover .check-circle:not(.on) { border-color: var(--done); }
.row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; text-align: left; background: none; border: 0; padding: 8px 0; color: inherit; }
.row-title { font-size: 15px; line-height: 1.35; }
.row-title.done { color: var(--faint); text-decoration: line-through; }
.row-title.muted { color: var(--text-2); }
.row-title.strong { font-weight: 600; }
.row-meta { font-size: 12.5px; color: var(--muted); }
.drag-handle { opacity: 0; cursor: grab; color: var(--faint); background: none; border: 0; padding: 4px; display: flex; }
.task-row:hover .drag-handle { opacity: 1; }
.row-menu { opacity: 0; flex: none; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.task-row:hover .row-menu, .row-menu:focus-visible { opacity: 1; }
.row-menu:hover { background: var(--hover); color: var(--text); }
@media (hover: none) { .row-menu { opacity: 1; } }
.row-actions { position: absolute; inset: 0; display: flex; justify-content: flex-end; align-items: stretch; z-index: 0; }
.row-actions button { border: 0; padding: 0 14px; font-size: 13px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 72px; color: #fff; }
.row-actions .a-today { background: var(--swipe-1, #6E6A62); }
.row-actions .a-tomorrow { background: var(--swipe-2, #4A4741); }
.row-actions .a-backlog { background: var(--swipe-3, #2F2C28); }
.row-actions .a-close { background: var(--surface-3); color: var(--text); }
.task-row.revealed .row-content { transform: translateX(-216px); }
.task-row.swipe-right::after { content: '✓ ' attr(data-swipe-label); position: absolute; inset: 0; background: var(--done); color: var(--on-done); font-weight: 600; display: flex; align-items: center; padding-left: 18px; z-index: 0; }

/* Decide card / night summary */
.decide { border-radius: var(--radius-card); background: var(--inverse); color: var(--inverse-text); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.decide-icon { width: 32px; height: 32px; border-radius: 9px; background: rgba(255, 122, 61, 0.18); color: var(--inverse-accent); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.decide .sub { font-size: 13px; color: var(--inverse-muted); }
.decide .title { font-size: 17px; font-weight: 600; }
.decide .btn { height: 38px; background: transparent; color: var(--inverse-text); border: 1px solid var(--inverse-border); }
.decide .btn.light { background: var(--inverse-text); color: var(--inverse); border: 0; font-weight: 600; }
:root[data-palette="blue"] .decide-icon { background: rgba(140, 180, 255, 0.18); }
.decide .agent-hint { display: flex; gap: 10px; align-items: flex-start; background: rgba(141, 141, 242, 0.12); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.night { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--border); padding: 14px 16px; }
.night .stats { display: flex; gap: 18px; }
.night .stat b { font-size: 20px; display: block; line-height: 1.1; }
.night .stat span { font-size: 12.5px; color: var(--muted); }

/* Detail panel */
.detail { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-left: 1px solid var(--border); padding: 24px 24px 32px; display: flex; flex-direction: column; gap: 20px; }
.detail-backdrop { display: none; }
.detail-title { margin: 0; font-size: 22px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; flex: 1; border: 0; background: transparent; padding: 4px 6px; margin-left: -6px; border-radius: 6px; width: 100%; resize: none; overflow: auto; field-sizing: content; }
.detail-title:hover:not(:disabled) { background: var(--surface-3); }
.detail-title.done { color: var(--faint); text-decoration: line-through; }
.detail-title-box { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.detail-title-box .detail-title { flex: none; }
.detail-title-box .alert { margin-top: 6px; padding: 8px 10px; }
.title-saved { color: var(--done-text); }
.props { margin: 0; display: grid; grid-template-columns: 96px minmax(0, 1fr); row-gap: 10px; column-gap: 12px; font-size: 14px; align-items: center; }
.props dt { color: var(--muted); }
.props dd { margin: 0; }
.pill-btn { height: 30px; padding: 0 10px; border-radius: 7px; font-size: 13.5px; font-weight: 600; border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2); }
.pill-btn.on { border-color: var(--accent-border); background: var(--accent-chip); color: var(--accent-strong); }
.notes { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); padding-top: 18px; }
.note { display: flex; gap: 10px; }
.note-bubble { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--line); }
.note.agent .note-bubble { background: var(--agent-bubble); border-color: var(--agent-border); }
.note-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.note-author { font-size: 13.5px; font-weight: 600; }
.note-time { font-size: 12px; color: var(--muted); }
.note-body { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.note-body p { margin: 0 0 6px; }
.note-body p:last-child { margin: 0; }
.note-body ul { margin: 0; padding-left: 18px; }
.note-body code { background: var(--surface-2); border-radius: 4px; padding: 0 4px; font-size: 12.5px; }
.history { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.history summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.history-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--text-2); }
.history-item .at { color: var(--faint); min-width: 84px; }
.sheet-handle { display: none; }

/* Toast */
.toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; background: var(--inverse); color: var(--inverse-text); border-radius: 10px; padding: 10px 12px 10px 16px; font-size: 14px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 12px; max-width: min(560px, 92vw); }
.toast button { background: none; border: 0; color: var(--inverse-text); font-weight: 700; text-decoration: underline; padding: 4px; }
.toast.error { background: var(--accent-strong); color: var(--on-accent); }
.toast-region { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast .toast-close { text-decoration: none; font-size: 18px; line-height: 1; font-weight: 400; padding: 4px 6px; opacity: .8; }
.toast .toast-close:hover { opacity: 1; }

/* Menu / popover */
.menu-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(28, 27, 25, 0.25); display: flex; align-items: flex-end; justify-content: center; }
.menu { width: min(420px, 100%); background: var(--surface); border-radius: 16px 16px 0 0; padding: 12px 12px calc(16px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 4px; }
.menu button { height: 48px; border: 0; background: none; text-align: left; padding: 0 14px; border-radius: 10px; font-size: 15px; }
.menu button:hover { background: var(--hover); }
.menu .menu-title { font-weight: 600; padding: 8px 14px; color: var(--muted); font-size: 13px; }
.menu .menu-text { margin: 0; padding: 0 14px 8px; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.menu .menu-field { padding: 0 14px 8px; }
.menu .menu-danger { color: var(--accent-strong); font-weight: 600; }
.menu button:disabled { opacity: 0.5; cursor: default; background: none; }
@media (min-width: 761px) { .menu-backdrop { align-items: center; } .menu { border-radius: 16px; } }
.drop-subtasks { max-height: calc(100dvh - 24px - var(--safe-top)); }
.drop-subtasks-list { display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; min-height: 0; max-height: min(50dvh, 360px); padding: 0 14px 4px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.drop-subtask { padding: 11px 0; min-height: 44px; cursor: pointer; }
.drop-subtask + .drop-subtask { border-top: 1px solid var(--line); }
.drop-subtask:has(input:disabled) { cursor: default; }
.drop-subtask:has(input:disabled) .drop-subtask-title { color: var(--muted); }
.drop-subtask-title { overflow-wrap: anywhere; }

/* Info hint (Components/InfoHint.razor, js/app.js): a quiet "i" next to a heading or label, its popover anchored under it (or above
   with no room below) and shifted by --hint-shift to stay on screen. The caret hangs off the button, so it points at it after a shift. */
.info-hint { position: relative; display: inline-flex; vertical-align: middle; font-size: 13.5px; font-weight: 400; font-family: var(--font); letter-spacing: normal; text-align: left; text-transform: none; line-height: 1.45; }
.info-hint-btn { position: relative; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; transition: color 0.12s, background-color 0.12s; }
.info-hint-btn::before { content: ''; position: absolute; inset: -10px; }
.info-hint-btn:hover, .info-hint-btn[aria-expanded="true"] { color: var(--text); background: var(--hover); }
.info-hint-btn[aria-expanded="true"]::after { content: ''; position: absolute; left: 50%; top: calc(100% + 4px); z-index: 51; width: 10px; height: 10px; margin-left: -5px; background: var(--surface); border: 1px solid var(--border-2); border-right: 0; border-bottom: 0; transform: rotate(45deg); }
.info-hint.above .info-hint-btn[aria-expanded="true"]::after { top: auto; bottom: calc(100% + 4px); transform: rotate(225deg); }
.info-hint-pop { position: absolute; top: calc(100% + 9px); left: -14px; z-index: 50; display: block; width: min(320px, calc(100vw - 32px)); padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border-2); box-shadow: var(--shadow-lg); color: var(--text-2); cursor: auto; translate: var(--hint-shift, 0px) 0; animation: hint-in 0.14s ease-out; }
.info-hint-pop[hidden] { display: none; }
:root[data-theme="dark"] .info-hint-pop, :root[data-theme="dark"] .info-hint-btn[aria-expanded="true"]::after { background: var(--surface-2); }
.info-hint.above .info-hint-pop { top: auto; bottom: calc(100% + 9px); }
.info-hint-pop::before { content: ''; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.info-hint.above .info-hint-pop::before { top: auto; bottom: -12px; }
@keyframes hint-in { from { opacity: 0; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .info-hint-pop { animation: none; } .info-hint-btn { transition: none; } }
.roles-help { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.roles-help > div { display: grid; grid-template-columns: 76px minmax(0, 1fr); column-gap: 10px; line-height: 1.4; }
.roles-help dt { font-weight: 600; color: var(--text); }
.roles-help dd { margin: 0; }
.roles-help-note { display: block; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.heading-row { display: flex; align-items: center; gap: 6px; }
.label-row { display: flex; align-items: center; gap: 4px; }

/* Group members */
.member-row .grow { min-width: 160px; }
.member-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.member-actions .select { width: auto; height: 44px; }
.member-actions .icon-btn, .member-actions .btn { width: auto; min-width: 44px; height: 44px; }

/* Search */
.search-overlay { position: fixed; inset: 0; z-index: 95; background: rgba(28, 27, 25, 0.3); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.search-box { width: min(640px, 100%); background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 12px; display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow: auto; }

/* Calendar */
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head { font-size: 12px; color: var(--muted); text-align: center; }
.cal-day { aspect-ratio: 1; width: 100%; border-radius: 9px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 0; border: 1px solid transparent; }
.cal-day .n { font-size: 13px; font-weight: 600; }
.cal-day .c { font-size: 11px; opacity: 0.85; }
.cal-day.h0 { background: var(--heat-0); color: var(--muted); }
.cal-day.h1 { background: var(--heat-1); color: var(--text); }
.cal-day.h2 { background: var(--heat-2); color: var(--on-heat-2); }
.cal-day.h3 { background: var(--heat-3); color: var(--on-heat-3); }
.cal-day.future { background: var(--surface); color: var(--faint); border: 1px dashed var(--border-2); }
.cal-day.today { border: 2px solid var(--accent); }
.cal-day[aria-pressed="true"] { border: 2px solid var(--text); }
.legend { display: flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.legend span { width: 14px; height: 14px; border-radius: 4px; }
.journal-h3 { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.journal-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 15px; }
.journal-link { min-width: 0; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.journal-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.mini-check { width: 18px; height: 18px; border-radius: 50%; background: var(--done); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; color: var(--on-done); }
.mini-open { width: 18px; height: 18px; border-radius: 50%; border: 1.75px solid var(--check); flex: 0 0 auto; }
.split { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }

/* Auth */
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; }
.auth-hero { flex: 1 1 420px; background: var(--hero-bg, #1C1B19); color: var(--hero-text, #F6F4EF); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-hero h1 { font-family: var(--serif); font-weight: 400; font-size: 52px; line-height: 1.05; max-width: 440px; }
.auth-hero .logo-mark { background: var(--hero-text, #F6F4EF); color: var(--hero-bg, #1C1B19); }
.auth-hero-foot { display: flex; align-items: baseline; justify-content: flex-start; flex-wrap: wrap; gap: 8px 24px; font-size: 13.5px; color: var(--hero-muted, #BDB7AB); }
.auth-hero-foot a { color: var(--hero-text, #F6F4EF); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(246, 244, 239, 0.4); text-underline-offset: 3px; }
.auth-hero-foot a:hover { text-decoration-color: var(--hero-text, #F6F4EF); }
.auth-sample { max-width: 360px; border-radius: 14px; background: var(--hero-text, #F6F4EF); color: var(--hero-bg, #1C1B19); padding: 14px; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; }
.auth-main { flex: 1 1 420px; padding: 48px 32px; display: flex; align-items: center; justify-content: center; }
.auth-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.auth-form h2 { font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.lang-switch { position: absolute; top: calc(12px + var(--safe-top)); right: 12px; z-index: 10; display: flex; gap: 2px; padding: 2px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface); }
.lang-switch button { height: 28px; min-width: 36px; padding: 0 8px; border: 0; border-radius: 6px; background: none; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.lang-switch button[aria-pressed="true"] { background: var(--inverse); color: var(--inverse-text); }
.center-card { min-height: 100vh; padding: 48px 16px; display: flex; align-items: center; justify-content: center; }
.center-card > main { width: 100%; max-width: 480px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); padding: 32px; display: flex; flex-direction: column; gap: 22px; }
.consent-option { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 10px; background: var(--surface-3); }
.consent-option.optional { background: transparent; border: 1px dashed var(--border-2); }

/* Settings */
.settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 24px; align-self: start; }
.settings-nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--text-2); font-size: 14px; }
.settings-nav a.active { background: var(--hover); color: var(--text); font-weight: 600; }
.settings-nav .nav-short { display: none; }
.card-desc { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.passkey-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.passkey-item { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.passkey-item:last-child { border-bottom: 1px solid var(--line); }
.passkey-item .grow { min-width: 180px; display: flex; flex-direction: column; gap: 2px; }
.passkey-name { font-weight: 600; overflow-wrap: anywhere; }
.passkey-actions { display: flex; gap: 8px; margin-left: auto; }
.passkey-add { display: flex; gap: 8px; max-width: 520px; }
.passkey-add .input { flex: 1; min-width: 0; }
.palette-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.palette-option { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; }
.palette-option:hover { background: var(--hover); }
.palette-option:has(input:checked) { border-color: var(--inverse); box-shadow: inset 0 0 0 1px var(--inverse); }
.palette-option:has(input:focus-visible) { outline: 2px solid var(--agent); outline-offset: 2px; }
.palette-option input { position: absolute; opacity: 0; pointer-events: none; }
.palette-preview { display: grid; grid-template-columns: 1fr 1fr; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.palette-half { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 0 12px; }
.palette-bar { width: 70%; height: 6px; border-radius: 3px; }
.palette-dot { width: 18px; height: 18px; border-radius: 50%; }
.palette-label { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.palette-option:has(input:checked) .palette-label::after { content: '✓'; margin-left: auto; color: var(--done-text); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cards-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.link-card { border-radius: 12px; background: var(--surface); border: 1px solid var(--border); padding: 14px 16px; text-decoration: none; display: flex; flex-direction: column; gap: 4px; }

/* Responsive */
@media (max-width: 1100px) {
    .split-view.open { grid-template-columns: minmax(0, 1fr); }
    .detail { position: fixed; right: 0; top: 0; bottom: 0; width: min(420px, 100%); z-index: 60; box-shadow: var(--shadow-lg); }
    .detail-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(28, 27, 25, 0.2); }
}

@media (max-width: 760px) {
    body { font-size: 16px; }
    .shell { display: block; }
    .sidebar { display: none; }
    .main { padding: calc(20px + var(--safe-top)) 16px calc(96px + var(--safe-bottom)); }
    .display { font-size: 40px; }
    .display.md { font-size: 38px; }
    .page { gap: 18px; }
    .progress-wrap { min-width: 0; }
    .progress { width: 120px; }
    .desktop-only { display: none !important; }
    .task-row .row-content { min-height: 52px; }
    .drag-handle, .row-menu { display: none; }
    .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--bg-nav); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + var(--safe-bottom)); }
    .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; text-decoration: none; color: var(--muted); padding: 4px 0; }
    .tabbar a.active { color: var(--text); font-weight: 600; }
    .fab { display: flex; position: fixed; right: 18px; bottom: calc(76px + var(--safe-bottom)); z-index: 45; width: 56px; height: 56px; border-radius: 18px; border: 0; background: var(--inverse); color: var(--inverse-text); align-items: center; justify-content: center; box-shadow: var(--shadow-lg); }
    .mobile-add { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; background: var(--surface); border-top: 1px solid var(--border); padding: 12px 12px calc(12px + var(--safe-bottom)); box-shadow: var(--shadow-lg); }
    .mobile-add-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -4px 0 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
    .detail { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100%; height: auto; max-height: 82vh; border-left: 0; border-radius: 20px 20px 0 0; padding: 8px 18px calc(24px + var(--safe-bottom)); z-index: 60; }
    .detail.full { top: 0; max-height: none; border-radius: 0; padding-top: calc(12px + var(--safe-top)); }
    .detail-backdrop { background: rgba(28, 27, 25, 0.35); }
    .sheet-handle { display: flex; justify-content: center; padding: 6px 0 2px; background: none; border: 0; width: 100%; }
    .sheet-handle span { width: 40px; height: 5px; border-radius: 3px; background: var(--border-2); }
    .toasts { bottom: calc(150px + var(--safe-bottom)); }
    /* minmax(0, …): a wide child (the token table) must scroll inside its wrap, not widen the page. */
    .settings-layout { grid-template-columns: minmax(0, 1fr); }
    .settings-layout { gap: 20px; }
    /* On a phone the section list becomes a grid of equal chips with one-word names: every section stays visible and none is cut off at the edge. */
    .settings-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; position: static; }
    .settings-nav .nav-label, .settings-nav .nav-long { display: none; }
    .settings-nav .nav-short { display: inline; }
    .settings-nav a { display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface); font-size: 13.5px; white-space: nowrap; }
    .settings-nav a.active { border-color: var(--inverse); background: var(--inverse); color: var(--inverse-text); }
    .passkey-actions { margin-left: 0; }
    .passkey-add { flex-direction: column; max-width: none; }
    .passkey-add .input { flex: none; }
    .grid-2 { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .card { padding: 18px; }
}

@media (min-width: 761px) {
    .mobile-only { display: none !important; }
}
.content { min-width: 0; }

.due-soon { border-radius: var(--radius-card); background: var(--accent-bg); border: 1px solid var(--accent-border); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.due-soon h2 { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-text); display: flex; align-items: center; gap: 6px; }
.due-soon-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14.5px; }
.due-soon-item .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.subtasks-box { display: flex; flex-direction: column; gap: 8px; }
.subtasks-head { display: flex; align-items: center; gap: 10px; }
.subtasks-head h3 { font-size: 15px; font-weight: 600; }
.subtasks-progress { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.subtasks-progress > div { height: 100%; background: var(--done-text); }
.subtask { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 8px; }
.subtask:hover { background: var(--surface-3); }
.subtask .check-btn { margin: -6px -4px -6px -6px; }
.subtask-title { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; color: var(--text); font: inherit; font-size: 14.5px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; }
.subtask-title.done { color: var(--muted); text-decoration: line-through; }
.subtask-title.dropped { color: var(--muted); text-decoration: line-through; font-style: italic; }
.due-text { font-weight: 500; }
.due-text.soon { color: var(--accent-strong); font-weight: 600; }
.due-text.overdue { color: var(--accent-strong); font-weight: 700; }
.parent-link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-text); cursor: pointer; text-align: left; }
.parent-link:disabled { color: var(--text-2); cursor: default; }

/* Tiers */
.tier-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; border: 1px solid; white-space: nowrap; }
.tier-pill.lg { height: 26px; padding: 0 12px; font-size: 12.5px; }
.tier-master { color: var(--tier-master-text); background: var(--tier-master-bg); border-color: var(--tier-master-border); }
.tier-pill.tier-master { background: linear-gradient(135deg, var(--tier-master-bg), color-mix(in srgb, var(--tier-master-border) 45%, var(--tier-master-bg))); }
.tier-advanced { color: var(--tier-advanced-text); background: var(--tier-advanced-bg); border-color: var(--tier-advanced-border); }
.tier-basic { color: var(--tier-basic-text); background: var(--tier-basic-bg); border-color: var(--tier-basic-border); }
.tier-free, .tier-invited { color: var(--tier-free-text); background: var(--tier-free-bg); border-color: var(--tier-free-border); }
.blocked-pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--on-accent); background: var(--accent-strong); }
.blocked-pill.lg { height: 26px; padding: 0 12px; font-size: 12.5px; }
.plan-card { display: flex; flex-direction: column; gap: 10px; }

/* Admin */
.logo-mark.admin, .avatar.admin { background: var(--inverse); color: var(--inverse-text); }
.brand-sub { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.admin-note { color: var(--muted); padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--border-2); line-height: 1.4; }
.admin-search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border-2); color: var(--muted); width: min(340px, 100%); }
.admin-search:focus-within { border-color: var(--agent); box-shadow: 0 0 0 1px var(--agent); }
.admin-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.kpi.warn { border-color: var(--accent-border); background: var(--accent-bg); }
.kpi-button { font: inherit; color: inherit; text-align: left; cursor: pointer; }
.kpi-button:hover { border-color: var(--accent); }
.kpi-label { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.kpi-value { font-family: var(--serif); font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-note { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-table { border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.admin-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 96px 84px 120px 104px; align-items: center; gap: 12px; padding: 8px 16px; border-top: 1px solid var(--line); min-height: 52px; }
.admin-row.head { border-top: 0; min-height: 40px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface-2); }
.admin-row.depth-0 { background: var(--surface); }
.admin-row.depth-1 { background: var(--surface-2); }
.admin-row.depth-1 .tree-cell { padding-left: 26px; }
.admin-row.depth-2 .tree-cell { padding-left: 56px; }
.admin-row.blocked .user-name-main { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--accent-border); }
.admin-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-group { padding: 10px 16px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--line); background: var(--surface-3); }
.admin-empty { padding: 18px 16px; border-top: 1px solid var(--line); }
.tree-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tree-toggle { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 6px; border: 0; background: none; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; transition: transform 150ms ease; }
.tree-toggle:hover { background: var(--hover); color: var(--text); }
.tree-toggle.open svg { transform: rotate(90deg); }
.tree-toggle svg { transition: transform 150ms ease; }
.tree-toggle:disabled { visibility: hidden; }
.tree-leaf { width: 24px; flex: 0 0 auto; }
.tree-group { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-group .dot { width: 10px; height: 10px; border-radius: 3px; }
.tree-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.user-name { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.user-name:hover .user-name-main { color: var(--accent-text); }
.user-name-text { display: flex; flex-direction: column; min-width: 0; }
.user-name-main { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-name-mail { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar.sm { width: 28px; height: 28px; font-size: 11.5px; }
.avatar.xl { width: 64px; height: 64px; font-size: 22px; }
.role-tag { font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--border-2); border-radius: 5px; padding: 0 5px; text-transform: lowercase; }
.num-sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.activity-cell { display: flex; align-items: center; gap: 8px; }
.activity-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; min-width: 40px; }
.activity-bar > span { display: block; height: 100%; border-radius: 3px; background: var(--done); }
.sort-head { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; display: inline-flex; gap: 4px; align-items: center; }
.sort-head.num { justify-content: flex-end; }
.sort-head.active { color: var(--text); }
.tier-tab { display: inline-flex; align-items: center; gap: 6px; }
.owner-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; font-size: 13.5px; min-width: 0; }
.owner-cell a { text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); text-decoration: none; }
.admin-head { display: flex; align-items: center; gap: 18px; }
.group-mark { width: 64px; height: 64px; border-radius: 16px; color: #fff; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.group-line { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 0 -10px; border-radius: 8px; text-decoration: none; }
.group-line:hover { background: var(--hover); }
.tier-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tier-option { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); text-align: left; color: var(--text); }
.tier-option[aria-checked="true"] { border-width: 2px; padding: 9px 11px; box-shadow: var(--shadow); }
.tier-option.tier-master[aria-checked="true"] { border-color: var(--tier-master-text); }
.tier-option.tier-advanced[aria-checked="true"] { border-color: var(--tier-advanced-text); }
.tier-option.tier-basic[aria-checked="true"] { border-color: var(--tier-basic-text); }
.tier-option.tier-free[aria-checked="true"], .tier-option.tier-invited[aria-checked="true"] { border-color: var(--tier-free-text); }
.tier-option:not([aria-checked="true"]) { background: var(--surface); border-color: var(--border-2); }
.usage-lines { display: flex; flex-direction: column; gap: 10px; }
.usage-meter { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 4px; }
.usage-meter > div { height: 100%; border-radius: 3px; background: var(--done); }
.usage-line.over .usage-meter > div { background: var(--accent-strong); }
.over-text { color: var(--accent-strong); font-weight: 600; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.week-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; align-items: end; height: 140px; }
.week-col { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.week-bar { border-radius: 4px 4px 2px 2px; background: var(--heat-2); min-height: 2px; }
.week-col:last-child .week-bar { background: var(--done); }
.week-label { font-size: 10.5px; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; }

@media (max-width: 900px) {
    .admin-row { grid-template-columns: minmax(0, 1fr) 96px 64px 96px; gap: 8px; padding: 8px 12px; }
    .admin-row .hide-sm { display: none; }
    .admin-row.depth-1 .tree-cell { padding-left: 14px; }
    .admin-row.depth-2 .tree-cell { padding-left: 30px; }
    .tree-count { display: none; }
}

@media (max-width: 560px) {
    .admin-row { grid-template-columns: minmax(0, 1fr) auto; }
    .admin-row > :nth-child(n+3) { display: none; }
    .admin-row.depth-1 .tree-cell { padding-left: 8px; }
    .admin-row.depth-2 .tree-cell { padding-left: 18px; }
    .role-tag { display: none; }
    .kpi-value { font-size: 28px; }
    .admin-head { align-items: flex-start; }
    .avatar.xl, .group-mark { width: 48px; height: 48px; font-size: 17px; }
    .week-label { font-size: 9px; }
    .week-col:nth-child(odd) .week-label { visibility: hidden; }
}

/* Quick add suggestions (@firma/jméno) */
.qchip.group.unknown { background: var(--accent-chip); color: var(--accent-strong); }
.suggest { position: absolute; top: 58px; left: 0; right: 0; z-index: 50; list-style: none; margin: 0; padding: 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border-2); box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; }
.suggest-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.suggest-item.active, .suggest-item:hover { background: var(--hover); }
.suggest-group { width: 12px; height: 12px; border-radius: 4px; flex: 0 0 auto; margin: 0 8px; }
.suggest-label { display: block; font-size: 14px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-label b { color: var(--text); font-weight: 600; }
.suggest-sub { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-token { font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.mobile-add .suggest { top: auto; bottom: calc(100% + 8px); }
@media (max-width: 560px) { .suggest-token { display: none; } }

/* Help ("?") */
.help-backdrop { position: fixed; inset: 0; z-index: 95; background: rgba(28, 27, 25, 0.35); display: flex; align-items: center; justify-content: center; padding: 16px; }
.help { width: min(640px, 100%); max-height: min(86vh, 900px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 22px 24px 24px; outline: none; display: flex; flex-direction: column; gap: 16px; }
.help-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.help-head h2 { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.1; margin-top: 2px; }
.help-body { display: flex; flex-direction: column; gap: 18px; }
.help-lead { margin: 0; color: var(--text-2); line-height: 1.5; }
.help-section h3 { font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.help-section dl { margin: 0; display: flex; flex-direction: column; }
.help-row { display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr); gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); align-items: baseline; }
.help-row dt { display: flex; flex-wrap: wrap; gap: 4px; }
.help-row dd { margin: 0; font-size: 14px; color: var(--text-2); }
.help-row kbd { font-family: var(--mono); font-size: 12.5px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-2); border-bottom-width: 2px; background: var(--surface-2); color: var(--text); white-space: nowrap; }
.help-btn { font-weight: 700; font-size: 15px; color: var(--text-2); }
.page-actions { display: flex; gap: 6px; }
.composer-help { display: block; margin: 4px auto 0; }
@media (max-width: 760px), (hover: none) and (pointer: coarse) {
    .page-actions .icon-btn, .journal-link, .composer-help { min-width: 44px; min-height: 44px; }
    .page-actions .icon-btn { width: 44px; height: 44px; }
}
@media (max-width: 760px) {
    .help-backdrop { align-items: flex-end; padding: 0; }
    .help { border-radius: 18px 18px 0 0; max-height: 88vh; padding-bottom: calc(24px + var(--safe-bottom)); }
    .help-row { grid-template-columns: 1fr; gap: 4px; }
}

/* Plan banner (free) */
.plan-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 32px; background: var(--tier-free-bg); border-bottom: 1px solid var(--tier-free-border); font-size: 14px; color: var(--text-2); }
.plan-banner.low { background: var(--accent-bg); border-bottom-color: var(--accent-border); }
.plan-banner.reached { background: var(--accent-strong); border-bottom-color: var(--accent-strong); color: var(--on-accent); }
.plan-banner.reached b { color: var(--on-accent); }
.plan-banner-text { flex: 1 1 260px; min-width: 0; }
.plan-banner-text b { color: var(--text); }
.plan-banner-meter { width: 120px; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; }
.plan-banner-meter > span { display: block; height: 100%; border-radius: 3px; background: var(--done); }
.plan-banner.low .plan-banner-meter > span { background: var(--accent); }
.plan-banner.reached .plan-banner-meter > span { background: var(--on-accent); }
.plan-banner-cta { font-weight: 700; text-decoration: none; white-space: nowrap; color: var(--accent-text); }
.plan-banner.reached .plan-banner-cta { color: var(--on-accent); text-decoration: underline; }
@media (max-width: 760px) { .plan-banner { padding: calc(8px + var(--safe-top)) 16px 8px; } .plan-banner-meter { display: none; } }

/* Pricing page */
.pricing-page { min-height: 100vh; background: var(--bg); }
.pricing-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 32px; max-width: 1240px; margin: 0 auto; }
.pricing-main { max-width: 1240px; margin: 0 auto; padding: 24px 32px 96px; display: flex; flex-direction: column; gap: 64px; }
.pricing-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pricing-hero .display { font-size: 60px; }
.pricing-hero .lead { max-width: 640px; }
.billing-toggle { display: inline-flex; gap: 4px; padding: 4px; margin-top: 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border-2); }
.billing-toggle button { height: 38px; padding: 0 18px; border-radius: 999px; border: 0; background: none; font-size: 14px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 8px; }
.billing-toggle button[aria-checked="true"] { background: var(--inverse); color: var(--inverse-text); }
.save-tag { font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--done-bg); color: var(--done-text); }
.billing-toggle button[aria-checked="true"] .save-tag { background: var(--done); color: var(--on-done); }
.plan-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 26px 22px 24px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.plan-card.featured { border: 2px solid var(--tier-advanced-text); padding: 25px 21px 23px; box-shadow: var(--shadow-lg); }
.plan-card.current { outline: 2px dashed var(--border-2); outline-offset: 4px; }
.plan-flag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); padding: 3px 12px; border-radius: 999px; background: var(--tier-advanced-text); color: var(--on-tier-advanced); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; }
.plan-card-head { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 92px; }
.plan-tagline { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.45; }
.plan-price { display: flex; align-items: baseline; gap: 6px; }
.plan-amount { font-family: var(--serif); font-size: 46px; line-height: 1; font-variant-numeric: tabular-nums; }
.plan-amount.sm { font-size: 34px; }
.plan-period { color: var(--muted); font-size: 14px; }
.plan-billing { min-height: 20px; white-space: pre-line; }
.plan-cta-note { margin: -6px 0 0; display: flex; flex-direction: column; gap: 6px; }
.plan-cta-note p { margin: 0; white-space: pre-line; }
.plan-cta-note code { overflow-wrap: anywhere; }
.plan-features { list-style: none; margin: 4px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 9px; font-size: 14px; color: var(--text-2); }
.plan-features li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.4; }
.plan-features li svg { flex: 0 0 auto; margin-top: 2px; color: var(--done); }
.plan-features li.strong { color: var(--text); font-weight: 600; }
.compare { display: flex; flex-direction: column; gap: 18px; }
.compare h2, .faq h2 { text-align: center; }
.compare-table { min-width: 720px; }
.compare-table th[scope="col"] { text-align: center; padding: 16px 8px; }
.compare-table td { text-align: center; font-variant-numeric: tabular-nums; }
.compare-table th[scope="row"] { font-weight: 500; color: var(--text); padding: 12px 8px 12px 16px; border-top: 1px solid var(--line); text-align: left; font-size: 14px; }
.compare-table tr.group th { background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 10px 16px; border-top: 1px solid var(--line); text-align: left; }
.cmp-yes { color: var(--done); display: inline-flex; }
.cmp-no { color: var(--faint); }
.faq { display: flex; flex-direction: column; gap: 10px; max-width: 760px; width: 100%; margin: 0 auto; }
.faq h2 { margin-bottom: 8px; }
.faq-item { border-radius: 12px; background: var(--surface); border: 1px solid var(--border); padding: 0 18px; }
.faq-item summary { cursor: pointer; padding: 16px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq-item summary::after { content: '+'; color: var(--muted); font-weight: 400; font-size: 20px; line-height: 1; }
.faq-item[open] summary::after { content: '–'; }
.faq-item p { margin: 0 0 16px; color: var(--text-2); line-height: 1.55; white-space: pre-line; }
@media (max-width: 1100px) { .plan-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; } }
@media (max-width: 640px) {
    .pricing-top { padding: calc(14px + var(--safe-top)) 16px 10px; }
    .pricing-main { padding: 12px 16px 64px; gap: 48px; }
    .pricing-hero .display { font-size: 40px; }
    .plan-cards { grid-template-columns: minmax(0, 1fr); }
    .plan-card-head { min-height: 0; }
}

/* Admin pricing editor */
.pricing-editor { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.pricing-edit-card { gap: 12px; border-top-width: 4px; }
.tier-edge-free, .tier-edge-invited { border-top-color: var(--tier-free-border); }
.tier-edge-basic { border-top-color: var(--tier-basic-text); }
.tier-edge-advanced { border-top-color: var(--tier-advanced-text); }
.tier-edge-master { border-top-color: var(--tier-master-border); }
.field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.field-pair .field label { font-size: 12.5px; }
@media (max-width: 1100px) { .pricing-editor { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .pricing-editor { grid-template-columns: minmax(0, 1fr); } }

/* Quick add composer: title, attached note and preview in one card */
.composer-box { border-radius: 12px; background: var(--surface); border: 1px solid var(--border-2); box-shadow: var(--shadow); transition: border-color 0.15s, box-shadow 0.15s; }
.composer-box:focus-within { border-color: var(--agent); box-shadow: var(--shadow), 0 0 0 1px var(--agent); }
.search-box .quick-add-box:focus-within { border-color: var(--agent); box-shadow: var(--shadow), 0 0 0 1px var(--agent); }
.composer-box .quick-add-box { border: 0; box-shadow: none; background: transparent; border-radius: 12px 12px 0 0; }
.quick-add-submit { flex: none; width: 32px; height: 32px; margin-right: -6px; border: 0; border-radius: 8px; background: var(--inverse); color: var(--inverse-text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.quick-add-submit:disabled { opacity: 0.5; cursor: default; }
.quick-add-limit { margin: 0; padding: 8px 14px; font-size: 13px; color: var(--accent-strong); background: var(--accent-bg); border-top: 1px solid var(--line); }
.quick-add-limit a { font-weight: 600; color: inherit; }
@media (hover: none) and (pointer: coarse) { .quick-add .kbd { display: none; } .quick-add-submit { width: 40px; height: 40px; } }
.composer-note textarea { display: block; width: 100%; min-height: 28px; max-height: 240px; field-sizing: content; resize: none; border: 0; outline: none; background: transparent; padding: 0 14px 10px 46px; font: inherit; font-size: 14px; line-height: 1.45; color: var(--text); }
.composer-note textarea::placeholder { color: var(--faint); }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 8px 12px 8px 14px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 60%, transparent); border-radius: 0 0 12px 12px; }
.composer-foot .quick-chips { padding-left: 0; }
.composer-hint { font-size: 12px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.quick-add.compact .composer-box { box-shadow: none; border-radius: 9px; }
.quick-add.compact .quick-add-box { height: 40px; padding: 0 10px; }
.quick-add.compact .quick-add-box input { font-size: 14px; }
.quick-add.compact .composer-note textarea { padding-left: 38px; font-size: 13.5px; }
.quick-add.compact .composer-hint { display: none; }
.quick-add.compact .kbd { display: none; }
.quick-add.compact .quick-add-submit { width: 28px; height: 28px; margin-right: -4px; }
.quick-add.compact .suggest { top: 46px; }
@media (max-width: 560px) { .composer-hint { display: none; } }
/* iOS Safari zooms into any field under 16px on focus. */
@media (max-width: 760px), (hover: none) and (pointer: coarse) {
    .input, .select, .textarea, .admin-search input, .quick-add-box input, .composer-note textarea,
    .quick-add.compact .quick-add-box input, .quick-add.compact .composer-note textarea { font-size: 16px; }
}

/* Shared tasks */
.badge.shared { color: var(--group-text); background: var(--group-bg); font-weight: 600; }
.avatar-stack { display: inline-flex; flex: 0 0 auto; }
.avatar-stack .avatar + .avatar { margin-left: -6px; }
.avatar.xs { width: 24px; height: 24px; font-size: 10.5px; background: var(--group-bg); color: var(--group-text); border: 2px solid var(--surface); }

/* Filterable task tables (team tasks, delegated) */
.table-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.table-tools .admin-search { flex: 1 1 240px; width: auto; }
.table-tools .select { width: auto; height: 40px; flex: 0 1 auto; }
.table-count { margin-left: auto; }
.task-list-table { min-width: 760px; }
.task-list-table th { white-space: nowrap; }
.task-list-table tr.clickable { cursor: pointer; }
.task-list-table tr.clickable:hover td, .task-list-table tr.selected td { background: var(--hover); }
.task-list-table td.nowrap { white-space: nowrap; }
.cell-link { background: none; border: 0; padding: 0; font: inherit; color: var(--text); text-align: left; font-weight: 500; }
.cell-link.done { color: var(--faint); text-decoration: line-through; }
@media (max-width: 560px) { .table-tools .select { flex: 1 1 140px; } .table-count { width: 100%; margin-left: 0; } }

/* Delegated counts, returned card, bulk actions */
.nav-link .count + .count-alert { margin-left: 6px; }
.count-alert { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent-strong); color: var(--on-accent); font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.count-alert.soft { background: var(--accent-chip); color: var(--accent-strong); }
.link-card .count { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.delegated-link { margin-bottom: 16px; }
.tabbar a.has-alert { position: relative; }
.tabbar a.has-alert::after { content: ''; position: absolute; top: 4px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent-strong); }
.decide.returned .decide-icon { background: rgba(141, 141, 242, 0.18); color: var(--inverse-agent); }
.decide .chip-btn { background: transparent; color: var(--inverse-text); border-color: var(--inverse-border); }
.decide .chip-btn[aria-pressed="true"] { background: var(--inverse-text); color: var(--inverse); border-color: var(--inverse-text); }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border-2); box-shadow: var(--shadow); }
.bulk-count { font-weight: 600; font-size: 14px; margin-right: 4px; }
.bulk-due { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-2); }
.bulk-due .input { height: 32px; width: auto; padding: 0 8px; }
.task-list-table .select-cell { width: 36px; padding-right: 0; }
/* A long table renders only the rows in view: it scrolls in its own box (the horizontal scroll makes it the scroll container anyway) with the header kept on top. */
.table-wrap.virtual { max-height: 75vh; overflow-y: auto; }
.table-wrap.virtual .task-list-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.task-list-table tr.checked td { background: var(--hover); }

/* Task tables as cards on phones */
@media (max-width: 700px) {
    .table-wrap:has(.task-list-table) { background: transparent; border: 0; overflow: visible; max-height: none; }
    .task-list-table { min-width: 0; }
    .task-list-table thead { display: none; }
    .task-list-table, .task-list-table tbody { display: block; }
    .task-list-table tr { display: grid; grid-template-columns: 32px 1fr; column-gap: 4px; row-gap: 4px; padding: 12px 14px; margin-bottom: 8px; border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--border); }
    .task-list-table td { display: flex; gap: 8px; align-items: baseline; padding: 0 !important; border: 0; grid-column: 2; font-size: 13.5px; }
    .task-list-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12px; min-width: 82px; flex: 0 0 auto; }
    .task-list-table td.title-cell { display: block; font-size: 15px; margin-bottom: 4px; }
    .task-list-table td.title-cell::before { display: none; }
    .task-list-table td.select-cell { grid-column: 1; grid-row: 1; width: auto; }
    .task-list-table td.select-cell.no-select, .task-list-table td.no-due { display: none; }
    .task-list-table tr:has(td.select-cell.no-select) td { grid-column: 1 / -1; }
    .task-list-table tr.empty { display: block; }
    .task-list-table tr.empty td { display: block; }
}

/* Queue scope: what the queue and the scheduled list show */
.scope-bar { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-3); width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.scope-bar::-webkit-scrollbar { display: none; }
.scope-option { flex: 0 0 auto; height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 13.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.scope-option:hover { color: var(--text); }
.scope-option[aria-checked="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.scope-option:focus-visible { outline: 2px solid var(--agent); outline-offset: 1px; }

/* Groups in the sidebar */
.nav-groups { display: flex; flex-direction: column; gap: 1px; margin: 0 0 4px 22px; padding-left: 10px; border-left: 1px solid var(--border); }
.nav-sublink { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 7px; text-decoration: none; color: var(--text-2); font-size: 13.5px; min-width: 0; }
.nav-sublink:hover { background: var(--hover); color: var(--text); }
.nav-sublink.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 0 var(--border); }
.nav-sublink .dot { width: 8px; height: 8px; flex: 0 0 auto; }
.nav-sublink-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Group page header link to its settings */
.group-manage { display: inline-flex; align-items: center; gap: 10px; padding: 6px 8px 6px 10px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); text-decoration: none; color: var(--text-2); font-size: 13.5px; }
.group-manage:hover { border-color: var(--text-2); color: var(--text); }
.group-manage-action { display: inline-flex; align-items: center; gap: 5px; padding-left: 10px; border-left: 1px solid var(--line); color: var(--text); font-weight: 600; }

/* Guided presentation */
.presentation-entry { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2px 6px; padding-top: 14px; margin-top: 2px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); }
.presentation-entry .link-btn { padding: 4px; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.tour-shade { position: fixed; inset: 0; z-index: 9000; background: rgba(20, 18, 15, 0.55); display: none; pointer-events: none; }
.tour-spot { position: fixed; z-index: 9001; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(20, 18, 15, 0.55), 0 0 0 2px #FF9A66; pointer-events: none; transition: left 0.3s ease, top 0.3s ease, width 0.3s ease, height 0.3s ease; display: none; }
.tour-bubble { position: fixed; z-index: 9002; width: min(380px, calc(100vw - 32px)); padding: 16px 18px 14px; border-radius: 14px; background: #1C1B19; color: #F6F4EF; border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35); visibility: hidden; transition: left 0.3s ease, top 0.3s ease; }
.tour-bubble.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 32px)); padding: 24px 26px 18px; }
.tour-bubble.bottom::before, .tour-bubble.top::before { content: ''; position: absolute; left: calc(var(--arrow-x, 40px) - 8px); width: 16px; height: 16px; background: #1C1B19; transform: rotate(45deg); border-radius: 3px; }
.tour-bubble.bottom::before { top: -7px; }
.tour-bubble.top::before { bottom: -7px; }
.tour-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.tour-progress { font-size: 12px; letter-spacing: 0.06em; color: #A8A193; }
.tour-close { background: none; border: 0; color: #A8A193; font-size: 20px; line-height: 1; padding: 0 2px; }
.tour-close:hover { color: #F6F4EF; }
.tour-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.tour-bubble.center .tour-title { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.1; }
.tour-text { font-size: 14.5px; line-height: 1.5; color: #E4DFD4; }
.tour-text code, .tour-text kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; padding: 1px 6px; border-radius: 5px; background: rgba(255, 255, 255, 0.12); color: #F6F4EF; }
.tour-keys { color: #A8A193; font-size: 13px; }
.tour-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.tour-back, .tour-next { border-radius: 8px; height: 34px; padding: 0 14px; font-size: 14px; font-weight: 600; border: 0; }
.tour-back { background: transparent; color: #A8A193; padding-left: 0; }
.tour-back:hover { color: #F6F4EF; }
.tour-next { background: #F6F4EF; color: #1C1B19; }
.tour-next:focus-visible { outline: 2px solid #FF9A66; outline-offset: 2px; }
.tour-reveal { position: fixed; inset: 0; z-index: 9003; display: flex; align-items: center; justify-content: center; background: #0E0D0B; color: #F6F4EF; opacity: 0; pointer-events: none; transition: opacity 0.6s ease; cursor: pointer; }
.tour-reveal.on { opacity: 1; pointer-events: auto; }
.tour-reveal span { font-family: var(--serif); font-size: clamp(44px, 8vw, 96px); letter-spacing: -0.01em; opacity: 0; transform: translateY(12px); transition: opacity 0.8s ease 0.4s, transform 0.8s ease 0.4s; }
.tour-reveal.on span { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-bubble, .tour-reveal, .tour-reveal span { transition: none; } }

/* Legal documents: public /terms and /privacy, the consent screen and the administrator's editor. */
.legal-main { max-width: 760px; margin: 0 auto; padding: 8px 32px 96px; display: flex; flex-direction: column; gap: 16px; }
.legal-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); align-self: flex-start; margin-bottom: 16px; }
.legal-tabs a, .legal-tabs button { padding: 6px 12px; border: 0; border-radius: 7px; background: none; color: var(--text-2); font-size: 14px; font-weight: 600; text-decoration: none; }
.legal-tabs a.active, .legal-tabs button.active { background: var(--inverse); color: var(--inverse-text); }
.legal-meta { margin: 0; }
.legal-doc { font-size: 15.5px; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
.legal-doc h1 { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.15; margin: 0 0 16px; }
.legal-doc h2 { font-size: 20px; font-weight: 650; margin: 28px 0 8px; }
.legal-doc h3 { font-size: 16.5px; font-weight: 650; margin: 20px 0 6px; }
.legal-doc p, .legal-doc ul, .legal-doc ol { margin: 0 0 12px; }
.legal-doc ul, .legal-doc ol { padding-left: 22px; }
.legal-doc li { margin: 4px 0; }
.legal-doc blockquote { margin: 0 0 16px; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; }
.legal-doc table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 14px; display: block; overflow-x: auto; }
.legal-doc th, .legal-doc td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.legal-doc code { font-family: var(--mono); font-size: 0.9em; }
.legal-doc a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.legal-box { max-height: 50vh; overflow-y: auto; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; color: var(--text-2); }
.legal-links a, .legal-footer a { color: inherit; }
.legal-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; padding: 0 16px 40px; color: var(--text-2); }
.consent-check { font-size: 14px; }
.consent-gate main { max-width: 760px; }
.legal-editor .textarea.mono { font-family: var(--mono); font-size: 13px; line-height: 1.5; }
.legal-versions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.legal-versions summary { cursor: pointer; }
.legal-source { max-height: 320px; overflow: auto; white-space: pre-wrap; font-family: var(--mono); font-size: 12.5px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
@media (max-width: 760px) {
    .legal-main { padding: 4px 16px 64px; }
    .legal-doc h1 { font-size: 28px; }
}

/* Tier request in the administration */
.tier-cell { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tier-request { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; text-decoration: none; background: var(--accent-bg); color: var(--accent-text); border: 1px dashed var(--accent-border); }
.tier-request:hover { border-style: solid; }
