/* ============================================================
      Domain Panel — components
      ------------------------------------------------------------
      Builds solely on tokens.css. No raw values here either.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light dark; }
body {
  margin: 0;
  font: var(--weight-normal) var(--text-md)/var(--row-height) var(--font);
  background: var(--surface-sunken);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- text --------------------------------------------------------- */
.heading   { font-size: var(--text-2xl); font-weight: var(--weight-bold); letter-spacing: -.02em; margin: 0; }
.heading-2 { font-size: var(--text-xl);  font-weight: var(--weight-bold); letter-spacing: -.01em; margin: 0; }
.heading-3 { font-size: var(--text-lg);  font-weight: var(--weight-bold); margin: 0; }
.muted   { color: var(--text-muted); }
.faint     { color: var(--text-faint); }
.mono     { font-family: var(--font-mono); font-size: var(--text-xs); }

/* The uppercase label is the system's recurring divider. */
.label {
  font-size: var(--text-2xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--label-spacing);
  font-weight: var(--weight-medium);
  margin: var(--step-4) 0 var(--step-2);
}
.label:first-child { margin-top: 0; }

/* --- buttons ------------------------------------------------------ */
.btn {
  font: var(--weight-normal) var(--text-md)/1 var(--font);
  padding: var(--step-2) var(--step-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--fast), color var(--fast), background var(--fast);
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: default; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: var(--weight-medium); }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

.btn-danger { border-color: var(--error-border); color: var(--error-text); }
.btn-danger:hover:not(:disabled) { background: var(--error-surface); border-color: var(--error-text); color: var(--error-text); }

.btn-quiet { border-color: transparent; background: transparent; color: var(--text-muted); }
.btn-quiet:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); border-color: transparent; }

.btn-sm { padding: var(--step-1) var(--step-2); font-size: var(--text-sm); }
.btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-surface); }
.btn-wide { width: 100%; }

/* The hidden attribute must win over any display rule, or `el.hidden = true` does nothing. */
[hidden] { display: none !important; }

/* --- meters: a labelled bar, for amounts next to each other --- */
.meter { padding: var(--step-2) 0; }
.meter + .meter { border-top: 1px solid var(--border); }
.meter-head { display: flex; justify-content: space-between; gap: var(--step-3); font-size: var(--text-sm); margin-bottom: 4px; }
.meter-track { height: 6px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.meter-fill { height: 100%; background: var(--accent); }

/* --- charts (inline SVG) --- */
.chart { display: block; width: 100%; height: auto; margin-top: var(--step-3); }
.chart .bar { fill: var(--accent); }
.chart .bar.partial { fill: var(--accent-border); }
.chart .axis { font: var(--weight-normal) 11px var(--font); fill: var(--text-faint); }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.chart .area { fill: var(--accent-surface); }

/* --- cards -------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--step-4) var(--step-4);
}
.card-tight { padding: var(--step-3); }
.card + .card { margin-top: var(--step-3); }
.card-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }

/* --- badges ------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 2px var(--step-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  background: var(--idle-surface);
  color: var(--idle-text);
  white-space: nowrap;
}
.badge-ok   { background: var(--ok-surface);   color: var(--ok-text); }
.badge-warn { background: var(--warn-surface); color: var(--warn-text); }
.badge-error  { background: var(--error-surface);  color: var(--error-text); }
.badge-accent { background: var(--accent-surface); color: var(--accent); }
.badge-count { background: var(--accent); color: #fff; border-radius: var(--radius-pill); padding: 1px var(--step-2); }

/* --- status dot --------------------------------------------------- */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--gray-400); }
.dot-ok   { background: var(--ok-text); }
.dot-warn { background: #e8890c; }
.dot-error  { background: var(--error-text); }
.dot-idle{ background: var(--gray-400); }

/* --- message boxes ------------------------------------------------ */
.box {
  border-radius: var(--radius);
  padding: var(--step-3);
  font-size: var(--text-sm);
  line-height: var(--row-height-tight);
  border: 1px solid transparent;
  margin-bottom: var(--step-4);
}
.box-ok   { background: var(--ok-surface);   border-color: var(--ok-border);   color: var(--ok-text); }
.box-warn { background: var(--warn-surface); border-color: var(--warn-border); color: var(--warn-text); }
.box-error  { background: var(--error-surface);  border-color: var(--error-border);  color: var(--error-text); }
.box-info { background: var(--accent-surface); border-color: var(--accent-border); color: var(--accent); }

/* --- forms -------------------------------------------------------- */
.field { display: block; }
.field > label {
  display: block;
  font-size: var(--text-2xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--label-spacing);
  margin-bottom: var(--step-1);
  font-weight: var(--weight-medium);
}
/* A div dressed as a field — used where a control is built out of several
   parts. The fields themselves are the primitive further down; restating it
   here is what let a tick box inherit width:100% and become 636px wide. */
.input-wrap {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--step-2) var(--step-3);
  font: var(--weight-normal) var(--text-md) var(--font);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--fast);
}
.input-wrap:focus { outline: none; border-color: var(--accent); }
.input-wrap:disabled { background: var(--surface-muted); color: var(--text-faint); }
.help-text { font-size: var(--text-xs); color: var(--text-faint); margin-top: var(--step-1); line-height: var(--row-height); }

/* Inline field errors. The browser's own bubbles are turned off with novalidate;
   this is what shows instead. */
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--error-border); }
.field.invalid input:focus { border-color: var(--error-border); box-shadow: 0 0 0 2px var(--error-surface); }
.field-error { font-size: var(--text-xs); color: var(--error-text); margin-top: var(--step-1); line-height: var(--row-height); }

/* --- tabs --------------------------------------------------------- */
.tabs {
  display: flex; gap: 2px; margin-bottom: var(--step-5); flex-wrap: wrap;
  background: var(--surface-muted); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 3px;
}
.tab {
  padding: var(--step-2) var(--step-4);
  font-size: var(--text-md);
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius);
  transition: color var(--fast), background var(--fast), box-shadow var(--fast);
  user-select: none;
  font-weight: var(--weight-medium);
  white-space: nowrap;
}
.tab:hover { color: var(--text); background: var(--surface-hover); }
.tab-active {
  color: var(--text); background: var(--surface);
  box-shadow: var(--shadow-sm); font-weight: var(--weight-medium);
}

/* --- key figures -------------------------------------------------- */
.number-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--step-3); }
.number { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--step-3) var(--step-4); border-top: 3px solid var(--border-strong); }
.number b { display: block; font-size: var(--text-3xl); font-weight: var(--weight-bold); letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.number span { color: var(--text-muted); font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: var(--label-spacing); }
.number-warn { border-top-color: var(--warn-text); }
.number-error { border-top-color: var(--error-text); }
.number-warn b { color: var(--warn-text); }
.number-error b { color: var(--error-text); }

/* --- table ------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: var(--text-2xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--label-spacing);
  font-weight: var(--weight-medium);
  padding: var(--step-3) var(--step-4);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}
.table td { padding: var(--step-2) var(--step-4); border-bottom: 1px solid var(--border); font-size: var(--text-md); }
.table tr:last-child td { border-bottom: none; }
.table tr.muted-row td { color: var(--text-faint); background: var(--surface-muted); }
.table td.narrow { width: 1%; white-space: nowrap; }

/* --- code blocks -------------------------------------------------- */
.code {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--step-2) var(--step-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: var(--row-height-airy);
  white-space: pre-wrap;
  overflow-x: auto;
  color: var(--text);
}
.code .removed { color: var(--error-text); }
.code .to { color: var(--ok-text); }

/* --- empty state -------------------------------------------------- */
.empty { padding: var(--step-7) var(--step-5); text-align: center; color: var(--text-faint); font-size: var(--text-md); line-height: var(--row-height-airy); }

/* --- layout ------------------------------------------------------- */
.page { max-width: var(--max-width); margin: 0 auto; padding: var(--step-6) var(--step-5) var(--step-7); }
.head { display: flex; align-items: baseline; gap: var(--step-3); margin-bottom: var(--step-5); flex-wrap: wrap; }
.head-right { margin-left: auto; display: flex; gap: var(--step-2); align-items: center; }
.shared { display: grid; grid-template-columns: minmax(0, 1fr) var(--sidebar); gap: var(--step-4); align-items: start; }
.shared > * { min-width: 0; }   /* same reason as .with-aside above */
@media (max-width: 900px) { .shared { grid-template-columns: minmax(0, 1fr); } }
.row { display: flex; gap: var(--step-2); align-items: center; flex-wrap: wrap; }
.column { display: flex; flex-direction: column; gap: var(--step-2); }

/* ============================================================
   Overlays: modal, drawer, dropdown, notify
   ============================================================ */

.scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  opacity: 0; pointer-events: none; transition: opacity var(--slow); z-index: 50;
  backdrop-filter: blur(2px);
}
.scrim.visible { opacity: 1; pointer-events: auto; }

/* --- modal --- */
.modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.97);
  width: min(460px, calc(100vw - var(--step-5) * 2));
  /* Never taller than the screen: a long list scrolls inside the dialog. */
  max-height: calc(100vh - var(--step-5) * 2); overflow: auto; box-sizing: border-box;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); padding: var(--step-5); z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity var(--slow), transform var(--slow);
}
.modal.visible { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal-wide { width: min(760px, calc(100vw - var(--step-5) * 2)); }
.modal .body-text .mono { overflow-wrap: anywhere; }
.modal h3 { font-size: var(--text-xl); font-weight: var(--weight-bold); margin: 0 0 var(--step-2); letter-spacing: -.01em; }
.modal .body-text { font-size: var(--text-md); color: var(--text-muted); line-height: var(--row-height-airy); margin-bottom: var(--step-4); }
.modal .button-row { display: flex; gap: var(--step-2); justify-content: flex-end; flex-wrap: wrap; }
.modal-icon {
  width: 38px; height: 38px; border-radius: var(--radius-pill); display: grid; place-items: center;
  font-size: var(--text-xl); margin-bottom: var(--step-3);
}
.modal-icon-danger { background: var(--error-surface); color: var(--error-text); }
.modal-icon-warn { background: var(--warn-surface); color: var(--warn-text); }
.modal-icon-ask { background: var(--accent-surface); color: var(--accent); }

/* --- drawer (slides up from below) --- */
.drawer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  max-height: 88vh; display: flex; flex-direction: column;
  background: var(--surface); border-top: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.18);
  transform: translateY(101%); transition: transform var(--slow);
}
.drawer.visible { transform: translateY(0); }
.drawer-handle {
  width: 38px; height: 4px; border-radius: var(--radius-pill); background: var(--border-strong);
  margin: var(--step-2) auto 0; flex: none;
}
.drawer-head {
  display: flex; align-items: flex-start; gap: var(--step-3);
  padding: var(--step-3) var(--step-5) var(--step-3);
  border-bottom: 1px solid var(--border); flex: none; flex-wrap: wrap;
}
.drawer-head h2 { font-size: var(--text-2xl); font-weight: var(--weight-bold); letter-spacing: -.02em; margin: 0; }
.drawer-body { overflow-y: auto; padding: var(--step-4) var(--step-5) var(--step-6); }
.drawer-inner { max-width: var(--max-width); margin: 0 auto; }
@media (max-width: 700px) { .drawer { max-height: 94vh; } .drawer-body { padding: var(--step-4) var(--step-4) var(--step-6); } }

/* --- dropdown --- */
.select { position: relative; display: inline-block; width: 100%; }
.select-button {
  width: 100%; display: flex; align-items: center; gap: var(--step-2);
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  padding: var(--step-2) var(--step-3); font: var(--weight-normal) var(--text-md) var(--font);
  color: var(--text); cursor: pointer; text-align: left; transition: border-color var(--fast);
}
.select-button:hover { border-color: var(--border-strong); }
.select-button[aria-expanded="true"] { border-color: var(--accent); }
.select-button .label-part { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-button .arrow { color: var(--text-faint); font-size: 10px; transition: transform var(--fast); }
.select-button[aria-expanded="true"] .arrow { transform: rotate(180deg); }

.select-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 70;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: var(--step-1); max-height: 280px; overflow-y: auto;
  opacity: 0; pointer-events: none; transform: translateY(-4px);
  transition: opacity var(--fast), transform var(--fast);
}
.select-list.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.select-option {
  padding: var(--step-2) var(--step-3); border-radius: var(--radius-sm); cursor: pointer;
  font-size: var(--text-md); display: flex; align-items: center; gap: var(--step-2);
}
.select-option:hover, .select-option.selected { background: var(--surface-hover); }
.select-option[aria-selected="true"] { color: var(--accent); font-weight: var(--weight-medium); }
.select-option .caption { display: block; font-size: var(--text-xs); color: var(--text-faint); font-weight: var(--weight-normal); }
.select-group { font-size: var(--text-2xs); color: var(--text-muted); text-transform: uppercase;
              letter-spacing: var(--label-spacing); padding: var(--step-2) var(--step-3) var(--step-1); font-weight: var(--weight-medium); }

/* --- notifications --- */
.notify-layer { position: fixed; right: var(--step-4); bottom: var(--step-4); z-index: 80;
                   display: flex; flex-direction: column; gap: var(--step-2); max-width: 360px; }
.notify {
  background: var(--surface); border: 1px solid var(--border); border-left-width: 3px;
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: var(--step-3) var(--step-4);
  font-size: var(--text-md); display: flex; gap: var(--step-2); align-items: flex-start;
  animation: glid-in var(--slow); 
}
.notify.out { animation: glid-out var(--fast) forwards; }
.notify-ok   { border-left-color: var(--ok-text); }
.notify-warn { border-left-color: var(--warn-text); }
.notify-error  { border-left-color: var(--error-text); }
.notify-info { border-left-color: var(--accent); }
.notify .text { flex: 1; line-height: var(--row-height-tight); }
.notify .icon {
  flex: none; width: 18px; height: 18px; border-radius: var(--radius-pill); margin-top: 1px;
  display: grid; place-items: center; font-size: var(--text-2xs); font-weight: var(--weight-bold);
  background: var(--surface-muted); color: var(--text-muted);
}
.notify-ok .icon    { background: var(--ok-surface);     color: var(--ok-text); }
.notify-warn .icon  { background: var(--warn-surface);   color: var(--warn-text); }
.notify-error .icon { background: var(--error-surface);  color: var(--error-text); }
.notify-info .icon  { background: var(--accent-surface); color: var(--accent); }
.notify .close { background: none; border: none; color: var(--text-faint); cursor: pointer; padding: 0 2px; font-size: var(--text-lg); }
@keyframes glid-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes glid-out { to { opacity: 0; transform: translateX(12px); } }

/* --- checkboxes in list form --- */
.check-row { display: flex; align-items: flex-start; gap: var(--step-3); padding: var(--step-2) 0; }
.check-row input[type="checkbox"] { margin-top: 2px; width: 15px; height: 15px; accent-color: var(--accent); flex: none; }
.check-row .text { flex: 1; }
.check-row .name { font-size: var(--text-md); font-weight: var(--weight-medium); }
.check-row .description { font-size: var(--text-sm); color: var(--text-faint); line-height: var(--row-height); }

/* ============================================================
   Responsive
   ------------------------------------------------------------
   Three breakpoints: 1000px (side panel becomes a row of its own),
   760px (form grid stacks), 560px (lists become cards).
   ============================================================ */

/* Two-column content with a narrower column at the side.
 *
 * min-width: 0 on the columns is not optional. A grid column of 1fr NEVER shrinks
 * below its content's minimum width — and DNS values like
 * "s2.domainkey.u35615465.wl216.sendgrid.net." are wide. Without it the
 * side column is pushed off the screen and the text is cut off mid-word. */
.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--step-5); align-items: start; }
.with-aside > * { min-width: 0; }
@media (max-width: 1000px) {
  .with-aside { grid-template-columns: minmax(0, 1fr); gap: var(--step-4); }
}

/* Form grid that stacks instead of being squeezed together. */
.field-row { display: grid; gap: var(--step-2); align-items: end; }
.field-row-2 { grid-template-columns: 1fr 1fr; }
.field-row-3 { grid-template-columns: 2fr 1fr auto; }
.field-row-4 { grid-template-columns: 1.8fr 1fr 1fr auto; }
@media (max-width: 760px) {
  .filter-pop { position: fixed; left: var(--step-3); right: var(--step-3); top: auto; max-width: none; }
  .field-row-2, .field-row-3, .field-row-4 { grid-template-columns: 1fr; }
  .field-row > .btn, .field-row > button { width: 100%; }
}

/* Tables that do not fit may scroll sideways instead of shrinking
   the text to illegibility. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll > .table { min-width: 520px; }

@media (max-width: 760px) {
  .page, .wrap { padding: var(--step-4) var(--step-3) var(--step-6); }
  .head { gap: var(--step-2); }
  .head-right { width: 100%; margin-left: 0; }
  .heading { font-size: var(--text-xl); }
  .number b { font-size: var(--text-2xl); }
  .number-row { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--step-2); }
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tab { white-space: nowrap; }
  .modal { padding: var(--step-4); }
  .notify-layer { left: var(--step-3); right: var(--step-3); bottom: var(--step-3); max-width: none; }
}

/* The drawer on a small screen: almost full screen, and room for thumb grip. */
@media (max-width: 760px) {
  .drawer { max-height: 92vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .drawer-head { padding: var(--step-3) var(--step-4); }
  .drawer-head h2 { font-size: var(--text-xl); }
  .drawer-head .row { width: 100%; }
  .drawer-body { padding: var(--step-3) var(--step-4) var(--step-6); }
}

/* Two-column cards in admin. */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--step-3); }

/* --- filter panel --- */
.filter-head { display: flex; gap: var(--step-2); align-items: center; flex-wrap: wrap; margin-bottom: var(--step-3); }
.filter-menu { position: relative; }
.filter-button { position: relative; display: inline-flex; align-items: center; gap: 5px; }
.filter-button.active { border-color: var(--accent); color: var(--accent); }
.filter-button .arrow { font-size: 9px; opacity: .6; }
.filter-button .count-badge {
  background: var(--accent); color: #fff; border-radius: var(--radius-pill);
  padding: 0 5px; font-size: var(--text-2xs); font-weight: var(--weight-medium);
}
.filter-summary { margin-left: auto; font-size: var(--text-xs); color: var(--text-faint); font-variant-numeric: tabular-nums; }
/* The menu's content, floating under its button. */
.filter-pop {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 40; min-width: 260px; max-width: 360px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: var(--step-3) var(--step-4);
}
.filter-pop .filter-group .label { display: none; }
.filter-group .label { margin-top: 0; }
.filter-option { display: flex; flex-direction: column; gap: 3px; }
.filter-option label {
  display: flex; align-items: center; gap: var(--step-2);
  font-size: var(--text-sm); cursor: pointer; padding: 3px 0; color: var(--text-muted);
}
.filter-option label:hover { color: var(--text); }
.filter-option input { accent-color: var(--accent); width: 14px; height: 14px; }
.filter-option .counter { margin-left: auto; color: var(--text-faint); font-size: var(--text-xs); }
/* Always drawn, one line high: choosing a filter must not move the list.
   Many chips scroll sideways instead of wrapping onto a second line. */
.active-filters {
  display: flex; gap: var(--step-1); flex-wrap: nowrap; align-items: center;
  height: 28px; margin-bottom: var(--step-3); overflow-x: auto; overflow-y: hidden;
}
.active-filters > * { flex: none; }
/* "Rensa" keeps its place when there is nothing to clear, so the row does not shift. */
.keeps-place { visibility: hidden; }
.active-filter {
  background: var(--accent-surface); border: 1px solid var(--accent-border); color: var(--accent);
  border-radius: var(--radius-pill); padding: 3px var(--step-2); font-size: var(--text-xs);
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
}
.active-filter:hover { border-color: var(--accent); }
/* .x and not .check: .check is the login checkbox label, a flex box with margins. */
.active-filter .x { opacity: .7; font-size: var(--text-sm); line-height: 1; }

/* --- target label with explanation on hover --- */
.target-info { position: relative; cursor: help; border-bottom: 1px dotted var(--border-strong); }
.target-info.unknown { border-bottom-style: dashed; border-bottom-color: var(--warn-text); }
.target-info .tip {
  position: absolute; left: 0; bottom: calc(100% + 7px); z-index: 40;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: var(--step-3); width: 265px;
  font-family: var(--font); font-size: var(--text-sm); line-height: var(--row-height);
  color: var(--text); opacity: 0; pointer-events: none; transition: opacity var(--fast);
  white-space: normal; font-weight: var(--weight-normal);
}
.target-info:hover .tip { opacity: 1; }
.target-info .tip .heading { font-weight: var(--weight-bold); margin-bottom: 3px; display: flex; align-items: center; gap: var(--step-2); }
.target-info .tip .explanation { color: var(--text-muted); }
.target-info .tip .figure { color: var(--text-faint); font-size: var(--text-xs); margin-top: var(--step-2); }

/* --- floating bubbles (live in body, cannot be clipped) --- */
.tip-layer { position: fixed; inset: 0; pointer-events: none; z-index: 200; }
.tip-floating {
  position: fixed; width: 270px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: var(--step-3);
  font: var(--weight-normal) var(--text-sm)/var(--row-height) var(--font); color: var(--text);
  opacity: 0; transition: opacity var(--fast); pointer-events: none;
}
.tip-floating.visible { opacity: 1; }
/* The plain tooltip: one line, the panel's own, instead of the browser's title bubble.
   Inverted colours so it reads on top of anything, in both themes. */
.tip-floating.tip-plain {
  width: auto; max-width: 280px; padding: var(--step-1) var(--step-2);
  background: var(--text); color: var(--surface); border-color: var(--text);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); font-size: var(--text-xs);
}
.tip-floating .heading { font-weight: var(--weight-bold); margin-bottom: 3px; display: flex; align-items: center; gap: var(--step-2); flex-wrap: wrap; }
.tip-floating .explanation { color: var(--text-muted); }
.tip-floating .figure { color: var(--text-faint); font-size: var(--text-xs); margin-top: var(--step-2); display: block; }
.row-info { display: flex; justify-content: space-between; gap: var(--step-3); padding: 2px 0; font-size: var(--text-sm); }
.row-info span:last-child { color: var(--text-muted); text-align: right; }
.tip-floating .row-info { font-size: inherit; }
.tip-floating .row-info span:last-child { color: var(--text-muted); text-align: right; }

.target-info { cursor: help; border-bottom: 1px dotted var(--border-strong); }
.target-info.unknown { border-bottom-style: dashed; border-bottom-color: var(--warn-text); }

/* --- drawer: locked background, own scroll, close cross --- */
body.drawer-open { overflow: hidden; }
.drawer-close {
  width: 30px; height: 30px; border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted); cursor: pointer; font-size: var(--text-lg);
  line-height: 1; display: grid; place-items: center; padding: 0; flex: none;
}
.drawer-close:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border-strong); }

.drawer-body { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.drawer-body::-webkit-scrollbar { width: 10px; }
.drawer-body::-webkit-scrollbar-track { background: transparent; }
.drawer-body::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: var(--radius-pill);
  border: 3px solid var(--surface); background-clip: padding-box;
}
.drawer-body::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: padding-box; }

/* --- multi-select list --- */
.multi-search { margin-bottom: var(--step-2); font-size: var(--text-sm); padding: var(--step-1) var(--step-2); }
.multi-list { overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 3px;
                 scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.multi-list::-webkit-scrollbar { width: 8px; }
.multi-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-pill);
                                          border: 2px solid var(--surface); background-clip: padding-box; }
.multi-row { display: flex; align-items: center; gap: var(--step-2); padding: var(--step-1) var(--step-2);
               border-radius: var(--radius-sm); cursor: pointer; font-size: var(--text-sm); }
.multi-row:hover { background: var(--surface-hover); }
.multi-row.chosen { background: var(--accent-surface); color: var(--accent); }
.multi-row input { accent-color: var(--accent); width: 14px; height: 14px; flex: none; }
.multi-row .label-part { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* domain list in a modal */
.domain-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 3px;
              max-height: 260px; overflow-y: auto; text-align: left; }
.domain-list a { display: block; padding: var(--step-1) var(--step-2); border-radius: var(--radius-sm);
                font-size: var(--text-sm); color: var(--text); text-decoration: none; }
.domain-list a:hover { background: var(--surface-hover); color: var(--accent); }

/* --- password field with eye --- */

.password-field { position: relative; display: flex; align-items: center; }
.password-field input { width: 100%; padding-right: 44px; }

.eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  /* Fixed dimensions, not just width: a broader button rule on the page should not
     be able to blow the eye up to the whole field's width. */
  width: 34px; min-width: 34px; max-width: 34px; height: 34px; padding: 0; margin: 0;
  background: none; border: none; border-radius: var(--radius-sm);
  color: var(--text-faint); cursor: pointer;
}
.eye:hover { color: var(--text); background: var(--surface-hover); }
.eye:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.eye svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.eye .eye-slash {
  stroke-linecap: round;
  /* The stroke is only drawn when the password is SHOWN — the eye is then "struck through",
     which is the established meaning of "hide again". */
  opacity: 0; transition: opacity var(--fast);
}
.eye[aria-pressed="true"] { color: var(--accent); }
.eye[aria-pressed="true"] .eye-slash { opacity: 1; }

/* --- checkbox on the login --- */

.check {
  display: flex; align-items: center; gap: var(--step-2);
  margin: var(--step-4) 0 var(--step-2);
  font-size: var(--text-sm); color: var(--text-muted); cursor: pointer;
  user-select: none; text-align: left;
}
/* flex-shrink: 0 — otherwise flexbox squeezes the box together when the text wraps. */
.check input {
  width: 16px; height: 16px; min-width: 16px; flex-shrink: 0;
  accent-color: var(--accent); cursor: pointer; margin: 0; padding: 0;
}
.check span { line-height: var(--row-height); }

/* --- passkey --- */

/* "or" with a line on each side. */
.divider {
  display: flex; align-items: center; gap: var(--step-3);
  margin: var(--step-4) 0 var(--step-3);
  color: var(--text-faint); font-size: var(--text-xs);
  text-transform: uppercase; letter-spacing: var(--label-spacing);
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.btn-passkey {
  display: flex; align-items: center; justify-content: center; gap: var(--step-2);
  width: 100%; padding: var(--step-3); font-size: var(--text-md);
}
.btn-passkey svg {
  width: 18px; height: 18px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round;
}

/* The list of saved keys. */
.passkey-row {
  display: flex; align-items: center; gap: var(--step-3);
  padding: var(--step-3) 0; border-bottom: 1px solid var(--border);
}
.passkey-row:last-child { border-bottom: none; }
.passkey-row .name { font-weight: var(--weight-medium); }
.passkey-row .when { font-size: var(--text-xs); color: var(--text-faint); }
.passkey-row .right { margin-left: auto; }

/* Long values in the side column should break, not stick out.
   .table-scroll takes care of the tables — it just never worked before, because the
   grid column grew instead of letting the sweep scroll. */
.with-aside .mono,
.row-info span:last-child { overflow-wrap: anywhere; }

/* The connections' health: three states, not two. "Not tested" is not broken. */
.connection-health {
  display: flex; align-items: flex-start; gap: var(--step-2);
  margin: var(--step-3) 0;
  padding: var(--step-2) var(--step-3);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: var(--text-sm);
}
.connection-health .dot { margin-top: 6px; flex-shrink: 0; }
.connection-health b { font-weight: var(--weight-medium); display: block; }
.connection-health .help-text { margin-top: 1px; }
.connection-health.ok  { background: var(--ok-surface);  border-color: var(--ok-border);  color: var(--ok-text); }
.connection-health.error { background: var(--error-surface); border-color: var(--error-border); color: var(--error-text); }
.connection-health.off  { background: var(--surface-muted); }

/* A connection in the list under its service. */
.connection {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--step-3); margin-top: var(--step-3);
}
.connection-head { display: flex; align-items: flex-start; gap: var(--step-3); flex-wrap: wrap; }
.connection-name { font-weight: var(--weight-medium); display: flex; align-items: center; gap: var(--step-2); }
.connection .connection-health { margin-bottom: 0; }

.connection-form {
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  padding: var(--step-3); margin-top: var(--step-3); background: var(--surface-muted);
}
.connection-form[hidden] { display: none; }

/* --- lightbox for screenshots --- */
.lightbox {
  position: fixed; inset: 50% auto auto 50%; transform: translate(-50%, -48%) scale(.98);
  z-index: 1100; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: var(--step-3); opacity: 0; transition: opacity .18s, transform .18s;
  max-width: min(92vw, 1100px); max-height: 90vh; display: flex; flex-direction: column;
}
.lightbox.visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.lightbox-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--step-4);
  margin-bottom: var(--step-2);
}
.lightbox-caption { color: var(--text-faint); font-size: var(--text-sm); margin-left: var(--step-2); }
/* A whole page can be several thousand pixels tall. If it is shrunk to fit it becomes
   illegible — the whole point of opening it disappears. The image is therefore shown
   at its width, and the box scrolls. */
.lightbox-image {
  overflow: auto; max-height: calc(90vh - 72px);
  border-radius: var(--radius); background: var(--surface-muted);
  -webkit-overflow-scrolling: touch;
}
.lightbox img { display: block; width: 100%; height: auto; }

/* --- the strip with earlier screenshots --- */
.thumb-strip { display: flex; gap: var(--step-2); overflow-x: auto; padding-bottom: var(--step-1); }
.thumb-strip button {
  flex: 0 0 auto; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-muted); cursor: pointer; line-height: 0; overflow: hidden;
}
.thumb-strip button:hover { border-color: var(--accent); }
.thumb-strip img { width: 104px; height: 65px; object-fit: cover; object-position: top center; display: block; }
.thumb-strip .when {
  display: block; font-size: var(--text-2xs); color: var(--text-faint);
  padding: 2px 4px; line-height: 1.3; text-align: center; background: var(--surface);
}
.thumb-strip .broken {
  width: 104px; height: 65px; display: flex; align-items: center; justify-content: center;
  font-size: var(--text-2xs); color: var(--text-faint); text-align: center; padding: 0 4px;
}

/* --- the modal that asks for a value --- */
.modal-ask { text-align: left; }
.modal-ask h3 { text-align: left; }
.modal-ask .field { display: block; margin: var(--step-4) 0 0; }
.modal-ask .field > span {
  display: block; font-size: var(--text-xs); color: var(--text-muted);
  margin-bottom: var(--step-1); font-weight: var(--weight-medium);
}
.modal-ask input {
  width: 100%; font: var(--weight-normal) var(--text-md) var(--font);
  padding: var(--step-2) var(--step-3); border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); color: var(--text);
}
.modal-ask input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-surface);
}
.modal-ask .button-row { margin-top: var(--step-4); }

/* --- secret shown only once --- */
.modal-secret { text-align: left; }
.modal-secret h3 { text-align: left; }
.secret-row {
  display: flex; gap: var(--step-2); align-items: stretch;
  margin: var(--step-3) 0;
}
.secret-row code {
  flex: 1; min-width: 0; background: var(--surface-muted);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--step-2) var(--step-3);
  font-family: var(--font-mono); font-size: var(--text-sm);
  word-break: break-all; user-select: all; line-height: var(--row-height);
}
.secret-row button { flex: 0 0 auto; align-self: flex-start; }

/* The copy button must NEVER change width. When the text changed to "Kopierat ✓"
   the whole box was pushed sideways every time you pressed it. Now only the colour changes, and
   the tick sits on top of the text instead of beside it. */
.secret-row [data-copy] {
  min-width: 104px; justify-content: center; position: relative;
  transition: background var(--fast), border-color var(--fast), color var(--fast);
}
.secret-row [data-copy] span { display: inline-block; transition: opacity var(--fast); }
.secret-row [data-copy].copied {
  background: var(--ok-surface); border-color: var(--ok-border); color: var(--ok-text);
}
.secret-row [data-copy].copied span { opacity: 0; }
.secret-row [data-copy].copied::after {
  content: "Kopierat ✓"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: var(--weight-medium);
}

/* The cards in a grid should be equally tall even when the texts are of different length,
   and the button should line up at the bottom — otherwise the row looks untidy.
   align-items: stretch is not enough: the cards ended up with the bottoms aligned and
   the tops at different heights. The height is therefore set explicitly. */
.card-grid { align-items: stretch; }
.card-grid > .card {
  display: flex; flex-direction: column;
  align-self: stretch; height: 100%; margin: 0;
}
/* The button is pushed down by margin-top: auto. An inline margin in the markup beats
   it, so the space above comes from a spacing of its own instead. */
.card-grid > .card > .btn-wide { margin-top: auto; }
/* The gap above the button sits on the element BEFORE it. A ::before spacer
   inside the button made the button itself 75 px tall. */
.card-grid > .card > :has(+ .btn-wide) { margin-bottom: var(--step-4); }

/* --- what a connection may do --- */
.capability {
  display: flex; gap: var(--step-3); align-items: flex-start;
  padding: var(--step-3) 0; border-bottom: 1px solid var(--border);
}
.capability:last-child { border-bottom: none; }
.capability > .dot { margin-top: 7px; flex-shrink: 0; }
.capability b { font-weight: var(--weight-medium); }

/* ---------- the drawer ---------- */

/* The drawer is a quick peek, not a page. Its own, smaller scale lets more
   fit without anything having to be removed — and clearly sets it apart from the
   domain page, which is where you work. */
.drawer-inner { font-size: var(--text-sm); }
.drawer-inner .card { padding: var(--step-3); }
.drawer-inner .label { margin-top: var(--step-4); }
.drawer-inner .meta { padding: 3px 0; }
.drawer-inner .table td,
.drawer-inner .table th { padding: var(--step-1) var(--step-2); }
/* An SPF line or a DKIM value has no spaces to break at. Without
   this they push out the column and the text is cut off mid-word. */
.drawer-inner .table td { overflow-wrap: anywhere; }

/* The way forward. It used to be a blue box that took as much space as the content;
   now a line you read once and then stop seeing. */
.drawer-guide {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: var(--step-1) var(--step-3);
  font-size: var(--text-xs);
  padding-bottom: var(--step-3);
  margin-bottom: var(--step-4);
  border-bottom: 1px solid var(--border);
}
.drawer-guide a { color: var(--accent); text-decoration: none; font-weight: var(--weight-medium); }
.drawer-guide a:hover { text-decoration: underline; }

/* The image and facts side by side at the top. The image gets a fixed width so that
   the facts column does not jump depending on how tall the screenshot happens to be. */
.drawer-hero {
  display: grid;
  /* Both columns capped. Letting the facts take the whole drawer put the
     label at one edge and the value at the other, 600 px apart — a pair you
     have to track with a finger to read. */
  /* Bild, fakta och tolkningen bredvid varandra. Tolkningen låg förut långt
     ner till höger, så det man öppnade drawern för att få veta — vad domänen
     faktiskt gör — krävde att man skrollade. */
  grid-template-columns: minmax(0, 260px) minmax(0, 330px) minmax(0, 1fr);
  justify-content: start;
  gap: var(--step-5);
  align-items: start;
  margin-bottom: var(--step-5);
}
.drawer-hero > * { min-width: 0; }
.hero-shot .card { padding: var(--step-2); }
/* The explanation about where the image is rendered belongs where you take the image, not at
   the top of a quick peek. It stays on the domain page's overview. */
.hero-shot .help-text { display: none; }
/* Facts sit tight and without a border — they are an enumeration, not a card. */
.hero-facts { display: flex; flex-direction: column; }
.hero-facts .meta:first-child { padding-top: 0; }
/* Label and value next to each other, not pushed to opposite edges. */
.hero-facts .meta {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: var(--step-2);
}
.hero-facts .meta > span:last-child { text-align: left; font-weight: var(--weight-medium); }

/* Nothing photographed yet. Without a height the card is a thin empty strip
   next to a tall column of facts; with one it reads as a place for a picture. */
.hero-shot .card:has(.help-text:only-child),
.hero-shot .card:has(> .box) {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-shot .shot { max-height: 220px; object-fit: cover; object-position: top; }

/* The interpretation of the zone, at the top where the question is. */
.hero-setup { min-width: 0; }
.hero-setup .label:first-child { margin-top: 0; }

/* The jump links live beside the title now, not on a row of their own. */
.drawer-jump { display: flex; flex-wrap: wrap; gap: var(--step-2); align-items: center; }
.drawer-jump .btn { text-decoration: none; }

@media (max-width: 1100px) {
  .drawer-hero { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); }
  .hero-setup { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .drawer-hero { grid-template-columns: minmax(0, 1fr); }
  .hero-shot .shot { max-height: 180px; }
}

/* The services the domain is connected to. The name first and what it is underneath —
   "Resend" says more than "SPF include:_spf.resend.com", and the traces remain
   in title for anyone who wants to see them. */
.service-chips { display: flex; flex-wrap: wrap; gap: var(--step-2); }
.service-chip {
  display: flex; flex-direction: column; gap: 1px;
  padding: var(--step-1) var(--step-2);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); line-height: 1.25;
}
.service-chip b { font-size: var(--text-sm); font-weight: var(--weight-medium); }
.service-chip span { font-size: var(--text-2xs); color: var(--text-faint); }

/* The brand. The logo is optional — without it the name stands alone, as before. */
.brand-logo { display: block; max-width: 148px; max-height: 32px; margin-bottom: var(--step-1); }
.login-logo { display: block; max-width: 200px; max-height: 56px; margin: 0 auto var(--step-3); }
.login-note { margin: calc(-1 * var(--step-2)) 0 var(--step-4); color: var(--text-muted); font-size: var(--text-sm); }

/* An error message can contain a long string without spaces —
   "gotoOptions/waitForSelector/waitForTimeout" — and it pushed the box out
   over the column next to it. */
.box { overflow-wrap: anywhere; }

/* A per-project field in a connection form: one row per project. */
.per-project-row {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) 1fr auto;
  gap: var(--step-2);
  align-items: center;
  margin-top: var(--step-2);
}
.per-project-name { display: flex; align-items: center; gap: var(--step-2); font-weight: 500; }
@media (max-width: 640px) {
  .per-project-row { grid-template-columns: 1fr; }
}

/* Folded step-by-step help under a field. */
.steps { margin-top: var(--step-3); font-size: var(--text-sm); color: var(--text-muted); }
.steps summary { cursor: pointer; color: var(--accent); }
.steps ol { margin: var(--step-2) 0 0; padding-left: 1.4em; }
.steps li { margin-top: var(--step-1); }

/* Type-to-confirm in a dialog: the word to type, and the field for it. */
.modal .confirm-word { display: flex; flex-direction: column; gap: var(--step-2); margin-bottom: var(--step-4); font-size: var(--text-sm); color: var(--text-muted); }
.modal .confirm-word input { font-family: var(--font-mono); letter-spacing: .08em; text-transform: uppercase; max-width: 240px; }
.modal .button-row button:disabled { opacity: .5; cursor: not-allowed; }

/* --- favourites --- */
.fav-star {
  background: none; border: none; padding: 0 var(--step-1) 0 0; margin: 0; cursor: pointer;
  font-size: var(--text-md); line-height: 1; color: var(--text-faint); vertical-align: baseline;
}
.fav-star:hover, .fav-star:focus-visible { color: var(--warn-text); }
.fav-star.on { color: var(--warn-text); }
.list-tabs { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; flex: none; }
.list-tab { background: var(--surface); border: none; padding: var(--step-1) var(--step-3); font-size: var(--text-sm); color: var(--text-muted); cursor: pointer; }
.list-tab + .list-tab { border-left: 1px solid var(--border); }
.list-tab.on { background: var(--accent-surface); color: var(--accent); font-weight: var(--weight-medium); }
.list-tab .tab-count { font-variant-numeric: tabular-nums; }
.fav-star.heading-star { font-size: var(--text-xl); padding-right: var(--step-2); vertical-align: 0.05em; }
.badge.proxied { background: var(--warn-surface); color: var(--warn-text); margin-left: 2px; }

/* ---------- a change being written ---------- */

/* A write to the provider is one call per record, so it takes a while. The
   buttons are replaced by this while it runs: the proposal cannot be approved
   twice by accident, and what is happening is visible rather than implied by a
   greyed-out button. */
.applying {
  border: 1px solid var(--accent-border);
  background: var(--accent-surface);
  border-radius: var(--radius);
  padding: var(--step-3);
  margin-top: var(--step-3);
}
.apply-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--accent-border);
  overflow: hidden;
}
/* Indeterminate: the panel cannot know how far a write has come, so the bar
   says "running", not "62 %". */
.apply-bar span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  animation: apply-slide 1.1s ease-in-out infinite;
}
@keyframes apply-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}
@media (prefers-reduced-motion: reduce) {
  .apply-bar span { animation: none; width: 100%; opacity: 0.6; }
}
.apply-text {
  display: flex;
  flex-wrap: wrap;
  gap: var(--step-1) var(--step-2);
  align-items: baseline;
  margin-top: var(--step-2);
  font-size: var(--text-sm);
}
.apply-text span { color: var(--text-muted); }
.apply-elapsed { font-variant-numeric: tabular-nums; }

/* The names of the DNS services need a label — on their own they look like a
   list of brands with no connection to the change above them. */
.prop-label {
  color: var(--text-faint);
  font-size: var(--text-2xs);
  margin-right: var(--step-1);
}

/* One line per thing the zone sets up. The separator belongs BETWEEN them —
   a border under the last row draws a line to nothing, just inside the card's
   own edge, and that is what it looks like: a mistake. */
.configured-row {
  align-items: flex-start;
  gap: var(--step-2);
  padding: var(--step-2) 0;
  border-bottom: 1px solid var(--border);
}
.configured-row:last-child { border-bottom: none; padding-bottom: 0; }
.configured-row:first-child { padding-top: 0; }

/* ---------- search over everything ---------- */

.search-open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--step-2);
  width: 100%;
  margin: 0 0 var(--step-3);
  padding: var(--step-2) var(--step-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--text-sm);
  cursor: pointer;
}
.search-open:hover { border-color: var(--border-strong); color: var(--text); }
.search-open kbd {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 4px;
}

/* Over the page, not inside the sidebar: grouped results from six kinds of
   thing need more room than a 230 px column. */
.search-palette { position: fixed; inset: 0; z-index: 70; }
.search-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.3); }
.search-box {
  position: relative;
  width: min(680px, calc(100vw - 2 * var(--step-4)));
  margin: 10vh auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.search-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: var(--step-4);
  font-size: var(--text-lg);
  background: transparent;
  color: var(--text);
}
.search-input:focus { outline: none; }
.search-results { max-height: min(56vh, 520px); overflow-y: auto; }
.search-group { padding: var(--step-2) 0; border-bottom: 1px solid var(--border); }
.search-group:last-child { border-bottom: none; }
.search-group-title {
  display: flex;
  justify-content: space-between;
  padding: var(--step-1) var(--step-4);
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}
.search-hit {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  padding: var(--step-2) var(--step-4);
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
}
.search-hit.on,
.search-hit:hover { background: var(--accent-surface); }
.search-hit-title { font-size: var(--text-md); font-weight: var(--weight-medium); color: var(--text); }
.search-hit-detail {
  font-size: var(--text-xs);
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.search-foot {
  display: flex;
  gap: var(--step-4);
  padding: var(--step-2) var(--step-4);
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
  font-size: var(--text-2xs);
  color: var(--text-faint);
}
.search-foot kbd {
  font-family: var(--font-mono);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 3px;
  margin-right: 2px;
}

/* ============================================================
   Form controls
   ------------------------------------------------------------
   One rule for every field in the panel. Before this there was no styling
   for `input` at all — only for a dozen component-specific selectors — so a
   form that did not happen to use one of them got the browser's default: a
   white box, in a dark interface.

   Components may change width or placement. They should not restate the
   colours, the height or the border; that is what made them drift.
   ============================================================ */

input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='range']),
select,
textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--control-height);
  padding: var(--control-padding);
  font: var(--weight-normal) var(--text-md) var(--font);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  /* Without this the OS draws its own control on macOS, which ignores the
     colours above and is why a dropdown looked nothing like the box next
     to it. */
  appearance: none;
}

textarea {
  min-height: calc(var(--control-height) * 2);
  resize: vertical;
  line-height: var(--row-height);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}

input:disabled,
select:disabled,
textarea:disabled {
  color: var(--text-faint);
  background: var(--surface-sunken);
  cursor: not-allowed;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

/* The dropdown arrow. appearance:none removes the OS one, so it is drawn
   here — as a token colour, so it follows the theme instead of staying dark
   on a dark field. */
select {
  padding-right: calc(var(--step-3) * 2 + 10px);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - var(--step-3) - 5px) calc(50% - 1px),
    calc(100% - var(--step-3)) calc(50% - 1px);
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
}

/* A number that is read rather than typed into: tabular figures so a column
   of them lines up. */
input[inputmode='numeric'] {
  font-variant-numeric: tabular-nums;
}
