/* Nexa Growth — dark graphite, single amber accent, dense monitor UI */
:root {
  --bg: #0f1115;
  --bg-2: #14171c;
  --card: #181b21;
  --card-2: #1e222a;
  --fg: #e8e9ec;
  --fg-2: #b9bdc6;
  --muted: #7d8290;
  --border: #262a33;
  --border-2: #343945;
  --accent: #f0b429;
  --accent-ink: #1a1304;
  --accent-dim: rgba(240, 180, 41, 0.14);
  --green: #3ddc84;  --green-bg: rgba(61, 220, 132, 0.13);
  --grey: #9aa0ab;   --grey-bg: rgba(154, 160, 171, 0.14);
  --yellow: #f0b429; --yellow-bg: rgba(240, 180, 41, 0.14);
  --red: #ff6b6b;    --red-bg: rgba(255, 107, 107, 0.14);
  --orange: #ff9f43; --orange-bg: rgba(255, 159, 67, 0.14);
  --violet: #b388ff; --violet-bg: rgba(179, 136, 255, 0.14);
  --blue: #5fb3ff;   --blue-bg: rgba(95, 179, 255, 0.14);
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, Menlo, monospace;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --rail: 232px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
code, .host, .reg, .spf { font-family: var(--mono); font-size: 0.92em; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 1.1rem;
  padding: 1.2rem 1rem;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--fg); }
.brand-mark {
  width: 30px; height: 30px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--mono); font-weight: 800; font-size: 1rem; border-radius: 6px;
}
.brand-text { font-weight: 700; letter-spacing: -0.01em; font-size: 1.05rem; }
.brand-text em { font-style: normal; color: var(--accent); }

.search input {
  width: 100%; font-family: var(--mono); font-size: 0.85rem;
  padding: 0.5rem 0.65rem; color: var(--fg);
  background: var(--card); border: 1px solid var(--border-2); border-radius: 6px;
  outline: none;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.search input::placeholder { color: var(--muted); }

.rail nav { display: flex; flex-direction: column; gap: 2px; }
.nav-h {
  margin: 0.8rem 0 0.25rem 0.6rem; font-size: 0.68rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
}
.rail nav a {
  padding: 0.42rem 0.6rem; border-radius: 6px; text-decoration: none;
  color: var(--fg-2); font-weight: 500;
}
.rail nav a:hover { background: var(--card); color: var(--fg); }
.rail nav a.on { background: var(--accent-dim); color: var(--accent); }
.rail-foot { margin-top: auto; font-size: 0.72rem; color: var(--muted); display: flex; align-items: center; gap: 0.4rem; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }

main { padding: 1.6rem 2rem 4rem; min-width: 0; max-width: 1400px; }

/* ---------- type ---------- */
h1 { font-size: 1.35rem; margin: 0 0 0.6rem; letter-spacing: -0.01em; }
h2 {
  font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin: 2rem 0 0.6rem; padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
h2 .muted { text-transform: none; letter-spacing: 0; }
.muted { color: var(--muted); }
.meta { color: var(--muted); font-size: 0.82rem; }
.empty { color: var(--muted); font-style: italic; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 1.4rem; }
.stat { background: var(--card); padding: 0.75rem 0.9rem; display: flex; flex-direction: column; gap: 0.1rem; }
.stat .num { font-family: var(--mono); font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--fg); }
.stat .num.small { font-size: 0.78rem; font-weight: 500; color: var(--fg-2); }
.stat .lbl { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }
.stat:nth-child(3) .num { color: var(--green); }

/* ---------- tables ---------- */
table.grid {
  width: 100%; border-collapse: collapse;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  margin-top: 0.4rem;
}
table.grid th, table.grid td {
  text-align: left; padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border); font-size: 0.86rem; vertical-align: top;
}
table.grid th {
  background: var(--bg-2); color: var(--muted); font-weight: 600;
  font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
}
table.grid tbody tr:hover td { background: var(--card-2); }
table.grid tr:last-child td { border-bottom: none; }
table.grid td a { text-decoration: none; }
table.grid td a code { color: var(--fg); }
table.grid td a:hover code { color: var(--accent); }
table.grid.narrow { max-width: 440px; }
table.grid tr.total td { border-top: 1px solid var(--border-2); }
.chain code { color: var(--muted); font-size: 0.78rem; }
.score { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; color: var(--accent); }

/* ---------- badges ---------- */
.badge, .rbadge, .mech, .chip {
  display: inline-block; border-radius: 4px; font-size: 0.7rem; font-weight: 600;
  padding: 0.08rem 0.45rem; line-height: 1.5; vertical-align: middle;
}
.badge { text-transform: lowercase; letter-spacing: 0.02em; }
.badge-available { color: var(--green); background: var(--green-bg); }
.badge-registered { color: var(--grey); background: var(--grey-bg); }
.badge-unknown { color: var(--yellow); background: var(--yellow-bg); }
.badge-error { color: var(--red); background: var(--red-bg); }
.badge-pending_delete { color: var(--orange); background: var(--orange-bg); }
.badge-redemption { color: var(--orange); background: var(--orange-bg); }
.badge-premium_or_reserved { color: var(--blue); background: var(--blue-bg); }
.badge-expiring { color: var(--orange); background: var(--orange-bg); }
.badge-auction { color: var(--accent); background: var(--accent-dim); }
.badge-dropped { color: var(--orange); background: var(--orange-bg); }
.badge-free_include { color: var(--green); background: var(--green-bg); }

.rbadge { margin-left: 0.2rem; font-size: 0.68rem; }
.rbadge-confirmed { color: var(--green); background: var(--green-bg); }
.rbadge-premium { color: var(--blue); background: var(--blue-bg); }
.rbadge-taken { color: var(--grey); background: var(--grey-bg); }
.rbadge-unconfirmed { color: var(--muted); background: var(--grey-bg); }

.mech { font-family: var(--mono); font-weight: 500; margin: 0 0.3rem; color: var(--muted); background: var(--grey-bg); }
.mech-spf { color: var(--accent); background: var(--accent-dim); }
.mech-dmarc { color: var(--green); background: var(--green-bg); }
.mech-mx { color: var(--blue); background: var(--blue-bg); }
.mech-ns { color: var(--orange); background: var(--orange-bg); }
.mech-dkim { color: var(--violet); background: var(--violet-bg); }
.mech-cname { color: var(--red); background: var(--red-bg); }

.chip { font-family: var(--mono); font-weight: 500; background: var(--grey-bg); color: var(--fg-2); margin: 0 0.15rem 0.15rem 0; }

/* ---------- domain page ---------- */
.domain-title { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.domain-title code { font-size: 1.35rem; font-weight: 600; }
.regbox {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px;
  margin: 0.9rem 0; background: var(--border); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; font-size: 0.85rem;
}
.regbox > div { background: var(--card); padding: 0.6rem 0.9rem; }
.regbox .lbl { display: block; color: var(--muted); text-transform: uppercase; font-size: 0.66rem; letter-spacing: 0.08em; margin-bottom: 0.15rem; }

.tree, .tree ul { list-style: none; margin: 0; padding-left: 1.2rem; }
.tree { border-left: 1px solid var(--border-2); margin-left: 0.35rem; }
.tree li { padding: 0.2rem 0; }
.host { font-weight: 500; color: var(--fg-2); }
.host.root { font-size: 1rem; color: var(--fg); font-weight: 600; }
.reg { text-decoration: none; }
.reg code { color: var(--accent); }
.tree-root { margin: 0.6rem 0 1rem; padding: 0.8rem 1rem; background: var(--card); border: 1px solid var(--border); border-radius: 8px; }
.refs { list-style: none; padding-left: 0; columns: 2; column-gap: 2rem; }
.refs li { padding: 0.15rem 0; break-inside: avoid; }
code.spf { display: block; white-space: pre-wrap; word-break: break-all; font-size: 0.78rem; color: var(--fg-2); }

/* ---------- forms / filters ---------- */
.filters { display: flex; gap: 0.5rem; margin: 0.8rem 0; flex-wrap: wrap; align-items: center; }
.filters input, .filters select, .bulk textarea {
  padding: 0.42rem 0.6rem; color: var(--fg); background: var(--card);
  border: 1px solid var(--border-2); border-radius: 6px; font-family: var(--sans); font-size: 0.85rem;
}
.filters input:focus, .filters select:focus, .bulk textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.filters button, .search button, form.inline button, .bulk button {
  padding: 0.42rem 0.9rem; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 0.85rem;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
}
.filters button:hover, form.inline button:hover, .bulk button:hover { filter: brightness(1.08); }
form.inline { display: inline-block; margin-bottom: 0.6rem; }
.csv {
  color: var(--fg-2); text-decoration: none; font-size: 0.82rem;
  border: 1px solid var(--border-2); border-radius: 6px; padding: 0.38rem 0.75rem;
}
.csv:hover { border-color: var(--accent); color: var(--accent); }
.bulk textarea { width: 100%; font-family: var(--mono); font-size: 0.82rem; min-height: 180px; }
.bulk div { margin-top: 0.6rem; }

.pager { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; color: var(--muted); font-size: 0.85rem; }
.pager a { color: var(--accent); text-decoration: none; }

.queued { text-align: center; padding: 4rem 1rem; color: var(--fg-2); }
.queued code { font-size: 1.4rem; color: var(--fg); }

footer { display: none; }

/* ---------- SPEC-4: free includes ---------- */
/* rank chip (#1,234) */
.rank {
  display: inline-block; font-family: var(--mono); font-size: 0.68rem; font-weight: 600;
  color: var(--blue); background: var(--blue-bg); border-radius: 4px;
  padding: 0.05rem 0.4rem; vertical-align: middle;
}

/* value bar + number */
.vbar {
  position: relative; display: inline-flex; align-items: center;
  width: 120px; height: 16px; border-radius: 4px; overflow: hidden;
  background: var(--card-2); border: 1px solid var(--border-2); vertical-align: middle;
}
.vbar-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 4px 0 0 4px;
}
.vbar-num {
  position: relative; z-index: 1; width: 100%; text-align: center;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700;
  font-variant-numeric: tabular-nums; color: var(--fg);
  text-shadow: 0 0 3px var(--bg), 0 0 3px var(--bg);
}

/* 5-dot verification indicator */
.dots { display: inline-flex; gap: 3px; align-items: center; vertical-align: middle; }
.dot-v { width: 8px; height: 8px; border-radius: 50%; }
.dot-v.on  { background: var(--green); box-shadow: 0 0 0 2px var(--green-bg); }
.dot-v.off { background: transparent; border: 1px solid var(--border-2); }

/* policy chips */
.chip-dmarc { color: var(--green); background: var(--green-bg); }
.chip-spf   { color: var(--accent); background: var(--accent-dim); }

/* SPEC-4b: unranked-cluster warning chip (spam-farm referrers only) */
.chip-unranked { color: var(--fg-2); background: var(--grey-bg); border: 1px solid var(--border); cursor: help; }

/* SPEC-5b: marketplace chips (GD / NC) + amber renew-price warning */
.chip-gd { color: var(--accent); background: var(--accent-dim); border: 1px solid var(--accent); }
.chip-nc { color: var(--blue); background: var(--blue-bg); border: 1px solid var(--blue); }
.renew-amber { color: var(--amber, #e0a000); font-weight: 600; }
.stat .sub { display: block; font-size: 0.66rem; margin-top: 0.1rem; }
.small { font-size: 0.72rem; }

/* free-includes table: each row is a <details> spanning all columns */
.free-grid td.fi-cell { padding: 0; }
.free-grid details { width: 100%; }
.free-grid summary {
  list-style: none; cursor: pointer; padding: 0.5rem 0.75rem;
}
.free-grid summary::-webkit-details-marker { display: none; }
.free-grid summary:hover { background: var(--card-2); }
.free-grid details[open] summary { background: var(--card-2); border-bottom: 1px solid var(--border); }
.free-grid thead tr {
  display: grid; gap: 0.5rem; padding: 0 0.75rem;
  grid-template-columns: 2.2fr 130px 70px 2.4fr 0.5fr 1.6fr 0.9fr 1fr;
}
.free-grid thead th { border-bottom: none; }
.fi-row {
  display: grid; align-items: center; gap: 0.5rem;
  grid-template-columns: 2.2fr 130px 70px 2.4fr 0.5fr 1.6fr 0.9fr 1fr;
}
.fi-row code { color: var(--fg); }
.fi-row .fi-more { color: var(--muted); font-size: 0.78rem; }
.fi-detail { padding: 0.5rem 0.9rem 0.9rem; background: var(--bg-2); }
.fi-detail .spf { white-space: pre-wrap; word-break: break-all; }
mark { background: var(--accent); color: var(--accent-ink); border-radius: 2px; padding: 0 1px; }

table.grid.narrow-wide { max-width: 100%; margin-top: 0.4rem; }
table.grid.narrow-wide th, table.grid.narrow-wide td { font-size: 0.8rem; }

/* value panel on the domain page */
.valuebox { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 0.9rem 1rem; }
.value-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-bottom: 0.6rem; }
.value-big .vbar { width: 200px; height: 20px; }
.value-ver { display: flex; align-items: center; gap: 0.5rem; }

/* SPEC-4c: purchasability widget */
.buy { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; vertical-align: middle; }
.buy-link {
  font-family: var(--mono); font-size: 0.74rem; font-weight: 600;
  color: var(--green); background: var(--green-bg);
  border: 1px solid var(--green); border-radius: 4px; padding: 0.05rem 0.4rem;
  text-decoration: none; white-space: nowrap;
}
.buy-link:hover { background: var(--green); color: #06130b; }
.chip-local      { color: var(--accent); background: var(--accent-dim); border: 1px solid var(--accent); text-decoration: none; cursor: help; }
.chip-registry   { color: var(--grey); background: var(--grey-bg); border: 1px solid var(--border); text-decoration: none; cursor: help; }
.chip-restricted { color: var(--red); background: var(--red-bg); border: 1px solid var(--red); cursor: help; }
.buy-note { margin-top: -0.4rem; }

/* ---------- SPEC-5: in auction ---------- */
/* same full-width <details> row pattern as .free-grid */
.auc-grid td.auc-cell { padding: 0; }
.auc-grid details { width: 100%; }
.auc-grid summary { list-style: none; cursor: pointer; padding: 0.5rem 0.75rem; }
.auc-grid summary::-webkit-details-marker { display: none; }
.auc-grid summary:hover { background: var(--card-2); }
.auc-grid details[open] summary { background: var(--card-2); border-bottom: 1px solid var(--border); }
.auc-cols {
  display: grid; align-items: center; gap: 0.5rem;
  grid-template-columns: 2.3fr 120px 2fr 0.5fr 0.9fr 0.55fr 0.8fr 1fr 0.9fr 0.8fr 1.7fr;
}
.auc-grid thead tr { display: grid; gap: 0.5rem; padding: 0 0.75rem; }
.auc-grid thead tr { grid-template-columns: 2.3fr 120px 2fr 0.5fr 0.9fr 0.55fr 0.8fr 1fr 0.9fr 0.8fr 1.7fr; }
.auc-grid thead th { border-bottom: none; }
.auc-cols code { color: var(--fg); }
.auc-cols .auc-more, .auc-cols .muted { color: var(--muted); font-size: 0.78rem; }
.auc-detail { padding: 0.5rem 0.9rem 0.9rem; background: var(--bg-2); }
.ends-soon { color: var(--orange); font-weight: 600; }
.ends-gone { color: var(--muted); }
.aucbtn {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  border-radius: 4px; padding: 0.08rem 0.45rem; text-decoration: none; white-space: nowrap;
}
.aucbtn-gd { color: var(--accent); background: var(--accent-dim); border: 1px solid var(--accent); }
.aucbtn-gd:hover { background: var(--accent); color: var(--accent-ink); }
.aucbtn-nc { color: var(--blue); background: var(--blue-bg); border: 1px solid var(--blue); }
.aucbtn-nc:hover { background: var(--blue); color: #06101b; }
.aucbtn-local { color: var(--blue); background: var(--blue-bg); border: 1px solid var(--blue); }
.aucbtn-local:hover { background: var(--blue); color: #06101b; }

/* In-auction panel on the domain page */
.aucbox { background: var(--card); border: 1px solid var(--accent); border-radius: 8px; padding: 0.9rem 1rem; }
.auc-head { display: flex; flex-wrap: wrap; gap: 1rem 1.4rem; align-items: baseline; }
.auc-head .big { font-family: var(--mono); font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.auc-head .lbl { color: var(--muted); text-transform: uppercase; font-size: 0.66rem; letter-spacing: 0.08em; margin-right: 0.3rem; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .rail nav { flex-direction: row; flex-wrap: wrap; }
  .nav-h { display: none; }
  main { padding: 1rem; }
  .refs { columns: 1; }
}

/* ---------- SPEC-6: warehouse (IP / NS / ASN / search) ---------- */
.wh-down {
  background: var(--red-bg); border: 1px solid var(--red); color: var(--red);
  border-radius: 6px; padding: 0.5rem 0.75rem; font-size: 0.85rem; margin: 0.6rem 0;
}
.hostbox code { color: var(--fg); }
.nscell code { color: var(--fg-2); }
.nscell a { text-decoration: none; }

/* ---------- SPEC-7: DNS scanner — change feed + history ---------- */
.dnsbox { padding: 0; background: transparent; border: none; }
.dnsbox .spf { white-space: pre-wrap; word-break: break-all; }
.diff-old code { color: var(--red); }
.diff-new code { color: var(--green); }
.diff-arrow { color: var(--muted); margin: 0 0.3rem; }
.chip-change { border: 1px solid var(--border); }
.chip-added     { color: var(--green);  background: var(--green-bg); }
.chip-revived   { color: var(--green);  background: var(--green-bg); }
.chip-removed   { color: var(--red);    background: var(--red-bg); }
.chip-nxdomain  { color: var(--red);    background: var(--red-bg); }
.chip-changed   { color: var(--accent); background: var(--accent-dim); }
.chip-servfail_flap { color: var(--fg-2); background: var(--grey-bg); }
.filters label.chk { display: inline-flex; align-items: center; gap: 0.3rem; }

/* ---------- SPEC-8: auth / login / account / users ---------- */
.userbox {
  margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.userbox .who { display: flex; align-items: center; gap: 0.4rem; text-decoration: none; color: var(--fg); min-width: 0; }
.userbox .who-name { font-family: var(--mono); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-role { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.1rem 0.35rem; border-radius: 4px; }
.chip-role-admin  { color: var(--accent-ink); background: var(--accent); }
.chip-role-viewer { color: var(--fg-2);        background: var(--grey-bg); }
.logout button, .userbox button {
  font: inherit; font-size: 0.78rem; cursor: pointer;
  background: var(--card-2); color: var(--fg-2);
  border: 1px solid var(--border-2); border-radius: 6px; padding: 0.3rem 0.55rem;
}
.logout button:hover { color: var(--fg); border-color: var(--accent); }

.login-body { background: var(--bg); color: var(--fg); min-height: 100vh; display: grid; place-items: center; }
.login-wrap { width: 100%; max-width: 360px; padding: 1.5rem; }
.login-brand { justify-content: center; margin-bottom: 0.4rem; }
.login-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.6rem 1.5rem;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
}
.login-sub { text-align: center; color: var(--muted); margin: 0.2rem 0 1.1rem; font-size: 0.85rem; }
.login-error {
  background: var(--red-bg); color: var(--red); border: 1px solid var(--red);
  border-radius: 7px; padding: 0.5rem 0.7rem; font-size: 0.85rem; margin: 0 0 0.9rem;
}
.login-form { display: flex; flex-direction: column; gap: 0.75rem; }
.login-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.78rem; color: var(--fg-2); }
.login-form input[type=text], .login-form input[type=password] {
  font-family: var(--mono); font-size: 0.9rem; padding: 0.55rem 0.65rem; color: var(--fg);
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 7px; outline: none;
}
.login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.login-remember { flex-direction: row !important; align-items: center; gap: 0.4rem !important; color: var(--muted) !important; }
.login-btn {
  margin-top: 0.3rem; font: inherit; font-weight: 700; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  border: none; border-radius: 7px; padding: 0.6rem; font-size: 0.9rem;
}
.login-btn:hover { filter: brightness(1.05); }
.login-foot { text-align: center; color: var(--muted); font-size: 0.72rem; margin-top: 1rem; }

.flash { border-radius: 7px; padding: 0.5rem 0.7rem; font-size: 0.85rem; margin: 0 0 0.9rem; }
.flash-ok  { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }
.flash-err { background: var(--red-bg);   color: var(--red);   border: 1px solid var(--red); }

.stacked-form { display: flex; flex-direction: column; gap: 0.7rem; max-width: 340px; }
.stacked-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.8rem; color: var(--fg-2); }
.stacked-form input[type=password] {
  font-family: var(--mono); padding: 0.5rem 0.6rem; color: var(--fg);
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 7px; outline: none;
}
.stacked-form button, .row-form button {
  font: inherit; font-weight: 600; cursor: pointer; align-self: flex-start;
  background: var(--accent); color: var(--accent-ink); border: none;
  border-radius: 7px; padding: 0.5rem 0.9rem;
}
.row-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.6rem 0 0; }
.row-form input, .row-form select {
  font-family: var(--mono); font-size: 0.85rem; padding: 0.45rem 0.6rem; color: var(--fg);
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 6px;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.actions form.inline { display: inline; }
.actions button, .pw-reset summary {
  font: inherit; font-size: 0.76rem; cursor: pointer;
  background: var(--card-2); color: var(--fg-2);
  border: 1px solid var(--border-2); border-radius: 6px; padding: 0.28rem 0.5rem;
}
.actions button.danger { color: var(--red); border-color: var(--red); }
.pw-reset { display: inline-block; }
.pw-reset summary { list-style: none; display: inline-block; }
.pw-reset input { font-family: var(--mono); font-size: 0.78rem; padding: 0.28rem 0.45rem; margin-top: 0.3rem;
  background: var(--bg-2); color: var(--fg); border: 1px solid var(--border-2); border-radius: 6px; }
