/* avocdn admin · page scaffolding only.
   Every visible control comes from Basecoat + the avocloud theme (BRANDING.md §12.1).
   No colour or size is written here as a literal: if something needs a value, it is a
   token (§12.4). If a component has to be restyled in this file, the theme is incomplete. */

[hidden] { display: none !important; }

/* The UI theme is dark; without this the browser draws light scrollbars and form chrome. */
html { color-scheme: dark; }

/* ---- App frame --------------------------------------------------------- */
/* The rail column is the rail plus the gutter it sits in, so the surface never
   touches the viewport edge. --avo-rail-top keeps the sticky offset and the
   height cap in agreement (§9, Navigation). */
body {
  display: grid;
  grid-template-columns: calc(var(--avo-ui-rail-w) + var(--avo-space-4) * 2) minmax(0, 1fr);
  min-height: 100vh;
  --avo-rail-top: var(--avo-space-4);
}
.avo-rail { margin: var(--avo-space-4); display: flex; flex-direction: column; }
.main { display: flex; flex-direction: column; min-width: 0; }

.bar {
  display: flex; align-items: center; gap: var(--avo-space-3); flex-wrap: wrap;
  min-height: 56px;
  padding: var(--avo-space-3) var(--avo-space-5);
  border-bottom: 1px solid var(--avo-line-strong);
}
.bar .sp { margin-left: auto; }
.body { padding: var(--avo-space-5); display: flex; flex-direction: column; gap: var(--avo-space-4); }

/* ---- Rail furniture ---------------------------------------------------- */
.avo-rail a.brand {
  height: auto; gap: var(--avo-space-2);
  padding: 14px var(--avo-ui-pad-plate) var(--avo-space-2);
  text-transform: none; letter-spacing: 0;
}
.avo-rail a.brand:hover { background: none; }
.brand b, .login-brand b {
  font-family: var(--avo-font-wordmark); font-weight: 800;
  font-size: 0.95rem; color: var(--avo-text);
}
.brand b span, .login-brand b span { color: var(--avo-primary); }
.rail-foot {
  margin-top: auto;
  padding: var(--avo-space-4);
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--avo-space-2);
}
.rail-foot form { margin: 0; }

/* ---- Page parts -------------------------------------------------------- */
.page-title { margin: var(--avo-space-1) 0 var(--avo-space-1); }
.page-title .at { color: var(--avo-primary); }
.stack { display: flex; flex-direction: column; gap: var(--avo-ui-gap); min-width: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--avo-space-4); align-items: start; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--avo-space-4); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--avo-space-4); }
.tile { padding: var(--avo-space-4); position: relative; }
.tile .avo-kicker { margin-bottom: 6px; }
.tile .avo-stat { font-size: 1.9rem; }
.pad { padding: var(--avo-ui-pad-plate); position: relative; }
.flush { padding: 0; overflow: hidden; position: relative; }
.head { display: flex; align-items: center; gap: var(--avo-space-2); margin-bottom: var(--avo-space-2); }
.muted { color: var(--avo-text-muted); }
.submit-row { display: flex; align-items: center; gap: var(--avo-space-3); flex-wrap: wrap; }
.submit-row .avo-loader { flex: 0 0 120px; }

/* Rows hold text of any length: let a long path break instead of widening the page. */
.table td.path { font-family: var(--avo-font-mono); white-space: normal; overflow-wrap: anywhere; }
.table td.path .avo-small { font-family: var(--avo-font-ui); }
.table td.actions { white-space: nowrap; text-align: right; width: 1%; }
.table td .avo-small { white-space: normal; overflow-wrap: anywhere; }  /* Basecoat sets nowrap on every cell */
.table td.actions .btn { margin-left: var(--avo-space-1); }
.table td a { color: var(--avo-text); text-decoration: underline; text-decoration-color: var(--avo-line-strong); text-underline-offset: 3px; }
.table td a:hover { text-decoration-color: var(--avo-primary); }
.table td .badge { margin-left: var(--avo-space-2); }

/* A chart in this system is a printout: rectangles, coral series 1, no gradient (§9). */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 96px; }
.bars i { flex: 1; background: var(--avo-primary); display: block; min-width: 0; }
.bars i.n { background: var(--avo-surface-high); }
.chart-foot { display: flex; justify-content: space-between; gap: var(--avo-space-2); margin-top: var(--avo-space-2); }

/* Address and snippet blocks: flat, 1px outline, mono, never a plate (§5). */
.urls { display: flex; flex-direction: column; gap: var(--avo-space-2); margin-top: var(--avo-space-3); }
.urls > div { display: flex; flex-direction: column; align-items: flex-start; gap: var(--avo-space-1); }
.urls code { align-self: stretch; }
.urls code, .token, .snippet {
  font-family: var(--avo-font-mono); font-size: var(--avo-ui-num);
  color: var(--avo-text);
  background: var(--avo-canvas-soft);
  border: 1px solid var(--avo-line);
  border-radius: var(--avo-radius-sm);
  padding: var(--avo-space-1) var(--avo-space-2);
  overflow-wrap: anywhere;
}
.urls code b { color: var(--avo-primary); font-weight: 500; }
.snippet { display: block; padding: var(--avo-space-3); white-space: pre; overflow-x: auto; margin: 0; }
.token-row { display: flex; align-items: center; gap: var(--avo-space-3); flex-wrap: wrap; }
.token { flex: 1 1 280px; padding: var(--avo-space-2) var(--avo-space-3); user-select: all; }

.kv { width: 100%; border-collapse: collapse; font-size: var(--avo-ui-text); }
.kv td { padding: var(--avo-space-1) 0; border-bottom: 1px solid var(--avo-line); }
.kv td.num { text-align: right; font-family: var(--avo-font-mono); font-variant-numeric: tabular-nums; }

.label .req { color: var(--avo-primary); }

/* ---- Login / error (no rail) ------------------------------------------- */
body.login { display: block; }
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--avo-space-5); }
.login-plate { width: 100%; max-width: 420px; padding: var(--avo-space-5); position: relative; }
.login-brand { display: flex; align-items: center; gap: var(--avo-space-2); }
.login-brand b { font-size: 1.25rem; }
.login-plate .stack { gap: var(--avo-space-3); }

/* ---- Below the rail breakpoint ----------------------------------------- */
@media (max-width: 1100px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* 1024, not 760: iOS Safari's "Request Desktop Website" lays out at 980px, so
   anything below that leaves a phone on the two-column layout with the rail
   pinned over the content. */
@media (max-width: 1024px) {
  body { display: block; }
  /* Stacked, the rail is a strip across the top. Sticky and a viewport cap would
     pin a full-height band over the content instead (§9, Navigation). */
  .avo-rail {
    position: sticky; top: 0; z-index: var(--avo-z-rail);
    width: auto; max-height: none; height: auto;
    margin: 0; padding: 0; border-radius: 0; border: 0;
    border-bottom: 1px solid var(--avo-line-strong);
    display: flex; flex-direction: row; align-items: stretch;
    overflow-x: auto; overflow-y: hidden;
    overscroll-behavior-x: contain; scrollbar-width: none;
  }
  .avo-rail::-webkit-scrollbar { display: none; }
  /* Section kickers and the footer are rail furniture; across a row they are obstacles. */
  .avo-rail > .avo-kicker, .rail-foot { display: none; }
  .avo-rail a.brand { padding: 0 var(--avo-space-4); height: var(--avo-ui-row-h); }
  .avo-rail > a { white-space: nowrap; padding: 12px 14px; }
  .avo-rail > a.active, .avo-rail > a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--avo-primary); }
  .bar { padding-inline: var(--avo-space-4); }
  .bar .avo-crumbs { flex-basis: 100%; }
  .bar .sp { display: none; }
  .body { padding: var(--avo-space-4); }
}
@media (max-width: 480px) {
  .stats, .two { grid-template-columns: minmax(0, 1fr); }
}

/* The theme right-aligns any cell that sits directly before a numeric one
   (`td:has(+ .num)`), which turns a name column into a right-aligned column when
   a number follows it. BRANDING.md §9 says text left, numbers right; restore that. */
.table td:has(+ .num):not(.num) { text-align: left; font-family: inherit; font-variant-numeric: normal; }
