/* The Control Center dashboard: light, quiet, one blue accent, green status dots. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #1f2933;
  --ink-2: #52606d;
  --ink-3: #7b8794;
  --line: #e1e5ea;
  --line-2: #cfd6de;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --accent-soft: #eef3fe;
  --good: #16a34a;
  --good-soft: #ecf8f0;
  --bad: #dc2626;
  --bad-soft: #fdf0f0;
  --wait: #d97706;
  --wait-soft: #fdf6ea;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 8px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 12px; }
h2 { font-size: 16px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
code, pre { font-family: var(--mono); font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }

/* top bar */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { font-weight: 650; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 14px; height: 14px; border-radius: 4px; background: var(--accent); display: inline-block; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a, .linkish { color: var(--ink-2); padding: 6px 10px; border-radius: 6px; font: inherit; }
.nav a[aria-current="page"] { color: var(--ink); background: var(--bg); }
.nav a:hover, .linkish:hover { color: var(--ink); text-decoration: none; background: var(--bg); }
.nav .nav-add { color: var(--accent); }
.linkish { background: none; border: 0; cursor: pointer; }

/* page */
.page { max-width: 1180px; margin: 0 auto; padding: 20px 16px 48px; }
.page-title { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.section-title { font-size: 15px; color: var(--ink-2); margin: 28px 0 10px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.section-head h2, .section-head .section-title { margin-bottom: 0; }
.section-head.spaced { margin: 28px 0 10px; }
.section-head.spaced .section-title { margin: 0; }
.table .nowrap { white-space: nowrap; }
.eyebrow { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.lead { color: var(--ink-2); }
.under { text-align: center; color: var(--ink-3); font-size: 13px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card.narrow { max-width: 460px; margin: 40px auto 16px; padding: 24px; }
.card.highlight { border-color: var(--accent); background: var(--accent-soft); }
.card.empty { color: var(--ink-3); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid > .card { margin-bottom: 0; }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.panel-card h2 { margin: 0; }

/* stats */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat-label { color: var(--ink-3); font-size: 13px; margin: 0; }
.stat-value { font-size: 26px; font-weight: 650; margin: 2px 0; }
.stat-value.small-value { font-size: 17px; padding: 6px 0 5px; }
.stat-note { color: var(--ink-3); font-size: 13px; margin: 0; }

/* site cards */
.site-card { display: flex; flex-direction: column; }
.site-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.site-card-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.site-card .actions { margin-top: auto; padding-top: 10px; }
.problems { color: var(--bad); font-size: 13px; }
.add-card { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; border-style: dashed; border-color: var(--line-2); min-height: 200px; color: var(--ink); }
.add-card:hover { text-decoration: none; border-color: var(--accent); }
.add-plus { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 22px; line-height: 36px; }
.add-title { font-weight: 600; }

/* dots, chips, badges */
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; background: var(--ink-3); }
.dot.good { background: var(--good); }
.dot.bad { background: var(--bad); }
.dot.wait { background: var(--wait); }
.chip { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); background: var(--surface); }
.chip.good { border-color: #b7e3c6; color: #166534; background: var(--good-soft); }
.chip.bad { border-color: #f3c2c2; color: #991b1b; background: var(--bad-soft); }
.badge { font-size: 12px; padding: 1px 7px; border-radius: 4px; flex: none; }
.badge.good { color: #166534; background: var(--good-soft); }
.badge.bad { color: #991b1b; background: var(--bad-soft); }
.badge.wait { color: #92400e; background: var(--wait-soft); }

/* facts */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 10px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts.compact { font-size: 14px; gap: 3px 12px; }
.problems-list { color: var(--bad); margin: 0; padding-left: 18px; }

/* buttons and forms */
.button { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 6px; font: inherit; font-weight: 550; cursor: pointer; }
.button:hover { text-decoration: none; filter: brightness(.95); }
.button.quiet { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.button.quiet:hover { border-color: var(--ink-3); }
.button.small { padding: 5px 10px; font-size: 13px; }
.button[disabled] { opacity: .5; cursor: not-allowed; }
.inline { display: inline; margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.stack > label, .stack > .value-row, .stack > fieldset { width: 100%; }
.fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 10px; }
label { color: var(--ink-2); font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
input[type="text"], input[type="password"], input[type="number"], select {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; padding: 7px 10px; min-width: 0; max-width: 100%;
}
input:focus, select:focus, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.input-two { font-size: 28px; width: 4.5ch; text-align: center; letter-spacing: .1em; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 0; }
legend { color: var(--ink-2); font-size: 14px; padding: 0 4px; }
.choices { display: grid; gap: 6px; }
.choices.two { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.choice { flex-direction: row; align-items: flex-start; gap: 8px; color: var(--ink); }
.choice input { margin-top: 4px; }
.inline-choice { margin-top: 4px; }
.value-row { border-top: 1px solid var(--line); padding-top: 10px; }
.value-row label:first-child { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }
.value-row input[type="text"], .value-row input[type="password"] { width: 100%; max-width: 420px; margin-top: 4px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-actions { display: flex; gap: 10px; align-items: center; }

/* panels */
.panel { border: 1px solid var(--line); background: var(--bg); border-radius: 6px; padding: 10px 12px; }
.panel p:last-child { margin: 0; }
.panel.good { border-color: #b7e3c6; background: var(--good-soft); }
.panel.bad { border-color: #f3c2c2; background: var(--bad-soft); }
.panel.warn { border-color: #f1d5a5; background: var(--wait-soft); }

/* flash */
.flashes { margin-bottom: 16px; display: grid; gap: 8px; }
.flash { margin: 0; padding: 10px 12px; border-radius: 6px; border: 1px solid; }
.flash.good { border-color: #b7e3c6; background: var(--good-soft); color: #14532d; }
.flash.bad { border-color: #f3c2c2; background: var(--bad-soft); color: #7f1d1d; }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 10px; }
.table th { text-align: left; color: var(--ink-3); font-weight: 500; border-bottom: 1px solid var(--line); padding: 6px 8px; }
.table td { border-bottom: 1px solid var(--line); padding: 8px; vertical-align: top; overflow-wrap: anywhere; }
.table tr:last-child td { border-bottom: 0; }

/* audit rows */
.rows { list-style: none; padding: 0; }
.rows.card { padding: 0; }
.row { border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row summary { list-style: none; cursor: pointer; padding: 10px 14px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row summary::-webkit-details-marker { display: none; }
.row summary:hover { background: var(--bg); }
.row-main { display: flex; gap: 8px; align-items: center; min-width: 0; flex-wrap: wrap; }
.row-main .site { color: var(--ink-2); }
.row-main .summary { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
.row-meta { color: var(--ink-3); font-size: 13px; }
.row-body { padding: 4px 14px 14px; border-top: 1px dashed var(--line); background: #fbfcfd; }
.label { color: var(--ink-3); font-size: 13px; margin: 8px 0 4px; }
pre.code { background: #f3f5f8; border: 1px solid var(--line); border-radius: 6px; padding: 10px; overflow: auto; max-height: 360px; margin: 0 0 10px; white-space: pre; }
pre.code.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
pre.log { max-height: 560px; }

/* site page */
.site-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.site-head .page-title { margin-bottom: 2px; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 12px; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--ink); }

/* add site */
.steps { list-style: none; padding: 0; margin: 0 0 16px; display: flex; gap: 8px; flex-wrap: wrap; counter-reset: none; }
.steps li { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-3); font-size: 14px; }
.steps li.current { border-color: var(--accent); color: var(--ink); }
.steps li.done { color: var(--ink-2); }
.step-n { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center; background: var(--bg); border: 1px solid var(--line-2); font-size: 12px; margin-right: 8px; color: var(--ink-2); }
.steps li .step-n { margin-right: 0; }
.steps li.current .step-n { background: var(--accent); border-color: var(--accent); color: #fff; }
.steps li.done .step-n { background: var(--good-soft); border-color: #b7e3c6; color: #166534; }
.log-steps { list-style: none; padding: 0; margin: 0 0 10px; }
.log-steps li { display: grid; grid-template-columns: 14px minmax(110px, max-content) 1fr auto; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); }
.log-steps li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); align-self: center; }
.log-steps li.good::before { background: var(--good); }
.log-steps li.bad::before { background: var(--bad); }
.log-steps li.wait::before { background: var(--wait); }
.step-name { font-family: var(--mono); font-size: 13px; }
.step-detail { color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }

/* sign in */
.code-label { color: var(--ink-3); margin: 0; }
.code-big { font-size: 56px; font-weight: 700; letter-spacing: .12em; margin: 0 0 8px; color: var(--accent); }
.waiting { color: var(--ink-2); }

@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav { margin-left: 0; width: 100%; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dt { margin-top: 6px; }
  .log-steps li { grid-template-columns: 14px 1fr; }
  .log-steps li .step-detail, .log-steps li .muted { grid-column: 2; }
  .row-main .summary { max-width: 100%; white-space: normal; }
  .table thead { display: none; }
  .table tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
  .table td { display: block; border: 0; padding: 3px 0; }
  .card.narrow { margin-top: 16px; }
}
