/* Host site styles. Dark theme; every colour is a variable here. */
:root {
  --bg: #0c0e14;
  --bg-2: #11141d;
  --panel: #161a26;
  --panel-2: #1c2130;
  --line: #2a3043;
  --text: #e8ebf3;
  --muted: #9aa3b8;
  --accent: #38d0c0;
  --accent-ink: #06201d;
  --accent-soft: rgba(56, 208, 192, .14);
  --good: #5fd39a;
  --good-soft: rgba(95, 211, 154, .14);
  --warn: #f2c35b;
  --warn-soft: rgba(242, 195, 91, .14);
  --bad: #ff7a85;
  --bad-soft: rgba(255, 122, 133, .14);
  --radius: 12px;
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font-body); -webkit-text-size-adjust: 100%; overflow-x: hidden; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 6vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 4vw, 2rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
a:hover { text-decoration: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1060px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 520px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg-2); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.wordmark { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.wordmark::before { content: ''; width: 12px; height: 12px; border-radius: 3px; background: var(--accent); transform: rotate(45deg); flex: none; }
.nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.nav .who { color: var(--muted); font-size: .9rem; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* buttons */
.btn { font: 600 .95rem var(--font-body); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.big { min-height: 52px; padding: 0 26px; font-size: 1.05rem; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .88rem; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; filter: none; }
.spinner { width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* hero & sections */
.hero { padding: 64px 0 48px; text-align: center; background: radial-gradient(ellipse at 50% 0, var(--accent-soft), transparent 60%); }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; margin: 0 auto 1.6em; }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
section.block { padding: 48px 0; }
section.block > .wrap > h2 { text-align: center; margin-bottom: 1.2em; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card h3 { margin-bottom: .4em; }
.card p { color: var(--muted); margin: 0; }
.steps { counter-reset: s; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); padding: 0; list-style: none; margin: 0; }
.steps li { counter-increment: s; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-bottom: 10px; }
.steps h3 { margin-bottom: .3em; }
.steps p { margin: 0; color: var(--muted); }
.pricing { text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 20px; max-width: 640px; margin: 0 auto; }
.site-footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: .9rem; margin-top: 32px; }

/* forms */
main.page { padding: 32px 0 48px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.field { margin-bottom: 16px; }
label, .label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: .85rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], select { width: 100%; min-height: 44px; padding: 0 12px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; font: inherit; }
input:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.input-row { display: flex; gap: 8px; }
.input-row > input { flex: 1; min-width: 0; }
.addr-row { display: flex; align-items: stretch; gap: 0; }
.addr-row input { border-radius: 10px 0 0 10px; min-width: 0; }
.addr-row .suffix { display: flex; align-items: center; padding: 0 10px; background: var(--panel-2); border: 1px solid var(--line); border-left: 0; border-radius: 0 10px 10px 0; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.msg { min-height: 1.4em; font-size: .92rem; margin: 8px 0; overflow-wrap: anywhere; }
.msg.error { color: var(--bad); }
.msg.ok { color: var(--good); }
.msg.info { color: var(--muted); }
.form-error { background: var(--bad-soft); border: 1px solid var(--bad); color: var(--bad); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-size: .92rem; }
.form-error:empty { display: none; }
.radio-list { display: grid; gap: 8px; }
.radio-list label { display: flex; align-items: center; gap: 10px; font-weight: 500; padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin: 0; cursor: pointer; min-height: 44px; }
.radio-list label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-list label.disabled { opacity: .55; cursor: not-allowed; }
.radio-list input { accent-color: var(--accent); width: 18px; height: 18px; }
.soon { margin-left: auto; font-size: .75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; }
.form-foot { margin-top: 16px; color: var(--muted); font-size: .92rem; }

/* wizard */
.wiz-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 20px; counter-reset: w; }
.wiz-steps li { flex: 1; min-width: 0; text-align: center; font-size: .78rem; color: var(--muted); border-top: 3px solid var(--line); padding-top: 6px; counter-increment: w; }
.wiz-steps li::before { content: counter(w) '. '; }
.wiz-steps li.done { border-color: var(--accent); color: var(--text); }
.wiz-steps li.current { border-color: var(--accent); color: var(--accent); font-weight: 700; }
@media (max-width: 520px) { .wiz-steps li span { display: none; } .wiz-steps li::before { content: counter(w); } }
.wiz-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
ol.how { padding-left: 1.2em; color: var(--muted); }
ol.how li { margin-bottom: 6px; }
ol.how code, code { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .88em; overflow-wrap: anywhere; color: var(--text); }
.found { background: var(--good-soft); border: 1px solid var(--good); border-radius: 10px; padding: 14px; margin: 12px 0; }
.found dl, .summary { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 8px 0 0; }
.found dt, .summary dt { color: var(--muted); }
.found dd, .summary dd { margin: 0; overflow-wrap: anywhere; }
.summary { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 14px 0; }
.success { text-align: center; }
.success .big-url { font-family: var(--font-display); font-size: 1.2rem; overflow-wrap: anywhere; display: inline-block; margin: 8px 0 16px; }

/* dashboard */
.banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--warn-soft); border: 1px solid var(--warn); color: var(--warn); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: .92rem; }
.banner span { overflow-wrap: anywhere; }
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-head h1 { font-size: 1.8rem; margin: 0; }
.site-card { display: flex; flex-direction: column; gap: 10px; }
.site-card h3 { margin: 0; overflow-wrap: anywhere; }
.site-card .addr { overflow-wrap: anywhere; }
.site-card .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.site-card .paused-note { margin: 4px 0 0; }
.pill { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 10px; border-radius: 99px; width: fit-content; }
.pill.active { background: var(--good-soft); color: var(--good); }
.pill.trial { background: var(--accent-soft); color: var(--accent); }
.pill.ended { background: var(--warn-soft); color: var(--warn); }
.pill.failed { background: var(--bad-soft); color: var(--bad); }
.empty { text-align: center; padding: 40px 20px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .spinner { animation: none; border-right-color: currentColor; opacity: .6; }
}

/* operator admin */
.wrap.wide { max-width: 1240px; }
.pill.comped { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.pill.op { background: var(--accent-soft); color: var(--accent); }
.admin-sec { margin-top: 36px; }
.admin-sec h2 { font-size: 1.3rem; }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.tile .t-label { color: var(--muted); font-size: .85rem; font-weight: 600; }
.tile .t-num { font: 700 2.2rem/1.1 var(--font-display); margin: 4px 0; }
.tile .t-sub { color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; min-height: 1.2em; }
.tile.good .t-num { color: var(--good); }
.tile.accent .t-num { color: var(--accent); }
.tile.warn .t-num { color: var(--warn); }
.tile.muted .t-num { color: var(--muted); }
.share { margin-top: 16px; }
.share-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--panel-2); }
.share-bar > div { min-width: 4px; }
.share-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; margin: 10px 0 0; font-size: .88rem; color: var(--muted); }
.share-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.c-good { background: var(--good); } .c-accent { background: var(--accent); } .c-warn { background: var(--warn); } .c-muted { background: var(--muted); }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input[type=text] { flex: 1 1 260px; max-width: 420px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: 600 .88rem var(--font-body); min-height: 44px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip .n { color: var(--muted); margin-left: 4px; font-weight: 500; }
.panel.tight { padding: 0; } /* not overflow:hidden: the Manage dropdown must be able to hang outside it */
.atable thead th:first-child { border-top-left-radius: var(--radius); }
.atable thead th:last-child { border-top-right-radius: var(--radius); }
.atable { width: 100%; border-collapse: collapse; font-size: .92rem; }
.atable th { text-align: left; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.atable td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; min-width: 0; }
.atable tbody tr:last-child td { border-bottom: 0; }
.atable .sub { display: block; color: var(--muted); font-size: .8rem; }
.atable .tag { color: var(--muted); font-size: .78rem; font-style: italic; }
.atable .link-btn { background: none; border: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; min-height: 28px; }
.empty-note { padding: 24px 16px; margin: 0; text-align: center; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-msg { font-size: .82rem; margin-top: 6px; }
.row-msg.ok { color: var(--good); } .row-msg.error { color: var(--bad); } .row-msg.info { color: var(--muted); }
details.manage > summary { list-style: none; cursor: pointer; display: inline-flex; }
details.manage > summary::-webkit-details-marker { display: none; }
details.manage > summary::after { content: '\25BE'; margin-left: 6px; }
details.manage[open] > summary::after { content: '\25B4'; }
.manage-panel { margin-top: 8px; padding: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 10px; }
.manage-panel .grp { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.manage-panel input[type=number], .manage-panel input[type=text] { min-height: 44px; padding: 0 10px; background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; font: inherit; min-width: 0; }
.manage-panel input[type=number] { width: 84px; }
.manage-panel input[type=text] { width: 170px; max-width: 100%; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.armed { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.audit { list-style: none; margin: 0; padding: 0; }
.audit li { display: grid; grid-template-columns: 150px 110px 150px 1fr; gap: 4px 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: .88rem; }
.audit li:last-child { border-bottom: 0; }
.audit span { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 760px) {
  .atable, .atable tbody, .atable tr, .atable td { display: block; width: 100%; }
  .atable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .atable tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .atable tbody tr:last-child { border-bottom: 0; }
  .atable td { border: 0; padding: 4px 0; display: flex; gap: 12px; }
  .atable td::before { content: attr(data-label); flex: 0 0 76px; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
  .atable td > div { flex: 1; min-width: 0; }
  .atable .btn.sm { min-height: 44px; }
  .atable .link-btn { min-height: 44px; }
  .audit li { grid-template-columns: 1fr; gap: 0; }
  .manage-panel input[type=text] { flex: 1 1 140px; }
}

/* Manage opens as a dropdown on wide screens so the table columns don't reflow */
@media (min-width: 761px) {
  details.manage { position: relative; }
  .manage-panel { position: absolute; right: 0; top: 100%; z-index: 5; width: 380px; box-shadow: 0 18px 48px -12px rgba(0, 0, 0, .7); }
}
@media (max-width: 760px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile .t-num { font-size: 1.8rem; }
}
.wordmark { white-space: nowrap; }
