/*
 * GE4 Panel stylesheet. Hand-written, no build step.
 * One accent (harbour green); status colours only ever mean status.
 */

@font-face { font-family: "Manrope"; src: url("../fonts/Manrope-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/Manrope-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/Manrope-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/Manrope-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/JetBrainsMono-Variable.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
    --ink: #232323;          /* headings (GE4 charcoal) */
    --menu: #2b2b2b;         /* sidebar, sign-in side, help top bar (brand setting) */
    --ink-soft: #444444;     /* body text */
    --muted: #6e6c6a;        /* secondary text */
    --line: #e3e0dd;         /* borders, rules */
    --paper: #f6f4f2;        /* page (warm, next to the coral logo) */
    --surface: #ffffff;      /* panels, tables */
    --accent: #c0492f;       /* GE4 coral, dark enough for white text: primary actions, focus, active nav */
    --accent-strong: #9a3a26;
    --accent-wash: #fbebe6;
    --accent-on-menu: color-mix(in srgb, var(--accent) 45%, #ffffff); /* links and markers on the dark menu */

    --ok: #1f7a4d;   --ok-wash: #e4f3ea;
    --info: #2c5d8f; --info-wash: #e6eef7;
    --warn: #93600a; --warn-wash: #fbf0d9;
    --bad: #b3261e;  --bad-wash: #fbe7e5;
    --idle: #6e6c6a; --idle-wash: #eeebe8;

    --radius-s: 4px;
    --radius-m: 8px;
    --sidebar: 15.5rem;
    --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 0.9375rem; line-height: 1.5; color: var(--ink-soft); background: var(--paper); }
h1, h2, h3 { color: var(--ink); line-height: 1.25; margin: 0; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.0625rem; font-weight: 700; }
h3 { font-size: 0.9375rem; font-weight: 600; }
p { margin: 0 0 0.75rem; max-width: 70ch; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
code, .mono { font-family: var(--mono); font-size: 0.8125rem; font-variant-ligatures: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-s); }
[x-cloak] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; background: linear-gradient(90deg, var(--menu) var(--sidebar), transparent var(--sidebar)); }
.sidebar { background: var(--menu); color: #d6d3d0; display: flex; flex-direction: column; padding: 1.25rem 0.75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 0.6rem; padding: 0 0.6rem 1.25rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.0625rem; }
.brand-mark { width: 1.75rem; height: 1.75rem; border-radius: 6px; background: var(--accent); display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; color: #fff; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.menu-toggle { display: none; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: var(--radius-s); background: transparent; color: #fff; cursor: pointer; }
.menu-toggle svg { width: 1.3rem; height: 1.3rem; }
.sidebar.open .menu-toggle { background: rgba(255, 255, 255, 0.1); }
.nav-group { margin-top: 1.25rem; padding: 0 0.6rem 0.35rem; font-size: 0.75rem; color: #9c9894; }
.nav a { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.6rem; border-radius: var(--radius-s); color: #d6d3d0; text-decoration: none; font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav a[aria-current="page"] { background: color-mix(in srgb, var(--accent) 38%, transparent); color: #fff; box-shadow: inset 3px 0 0 var(--accent-on-menu); }
.nav svg { width: 1.05rem; height: 1.05rem; flex: none; opacity: 0.85; }
.sidebar-foot { margin-top: auto; padding: 1rem 0.6rem 0; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 0.8125rem; }
.sidebar-foot .who { color: #fff; font-weight: 600; }
.sidebar-foot .role { color: #9c9894; }
.sidebar-foot form { margin-top: 0.5rem; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent-on-menu); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

.main { min-width: 0; }
.impersonating { background: var(--warn-wash); color: var(--warn); border-bottom: 1px solid #efd9a8; padding: 0.5rem 2rem; display: flex; gap: 1rem; align-items: center; font-weight: 500; }
.page { padding: 1.75rem 2rem 3rem; max-width: 76rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head .sub { color: var(--muted); margin-top: 0.25rem; }
.crumbs { font-size: 0.8125rem; color: var(--muted); margin-bottom: 0.4rem; }
.crumbs a { color: var(--muted); }

/* ------------------------------------------------------------ panels & tables */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); margin-bottom: 1.25rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--line); }
.panel-body { padding: 1.1rem; }
.panel-note { color: var(--muted); font-size: 0.875rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1.25rem; }

table.data { width: 100%; border-collapse: collapse; }
.data th { text-align: left; font-size: 0.8125rem; font-weight: 600; color: var(--muted); padding: 0.6rem 1.1rem; border-bottom: 1px solid var(--line); background: #fbfaf9; }
.data td { padding: 0.7rem 1.1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data tr:last-child td { border-bottom: 0; }
.data tbody tr:hover { background: #fcfaf9; }
.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.data .actions { text-align: right; white-space: nowrap; }
.data a.row-link { color: var(--ink); font-weight: 600; text-decoration: none; }
.data a.row-link:hover { color: var(--accent); }
.table-scroll { overflow-x: auto; }
.empty { padding: 2rem 1.1rem; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); margin-bottom: 0.25rem; }

/* key figures on the dashboard: a row, not a card grid */
.figures { display: flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); margin-bottom: 1.25rem; }
.figure { flex: 1 1 10rem; padding: 1rem 1.25rem; border-right: 1px solid var(--line); }
.figure:last-child { border-right: 0; }
.figure .value { font-size: 1.625rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.figure .label { color: var(--muted); font-size: 0.875rem; }
.figure a { text-decoration: none; }

/* ------------------------------------------------------------ status */
.status { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8125rem; font-weight: 600; padding: 0.1rem 0.55rem 0.1rem 0.45rem; border-radius: 999px; white-space: nowrap; }
.status::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; }
.status-green { color: var(--ok); background: var(--ok-wash); }
.status-blue { color: var(--info); background: var(--info-wash); }
.status-amber { color: var(--warn); background: var(--warn-wash); }
.status-red { color: var(--bad); background: var(--bad-wash); }
.status-gray { color: var(--idle); background: var(--idle-wash); }

.meter { height: 0.4rem; background: var(--idle-wash); border-radius: 999px; overflow: hidden; min-width: 6rem; }
.meter span { display: block; height: 100%; background: var(--accent); }
.meter.high span { background: var(--warn); }
.meter.full span { background: var(--bad); }

/* ------------------------------------------------------------ tabs */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a { padding: 0.6rem 0.9rem; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ------------------------------------------------------------ forms */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem 1.25rem; }
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field label, .label { font-weight: 600; color: var(--ink); font-size: 0.875rem; }
.field .hint { color: var(--muted); font-size: 0.8125rem; }
.field .error { color: var(--bad); font-size: 0.8125rem; font-weight: 500; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], input[type="url"], input[type="tel"], input[type="date"], select, textarea {
    font: inherit; color: var(--ink); background: #fff; border: 1px solid #cfcac5; border-radius: var(--radius-s); padding: 0.5rem 0.65rem; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--bad); }
.input-prefix { display: flex; }
.input-prefix span { font-family: var(--mono); font-size: 0.8125rem; background: var(--paper); border: 1px solid #cfcac5; border-right: 0; border-radius: var(--radius-s) 0 0 var(--radius-s); padding: 0.55rem 0.6rem; color: var(--muted); }
.input-prefix input { border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.check { display: flex; gap: 0.5rem; align-items: flex-start; font-weight: 500; color: var(--ink); }
.check input { margin-top: 0.25rem; accent-color: var(--accent); }
.form-actions { display: flex; gap: 0.6rem; align-items: center; margin-top: 1.25rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; font: inherit; font-weight: 600; font-size: 0.875rem; padding: 0.5rem 0.95rem; border-radius: var(--radius-s); border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); color: #fff; }
.btn-secondary { background: #fff; color: var(--ink); border-color: #cfcac5; }
.btn-secondary:hover { border-color: var(--ink-soft); color: var(--ink); }
.btn-danger { background: #fff; color: var(--bad); border-color: #e7b8b4; }
.btn-danger:hover { background: var(--bad-wash); color: var(--bad); }
.btn-small { padding: 0.25rem 0.6rem; font-size: 0.8125rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.alert { border-radius: var(--radius-m); padding: 0.75rem 1rem; margin-bottom: 1.25rem; border: 1px solid; }
.alert-ok { background: var(--ok-wash); border-color: #b9dfc8; color: #17573a; }
.alert-bad { background: var(--bad-wash); border-color: #efc2be; color: #8a1d17; }
.alert-warn { background: var(--warn-wash); border-color: #efd9a8; color: #6e4807; }

/* A secret shown once (generated password) */
.secret { border: 1px dashed var(--accent); background: var(--accent-wash); border-radius: var(--radius-m); padding: 0.85rem 1rem; margin-bottom: 1.25rem; }
.secret .value { font-family: var(--mono); font-size: 0.9375rem; color: var(--ink); background: #fff; padding: 0.3rem 0.55rem; border-radius: var(--radius-s); border: 1px solid var(--line); user-select: all; word-break: break-all; }
.secret p { margin: 0.4rem 0 0; font-size: 0.875rem; }

/* ------------------------------------------------------------ provisioning timeline (signature) */
.timeline { list-style: none; margin: 0; padding: 0.4rem 1.1rem 0.9rem; }
.timeline li { position: relative; display: grid; grid-template-columns: 1.4rem 1fr auto; gap: 0.75rem; padding: 0.55rem 0; }
.timeline li::before { content: ""; position: absolute; left: 0.6rem; top: 1.65rem; bottom: -0.55rem; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 2px solid var(--line); background: #fff; display: grid; place-items: center; z-index: 1; }
.timeline .dot svg { width: 0.8rem; height: 0.8rem; }
.timeline .succeeded .dot { border-color: var(--ok); background: var(--ok); color: #fff; }
.timeline .failed .dot { border-color: var(--bad); background: var(--bad); color: #fff; }
.timeline .running .dot { border-color: var(--accent); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.timeline .cancelled .dot { border-style: dashed; }
.timeline .succeeded::before { background: var(--ok); }
.timeline .what { color: var(--ink); font-weight: 500; }
.timeline .queued .what, .timeline .cancelled .what { color: var(--muted); }
.timeline .err { color: var(--bad); font-size: 0.8125rem; margin-top: 0.15rem; font-family: var(--mono); word-break: break-word; }
.timeline .when { color: var(--muted); font-size: 0.8125rem; white-space: nowrap; }
.batch-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.75rem 1.1rem 0; font-size: 0.875rem; color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .timeline .running .dot { animation: none; border-top-color: var(--accent); } }

/* ------------------------------------------------------------ misc */
.muted { color: var(--muted); }
.small { font-size: 0.8125rem; }
.stack > * + * { margin-top: 0.75rem; }
.row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.45rem 1.25rem; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; color: var(--ink); }
details.inline summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.pagination { padding: 0.75rem 1.1rem; border-top: 1px solid var(--line); }
.pagination nav > div:first-child { display: none; }

/* ------------------------------------------------------------ auth pages */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(22rem, 30rem); }
.auth-side { background: var(--menu); color: #d6d3d0; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side .brand { padding: 0; }
.auth-side .claim { font-size: 1.75rem; line-height: 1.3; color: #fff; font-weight: 600; max-width: 22ch; letter-spacing: -0.01em; }
.auth-side .status-list { list-style: none; padding: 0; margin: 1.5rem 0 0; font-family: var(--mono); font-size: 0.8125rem; color: var(--accent-on-menu); }
.auth-side .status-list li { padding: 0.15rem 0; }
.auth-form { background: var(--surface); padding: 3rem; display: flex; flex-direction: column; justify-content: center; }
.auth-form h1 { margin-bottom: 0.4rem; }
.brand-compact { display: none; color: var(--ink); padding: 0 0 2rem; }
.auth-form form { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }

@media (max-width: 860px) {
    .shell { grid-template-columns: 1fr; background: none; }
    .sidebar { position: sticky; top: 0; z-index: 10; height: auto; max-height: 100vh; padding: 0.6rem 0.75rem; }
    .sidebar-head .brand { padding: 0 0.25rem; }
    .menu-toggle { display: inline-flex; }
    .sidebar:not(.open) .nav, .sidebar:not(.open) .sidebar-foot { display: none; }
    .sidebar.open .nav { margin-top: 0.75rem; }
    .page { padding: 1.25rem 1rem 2.5rem; }
    .auth { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .brand-compact { display: flex; }
    .auth-form { padding: 2rem 1.25rem; }
    .figure { border-right: 0; border-bottom: 1px solid var(--line); }
}

/* File manager */
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-align: left; text-decoration: underline; text-underline-offset: 2px; }
.link:hover { text-decoration-thickness: 2px; }
.panel-head .crumbs { margin: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
textarea.editor { width: 100%; min-height: 24rem; font-size: 0.8125rem; line-height: 1.5; tab-size: 4; white-space: pre; overflow: auto; }
label.btn { cursor: pointer; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 0.35rem; font-weight: 600; color: var(--ink); }

/* Charts (single series, server-drawn SVG). The series colour is the GE4
   coral (checked with the dataviz palette validator). */
:root { --chart: #c0492f; --chart-wash: rgba(192, 73, 47, 0.10); --chart-grid: #ebe7e3; }
.chart { margin: 0; }
.chart-title { font-weight: 600; color: var(--ink); margin-bottom: 0.5rem; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid, .chart-axis { stroke: var(--chart-grid); stroke-width: 1; }
.chart-axis { stroke: #d6d1cc; }
.chart-tick { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart-bar { fill: var(--chart); }
.chart-line { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: var(--chart-wash); }
.chart-dot { fill: var(--chart); stroke: var(--surface); stroke-width: 2; }
.chart-hit { fill: transparent; }
.chart-cross { stroke: #a39e99; stroke-width: 1; opacity: 0; }
.chart-hover-dot, .chart-tip { opacity: 0; pointer-events: none; }
.chart-tip rect { fill: var(--ink); }
.chart-tip text { font-size: 12px; font-family: var(--font); }
.chart-tip-value { fill: #fff; font-weight: 600; }
.chart-tip-label { fill: #d6d3d0; }
.chart-mark { outline: none; }
.chart-mark:hover .chart-tip, .chart-mark:focus .chart-tip,
.chart-mark:hover .chart-cross, .chart-mark:focus .chart-cross,
.chart-mark:hover .chart-hover-dot, .chart-mark:focus .chart-hover-dot { opacity: 1; }
.chart-mark:hover .chart-bar, .chart-mark:focus .chart-bar { fill: var(--accent-strong); }
.chart-mark:focus-visible .chart-hit { stroke: var(--accent); stroke-width: 1; }
.chart-table { margin-top: 0.5rem; }
.chart-table summary { cursor: pointer; color: var(--muted); }
.chart-table table { margin-top: 0.5rem; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: var(--surface); }
.segmented button { font: inherit; font-size: 0.8125rem; border: 0; background: none; padding: 0.4rem 0.8rem; cursor: pointer; color: var(--ink-soft); }
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button.on { background: var(--accent-wash); color: var(--accent-strong); font-weight: 600; }
.chart-scroll { overflow-x: auto; }

/* ------------------------------------------------------------ help pages */
.tabs-help { margin-left: auto; display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 500 !important; }
.tabs-help svg { width: 1rem; height: 1rem; }
.topbar { background: var(--menu); display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 1.5rem; flex-wrap: wrap; }
.topbar .brand { padding: 0; }
.topbar-nav { display: flex; align-items: center; gap: 1.25rem; font-weight: 500; }
.topbar-nav > a:not(.btn) { color: #d6d3d0; text-decoration: none; }
.topbar-nav > a[aria-current="page"] { color: #fff; box-shadow: inset 0 -2px 0 var(--accent-on-menu); }
.topbar-lang { display: flex; gap: 0.6rem; font-size: 0.8125rem; color: #fff; }
.topbar-lang a { color: var(--accent-on-menu); }
.page-narrow { margin: 0 auto; }
.help-search { display: flex; gap: 0.6rem; margin-bottom: 1.5rem; max-width: 40rem; }
.help-search input { flex: 1; min-width: 0; font: inherit; padding: 0.55rem 0.8rem; border: 1px solid #cfcac5; border-radius: var(--radius-s); background: var(--surface); color: var(--ink); }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 0 1.25rem; align-items: start; }
.help-list { list-style: none; margin: 0; padding: 0.35rem 0; }
.help-list li { display: flex; flex-direction: column; padding: 0.55rem 1.1rem; }
.help-list li + li { border-top: 1px solid #f0edea; }
.help-list a { font-weight: 600; text-decoration: none; }
.help-list a:hover { text-decoration: underline; }
.help-article { display: grid; grid-template-columns: minmax(0, 1fr) 16rem; gap: 1.25rem; align-items: start; }
.help-aside { position: sticky; top: 1rem; }
.help-toc { list-style: none; margin: 0; padding: 0.6rem 1.1rem; font-size: 0.875rem; display: flex; flex-direction: column; gap: 0.4rem; }
.help-toc [aria-current="page"] { font-weight: 600; color: var(--ink); }
.help-pager { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.help-pager a { display: flex; flex-direction: column; text-decoration: none; font-weight: 600; padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); max-width: 48%; }
.help-pager a.next { text-align: right; margin-left: auto; }
.help-contact h2 { font-size: 1rem; }
.prose { padding: 1.5rem 1.75rem; color: var(--ink-soft); }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.1875rem; margin: 2rem 0 0.6rem; padding-top: 0.25rem; scroll-margin-top: 1rem; }
.prose h3 { font-size: 1rem; margin: 1.5rem 0 0.5rem; scroll-margin-top: 1rem; }
.prose p, .prose li { max-width: 72ch; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 0.9rem; }
.prose li { margin-bottom: 0.3rem; }
.prose li > p { margin: 0; }
.prose code { background: var(--paper); border: 1px solid var(--line); border-radius: 3px; padding: 0.05rem 0.3rem; color: var(--ink); }
.prose pre { background: var(--ink); color: #eeeae6; padding: 0.9rem 1rem; border-radius: var(--radius-m); overflow-x: auto; margin: 0 0 1rem; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; }
.prose table { border-collapse: collapse; margin: 0 0 1rem; font-size: 0.875rem; display: block; overflow-x: auto; max-width: 100%; }
.prose th, .prose td { text-align: left; padding: 0.45rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--ink); font-weight: 600; background: var(--paper); }
.prose blockquote { margin: 0 0 1rem; padding: 0.7rem 1rem; background: var(--accent-wash); border-left: 3px solid var(--accent); border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.prose blockquote p { margin: 0; }
.prose .heading-permalink { margin-left: 0.4rem; color: #bdb7b1; text-decoration: none; font-weight: 400; opacity: 0; }
.prose h2:hover .heading-permalink, .prose h3:hover .heading-permalink, .prose .heading-permalink:focus { opacity: 1; }
.prose strong { color: var(--ink); }
@media (max-width: 860px) {
    .help-article { grid-template-columns: minmax(0, 1fr); }
    .help-aside { position: static; order: -1; }
    .help-aside .panel:last-child { display: none; }
    .prose { padding: 1.1rem 1rem; }
    .topbar { padding: 0.75rem 1rem; }
    .help-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------ branding */
.brand-logo { display: block; max-height: 1.75rem; max-width: 11rem; }
.brand-layout { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 1.25rem; align-items: start; }
.brand-preview-wrap { position: sticky; top: 1rem; }
.brand-preview { display: grid; grid-template-columns: 7.5rem 1fr; border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; font-size: 0.75rem; background: var(--paper); min-height: 13rem; }
.bp-side { background: var(--p-ink); color: #d6d3d0; padding: 0.75rem 0.5rem; display: flex; flex-direction: column; gap: 0.2rem; }
.bp-brand { display: flex; align-items: center; gap: 0.35rem; color: #fff; font-weight: 700; margin-bottom: 0.6rem; overflow: hidden; white-space: nowrap; }
.bp-mark { background: var(--p-accent); border-radius: 4px; padding: 0.1rem 0.25rem; font-size: 0.625rem; }
.bp-nav { padding: 0.25rem 0.35rem; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-on { background: color-mix(in srgb, var(--p-accent) 45%, transparent); color: #fff; box-shadow: inset 2px 0 0 #fff; }
.bp-main { padding: 0.75rem; min-width: 0; }
.bp-title { font-weight: 700; color: var(--ink); font-size: 0.875rem; margin-bottom: 0.4rem; }
.bp-tabs { display: flex; gap: 0.6rem; border-bottom: 1px solid var(--line); margin-bottom: 0.6rem; color: var(--muted); }
.bp-tabs span { padding-bottom: 0.25rem; }
.bp-tab-on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--p-accent); }
.bp-card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 0.6rem; }
.bp-line { height: 0.4rem; background: var(--idle-wash); border-radius: 99px; margin-bottom: 0.35rem; }
.bp-btn { background: var(--p-accent); color: #fff; border-radius: 3px; padding: 0.2rem 0.5rem; font-weight: 600; }
.bp-link { color: var(--p-accent); text-decoration: underline; }
.swatch-input { width: 2.5rem; height: 2.35rem; padding: 0.15rem; border: 1px solid #cfcac5; border-radius: var(--radius-s); background: #fff; flex: none; cursor: pointer; }
.logo-preview { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.75rem; background: #fff; }
.logo-preview img { display: block; max-height: 2rem; max-width: 100%; }
.logo-preview-dark { border-color: transparent; }
@media (max-width: 860px) {
    .brand-layout { grid-template-columns: minmax(0, 1fr); }
    .brand-preview-wrap { position: static; order: -1; }
}
.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.4rem 1rem; }
