

:root {
  --font-display: "Red Hat Display", -apple-system, "Segoe UI", sans-serif;
  --font-text: "Red Hat Text", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Red Hat Mono", ui-monospace, Menlo, monospace;
  
  --text-badge: 12px;    
  --text-meta: 13px;     
  --text-ui: 14px;       
  --text-body: 15px;     
  --text-title: 17px;    
  --text-section: 20px;  
  --text-figure: 26px;   
  --text-page: 30px;     
  
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  
  color-scheme: light dark;
  --ink: light-dark(#0a0a0a, #f2f2f0);
  --ink-2: light-dark(#333333, #d2d2ce);
  --ink-3: light-dark(#4a4a48, #b9b9b4);
  --muted: light-dark(#5e5e5b, #9a9a95);
  --line: light-dark(#e4e4e1, #262624);
  --line-strong: light-dark(#bcbcb8, #444441);
  --soft: light-dark(#f5f5f3, #181817);
  --light-soft: light-dark(#fafaf9, #121211);
  --paper: light-dark(#ffffff, #0b0b0a);
  --hover: light-dark(#f0f0ee, #1e1e1d);
  --chip: light-dark(#ececea, #262624);
  
  --panel: light-dark(#f6f6f4, #151514);
  
  --raised: light-dark(#ffffff, #1f1f1e);
  --focus: var(--ink);
  
  --on-ink: light-dark(#ffffff, #0a0a0a);
  --ink-hover: light-dark(#343434, #d4d4d0);
  
  --selected-bg: light-dark(#e6e6e3, #2b2b29);
  --selected-ink: var(--ink);
  --selected-count: var(--on-ink);
  
  --field-line-soft: light-dark(#a9a9a5, #4e4e4b);
  --field-line: light-dark(#8a8a86, #6e6e6a);
  --field-bg: light-dark(#ffffff, #121211);
  --ok-ink: light-dark(#1f5f3a, #86d6a6);
  --ok-bg: light-dark(#e6f2ea, #10231a);
  --ok-line: light-dark(#b5d0bd, #2a5440);
  --warn-ink: light-dark(#7a4f00, #efc56d);
  --warn-bg: light-dark(#f9efd8, #261d0a);
  --warn-line: light-dark(#e3cf9f, #5a4719);
  --bad-ink: light-dark(#8f2525, #ff9e9e);
  --bad-bg: light-dark(#f9e8e8, #2a1212);
  --bad-line: light-dark(#e2b8b8, #6b2f2f);
  --info-ink: light-dark(#1e3f8a, #a5bdff);
  --info-bg: light-dark(#e8eefa, #111a31);
  --info-line: light-dark(#bccbeb, #314677);
  
  --feature-bg: light-dark(#0a0a0a, #1a1a19);
  --feature-edge: light-dark(#0a0a0a, #2e2e2c);
  
  --dev-ink: light-dark(#4d4200, #efdc8c);
  --dev-bg: light-dark(#fff8db, #221d07);
  --dev-line: light-dark(#e8d98f, #4f4515);
  --radius: 0px;
  font-family: var(--font-text);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); min-height: 100svh; font-size: var(--text-body); line-height: 1.5; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); text-wrap: balance; line-height: 1.25; }
p { line-height: 1.6; }
a { color: inherit; text-underline-offset: 4px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
h1:focus { outline: none; }
::selection { background: var(--ink); color: var(--on-ink); }
svg { flex: none; }
code, .mono { font-family: var(--font-mono); font-size: .92em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; top: -100px; left: 16px; z-index: 50; background: var(--paper); padding: 12px 14px; border: 1px solid var(--ink); }
.skip:focus { top: 10px; }


.dev-bar { display: flex; justify-content: space-between; gap: 16px; align-items: center; background: var(--dev-bg); border-bottom: 1px solid var(--dev-line); padding: 7px 28px; font-size: var(--text-meta); color: var(--dev-ink); }
.dev-bar strong { font-weight: 700; }
.dev-bar a { font-weight: 600; }


.masthead { height: 64px; padding: 0 28px; display: flex; gap: 24px; align-items: center; border-bottom: 1px solid var(--line); background: var(--paper); }
.wordmark { display: inline-flex; align-items: baseline; font-family: var(--font-display); font-size: 19px; letter-spacing: -.02em; white-space: nowrap; text-decoration: none; }
.wordmark strong { font-weight: 800; }
.wordmark span:last-child { font-weight: 400; }


.theme-switch { display: flex; align-items: center; flex: none; }
.masthead .theme-switch { margin-left: -13px; }
:root:not([data-theme]) .theme-switch { visibility: hidden; }
.sw { position: relative; width: 24px; height: 24px; padding: 0; border: 0; background: none; }
.sw::before { content: ""; position: absolute; inset: 5px; border: 1px solid transparent; transition: transform .2s ease, border-color .2s ease; }
.sw-dark::before { background: #0a0a0a; }
.sw-light::before { background: #ffffff; }
:root[data-theme="dark"] .sw-dark::before { border-color: #ffffff; }
:root[data-theme="light"] .sw-light::before { border-color: #0a0a0a; }
.sw:hover::before { transform: scale(1.15); }
.sw:focus-visible { outline-offset: 0; }
.brand-dot { height: 4px; width: 4px; background: currentColor; margin: 0 2px; display: inline-block; }
.workspace-label { color: var(--muted); font-size: var(--text-ui); border-left: 1px solid var(--line); padding-left: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.masthead-person { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: var(--text-ui); font-weight: 600; line-height: 1.3; }
.masthead-person small { display: block; color: var(--muted); font-weight: 400; font-size: var(--text-meta); }
.masthead-person .sign-out { margin: 0 0 0 6px; }
.avatar { height: 32px; width: 32px; display: inline-flex; align-items: center; justify-content: center; background: var(--chip); font-size: var(--text-badge); font-weight: 700; flex: none; font-family: var(--font-display); }
.avatar.inverse { background: var(--ink); color: var(--on-ink); }


.layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100svh - 64px); }
.sidebar { background: var(--light-soft); border-right: 1px solid var(--line); padding: 20px 12px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.sidebar-group > h2 { font-family: var(--font-text); font-size: var(--text-meta); font-weight: 500; color: var(--muted); margin: 0 12px 6px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; min-height: 40px; font-size: var(--text-body); color: var(--ink-3); text-decoration: none; }
.side-nav a svg { color: var(--muted); }
.side-nav a:hover { background: var(--hover); color: var(--ink); }
.side-nav a:hover svg { color: var(--ink-2); }
.side-nav a[aria-current="page"] { background: var(--selected-bg); color: var(--selected-ink); font-weight: 600; }
.side-nav a[aria-current="page"] svg { color: var(--ink); }
.side-nav .count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; font-size: var(--text-badge); font-weight: 700; background: var(--chip); color: var(--ink); font-variant-numeric: tabular-nums; }
.side-nav a[aria-current="page"] .count { background: var(--ink); color: var(--selected-count); }
.project-switcher { display: block; border: 1px solid var(--line); background: var(--paper); }
.project-switcher summary { list-style: none; cursor: pointer; padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.project-switcher summary::-webkit-details-marker { display: none; }
.project-switcher summary > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.project-switcher summary strong { font-size: var(--text-body); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-switcher summary small { font-size: var(--text-meta); color: var(--muted); }
.project-switcher ul { list-style: none; padding: 4px; margin: 0; border-top: 1px solid var(--line); }
.project-switcher li a { display: flex; justify-content: space-between; gap: 8px; padding: 9px 8px; font-size: var(--text-ui); text-decoration: none; }
.project-switcher li a:hover { background: var(--hover); }
.project-switcher li a[aria-current="page"] { font-weight: 700; }
.sidebar-bottom { margin-top: auto; padding: 0 12px; display: flex; flex-direction: column; gap: 14px; }
.contact-person { display: flex; align-items: center; gap: 10px; font-size: var(--text-meta); }
.contact-person > div { display: flex; flex-direction: column; gap: 2px; }
.contact-person span { color: var(--muted); }
.main { padding: 40px 48px 32px; min-width: 0; width: 100%; max-width: 1440px; }
.main-footer { border-top: 1px solid var(--line); margin-top: 48px; padding-top: 16px; display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: var(--text-meta); }


.page-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: var(--space-8); flex-wrap: wrap; }
.page-heading h1 { font-size: var(--text-page); font-weight: 600; letter-spacing: -.025em; line-height: 1.15; }
.page-heading p { font-size: var(--text-body); color: var(--muted); margin-top: 8px; max-width: 70ch; }
.page-heading .eyebrow { font-size: var(--text-meta); color: var(--muted); margin-bottom: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.section { margin-top: var(--space-12); }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: var(--space-4); }
.section-heading h2 { font-size: var(--text-section); font-weight: 600; letter-spacing: -.015em; }
.section-heading a, .section-heading .meta { font-size: var(--text-meta); color: var(--muted); }

.sub-heading { font-family: var(--font-display); font-size: var(--text-title); font-weight: 600; letter-spacing: -.01em; margin: var(--space-8) 0 var(--space-3); }
.section-heading a:hover { color: var(--ink); }


.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--ink); color: var(--on-ink); padding: 8px 16px; min-height: 40px; border: 1px solid var(--ink); text-decoration: none; font-size: var(--text-ui); font-weight: 600; line-height: 1.2; white-space: nowrap; }
.button:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.button.secondary { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
.button.secondary:hover { background: var(--hover); border-color: var(--ink); }
.button.light { background: #fff; color: #0a0a0a; border-color: #fff; }
.button.light:hover { background: #e4e4e1; }
.button.danger { background: var(--paper); color: var(--bad-ink); border-color: var(--bad-line); }
.button.danger:hover { background: var(--bad-bg); border-color: var(--bad-ink); }
.button.small { min-height: 32px; padding: 5px 12px; font-size: var(--text-meta); }
.text-link { background: none; border: 0; padding: 4px 0; font-size: var(--text-ui); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-strong); }
.text-link:hover { text-decoration-color: currentColor; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }


.pill { display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 3px 8px; font-size: var(--text-badge); font-weight: 600; color: var(--ink-2); background: var(--chip); white-space: nowrap; line-height: 1.4; vertical-align: middle; }
.pill::before { content: ""; width: 6px; height: 6px; background: currentColor; opacity: .75; }
.pill.plain::before { display: none; }
.pill.ok { color: var(--ok-ink); background: var(--ok-bg); }
.pill.warn { color: var(--warn-ink); background: var(--warn-bg); }
.pill.bad { color: var(--bad-ink); background: var(--bad-bg); }
.pill.info { color: var(--info-ink); background: var(--info-bg); }

.sla-clock { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: var(--text-meta); color: var(--muted); font-variant-numeric: tabular-nums; }
.sla-clock [data-sla-left] { color: var(--ink); font-weight: 600; }
.sla-clock.is-overdue [data-sla-left] { color: var(--bad-ink); }
.pill.muted { color: var(--muted); background: var(--soft); }
.pill.neutral { color: var(--ink-2); background: var(--chip); }
.pill.dark { color: var(--on-ink); background: var(--ink); }


:is(.filters, .tabs) > a { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 5px 10px; font-size: var(--text-ui); font-weight: 500; color: var(--ink-3); text-decoration: none; white-space: nowrap; }
:is(.filters, .tabs) > a:hover { background: var(--hover); color: var(--ink); }
:is(.filters, .tabs) > a[aria-current="page"] { background: var(--selected-bg); color: var(--ink); font-weight: 600; }
:is(.filters, .tabs) .filter-count, .tabs .count { font-size: var(--text-meta); font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }


.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--ok-bg); color: var(--ok-ink); padding: 12px 16px; margin-bottom: 24px; font-size: var(--text-body); }
.notice.error { background: var(--bad-bg); color: var(--bad-ink); }
.notice.info { background: var(--info-bg); color: var(--info-ink); }

.notice.warn { background: var(--warn-bg); color: var(--warn-ink); }


.table-wrap { position: relative; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--text-body); }
table.data th { text-align: left; font-weight: 500; font-size: var(--text-meta); color: var(--muted); padding: 0 16px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: bottom; }
table.data td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data :is(th, td):first-child { padding-left: 0; }
table.data :is(th, td):last-child { padding-right: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .nowrap { white-space: nowrap; }
table.data td.primary a, table.data td.primary strong { font-weight: 600; text-decoration: none; }
table.data td.primary a:hover { text-decoration: underline; }
table.data td .sub { display: block; color: var(--muted); font-size: var(--text-meta); margin-top: 2px; }


.list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.list > li { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: flex-start; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; font-size: var(--text-body); }
.list .meta { color: var(--muted); font-size: var(--text-meta); margin-top: 2px; display: flex; gap: 4px 12px; flex-wrap: wrap; }
.list .body { font-size: var(--text-body); color: var(--ink-2); margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.quote { border-left: 2px solid var(--line-strong); padding: 2px 0 2px 12px; color: var(--ink-2); font-size: var(--text-body); margin-top: 8px; }


.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--panel); padding: 24px; min-width: 0; }
.card h2, .card h3 { font-size: var(--text-title); font-weight: 600; letter-spacing: -.01em; margin-bottom: 12px; }


.grid:has(> .stat) { gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(200px, calc(50% - 12px)), 1fr)); }
.grid:has(> .stat) + * { margin-top: var(--space-8); }
.stat { border-top: 1px solid var(--line-strong); padding: 12px 0 0; min-width: 0; }
.stat dt { font-size: var(--text-meta); color: var(--muted); }
.stat dd { font-family: var(--font-display); font-size: var(--text-figure); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat dd small { font-family: var(--font-text); font-size: var(--text-meta); font-weight: 400; color: var(--muted); letter-spacing: 0; margin-left: 6px; }
dl.facts > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--text-body); }
dl.facts dt { color: var(--muted); }


.form { display: flex; flex-direction: column; gap: 6px; }
.form label, .field-label { font-size: var(--text-ui); font-weight: 600; margin-top: 12px; }
.form input[type="text"], .form input[type="email"], .form input[type="number"], .form input:not([type]), .form textarea, .form select, input.field, textarea.field, select.field {
  width: 100%; min-width: 0; border: 1px solid var(--field-line-soft); background: var(--field-bg); color: var(--ink); padding: 9px 12px; min-height: 40px; font-size: var(--text-body); border-radius: 0;
}
.form textarea, textarea.field { resize: vertical; min-height: 96px; line-height: 1.55; }
.form .hint { font-size: var(--text-meta); color: var(--muted); }
.form .actions { display: flex; gap: 8px; align-items: center; margin-top: 16px; }


.empty { background: var(--panel); padding: 20px 24px; text-align: left; color: var(--muted); font-size: var(--text-body); }
.empty strong { color: var(--ink); display: block; font-size: var(--text-body); font-weight: 600; }
.empty strong + * { margin-top: 4px; }


@media (max-width: 1100px) {
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main { padding: 32px 32px 24px; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; gap: 12px; }
  .side-nav { flex-direction: row; overflow-x: auto; }
  .side-nav a { white-space: nowrap; }
  .sidebar-bottom, .sidebar-group > h2 { display: none; }
  .workspace-label { display: none; }
  .masthead { padding: 0 16px; gap: 16px; }
  .main { padding: 24px 16px; }
  .page-heading h1 { font-size: 26px; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dev-bar { padding: 7px 16px; flex-wrap: wrap; }
}

@media (max-width: 520px) {
  .masthead { gap: 12px; }
  .masthead .theme-switch { margin-left: -9px; }
  .masthead-person > span + span { display: none; }
  table.data :is(th, td) { padding-inline: 8px; }
}

@media (max-width: 420px) {
  .masthead-person > .avatar { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }


.auth { max-width: 400px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.auth h1 { font-size: var(--text-page); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.auth .auth-sub { font-size: var(--text-title); font-weight: 600; margin-top: 10px; }
.auth .form label { margin-top: 4px; }
.auth .form .actions { margin-top: 14px; }
.auth .form .field-label { margin-top: 4px; }
.auth-check { min-height: 65px; }
.auth-passkey { display: flex; flex-direction: column; gap: 14px; }
.auth-or { font-size: var(--text-ui); color: var(--muted); margin-top: 4px; }
.auth-state { font-size: var(--text-body); color: var(--muted); line-height: 1.5; }
.auth-state strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.auth-alert { background: var(--bad-bg); color: var(--bad-ink); padding: 10px 12px; font-size: var(--text-ui); line-height: 1.45; }
.auth .auth-code { font-family: var(--font-mono); font-size: 22px; letter-spacing: .32em; padding-block: 10px; }
.button.wide { width: 100%; min-height: 46px; font-size: var(--text-body); }
.auth-links { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; font-size: var(--text-ui); margin-top: 6px; }
.auth-links form { margin: 0; }
.auth-links a, .link-button { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.auth-links a:hover, .link-button:hover { color: var(--ink); text-decoration-color: currentColor; }
.link-button { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

.auth-qr { align-self: flex-start; background: #ffffff; border: 1px solid var(--line); padding: 10px; line-height: 0; }
.auth-qr svg { width: 192px; height: 192px; }
.auth-key { display: flex; flex-direction: column; gap: 4px; }
.auth-key dt { font-size: var(--text-meta); font-weight: 500; color: var(--muted); }
.auth-key code { font-size: var(--text-ui); letter-spacing: .06em; overflow-wrap: anywhere; }
.auth-backup { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.auth-backup li { background: var(--soft); padding: 8px 10px; }
.auth-backup code { font-size: var(--text-ui); }

.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
