/* Headless CRM — the Jira Software look (after Jeera), in plain CSS.
   One stylesheet for every page: the app shell, the records, the sign-in card.
   Light by default; dark follows the system, or the choice in the profile menu. */

:root {
  --text: #172b4d; --text-subtle: #44546f; --text-subtlest: #626f86; --text-disabled: #8590a2;
  --brand: #0c66e4; --brand-hover: #0055cc; --brand-pressed: #09326c; --link: #0c66e4; --on-brand: #ffffff;
  --surface: #ffffff; --sunken: #f7f8f9; --raised: #ffffff; --overlay: #ffffff;
  --neutral: #091e420f; --neutral-hover: #091e4224; --neutral-pressed: #091e424f;
  --border: #091e4224; --border-bold: #758195; --line: #dcdfe4;
  --input: #f7f8f9; --input-hover: #f1f2f4; --focus: #388bff;
  --selected: #e9f2ff; --selected-text: #0c66e4;
  --danger: #c9372c; --danger-hover: #ae2e24; --danger-bg: #ffeceb; --danger-text: #ae2e24;
  --warn-bg: #fff7d6; --warn-text: #7f5f01; --ok: #22a06b; --ok-bg: #dcfff1; --ok-text: #216e4e;
  --purple-bg: #f3f0ff; --purple-text: #5e4db2;
  --todo-bg: #091e420f; --todo-text: #44546f; --prog-bg: #e9f2ff; --prog-text: #0055cc;
  --shadow-raised: 0 1px 1px #091e4240, 0 0 1px #091e424f;
  --shadow-overlay: 0 8px 12px #091e4226, 0 0 1px #091e424f;
  --scrim: #091e427d; --ring: #ffffff;
  --nav-h: 56px; --side-w: 240px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', Ubuntu, 'Helvetica Neue', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text: #b6c2cf; --text-subtle: #9fadbc; --text-subtlest: #8c9bab; --text-disabled: #596773;
    --brand: #579dff; --brand-hover: #85b8ff; --brand-pressed: #cce0ff; --link: #579dff; --on-brand: #1d2125;
    --surface: #1d2125; --sunken: #161a1d; --raised: #22272b; --overlay: #282e33;
    --neutral: #a1bdd914; --neutral-hover: #a6c5e229; --neutral-pressed: #bfdbf847;
    --border: #a6c5e229; --border-bold: #738496; --line: #2c333a;
    --input: #22272b; --input-hover: #282e33; --focus: #579dff;
    --selected: #1c2b41; --selected-text: #579dff;
    --danger: #f87168; --danger-hover: #fd9891; --danger-bg: #42221f; --danger-text: #fd9891;
    --warn-bg: #533f04; --warn-text: #f5cd47; --ok: #2abb7f; --ok-bg: #164b35; --ok-text: #7ee2b8;
    --purple-bg: #2b273f; --purple-text: #b8acf6;
    --todo-bg: #a1bdd914; --todo-text: #9fadbc; --prog-bg: #1c2b41; --prog-text: #85b8ff;
    --shadow-raised: 0 1px 1px #03040480, 0 0 1px #03040480;
    --shadow-overlay: inset 0 0 0 1px #bcd6f01f, 0 8px 12px #0304045c, 0 0 1px #03040480;
    --scrim: #10121499; --ring: #1d2125;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --text: #b6c2cf; --text-subtle: #9fadbc; --text-subtlest: #8c9bab; --text-disabled: #596773;
  --brand: #579dff; --brand-hover: #85b8ff; --brand-pressed: #cce0ff; --link: #579dff; --on-brand: #1d2125;
  --surface: #1d2125; --sunken: #161a1d; --raised: #22272b; --overlay: #282e33;
  --neutral: #a1bdd914; --neutral-hover: #a6c5e229; --neutral-pressed: #bfdbf847;
  --border: #a6c5e229; --border-bold: #738496; --line: #2c333a;
  --input: #22272b; --input-hover: #282e33; --focus: #579dff;
  --selected: #1c2b41; --selected-text: #579dff;
  --danger: #f87168; --danger-hover: #fd9891; --danger-bg: #42221f; --danger-text: #fd9891;
  --warn-bg: #533f04; --warn-text: #f5cd47; --ok: #2abb7f; --ok-bg: #164b35; --ok-text: #7ee2b8;
  --purple-bg: #2b273f; --purple-text: #b8acf6;
  --todo-bg: #a1bdd914; --todo-text: #9fadbc; --prog-bg: #1c2b41; --prog-text: #85b8ff;
  --shadow-raised: 0 1px 1px #03040480, 0 0 1px #03040480;
  --shadow-overlay: inset 0 0 0 1px #bcd6f01f, 0 8px 12px #0304045c, 0 0 1px #03040480;
  --scrim: #10121499; --ring: #1d2125;
  color-scheme: dark;
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font: 14px/20px var(--font); color: var(--text); background: var(--surface); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; color: var(--text); }
h1 { font-size: 24px; line-height: 28px; font-weight: 500; letter-spacing: -0.01em; }
h2 { font-size: 20px; line-height: 24px; font-weight: 500; }
h3 { font-size: 16px; line-height: 20px; font-weight: 600; }
h4 { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--text-subtle); }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: 12px; background: var(--neutral); padding: 1px 4px; border-radius: 3px; }
pre { font-family: var(--mono); font-size: 12px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.muted, .hint { color: var(--text-subtlest); }
.hint { font-size: 12px; line-height: 16px; }
.subtle { color: var(--text-subtle); }
.small { font-size: 12px; line-height: 16px; }
.mono { font-family: var(--mono); }
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.between { justify-content: space-between; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── Buttons ── (the bare button.* names are what the page scripts write) */
.btn, button.primary, button.quiet, button.danger, button.secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 32px; padding: 0 12px; border: 0; border-radius: 3px;
  background: var(--neutral); color: var(--text-subtle); font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover, button.quiet:hover, button.secondary:hover { background: var(--neutral-hover); color: var(--text); }
.btn:active, button.quiet:active { background: var(--neutral-pressed); }
.btn:disabled, button:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary, button.primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover, button.primary:hover { background: var(--brand-hover); color: var(--on-brand); }
.btn-danger, button.danger { background: var(--danger); color: #fff; }
.btn-danger:hover, button.danger:hover { background: var(--danger-hover); color: #fff; }
.btn-subtle { background: transparent; }
.btn-subtle:hover { background: var(--neutral); }
.btn-sm { height: 24px; padding: 0 8px; font-size: 13px; }
.btn-icon { width: 32px; padding: 0; }
.btn-sm.btn-icon { width: 24px; }
.btn.on { background: var(--selected); color: var(--selected-text); }
.link-btn, button.link { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; font: inherit; }
.link-btn:hover, button.link:hover { text-decoration: underline; }

/* ── Inputs ── */
.input, .select, .textarea,
.main input[type="text"], .main input[type="email"], .main input[type="search"], .main input[type="number"], .main input[type="date"], .main input[type="password"], .main input[type="url"], .main select, .main textarea,
.authcard input[type="text"], .authcard input[type="email"], .authcard input[type="password"], .authcard input[type="number"], .authcard select, .authcard textarea {
  width: 100%; min-height: 36px; padding: 6px 8px; border: 2px solid var(--line); border-radius: 3px; background: var(--input); color: var(--text); outline: none; }
.input:hover, .main input:hover, .main select:hover, .main textarea:hover, .authcard input:hover { background: var(--input-hover); }
.input:focus, .main input:focus, .main select:focus, .main textarea:focus, .authcard input:focus, .authcard select:focus, .authcard textarea:focus { border-color: var(--focus); background: var(--surface); }
.main textarea, .textarea { min-height: 80px; resize: vertical; line-height: 20px; }
.input-sm { min-height: 32px; padding: 4px 8px; }
.main input[type="checkbox"], .main input[type="radio"] { width: auto; min-height: 0; accent-color: var(--brand); }
label.field, .main label:has(> .cap), .authcard label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-subtle); }
label .cap, .cap { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--text-subtle); }
label .req, .req { color: var(--danger); }
.help { font-size: 12px; color: var(--text-subtlest); font-weight: 400; }
.search { position: relative; }
.search svg { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: var(--text-subtlest); pointer-events: none; }
.search .input, .search input { padding-left: 30px !important; }

/* ── Lozenges, badges, avatars ── */
.lozenge { display: inline-flex; align-items: center; height: 20px; padding: 0 4px; border-radius: 3px; font-size: 11px; font-weight: 700; text-transform: uppercase; line-height: 16px; white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.lz-grey { background: var(--todo-bg); color: var(--todo-text); }
.lz-blue { background: var(--prog-bg); color: var(--prog-text); }
.lz-green { background: var(--ok-bg); color: var(--ok-text); }
.lz-red { background: var(--danger-bg); color: var(--danger-text); }
.lz-yellow { background: var(--warn-bg); color: var(--warn-text); }
.lz-purple { background: var(--purple-bg); color: var(--purple-text); }
.lz-bold.lz-green { background: #1f845a; color: #fff; }
.lz-bold.lz-blue { background: var(--brand); color: var(--on-brand); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 16px; padding: 0 4px; border-radius: 8px; font-size: 12px; line-height: 16px; background: var(--neutral-hover); color: var(--text); font-weight: 500; }
.badge-blue { background: var(--brand); color: var(--on-brand); }
.label-chip, .tagchip { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: 3px; border: 1px solid var(--line); font-size: 12px; color: var(--text); background: var(--surface); white-space: nowrap; }
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 600; flex-shrink: 0; user-select: none; box-shadow: 0 0 0 2px var(--ring); vertical-align: middle; }
.avatar-none { background: var(--neutral-hover); color: var(--text-subtlest); }
.person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.person > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prio-ic { flex-shrink: 0; vertical-align: middle; }
.points { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--neutral-hover); font-size: 12px; font-weight: 600; color: var(--text); }
.key { color: var(--text-subtle); font-size: 12px; font-weight: 500; white-space: nowrap; }
.dnc { display: inline-flex; align-items: center; height: 20px; padding: 0 4px; border-radius: 3px; font-size: 11px; font-weight: 700; text-transform: uppercase; background: var(--danger-bg); color: var(--danger-text); white-space: nowrap; }

/* ── Top navigation ── */
.topnav { position: sticky; top: 0; z-index: 50; height: var(--nav-h); display: flex; align-items: center; gap: 4px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topnav .brand { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px; margin-right: 8px; border-radius: 3px; color: var(--text); font-weight: 600; font-size: 16px; text-decoration: none !important; white-space: nowrap; }
.topnav .brand:hover { background: var(--neutral); }
.navlink { position: relative; display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 8px; border: 0; background: none; border-radius: 3px; color: var(--text-subtle); font-weight: 500; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.navlink:hover { background: var(--neutral); color: var(--text); }
.navlink.on { color: var(--brand); }
.navlink.on::after { content: ''; position: absolute; left: 4px; right: 4px; bottom: -12px; height: 3px; border-radius: 2px 2px 0 0; background: var(--brand); }
.topnav .spacer { flex: 1; }
.topnav .search { width: 220px; }
.topnav .search input { width: 100%; min-height: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--border-bold); border-radius: 3px; background: var(--surface); color: var(--text); outline: none; }
.topnav .search input:focus { border: 2px solid var(--focus); }
.iconbtn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--text-subtle); cursor: pointer; text-decoration: none !important; }
.iconbtn:hover { background: var(--neutral); color: var(--text); }
.helpmark { width: 20px; height: 20px; border-radius: 10px; border: 2px solid currentColor; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; line-height: 1; }
.mob-only { display: none; }

/* ── Menus and popovers ── */
.pop { position: fixed; z-index: 100; min-width: 220px; max-width: 360px; max-height: 70vh; overflow: auto; padding: 4px 0; background: var(--overlay); border-radius: 3px; box-shadow: var(--shadow-overlay); }
.pop-h { padding: 12px 16px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-subtle); letter-spacing: .02em; }
.mi { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 16px; border: 0; background: none; text-align: left; color: var(--text); cursor: pointer; text-decoration: none !important; position: relative; font: inherit; }
.mi:hover { background: var(--neutral); }
.mi.sel { background: var(--selected); color: var(--selected-text); }
.mi.sel::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--brand); }
.mi .muted { font-size: 12px; }
.pop-sep { height: 1px; background: var(--line); margin: 4px 0; }

/* ── App layout ── */
.app { display: flex; min-height: calc(100dvh - var(--nav-h)); }
.side { position: sticky; top: var(--nav-h); align-self: flex-start; width: var(--side-w); height: calc(100dvh - var(--nav-h)); flex-shrink: 0; overflow-y: auto; padding: 16px 8px; background: var(--surface); border-right: 1px solid var(--line); }
.side-proj { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.side-proj b { display: block; font-size: 14px; line-height: 18px; }
.side-h { padding: 16px 12px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-subtle); letter-spacing: .02em; }
.side a.si { position: relative; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 3px; color: var(--text-subtle); font-weight: 500; text-decoration: none !important; }
.side a.si:hover { background: var(--neutral); color: var(--text); }
.side a.si.on { background: var(--selected); color: var(--selected-text); }
.side a.si.on::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); }
.side a.si .badge { margin-left: auto; font-size: 11px; background: var(--neutral); color: var(--text-subtle); }
.side a.si.on .badge { background: var(--brand); color: var(--on-brand); }
.side .divider { height: 1px; background: var(--line); margin: 16px 8px; }
.side .foot { padding: 24px 12px 0; font-size: 12px; color: var(--text-subtlest); }
.main { flex: 1; min-width: 0; padding: 24px 40px 48px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-subtle); margin-bottom: 12px; flex-wrap: wrap; }
.crumbs a { color: var(--text-subtle); }
.crumbs .sep { color: var(--text-subtlest); }
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.pagehead .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pagehead .lede { margin-top: 4px; color: var(--text-subtle); }
.toolbar { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.projicon { display: inline-flex; align-items: center; justify-content: center; border-radius: 3px; color: #fff; font-weight: 700; flex-shrink: 0; }

/* ── Tables ── */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 8px; font-size: 12px; font-weight: 600; color: var(--text-subtle); border-bottom: 2px solid var(--line); white-space: nowrap; }
.table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: var(--sunken); }
.table th.num, .table td.num { text-align: right; }
.tablewrap { overflow-x: auto; }

/* ── Board ── */
.board { display: flex; gap: 8px; align-items: flex-start; overflow-x: auto; padding-bottom: 16px; min-height: 400px; }
.colm { flex: 0 0 272px; display: flex; flex-direction: column; background: var(--sunken); border-radius: 6px; max-height: calc(100dvh - 220px); }
.colm-h { display: flex; align-items: center; gap: 6px; padding: 12px 12px 8px; font-size: 12px; font-weight: 600; color: var(--text-subtle); text-transform: uppercase; letter-spacing: .02em; }
.colm-h .sum { margin-left: auto; text-transform: none; font-weight: 500; color: var(--text-subtlest); letter-spacing: 0; }
.colm-body { flex: 1; overflow-y: auto; padding: 0 6px 6px; display: flex; flex-direction: column; gap: 4px; min-height: 60px; border-radius: 0 0 6px 6px; }
.colm-body.over { background: var(--selected); outline: 2px dashed var(--focus); outline-offset: -4px; }
.colm.won .colm-h::after { content: '✓'; color: var(--ok-text); margin-left: 2px; }
.colm-more { display: block; margin: 2px 6px 8px; padding: 6px 8px; border-radius: 3px; color: var(--text-subtle); font-size: 13px; text-align: center; }
.colm-more:hover { background: var(--neutral); color: var(--text); text-decoration: none; }
.card { display: block; padding: 10px 12px; background: var(--raised); border-radius: 3px; box-shadow: var(--shadow-raised); color: var(--text); cursor: pointer; text-decoration: none !important; user-select: none; }
.card:hover { background: var(--sunken); }
.card.sel { background: var(--selected); }
.card.dragging { opacity: .4; }
.card .s { margin-bottom: 4px; font-weight: 500; word-break: break-word; }
.card .c { margin-bottom: 8px; font-size: 12px; color: var(--text-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .m { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card .m .grow { min-width: 0; }

/* ── Side panel (a record) ── */
.scrim { position: fixed; inset: var(--nav-h) 0 0 0; z-index: 70; background: var(--scrim); }
.drawer { position: fixed; z-index: 75; top: calc(var(--nav-h) + 8px); right: 8px; bottom: 8px; width: min(560px, calc(100vw - 16px)); display: flex; flex-direction: column; background: var(--overlay); border-radius: 3px; box-shadow: var(--shadow-overlay); overflow: hidden; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px 8px; }
.drawer-head .sub { display: block; margin-top: 4px; font-size: 12px; color: var(--text-subtlest); }
.drawer-head h2 { font-size: 20px; line-height: 28px; font-weight: 500; word-break: break-word; }
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.drawer-actions { display: flex; gap: 4px; flex-wrap: wrap; }

/* ── Modal ── */
.overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px 16px; background: var(--scrim); overflow-y: auto; }
.modal { width: 100%; max-width: 600px; background: var(--overlay); border-radius: 3px; box-shadow: var(--shadow-overlay); display: flex; flex-direction: column; max-height: calc(100dvh - 80px); }
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 12px; }
.modal-b { padding: 4px 24px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-f { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 16px 24px 20px; border-top: 1px solid var(--line); }

/* ── Toasts and notices ── */
.toasts { position: fixed; left: 24px; bottom: 24px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: flex-start; gap: 10px; width: 400px; max-width: calc(100vw - 48px); padding: 14px 16px; border-radius: 3px; background: var(--overlay); color: var(--text); box-shadow: var(--shadow-overlay); border-left: 4px solid var(--brand); }
.toast.err { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }
.toast .mark { flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--brand); }
.toast.err .mark { background: var(--danger); }
.toast.ok .mark { background: var(--ok); }
.toast .txt { flex: 1; min-width: 0; }
.toast button { border: 0; background: none; color: var(--text-subtlest); cursor: pointer; font-size: 18px; line-height: 20px; padding: 0 2px; }
.toast button:hover { color: var(--text); }
.notice, .msg { padding: 12px 16px; border-radius: 3px; background: var(--selected); color: var(--text); }
.notice.warn, .msg.warn { background: var(--warn-bg); color: var(--warn-text); }
.notice.err, .msg.err { background: var(--danger-bg); color: var(--danger-text); }
.notice.ok, .msg.ok { background: var(--ok-bg); color: var(--ok-text); }

/* ── Bits ── */
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 16px; text-align: center; color: var(--text-subtle); }
.empty h3 { color: var(--text); }
.segment { display: inline-flex; border-radius: 3px; background: var(--neutral); padding: 2px; gap: 2px; }
.segment button { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 0; border-radius: 3px; background: none; color: var(--text-subtle); font-weight: 500; cursor: pointer; }
.segment button:hover { color: var(--text); }
.segment button.on, .segment button[aria-pressed="true"] { background: var(--raised); color: var(--brand); box-shadow: var(--shadow-raised); }
.statgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.statbox { padding: 16px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); }
.statbox > b { display: block; font-size: 24px; line-height: 28px; font-weight: 500; }
.panelbox { border: 1px solid var(--line); border-radius: 3px; background: var(--surface); }
.panelbox-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.panelbox-b { padding: 16px; }
.dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 4px 12px; align-items: start; margin: 0; }
.dl > dt { color: var(--text-subtle); font-size: 13px; font-weight: 600; padding: 6px 0; }
.dl > dd { margin: 0; min-width: 0; padding: 6px 0; word-break: break-word; }
.kbd { display: inline-block; min-width: 18px; padding: 0 4px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; font-size: 11px; text-align: center; color: var(--text-subtle); background: var(--surface); }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 16px; }
.tab { position: relative; padding: 6px 8px 8px; border: 0; background: none; color: var(--text-subtle); font-weight: 500; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--brand); }
.tab.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--brand); }

/* ── Settings pages (team, tokens): sections, member and token tables ── */
.main.settings { max-width: 1100px; }
.main .authcard { background: var(--surface); padding: 20px 24px; border: 1px solid var(--line); border-radius: 3px; box-shadow: none; display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.main .authcard h2 { font-size: 16px !important; line-height: 20px; font-weight: 600 !important; }
.main .authcard form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.main .authcard form label { flex: 1 1 12rem; }
.main .authcard form > button { height: 36px; }
.orgbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
table.tokens { width: 100%; border-collapse: collapse; }
table.tokens th { text-align: left; padding: 8px; font-size: 12px; font-weight: 600; color: var(--text-subtle); border-bottom: 2px solid var(--line); white-space: nowrap; }
table.tokens td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tokens tr:hover td { background: var(--sunken); }
table.tokens td.mono { font-family: var(--mono); font-size: 12px; color: var(--text-subtle); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.row-actions button { height: 28px; padding: 0 8px; font-size: 13px; }
.you { margin-left: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-subtlest); }
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 4px; border-radius: 3px; font-size: 11px; font-weight: 700; text-transform: uppercase; background: var(--todo-bg); color: var(--todo-text); white-space: nowrap; }
.pill.active { background: var(--ok-bg); color: var(--ok-text); }
.pill.invited { background: var(--prog-bg); color: var(--prog-text); }
.pill.expired { background: var(--warn-bg); color: var(--warn-text); }
.pill.revoked, .pill.deactivated { background: var(--danger-bg); color: var(--danger-text); }
.tokenbox, .linkbox { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 3px; background: var(--ok-bg); color: var(--ok-text); }
.linkbox { background: var(--selected); color: var(--text); }
.tokenbox code, .linkbox code { display: block; padding: 8px 10px; background: var(--surface); color: var(--text); border: 1px solid var(--line); word-break: break-all; font-size: 13px; }
.tokenbox .hint, .linkbox .hint { color: inherit; opacity: .85; }

/* ── The sign-in card ── */
.center { display: grid; place-items: center; min-height: 100dvh; padding: 32px 16px; background: var(--sunken); }
.authbox { width: 100%; max-width: 400px; }
.authbrand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 24px; color: var(--text); text-decoration: none !important; }
.authbrand b { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.authcard { background: var(--raised); padding: 32px 40px; border-radius: 3px; box-shadow: var(--shadow-overlay); display: flex; flex-direction: column; gap: 14px; }
.authcard h1, .authcard .h { text-align: center; font-size: 16px; line-height: 20px; font-weight: 600; color: var(--text-subtle); margin-bottom: 4px; }
.center .authcard button.primary, .center .authcard .btn-primary { width: 100%; height: 40px; }
.authcard .sep { display: flex; align-items: center; gap: 12px; color: var(--text-subtlest); font-size: 12px; }
.authcard .sep::before, .authcard .sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.authfoot { margin-top: 16px; text-align: center; font-size: 12px; color: var(--text-subtle); }
.authfoot a { color: var(--link); }

/* One card holds the whole sign-in page, as Jira's does: heading centred, the
   form, the links. Cards the page itself nests inside it lie flat. */
.center .authpanel { gap: 16px; }
.center .authpanel > div:first-child { text-align: center; }
.center .authpanel > div:first-child h1 { font-size: 20px !important; line-height: 24px; font-weight: 600; color: var(--text); margin: 0 !important; }
.center .authpanel > div:first-child .hint { margin-top: 8px !important; font-size: 14px; line-height: 20px; color: var(--text-subtle); }
.center .authpanel .eyebrow { margin: 0 0 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); }
.center .authpanel .authcard { padding: 0; background: none; box-shadow: none; border: 0; gap: 12px; }
.center .authpanel > p.hint { text-align: center; }
.center .authpanel #or { display: flex; align-items: center; gap: 12px; color: var(--text-subtlest); font-size: 12px; }
.center .authpanel #or::before, .center .authpanel #or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.center .authpanel .consent { display: flex; flex-direction: column; gap: 14px; }
.center .authpanel .client { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 12px; border-radius: 3px; background: var(--sunken); }
.center .authpanel .client .who { font-weight: 600; font-size: 16px; }
.center .authpanel .grants { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text-subtle); }
.center .authpanel .actions { display: flex; gap: 8px; }
.center .authpanel .actions button { flex: 1; height: 40px; }
.center .authpanel .mono { font-family: var(--mono); font-size: 13px; }
.center .authpanel .msg { text-align: left; }

/* ── Small screens ── */
@media (max-width: 960px) {
  .side { position: fixed; z-index: 60; left: 0; top: var(--nav-h); box-shadow: var(--shadow-overlay); transform: translateX(-100%); transition: transform .15s; }
  .side.open { transform: none; }
  .mob-only { display: inline-flex; }
  .desk-only { display: none !important; }
  .main { padding: 16px; }
  .topnav .search { display: none; }
  .drawer { top: var(--nav-h); right: 0; bottom: 0; width: 100vw; border-radius: 0; }
}
@media (max-width: 560px) {
  .navlink, .topnav .brand span { display: none; }
  .topnav [data-shell="create"] .lbl { display: none; }
  .topnav { padding: 0 6px; }
  .colm { flex-basis: 85vw; }
  .authcard { padding: 24px 20px; }
  .dl { grid-template-columns: 110px minmax(0, 1fr); }
}
