/* Neutral graphite ramp. The "accent" is the text colour itself; green only means "online". */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #171717;
  --muted: #666666;
  --line: #e6e6e6;
  --accent: #171717;
  --accent-text: #ffffff;
  --accent-soft: #f4f4f5;
  --positive: #15803d;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --warn: #a16207;
  --radius: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141415;
    --surface: #19191b;
    --text: #ededed;
    --muted: #a1a1a6;
    --line: #2c2c2f;
    --accent: #ededed;
    --accent-text: #141415;
    --accent-soft: #232325;
    --positive: #4cc38a;
    --danger: #e5484d;
    --danger-soft: #3a1d1f;
    --warn: #e4b45a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
code { font-family: var(--mono); font-size: .92em; }
h1, h2 { line-height: 1.2; margin: 0; font-weight: 500; }
h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); text-wrap: balance; }
h2 { font-size: 1.125rem; }
p { margin: 0; }

.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 920px; margin: 0 auto; padding: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 500; color: var(--text); text-decoration: none; }
.logo {
  width: 28px; height: 28px; border-radius: 8px; background: var(--accent);
  background-image: linear-gradient(var(--accent-text), var(--accent-text)), linear-gradient(var(--accent-text), var(--accent-text)), linear-gradient(var(--accent-text), var(--accent-text));
  background-size: 16px 2px, 16px 2px, 10px 2px;
  background-position: 6px 8px, 6px 13px, 6px 18px;
  background-repeat: no-repeat;
}
#account { display: flex; align-items: center; gap: 12px; }

main { max-width: 920px; margin: 0 auto; padding: 0 16px 64px; display: grid; gap: 32px; }

/* Sections are flat: a hairline and space between them, no frames. */
.card { display: grid; gap: 16px; min-width: 0; padding-top: 32px; border-top: 1px solid var(--line); }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hint { color: var(--muted); font-size: .875rem; }
.error { color: var(--danger); }
.lead { color: var(--muted); font-size: 1.0625rem; max-width: 34rem; }

/* Sign-in: text left, Clerk's box right; stacked on phones. */
.signin { display: grid; gap: 32px; align-items: center; min-height: 72vh; padding: 32px 0; }
.signin-text { display: grid; gap: 16px; align-content: center; }
@media (min-width: 800px) { .signin { grid-template-columns: 1fr auto; gap: 48px; } }

label { display: grid; gap: 4px; font-size: .875rem; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
input:not([type]), input[type="text"], input[type="password"] {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; min-width: 0;
}
input:focus-visible, button:focus-visible, .button:focus-within, .drop:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

button, .button {
  font: inherit; font-size: .9375rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 8px 16px;
  transition: border-color 150ms var(--ease), transform 150ms var(--ease);
}
button:hover, .button:hover { border-color: var(--muted); }
button:active, .button:active { transform: scale(0.98); }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 500; }
button.danger { color: var(--danger); }
button.danger:hover { border-color: var(--danger); }
button:disabled { opacity: .5; cursor: default; }
button.small { padding: 4px 8px; font-size: .8125rem; border-radius: 6px; border-color: transparent; background: none; color: var(--muted); }
button.small:hover { border-color: transparent; background: var(--accent-soft); color: var(--text); }
button.small.danger:hover { background: var(--danger-soft); color: var(--danger); }

.address-input {
  display: flex; align-items: stretch; max-width: 30rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); overflow: hidden;
}
.address-input input { border: 0; border-radius: 0; flex: 1; font-family: var(--mono); background: transparent; }
.address-input input:focus-visible { outline: none; }
.address-input:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.suffix { font-family: var(--mono); color: var(--muted); padding: 8px 12px 8px 0; white-space: nowrap; }

.site-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 8px; }
.eyebrow { color: var(--muted); font-size: .875rem; }
.site-link { font-family: var(--mono); font-size: clamp(1.125rem, 3.5vw, 1.625rem); font-weight: 500; word-break: break-all; }

/* Signature: one status dot, the same everywhere (site, versions, admin). */
.status { display: inline-flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--positive); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.status.off { color: var(--danger); }
.status.empty { color: var(--muted); }
.status.empty::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }

.drop {
  border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 24px 16px;
  display: grid; gap: 8px; justify-items: center; text-align: center;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease);
}
.drop .row { margin-top: 4px; justify-content: center; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop.busy { opacity: .6; pointer-events: none; }
.drop-title { font-weight: 500; }

.upload-result { font-size: .9375rem; color: var(--muted); }
.upload-result.ok { color: var(--positive); }
.upload-result.fail { color: var(--danger); }
.upload-result ul { margin: 8px 0 0; padding-left: 20px; font-family: var(--mono); font-size: .8125rem; }

.rules summary { cursor: pointer; color: var(--muted); font-size: .875rem; }
.rules ul { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: .875rem; }

.versions { list-style: none; margin: 0; padding: 0; }
.versions li {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 4px 16px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.versions li:first-child { border-top: 0; padding-top: 0; }
.versions li.muted { display: block; } /* the "no versions yet" line, not a grid row */
.v-num { font-family: var(--mono); font-weight: 500; }
.v-when { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.v-meta { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.v-actions { display: flex; gap: 8px; }
@media (max-width: 560px) {
  .versions li { grid-template-columns: 48px 1fr; }
  .v-actions { grid-column: 2; }
}

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .875rem; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: .8125rem; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); }
td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
td .person { display: grid; }
td .person small { color: var(--muted); }
td .actions { display: flex; gap: 4px; justify-content: flex-end; }

.usage { display: grid; gap: 8px; color: var(--muted); }
.usage .row span:last-child { font-variant-numeric: tabular-nums; }
.meter { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.meter div {
  height: 100%; width: 100%; background: var(--accent);
  transform-origin: left; transform: scaleX(0); transition: transform 400ms var(--ease);
}
.meter div.warn { background: var(--warn); }
.meter div.full { background: var(--danger); }

.mail-address { font-family: var(--mono); font-weight: 500; word-break: break-all; }
.settings { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-size: .875rem; }
.settings dt { color: var(--muted); }
.settings dd { margin: 0; font-family: var(--mono); word-break: break-all; }
