/*
  Support.Portal – one stylesheet. Colours are tokens (light, then dark by prefers-color-scheme); --brand comes from
  /branding/theme.css (Portal:AccentColor), the accent of each theme is derived from it. No inline styles (CSP).
*/
:root {
  --brand: #1f5fae;
  --accent: var(--brand);
  --accent-hover: color-mix(in srgb, var(--accent) 86%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 10%, var(--surface));
  --on-accent: #fff;
  --bg: #f5f6f8;
  --bg-tint: color-mix(in srgb, var(--brand) 6%, #f5f6f8);
  --surface: #fff;
  --surface-2: #f0f2f5;
  --fg: #18202b;
  --muted: #5a6575;
  --line: #dfe3e9;
  --line-strong: #c9cfd8;
  --ok: #1c7a48; --ok-soft: #e3f4ea;
  --warn: #8a5a00; --warn-soft: #fcf1dc;
  --bad: #b42318; --bad-soft: #fde8e6;
  --info: #1f5fae; --info-soft: #e7eef9;
  --supplier: #6b3fa0; --supplier-soft: #f0e9f8;
  --customer: #1d6f7a; --customer-soft: #e3f3f4;
  --admin: #8a4b00; --admin-soft: #fbeedd;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 1px 3px rgb(16 24 40 / 8%);
  --shadow-lg: 0 12px 32px rgb(16 24 40 / 12%), 0 2px 6px rgb(16 24 40 / 6%);
  --radius: 10px;
  --radius-sm: 6px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: color-mix(in srgb, var(--brand) 62%, #fff);
    --accent-hover: color-mix(in srgb, var(--accent) 85%, #fff);
    --on-accent: #0d1117;
    --bg: #101419;
    --bg-tint: color-mix(in srgb, var(--brand) 10%, #101419);
    --surface: #171c23;
    --surface-2: #1e252e;
    --fg: #e4e8ee;
    --muted: #9aa5b3;
    --line: #2a323d;
    --line-strong: #3a4452;
    --ok: #6fd19c; --ok-soft: #15301f;
    --warn: #e9b860; --warn-soft: #33270f;
    --bad: #ff8a80; --bad-soft: #3a1714;
    --info: #8ab4f0; --info-soft: #172438;
    --supplier: #c9a6f2; --supplier-soft: #2a1d3b;
    --customer: #7fd3dc; --customer-soft: #12302f;
    --admin: #f0b86a; --admin-soft: #33240f;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow-lg: 0 12px 32px rgb(0 0 0 / 45%);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--fg); font: 15px/1.55 var(--font);
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.25; margin: 0; text-wrap: balance; }
h1 { font-size: 1.75rem; font-weight: 600; }
h2 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0; }
img { max-width: 100%; }
code { font: 0.85em var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); z-index: 20; }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.nowrap { white-space: nowrap; }
.wrap { overflow-wrap: anywhere; }
.break { overflow-wrap: anywhere; }
.stack { display: grid; gap: 14px; }
.push { margin-left: auto; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }

/* Top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 24px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-weight: 600; font-size: 1.05rem; min-width: 0; }
.brand img { height: 32px; width: auto; display: block; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand:hover { color: var(--fg); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; padding: 7px 12px; border-radius: var(--radius-sm); font-weight: 500; }
.nav a:hover { color: var(--fg); background: var(--surface-2); }
.nav a.active { color: var(--accent); background: var(--accent-soft); }

/* Account menu */
.account { margin-left: auto; position: relative; }
.account summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 999px; }
.account summary::-webkit-details-marker { display: none; }
.account summary:hover { background: var(--surface-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.02em; }
.account-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 0.9rem; }
.account-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 280px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px; display: grid; gap: 12px; }
.account-who { display: grid; gap: 4px; overflow-wrap: anywhere; }
.account-who > span { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Page */
.page { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 28px 20px 48px; display: grid; gap: 20px; align-content: start; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 + p { margin-top: 4px; }
.breadcrumb { font-size: 0.875rem; color: var(--muted); display: flex; gap: 6px; }
.footer { color: var(--muted); font-size: 0.8rem; text-align: center; padding: 18px; border-top: 1px solid var(--line); }
.hero { display: grid; gap: 6px; padding: 8px 0 4px; }
.hero .lead { color: var(--muted); font-size: 1.05rem; max-width: 70ch; }
.eyebrow { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); font-weight: 600; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; display: grid; gap: 14px; align-content: start; }
.card-title { font-size: 1rem; }
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 20px; align-items: start; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; align-items: start; }
.empty-state { justify-items: center; text-align: center; padding: 40px 20px; }
.empty-icon { color: var(--accent); opacity: 0.8; }
.notice { max-width: 520px; margin: 40px auto; display: grid; gap: 14px; text-align: center; justify-items: center; }
.danger-zone summary { cursor: pointer; color: var(--bad); font-weight: 600; }
.danger-zone[open] { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }

/* Forms */
label, legend { font-weight: 500; font-size: 0.875rem; }
.field { display: grid; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field.grow { flex: 1 1 220px; }
.form-row, .filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
input[type=text], input[type=email], input[type=search], input[type=date], input[type=number], input:not([type]), select, textarea {
  font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 8px 10px; min-height: 40px; width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.choice { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 0.95rem; }
.choice input { width: 16px; height: 16px; accent-color: var(--accent); }
fieldset.field .choice { margin-top: 2px; }
.select-compact { min-height: 34px; padding: 4px 8px; font-size: 0.875rem; }
.language-form { display: flex; gap: 6px; align-items: center; }
.code-input { font: 600 1.5rem var(--mono); letter-spacing: 0.4em; text-align: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 500 0.95rem var(--font);
  min-height: 40px; padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--fg); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); color: var(--fg); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--fg); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--bad) 85%, #000); color: #fff; }
.btn-small { min-height: 32px; padding: 4px 10px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-provider { width: 100%; min-height: 44px; font-weight: 500; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* Badges, alerts */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge-on { background: var(--ok-soft); color: var(--ok); }
.badge-off { background: var(--bad-soft); color: var(--bad); }
.role-administrator { background: var(--admin-soft); color: var(--admin); }
.role-supplier { background: var(--supplier-soft); color: var(--supplier); }
.role-customer { background: var(--customer-soft); color: var(--customer); }
.alert { padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid transparent; font-size: 0.925rem; }
.alert-info { background: var(--info-soft); color: var(--info); }
.alert-success { background: var(--ok-soft); color: var(--ok); }
.alert-warning { background: var(--warn-soft); color: var(--warn); }
.alert-error { background: var(--bad-soft); color: var(--bad); }

/* Tables */
.table-wrap { position: relative; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { text-align: left; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.row-link { font-weight: 600; text-decoration: none; }
.row-link:hover { text-decoration: underline; }
.row-off td { opacity: 0.7; }
code.json { white-space: pre-wrap; word-break: break-word; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { padding: 8px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tab:hover { color: var(--fg); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.pager { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 0.875rem; }
.pager-buttons { display: flex; gap: 6px; }

/* Popover (block reason) */
.popover { position: relative; }
.popover summary { list-style: none; }
.popover summary::-webkit-details-marker { display: none; }
.popover-panel { position: absolute; right: 0; top: calc(100% + 6px); width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 12px; z-index: 5; }

/* Organization rules */
.rule-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.rule-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.rule-list li:last-child { border-bottom: 0; }
.rule-pattern { font-family: var(--mono); font-size: 0.9rem; overflow-wrap: anywhere; }

/* Status */
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 0.9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.meter { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.meter-bar { height: 100%; width: 0; border-radius: 999px; transition: width 0.4s ease; }
.meter-low { background: var(--ok); }
.meter-mid { background: var(--warn); }
.meter-high { background: var(--bad); }
.branding-preview { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.branding-preview img { width: auto; }

/* Sign-in */
.signin-body { background:
    radial-gradient(1200px 600px at 50% -10%, var(--bg-tint), transparent 70%), var(--bg); }
.signin { flex: 1; display: grid; place-items: center; align-content: center; gap: 16px; padding: 32px 16px; }
.signin-card { width: min(100%, 420px); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 32px 32px 28px; display: grid; gap: 16px; }
.signin-logo { display: flex; justify-content: center; }
.signin-logo img { width: 100%; max-width: 300px; height: auto; aspect-ratio: 3 / 1; object-fit: contain; }
.signin-site { text-align: center; color: var(--muted); font-size: 0.9rem; margin-top: -8px; }
.signin-title { font-size: 1.35rem; text-align: center; margin-top: 4px; }
.signin-lead { text-align: center; color: var(--muted); font-size: 0.925rem; }
.provider-buttons { display: grid; gap: 10px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.signin-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 0.9rem; }
.signin-note { color: var(--muted); font-size: 0.8rem; text-align: center; }
.signin-foot { display: flex; justify-content: center; }
body.plain { display: block; }

/* Releases */
.plain-link { color: inherit; text-decoration: none; }
.plain-link:hover { color: var(--accent); }
.title-extra { font-weight: 400; color: var(--muted); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-draft, .state-draft { background: var(--warn-soft); color: var(--warn); }
.state-published { background: var(--ok-soft); color: var(--ok); }
.state-archived { background: var(--surface-2); color: var(--muted); }
.featured { gap: 18px; border-top: 3px solid var(--accent); }
.featured-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.featured-title { display: grid; gap: 4px; min-width: 0; }
.featured h2 { font-size: 1.4rem; }
.file-group { display: grid; gap: 8px; }
.file-group + .file-group { margin-top: 6px; }
.file-group-title { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.file-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.file-row:last-child { border-bottom: 0; }
.file-row form { margin: 0; }
.file-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.file-name { font-weight: 600; overflow-wrap: anywhere; }
.file-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 0.8rem; color: var(--muted); }
.file-description { font-size: 0.85rem; color: var(--muted); }
.sha { font: 0.78rem var(--mono); color: var(--muted); text-decoration: none; }
.sha:hover { color: var(--accent); }
.ext { flex: none; width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center; font: 700 0.66rem var(--font); letter-spacing: 0.04em; background: var(--surface-2); color: var(--muted); }
.ext-exe, .ext-msi { background: var(--info-soft); color: var(--info); }
.ext-zip, .ext-7z { background: var(--warn-soft); color: var(--warn); }
.ext-apk, .ext-aab { background: var(--ok-soft); color: var(--ok); }
.ext-pdf, .ext-docx { background: var(--bad-soft); color: var(--bad); }
.download { flex: none; }
.changelog-teaser summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.changelog-teaser[open] summary { margin-bottom: 10px; }
.release-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.line-card { gap: 10px; }
.line-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.line-head h3 { font-size: 1rem; }
.release-rows { list-style: none; margin: 0; padding: 0; display: grid; }
.release-rows li { display: grid; grid-template-columns: minmax(70px, auto) minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.release-rows li:last-child { border-bottom: 0; }
.release-version { font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; }
.release-title { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archive summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; padding: 6px 4px; }

/* Markdown (changelogs) */
.markdown { font-size: 0.95rem; overflow-wrap: anywhere; }
.markdown > * + * { margin-top: 0.7em; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4 { font-size: 1rem; margin-top: 1.2em; }
.markdown h1:first-child, .markdown h2:first-child, .markdown h3:first-child { margin-top: 0; }
.markdown ul, .markdown ol { padding-left: 1.3em; margin-bottom: 0; }
.markdown li + li { margin-top: 0.3em; }
.markdown code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.markdown pre { background: var(--surface-2); padding: 12px; border-radius: var(--radius-sm); overflow-x: auto; }
.markdown pre code { background: none; padding: 0; }
.markdown blockquote { margin: 0; padding-left: 12px; border-left: 3px solid var(--line-strong); color: var(--muted); }
.markdown table { border-collapse: collapse; display: block; overflow-x: auto; }
.markdown th, .markdown td { border: 1px solid var(--line); padding: 6px 10px; }

/* Administration */
.admin-tabs { overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; scrollbar-width: thin; }
.admin-tabs .tab { white-space: nowrap; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions-row form { margin: 0; }
.edit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.edit-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.edit-list li form { margin: 0; }
.edit-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex: 1; min-width: 0; }
.edit-row .grow, .edit-row input.grow { flex: 1 1 160px; width: auto; }
.w-name { width: 120px !important; }
.w-num { width: 84px !important; }
.w-version { width: 130px !important; }
.w-auto { width: auto !important; max-width: 100%; }
.choice-row { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.customer-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); max-height: 220px; overflow-y: auto; }
textarea.mono { font: 0.875rem/1.5 var(--mono); }
.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 12px; display: grid; gap: 8px; transition: border-color 0.15s, background 0.15s; }
.dropzone.dragging { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-label { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); cursor: pointer; padding: 8px; font-weight: 400; font-size: 0.9rem; }
.dropzone-label:hover { color: var(--accent); }
.upload-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.upload-list:empty { display: none; }
.upload-item { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto; gap: 10px; align-items: center; font-size: 0.875rem; }
.upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.upload-ok .progress-bar { background: var(--ok); }
.upload-failed .progress-bar { background: var(--bad); }
.upload-failed .upload-state { color: var(--bad); }

/* Library */
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 20px; align-items: start; }
.library-item { gap: 12px; }
.library-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.library-head h3 { font-size: 1.1rem; }
.inline-edit summary { cursor: pointer; color: var(--accent); font-size: 0.8rem; width: fit-content; }
.inline-edit[open] summary { margin-bottom: 8px; }

/* Reports, storage */
.filter-check { min-height: 40px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: grid; gap: 2px; }
.stat-value { font: 600 1.5rem/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 0.8rem; }
.size-table .size-level-0 td { font-weight: 600; background: var(--surface-2); }
.size-table .size-level-1 td:first-child { padding-left: 30px; }
.size-table .size-level-2 td:first-child { padding-left: 52px; }

/* Publishing tokens */
.token-new { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.token-value { display: flex; gap: 8px; flex-wrap: wrap; }
.token-value input { flex: 1 1 320px; width: auto; }
input.mono { font-family: var(--mono); font-size: 0.875rem; }
code.command { display: block; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); overflow-x: auto; white-space: pre; }

/* Tickets */
.stack-tight { display: grid; gap: 6px; }
.ticket-facts { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.status-new { background: var(--info-soft); color: var(--info); }
.status-open { background: var(--accent-soft); color: var(--accent); }
.status-needinfo { background: var(--warn-soft); color: var(--warn); }
.status-fixed { background: var(--ok-soft); color: var(--ok); }
.status-closed { background: var(--surface-2); color: var(--muted); }
.severity-low { background: var(--surface-2); color: var(--muted); }
.severity-normal { background: var(--info-soft); color: var(--info); }
.severity-high { background: var(--warn-soft); color: var(--warn); }
.severity-critical { background: var(--bad-soft); color: var(--bad); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: grid; gap: 10px; min-width: 0; }
.entry-report { border-top: 3px solid var(--accent); }
.entry-internal { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.entry-portal { background: var(--surface-2); box-shadow: none; }
.entry-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.entry-head > span:last-child { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.status-change { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); }
.thumbs { display: flex; flex-wrap: wrap; gap: 12px; }
.thumb { margin: 0; display: grid; gap: 4px; max-width: 220px; }
.thumb img { max-width: 220px; max-height: 160px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); object-fit: contain; }
.thumb figcaption { overflow-wrap: anywhere; }
.inline-form { display: inline; margin: 0; }
.summary-title { cursor: pointer; }

@media (max-width: 900px) {
  .release-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .release-rows li { grid-template-columns: auto minmax(0, 1fr); }
  .file-row { flex-wrap: wrap; }
  .file-main { flex: 1 1 calc(100% - 60px); }
  .file-row .download, .file-row > .btn, .file-row > form { margin-left: 56px; }
  .upload-item { grid-template-columns: 1fr; }
  .topbar-inner { flex-wrap: wrap; gap: 10px 16px; padding: 10px 16px; }
  .nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .account-name { display: none; }
  .page { padding: 20px 16px 40px; }
  h1 { font-size: 1.45rem; }
  .signin-card { padding: 24px 20px; }
  .columns { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
