/* GitTol product app design system. Two themes: GitTol Dark (flagship default) and GitTol Light. Components read
   only semantic tokens. Structure comes from 1px tan borders, surface steps and contrast, not shadows. The same token
   names are used by the first-party connection pages (auth.css). */
@font-face { font-family: "Geist"; src: url("/site/assets/fonts/geist-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/site/assets/fonts/geist-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root, [data-theme=dark] {
  color-scheme: dark;
  /* surfaces */
  --bg: #11110F; --bg-deep: #0D0D0C; --bg-subtle: #181714; --bg-raised: #1D1A17; --bg-inset: #141311; --bg-strip: #1B1916;
  --bg-hover: rgb(179 121 82 / .08); --bg-selected: #432B1D; --bg-emphasis: #4C2C1B;
  /* text */
  --fg: #EEE7E1; --fg-strong: #FDFCF7; --fg-muted: #C5BAB0; --fg-subtle: #978B82; --fg-on-emphasis: #FDFCF7; --fg-label: #B9A08A;
  --link: #FDFCF7; --link-hover: #DDB795;
  /* lines */
  --border: rgb(221 183 149 / .22); --border-muted: rgb(221 183 149 / .14); --border-strong: rgb(221 183 149 / .38);
  /* brand */
  --brown-deep: #4C2C1B; --brown-medium: #9A6240; --brown-warm: #B37952; --tan: #DDB795; --cream: #FDFCF7;
  --accent-fg: #DDB795; --accent-emphasis: #B37952; --accent-subtle: rgb(179 121 82 / .14); --accent-border: rgb(221 183 149 / .38);
  /* semantic (kept distinct from brand brown) */
  --success-fg: #95B88F; --success-emphasis: #4E7A4A; --success-subtle: rgb(149 184 143 / .13);
  --attention-fg: #D6AA5E; --attention-subtle: rgb(214 170 94 / .13);
  --danger-fg: #DB8572; --danger-emphasis: #8E3E2E; --danger-subtle: rgb(219 133 114 / .12);
  --done-fg: #B7A4C6; --done-subtle: rgb(183 164 198 / .13);
  /* controls */
  --btn-bg: #1D1A17; --btn-hover: #231F1B; --btn-border: rgb(221 183 149 / .18); --btn-border-hover: rgb(221 183 149 / .32);
  --btn-primary: #A56843; --btn-primary-hover: #B37952; --btn-primary-active: #8F5838; --btn-primary-fg: #FDFCF7;
  --input-bg: #141311; --input-border: rgb(221 183 149 / .16); --input-focus: rgb(221 183 149 / .42);
  --header-bg: #11110F; --header-fg: #EEE7E1; --header-border: rgb(221 183 149 / .12);
  --menu-bg: #1D1A17; --menu-shadow: 0 12px 32px rgb(0 0 0 / .45); --overlay: rgb(0 0 0 / .65);
  /* viewer (GitTol Technical Render) */
  --viewer-bg: #11110F; --model: #3B2A20; --model-shaded: #8A5A3C; --model-selected: #6E452E; --model-edge: #DDB795;
  --model-edge-soft: rgb(221 183 149 / .32); --model-edge-selected: #FDFCF7; --grid: #1C1A17; --grid-strong: #29251F;
  --contrib-0: #1D1A17; --contrib-1: #4C2C1B; --contrib-2: #7C4C31; --contrib-3: #B37952; --contrib-4: #DDB795;
  --fusion: #D9A066; --onshape: #A7B9CA; --freecad: #C98F7B; --solidworks: #C98680; --unknown: #978B82;
  --focus: #DDB795;
  /* legacy aliases still read by first-party connection pages */
  --glass: var(--menu-bg); --glass-border: var(--border); --glass-shadow: var(--menu-shadow); --overlay-shadow: var(--menu-shadow);
}
[data-theme=light] {
  color-scheme: light;
  --bg: #FAF7F1; --bg-deep: #F3EEE6; --bg-subtle: #F5F0E8; --bg-raised: #FFFDF9; --bg-inset: #EFE8DD; --bg-strip: #F3ECE2;
  --bg-hover: rgb(154 98 64 / .07); --bg-selected: #EAD7C4; --bg-emphasis: #4C2C1B;
  --fg: #2A1D15; --fg-strong: #1B120C; --fg-muted: #5E4B3E; --fg-subtle: #7F6C5F; --fg-on-emphasis: #FDFCF7; --fg-label: #8A6248;
  --link: #1B120C; --link-hover: #9A6240;
  --border: rgb(76 44 27 / .2); --border-muted: rgb(76 44 27 / .13); --border-strong: rgb(76 44 27 / .38);
  --accent-fg: #8A5536; --accent-emphasis: #9A6240; --accent-subtle: rgb(154 98 64 / .12); --accent-border: rgb(154 98 64 / .45);
  --success-fg: #3F6E3B; --success-emphasis: #4E7A4A; --success-subtle: rgb(63 110 59 / .1);
  --attention-fg: #8A6216; --attention-subtle: rgb(138 98 22 / .1);
  --danger-fg: #A3402E; --danger-emphasis: #8E3E2E; --danger-subtle: rgb(163 64 46 / .09);
  --done-fg: #6E5687; --done-subtle: rgb(110 86 135 / .1);
  --btn-bg: #FFFDF9; --btn-hover: #F6EFE5; --btn-border: rgb(76 44 27 / .22); --btn-border-hover: rgb(76 44 27 / .38);
  --btn-primary: #9A6240; --btn-primary-hover: #8A5536; --btn-primary-active: #77482D; --btn-primary-fg: #FDFCF7;
  --input-bg: #FFFDF9; --input-border: rgb(76 44 27 / .22); --input-focus: rgb(154 98 64 / .6);
  --header-bg: #FAF7F1; --header-fg: #2A1D15; --header-border: rgb(76 44 27 / .12);
  --menu-bg: #FFFDF9; --menu-shadow: 0 12px 32px rgb(76 44 27 / .16); --overlay: rgb(27 18 12 / .45);
  --viewer-bg: #F3EEE6; --model: #C9AE92; --model-shaded: #B58460; --model-selected: #D19A6C; --model-edge: #5C3A26;
  --model-edge-soft: rgb(92 58 38 / .3); --model-edge-selected: #2A1D15; --grid: #E9E1D5; --grid-strong: #DCD0C0;
  --contrib-0: #EFE8DD; --contrib-1: #E4C9AE; --contrib-2: #C99A72; --contrib-3: #9A6240; --contrib-4: #4C2C1B;
  --fusion: #A9692E; --onshape: #4E6A85; --freecad: #9A5240; --solidworks: #9A4A43; --unknown: #7F6C5F;
  --focus: #9A6240;
}
:root {
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r-xs: 6px; --r-sm: 6px; --r: 8px; --r-lg: 10px; --header-h: 54px;
  --ease: cubic-bezier(.22, 1, .36, 1); --t: 150ms;
}

/* Base ----------------------------------------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  scrollbar-color: var(--border-strong) var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--fg); }
[hidden] { display: none !important; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgb(179 121 82 / .4); color: var(--fg-strong); }
code, pre, .mono, kbd { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--bg-inset); border: 1px solid var(--border-muted); padding: .05em .35em; border-radius: 5px; overflow-wrap: anywhere; }
kbd { display: inline-block; min-width: 18px; padding: 0 5px; line-height: 18px; text-align: center; border: 1px solid var(--border); border-radius: 4px; color: var(--fg-subtle); font-size: 11px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; color: var(--fg-strong); }
h1 { font-size: 26px; letter-spacing: -.015em; } h2 { font-size: 17px; } h3 { font-size: 15px; } h4 { font-size: 13px; }
p { margin: 0 0 10px; }
.icon { flex: none; width: 16px; height: 16px; }
.muted { color: var(--fg-muted); } .subtle { color: var(--fg-subtle); } .small { font-size: 12.5px; } .meta { color: var(--fg-subtle); font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .spread { justify-content: space-between; } .grow { flex: 1 1 auto; min-width: 0; }
.stack { display: grid; gap: 14px; } .stack-sm { display: grid; gap: 8px; } .stack-lg { display: grid; gap: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -40px; z-index: 100; background: var(--bg-raised); color: var(--fg); padding: 6px 10px; border-radius: var(--r-sm); border: 1px solid var(--border); }
.skip:focus { top: 8px; }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--fg-label); }
.truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Buttons -------------------------------------------------------------------------------------------------------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 15px;
  font: 500 13.5px/1 var(--font); color: var(--fg-strong); background: var(--btn-bg); border: 1px solid var(--btn-border); border-radius: var(--r);
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease), transform var(--t) var(--ease); }
.btn:hover { background: var(--btn-hover); border-color: var(--btn-border-hover); color: var(--fg-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn[aria-disabled=true] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--btn-primary); border-color: transparent; color: var(--btn-primary-fg); }
.btn.primary:hover { background: var(--btn-primary-hover); }
.btn.primary:active { background: var(--btn-primary-active); }
.btn.danger { color: var(--danger-fg); border-color: color-mix(in srgb, var(--danger-fg) 35%, transparent); background: var(--danger-subtle); }
.btn.danger:hover { background: var(--danger-emphasis); border-color: var(--danger-emphasis); color: var(--cream); }
.btn.ghost, .btn.quiet { background: transparent; border-color: transparent; color: var(--fg-muted); }
.btn.ghost:hover, .btn.quiet:hover { background: var(--bg-hover); color: var(--fg-strong); border-color: transparent; }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: var(--r-xs); gap: 6px; }
.btn.lg { height: 40px; padding: 0 18px; font-size: 14px; }
.btn.icon-only { width: 34px; padding: 0; } .btn.sm.icon-only { width: 30px; }
.btn .count { font: 500 12px var(--mono); color: var(--fg-muted); padding-left: 2px; }
.btn[aria-pressed=true] { background: var(--accent-subtle); border-color: var(--accent-border); color: var(--fg-strong); }
.btn[aria-busy=true][disabled] { cursor: progress; color: transparent; }
.btn[aria-busy=true]::after { content: ''; position: absolute; top: calc(50% - 6px); left: calc(50% - 6px); width: 12px; height: 12px; color: var(--fg);
  border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.btn.primary[aria-busy=true]::after { color: var(--btn-primary-fg); }
.link-btn { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; font: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: .2em; }
.link-btn:hover { color: var(--link-hover); }

/* Forms ---------------------------------------------------------------------------------------------------------- */
.field { display: grid; gap: 7px; } .field > label, .legend { font-weight: 550; font-size: 13px; color: var(--fg-strong); }
.hint { margin: 0; color: var(--fg-subtle); font-size: 12.5px; }
.input, input[type=text], input[type=password], input[type=search], input[type=url], input[type=number], select, textarea {
  width: 100%; height: 38px; padding: 0 12px; font: 14px/1.4 var(--font); color: var(--fg-strong); background: var(--input-bg);
  border: 1px solid var(--input-border); border-radius: var(--r); transition: border-color var(--t), box-shadow var(--t); }
input::placeholder, textarea::placeholder { color: var(--fg-subtle); }
select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%), linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { height: auto; min-height: 120px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
textarea.mono { font-family: var(--mono); font-size: 12.5px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 3px rgb(221 183 149 / .12); }
input[type=checkbox], input[type=radio] { accent-color: var(--brown-warm); width: 15px; height: 15px; margin: 0; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border-muted); border-radius: var(--r); cursor: pointer; background: var(--bg-inset);
  transition: border-color var(--t), background var(--t); }
.choice:hover { border-color: var(--border); }
.choice:has(input:checked) { border-color: var(--accent-border); background: var(--accent-subtle); }
.choice input { margin-top: 3px; } .choice strong { display: flex; align-items: center; gap: 6px; color: var(--fg-strong); font-weight: 600; }
.choice span.muted { display: block; margin-top: 2px; font-size: 12.5px; }
.form-error { color: var(--danger-fg); font-size: 13px; margin: 0; } .form-error:empty { display: none; }
.owner-name { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 10px; }
.owner-name .owner { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--border-muted); border-radius: var(--r); background: var(--bg-subtle); font-weight: 550; }
.owner-name .slash { color: var(--fg-subtle); font-size: 18px; }

/* Badges, avatars, chips ------------------------------------------------------------------------------------------ */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; font: 500 12px/1 var(--font); border: 1px solid var(--border-strong);
  border-radius: 999px; color: var(--fg-muted); white-space: nowrap; background: transparent; }
.badge .icon { width: 12px; height: 12px; }
.badge.ok { color: var(--success-fg); border-color: color-mix(in srgb, var(--success-fg) 45%, transparent); }
.badge.warn { color: var(--attention-fg); border-color: color-mix(in srgb, var(--attention-fg) 45%, transparent); }
.badge.bad { color: var(--danger-fg); border-color: color-mix(in srgb, var(--danger-fg) 45%, transparent); }
.badge.accent { color: var(--accent-fg); border-color: var(--accent-border); }
.badge.mono { font-family: var(--mono); font-size: 11.5px; }
.cad-badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 8px; font: 500 12px/1 var(--font); color: var(--fg-muted);
  border: 1px solid var(--border); border-radius: 11px; white-space: nowrap; }
.cad-badge::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: var(--cad, var(--unknown)); flex: none; }
.cad-badge[data-cad=fusion] { --cad: var(--fusion); } .cad-badge[data-cad=onshape] { --cad: var(--onshape); }
.cad-badge[data-cad=freecad] { --cad: var(--freecad); } .cad-badge[data-cad=solidworks] { --cad: var(--solidworks); }
.avatar { --s: 28px; display: inline-grid; place-items: center; width: var(--s); height: var(--s); flex: none; border-radius: 50%;
  font: 600 calc(var(--s) * .4)/1 var(--font); letter-spacing: -.02em; color: var(--cream); background: hsl(calc(18 + var(--h) * .05) 42% calc(30% + var(--h) * .02%));
  border: 1px solid rgb(221 183 149 / .28); user-select: none; }
[data-theme=light] .avatar { border-color: rgb(76 44 27 / .18); }
.user-link { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-strong); font-weight: 600; }
.user-link:hover { color: var(--link-hover); }
.topic { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; font: 500 12px var(--mono); border-radius: 999px; color: var(--fg-muted); border: 1px solid var(--border-muted); background: var(--bg-inset); }
.topic:hover { color: var(--fg-strong); border-color: var(--border-strong); }
.sha { font: 500 12.5px var(--mono); color: var(--fg-subtle); }
a.sha:hover { color: var(--link-hover); }
.dot-sep::before { content: '·'; padding: 0 6px; color: var(--fg-subtle); }

/* Panels, rows, notices -------------------------------------------------------------------------------------------- */
.panel { border: 1px solid var(--border-muted); border-radius: var(--r-lg); background: var(--bg-subtle); min-width: 0; }
.panel-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-height: 48px; padding: 10px 16px; border-bottom: 1px solid var(--border-muted); }
.panel-head h2, .panel-head h3 { font-size: 14px; }
.panel-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border-muted); min-width: 0; }
.panel-row:first-child, .panel-head + .panel-row { border-top: 0; }
.panel-body { padding: 16px; }
.list { list-style: none; margin: 0; padding: 0; }
.notice { overflow-wrap: anywhere; padding: 12px 14px; border: 1px solid var(--border-muted); border-radius: var(--r); background: var(--bg-inset); font-size: 13px; }
.notice.bad { border-color: color-mix(in srgb, var(--danger-fg) 35%, transparent); background: var(--danger-subtle); }
.notice.warn { border-color: color-mix(in srgb, var(--attention-fg) 35%, transparent); background: var(--attention-subtle); }
.notice p:last-child { margin: 0; } .notice strong { display: block; margin-bottom: 2px; color: var(--fg-strong); }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 9px 18px; margin: 0; font-size: 13px; }
.facts dt { color: var(--fg-subtle); } .facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--fg); }
hr.sep { border: 0; border-top: 1px solid var(--border-muted); margin: 18px 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; }
.section-title h2 { font-size: 15px; }

/* Empty, loading, errors ------------------------------------------------------------------------------------------- */
.empty { display: grid; justify-items: center; gap: 10px; padding: 48px 24px; text-align: center; border: 1px solid var(--border-muted); border-radius: var(--r-lg); background: var(--bg-subtle); }
.empty .empty-mark { width: 96px; height: 72px; color: var(--tan); opacity: .7; }
.empty h3 { font: 600 13px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-strong); }
.empty p { max-width: 54ch; margin: 0; color: var(--fg-muted); } .empty .row { justify-content: center; margin-top: 4px; }
.skeleton { display: grid; gap: 10px; padding: 6px 0; }
.skeleton span { height: 12px; border-radius: 3px; background: linear-gradient(90deg, var(--bg-inset), var(--bg-raised), var(--bg-inset)); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.progress-line { position: relative; height: 2px; width: min(240px, 60%); overflow: hidden; background: var(--border-muted); border-radius: 1px; }
.progress-line::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 40%; background: var(--tan); animation: sweep 1.3s var(--ease) infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.error-page { max-width: 640px; margin: 8vh auto; padding: 0 24px; display: grid; gap: 14px; }
.error-page svg { width: 100%; max-width: 360px; height: auto; color: var(--tan); }
.error-page .code { font: 500 13px var(--mono); letter-spacing: .08em; color: var(--fg-label); }
.error-page h1 { font-size: 24px; } .error-page p { color: var(--fg-muted); max-width: 52ch; }

/* App header --------------------------------------------------------------------------------------------------------- */
.header { position: sticky; top: 0; z-index: 40; height: var(--header-h); display: flex; align-items: center; gap: 14px; padding: 0 20px;
  color: var(--header-fg); background: var(--header-bg); border-bottom: 1px solid var(--header-border); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--fg-strong); font-weight: 600; font-size: 16px; letter-spacing: -.01em; flex: none; }
.brand:hover { color: var(--fg-strong); }
.brand-mark { width: 26px; height: 26px; flex: none; display: block; border-radius: 6px; }
.header nav.primary-nav { display: flex; gap: 2px; flex: none; }
.header nav.primary-nav a { display: inline-flex; align-items: center; height: 32px; padding: 0 10px; color: var(--fg-muted); border-radius: var(--r-xs); font-weight: 500; font-size: 13.5px; }
.header nav.primary-nav a:hover, .header nav.primary-nav a[aria-current=page] { color: var(--fg-strong); background: var(--bg-hover); }
.header .search-trigger { flex: 0 1 520px; min-width: 34px; margin: 0 auto; display: flex; align-items: center; gap: 9px; height: 35px; padding: 0 8px 0 11px;
  color: var(--fg-subtle); background: var(--bg-inset); border: 1px solid var(--border-muted); border-radius: var(--r); cursor: pointer; font: 13.5px var(--font); }
.header .search-trigger:hover { border-color: var(--border); color: var(--fg-muted); }
.header .search-trigger span { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.header .btn.ghost { color: var(--fg-muted); }
.avatar-btn { padding: 0; width: 32px; height: 32px; border-radius: 50%; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.avatar-btn .avatar { --s: 29px; }

/* Menus, modals, toasts ---------------------------------------------------------------------------------------------- */
.menu { position: fixed; z-index: 60; min-width: min(232px, calc(100vw - 16px)); max-width: min(360px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); overflow-y: auto;
  padding: 6px; border-radius: var(--r-lg); background: var(--menu-bg); border: 1px solid var(--border); box-shadow: var(--menu-shadow); color: var(--fg); animation: pop .14s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-3px); } }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 10px; border: 0; border-radius: var(--r-xs); background: none; color: var(--fg);
  font: 13.5px var(--font); text-align: left; cursor: pointer; }
.menu-item:hover, .menu-item:focus { background: var(--bg-hover); color: var(--fg-strong); outline: none; }
.menu-item[aria-checked=true] { color: var(--fg-strong); }
.menu-item .icon { color: var(--fg-subtle); }
.menu-item .end { margin-left: auto; }
.menu-label { display: grid; gap: 2px; min-width: 0; } .menu-label small { color: var(--fg-subtle); font-size: 12px; }
.menu .tick { width: 16px; display: inline-grid; color: var(--tan); }
.menu-sep { height: 1px; margin: 6px 4px; background: var(--border-muted); }
.menu-head { padding: 8px 10px 4px; font: 500 11.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--fg-label); }
.modal-backdrop { position: fixed; inset: 0; z-index: 70; background: var(--overlay); display: grid; place-items: start center; padding: 14vh 16px 16px; animation: fade .14s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(480px, 100%); max-height: 100%; overflow: auto; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-lg); animation: pop .16s var(--ease); }
.modal.md { width: min(600px, 100%); } .modal.lg { width: min(900px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border-muted); }
.modal-head h2 { font-size: 16px; flex: 1; }
.modal-body { padding: 18px; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border-muted); }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; gap: 8px; justify-items: end; pointer-events: none; max-width: min(420px, calc(100vw - 40px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--r); font-size: 13px; color: var(--fg-strong); background: var(--menu-bg);
  border: 1px solid var(--border); box-shadow: var(--menu-shadow); animation: pop .18s var(--ease); transition: opacity .4s; overflow-wrap: anywhere; }
.toast::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--tan); flex: none; }
.toast[data-kind=bad]::before { background: var(--danger-fg); } .toast[data-kind=ok]::before { background: var(--success-fg); }
.toast.out { opacity: 0; }
[role=tooltip], .tip { max-width: 260px; }

/* Command palette ---------------------------------------------------------------------------------------------------- */
.palette-backdrop { position: fixed; inset: 0; z-index: 80; background: var(--overlay); display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; animation: fade .12s; }
.palette { width: min(620px, 100%); max-height: 100%; min-height: 0; display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden; background: var(--menu-bg); border: 1px solid var(--border); box-shadow: var(--menu-shadow); animation: pop .16s var(--ease); }
.palette > * { min-width: 0; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border-muted); color: var(--fg-subtle); flex-shrink: 0; }
.palette-input input { height: 52px; border: 0; background: transparent; font-size: 15px; padding: 0; box-shadow: none; }
.palette-input input:focus { box-shadow: none; }
.palette-results { max-height: min(420px, 60vh); min-height: 0; overflow-y: auto; padding: 6px; }
.palette-group { padding: 10px 10px 4px; font: 500 11.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--fg-label); }
.palette-item { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 10px; border-radius: var(--r-xs); cursor: pointer; color: var(--fg); }
.palette-item[aria-selected=true] { background: var(--bg-selected); color: var(--fg-strong); }
.palette-item .icon { color: var(--fg-subtle); } .palette-item small { margin-left: auto; color: var(--fg-subtle); font-size: 12px; }
.palette-item > span, .palette-item small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-foot { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--border-muted); font-size: 12px; color: var(--fg-subtle); flex-shrink: 0; }

/* Pages ---------------------------------------------------------------------------------------------------------------- */
#view { outline: none; }
.page { max-width: 1460px; margin: 0 auto; padding: 28px 24px 72px; overflow-wrap: anywhere; }
.page.mid { max-width: 1320px; } .page.narrow { max-width: 760px; } .page.wide { max-width: 1600px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.page-head p { margin: 6px 0 0; color: var(--fg-muted); }
.page-head .meta-line { display: flex; gap: 18px; margin-top: 8px; font: 12.5px var(--mono); color: var(--fg-subtle); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.split > *, .stack > *, .stack-lg > *, .stack-sm > *, .dash-grid > *, .profile > * { min-width: 0; }

/* Repository cards and thumbnails ------------------------------------------------------------------------------------ */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.card-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.repo-card { display: flex; flex-direction: column; border: 1px solid var(--border-muted); border-radius: var(--r-lg); background: var(--bg-subtle); overflow: hidden; min-width: 0;
  transition: border-color var(--t) var(--ease), transform var(--t) var(--ease); }
.repo-card:hover { border-color: var(--border-strong); }
.repo-card .thumb { border-bottom: 1px solid var(--border-muted); }
.repo-card .card-body { display: grid; gap: 8px; padding: 14px 16px 16px; }
.repo-card .card-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.repo-card .card-title a { font-size: 15px; color: var(--fg-strong); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repo-card .card-title a span { color: var(--fg-subtle); font-weight: 400; }
.repo-card .card-title a b { font-weight: 650; }
.repo-card .card-title a:hover b { color: var(--link-hover); }
.repo-card p { margin: 0; color: var(--fg-muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.repo-card .card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; color: var(--fg-subtle); }
.repo-card .card-meta .mono { color: var(--fg-muted); }
.thumb { position: relative; aspect-ratio: 16 / 10; background: var(--viewer-bg); overflow: hidden; display: block; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb svg.placeholder { position: absolute; inset: 14% 18%; width: 64%; height: 72%; color: var(--tan); opacity: .38; }
.thumb .thumb-tag { position: absolute; left: 10px; bottom: 9px; font: 500 10.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-subtle); }
.thumb.sm { aspect-ratio: 4 / 3; }
.repo-rows .panel-row { gap: 14px; }
.repo-rows .thumb { width: 96px; aspect-ratio: 16 / 10; flex: none; border-radius: var(--r-xs); border: 1px solid var(--border-muted); }

/* Dashboard ------------------------------------------------------------------------------------------------------------ */
.attention { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border: 1px solid var(--border-muted); border-radius: var(--r-lg); background: var(--bg-subtle); overflow: hidden; }
.attention > * { display: grid; gap: 4px; padding: 14px 18px; border-left: 1px solid var(--border-muted); color: var(--fg); min-width: 0; }
.attention > :first-child { border-left: 0; }
.attention a:hover { background: var(--bg-hover); color: var(--fg-strong); }
.attention b { font: 600 18px var(--mono); color: var(--fg-strong); } .attention span { font-size: 13px; color: var(--fg-muted); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }

/* Activity timeline ------------------------------------------------------------------------------------------------ */
.timeline { position: relative; }
.timeline li { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 0 0 18px; font-size: 13.5px; }
.timeline li::before { content: ''; position: absolute; left: 13.5px; top: 30px; bottom: 0; width: 1px; background: var(--border-muted); }
.timeline li:last-child::before { display: none; }
.timeline .t-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border); color: var(--tan); background: var(--bg); }
.timeline .t-icon .icon { width: 14px; height: 14px; }
.timeline .t-body { min-width: 0; padding-top: 4px; }
.timeline .t-body a.strong { color: var(--fg-strong); font-weight: 600; }
.timeline .t-body .msg { color: var(--fg); }
.timeline .t-meta { display: flex; flex-wrap: wrap; gap: 4px 0; margin-top: 3px; font-size: 12.5px; color: var(--fg-subtle); }
.timeline .t-meta a { color: var(--fg-muted); } .timeline .t-meta a:hover { color: var(--link-hover); }

/* Tabs ----------------------------------------------------------------------------------------------------------------- */
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; height: 46px; color: var(--fg-subtle); font-weight: 500; white-space: nowrap; font-size: 14px; }
.tab:hover { color: var(--fg-strong); }
.tab::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; border-radius: 1px; background: transparent; }
.tab[aria-current=page] { color: var(--fg-strong); } .tab[aria-current=page]::after { background: var(--brown-warm); }
.tab .count { font: 500 12px var(--mono); color: var(--fg-subtle); }
.subtabs { border-bottom: 1px solid var(--border-muted); margin-bottom: 20px; }
.seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.seg button, .seg a { display: inline-flex; align-items: center; gap: 6px; height: 33px; padding: 0 12px; border: 1px solid var(--border-muted); border-radius: var(--r-xs);
  background: var(--bg-inset); color: var(--fg-subtle); font: 500 13px var(--font); cursor: pointer; white-space: nowrap; transition: color var(--t), border-color var(--t), background var(--t); }
.seg button:hover, .seg a:hover { color: var(--fg-strong); border-color: var(--border); }
.seg [aria-pressed=true], .seg [aria-current=page] { color: var(--fg-strong); border-color: var(--accent-border); background: var(--bg-raised); }
.seg .count { font: 500 12px var(--mono); color: var(--fg-subtle); }

/* Repository shell --------------------------------------------------------------------------------------------------- */
.repo-shell { max-width: 1600px; margin: 14px auto 0; padding: 0 14px; }
.repo-frame { border: 1px solid var(--border-muted); border-radius: var(--r-lg); background: var(--bg); overflow: hidden; }
.repo-identity { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; min-height: 80px; padding: 14px 24px; background: var(--bg-emphasis); color: var(--cream); }
.repo-identity .repo-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 20px; letter-spacing: -.01em; }
.repo-identity .repo-name a { color: var(--cream); min-width: 0; overflow-wrap: anywhere; }
.repo-identity .repo-name a:hover { color: var(--tan); }
.repo-identity .repo-name .owner { font-weight: 450; } .repo-identity .repo-name .slash { color: rgb(253 252 247 / .5); }
.repo-identity .repo-name .name { font-weight: 700; }
.repo-identity .badge { color: var(--tan); border-color: rgb(221 183 149 / .5); margin-left: 8px; }
.repo-identity .fork-note { flex-basis: 100%; margin: -8px 0 0; font-size: 12.5px; color: rgb(253 252 247 / .7); }
.repo-identity .fork-note a { color: var(--tan); }
.repo-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.repo-actions .btn { height: 37px; background: rgb(17 17 15 / .18); border-color: rgb(221 183 149 / .4); color: var(--cream); }
.repo-actions .btn:hover { background: rgb(17 17 15 / .32); border-color: rgb(221 183 149 / .7); color: var(--cream); }
.repo-actions .btn[aria-pressed=true] { background: rgb(221 183 149 / .16); border-color: var(--tan); }
.repo-actions .btn .count { color: var(--tan); }
.repo-nav { display: flex; align-items: flex-end; height: 60px; padding: 0 16px; background: var(--bg); border-bottom: 1px solid var(--border-muted); }
.repo-nav .tabs { height: 100%; align-items: stretch; } .repo-nav .tab { height: 100%; }
.repo-body { padding: 0; }
.repo-body .pad { padding: 22px 24px 40px; }
.repo-body .pad.mid { max-width: 1350px; }

/* Design page -------------------------------------------------------------------------------------------------------- */
.context-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; min-height: 72px; padding: 16px 24px; border-bottom: 1px solid var(--border-muted); }
.context-row .stat { display: inline-flex; align-items: center; gap: 7px; color: var(--fg-muted); font-size: 13.5px; }
.context-row .stat b { color: var(--fg-strong); font: 600 13.5px var(--mono); }
.context-row .stat:hover { color: var(--fg-strong); }
.context-row .push { margin-left: auto; }
.branch-btn { height: 38px; min-width: 96px; max-width: 260px; justify-content: space-between; font-family: var(--mono); font-size: 13px; background: var(--bg-inset); }
.branch-btn .label-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.open-cad { height: 40px; padding: 0 18px; }
.historical { display: flex; align-items: center; gap: 10px; padding: 8px 24px; border-bottom: 1px solid var(--border-muted); background: var(--accent-subtle); font: 500 12px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--fg-label); }
.historical a { color: var(--fg-strong); text-transform: none; letter-spacing: 0; }
.commit-strip { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 24px; background: var(--bg-strip); border-bottom: 1px solid var(--border-muted); font-size: 13.5px; min-width: 0; }
.commit-strip .author { font-weight: 600; color: var(--fg-strong); flex: none; }
.commit-strip .message { color: var(--fg-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; }
.commit-strip .message:hover { color: var(--fg-strong); }
.commit-strip .end { margin-left: auto; display: flex; align-items: center; gap: 14px; flex: none; }
.workspace { position: relative; display: grid; grid-template-columns: clamp(300px, 27vw, 390px) minmax(0, 1fr); height: max(620px, calc(100vh - 380px)); min-height: 0; }
.tree-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid rgb(221 183 149 / .18); background: var(--bg); }
.tree-head { display: grid; gap: 10px; padding: 14px 14px 10px; }
.tree-head .seg { gap: 6px; }
.tree-head .seg button { height: 33px; padding: 0 9px; font-size: 12.5px; gap: 5px; }
.tree-head input[type=search] { height: 32px; font-size: 13px; background: var(--bg-inset); }
.tree { flex: 1; min-height: 0; overflow: auto; padding: 6px 10px 16px; }
.tree-label { display: flex; justify-content: space-between; padding: 12px 10px 6px; font: 500 12px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--fg-label); }
.tree ul { list-style: none; margin: 0; padding: 0; } .tree ul ul { padding-left: 16px; }
.node { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 0 10px; border: 0; border-radius: var(--r-xs); background: none; color: var(--fg);
  font: 15px/1.2 var(--font); text-align: left; cursor: pointer; transition: background var(--t); }
.node:hover { background: var(--bg-hover); }
.node[aria-selected=true] { background: var(--bg-selected); color: var(--cream); }
.node .chev { width: 14px; height: 14px; color: var(--fg-subtle); flex: none; transition: transform var(--t); }
.node .chev.closed { transform: rotate(-90deg); }
.node .chev-space { width: 14px; flex: none; }
.node .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node .kind { font: 12px var(--mono); color: var(--fg-subtle); flex: 0 1 auto; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node .value { font: 13px var(--mono); color: var(--fg-muted); margin-left: auto; white-space: nowrap; }
.node[aria-selected=true] .kind, .node[aria-selected=true] .value { color: var(--tan); }
.node .lvl { width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--fg-subtle); }
.node .lvl[data-level=FULL] { background: var(--success-fg); } .node .lvl[data-level=PARTIAL] { background: var(--attention-fg); }
.node .lvl[data-level=PRESERVE_ONLY] { background: var(--done-fg); } .node .lvl[data-level=UNSUPPORTED] { background: var(--danger-fg); }
.node.suppressed .name { text-decoration: line-through; color: var(--fg-subtle); }
.node.root { font-weight: 600; cursor: default; } .node.root:hover { background: none; }
.tree-empty { padding: 8px 10px; color: var(--fg-subtle); font-size: 13px; }
.viewer-pane { position: relative; min-width: 0; min-height: 0; background: var(--viewer-bg); overflow: hidden; }
.viewer-pane canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
.viewer-toolbar { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; height: 40px; padding: 3px;
  max-width: calc(100% - 24px); overflow-x: auto; scrollbar-width: none; border: 1px solid var(--border); border-radius: var(--r);
  background: color-mix(in srgb, var(--bg-raised) 88%, transparent); }
.viewer-toolbar button { height: 32px; padding: 0 12px; border: 0; border-radius: 5px; background: transparent; color: var(--fg-subtle); font: 500 13px var(--font); cursor: pointer; white-space: nowrap; }
.viewer-toolbar button:hover { color: var(--fg-strong); background: var(--bg-hover); }
.viewer-toolbar button[aria-pressed=true] { color: var(--fg-strong); background: rgb(221 183 149 / .12); }
[data-theme=light] .viewer-toolbar button[aria-pressed=true] { background: rgb(154 98 64 / .12); }
.viewer-toolbar .sep { width: 1px; height: 20px; margin: 0 3px; background: var(--border); flex: none; }
.viewer-toolbar kbd { margin-left: 6px; border: 0; padding: 0; min-width: 0; color: var(--fg-subtle); }
.viewer-badge { position: absolute; left: 14px; bottom: 14px; z-index: 2; max-width: calc(100% - 28px); font: 500 11.5px var(--mono); letter-spacing: .04em; color: var(--fg-subtle); }
.viewer-badge strong { color: var(--attention-fg); font-weight: 600; text-transform: uppercase; }
.viewer-hint { position: absolute; right: 14px; bottom: 14px; z-index: 2; font: 11.5px var(--mono); color: var(--fg-subtle); }
.viewer-state { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--fg-muted); }
.viewer-state > div { display: grid; justify-items: center; gap: 10px; max-width: 46ch; }
.viewer-state h3 { font: 600 12.5px var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--fg-strong); }
.viewer-state p { margin: 0; font-size: 13px; }
.spinner { width: 20px; height: 20px; margin: 0 auto; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--tan); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.workspace.inspecting { grid-template-columns: clamp(300px, 27vw, 390px) minmax(0, 1fr) 330px; }
.inspector { position: relative; z-index: 4; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--bg-raised);
  border-left: 1px solid var(--border); animation: drawer .18s var(--ease); }
@keyframes drawer { from { transform: translateX(16px); opacity: 0; } }
.inspector-head { display: flex; align-items: flex-start; gap: 10px; padding: 16px 16px 12px; border-bottom: 1px solid var(--border-muted); }
.inspector-head h3 { font: 600 14px/1.35 var(--mono); color: var(--fg-strong); overflow-wrap: anywhere; margin-top: 4px; }
.inspector-body { flex: 1; overflow: auto; padding: 14px 16px 18px; display: grid; gap: 18px; align-content: start; font-size: 13px; }
.inspector-body .facts { font-size: 13px; } .inspector-body .facts dd.mono { font-size: 12.5px; }
.inspector-body h4 { font: 500 11.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--fg-label); margin-bottom: 8px; }
.inspector-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.inspector .field-change { grid-template-columns: 1fr; gap: 2px; }
.design-below { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; padding: 20px 24px 28px; border-top: 1px solid var(--border-muted); align-items: start; }
.readme-panel { background: var(--bg-subtle); border: 1px solid var(--border-muted); border-radius: var(--r-lg); min-width: 0; }
.readme-panel .panel-head .icon { color: var(--tan); }
.readme-panel .readme-body { padding: 26px 32px 30px; }
.about { display: grid; gap: 16px; align-content: start; font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.about section { display: grid; gap: 8px; padding-bottom: 16px; border-bottom: 1px solid var(--border-muted); }
.about section:last-child { border-bottom: 0; }
.about h4 { font: 500 11.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--fg-label); }
.compat { display: grid; gap: 6px; }
.compat li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.compat .lvl-text { font: 12px var(--mono); color: var(--fg-subtle); }
.compat .lvl-text[data-level=SOURCE], .compat .lvl-text[data-level=EXCELLENT], .compat .lvl-text[data-level=HIGH] { color: var(--success-fg); }
.compat .lvl-text[data-level=PARTIAL], .compat .lvl-text[data-level=GEOMETRY_ONLY] { color: var(--attention-fg); }
.compat .lvl-text[data-level=UNSUPPORTED] { color: var(--danger-fg); }
.tree-toggle { display: none; }

/* Markdown ------------------------------------------------------------------------------------------------------------- */
.markdown { font-size: 15px; line-height: 1.65; overflow-wrap: break-word; max-width: 82ch; color: var(--fg); }
.markdown > * + * { margin-top: 14px; } .markdown > :first-child { margin-top: 0; }
.markdown h1, .markdown h2 { padding-bottom: .35em; border-bottom: 1px solid var(--border-muted); }
.markdown h1 { font-size: 1.75em; } .markdown h2 { font-size: 1.35em; margin-top: 26px; } .markdown h3 { font-size: 1.15em; margin-top: 22px; }
.markdown p { margin: 0; } .markdown ul, .markdown ol { padding-left: 1.6em; margin-bottom: 0; } .markdown li + li { margin-top: 4px; }
.markdown li.task { list-style: none; margin-left: -1.4em; }
.markdown a { text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: .2em; }
.markdown pre { padding: 14px 16px; overflow: auto; background: var(--bg-inset); border: 1px solid var(--border-muted); border-radius: var(--r); line-height: 1.5; }
.markdown pre code { background: none; border: 0; padding: 0; }
.markdown blockquote { margin: 0; padding: 0 1em; color: var(--fg-muted); border-left: 2px solid var(--border-strong); }
.markdown img { max-width: 100%; } .markdown hr { border: 0; height: 1px; background: var(--border); }
.table-wrap { overflow-x: auto; }
.markdown table, table.data { border-collapse: collapse; font-size: 13px; }
.markdown th, .markdown td { padding: 7px 12px; border: 1px solid var(--border-muted); } .markdown th { background: var(--bg-inset); }
table.data { width: 100%; }
table.data th, table.data td { padding: 11px 16px; border-bottom: 1px solid var(--border-muted); text-align: left; vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data th { font: 500 11.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--fg-label); background: var(--bg-inset); }
table.data tbody tr:hover td { background: var(--bg-hover); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td.mono { font-family: var(--mono); font-size: 12.5px; }
table.data .changed { color: var(--attention-fg); }

/* Commits ---------------------------------------------------------------------------------------------------------------- */
.day { margin: 22px 0 8px; font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-label); }
.day:first-child { margin-top: 0; }
.commit-row { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 12px 16px; border-top: 1px solid var(--border-muted); transition: background var(--t); }
.commit-row:first-child { border-top: 0; }
.commit-row:hover { background: var(--bg-hover); }
.commit-row .avatar { --s: 30px; }
.commit-row .msg { display: block; font-weight: 550; color: var(--fg-strong); font-size: 14.5px; overflow-wrap: anywhere; }
.commit-row .msg:hover { color: var(--link-hover); }
.commit-row .by { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; margin-top: 5px; font-size: 12.5px; color: var(--fg-subtle); }
.commit-row .by a { color: var(--fg-muted); } .commit-row .by a:hover { color: var(--link-hover); }
.commit-row .end { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.commit-title { display: grid; gap: 10px; padding: 22px 24px; border-bottom: 1px solid var(--border-muted); }
.commit-title h1 { font-size: 22px; overflow-wrap: anywhere; }
.commit-title .row { font-size: 13px; color: var(--fg-muted); }
.overview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }

/* Diff ---------------------------------------------------------------------------------------------------------------- */
.summary-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--border-muted); border-radius: var(--r-lg); background: var(--bg-subtle); overflow: hidden; }
.summary-panel > div { padding: 14px 18px; border-left: 1px solid var(--border-muted); display: grid; gap: 3px; min-width: 0; }
.summary-panel > div:first-child { border-left: 0; }
.summary-panel b { font: 600 18px var(--mono); color: var(--fg-strong); }
.summary-panel span { font-size: 12.5px; color: var(--fg-subtle); }
.summary-panel .add b { color: var(--success-fg); } .summary-panel .del b { color: var(--danger-fg); } .summary-panel .mod b { color: var(--attention-fg); }
.change { border-top: 1px solid var(--border-muted); --status: var(--fg-subtle); box-shadow: inset 2px 0 0 var(--status); }
.change:first-child { border-top: 0; }
.change[data-s=added] { --status: var(--success-fg); } .change[data-s=removed] { --status: var(--danger-fg); } .change[data-s=modified] { --status: var(--attention-fg); }
.change > summary { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 16px; cursor: pointer; list-style: none; }
.change > summary::-webkit-details-marker { display: none; }
.change > summary:hover { background: var(--bg-hover); }
.change-status { font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--status); width: 74px; flex: none; }
.change .label-name { font: 14px var(--mono); color: var(--fg-strong); }
.field-changes { margin: 0; padding: 0 16px 14px 102px; display: grid; gap: 6px; font-size: 13px; }
.field-change { display: grid; grid-template-columns: minmax(120px, 30%) 1fr; gap: 12px; align-items: baseline; }
.field-change .path { font-family: var(--mono); color: var(--fg-subtle); overflow-wrap: anywhere; font-size: 12.5px; }
.field-change .vals { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-family: var(--mono); font-size: 13px; }
.field-change del { color: var(--danger-fg); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger-fg) 55%, transparent); overflow-wrap: anywhere; }
.field-change ins { color: var(--success-fg); text-decoration: none; overflow-wrap: anywhere; }
.field-change .arrow { color: var(--fg-subtle); }
.compare-bar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px; padding: 16px; border: 1px solid var(--border-muted); border-radius: var(--r-lg); background: var(--bg-subtle); }
.compare-bar .field { min-width: 200px; } .compare-bar .field > label { font: 500 11.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-label); }
.compare-bar .swap { height: 38px; display: grid; place-items: center; color: var(--fg-subtle); font-size: 18px; }

/* Branches ------------------------------------------------------------------------------------------------------------ */
.branch-name { font: 600 13.5px var(--mono); color: var(--fg-strong); }
.branch-name:hover { color: var(--link-hover); }
.ahead-behind { display: inline-grid; grid-template-columns: auto 64px 1px 64px auto; align-items: center; gap: 6px; font: 12px var(--mono); color: var(--fg-subtle); }
.ahead-behind .bar { height: 4px; border-radius: 2px; background: var(--border-strong); }
.ahead-behind .behind { display: flex; justify-content: flex-end; } .ahead-behind .ahead .bar { background: var(--brown-warm); }
.ahead-behind .mid { height: 16px; background: var(--border); }

/* Profile ---------------------------------------------------------------------------------------------------------------- */
.profile { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 36px; align-items: start; }
.profile-side { display: grid; gap: 14px; align-content: start; }
.profile-side .avatar { --s: 248px; width: 100%; max-width: 248px; height: auto; aspect-ratio: 1; font-size: 72px; }
.profile-side h1 { font-size: 22px; } .profile-side .handle { font: 15px var(--mono); color: var(--fg-subtle); margin-top: 4px; }
.profile-side .bio { margin: 0; color: var(--fg-muted); }
.contrib { overflow-x: auto; padding: 4px 0; }
.contrib svg { display: block; }
.contrib-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; font: 11px var(--mono); color: var(--fg-subtle); margin-top: 8px; }
.contrib-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* Insights --------------------------------------------------------------------------------------------------------------- */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding: 8px 0 0; border-bottom: 1px solid var(--border-muted); }
.bars span { flex: 1; min-width: 4px; background: var(--brown-warm); border-radius: 2px 2px 0 0; }
.bars span:hover { background: var(--tan); }
.hbars { display: grid; gap: 12px; }
.hbars li { display: grid; grid-template-columns: 110px minmax(0, 1fr) 48px; gap: 12px; align-items: center; font-size: 13px; }
.hbars .track { height: 8px; border-radius: 4px; background: var(--bg-inset); overflow: hidden; }
.hbars .fill { height: 100%; background: var(--brown-warm); border-radius: 4px; }
.hbars .pct { font: 12.5px var(--mono); color: var(--fg-muted); text-align: right; }

/* Settings ---------------------------------------------------------------------------------------------------------------- */
.settings-layout { display: grid; grid-template-columns: 230px minmax(0, 880px); gap: 32px; align-items: start; }
.settings-nav { display: grid; gap: 2px; position: sticky; top: calc(var(--header-h) + 16px); }
.settings-nav a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-radius: var(--r-xs); color: var(--fg-muted); font-size: 13.5px; }
.settings-nav a:hover { background: var(--bg-hover); color: var(--fg-strong); }
.settings-nav a[aria-current=page] { background: var(--bg-selected); color: var(--cream); }
[data-theme=light] .settings-nav a[aria-current=page] { color: var(--fg-strong); }
.settings-nav a.danger-link { color: var(--danger-fg); }
.settings-section { display: grid; gap: 18px; }
.settings-section > header { padding-bottom: 14px; border-bottom: 1px solid var(--border-muted); }
.settings-section > header p { margin: 6px 0 0; color: var(--fg-muted); }
.settings-form { display: grid; gap: 18px; max-width: 640px; }
.danger-zone { border: 1px solid color-mix(in srgb, var(--danger-fg) 40%, transparent); border-radius: var(--r-lg); }
.danger-zone .panel-row { border-color: color-mix(in srgb, var(--danger-fg) 22%, transparent); }

/* Sign-in -------------------------------------------------------------------------------------------------------------- */
.auth { min-height: calc(100vh - var(--header-h)); display: grid; place-items: center; padding: 40px 16px; background:
  linear-gradient(var(--border-muted) 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(90deg, var(--border-muted) 1px, transparent 1px) 0 0 / 32px 32px; }
body.signed-out .header { display: none; }
body.signed-out .auth { min-height: 100vh; }
.auth-card { width: min(380px, 100%); padding: 28px 26px 24px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-lg); display: grid; gap: 18px; }
.auth-card .brand-row { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; color: var(--fg-strong); }
.auth-card .brand-row img { width: 36px; height: 36px; border-radius: 8px; }
.auth-card h1 { font-size: 20px; }
.auth-card form { display: grid; gap: 14px; }
.auth-card .btn.primary { width: 100%; height: 40px; }
.auth-foot { display: grid; gap: 6px; text-align: center; font-size: 12.5px; color: var(--fg-subtle); }
.auth-foot a { color: var(--fg-muted); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: .2em; }

/* Responsive ----------------------------------------------------------------------------------------------------------- */
@media (max-width: 1199px) {
  .card-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .design-below { grid-template-columns: minmax(0, 1fr); }
  .workspace { grid-template-columns: clamp(260px, 30vw, 300px) minmax(0, 1fr); }
  .workspace.inspecting { grid-template-columns: clamp(260px, 26vw, 280px) minmax(0, 1fr) 300px; }
}
@media (max-width: 899px) {
  .header nav.primary-nav { display: none; }
  .header .search-trigger span, .header .search-trigger kbd { display: none; }
  .header .search-trigger { flex: none; width: 36px; padding: 0; justify-content: center; margin-left: auto; margin-right: 0; }
  .split, .profile, .settings-layout, .overview { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; grid-auto-flow: column; overflow-x: auto; }
  .profile-side { grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 4px 16px; }
  .profile-side .avatar { --s: 88px; font-size: 28px; grid-row: span 2; }
  .profile-side > :not(.avatar):not(.names) { grid-column: 1 / -1; }
  .workspace, .workspace.inspecting { grid-template-columns: minmax(0, 1fr); grid-template-rows: 52vh auto; height: auto; }
  .workspace .viewer-pane { grid-row: 1; }
  .workspace .tree-pane { grid-row: 2; border-right: 0; border-top: 1px solid var(--border-muted); max-height: 60vh; }
  .workspace .tree-pane.collapsed .tree, .workspace .tree-pane.collapsed .tree-head > :not(.tree-toggle) { display: none; }
  .tree-toggle { display: flex; }
  .viewer-hint { display: none; }
  .inspector { position: fixed; inset: auto 0 0 0; top: auto; width: 100%; max-height: 62vh; border-left: 0; border-top: 1px solid var(--border); border-radius: var(--r-lg) var(--r-lg) 0 0; z-index: 50; }
  .field-changes { padding-left: 16px; }
}
@media (max-width: 599px) {
  .page { padding: 20px 16px 56px; }
  .header { padding: 0 12px; gap: 8px; }
  .brand span { display: none; }
  .repo-shell { padding: 0; margin-top: 0; }
  .repo-frame { border-radius: 0; border-left: 0; border-right: 0; }
  .repo-identity { padding: 14px 16px; gap: 10px; }
  .repo-identity .repo-name { font-size: 18px; flex-wrap: wrap; }
  .repo-actions { margin-left: 0; width: 100%; }
  .repo-nav { padding: 0 6px; height: 52px; }
  .context-row, .commit-strip, .historical, .commit-title { padding-left: 16px; padding-right: 16px; }
  .context-row .push { margin-left: 0; }
  .commit-strip { flex-wrap: wrap; } .commit-strip .end { margin-left: 0; }
  .repo-body .pad { padding: 18px 16px 32px; }
  .design-below { padding: 16px; }
  .readme-panel .readme-body { padding: 18px; }
  .card-grid.three { grid-template-columns: minmax(0, 1fr); }
  .commit-row { flex-wrap: wrap; } .commit-row .end { margin-left: 44px; }
  .field-change { grid-template-columns: 1fr; gap: 2px; }
  .owner-name { grid-template-columns: minmax(0, 1fr); } .owner-name .slash { display: none; }
  .attention > * { border-left: 0; border-top: 1px solid var(--border-muted); } .attention > :first-child { border-top: 0; }
  .toasts { left: 16px; right: 16px; bottom: 16px; max-width: none; justify-items: stretch; }
  .hbars li { grid-template-columns: 80px minmax(0, 1fr) 40px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } .btn:hover { transform: none; } }

/* Waitlist administration (/admin/waitlist) ---------------------------------------------------------------------------- */
.wl-metrics { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 1px; margin-bottom: 20px; border: 1px solid var(--border-muted);
  border-radius: var(--r-lg); overflow: hidden; background: var(--border-muted); }
.wl-metric { display: grid; gap: 4px; padding: 14px 16px; background: var(--bg-subtle); }
.wl-metric-value { font: 600 24px/1 var(--mono); color: var(--fg-strong); font-variant-numeric: tabular-nums; }
.wl-metric-label { font: 500 11.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--fg-label); }
.wl-span { grid-column: 1 / -1; border-radius: 0; border-width: 0; }
.wl-filters { display: grid; gap: 12px; margin-bottom: 16px; padding: 14px 16px; border: 1px solid var(--border-muted); border-radius: var(--r-lg); background: var(--bg-subtle); }
.wl-search { display: flex; gap: 8px; } .wl-search input { flex: 1 1 auto; min-width: 0; }
.wl-filter-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.wl-filter { display: grid; gap: 4px; min-width: 150px; } .wl-filter select { width: 100%; }
.wl-range input { width: 74px; }
.wl-signals { align-items: center; }
.wl-clear { margin-left: auto; border: 0 !important; background: none !important; color: var(--link-hover) !important; }
.wl-table tbody tr { cursor: pointer; }
.wl-table tbody tr:focus-visible td { outline: 2px solid var(--focus); outline-offset: -2px; }
.wl-table td { font-size: 13.5px; }
.wl-table th { white-space: nowrap; }
.wl-name { display: block; font-weight: 600; color: var(--fg-strong); }
.wl-email { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-sort { border: 0; background: none; padding: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; }
.wl-sort:hover { color: var(--fg-strong); }
.wl-cads { display: flex; flex-wrap: wrap; gap: 4px; }
.wl-signal { display: inline-block; margin: 0 4px 4px 0; padding: 2px 7px; border: 1px solid var(--border); border-radius: var(--r-xs); font-size: 11.5px; color: var(--fg-muted); white-space: nowrap; }
.wl-score { display: inline-flex; align-items: center; gap: 8px; }
.wl-score-bar { display: block; width: 64px; height: 6px; border-radius: 3px; background: var(--bg-inset); border: 1px solid var(--border-muted); overflow: hidden; }
.wl-score-bar > span { display: block; height: 100%; background: var(--accent-emphasis); }
.wl-score-num { font: 600 13px var(--mono); color: var(--fg-strong); min-width: 2ch; text-align: right; }
.wl-tier { display: inline-flex; align-items: center; gap: 3px; justify-content: center; min-width: 28px; height: 22px; padding: 0 6px; border-radius: var(--r-xs);
  font: 700 12.5px var(--mono); border: 1px solid var(--border-strong); color: var(--fg-strong); }
.wl-tier[data-tier=A] { background: var(--accent-emphasis); border-color: transparent; color: var(--cream); }
.wl-tier[data-tier=B] { background: var(--accent-subtle); border-color: var(--accent-border); }
.wl-tier.none { color: var(--fg-subtle); border-style: dashed; }
.wl-manual { font-size: 9.5px; opacity: .8; }
.wl-status { text-transform: capitalize; }
.wl-col-date { white-space: nowrap; color: var(--fg-muted); }
.wl-pager { margin-top: 14px; }
.wl-back { margin-bottom: 8px; }
.wl-detail-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 24px; align-items: start; }
.wl-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; margin: 0; }
.wl-total { font: 600 34px/1 var(--mono); color: var(--fg-strong); }
.wl-part { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border-muted); }
.wl-part .wl-score-bar { width: 100%; }
.wl-part-score { font: 600 13px var(--mono); }
.wl-reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.wl-reasons li { display: flex; justify-content: space-between; gap: 12px; color: var(--fg-muted); }
.wl-reasons .mono { font-family: var(--mono); color: var(--success-fg); }
.wl-submission { display: block; } .wl-submission summary { cursor: pointer; } .wl-submission .facts { margin-top: 12px; }
.wl-note { padding: 12px 14px; border: 1px solid var(--border-muted); border-radius: var(--r); background: var(--bg-inset); display: grid; gap: 8px; }
.wl-history { list-style: none; margin: 0; padding: 0; }
.wl-dot { width: 9px; height: 9px; margin: 5px 0 0 9px; border-radius: 50%; background: var(--accent-emphasis); }
@media (max-width: 1199px) {
  .wl-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wl-col-role, .wl-col-signals { display: none; }
}
@media (max-width: 899px) {
  .wl-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .wl-col-type, .wl-col-cad, .wl-col-date { display: none; }
}
@media (max-width: 599px) {
  .wl-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wl-col-org { display: none; }
  .wl-filter { min-width: calc(50% - 7px); }
  .wl-table th, .wl-table td { padding: 10px 10px; }
  .wl-email { max-width: 160px; }
}
