:root {
    color-scheme: dark;
    --bg: #090d12;
    --surface: #10161e;
    --surface-raised: #151d27;
    --surface-soft: #0d131a;
    --line: #27313d;
    --line-bright: #3a4654;
    --text: #edf3f8;
    --muted: #8e9cab;
    --quiet: #667483;
    --david: #4da3ff;
    --stuart: #ffb454;
    --danger: #ff6b6b;
    --flag: #ff503c;
    --success: #71d6a3;
    --radius: 12px;
    --heading-gap: 10px;
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
a { color: var(--david); text-underline-offset: 3px; }
a:hover { color: #86c1ff; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--david); outline-offset: 3px; }
h1, h2, h3, h4 {
    margin: 0;
    font-family: "Space Grotesk", ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    letter-spacing: -.025em;
    text-wrap: balance;
}
p { margin: 0; }
.app-header {
    position: sticky;
    z-index: 10;
    top: 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 64px;
    padding: 0 32px;
    border-bottom: 1px solid var(--line);
    background: rgba(9, 13, 18, .94);
    backdrop-filter: blur(14px);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    color: var(--text);
    font-size: 13px;
    font-weight: 750;
    letter-spacing: .12em;
    text-decoration: none;
}
.brand:hover { color: var(--text); }
.header-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid var(--line-bright);
    border-radius: 8px;
    background: var(--surface-raised);
    color: var(--david);
    font-weight: 850;
}
.flag-badge { display: inline-flex; align-items: center; gap: 7px; min-width: 42px; height: 30px; padding: 0 9px; border: 1px solid rgba(255,80,60,.65); border-radius: 999px; background: rgba(255,80,60,.13); color: #ff8b7e; font-size: 11px; text-decoration: none; }
.flag-badge:hover { background: rgba(255,80,60,.2); color: #ffaaa0; }
.flag-glyph { position: relative; display: block; width: 15px; height: 16px; border-left: 1.5px solid currentColor; }
.flag-glyph::after { position: absolute; top: 1px; left: 1px; width: 11px; height: 8px; background: currentColor; clip-path: polygon(0 0,100% 14%,82% 53%,100% 100%,0 84%); content: ""; transform-origin: left center; animation: flag-wave 2s ease-in-out infinite; }
.sync-rail {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}
.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(113, 214, 163, .11);
    animation: live-pulse 2.4s ease-out infinite;
}
.sync-rail.is-offline .live-dot { background: var(--danger); box-shadow: none; animation: none; }
.session-meta { display: flex; justify-content: flex-end; align-items: center; gap: 18px; font-size: 12px; }
.session-meta a { color: var(--muted); }
.session-links { display: flex; align-items: center; gap: 14px; }
.signed-in { display: flex; align-items: center; gap: 7px; text-transform: capitalize; }
.person-dot { display: inline-block; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--quiet); }
.person-david { background: var(--david); color: var(--david); }
.person-stuart { background: var(--stuart); color: var(--stuart); }
.person-system { background: var(--quiet); color: var(--quiet); }
main { width: min(1380px, calc(100% - 64px)); margin: 0 auto; padding: 48px 0 80px; }
.page-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 560px);
    align-items: end;
    gap: 40px;
    padding: 0 2px 28px;
}
.eyebrow, .panel-heading > span {
    display: block;
    margin-bottom: var(--heading-gap);
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .15em;
    text-transform: uppercase;
}
.page-heading h1 { font-size: clamp(34px, 5vw, 58px); line-height: .98; }
.page-heading p { color: var(--muted); font-size: 14px; line-height: 1.65; }
.table-talk { margin-bottom: 20px; overflow: hidden; border: 1px solid rgba(255,80,60,.35); border-radius: var(--radius); background: #11161d; }
.table-talk-heading { display: grid; grid-template-columns: minmax(220px,.7fr) minmax(320px,1.3fr); align-items: end; gap: 32px; padding: 22px; border-bottom: 1px solid var(--line); }
.table-talk-heading h2 { font-size: 27px; }
.table-talk-heading p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.open-flag-list, .resolved-flag-list { display: grid; }
.table-flag { display: grid; grid-template-columns: 92px minmax(0,1fr) auto; align-items: center; gap: 18px; padding: 15px 22px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.table-flag:hover { background: rgba(255,80,60,.055); color: var(--text); }
.table-flag-copy { display: grid; gap: 5px; min-width: 0; }
.table-flag-copy strong { overflow: hidden; font: italic 600 14px/1.3 Georgia, "Times New Roman", serif; text-overflow: ellipsis; white-space: nowrap; }
.table-flag-copy small, .table-flag-meta { color: var(--muted); font-size: 10px; }
.table-flag-meta { font-variant-numeric: tabular-nums; }
.flag-empty { padding: 20px 22px; color: var(--muted); font-size: 12px; }
.resolved-flags > summary { padding: 12px 22px; cursor: pointer; color: var(--muted); font-size: 11px; font-weight: 700; list-style-position: inside; }
.resolved-flags > summary span { margin-left: 5px; color: var(--quiet); }
.resolved-flag { display: grid; gap: 5px; padding: 13px 22px; border-top: 1px solid var(--line); color: var(--muted); }
.resolved-flag:hover { background: var(--surface-raised); color: var(--text); }
.resolved-flag > a { display: grid; gap: 5px; color: inherit; text-decoration: none; }
.resolved-flag span { font-size: 10px; text-transform: capitalize; }
.resolved-flag p { color: #abb5bf; font-size: 12px; }
.resolved-context { padding-top: 6px; }
.rule-chip { display: inline-grid; width: fit-content; min-width: 68px; padding: 7px 10px; place-items: center; border: 1px solid currentColor; border-radius: 6px; background: rgba(102,116,131,.1); font-size: 12px; letter-spacing: .06em; }
.rule-chip.person-david { background: rgba(77,163,255,.13); }
.rule-chip.person-stuart { background: rgba(255,180,84,.13); }
.projects { display: grid; gap: 12px; }
.project { overflow: clip; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.project[open] { border-color: var(--line-bright); }
.project summary {
    display: grid;
    grid-template-columns: 4px minmax(180px, 1fr) minmax(90px, auto) auto auto 16px;
    align-items: center;
    gap: 18px;
    min-height: 62px;
    padding: 0 20px 0 14px;
    cursor: pointer;
    list-style: none;
}
.project summary::-webkit-details-marker { display: none; }
.project summary:hover { background: var(--surface-raised); }
.project-marker { width: 4px; height: 26px; border-radius: 5px; background: var(--line-bright); }
.project[open] .project-marker { background: linear-gradient(var(--david) 0 50%, var(--stuart) 50%); }
.project-name { overflow: hidden; font-size: 15px; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.project-updated, .count { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.count { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; }
.open-count { color: #a9ccf3; }
.claimed-count { color: #ebc58e; }
.chevron { width: 8px; height: 8px; border-right: 1px solid var(--muted); border-bottom: 1px solid var(--muted); transform: rotate(45deg); transition: transform .18s ease; }
.project[open] .chevron { transform: rotate(225deg); }
.project-detail { display: grid; gap: 12px; padding: 0 12px 12px; border-top: 1px solid var(--line); }
.project-flags { display: grid; gap: 8px; margin-top: 12px; }
.flag-banner { position: relative; display: grid; grid-template-columns: 150px minmax(0,1fr) auto; gap: 22px; overflow: hidden; padding: 22px; border: 1px solid rgba(255,80,60,.35); border-radius: 9px; background: #0c1117; transform-origin: center; }
.caution-stripe::before { position: absolute; top: 0; right: 0; left: 0; height: 3px; background: repeating-linear-gradient(120deg,var(--flag) 0 9px,transparent 9px 16px); content: ""; }
.flag-citation { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.flag-citation > span { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.flag-call { display: grid; gap: 7px; min-width: 0; color: #dbe3ea; font-size: 12px; line-height: 1.45; }
.rule-title { margin-bottom: 2px; color: var(--text); font: italic 600 17px/1.35 Georgia, "Times New Roman", serif; }
.flag-reason { color: var(--muted); }
.flag-context { margin-top: 5px; padding-top: 10px; border-top: 1px solid var(--line); }
.flag-context.markdown p { margin: 0; }
.flag-state { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.flag-state strong { padding: 5px 8px; border: 1px solid rgba(255,80,60,.55); border-radius: 999px; background: rgba(255,80,60,.11); color: #ff8b7e; font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }
.flag-new { animation: flag-settle 600ms cubic-bezier(.2,.8,.2,1) both; }
.panel { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.project-detail > .panel:first-child { margin-top: 12px; }
.panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.panel-heading > span { margin: 0; }
.panel-heading h3 { font-size: 18px; }
.markdown { color: #cbd5df; font-size: 13px; line-height: 1.65; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4 { margin: 20px 0 var(--heading-gap); color: var(--text); font-size: 16px; }
.markdown > :first-child { margin-top: 0; }
.markdown p + p { margin-top: 10px; }
.markdown ul { margin: 10px 0 0; padding-left: 20px; }
.markdown code, .markdown pre { border: 1px solid var(--line); border-radius: 5px; background: #090e14; font-family: "SFMono-Regular", Consolas, monospace; }
.markdown code { padding: 2px 5px; font-size: .92em; }
.markdown pre { overflow: auto; padding: 12px; }
.queue-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.queue-column { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.queue-column header { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.queue-column h4 { font-size: 12px; letter-spacing: .01em; }
.queue-column header span { color: var(--quiet); font-size: 10px; }
.task-list, .lock-list, .activity-list { margin: 0; padding: 0; list-style: none; }
.task-list li { display: grid; gap: 7px; padding: 12px 13px; border-bottom: 1px solid var(--line); }
.task-list li:last-child { border-bottom: 0; }
.task-list strong { overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.task-list span, .lock-list li > span:last-child, .activity-list span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.empty { padding: 12px 0; color: var(--quiet); font-size: 12px; }
.queue-column .empty { padding: 14px; }
.support-grid { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr); gap: 12px; }
.lock-list { display: grid; gap: 8px; }
.lock-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 7px; }
.lock-list li.stale { border-color: rgba(255, 107, 107, .55); background: rgba(255, 107, 107, .06); }
.lock-name { font-size: 12px; font-weight: 650; }
.activity-list { display: grid; gap: 2px; }
.activity-list li { display: grid; grid-template-columns: 7px minmax(0, 1fr); gap: 10px; padding: 6px 0; }
.activity-line { width: 2px; height: 100%; min-height: 30px; margin-left: 2px; border-radius: 2px; background: currentColor; opacity: .85; }
.activity-list div { display: grid; gap: 4px; min-width: 0; }
.activity-list strong { overflow: hidden; font-size: 12px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.journal-panel pre { overflow: auto; max-height: 320px; margin: 0; color: #b7c4d0; font: 11px/1.7 "SFMono-Regular", Consolas, monospace; white-space: pre-wrap; }
.empty-state { display: grid; gap: 7px; padding: 48px; border: 1px dashed var(--line-bright); border-radius: var(--radius); text-align: center; }
.empty-state span { color: var(--muted); font-size: 13px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; max-width: min(430px, calc(100vw - 44px)); padding: 12px 15px; border: 1px solid var(--line-bright); border-radius: 9px; background: var(--surface-raised); color: var(--text); font-size: 12px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; box-shadow: 0 16px 40px rgba(0, 0, 0, .36); }
.toast.visible { opacity: 1; transform: translateY(0); }
.noscript { position: fixed; right: 16px; bottom: 16px; padding: 10px; background: var(--danger); color: #111; font-size: 12px; }
.login-page { display: grid; place-items: center; padding: 32px; }
.login-shell { display: grid; grid-template-columns: minmax(320px, 1.15fr) minmax(320px, .85fr); width: min(980px, 100%); min-height: 560px; margin: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.login-context { display: flex; flex-direction: column; justify-content: space-between; padding: 46px; border-right: 1px solid var(--line); background: #0c1219; }
.login-context h1 { max-width: 520px; font-size: clamp(40px, 6vw, 66px); line-height: 1; }
.login-context > p { max-width: 500px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.identity-key { display: flex; gap: 22px; color: var(--muted); font-size: 11px; }
.identity-key span { display: flex; align-items: center; gap: 7px; }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: 46px; }
.login-card .panel-heading { display: block; }
.login-card h2 { font-size: 30px; }
.login-card form { display: grid; gap: 9px; }
.login-card label { margin-top: 9px; color: var(--muted); font-size: 11px; font-weight: 650; }
.login-card input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line-bright); border-radius: 7px; background: var(--bg); color: var(--text); }
.login-card button { height: 44px; margin-top: 14px; border: 0; border-radius: 7px; background: var(--david); color: #07101a; font-weight: 780; cursor: pointer; }
.login-card button:hover { background: #76b8ff; }
.form-error { margin-bottom: 12px; padding: 10px 11px; border: 1px solid rgba(255, 107, 107, .5); border-radius: 7px; background: rgba(255, 107, 107, .07); color: #ffb0b0; font-size: 11px; line-height: 1.5; }
.account-location { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.account-main { width: min(1080px, calc(100% - 64px)); }
.account-heading { grid-template-columns: minmax(0,1fr) minmax(300px,480px); }
.form-success, .managed-notice { margin-bottom: 16px; padding: 13px 15px; border: 1px solid rgba(113,214,163,.45); border-radius: 9px; background: rgba(113,214,163,.07); color: #b9efd4; font-size: 12px; }
.managed-notice { display: grid; gap: 5px; border-color: var(--line-bright); background: var(--surface); color: var(--text); }
.managed-notice p { color: var(--muted); line-height: 1.5; }
.identity-panel { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 12px; padding: 22px; border: 1px solid currentColor; border-radius: var(--radius); background: var(--surface); }
.identity-panel h2 { font-size: 32px; text-transform: capitalize; }
.identity-panel .eyebrow { color: currentColor; opacity: .75; }
.identity-login { display: grid; gap: 5px; text-align: right; }
.identity-login span, .account-form small { color: var(--muted); font-size: 10px; }
.identity-login strong { color: var(--text); font: 650 13px/1.3 "SFMono-Regular",Consolas,monospace; }
.account-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.account-card { background: var(--surface-soft); }
.account-card .panel-heading { display: grid; justify-content: start; gap: 0; }
.form-intro { min-height: 42px; margin: -5px 0 16px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.account-form fieldset { display: grid; gap: 9px; min-width: 0; margin: 0; padding: 0; border: 0; }
.account-form label { margin-top: 8px; color: var(--muted); font-size: 11px; font-weight: 650; }
.account-form input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line-bright); border-radius: 7px; background: var(--bg); color: var(--text); }
.account-form button { height: 44px; margin-top: 14px; border: 0; border-radius: 7px; background: var(--david); color: #07101a; font-weight: 780; cursor: pointer; }
.account-form button:hover { background: #76b8ff; }
.account-form fieldset:disabled { opacity: .45; }
@keyframes live-pulse { 0%, 45% { box-shadow: 0 0 0 3px rgba(113, 214, 163, .15); } 75%, 100% { box-shadow: 0 0 0 8px rgba(113, 214, 163, 0); } }
@keyframes flag-wave { 0%,100% { transform: skewY(0deg) scaleX(1); } 50% { transform: skewY(-5deg) scaleX(.92); } }
@keyframes flag-settle { 0% { transform: scale(.975); } 55% { transform: scale(1.008); } 100% { transform: scale(1); } }
@media (max-width: 900px) {
    .queue-grid, .support-grid, .account-grid { grid-template-columns: 1fr; }
    .flag-banner { grid-template-columns: 130px minmax(0,1fr); }
    .flag-state { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; }
    .page-heading { grid-template-columns: 1fr; gap: 16px; }
    .login-shell { grid-template-columns: 1fr; }
    .login-context { min-height: 380px; border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 767px) {
    .app-header { grid-template-columns: 1fr auto; min-height: 58px; padding: 0 16px; }
    .sync-rail { position: fixed; right: 14px; bottom: 14px; z-index: 15; background: var(--surface-raised); }
    .signed-in { display: none; }
    .account-location { display: none; }
    main { width: calc(100% - 24px); padding: 30px 0 70px; }
    .project summary { grid-template-columns: 4px minmax(0, 1fr) 14px; gap: 12px; padding: 0 14px 0 10px; }
    .project-updated, .count { display: none; }
    .project-detail { padding: 0 7px 7px; }
    .table-talk-heading, .table-flag, .flag-banner { grid-template-columns: 1fr; }
    .table-talk-heading { gap: 10px; padding: 18px; }
    .table-flag { gap: 10px; padding: 15px 18px; }
    .table-flag-meta { justify-self: start; }
    .flag-banner { gap: 14px; padding: 18px; }
    .flag-state { grid-column: 1; }
    .panel { padding: 17px; }
    .panel-heading { display: block; }
    .panel-heading > span { margin-bottom: var(--heading-gap); }
    .login-page { display: block; padding: 12px; }
    .login-shell { min-height: 0; }
    .login-context, .login-card { padding: 30px 24px; }
    .login-context { min-height: 360px; }
    .login-context h1 { font-size: 42px; }
    .identity-panel { display: grid; align-items: start; }
    .identity-login { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
