/* ==========================================================================
   19216811.org dashboard stylesheet
   Cloudflare-dashboard-style frame. Copy verbatim. Do not add gradients,
   shadows on cards, emojis, purple, or web fonts.
   ========================================================================== */

:root {
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --bg: #ffffff;
  --bg-sidebar: #f8f8f8;
  --bg-subtle: #f9f9fa;
  --bg-hover: #f1f2f3;
  --bg-active: #ebecee;

  --border: #e3e4e6;
  --border-strong: #c9cbcf;

  --text: #1d1d1f;
  --text-2: #5f6368;
  --text-3: #8a8d93;

  --blue: #0051c3;
  --blue-hover: #003e99;
  --blue-bg: #eaf1fb;
  --blue-border: #b6cef2;

  --green: #1a7f37;
  --red: #c62828;
  --amber: #9a6700;

  --topbar-h: 56px;
  --sidebar-w: 280px;
  --content-max: 1180px;
  --radius: 8px;
  --radius-sm: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p, ul, ol { margin: 0; }
svg { display: inline-block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

code, .mono { font-family: var(--font-mono); font-size: 0.92em; }
code {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px 0 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar__left, .topbar__right { display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 600; font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 22px; height: 22px; border-radius: 5px; background: var(--blue); display: inline-block; }
.topbar__divider { width: 1px; height: 24px; background: var(--border); }
.topbar__ctx { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.topbar__ctx-name { font-weight: 600; font-family: var(--font-mono); }
.topbar__link { color: var(--text); font-size: 14px; }
.topbar__link:hover { color: var(--blue); text-decoration: none; }

.tag {
  display: inline-flex; align-items: center;
  font-size: 11.5px; line-height: 1;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
  background: var(--bg);
}
.tag--new { color: var(--blue); border-color: var(--blue-border); background: var(--blue-bg); margin-left: auto; }

/* ---------- Frame ---------- */
.frame { display: flex; min-height: calc(100vh - var(--topbar-h)); }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
}
.sidebar__search {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 10px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  margin-bottom: 14px;
}
.sidebar__search input {
  flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: var(--text); outline: none;
}
.sidebar__search kbd { font: 11px/1 var(--font-ui); color: var(--text-3); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 38px; padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px; text-align: left;
}
.nav__item:hover { background: var(--bg-hover); text-decoration: none; }
.nav__item--active { background: var(--bg-active); font-weight: 500; }
.nav__icon { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: var(--text-2); }
.nav__chev { width: 14px; height: 14px; margin-left: auto; fill: none; stroke: currentColor; stroke-width: 1.8; color: var(--text-3); transition: transform 120ms; }
.nav__item--group[aria-expanded="true"] .nav__chev { transform: rotate(90deg); }
.nav__sub { display: none; flex-direction: column; margin: 2px 0 6px 0; padding-left: 26px; border-left: 0; }
.nav__item--group[aria-expanded="true"] + .nav__sub { display: flex; }
.nav__subitem {
  display: block; height: 32px; line-height: 32px; padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 13.5px; font-family: var(--font-mono);
}
.nav__subitem:hover { background: var(--bg-hover); text-decoration: none; }
.nav__subitem--active { background: var(--bg-active); font-weight: 500; }
.nav__subitem--more { font-family: var(--font-ui); color: var(--blue); }

/* ---------- Content ---------- */
.content {
  flex: 1; min-width: 0;
  padding: 28px 32px 40px;
  max-width: calc(var(--content-max) + 64px);
}

.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--text-3); margin-bottom: 10px; }
.crumbs a { color: var(--text-2); }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-head__title { display: flex; align-items: center; gap: 10px; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.page-head__icon { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: var(--text-2); }
.page-head__sub { margin-top: 6px; font-size: 15px; color: var(--text-2); }
.page-head__actions { display: flex; gap: 10px; flex-shrink: 0; padding-top: 22px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  font-size: 14px; font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background 120ms, border-color 120ms;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-hover); }
.btn--secondary { background: var(--bg); color: var(--text); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--bg-hover); }
.btn--icon { width: 36px; padding: 0; display: none; border-color: var(--border-strong); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* ---------- Layout grid ---------- */
.grid--main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* ---------- Toolbar / segmented ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.toolbar__meta { font-size: 12px; color: var(--text-3); letter-spacing: 0.02em; text-transform: uppercase; }
.segmented { display: inline-flex; padding: 3px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.segmented__item { height: 32px; padding: 0 14px; border-radius: 4px; font-size: 14px; color: var(--text-2); font-family: var(--font-mono); }
.segmented__item--active { background: var(--bg); color: var(--text); border: 1px solid var(--border-strong); font-weight: 500; }

/* ---------- Card ---------- */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.card--flush { padding: 0; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card--flush .card__head { padding: 16px 22px; margin: 0; }
.card__head--bordered { border-bottom: 1px solid var(--border); }
.card__title { font-size: 15px; font-weight: 600; }
.card__meta { font-size: 13px; color: var(--text-3); }
.card__text { font-size: 14px; color: var(--text-2); margin-top: 6px; }
.card__action { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; }
.card__action svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* ---------- Summary (two columns of icon + line) ---------- */
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.summary__col { list-style: none; padding: 0; display: flex; flex-direction: column; }
.summary__col li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; font-size: 14.5px; }
.summary__col li + li { border-top: 1px solid var(--border); }
.summary__col svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 1.6; color: var(--text-2); }
.summary__col:first-child { border-right: 1px solid var(--border); padding-right: 32px; }

/* ---------- Metrics row ---------- */
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); }
.metric { padding: 18px 22px; }
.metric + .metric { border-left: 1px solid var(--border); }
.metric__label { font-size: 13.5px; color: var(--text-2); border-bottom: 1px dashed var(--border-strong); display: inline-block; margin-bottom: 8px; }
.metric__value { font-size: 24px; font-weight: 600; line-height: 1.1; }
.metric__note { font-size: 12.5px; color: var(--text-3); margin-top: 8px; }

/* ---------- Steps ---------- */
.steps { list-style: none; padding: 0; display: flex; flex-direction: column; }
.step { display: flex; gap: 14px; padding: 14px 0; }
.step + .step { border-top: 1px solid var(--border); }
.step__num {
  flex: 0 0 26px; width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); border-radius: 50%;
  font-size: 13px; font-weight: 600; color: var(--text-2); font-family: var(--font-mono);
}
.step__title { font-size: 14.5px; font-weight: 600; margin-bottom: 3px; }
.step__text { font-size: 14px; color: var(--text-2); }

/* ---------- Callout ---------- */
.callout {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 16px; padding: 12px 14px;
  background: var(--blue-bg); border: 1px solid var(--blue-border); border-radius: var(--radius-sm);
  font-size: 13.5px;
}
.callout svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.6; color: var(--blue); }

/* ---------- Filter bar ---------- */
.filterbar { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-bottom: 1px solid var(--border); background: var(--bg); }
.filterbar__spacer { flex: 1; }
.select {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 10px;
  height: 36px; min-width: 170px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text-2); background: var(--bg);
}
.select svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
.check input { width: 16px; height: 16px; accent-color: var(--text); margin: 0; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-weight: 600; font-size: 13.5px; color: var(--text);
  padding: 12px 22px; background: var(--bg-subtle); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 14px 22px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--bg-subtle); }
.cell-primary { font-weight: 600; font-size: 14.5px; }
.cell-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.cell-muted { color: var(--text-3); }
.cell-action { text-align: right; white-space: nowrap; }
.pill {
  display: inline-block; padding: 4px 9px; font-size: 12.5px; line-height: 1.2;
  background: var(--bg-hover); border-radius: 999px; color: var(--text); white-space: nowrap;
}

/* ---------- Prose ---------- */
.prose { max-width: 72ch; font-size: 14.5px; line-height: 1.65; }
.prose p + p { margin-top: 12px; }
.prose h3 { font-size: 15px; font-weight: 600; margin: 20px 0 8px; }
.prose ul, .prose ol { padding-left: 20px; margin: 10px 0; }

/* ---------- FAQ ---------- */
.faq__item { border-bottom: 1px solid var(--border); }
.faq__item:last-child { border-bottom: 0; }
.faq__item summary { list-style: none; cursor: pointer; padding: 14px 22px; font-weight: 600; font-size: 14.5px; display: flex; justify-content: space-between; align-items: center; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: ""; width: 8px; height: 8px; border-right: 1.6px solid var(--text-3); border-bottom: 1.6px solid var(--text-3); transform: rotate(45deg); margin-right: 4px; transition: transform 120ms; }
.faq__item[open] summary::after { transform: rotate(-135deg); }
.faq__body { padding: 0 22px 16px; color: var(--text-2); font-size: 14px; max-width: 72ch; }

/* ---------- Right rail ---------- */
.rail { display: flex; flex-direction: column; gap: 20px; }
.rail__block { padding: 0 2px; }
.rail__title { font-size: 13px; font-weight: 600; color: var(--text-2); padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.rail__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.rail__label { color: var(--text-2); }
.rail__value { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.rail__link { display: block; padding: 7px 0; font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot--ok { background: var(--green); }

/* ---------- Footer ---------- */
.footer { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); }
.footer a { color: var(--text-2); margin-left: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .grid--main { grid-template-columns: 1fr; }
  .rail { flex-direction: row; flex-wrap: wrap; }
  .rail > * { flex: 1 1 260px; }
}
@media (max-width: 1024px) {
  .btn--icon { display: inline-flex; }
  .sidebar {
    position: fixed; left: 0; top: var(--topbar-h); z-index: 20;
    transform: translateX(-100%); transition: transform 160ms;
  }
  body.sidebar-open .sidebar { transform: none; }
  .content { padding: 20px 16px 32px; }
  .topbar__link { display: none; }
  .page-head { flex-direction: column; gap: 14px; }
  .page-head__actions { padding-top: 0; }
  .summary { grid-template-columns: 1fr; }
  .summary__col:first-child { border-right: 0; padding-right: 0; }
  .metrics { grid-template-columns: 1fr; }
  .metric + .metric { border-left: 0; border-top: 1px solid var(--border); }
  .toolbar { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 600px) {
  .topbar__ctx { display: none; }
  .page-head__title { font-size: 22px; }
  .filterbar { flex-wrap: wrap; }
  .select { min-width: 0; flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ==========================================================================
   Site additions (not part of design/dashboard.css; same variables, same naming)
   ========================================================================== */
.card__body { padding: 16px 22px 18px; }
.card__body + .filterbar { border-top: 1px solid var(--border); }
.card__body + .table-wrap { border-top: 1px solid var(--border); }
.prose img { display: block; max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius); margin: 14px 0; }
.prose .callout { margin-top: 14px; }
a.segmented__item { display: inline-flex; align-items: center; }
a.segmented__item:hover { text-decoration: none; color: var(--text); }
select.select { appearance: auto; padding-right: 8px; }
.filterbar__count { font-size: 13px; color: var(--text-3); white-space: nowrap; }
@media (max-width: 600px) {
  .segmented { flex-wrap: wrap; max-width: 100%; }
  .page-head__actions { flex-wrap: wrap; }
}
.metric__value--long { font-size: 17px; word-break: break-word; }
.grid--article .col { max-width: 760px; }
.rail__link--active { color: var(--text); font-weight: 500; }
@media (max-width: 1280px) {
  .grid--article .rail { display: none; }
}
.codeblock { font-family: var(--font-mono); font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-x: auto; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; margin: 12px 0; }
.codeblock .hl { color: var(--blue); font-weight: 600; }
/* list pages: search-type filter bar */
.filterbar__search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; flex: 1; min-width: 200px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg); color: var(--text-3); }
.filterbar__search svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.filterbar__search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: var(--text); outline: none; }
/* tools */
.metrics--2 { grid-template-columns: 1fr 1fr; }
.metrics--4 { grid-template-columns: repeat(4, 1fr); }
.card__body .metrics { margin: 0 -22px 14px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.btn--sm { height: 30px; padding: 0 10px; font-size: 13px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 14px; }
.kv > div { padding: 12px 16px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); margin: 0 -1px -1px 0; }
.kv__label { font-size: 12.5px; color: var(--text-2); }
.kv__value { font-weight: 500; margin-top: 2px; word-break: break-word; }
.tool__status { font-size: 14px; color: var(--text-2); margin: 12px 0; }
.tool__status.is-error { color: var(--red); }
.tool__note { font-size: 12.5px; color: var(--text-3); }
.tool__row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 14px; }
.tool__row .input { flex: 1 1 240px; width: auto; }
.tool__row input[type="range"] { flex: 1; min-width: 140px; max-width: 360px; accent-color: var(--blue); }
.input { height: 36px; padding: 0 10px; font: inherit; font-size: 14px; color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg); width: 100%; }
.gauge { position: relative; display: inline-block; margin: 16px 0 4px; max-width: 100%; }
.gauge svg { display: block; max-width: 100%; height: auto; }
.gauge__readout { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; }
.gauge__value { font-size: 24px; font-weight: 600; line-height: 1.1; }
.progress { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; margin: 10px 0; }
.progress > div { height: 100%; width: 0; background: var(--blue); transition: width 200ms; }
.tool__frame { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 8px; }
.tool__frame iframe { display: block; width: 100%; height: 500px; border: 0; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
a.pill:hover { text-decoration: none; background: var(--bg-active); }
.toast { position: fixed; bottom: 20px; right: 20px; z-index: 40; background: var(--text); color: #fff; font-size: 13px; padding: 8px 14px; border-radius: var(--radius-sm); }
@media (max-width: 1024px) {
  .metrics--2, .metrics--4 { grid-template-columns: 1fr; }
}
/* content fills the card; no narrow measure inside cards */
.prose, .faq__body { max-width: none; }
.grid--article .col { max-width: none; }
/* content area uses the full width right of the sidebar */
.content { max-width: none; }
.card:not(.card--flush) > .table-wrap { border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 12px 0; }
.card:not(.card--flush) > .table-wrap .table tbody tr:last-child td { border-bottom: 0; }
.card__body > .metrics:first-child { margin-top: -16px; border-top: 0; }
