/* LinkRadar — survey-instrument look: cool map paper, deep teal-ink, one signal green
   reserved for "this domain is free". */
:root {
  --paper: #e7ece9;
  --surface: #f6f8f6;
  --surface-2: #dfe6e2;
  --ink: #142329;
  --ink-2: #4a5d63;
  --ink-3: #6f8186;
  --line: #c3cec9;
  --line-strong: #93a39e;
  --accent: #1f4fbf;          /* actions */
  --accent-ink: #ffffff;
  --accent-soft: #dbe4f8;
  --free: #087a4c;            /* available — the one loud colour */
  --free-soft: #cdeedd;
  --urgent: #b4401b;          /* pending delete / redemption */
  --urgent-soft: #f6dccf;
  --warn: #8a6100;            /* parked / expired / grace */
  --warn-soft: #f1e4c2;
  --mute-soft: #e1e6e4;
  --focus: #1f4fbf;
  --radius-s: 6px;
  --radius-m: 10px;
  --shadow-pop: 0 18px 50px -12px rgba(9, 25, 31, .35);
  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --step--1: .8125rem;
  --step-0: .9375rem;
  --step-1: 1.125rem;
  --step-2: 1.375rem;
  --step-3: 1.75rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f181b;
    --surface: #152125;
    --surface-2: #1c2b30;
    --ink: #dce7e4;
    --ink-2: #a3b4b2;
    --ink-3: #7e908f;
    --line: #2a3c41;
    --line-strong: #46595d;
    --accent: #7ea2ff;
    --accent-ink: #0d1530;
    --accent-soft: #1d2b4f;
    --free: #3fd18f;
    --free-soft: #11392a;
    --urgent: #ff8a62;
    --urgent-soft: #45231a;
    --warn: #e7b84a;
    --warn-soft: #3a2f14;
    --mute-soft: #1f2d31;
    --focus: #9db8ff;
    --shadow-pop: 0 18px 50px -12px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  --paper: #0f181b; --surface: #152125; --surface-2: #1c2b30; --ink: #dce7e4; --ink-2: #a3b4b2;
  --ink-3: #7e908f; --line: #2a3c41; --line-strong: #46595d; --accent: #7ea2ff; --accent-ink: #0d1530;
  --accent-soft: #1d2b4f; --free: #3fd18f; --free-soft: #11392a; --urgent: #ff8a62; --urgent-soft: #45231a;
  --warn: #e7b84a; --warn-soft: #3a2f14; --mute-soft: #1f2d31; --focus: #9db8ff;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.5 var(--font);
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
}
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 650; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; color: var(--ink); flex: none; }
.brand-blip { fill: var(--free); }
.brand h1 { font-size: var(--step-1); font-stretch: 85%; letter-spacing: -.01em; }
.brand-sub { color: var(--ink-2); font-size: var(--step--1); }
.top-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.usage { color: var(--ink-2); font-size: var(--step--1); }
.key-pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-strong); background: transparent; border-radius: 999px;
  padding: 5px 12px; cursor: pointer; font-size: var(--step--1);
}
.key-pill:hover { background: var(--surface-2); }
.key-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--urgent); }
.key-pill.ok .key-dot { background: var(--free); }

/* ---------------------------------------------------------------- layout */
.layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  align-items: start;
  min-height: calc(100vh - 64px);
}
.setup {
  border-right: 1px solid var(--line);
  padding: 22px 24px 40px;
  background: var(--surface);
  position: sticky; top: 0;
  max-height: 100vh; overflow-y: auto;
  scrollbar-width: thin;
}
.results { padding: 22px 28px 40px; min-width: 0; }
.results:focus { outline: none; }
.panel-title { font-size: var(--step-2); font-stretch: 85%; letter-spacing: -.01em; }

/* ---------------------------------------------------------------- form */
#scanForm { display: flex; flex-direction: column; gap: 20px; margin-top: 18px; }
.field { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.field > label, .field > legend, .modal label { font-weight: 600; font-size: var(--step--1); padding: 0; }
.count-hint { color: var(--ink-3); font-weight: 400; }
.help { color: var(--ink-2); font-size: var(--step--1); }
select, input[type="text"], input[type="number"], input[type="search"], input[type="password"] {
  width: 100%; min-height: 40px; padding: 8px 10px;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius-s);
}
select:hover, input:hover { border-color: var(--ink-3); }
input::placeholder { color: var(--ink-3); }
.inline-add { display: flex; gap: 8px; }
.inline-add input { flex: 1; min-width: 0; }
.mini-actions { display: flex; gap: 14px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: var(--step--1); text-decoration: underline; text-underline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line-strong); background: transparent; border-radius: 999px;
  padding: 4px 11px; font-size: var(--step--1); cursor: pointer; line-height: 1.4;
  transition: background-color .12s, border-color .12s;
}
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip .x { margin-left: 6px; opacity: .7; }

.cat-group { border-top: 1px solid var(--line); padding: 10px 0 2px; }
.cat-group:first-child { border-top: 0; padding-top: 0; }
.cat-group-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.cat-group-head h4 { margin: 0; font-size: var(--step--1); font-weight: 600; color: var(--ink-2); }

.segmented { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line-strong); border-radius: var(--radius-s); overflow: hidden; }
.segmented button { border: 0; border-left: 1px solid var(--line-strong); background: transparent; padding: 8px 0; cursor: pointer; }
.segmented button:first-child { border-left: 0; }
.segmented button[aria-checked="true"] { background: var(--ink); color: var(--paper); }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--step--1); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.check.compact { align-items: center; }

.estimate {
  border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px;
  background: var(--paper); font-size: var(--step--1); display: grid; gap: 4px;
}
.estimate:empty { display: none; }
.estimate strong { font-size: var(--step-1); font-weight: 650; }
.estimate .cost-free { color: var(--free); font-weight: 600; }
.estimate .cost-paid { color: var(--urgent); font-weight: 600; }
.form-error { color: var(--urgent); font-size: var(--step--1); }
.form-error:empty { display: none; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px; border-radius: var(--radius-s);
  border: 1px solid transparent; cursor: pointer; font-weight: 600; text-decoration: none;
}
.btn.small { min-height: 32px; padding: 4px 12px; font-size: var(--step--1); }
.btn.wide { width: 100%; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.primary:active { filter: brightness(.95); }
.btn.ghost { background: transparent; border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; filter: none; }
.btn.busy::after {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { background: transparent; border: 0; width: 36px; height: 36px; border-radius: var(--radius-s); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------------------------------------------------------------- progress */
.progress {
  margin-top: 16px; padding: 14px 16px; display: grid; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius-m);
}
.progress.done { border-left-color: var(--free); }
.progress.failed { border-left-color: var(--urgent); }
.prog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.prog-head h3 { font-size: var(--step-1); }
.prog-phase { color: var(--ink-2); font-size: var(--step--1); margin-top: 2px; }
.progress.failed .prog-phase { color: var(--urgent); }
.bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s ease; }
.progress.done .bar span { background: var(--free); }
.prog-stats { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0; font-size: var(--step--1); }
.prog-stats div { display: grid; }
.prog-stats dt { color: var(--ink-2); }
.prog-stats dd { margin: 0; font-weight: 650; font-size: var(--step-1); }
.prog-stats .hit { color: var(--free); }
.prog-details summary { cursor: pointer; font-size: var(--step--1); color: var(--ink-2); width: fit-content; }
.prog-log { list-style: none; margin: 8px 0 0; padding: 0; max-height: 200px; overflow-y: auto; font-size: var(--step--1); color: var(--ink-2); display: flex; flex-direction: column-reverse; }
.prog-log li { padding: 3px 0; border-bottom: 1px dashed var(--line); }

/* ---------------------------------------------------------------- results */
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.results-actions { display: flex; gap: 8px; }
.filters { margin: 16px 0 14px; display: grid; gap: 12px; }
.status-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.sfilter {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius-s);
  padding: 5px 10px; cursor: pointer; font-size: var(--step--1);
}
.sfilter .n { color: var(--ink-3); }
.sfilter[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sfilter[aria-pressed="true"] .n { color: var(--ink); }
.sfilter.preset { font-weight: 600; }
.filter-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.filter-row input[type="search"] { width: 220px; }
.filter-row select { width: auto; }
.inline-num { display: inline-flex; align-items: center; gap: 8px; font-size: var(--step--1); white-space: nowrap; }
.inline-num input { width: 72px; }

.table-wrap { border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); overflow: hidden; }
.dtable { width: 100%; border-collapse: collapse; }
.dtable th {
  text-align: left; font-size: var(--step--1); font-weight: 600; color: var(--ink-2);
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.dtable td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.dtable tr:last-child td { border-bottom: 0; }
.dtable .num { text-align: right; }
.dtable tbody tr { cursor: pointer; }
.dtable tbody tr:hover { background: var(--surface-2); }
.dtable tbody tr.free { background: color-mix(in srgb, var(--free-soft) 55%, transparent); }
.dtable tbody tr.free:hover { background: var(--free-soft); }
.dom-btn {
  background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
  font-weight: 650; font-size: var(--step-0); overflow-wrap: anywhere;
}
.dom-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.dom-note { display: block; color: var(--ink-3); font-size: var(--step--1); margin-top: 2px; }
.own-flag { color: var(--warn); }

.pill {
  display: inline-block; white-space: nowrap; font-size: var(--step--1); font-weight: 600;
  padding: 2px 9px; border-radius: 999px; background: var(--mute-soft); color: var(--ink-2);
}
.pill.s-available, .pill.s-likely_available { background: var(--free); color: var(--surface); }
.pill.s-likely_available { background: var(--free-soft); color: var(--free); }
.pill.s-pending_delete, .pill.s-redemption { background: var(--urgent-soft); color: var(--urgent); }
.pill.s-grace, .pill.s-expired, .pill.s-parked, .pill.s-dead, .pill.s-expiring { background: var(--warn-soft); color: var(--warn); }

.biz { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.biz-bar { width: 64px; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.biz-bar span { display: block; height: 100%; background: var(--ink-2); }
tr.free .biz-bar span { background: var(--free); }
.biz strong { min-width: 2.5ch; text-align: right; }
.muted { color: var(--ink-3); }
.cities { color: var(--ink-2); font-size: var(--step--1); }

.empty { padding: 48px 24px; text-align: center; color: var(--ink-2); display: grid; gap: 8px; justify-items: center; }
.empty strong { color: var(--ink); font-size: var(--step-1); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: var(--step--1); color: var(--ink-2); gap: 12px; }
.pager div { display: flex; gap: 8px; }

/* ---------------------------------------------------------------- drawer */
.scrim { position: fixed; inset: 0; background: rgba(8, 18, 22, .38); z-index: 30; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%);
  background: var(--surface); z-index: 31; box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column;
  animation: slide-in .22s ease-out;
}
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: var(--step-3); font-stretch: 85%; overflow-wrap: anywhere; letter-spacing: -.015em; }
.drawer-head p { margin-top: 6px; }
.drawer-body { padding: 18px 22px 32px; overflow-y: auto; display: grid; gap: 22px; align-content: start; }
.action-box { border-left: 3px solid var(--ink-3); padding: 2px 0 2px 14px; display: grid; gap: 8px; }
.action-box.s-available, .action-box.s-likely_available { border-color: var(--free); }
.action-box.s-pending_delete, .action-box.s-redemption { border-color: var(--urgent); }
.action-box.s-grace, .action-box.s-expired, .action-box.s-parked, .action-box.s-dead, .action-box.s-expiring { border-color: var(--warn); }
.action-box h3 { font-size: var(--step-1); }
.action-links { display: flex; flex-wrap: wrap; gap: 8px; }
.warn-note { background: var(--warn-soft); color: var(--ink); border-radius: var(--radius-s); padding: 10px 12px; font-size: var(--step--1); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: var(--step--1); }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.section-title { font-size: var(--step-0); font-weight: 650; margin-bottom: 8px; }
.biz-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.biz-list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; font-size: var(--step--1); }
.biz-list .bname { font-weight: 600; font-size: var(--step-0); }
.biz-list .burl { color: var(--ink-3); overflow-wrap: anywhere; }

.signals { margin: 0; padding-left: 18px; font-size: var(--step--1); color: var(--ink-2); display: grid; gap: 2px; }
.verify .action-links { margin-bottom: 8px; }
.link-out { font-size: var(--step--1); width: fit-content; margin-top: 4px; }
.ev-wrap summary { cursor: pointer; font-weight: 600; font-size: var(--step--1); }
.evidence { margin-top: 10px; }
.ev-head { font-size: var(--step--1); color: var(--ink-2); overflow-wrap: anywhere; margin-bottom: 4px; }
.evidence pre {
  margin: 0; max-height: 260px; overflow: auto; padding: 10px 12px; border-radius: var(--radius-s);
  background: var(--paper); border: 1px solid var(--line); font-size: 12px; line-height: 1.45;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.banner { margin: 14px 0 0; }
.pill.s-on_hold { background: var(--urgent-soft); color: var(--urgent); }
.pill.s-new_reg { background: var(--warn-soft); color: var(--warn); }
.action-box.s-on_hold { border-color: var(--urgent); }
.action-box.s-new_reg { border-color: var(--warn); }
.ttable { width: 100%; border-collapse: collapse; min-width: 560px; font-size: var(--step--1); }
.ttable th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.ttable td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ttable tr:last-child td { border-bottom: 0; }
.ttable tr.fail { background: color-mix(in srgb, var(--urgent-soft) 60%, transparent); }
.ok-text { color: var(--free); }
.fail-text { color: var(--urgent); }

/* ---------------------------------------------------------------- watchlist & notifications */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bell svg { width: 16px; height: 16px; }
.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--urgent); color: #fff;
  font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1;
}
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tabs [role="tab"] {
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 8px 4px; margin-right: 18px; cursor: pointer; font-size: var(--step-1); font-weight: 650;
  font-stretch: 85%; color: var(--ink-3);
}
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tabs [role="tab"]:hover { color: var(--ink); }
.tab-n { font-size: var(--step--1); font-weight: 600; color: var(--ink-3); margin-left: 4px; }
.watch-intro { margin: 16px 0 12px; max-width: 72ch; }
.watch-add { margin-bottom: 14px; max-width: 520px; }
.watch-flag { color: var(--accent); }
.wtable td.num { text-align: right; }
.slot { display: grid; gap: 6px; }
.slot-state { font-weight: 400; color: var(--ink-3); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.modal code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.modal fieldset.field { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; }
.notif-list { list-style: none; margin: 0; padding: 0; max-height: min(60vh, 520px); overflow-y: auto; border-top: 1px solid var(--line); }
.notif { border-bottom: 1px solid var(--line); }
.notif-btn {
  width: 100%; text-align: left; background: none; border: 0; padding: 12px 4px 12px 14px; cursor: pointer;
  display: grid; gap: 3px; border-left: 3px solid transparent; font-size: var(--step--1); color: var(--ink-2);
}
.notif-btn strong { font-size: var(--step-0); color: var(--ink); }
.notif-btn:hover { background: var(--surface-2); }
.notif.unread .notif-btn { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.notif.lvl-urgent .notif-btn { border-left-color: var(--free); }
.notif.lvl-high .notif-btn { border-left-color: var(--urgent); }
.notif.lvl-info .notif-btn { border-left-color: var(--line-strong); }
.notif-top { display: flex; justify-content: space-between; gap: 8px; }
.notif-level { font-weight: 650; color: var(--ink); }
.notif-list .empty { padding: 32px 12px; }

/* ---------------------------------------------------------------- modal / toast */
.modal {
  border: 0; border-radius: var(--radius-m); padding: 0; width: min(520px, calc(100% - 32px));
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop);
}
.modal::backdrop { background: rgba(8, 18, 22, .45); }
.modal form, .modal-inner { padding: 22px; display: grid; gap: 12px; }
.wide-modal { width: min(820px, calc(100% - 32px)); }
.wide-modal .table-wrap { overflow-x: auto; }
.modal h2 { font-size: var(--step-2); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: var(--step--1); color: var(--ink-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 40;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--radius-s);
  font-size: var(--step--1); box-shadow: var(--shadow-pop); max-width: calc(100% - 32px);
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); }
  .results { padding: 20px; }
  .dtable th:nth-child(5), .dtable td:nth-child(5) { display: none; }
}
@media (max-width: 820px) {
  .topbar { padding: 12px 16px; align-items: flex-start; }
  .brand-sub { display: none; }
  .usage { display: none; }
  .layout { grid-template-columns: 1fr; }
  .setup { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); padding: 18px 16px 24px; }
  .results { padding: 18px 16px 32px; }
  .status-filter { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  .sfilter { flex: none; }
  .filter-row input[type="search"] { width: 100%; }
  .filter-row select { width: 100%; }
  /* table becomes a list */
  .dtable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .dtable, .dtable tbody, .dtable tr, .dtable td { display: block; }
  .dtable tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .dtable tr:last-child { border-bottom: 0; }
  .dtable td { padding: 0; border: 0; }
  .dtable td:nth-child(1) { grid-column: 1; }
  .dtable td:nth-child(2) { grid-column: 2; grid-row: 1; text-align: right; }
  .dtable td:nth-child(3) { grid-column: 2; grid-row: 2; }
  .dtable td:nth-child(4) { grid-column: 1; grid-row: 2; }
  .dtable td:nth-child(5) { display: none; }
  .biz-bar { display: none; }
  .wtable td:nth-child(3) { grid-column: 1 / -1; grid-row: auto; }
  .wtable td:nth-child(4) { display: block; grid-column: 1; grid-row: auto; }
  .bell span:not(.badge) { display: none; }
  .top-meta { gap: 8px; }
  .drawer { top: auto; height: 88vh; width: 100%; border-radius: 14px 14px 0 0; animation-name: rise; }
  @keyframes rise { from { transform: translateY(30px); opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.slot .link-btn { justify-self: start; }

/* ---------------------------------------------------------------- automatic registration */
.reg-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface);
  margin-bottom: 12px; font-size: var(--step--1); color: var(--ink-2); }
.reg-bar.live { border-color: var(--urgent); background: color-mix(in srgb, var(--urgent-soft) 45%, var(--surface)); color: var(--ink); }
.auto-cell { display: grid; gap: 2px; }
.auto-cell .check { font-size: var(--step--1); }
.reg-registered { color: var(--free); font-weight: 600; }
.reg-failed, .reg-unknown, .reg-blocked { color: var(--urgent); font-weight: 600; }
.reg-buying { color: var(--accent); font-weight: 600; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 820px) {
  .wtable td:nth-child(5) { display: block; grid-column: 1 / -1; grid-row: auto; }
  .wtable td:nth-child(6) { display: block; grid-column: 2; grid-row: auto; text-align: right; }
}
.btn { white-space: nowrap; }

/* ---------------------------------------------------------------- login (server mode) */
.login-page { display: grid; place-items: center; padding: 24px 16px; }
.login-box { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-m); padding: 28px 24px; display: grid; gap: 22px; box-shadow: var(--shadow-pop); }
.login-box form { display: grid; gap: 10px; }
.login-box label { font-weight: 600; font-size: var(--step--1); }

/* ⭐ Altın fırsat (1.5) */
.gold-flag { color: var(--warn); font-weight: 700; }
.hosts-flag { color: var(--ink-2); }
.sfilter.gold-preset { border-color: var(--warn); }
.sfilter.gold-preset[aria-pressed="true"] { background: var(--warn-soft); border-color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn); }
.gold-note { background: var(--warn-soft); color: var(--ink); border-left: 3px solid var(--warn); border-radius: var(--radius-s); padding: 10px 12px; font-size: var(--step--1); font-weight: 600; margin: 0; }
.sub-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.sub-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: var(--step--1); }
.sub-list .burl { overflow-wrap: anywhere; }
.sub-list .muted { white-space: nowrap; color: var(--ink-3); }

/* Değer puanı (1.5) */
.score { display: inline-block; min-width: 2.6em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 2px 8px; border-radius: 999px; font-size: var(--step--1); }
.score.sc-high { background: var(--free); color: var(--surface); }
.score.sc-mid { background: var(--warn-soft); color: var(--ink); }
.score.sc-low { background: var(--mute-soft); color: var(--ink-2); }
.score.big { font-size: var(--step-2); padding: 6px 12px; }
.score-box { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; display: grid; gap: 10px; }
.score-head { display: flex; gap: 12px; align-items: center; }
.score-head .help { margin: 2px 0 0; }
.score-parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--step--1); }
.score-parts li { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-2); }
.score-parts strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.biz-list .brate { color: var(--ink-2); }
/* main table has a Değer column since 1.5: Domain, Durum, Değer, İşletme, Şehirler, Bitiş */
@media (max-width: 1100px) {
  #table th:nth-child(5), #table td:nth-child(5) { display: table-cell; }
  #table th:nth-child(6), #table td:nth-child(6) { display: none; }
}
@media (max-width: 820px) {
  #table td:nth-child(1) { grid-column: 1; grid-row: 1 / span 2; }
  #table td:nth-child(2) { grid-column: 2; grid-row: 1; text-align: right; }
  #table td:nth-child(3) { grid-column: 2; grid-row: 2; display: block; }
  #table td:nth-child(4) { grid-column: 2; grid-row: 3; display: block; }
  #table td:nth-child(5) { grid-column: 1; grid-row: 3; display: block; }
  #table td:nth-child(6) { display: none; }
}

/* Fırsat paneli + otomatik tarama (1.6) */
.panel-filters { margin-bottom: 14px; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.pcard-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pcard-head h3 { margin: 0; font-size: var(--step-1); }
.pcard-n { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.pc-simdi { border-top: 4px solid var(--free); }
.pc-hafta { border-top: 4px solid var(--urgent); }
.pc-ay { border-top: 4px solid var(--warn); }
.pc-yakinda { border-top: 4px solid var(--line-strong); }
.pcard .help { margin: 0; }
.plist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.plist li { border-bottom: 1px solid var(--line); }
.pitem { width: 100%; background: none; border: 0; padding: 9px 2px; cursor: pointer; text-align: left; color: inherit; font: inherit;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.pitem:hover { background: var(--surface-2); }
.pmain { display: grid; gap: 2px; min-width: 0; }
.pmain strong { overflow-wrap: anywhere; }
.pmeta { color: var(--ink-3); font-size: var(--step--1); }
.pwhen { display: grid; justify-items: end; gap: 3px; font-size: var(--step--1); text-align: right; }
.pempty { color: var(--ink-3); margin: 4px 0; font-size: var(--step--1); }
.btn.wide + .btn.wide { margin-top: 8px; }
.sched-line { margin: 6px 0 0; color: var(--ink-2); }
.sched-summary { background: var(--surface-2); border-radius: var(--radius-s); padding: 8px 10px; font-size: var(--step--1); margin: 0; }
@media (max-width: 820px) {
  .panel-grid { grid-template-columns: 1fr; }
  .pitem { grid-template-columns: auto minmax(0, 1fr); }
  .pwhen { grid-column: 2; justify-items: start; text-align: left; display: flex; gap: 8px; flex-wrap: wrap; }
}

/* Rehber siteleri (1.7) */
#rehberBody { display: grid; gap: 14px; }
.rcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; display: grid; gap: 8px; }
.rcard .help { margin: 0; }
.ritem { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.rfind { padding-right: 2px; }
.rehber-note { border-left-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 820px) {
  .ritem { grid-template-columns: 1fr; }
  .rfind { padding: 0 0 10px 2px; }
}
@media (max-width: 820px) {
  .tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .tabs [role="tab"] { white-space: nowrap; flex: none; }
}
/* 🔥 Popüler fırsatlar (1.8) */
.sfilter.pop-preset { border-color: var(--urgent); }
.sfilter.pop-preset[aria-pressed="true"] { background: var(--urgent-soft); border-color: var(--urgent); box-shadow: inset 0 0 0 1px var(--urgent); }
/* geçmiş arama hatırlatması (1.8) */
.hist-warn { color: var(--warn); font-weight: 600; }
.hist-list { list-style: none; margin: 0; padding: 0; max-height: 46vh; overflow: auto; border-top: 1px solid var(--line); }
.hist-list li { display: grid; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: var(--step--1); }
