:root {
  --sky: #cfe5f6;
  --paper: #f4faff;
  --ink: #0e2b1f;
  --ink-soft: #3d5a4c;
  --field: #2f7d4e;
  --sun: #ffc62e;
  --soil: #8a4b2a;
  --line: #a9c9e0;
  --danger: #b3261e;
  --font: 'Bricolage Grotesque', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --sky: #0c1f18;
    --paper: #12291f;
    --ink: #e8f4ec;
    --ink-soft: #a6c2b2;
    --field: #4fae77;
    --line: #264a39;
    --soil: #e0956a;
    --danger: #ff8a80;
  }
}
* { box-sizing: border-box; }
html { color-scheme: light dark; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--sky); color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font); font-variation-settings: 'wdth' 92;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--field); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.05; margin: 0; letter-spacing: -0.02em; font-weight: 700; }
h2 { font-size: 1.75rem; }
p { margin: 0; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top, .foot, main { width: min(100% - 32px, 70rem); margin-inline: auto; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; text-decoration: none; letter-spacing: -0.02em; }
nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
main { flex: 1; padding-bottom: 64px; outline: none; }
.foot { display: flex; justify-content: space-between; gap: 16px; padding: 20px 0 32px; color: var(--ink-soft); font-size: 0.9rem; border-top: 1px solid var(--line); }

.btn, .btn-ghost {
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 2px solid var(--ink); background: var(--ink); color: var(--sky);
}
.btn:hover { background: var(--field); border-color: var(--field); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--sky); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: progress; }
.btn.small, .btn-ghost.small { padding: 5px 12px; font-size: 0.9rem; }
button.link { font: inherit; background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; }

/* Hero: the address is the interface */
.hero { padding: clamp(24px, 7vw, 80px) 0 40px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 4.2rem); max-width: 14ch; font-variation-settings: 'wdth' 80; }
.lede { margin-top: 16px; max-width: 34rem; font-size: 1.2rem; color: var(--ink-soft); }
.claim { margin-top: clamp(28px, 5vw, 56px); }
.url-line {
  display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 2px;
  border-bottom: 4px solid var(--ink); padding-bottom: 6px;
}
.url-line .pre, .url-line .suf { font-size: clamp(1rem, 2.4vw, 1.5rem); color: var(--ink-soft); font-weight: 500; }
.url-line input {
  flex: 1 1 8ch; min-width: 8ch; width: 100%; border: 0; background: transparent; color: var(--ink);
  font: 800 clamp(2.6rem, 10vw, 7rem)/1 var(--font); font-variation-settings: 'wdth' 78; letter-spacing: -0.04em;
  padding: 0; outline: none;
}
.url-line input::placeholder { color: color-mix(in srgb, var(--ink) 25%, transparent); }
.url-line:focus-within { border-bottom-color: var(--field); }
.claim-row { display: flex; align-items: center; gap: 20px; margin-top: 20px; flex-wrap: wrap; }
.status { display: inline-flex; align-items: center; gap: 10px; min-height: 2rem; font-weight: 500; }
.dot { width: 18px; height: 18px; border-radius: 50%; background: var(--line); transition: background .2s, transform .2s; }
.dot.ok { background: var(--sun); transform: scale(1.25); box-shadow: 0 0 0 5px color-mix(in srgb, var(--sun) 35%, transparent); }
.dot.bad { background: var(--soil); }
.limits { margin-top: 48px; display: flex; flex-wrap: wrap; gap: 8px 28px; color: var(--ink-soft); }
.limits b { color: var(--ink); font-weight: 700; }

/* Panels */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.stack > * + * { margin-top: 16px; }
.field { display: block; }
.field > span { display: block; font-weight: 600; margin-bottom: 6px; }
input, textarea, select {
  font: inherit; color: var(--ink); background: var(--sky); border: 2px solid var(--line); border-radius: 10px;
  padding: 10px 12px; width: 100%;
}
input:focus, textarea:focus { border-color: var(--field); outline: none; }
.auth { max-width: 26rem; margin: clamp(16px, 5vw, 56px) auto 0; }
.auth h2 { margin-bottom: 4px; }
.auth .sub { color: var(--ink-soft); margin-bottom: 20px; }
.error { color: var(--danger); font-weight: 600; min-height: 1.5em; }
.switch { margin-top: 18px; color: var(--ink-soft); }

.page-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin: 24px 0 20px; }
.page-head h1 { font-size: clamp(2rem, 5vw, 3rem); }
.rows { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); overflow: hidden; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 16px 20px; align-items: center; }
.row + .row { border-top: 1px solid var(--line); }
.row .name { font-weight: 700; font-size: 1.2rem; text-decoration: none; }
.row .name:hover { text-decoration: underline; }
.meta { color: var(--ink-soft); font-size: 0.92rem; }
.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; border: 1.5px solid var(--soil); color: var(--soil); font-size: 0.8rem; font-weight: 700; margin-left: 8px; vertical-align: middle; }
.empty { padding: 36px 20px; text-align: center; color: var(--ink-soft); }
.inline-form { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.inline-form input { flex: 1 1 14rem; width: auto; }

.site-url { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.site-url a { word-break: break-all; }
.drop {
  margin-top: 24px; border: 3px dashed var(--field); border-radius: 16px; padding: 32px 20px; text-align: center;
  background: color-mix(in srgb, var(--paper) 70%, transparent); transition: background .15s, border-color .15s;
}
.drop.over { background: color-mix(in srgb, var(--sun) 30%, var(--paper)); border-style: solid; border-color: var(--sun); }
.drop h3 { font-size: 1.4rem; margin-bottom: 6px; }
.drop .btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 18px 0 12px; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.check input { width: auto; accent-color: var(--field); }
progress { width: 100%; height: 10px; margin-top: 14px; accent-color: var(--field); }
.notes { margin-top: 14px; text-align: left; font-size: 0.92rem; color: var(--ink-soft); }
.notes summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.section-title { margin: 36px 0 12px; font-size: 1.3rem; }
.file { grid-template-columns: 1fr auto auto; }
.file .p { font-family: var(--mono); font-size: 0.92rem; word-break: break-all; }
.actions { display: flex; gap: 8px; }
.served h3 { font-size: 1.2rem; margin-bottom: 8px; }
.warn-list { margin: 10px 0 0; padding-left: 20px; color: var(--soil); font-size: 0.92rem; }
.warn-list li { margin-top: 4px; word-break: break-word; }
.notice { display: flex; justify-content: space-between; align-items: start; gap: 12px 16px; flex-wrap: wrap; border-color: var(--soil); }
.notice > div { flex: 1 1 24rem; }
.danger-zone { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.tab { font: inherit; font-weight: 600; background: none; border: 0; border-bottom: 3px solid transparent; padding: 6px 2px; margin-right: 14px; cursor: pointer; color: var(--ink-soft); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--sun); }

dialog { border: 0; border-radius: 16px; padding: 0; width: min(100% - 24px, 56rem); background: var(--paper); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(8, 24, 17, .55); }
dialog form { padding: 20px; display: grid; gap: 14px; }
#report { width: min(100% - 24px, 30rem); }
.dlg-head, .dlg-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.code { min-height: 50vh; resize: vertical; tab-size: 2; white-space: pre; line-height: 1.5; }
.hint { color: var(--ink-soft); font-size: 0.9rem; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--sky); padding: 12px 20px; border-radius: 999px; font-weight: 600; max-width: calc(100% - 32px);
  transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--danger); color: #fff; }

@media (max-width: 560px) {
  .row, .file { grid-template-columns: 1fr; }
  .actions { margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
