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

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

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

@media (max-width: 960px) {
    .shell { grid-template-columns: 1fr; }
    /* Closed drawer: off screen AND hidden, so it leaves the tab order and the accessibility tree. */
    .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: min(300px, 86vw); transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; box-shadow: var(--shadow-lg); }
    .shell.open .sidebar { transform: none; visibility: visible; transition: transform .2s ease; }
    .shell.open .nav-scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(15, 18, 22, .45); }
    .nav-toggle { display: inline-flex; }
    .topbar, .content, .page-header { padding-left: 16px; padding-right: 16px; }
    .user-menu-text { display: none; }
}

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

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

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

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

/* ---------- Rich text editor ---------- */
.rte { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.rte-toolbar { display: flex; gap: 2px; padding: 4px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.rte-toolbar button { padding: 4px 8px; font-size: .8rem; border: 0; background: none; border-radius: 6px; min-width: 32px; min-height: 32px; justify-content: center; }
.rte-toolbar button[aria-pressed=true] { background: var(--nav-active-bg); color: var(--text); }
.rte-toolbar button:hover, .rte-toolbar button.active { background: var(--surface-2); }
.rte-area { min-height: 140px; max-height: 480px; overflow-y: auto; padding: 10px 12px; outline: none; }
.rte-area:empty::before { content: attr(data-placeholder); color: var(--muted); }
.rte:focus-within { box-shadow: var(--focus); border-color: var(--link); outline: 2px solid var(--focus-color); outline-offset: 1px; }
.rte-small .rte-area { min-height: 70px; }
/* Lists typed in the editor are content, not form errors (form ul is styled as an error list). */
.rte-area ul, .rte-area ol { color: inherit; font-size: inherit; margin: .5em 0; padding-left: 1.5em; }

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

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

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

/* ---------- Board extras ---------- */
.column-head { gap: 6px; }
.column-head .column-name { flex: 1; }
.column-grip { cursor: grab; color: var(--muted); display: inline-flex; }
.column.dragging { opacity: .5; }
.column-add { background: transparent; border: 2px dashed var(--border); justify-content: flex-start; }
.task-card { position: relative; }
.task-card .card-foot { flex-wrap: wrap; }
.task-card .card-foot .avatar-stack { margin-left: auto; }
.task-card .card-foot .avatar { margin-left: 0; }
.task-card .card-action { opacity: 0; transition: opacity .1s; }
.task-card:hover .card-action, .task-card:focus-within .card-action { opacity: 1; }
@media (hover: none) { .task-card .card-action { opacity: 1; } }
.activity-dot { position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; border-radius: 50%; background: #e5484d; border: 2px solid var(--surface); box-shadow: 0 0 0 3px rgba(229, 72, 77, .18); }
.task-card.is-unseen { box-shadow: var(--shadow), 0 0 0 1px rgba(229, 72, 77, .35); }
.due { display: inline-flex; align-items: center; gap: 3px; }
.due-soon { color: var(--warning-text); font-weight: 700; }
.due-overdue { color: var(--danger); font-weight: 700; }
.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack .avatar + .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-more { background: var(--surface-2); color: var(--muted); }
/* Live updates (board_live_controller.js): toolbar slot without its own box; new/changed cards flash briefly. */
.board-actions { display: contents; }
.task-card.is-fresh { outline: 2px solid var(--focus-color); outline-offset: 1px; }
@media (prefers-reduced-motion: no-preference) {
    .task-card.is-fresh { animation: card-fresh 2.5s ease-out forwards; }
    @keyframes card-fresh { 0%, 40% { outline-color: var(--focus-color); } 100% { outline-color: transparent; } }
}

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

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

/* Task card: the title is the headline, editable in place (task_edit_controller.js) */
.task-title-row { display: flex; align-items: flex-start; gap: 8px 12px; flex-wrap: wrap; }
.task-title-row[hidden], .task-title-form[hidden], .task-desc-form[hidden], .task-desc-empty[hidden], .task-edit-button[hidden] { display: none; }
.task-title { flex: 1 1 260px; min-width: 0; margin: 0; font-size: 1.45rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.3; overflow-wrap: anywhere; }
.task-title-row .vis-badge { margin-top: 6px; }
[data-controller~="task-edit"] .task-title { cursor: text; border-radius: 4px; }
[data-controller~="task-edit"] .task-title:hover { background: var(--surface-2); box-shadow: 0 0 0 4px var(--surface-2); }
.task-edit-button { flex: none; min-height: 32px; }
.task-title-input { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }
.task-title-form { display: flex; flex-direction: column; gap: 8px; }
.task-edit-actions .help { margin: 0; }
.task-edit-status { margin-top: 6px; }
.task-edit-status:empty { display: none; }
.task-desc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.task-section-label { margin: 0; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.task-saved-title { font-weight: 700; margin: 6px 0; overflow-wrap: anywhere; }
.task-desc-empty { display: flex; align-items: center; gap: 8px; width: 100%; padding: 14px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); font-weight: 500; }
.task-desc-empty:hover { color: var(--link); border-color: var(--link); text-decoration: none; }
@media (max-width: 640px) {
    .task-title { font-size: 1.25rem; flex-basis: 100%; }
    .task-edit-actions button { min-height: 40px; }
}

/* Lightbox (lightbox_controller.js): full-window dialog, file centred, controls on dark glass */
.lightbox { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(12, 14, 11, .94); color: #F2F3EA; overflow: hidden; }
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.lightbox::backdrop { background: rgba(12, 14, 11, .6); }
.lightbox :focus-visible { outline-color: var(--lime); }
.lightbox-bar { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; min-width: 0; }
.lightbox-counter { margin: 0; font-variant-numeric: tabular-nums; font-weight: 700; font-size: .9rem; white-space: nowrap; }
.lightbox-counter[hidden] { display: none; }
.lightbox-caption { margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; color: #D5D8CB; }
.lightbox-button, .lightbox-nav { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .08); color: inherit; }
.lightbox-button:hover, .lightbox-nav:hover { background: rgba(255, 255, 255, .18); color: inherit; text-decoration: none; }
.lightbox-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 8px 64px 24px; touch-action: pan-y pinch-zoom; user-select: none; }
.lightbox-media { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; background: #000; box-shadow: 0 12px 40px rgba(0, 0, 0, .45); }
img.lightbox-media { background: repeating-conic-gradient(#2a2d26 0 25%, #33372e 0 50%) 50% / 16px 16px; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; }
.lightbox-nav[hidden] { display: none; }
.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }
.lightbox-failed { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(480px, calc(100vw - 32px)); margin: 0; padding: 10px 14px; border-radius: 8px; background: #B4232C; color: #fff; text-align: center; }
.lightbox-failed[hidden] { display: none; }
@media (max-width: 640px) {
    .lightbox-stage { padding: 4px 4px 72px; }
    .lightbox-nav { top: auto; bottom: 12px; transform: none; height: 48px; }
    .lightbox-prev { left: 16px; }
    .lightbox-next { right: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
    .lightbox[open] { animation: lightbox-in .16s ease-out; }
    .lightbox-media { animation: lightbox-in .2s ease-out; }
    @keyframes lightbox-in { from { opacity: 0; } }
}
@media (forced-colors: active) { .lightbox-button, .lightbox-nav { border: 1px solid ButtonText; } }

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

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

/* ---------- Epics ---------- */
.progress { width: 100%; height: 8px; border: 0; border-radius: 999px; overflow: hidden; background: var(--surface-2); appearance: none; }
.progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
.progress::-webkit-progress-value { background: var(--forest); border-radius: 999px; }
.progress::-moz-progress-bar { background: var(--forest); border-radius: 999px; }
.epic-title { margin: 0 0 4px; }
/* Two-column grid: every row shares the status column, which is as wide as the longest badge (max. 45 %, then the
   badge is cut with an ellipsis, full name in its tooltip); the title takes the rest and is clamped to 2 lines. */
.epic-tasks { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) fit-content(45%); column-gap: 8px; row-gap: 4px; max-height: 320px; overflow-y: auto; }
.epic-tasks li { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; font-size: .84rem; padding: 4px 6px; border-radius: 6px; }
.epic-tasks li .pill-col { justify-self: end; }
.epic-tasks li.current { background: var(--surface-2); font-weight: 600; }
.epic-tasks li a { color: var(--text); }
.epic-list { display: flex; flex-direction: column; gap: 10px; }
.epic-list .card + .card { margin-top: 0; }
.epic-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; align-items: center; color: inherit; }
.epic-row:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.epic-row.is-closed { opacity: .65; }
.epic-row-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.epic-row-meta { display: grid; grid-template-columns: 90px minmax(80px, 1fr) auto auto; gap: 12px; align-items: center; font-size: .82rem; color: var(--muted); }
@media (max-width: 760px) { .epic-row, .epic-row-meta { grid-template-columns: 1fr; } }
.epic-heading { display: flex; align-items: center; gap: 10px; }
.swatches { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.swatches legend { margin-bottom: 6px; }
.swatch-option { display: inline-flex; margin: 0; cursor: pointer; }
.swatch-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch-option .epic-swatch { width: 22px; height: 22px; border-radius: 6px; border: 2px solid transparent; }
.swatch-option input:checked + .epic-swatch { border-color: var(--text); }
.swatch-option input:focus-visible + .epic-swatch { outline: 2px solid var(--focus-color); outline-offset: 2px; }
.task-table td { vertical-align: middle; }
.task-table .card-labels { margin: 0; }

/* ---------- Search ---------- */
.search-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.search-results { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.search-results .card + .card { margin-top: 0; }
.search-title { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.search-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: start; }
.search-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; min-width: 0; max-width: 16em; }
.snippet { margin: 6px 0; color: var(--text); }
mark { background: var(--mark-bg); color: inherit; border-radius: 3px; padding: 0 2px; }
.section-gap { margin-top: 20px; }

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

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

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

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

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

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

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

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

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

/* ---------- Billing ---------- */
.billing-banner { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 10px 28px; font-size: .88rem; border-bottom: 1px solid var(--border); background: var(--tint-blue); color: var(--text); }
.billing-banner.billing-readonly { background: var(--tint-orange); }
.billing-banner a { font-weight: 650; }
.billing-grid { align-items: start; }
.price-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.price-option { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.price-option.recommended { border-color: var(--forest); box-shadow: 0 0 0 1px var(--forest); }
.price-option h3 { margin: 0; font-size: 1rem; }
.price-option .price { margin: 0; font-size: 1.1rem; }
.price-option .price strong { font-size: 1.6rem; }
.seat-usage { margin: 0 0 16px; font-size: .9rem; }
.seat-usage-full { padding: 10px 14px; border-radius: var(--radius); background: var(--tint-orange); }
.plan-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.plan-choice .price-option label { cursor: pointer; font-weight: 400; margin: 0; }
.plan-choice .price-option:has(input:checked) { border-color: var(--forest); box-shadow: 0 0 0 2px var(--forest); }
.plan-choice .price-option.is-unavailable { opacity: .6; }
.plan-choice .price-option.is-unavailable label { cursor: not-allowed; }
.plan-choice .plan-limits { margin: 0; padding-left: 18px; font-size: .84rem; color: var(--text); } /* not the red "form ul" error-list style */
.interval-choice { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.interval-choice label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }
.progress-warn::-webkit-progress-value { background: var(--warning); }
.progress-warn::-moz-progress-bar { background: var(--warning); }
.progress-danger::-webkit-progress-value { background: var(--danger); }
.progress-danger::-moz-progress-bar { background: var(--danger); }
@media (max-width: 720px) { .billing-banner { padding: 10px 16px; } }

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

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

/* ---------- Single sign-on ---------- */
.sso-button { margin-top: -4px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; width: 100%; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.row-actions form { margin: 0; }

/* ---------- Member project access ---------- */
.member-project-list { margin-bottom: 6px; }
.member-projects select { max-width: 420px; }

/* ---------- Dashboard setup guide (checklist; steps tick themselves off from real data) ---------- */
.setup-guide { padding: 0; overflow: hidden; margin-bottom: 20px; }
.setup-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; padding: 22px 24px 18px; background: linear-gradient(120deg, var(--surface), var(--tint-lime)); border-bottom: 1px solid var(--border); }
.setup-head h2 { margin: 0 0 4px; font-size: 1.25rem; }
.setup-head p { margin: 0; max-width: 560px; }
.setup-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.setup-count { font-size: .9rem; color: var(--muted); white-space: nowrap; }
.setup-count strong { color: var(--text); }
.setup-bar { width: 140px; height: 8px; border: 0; border-radius: 99px; background: var(--surface-2); overflow: hidden; appearance: none; }
.setup-bar::-webkit-progress-bar { background: var(--surface-2); border-radius: 99px; }
.setup-bar::-webkit-progress-value { background: var(--accent); border-radius: 99px; transition: width .4s ease; }
.setup-bar::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
.setup-steps { list-style: none; margin: 0; padding: 6px 0; }
.setup-step + .setup-step { border-top: 1px solid var(--border); }
.setup-step summary { display: flex; align-items: center; gap: 14px; padding: 14px 24px; cursor: pointer; list-style: none; font-weight: 600; }
.setup-step summary::-webkit-details-marker { display: none; }
.setup-step summary:hover { background: var(--surface-2); }
.setup-step summary:focus-visible { outline: 2px solid var(--focus-color); outline-offset: -3px; }
.setup-step summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s ease; }
.setup-step details[open] summary::after { transform: rotate(-135deg); }
.setup-check { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; border: 2px solid var(--border); color: var(--muted); background: var(--surface); }
.setup-step.is-done .setup-check { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.setup-step.is-done .setup-title { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.setup-step details[open] .setup-check { border-color: var(--accent); color: var(--text); }
.setup-step.is-done details[open] .setup-check { color: var(--on-accent); }
.setup-body { padding: 0 24px 18px 64px; }
.setup-body p { margin: 0 0 12px; color: var(--muted); max-width: 640px; }
.setup-body .row { gap: 16px; align-items: center; flex-wrap: wrap; }
.setup-body .row a.small { display: inline-flex; align-items: center; gap: 6px; }
.setup-guide.is-complete .setup-head { border-bottom: 0; }
@media (max-width: 640px) { .setup-body { padding-left: 24px; } .setup-head { padding: 18px; } .setup-step summary { padding: 14px 18px; } }

/* File inputs: list of chosen files and upload progress (file_list_controller.js). */
.file-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; flex-basis: 100%; }
.file-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); font-size: .86rem; min-width: 0; }
.file-mark { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; color: var(--surface); background: var(--success); }
.file-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file-meta { color: var(--muted); white-space: nowrap; margin-left: auto; font-size: .8rem; }
.file-item.is-bad { border-color: var(--danger); }
.file-item.is-bad .file-mark { background: var(--danger); }
.file-item.is-bad .file-meta { color: var(--danger); white-space: normal; text-align: right; }
.file-uploading { display: flex; flex-direction: column; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--text); }
.file-progress { display: block; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; position: relative; }
.file-progress::after { content: ""; position: absolute; inset: 0; width: 40%; border-radius: inherit; background: var(--link); }
@media (prefers-reduced-motion: no-preference) {
    .file-progress::after { animation: file-progress 1.2s ease-in-out infinite; }
    @keyframes file-progress { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
}

/* Visibility (docs/visibility.md): lock badge on internal items, compact "Visible to" pickers. */
.vis-badge { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 500; color: var(--warning, #9a6700); border-color: color-mix(in srgb, currentColor 35%, transparent); vertical-align: middle; }
.vis-picker { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.vis-legend { padding: 0; margin-bottom: 4px; font-weight: 600; font-size: .9rem; }
.vis-legend.small { font-size: .82rem; }
.vis-options { display: flex; flex-direction: column; gap: 2px; }
.vis-option { font-size: .9rem; }
.vis-option .icon { color: var(--warning, #9a6700); }
.vis-groups { display: flex; flex-direction: column; gap: 4px; margin: 0 0 0 24px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); max-height: 240px; overflow-y: auto; }
.vis-groups[hidden] { display: none; }
.vis-groups .check { font-size: .88rem; }
.vis-groups .help.is-error { color: var(--danger); }
.vis-picker-compact .vis-options { flex-direction: row; flex-wrap: wrap; gap: 2px 12px; }
.vis-picker-compact .vis-option { font-size: .85rem; }
.vis-change > summary { cursor: pointer; margin-top: 4px; }
.vis-change form { margin-top: 6px; gap: 6px; }
.role-confirm { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.flash-warning { border-color: var(--warning); color: var(--warning-text); }
.assignee-warning { color: var(--warning-text); font-size: .8rem; }

/* ---------- UX/a11y components (2026-11): titles, palette, toasts, dialogs, autosave, mentions ---------- */
.page-title-block { min-width: 0; flex: 1 1 320px; }
.title-clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; }
.clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; min-width: 0; }
.flush-bottom { margin-bottom: 0; }
kbd, .palette-kbd { font: 600 .72rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 3px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.danger-solid:hover { background: color-mix(in srgb, var(--danger) 85%, #000); }

/* Command palette trigger (top bar) and dialog */
.palette-trigger { flex: 0 1 340px; min-width: 0; height: 40px; justify-content: flex-start; gap: 8px; color: var(--muted); font-weight: 500; background: var(--surface-2); }
.palette-trigger-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: left; }
@media (max-width: 640px) { .palette-trigger { flex: 0 0 40px; width: 40px; padding: 0; justify-content: center; } .palette-trigger-text, .palette-trigger .palette-kbd { display: none; } }
.palette { width: min(640px, calc(100vw - 32px)); margin-top: 12vh; }
.palette-panel { display: flex; flex-direction: column; max-height: 70vh; }
.palette-search { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.palette-search input { border: 0; padding: 6px 0; font-size: 1.05rem; background: transparent; box-shadow: none; }
.palette-search input:focus, .palette-search input:focus-visible { box-shadow: none; outline: none; } /* the dialog itself shows focus context; the caret is visible */
.palette-search:focus-within { box-shadow: inset 0 -2px 0 var(--focus-color); }
.palette-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.palette-group { padding: 10px 10px 4px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.palette-option { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; min-height: 40px; }
.palette-option[aria-selected=true] { background: var(--nav-active-bg); outline: 2px solid var(--focus-color); outline-offset: -2px; }
.palette-option .muted { margin-left: auto; white-space: nowrap; }
.palette-number { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.palette-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-status:empty { display: none; }
.palette-status, .palette-hint { margin: 0; padding: 8px 16px; border-top: 1px solid var(--border); }

/* Keyboard shortcuts and confirmation dialogs */
.shortcuts-dialog { width: min(560px, calc(100vw - 32px)); }
.shortcut-list { margin: 0; padding: 16px 24px; display: grid; gap: 10px; }
.shortcut-list > div { display: grid; grid-template-columns: minmax(150px, max-content) 1fr; gap: 16px; align-items: center; }
.shortcut-list dd { margin: 0; }
.shortcut-note { padding: 0 24px 18px; margin: 0; }
.confirm-dialog, .modal-narrow { width: min(480px, calc(100vw - 32px)); }
.modal-narrow { width: min(600px, calc(100vw - 32px)); }
.confirm-body { padding: 22px 24px 8px; }
.confirm-body h2 { margin: 0 0 8px; font-size: 1.1rem; }
.confirm-body p { color: var(--muted); margin: 0; }
/* No JavaScript: a dialog linked with #id is shown in the page instead of as a modal. */
.modal:target:not([open]) { display: block; position: static; margin: 16px 0; width: 100%; }

/* Toasts (bottom of the window; above the cookie banner's corner) */
.toast-region { position: fixed; z-index: 90; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 8px; background: var(--charcoal); color: #F2F3EA; box-shadow: var(--shadow-lg); animation: toast-in .18s ease-out; }
:root[data-theme=dark] .toast { background: #33372E; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .toast { background: #33372E; } }
.toast-error { background: var(--ink-red); color: #fff; }
.toast-text { margin: 0; flex: 1; min-width: 0; font-size: .9rem; }
.toast-undo { background: transparent; color: var(--lime); border-color: color-mix(in srgb, var(--lime) 55%, transparent); min-height: 32px; }
.toast-undo:hover { background: rgba(255, 255, 255, .08); }
.toast .toast-close { color: inherit; }
.toast .toast-close:hover { background: rgba(255, 255, 255, .1); color: inherit; }
.toast :focus-visible { outline-color: var(--lime); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Background saving (task sidebar, team roles) */
.autosave-status { display: block; min-height: 1.2em; margin: 0; font-size: .8rem; color: var(--muted); }
.autosave-status[data-state=saved] { color: var(--success); }
.autosave-status[data-state=saved]::before { content: "✓ "; }
.autosave-status[data-state=warning] { color: var(--warning-text); }
.autosave-status[data-state=error] { color: var(--danger); font-weight: 600; }
.table .autosave-status { display: inline-block; margin-left: 8px; }

/* Rich text: link field and @mention list */
.rte { position: relative; }
.rte-link { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.rte-link input { flex: 1 1 220px; width: auto; }
.rte-link .field-error { flex-basis: 100%; margin: 0; }
.mention-list { position: absolute; left: 8px; right: 8px; bottom: calc(100% - 40px); z-index: 25; list-style: none; margin: 0; padding: 4px; max-width: 360px; max-height: 260px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); }
.mention-option { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; min-height: 32px; }
.mention-option[aria-selected=true] { background: var(--nav-active-bg); outline: 2px solid var(--focus-color); outline-offset: -2px; }
.mention-empty { padding: 6px 8px; color: var(--muted); font-size: .85rem; }

/* Invite: role as radio cards */
.role-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.role-cards legend { grid-column: 1 / -1; }
.role-card { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-weight: 400; cursor: pointer; }
.role-card:hover { border-color: var(--link); }
.role-card:has(input:checked) { border-color: var(--forest); box-shadow: 0 0 0 1px var(--forest); background: var(--nav-active-bg); }
.role-card:has(input:focus-visible) { outline: 2px solid var(--focus-color); outline-offset: 2px; }
.role-card input { margin-top: 2px; flex: none; }
.role-card-body { display: grid; gap: 2px; }
.role-card.is-unavailable { opacity: .6; cursor: not-allowed; }

/* Board filters: inline on wide screens, behind "Filters (n)" on small ones */
.filters-toggle { display: none; }
.board-filters { display: contents; }
@media (max-width: 760px) {
    .filters-toggle { display: inline-flex; }
    .board-filters { display: none; flex-basis: 100%; order: 10; flex-wrap: wrap; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
    .board-filters.is-open { display: flex; }
    .board-filters > input[type=search], .board-filters > select, .board-filters > .multi-select { max-width: none; flex: 1 1 100%; }
}
.filter-empty { margin-top: 12px; }

/* Notifications list */
.notification-day + .notification-day { margin-top: 18px; }
.notification-day-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.notification-list { list-style: none; margin: 0; padding: 4px 16px; }
.notif-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.notif-text { color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
a.notif-text:hover { color: var(--link); text-decoration: underline; }
.notif-actions { margin: 0; flex: none; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 18px; }

/* Notification popover (header bell, notification_peek_controller.js): dropdown on wide screens, sheet on phones */
.notif-peek { position: relative; display: inline-flex; }
.notif-peek-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 45; width: min(400px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 96px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.notif-peek-panel:focus { outline: none; }
.notif-peek-panel:focus-visible { outline: 2px solid var(--focus-color); outline-offset: 2px; }
.notif-peek-head, .notif-peek-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.notif-peek-head { border-bottom: 1px solid var(--border); }
.notif-peek-title { font-size: 1rem; }
.notif-peek-head form { margin: 0; }
.notif-peek-foot { border-top: 1px solid var(--border); font-size: .9rem; }
.notif-peek-foot a { display: inline-flex; align-items: center; gap: 4px; }
.notif-peek-scroll { overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; }
.notif-peek-state { margin: 0; padding: 24px 16px; color: var(--muted); text-align: center; }
.notif-peek-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; color: var(--muted); }
.notif-peek-empty p { margin: 0; }
.notif-peek-list { list-style: none; margin: 0; padding: 4px 0; }
.notif-peek-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px 8px 12px; border-bottom: 1px solid var(--border); }
.notif-peek-item:last-child { border-bottom: 0; }
.notif-peek-item:hover { background: var(--surface-2); }
.notif-peek-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 10px; flex: none; }
.notif-peek-item.read .dot { visibility: hidden; }
.notif-peek-link { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; color: var(--text); text-decoration: none; border-radius: 4px; }
.notif-peek-link:hover { text-decoration: none; }
a.notif-peek-link:hover .notif-peek-text { color: var(--link); text-decoration: underline; }
.notif-peek-link:focus-visible { outline: 2px solid var(--focus-color); outline-offset: 2px; }
.notif-peek-text { overflow-wrap: anywhere; font-size: .9rem; }
.notif-peek-item.unread .notif-peek-text { font-weight: 600; }
.notif-peek-meta { display: flex; gap: 4px; min-width: 0; color: var(--muted); font-size: .8rem; }
.notif-peek-meta time { flex: none; }
.notif-peek-item .notif-actions { margin: 0; flex: none; }
@media (max-width: 600px) {
    /* Full-width sheet under the sticky top bar. */
    .notif-peek { position: static; }
    .notif-peek-panel { position: fixed; left: 0; right: 0; top: 64px; width: auto; max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); border-radius: 0 0 var(--radius) var(--radius); border-left: 0; border-right: 0; }
    .notif-peek-item { padding: 12px 12px 12px 16px; }
    .notif-peek-item .icon-button { min-width: 44px; min-height: 44px; }
}

/* Filter forms (board, archive): the GET form doesn't affect the toolbar layout */
.filter-form { display: contents; }

/* Multi-select combobox (multi_select_controller.js over a native <select multiple>) */
.multi-select { position: relative; display: inline-flex; }
.multi-select select[multiple] { width: auto; min-width: 180px; }
/*
 * Until the (lazy-loaded) controller has built the combobox, a skeleton with the combobox's size stands in for the
 * native list, so the raw options never flash and nothing shifts (#12). Only with JavaScript: without it the native
 * <select multiple> is the control. If the script never arrives, the select comes back after 4 s (still usable).
 */
@media (scripting: enabled) {
    .multi-select:not(.is-enhanced) { width: 190px; height: 38px; overflow: hidden; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); }
    .multi-select:not(.is-enhanced) select[multiple] { position: absolute; inset: 0; width: 100%; min-width: 0; height: 100%; visibility: hidden; animation: ms-reveal 0s 4s forwards; }
    @keyframes ms-reveal { to { visibility: visible; } }
}
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
    .multi-select:not(.is-enhanced)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent); transform: translateX(-100%); animation: ms-shimmer 1.2s ease-in-out infinite; pointer-events: none; }
    @keyframes ms-shimmer { to { transform: translateX(100%); } }
}
.ms-control { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 190px; max-width: 360px; min-height: 38px; padding: 3px 4px 3px 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; cursor: text; }
.ms-control:focus-within { outline: 2px solid var(--focus-color); outline-offset: 1px; }
.multi-select.has-value .ms-control { border-color: var(--link); }
.ms-chips, .ms-list { color: var(--text); font-size: inherit; } /* not the "form ul" error-list style */
.ms-chips { display: contents; list-style: none; margin: 0; padding: 0; }
.ms-chips[hidden] { display: none; }
.ms-chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 1px 2px 1px 8px; border-radius: 999px; background: var(--nav-active-bg); color: var(--text); font-size: .8rem; font-weight: 600; }
.ms-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.ms-chip-remove, .ms-clear { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 1rem; line-height: 1; font-weight: 600; }
.ms-chip-remove:hover, .ms-clear:hover { background: var(--surface-2); color: var(--text); }
.ms-clear { margin-left: auto; }
.ms-control .ms-input { flex: 1 1 60px; min-width: 60px; width: auto; max-width: none; border: 0; padding: 4px; background: transparent; }
.ms-control .ms-input:focus, .ms-control .ms-input:focus-visible { outline: none; box-shadow: none; } /* the whole field shows the focus ring */
.ms-popup { position: absolute; left: 0; top: calc(100% + 4px); z-index: 35; min-width: 100%; width: max-content; max-width: min(340px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 4px; }
.ms-list { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow-y: auto; overscroll-behavior: contain; }
.ms-option { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 5px 8px; border-radius: 6px; cursor: pointer; overflow-wrap: anywhere; }
.ms-option:hover { background: var(--surface-2); }
.ms-option.is-active { background: var(--nav-active-bg); outline: 2px solid var(--focus-color); outline-offset: -2px; }
.ms-special-last { margin-bottom: 4px; box-shadow: 0 5px 0 -4px var(--border); }
.ms-check { flex: none; width: 16px; height: 16px; border: 1.5px solid var(--muted); border-radius: 4px; background: var(--surface); position: relative; }
.ms-option[aria-selected=true] .ms-check { background: var(--accent); border-color: var(--accent); }
.ms-option[aria-selected=true] .ms-check::after { content: ""; position: absolute; left: 4px; top: 0; width: 5px; height: 10px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ms-option[aria-selected=true] .ms-option-label { font-weight: 600; }
.ms-empty { margin: 0; padding: 8px; color: var(--muted); font-size: .85rem; }
@media (max-width: 760px) {
    .multi-select, .multi-select:not(.is-enhanced), .ms-control { width: 100%; max-width: none; }
    .ms-popup { right: 0; max-width: none; width: auto; }
    .ms-option { min-height: 44px; }
    .ms-chip-remove, .ms-clear { min-width: 32px; min-height: 32px; }
}
@media (forced-colors: active) {
    .ms-option[aria-selected=true] .ms-check { background: Highlight; border-color: Highlight; }
    .ms-option.is-active { outline-color: Highlight; }
}

/* ---------- Time tracking (docs/time-tracking.md) ---------- */
.time-card .h3 { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 1rem; }
.time-total { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.time-total-value { font-size: 1.5rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.time-meter { display: block; width: 100%; height: 6px; }
.time-meter-track { fill: var(--surface-2); }
.time-meter-fill { fill: var(--series-1); }
.time-meter.is-over .time-meter-fill { fill: var(--danger); }
@media (forced-colors: active) { .time-meter-fill { fill: Highlight; } }
.timer-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; font-size: .875rem; }
.timer-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex: none; }
@media (prefers-reduced-motion: no-preference) { .timer-dot { animation: timer-pulse 1.6s ease-in-out infinite; } }
@keyframes timer-pulse { 50% { opacity: .35; } }
.timer-clock { font-variant-numeric: tabular-nums; }
.time-log > summary { cursor: pointer; }
.time-log[open] > summary { margin-bottom: 8px; }
.time-entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.time-entries li { padding-top: 8px; border-top: 1px solid var(--border); }
.time-entry-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.time-entry-head a { margin-left: auto; }
.time-entry-note { margin: 2px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.topbar-timer { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: .85rem; }
.topbar-timer a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); }
.topbar-timer button { padding: 2px 10px; border-radius: 999px; }
.time-filter { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 32px; margin: 16px 0 20px; }
.time-filter-row { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.time-filter-row > div { min-width: 150px; }
.time-stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.two-col-even { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.two-col-even > .card + .card { margin-top: 0; }
.table td.row-head { font-weight: 600; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.time-table td { vertical-align: top; }
@media (max-width: 640px) {
    .topbar-timer .timer-clock { display: none; }
    .time-filter-row > div { min-width: 0; flex: 1 1 45%; }
}

/* ---------- AI first-level support (docs/ai-support.md) ---------- */
.avatar-ai { background: var(--tint-violet); color: var(--text); }
.pill-ai { background: var(--tint-violet); color: var(--text); font-weight: 700; letter-spacing: .04em; font-size: .7rem; padding: 1px 6px; vertical-align: middle; }
@media (forced-colors: active) { .pill-ai { border: 1px solid CanvasText; } }
.ai-intro { display: flex; gap: 16px; align-items: flex-start; margin: 16px 0; }
.ai-intro-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: var(--tint-violet); flex: none; }
.pill-via-cms { background: var(--surface-2); color: var(--muted); font-size: .7rem; padding: 1px 6px; vertical-align: middle; }

/* ---------- Checklists (docs/board.md) ---------- */
.checklist-card .h3 { display: flex; align-items: center; gap: 6px; font-size: 1rem; }
.checklist-meter.is-complete .time-meter-fill { fill: var(--success); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.checklist li { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.checklist li:last-child { border-bottom: 0; }
.checklist-toggle { flex: 1; min-width: 0; }
.checklist-text { overflow-wrap: anywhere; }
.checklist li.is-done .checklist-text { color: var(--muted); text-decoration: line-through; }
.checklist-mark { display: inline-grid; place-items: center; width: 16px; height: 16px; border: 1px solid var(--border); border-radius: 3px; font-size: .75rem; }
.checklist-more > summary { cursor: pointer; color: var(--muted); }
.checklist-more[open] { flex-basis: 100%; }
.checklist-add { display: flex; gap: 8px; align-items: flex-start; }
.checklist-add textarea { flex: 1; min-height: 38px; resize: vertical; }
.task-card .checklist-done { color: var(--success); }

/* ---------- Releases (docs/board.md) ---------- */
.release-chip { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .7rem; font-weight: 600; }
.release-notes { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }

/* ---------- Project documentation (docs/docs.md) ---------- */
.docs-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.docs-layout > .card + .card { margin-top: 0; }
@media (max-width: 860px) { .docs-layout { grid-template-columns: 1fr; } }
.doc-sidebar { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; }
.doc-tree { list-style: none; margin: 0; padding: 0; }
.doc-tree .doc-tree { padding-left: 14px; border-left: 1px solid var(--border); margin-left: 6px; }
.doc-tree a { display: block; padding: 4px 6px; border-radius: 4px; color: var(--text); overflow-wrap: anywhere; }
.doc-tree a:hover { background: var(--surface-2); text-decoration: none; }
.doc-tree a.active { background: var(--nav-active-bg); font-weight: 600; }
.doc-page .prose { font-size: 1rem; }
.doc-title { font-size: 1.4rem; }
.doc-versions { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.doc-versions li { display: grid; padding: 6px 8px; border-radius: 4px; }
.doc-versions li.active { background: var(--surface-2); }
