/* Domain Pool Panel - one stylesheet, no framework, no build step.
 *
 * Calm operations tool: light, generous whitespace, rounded cards, a single
 * accent colour, status carried by a small badge rather than by row colour.
 * No gradients, no glow, no decorative icons.
 */

:root {
  --bg:        #f4f5f7;
  --card:      #ffffff;
  --line:      #e3e6ea;
  --line-soft: #eef0f3;
  --ink:       #1f242b;
  --ink-soft:  #5c6570;
  --ink-faint: #949ca6;
  --accent:    #2f6690;
  --accent-d:  #244f6d;
  --accent-bg: #eaf1f6;
  --green:     #2e7d4f;
  --green-bg:  #e7f3ec;
  --green-ln:  #cbe4d5;
  --amber:     #8a5d08;
  --amber-bg:  #fbf1db;
  --amber-ln:  #ecdcb4;
  --red:       #b3261e;
  --red-bg:    #fbeae8;
  --red-ln:    #f0cfca;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius:    12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; }

/* ---------------------------------------------------------------- topbar */

.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; min-height: 56px; }
.brand { font-weight: 650; color: var(--ink); letter-spacing: .01em; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; margin-right: auto; }
.nav a {
  padding: 7px 11px; border-radius: var(--radius-sm); color: var(--ink-soft); font-size: 13px;
}
.nav a:hover { background: var(--line-soft); text-decoration: none; }
.nav a.on { background: var(--accent); color: #fff; }
.signout { font-size: 13px; color: var(--ink-faint); }

main.wrap { padding-top: 24px; padding-bottom: 40px; }

/* ------------------------------------------------------------------ text */

h1 { font-size: 21px; margin: 0 0 18px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 650; }
h3 { font-size: 11.5px; margin: 0 0 8px; font-weight: 650; color: var(--ink-faint);
     text-transform: uppercase; letter-spacing: .06em; }
p  { margin: 0 0 10px; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); font-size: 12px; }
code, .mono, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}
pre {
  background: #f7f8f9; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 13px; overflow-x: auto; margin: 0 0 12px;
}

/* ----------------------------------------------------------------- cards */

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin: 0 0 18px;
}
.card > h1:first-child, .card > h2:first-child { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }

/* ---------------------------------------------------------------- badges */

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 650; letter-spacing: .02em; line-height: 1.5;
  border: 1px solid transparent; white-space: nowrap; text-transform: lowercase;
}
.badge.g { background: var(--green-bg); color: var(--green); border-color: var(--green-ln); }
.badge.a { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-ln); }
.badge.r { background: var(--red-bg);   color: var(--red);   border-color: var(--red-ln); }
.badge.n { background: #eef0f3;         color: var(--ink-soft); border-color: var(--line); }
/* Awaiting DNS: informational blue, deliberately not red. */
.badge.b { background: var(--accent-bg); color: var(--accent-d); border-color: #cfe0ec; }

/* ------------------------------------------------- dashboard pool cards */

.pool-card { display: flex; flex-direction: column; }
.pool-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pool-head .title { font-size: 16px; font-weight: 650; }
.pool-head .key { color: var(--ink-faint); font-size: 13px; }
.pool-head .spacer { flex: 1 1 auto; }

.live-block { margin-bottom: 18px; }
.live-label { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-faint); margin-bottom: 6px; }
.live-dom {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 21px; font-weight: 600; color: var(--ink); word-break: break-all; line-height: 1.3;
}
.live-none { font-size: 16px; color: var(--red); font-weight: 600; }
.live-meta { margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.live-note { margin-top: 6px; font-size: 12px; color: var(--ink-faint); word-break: break-word; }

/* The reserve line: what the queued count is actually worth. Sits between the
   "Queued (n)" heading and the list, because the split is the headline and the
   list is the detail. */
.reserve {
  display: flex; column-gap: 14px; row-gap: 2px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--ink-soft);
  margin: -6px 0 12px;
}
.reserve b { font-weight: 650; }
.reserve .ok   { color: var(--green); }
.reserve .wait { color: var(--amber); }
.reserve .unk  { color: var(--ink-faint); }
.queue .faint.ok { color: var(--green); }
/* "in 12m" - the next-due hint, deliberately quieter than the verdict. */
.queue .due { margin-left: 6px; opacity: .75; }

.queue { list-style: none; margin: 0 0 18px; padding: 0; }
.queue li {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-top: 1px solid var(--line-soft); font-size: 13.5px;
}
.queue li:first-child { border-top: 0; }
.queue .pos {
  width: 20px; flex: 0 0 20px; text-align: center; color: var(--ink-faint);
  font-size: 11px; font-variant-numeric: tabular-nums;
}
.queue .host { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; word-break: break-all; }
.queue .spacer { flex: 1 1 auto; }
.queue-empty { color: var(--ink-faint); font-size: 13px; margin: 0 0 18px; }

.pool-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.counts { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 12px; }
.counts b { color: var(--ink); font-weight: 650; }
.linkrow { display: flex; gap: 10px; align-items: baseline; font-size: 12px; padding: 2px 0; }
.linkrow .lbl { color: var(--ink-faint); flex: 0 0 34px; text-transform: uppercase; letter-spacing: .04em; font-size: 10.5px; }
.linkrow a, .linkrow .val { word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; }
.pool-actions { margin-top: 16px; }

/* legacy dashboard classes (kept so nothing else breaks) */
.kv { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-soft); }
.kv b { color: var(--ink); font-weight: 650; }

/* --------------------------------------------------------------- tables */

.tablewrap { overflow-x: auto; margin: 0; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
     color: var(--ink-faint); font-weight: 650; white-space: nowrap; }
thead th { border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }
td.nowrap, th.nowrap { white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rowsub { color: var(--ink-faint); font-size: 11.5px; margin-top: 3px; word-break: break-word; }

/* --------------------------------------------------------------- forms */

label { display: block; font-size: 12.5px; color: var(--ink-soft); margin: 0 0 5px; font-weight: 500; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); font: inherit; font-size: 13px;
}
textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg);
}
.field { margin: 0 0 14px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px; }
.check { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; }
.check input { width: auto; }
.check label { margin: 0; color: var(--ink); font-size: 13px; }

.btn {
  display: inline-block; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer;
  line-height: 1.4; white-space: nowrap;
}
.btn:hover { background: #f6f7f9; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-d); }
.btn.danger { color: var(--red); border-color: var(--red-ln); }
.btn.danger:hover { background: var(--red-bg); }
.btn.mini { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn[disabled] { opacity: .5; cursor: default; }

form.inline { display: inline; }

/* --------------------------------------------------------------- flash */

.flash {
  padding: 11px 14px; border-radius: var(--radius-sm); margin: 0 0 16px; font-size: 13px;
  border: 1px solid transparent;
}
.flash.ok   { background: var(--green-bg); color: var(--green); border-color: var(--green-ln); }
.flash.warn { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-ln); }
.flash.err  { background: var(--red-bg);   color: var(--red);   border-color: var(--red-ln); }

.notice {
  padding: 10px 13px; border-radius: var(--radius-sm); font-size: 12.5px; margin: 0 0 16px;
  background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-ln);
}

/* ------------------------------------------------------- domains page */

.section-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 4px; }
.section-head h2 { margin: 0; }
.section-head .count { color: var(--ink-faint); font-weight: 500; font-size: 13px; }
.section-head .spacer { flex: 1 1 auto; }

/* the burned section: dimmed, never competing with the active queue */
details.burned { margin: 0 0 18px; }
details.burned > summary {
  list-style: none; cursor: pointer; padding: 14px 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 14px;
}
details.burned[open] > summary { border-radius: var(--radius) var(--radius) 0 0; border-bottom: 0; }
details.burned > summary::-webkit-details-marker { display: none; }
details.burned > summary .chev { color: var(--ink-faint); font-size: 11px; transition: none; }
details.burned[open] > summary .chev { transform: rotate(90deg); display: inline-block; }
details.burned > summary .spacer { flex: 1 1 auto; }
.burned-body {
  background: var(--card); border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius); padding: 4px 20px 12px;
}
.burned-body table { color: var(--ink-faint); }
.burned-body td, .burned-body th { border-color: var(--line-soft); }
.burned-body tbody tr:hover { background: transparent; }   /* no hover emphasis */
.burned-body .mono { color: var(--ink-soft); }

/* ----------------------------------------------------------- pagination */

.pager { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; margin-top: 14px; }
.pager a, .pager span {
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff;
  color: var(--ink-soft);
}
.pager .cur { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------------------------------------------------------------- login */

.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-box { width: 100%; max-width: 340px; }
.login-box h1 { text-align: center; margin-bottom: 18px; }

/* ---------------------------------------------------------------- foot */

.foot {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  color: var(--ink-faint); font-size: 12px; padding-bottom: 28px;
}

@media (max-width: 640px) {
  .wrap { padding: 0 14px; }
  .topbar-in { gap: 10px; }
  .nav { order: 3; width: 100%; margin: 0 0 8px; }
  .signout { margin-left: auto; }
  .card { padding: 16px; }
  .live-dom { font-size: 18px; }
  th, td { padding: 9px 10px; }
  details.burned > summary, .burned-body { padding-left: 16px; padding-right: 16px; }
}

/* ---------------------------------------------------- pool blocks (IP pools)
 *
 * The two lists on this page run to a couple of hundred entries each, so they
 * are chip grids rather than form rows: one line of chrome per list instead of
 * one per entry, and state carried by the chip itself.
 */

details.pool-block { padding: 0; }
details.pool-block > summary {
  list-style: none; cursor: pointer; padding: 16px 18px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-radius: var(--radius);
}
details.pool-block > summary::-webkit-details-marker { display: none; }
details.pool-block > summary::before {
  content: "\25B8"; color: var(--ink-faint); font-size: 12px;
  transition: transform .12s ease; flex: 0 0 auto;
}
details.pool-block[open] > summary::before { transform: rotate(90deg); }
details.pool-block[open] > summary { border-bottom: 1px solid var(--line-soft); }
details.pool-block > summary:hover { background: #fafbfc; }
.pool-name { font-size: 15px; font-weight: 650; }
.pool-body { padding: 16px 18px 18px; }

.statline { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.statline .stat {
  font-size: 11.5px; color: var(--ink-soft); background: var(--line-soft);
  border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.statline .stat b { color: var(--ink); font-variant-numeric: tabular-nums; }

.forecast {
  font-size: 11.5px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); white-space: normal;
}
.forecast.ok  { color: var(--green); background: var(--green-bg); border-color: var(--green-ln); }
.forecast.warn{ color: var(--amber); background: var(--amber-bg); border-color: var(--amber-ln); }
.forecast.bad { color: var(--red);   background: var(--red-bg);   border-color: var(--red-ln); }

/* Sub-section inside a form card: the queue-checking block on Pools. */
.subhead { font-size: 13px; margin: 26px 0 6px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.blurb { margin: 0 0 14px; max-width: 70ch; line-height: 1.55; }

/* The coverage arithmetic. A settings figure the user has to be able to trust,
   so it gets its own block rather than a footnote. */
.coverage {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); padding: 12px 14px; margin: 4px 0 18px;
  font-size: 12.5px; line-height: 1.6; color: var(--ink-soft); max-width: 78ch;
}
.coverage .chead { font-weight: 650; color: var(--ink); margin-bottom: 6px; font-size: 12px;
  text-transform: uppercase; letter-spacing: .04em; }
.coverage p { margin: 0 0 8px; }
.coverage p:last-child { margin-bottom: 0; }
.coverage b { color: var(--ink); font-weight: 650; }
.coverage.ok   { background: var(--green-bg); border-color: var(--green-ln); }
.coverage.warn { background: var(--amber-bg); border-color: var(--amber-ln); }
.coverage.off  { background: var(--line-soft); }
.coverage .yard, .coverage .load { color: var(--ink-faint); font-size: 11.5px; }

.listblock { margin-bottom: 26px; }
.list-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.list-head h3 { margin: 0; font-size: 13px; }

/* ------------------------------------------------------------ action bar */
.actionbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; background: var(--line-soft);
  border-radius: var(--radius-sm); margin-bottom: 10px;
}
.actionbar .selcount {
  font-size: 11.5px; color: var(--ink-faint); min-width: 82px;
  font-variant-numeric: tabular-nums;
}
.actionbar .selcount.has { color: var(--accent); font-weight: 650; }
.actionbar .notebox { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.actionbar input[type="text"].mini {
  margin: 0; padding: 4px 8px; font-size: 12px; width: 150px; height: auto;
}

/* ----------------------------------------------------------- the chip grid */
.chipgrid { display: grid; gap: 6px; }
.chipgrid.g-ip  { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
.chipgrid.g-lab { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

.chip {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); padding: 3px 7px 3px 3px; font-size: 12px;
}
.chip .chk { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.chip .ix {
  flex: 0 0 auto; min-width: 26px; text-align: center;
  font-size: 10.5px; font-variant-numeric: tabular-nums;
  color: var(--ink-faint); text-decoration: none;
  background: var(--line-soft); border-radius: 5px; padding: 2px 4px;
}
.chip .ix:hover { background: var(--accent-bg); color: var(--accent); }
.chip .val {
  flex: 1 1 auto; min-width: 0; cursor: pointer; margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; color: var(--ink); font-weight: 400;
  text-transform: none; letter-spacing: 0;
}
.chip .pinmark { flex: 0 0 auto; color: var(--accent); font-size: 9px; }
.chip:hover { border-color: var(--ink-faint); }

/* Selected. :has() styles the chip from its own hidden checkbox, so selection
   survives with scripting off. */
.chip:has(.chk:checked) {
  border-color: var(--accent); background: var(--accent-bg);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.chip:has(.chk:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Inactive: dimmed and struck through, no checkbox needed to see it. */
.chip.off { background: var(--bg); border-style: dashed; }
.chip.off .val { color: var(--ink-faint); text-decoration: line-through; }
.chip.pin { border-color: var(--accent-bg); }

/* --------------------------------------------------------- detail panel */
.detail {
  margin-top: 12px; padding: 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--line-soft);
}
.detail .kv { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; font-size: 12.5px; }
.detail .kv span { color: var(--ink-faint); }
.detail input[type="text"], .detail input[type="number"] { margin: 0; }

.textview textarea { font-size: 12.5px; }
details.addbox { margin-top: 4px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
details.addbox > summary { cursor: pointer; font-size: 12.5px; }

/* --------------------------------------------- tighter tables (registrar) */
table.tight { font-size: 12.5px; }
table.tight th, table.tight td { padding: 5px 8px; }
table.tight td.shrink, table.tight th.shrink { width: 1%; white-space: nowrap; }
table.tight .rowsub { font-size: 11px; margin-top: 1px; }

/* ---------------------------------------------------------------------------
   Per-row actions.

   These used to be an absolutely positioned dropdown inside the cell, which
   the .tablewrap scroll container clipped and which covered the rows beneath.
   Now the trigger opens a full-width panel ROW: it expands the table and
   pushes everything below it down, so nothing can be cut off by a cell edge,
   a card edge or the horizontal scroller.
--------------------------------------------------------------------------- */
.rowmenu-btn {
  cursor: pointer; display: inline-block; font: inherit;
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px;
  font-size: 11.5px; color: var(--ink-soft); background: var(--card);
  white-space: nowrap;
}
.rowmenu-btn:hover { border-color: var(--accent); color: var(--accent); }
.rowmenu-btn[aria-expanded="true"] {
  border-color: var(--accent); color: var(--accent); background: var(--accent-bg);
}
.rowmenu-btn .chev { display: inline-block; font-size: 9px; margin-left: 2px; }
.rowmenu-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }

tr.rowpanel { display: none; }
tr.rowpanel.open { display: table-row; }
/* Without JavaScript nothing could ever open one, so show them all instead. */
html:not(.js) tr.rowpanel { display: table-row; }

tr.rowpanel > td {
  padding: 0; background: var(--line-soft);
  border-bottom: 1px solid var(--line);
}
/* On a narrow screen the table itself still scrolls sideways - seven columns
   will not fit on a phone. The panel must not: it is pinned to the left edge
   of the scroller and sized to the visible width (by rowpanel_script), so the
   editor is fully usable without scrolling the table at all. */
.rowpanel-body {
  padding: 14px 12px 16px;
  display: grid; gap: 14px 18px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  align-items: start;
  position: sticky; left: 0; box-sizing: border-box;
}
.rowpanel-sec { min-width: 0; }        /* the rule that stops a grid cell overflowing */
.rowpanel-sec.wide { grid-column: 1 / -1; }
.rowpanel-sec .btn.mini { margin: 0 4px 4px 0; }
.rowpanel-body .menu-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-faint); margin: 0 0 5px;
}
.rowpanel-head {
  grid-column: 1 / -1; display: flex; align-items: baseline; gap: 8px;
  flex-wrap: wrap; margin: -2px 0 2px;
}
.rowpanel-head .dom { font-family: var(--mono); font-size: 13px; }

/* The nameserver editor: a plain vertical list, one per line, full width. */
.nslist { display: flex; flex-direction: column; gap: 6px; margin: 0 0 8px; }
.nsrow { display: flex; gap: 6px; align-items: center; }
.nsrow input[type="text"] { flex: 1 1 auto; min-width: 0; margin: 0; }
.nsdel {
  flex: 0 0 auto; cursor: pointer; font: inherit; line-height: 1;
  width: 30px; height: 30px; padding: 0; border-radius: 6px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-faint);
}
.nsdel:hover { border-color: var(--red-ln); background: var(--red-bg); color: var(--red); }
.nsadd {
  cursor: pointer; font: inherit; font-size: 12px; padding: 0;
  border: 0; background: none; color: var(--accent); text-decoration: underline;
}
.nsprofile { margin-top: 10px; }
.nsprofile select { max-width: 320px; }
.nsactions {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
}
.nshelp { margin: 8px 0 0; width: 100%; }

@media (max-width: 460px) {
  .rowpanel-body { padding: 12px 10px 14px; grid-template-columns: 1fr; }
  .nsactions .btn { flex: 1 1 auto; text-align: center; }
}

/* The zone forecast as it appears in a table cell / on a button. */
.reccount { font-variant-numeric: tabular-nums; font-size: 11.5px; }
.btn.mini.warn {
  border-color: var(--amber-ln); background: var(--amber-bg); color: var(--amber);
}
.btn.mini.dim { opacity: .5; }

@media (max-width: 640px) {
  .chipgrid.g-ip, .chipgrid.g-lab { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .actionbar .notebox { margin-left: 0; width: 100%; }
  .actionbar input[type="text"].mini { flex: 1 1 auto; width: auto; }
  .detail .kv { grid-template-columns: 1fr; }
  .detail .kv span { margin-top: 6px; }
  .pool-body { padding: 14px 12px 16px; }
  details.pool-block > summary { padding: 14px 12px; }
}

@media (max-width: 400px) {
  .chipgrid.g-ip, .chipgrid.g-lab { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
  .chip { font-size: 11.5px; padding: 3px 5px 3px 3px; }
  .chip .ix { min-width: 22px; }
}

/* A notice that is only telling you the size, not warning about it. */
.notice.info {
  background: var(--accent-bg); color: var(--accent-d); border-color: #cfe0ec;
}

/* A notice about something that is already broken, not merely uneven. */
.notice.err {
  background: var(--red-bg); color: var(--red); border-color: var(--red-ln);
}
.notice.err b.mono, .notice b.mono { font-family: var(--mono); }

.statline .stat .sub { color: var(--ink-faint); margin-left: 4px; }

/* ------------------------------------------------- copy-to-clipboard control
 *
 * Deliberately quiet: it only gains colour on hover, and it sits outside the
 * domain text so the text stays selectable by hand.
 */
.copybtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 19px; height: 19px; padding: 0; margin: 0 0 0 5px;
  vertical-align: middle; flex: 0 0 auto;
  border: 1px solid transparent; border-radius: 5px;
  background: transparent; color: var(--ink-faint);
  cursor: pointer; font-size: 11px; line-height: 1;
}
.copybtn:hover { color: var(--accent); background: var(--accent-bg); border-color: #cfe0ec; }
.copybtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.copybtn .ci, .copybtn .cok { display: block; }
.copybtn .cok { display: none; }
.copybtn.done { color: var(--green); background: var(--green-bg); border-color: var(--green-ln); }
.copybtn.done .ci { display: none; }
.copybtn.done .cok { display: inline; }

/* The domain cell: wrap at the dot, never inside a label. */
td.domcell {
  min-width: 190px;
  word-break: keep-all;
  overflow-wrap: break-word;
}
td.domcell .domname {
  /* Keeps the name and its button on one line together. */
  display: inline-flex; align-items: center; max-width: 100%;
}
td.domcell .domname .dt { word-break: keep-all; overflow-wrap: break-word; }

/* Nameservers: one line, ellipsis, full value on hover and in the panel. */
td.nscell { max-width: 190px; }
td.nscell .nsline {
  display: block; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media (max-width: 640px) {
  td.domcell { min-width: 150px; }
  td.nscell { max-width: 130px; }
}

/* The row a "Provision" link just landed on. */
tr[id^="reg-"]:target { background: var(--accent-bg); box-shadow: inset 3px 0 0 var(--accent); }

/* The per-row action strip: allowed to wrap so nothing is ever clipped. */
td.rowacts { white-space: normal; min-width: 210px; }
td.rowacts form.inline, td.rowacts .rowmenu-btn { display: inline-block; margin-bottom: 3px; }
/* A queue row's domain cell needs room for its explanation line. */
table.tight td.domcell { min-width: 230px; }

/* --------------------------------------------------------- automatic setup
   One block per pool on the Pools page: the plan in plain words, then the
   controls that change it. Always on screen - nothing to open. */
.autopool {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 14px 16px 4px;
  margin: 0 0 14px;
}
.autopool:last-of-type { margin-bottom: 0; }
.autopool-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.autopool-head .key { font-size: 12px; }
.autopool-head .spacer { flex: 1 1 auto; }

.autonow {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 3px 12px;
  margin: 0 0 14px;
  font-size: 12.5px;
}
.autonow dt { color: var(--ink-faint); }
.autonow dd { margin: 0; color: var(--ink-soft); word-break: break-word; }
.autonow dd.mono { font-size: 12px; }
.autonow dd.bad  { color: var(--red); }

.autoform .fields { max-width: 720px; }
.autoform textarea { min-height: 84px; max-width: 420px; }
.autoform .row { margin-bottom: 14px; }

@media (max-width: 560px) {
  .autonow { grid-template-columns: 1fr; }
  .autonow dt { margin-top: 6px; }
}

/* The "set nameservers now" options on the Domains page bulk-add box, and the
   one muted line per awaiting-DNS row saying what it would get. */
.setnsbox {
  border-left: 2px solid var(--line);
  padding: 12px 0 2px 14px;
  margin: 0 0 14px 6px;
}
.setnsbox .autonow { margin-bottom: 12px; }
.setnsbox textarea { min-height: 72px; max-width: 420px; }
.setnsbox .notice { margin-bottom: 12px; }
/* "next in 12m" under a queued row's last-check time. A row that is due now
   is the one worth noticing, so only that state gets any colour. */
.rowsub.duesub { white-space: nowrap; }
.rowsub.duesub.now { color: var(--accent); }

.rowsub.autonote {
  color: var(--ink-faint);
  white-space: normal;          /* the cell around it is nowrap; this must wrap */
  max-width: 44ch;
  margin-top: 5px;
}

/* The verified read-back of the last nameserver write, under the domain. */
.rowsub.nsresult {
  color: var(--ink-soft);
  white-space: normal;
  max-width: 44ch;
  font-family: var(--mono);
  font-size: 10.5px;
}

/* The facts block at the top of a row's nameserver panel. */
.nsfacts { margin: 0 0 12px; }
.nsfacts dd a { color: inherit; }
.nsform label { display: block; }
.nsform .faint { margin: 6px 0 0; }
#nsbulk .nsactions { margin-top: 4px; padding-top: 0; border-top: 0; }
