/* ==========================================================================
   YicMail — pannello operativo per un relay di posta in uscita.
   Elemento distintivo unico: la banda "posta aerea" (strisce rosso/blu)
   lungo la sidebar e in cima al login. Tutto il resto è sobrio e denso:
   lo stato di consegna è l'informazione, il colore la codifica.
   ========================================================================== */

:root {
  --paper: #edf0f4;
  --panel: #ffffff;
  --ink: #172033;
  --ink-soft: #2c3a52;
  --muted: #5a6578;
  --line: #d5dbe4;
  --line-soft: #e6eaf0;
  --navy: #1f3e8a;
  --navy-hover: #183170;
  --navy-tint: #e3e9f7;
  --airmail-red: #b8333a;

  --st-sent: #217a4c;       --st-sent-bg: #e1f2e8;
  --st-pending: #4b5b7a;    --st-pending-bg: #e5e9f1;
  --st-deferred: #95620f;   --st-deferred-bg: #f8edd8;
  --st-failed: #b8333a;     --st-failed-bg: #f8e3e4;

  --font-ui: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Red Hat Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Scala tipografica 1.2 (terza minore) su base 15px */
  --fs-xs: 0.75rem;
  --fs-sm: 0.833rem;
  --fs-base: 0.9375rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.35rem;
  --fs-xl: 1.62rem;
  --fs-2xl: 2.33rem;

  --r-sm: 4px;
  --r-md: 8px;
  --space: 1rem;
  --sidebar-w: 232px;
  --shadow-pop: 0 12px 32px rgba(23, 32, 51, 0.18);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12161e;
    --panel: #1a202b;
    --ink: #e6eaf1;
    --ink-soft: #c9d0dc;
    --muted: #96a0b2;
    --line: #2d3545;
    --line-soft: #242b38;
    --navy: #6f8fe0;
    --navy-hover: #8aa4ea;
    --navy-tint: #232f4b;
    --airmail-red: #d9545b;
    --st-sent: #5cc28d;       --st-sent-bg: #173326;
    --st-pending: #a7b3cc;    --st-pending-bg: #252d3c;
    --st-deferred: #e0aa4b;   --st-deferred-bg: #3a2d14;
    --st-failed: #ef7a80;     --st-failed-bg: #3d1d20;
    --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

/* ---------- Base ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "tnum" 1;
}
h1, h2, h3 { margin: 0; line-height: 1.2; color: var(--ink); }
h1 { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.015em; }
h2 { font-size: var(--fs-md); font-weight: 600; }
h3 { font-size: var(--fs-base); font-weight: 600; margin: 1.5rem 0 0.5rem; }
p { margin: 0 0 0.75rem; }
a { color: var(--navy); text-underline-offset: 2px; }
a:hover { color: var(--navy-hover); }
code, .mono { font-family: var(--font-mono); font-size: 0.93em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; }
.truncate { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Banda posta aerea (l'unico elemento decorativo) --------------- */
.airmail,
.sidebar-stripe {
  background: repeating-linear-gradient(
    -45deg,
    var(--airmail-red) 0 14px,
    var(--panel) 14px 22px,
    var(--navy) 22px 36px,
    var(--panel) 36px 44px
  );
}
.airmail { height: 10px; border-radius: var(--r-md) var(--r-md) 0 0; }

/* ---------- Login ------------------------------------------------------- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.login-card {
  width: min(100%, 380px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.login-body { padding: 2rem 2rem 1.75rem; }
.login-logo { display: block; height: 40px; width: auto; max-width: 160px; object-fit: contain; margin-bottom: 0.75rem; }
.brand-title { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.03em; margin-bottom: 0.25rem; }

/* ---------- Shell -------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: grid; grid-template-columns: 8px 1fr;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
.sidebar-inner { display: flex; flex-direction: column; padding: 1.5rem 1rem 1rem; min-width: 0; }
.brand-logo { height: 20px; width: auto; max-width: 28px; object-fit: contain; vertical-align: middle; }
.brand {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none; padding: 0 0.6rem 1.25rem;
}
.nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav a {
  display: block; padding: 0.5rem 0.6rem; border-radius: var(--r-sm);
  color: var(--ink-soft); text-decoration: none; font-weight: 500;
}
.nav a:hover { background: var(--line-soft); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--navy-tint); color: var(--navy); font-weight: 600; }
.sidebar-foot {
  margin-top: auto; padding: 0.75rem 0.6rem 0; border-top: 1px solid var(--line-soft);
  display: grid; gap: 0.4rem; justify-items: start; overflow-wrap: anywhere;
}

.main { padding: 2rem clamp(1rem, 3vw, 2.5rem) 3rem; min-width: 0; outline: none; }
.page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 1.5rem;
}
.actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.field-narrow { max-width: 18rem; }

/* ---------- Schede (tab) nelle modali ------------------------------------ */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin: 0.5rem 0 1rem; }
.tab {
  font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--ink-soft); padding: 0.5rem 0.9rem; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: grid; gap: 0.9rem; }
.field-narrow + .actions, form .actions { margin-top: 1.25rem; }
.actions select { width: auto; min-width: 12rem; }

/* ---------- Pannelli ----------------------------------------------------- */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 1.25rem; margin-bottom: 1.25rem;
}
.panel-flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.25rem; }
.grid-2 > .panel { margin-bottom: 0; }

/* ---------- Riepilogo: una riga "da registro", non quattro card ---------- */
.ledger {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
}
.ledger-item {
  display: flex; flex-direction: column; gap: 0.15rem;
  padding: 1rem 1.25rem 1.1rem 0;
}
.ledger-item + .ledger-item { padding-left: 1.25rem; border-left: 1px solid var(--line); }
.ledger-value { font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.ledger-label { color: var(--muted); font-size: var(--fs-sm); }
.ledger-item-alert .ledger-value { color: var(--st-failed); }
.ledger-item-alert.is-zero .ledger-value { color: var(--ink); }

/* ---------- Grafico (SVG generato da JS) -------------------------------- */
.chart { width: 100%; min-height: 220px; }
.chart svg { display: block; width: 100%; height: 240px; }
.chart .bar-sent { fill: var(--st-sent); }
.chart .bar-pending { fill: var(--st-pending); opacity: 0.55; }
.chart .bar-failed { fill: var(--st-failed); }
.chart .axis { stroke: var(--line); }
.chart .tick { fill: var(--muted); font-size: 11px; font-family: var(--font-ui); }
.legend { display: flex; gap: 1rem; list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 0.35rem; }
.dot { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.dot-sent { background: var(--st-sent); }
.dot-pending { background: var(--st-pending); opacity: 0.55; }
.dot-failed { background: var(--st-failed); }

/* ---------- Stati -------------------------------------------------------- */
.status {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.1rem 0.5rem; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 600; white-space: nowrap;
  color: var(--st-pending); background: var(--st-pending-bg);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status[data-tone="ok"] { color: var(--st-sent); background: var(--st-sent-bg); }
.status[data-tone="warn"] { color: var(--st-deferred); background: var(--st-deferred-bg); }
.status[data-tone="bad"] { color: var(--st-failed); background: var(--st-failed-bg); }
.status[data-tone="off"] { color: var(--muted); background: var(--line-soft); }

/* ---------- Tabelle ------------------------------------------------------ */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th {
  text-align: left; font-weight: 600; color: var(--muted);
  padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: var(--panel);
}
.table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover tbody tr { cursor: pointer; }
.table-hover tbody tr:hover td { background: var(--navy-tint); }
.table-compact td, .table-compact th { padding: 0.4rem 0.5rem; }
.table th.num { text-align: right; }
.col-check { width: 2.25rem; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions > * { vertical-align: middle; }
.response { max-width: 28rem; color: var(--ink-soft); }

/* ---------- Bottoni e form ---------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font: inherit; font-weight: 600; font-size: var(--fs-sm);
  padding: 0.5rem 0.9rem; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  cursor: pointer; text-decoration: none; line-height: 1.2;
}
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-hover); border-color: var(--navy-hover); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary, .btn-primary:hover { color: #0e1422; } }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--line-soft); border-color: transparent; }
.btn-sm { padding: 0.32rem 0.65rem; }
.btn-xs { padding: 0.12rem 0.45rem; font-size: var(--fs-xs); }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; min-width: 0; }
.field > span { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-soft); }
.field small { font-size: var(--fs-xs); }
.field-grow { flex: 1 1 14rem; }
.field-row { display: flex; gap: 0.5rem; align-items: flex-end; }
.at { padding-bottom: 1.55rem; color: var(--muted); font-weight: 600; }
input, select {
  font: inherit; font-size: var(--fs-sm); color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 0.5rem 0.6rem; min-width: 0; width: 100%;
}
input[type="checkbox"] { width: auto; accent-color: var(--navy); }
input:focus, select:focus { outline: 2px solid var(--navy); outline-offset: -1px; border-color: transparent; }
.check { display: flex; align-items: center; gap: 0.5rem; font-size: var(--fs-sm); margin-bottom: 0.6rem; cursor: pointer; }
.form-error { color: var(--st-failed); font-size: var(--fs-sm); font-weight: 500; }

.filters {
  display: flex; flex-wrap: wrap; gap: 0 0.75rem; align-items: flex-end;
  margin-bottom: 1rem;
}
.filters .field { margin-bottom: 0.75rem; flex: 0 1 10rem; }
.filters .field-grow { flex: 1 1 16rem; }
.filters .btn { margin-bottom: 0.75rem; }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--panel); }
.segmented button {
  font: inherit; font-size: var(--fs-sm); font-weight: 500; padding: 0.4rem 0.8rem;
  border: 0; background: transparent; color: var(--ink-soft); cursor: pointer;
}
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--panel); }

.bulkbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.6rem 1rem; margin-bottom: 0.75rem;
  background: var(--navy-tint); border: 1px solid var(--navy); border-radius: var(--r-md);
  font-size: var(--fs-sm);
}
.bulkbar .check { margin: 0; }

.pager { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; border-top: 1px solid var(--line-soft); }
.pager-buttons { display: flex; gap: 0.5rem; }

.empty { padding: 1.5rem 1rem; color: var(--muted); text-align: center; margin: 0; }
.empty-state { padding: 2.5rem 1.5rem; text-align: center; max-width: 34rem; margin: 0 auto; }
.empty-state p { color: var(--ink-soft); }

/* ---------- Liste -------------------------------------------------------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line-soft); }
.list-item:last-child { border-bottom: 0; }
.list-main { display: flex; flex-direction: column; min-width: 0; flex: 1; text-decoration: none; color: inherit; }
.list-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-plain li { padding: 0.2rem 0; }

/* ---------- Menu a tendina (details) ------------------------------------- */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 13rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-pop); padding: 0.3rem; display: grid; text-align: left;
}
.menu-list button {
  font: inherit; font-size: var(--fs-sm); text-align: left; padding: 0.45rem 0.6rem;
  background: none; border: 0; border-radius: var(--r-sm); color: var(--ink); cursor: pointer;
}
.menu-list button:hover { background: var(--line-soft); }
.menu-list .danger { color: var(--st-failed); }

/* ---------- Dialog: modale e drawer --------------------------------------- */
dialog { color: var(--ink); background: var(--panel); border: 1px solid var(--line); padding: 0; }
dialog::backdrop { background: rgba(15, 21, 33, 0.45); }
.modal { width: min(94vw, 520px); border-radius: var(--r-md); box-shadow: var(--shadow-pop); }
.modal-sm { width: min(94vw, 420px); }
.modal-lg { width: min(94vw, 620px); }
.modal form { padding: 1.5rem; }
.modal h2 { margin-bottom: 1rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.25rem; }

.drawer {
  margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(100vw, 760px);
  border: 0; border-left: 1px solid var(--line); box-shadow: var(--shadow-pop);
}
.drawer[open] { display: flex; flex-direction: column; animation: drawer-in 180ms ease-out; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: var(--fs-lg); margin-top: 0.4rem; overflow-wrap: anywhere; }
.drawer-body { padding: 1.25rem 1.5rem 2rem; overflow-y: auto; flex: 1; }
.drawer-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }

.meta { display: grid; grid-template-columns: 10rem 1fr; gap: 0.35rem 1rem; margin: 0 0 1rem; font-size: var(--fs-sm); }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; overflow-wrap: anywhere; }
.meta-tight { grid-template-columns: 8rem 1fr; }

.notice { padding: 0.6rem 0.8rem; border-radius: var(--r-sm); background: var(--st-deferred-bg); color: var(--st-deferred); font-size: var(--fs-sm); }
.notice-error { background: var(--st-failed-bg); color: var(--st-failed); overflow-wrap: anywhere; }

/* Cronologia: è davvero una sequenza, quindi una linea verticale ha senso */
.timeline { list-style: none; margin: 0 0 1.25rem; padding: 0 0 0 1rem; border-left: 2px solid var(--line); }
.timeline-item { position: relative; padding: 0 0 0.85rem 0.75rem; display: grid; gap: 0.1rem; }
.timeline-item::before {
  content: ""; position: absolute; left: -1.37rem; top: 0.35rem;
  width: 10px; height: 10px; border-radius: 50%; background: var(--panel); border: 2px solid var(--st-pending);
}
.timeline-item[data-tone="ok"]::before { border-color: var(--st-sent); background: var(--st-sent); }
.timeline-item[data-tone="warn"]::before { border-color: var(--st-deferred); }
.timeline-item[data-tone="bad"]::before { border-color: var(--st-failed); background: var(--st-failed); }
.timeline-event { font-weight: 600; font-size: var(--fs-sm); }
.timeline-detail { color: var(--ink-soft); overflow-wrap: anywhere; }

.headers { margin: 1rem 0; }
.headers summary { cursor: pointer; font-weight: 600; font-size: var(--fs-sm); margin-bottom: 0.5rem; }
.headers th { width: 11rem; vertical-align: top; color: var(--ink-soft); }

/* ---------- DNS ----------------------------------------------------------- */
.dns-list { display: grid; gap: 0.9rem; margin-top: 1rem; }
.dns-item { border: 1px solid var(--line); border-radius: var(--r-md); padding: 0.9rem 1rem; }
.dns-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.dns-kind { font-weight: 700; }
.dns-item code { background: var(--line-soft); padding: 0.1rem 0.3rem; border-radius: 3px; }

.secret { display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.75rem; background: var(--line-soft); border-radius: var(--r-sm); margin-bottom: 0.75rem; }
.secret code { flex: 1; font-size: var(--fs-base); }
.code {
  font-family: var(--font-mono); font-size: var(--fs-xs); background: var(--line-soft);
  padding: 0.75rem; border-radius: var(--r-sm); overflow-x: auto; white-space: pre; margin: 0;
}

/* ---------- Documentazione ----------------------------------------------- */
.docs { display: grid; grid-template-columns: 15rem 1fr; gap: 1.5rem; align-items: start; }
.docs-toc {
  position: sticky; top: 1rem; align-self: start;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 0.9rem 1rem;
}
.docs-toc-title { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-soft); margin: 0 0 0.5rem; }
.docs-toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.docs-toc a { color: var(--ink-soft); text-decoration: none; font-size: var(--fs-sm); display: block; padding: 0.15rem 0; }
.docs-toc a:hover { color: var(--accent); }
.docs-body { display: grid; gap: 1.25rem; min-width: 0; }
.docs-body .doc-section { scroll-margin-top: 1rem; }
.docs-body h2 { margin: 0 0 0.75rem; font-size: var(--fs-lg); }
.docs-body h3 { margin: 1.25rem 0 0.5rem; font-size: var(--fs-md); }
.docs-body p, .docs-body li { line-height: 1.55; }
.docs-body ul { padding-left: 1.2rem; display: grid; gap: 0.3rem; }
.docs-body code { font-family: var(--mono, monospace); font-size: 0.9em; background: var(--line-soft); padding: 0.05rem 0.3rem; border-radius: 4px; }
.code-wrap { position: relative; }
.code-wrap .code-copy { position: absolute; top: 0.4rem; right: 0.4rem; }
pre.code {
  background: var(--ink); color: var(--panel); padding: 0.9rem 1rem; border-radius: var(--r-md);
  overflow-x: auto; font-family: var(--mono, monospace); font-size: var(--fs-sm); line-height: 1.5; margin: 0.5rem 0;
}
pre.code code { background: none; padding: 0; color: inherit; }
@media (max-width: 820px) {
  .docs { grid-template-columns: 1fr; }
  .docs-toc { position: static; }
}

/* ---------- Toast -------------------------------------------------------- */
.toasts { position: fixed; bottom: 1.25rem; right: 1.25rem; display: grid; gap: 0.5rem; z-index: 100; }
.toast {
  background: var(--ink); color: var(--panel); padding: 0.65rem 1rem; border-radius: var(--r-md);
  font-size: var(--fs-sm); box-shadow: var(--shadow-pop); max-width: 26rem;
  animation: toast-in 160ms ease-out;
}
.toast[data-tone="bad"] { background: var(--st-failed); color: #fff; }
.toast[data-tone="ok"] { background: var(--st-sent); color: #fff; }
.toast[data-tone="warn"] { background: var(--st-deferred); color: #1a1a1a; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Responsive ---------------------------------------------------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; grid-template-columns: 1fr; grid-template-rows: 6px auto; }
  .sidebar-inner { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem; }
  .brand { padding: 0 0.75rem 0 0; }
  .nav { display: flex; flex-wrap: wrap; }
  .sidebar-foot { margin: 0 0 0 auto; border: 0; padding: 0; grid-auto-flow: column; align-items: center; }
  #admin-email { display: none; }
  .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger-item:nth-child(3) { padding-left: 0; border-left: 0; }
  .ledger-item:nth-child(n+3) { border-top: 1px solid var(--line); }
  .meta { grid-template-columns: 1fr; gap: 0 0; }
  .meta dd { margin-bottom: 0.5rem; }
  .truncate { max-width: 12rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
