:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #1c1b18;
  --ink-2: #57544c;
  --ink-3: #8d897e;
  --line: #e6e2d8;
  --line-2: #d6d1c4;
  --accent: #176b4d;
  --accent-ink: #ffffff;
  --accent-soft: #e2f0e8;
  --avail: #1d8a5f;
  --avail-soft: #dcf1e6;
  --premium: #b26b00;
  --premium-soft: #fbecd2;
  --taken: #a8a395;
  --taken-soft: #efece5;
  --pending: #c9c4b6;
  --error: #b3261e;
  --shadow: 0 1px 2px rgba(28, 27, 24, .05), 0 4px 16px rgba(28, 27, 24, .04);
  --radius: 14px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12130f;
    --surface: #1a1b17;
    --surface-2: #20211c;
    --ink: #ecebe4;
    --ink-2: #b4b2a8;
    --ink-3: #7f7d73;
    --line: #2b2c26;
    --line-2: #3a3b33;
    --accent: #4cc391;
    --accent-ink: #0d1a14;
    --accent-soft: #173327;
    --avail: #4cc391;
    --avail-soft: #163428;
    --premium: #f0a838;
    --premium-soft: #3a2a10;
    --taken: #6c6a60;
    --taken-soft: #26271f;
    --pending: #3d3e36;
    --error: #ff8a80;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-size: .92em; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* Header */
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top-inner { display: flex; align-items: center; gap: 24px; padding-top: 18px; padding-bottom: 18px; flex-wrap: wrap; }
.brand { font: 700 30px/1 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.brand span { color: var(--accent); }
.tagline { margin: 0; color: var(--ink-2); flex: 1 1 320px; max-width: 560px; }
.scanner { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--ink-2); background: var(--surface-2); white-space: nowrap; }
.scanner .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.scanner.running .dot { background: var(--avail); box-shadow: 0 0 0 0 var(--avail); animation: pulse 2s infinite; }
.scanner.warn .dot { background: var(--premium); }
.scanner.bad .dot { background: var(--error); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--avail) 60%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Tabs */
.tabs { display: flex; gap: 4px; padding-top: 14px; }
.tab { border: 1px solid transparent; background: transparent; padding: 8px 16px; border-radius: 10px; cursor: pointer; color: var(--ink-2); font-weight: 500; font-size: 15px; }
.tab:hover { color: var(--ink); }
.tab.on { background: var(--surface); border-color: var(--line); color: var(--ink); box-shadow: var(--shadow); }
.tab[data-view="best"]::before { content: "★ "; color: var(--premium); }

/* Best finds */
.best-hero { margin: 26px 0 18px; max-width: 760px; }
.best-hero h1 { font: 700 34px/1.1 var(--serif); letter-spacing: -.02em; margin: 0 0 8px; }
.best-hero p { margin: 0; color: var(--ink-2); font-size: 16px; }
.best-controls { display: grid; gap: 14px; }
.b-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; align-items: center; }
.b-row-wrap { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.b-row-wrap .b-label { width: 100px; }
.b-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.chip .n, .seg .n { font: 400 11px var(--mono); opacity: .7; margin-left: 5px; }
.chip.zero { opacity: .45; }
.chip.on.zero { opacity: 1; }
.chip.wide { font-family: var(--sans); }
.seg button .n { color: inherit; }
.notice { background: var(--premium-soft); border: 1px solid color-mix(in srgb, var(--premium) 30%, transparent); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; font-size: 14.5px; color: var(--ink); }
.notice p { margin: 0 0 8px; }
.notice .actions { display: flex; flex-wrap: wrap; gap: 6px; }
.notice button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 13px; }
.notice button:hover { border-color: var(--accent); color: var(--accent); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 16px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.c-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.c-word { font: 700 26px/1.1 var(--serif); letter-spacing: -.01em; overflow-wrap: anywhere; }
.c-word span { color: var(--avail); font-weight: 600; font-size: .62em; font-family: var(--mono); letter-spacing: 0; }
.c-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); white-space: nowrap; }
.c-def { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.c-def i { font-family: var(--serif); color: var(--ink-3); margin-right: 4px; }
.c-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); padding-top: 8px; border-top: 1px solid var(--line); }
.c-price { color: var(--avail); font: 500 13px var(--mono); }
.c-also { font: 11.5px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* KPIs */
.kpis { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr 1fr; gap: 14px; margin: 24px 0 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.kpi-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.kpi-value { font: 600 32px/1.15 var(--serif); margin-top: 6px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi-hero .kpi-value { color: var(--avail); font-size: 40px; }
.kpi-sub { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.bar { height: 6px; background: var(--taken-soft); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .6s ease; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 34px; margin-top: 10px; }
.spark i { flex: 1; background: var(--accent); opacity: .75; border-radius: 2px 2px 0 0; min-height: 1px; }
.spark i.zero { background: var(--line-2); opacity: 1; }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.panel-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.panel h2 { font: 600 17px/1.3 var(--serif); margin: 0; }
.hint { color: var(--ink-3); font-size: 13px; margin: 0; }

/* Matrix */
.matrix-panel { margin-bottom: 18px; }
.matrix-scroll { overflow-x: auto; margin: 0 -4px; }
.matrix { border-collapse: separate; border-spacing: 4px; width: 100%; min-width: 640px; }
.matrix th { font: 500 12px var(--mono); color: var(--ink-3); text-align: center; padding: 2px 4px; }
.matrix th.row { text-align: right; padding-right: 10px; white-space: nowrap; font-family: var(--sans); }
.matrix th.off { text-decoration: line-through; opacity: .6; }
.cell { position: relative; height: 46px; border-radius: 8px; background: var(--taken-soft); overflow: hidden; cursor: pointer; border: 1px solid transparent; transition: border-color .15s, transform .15s; }
.cell:hover { border-color: var(--accent); }
.cell .fill { position: absolute; inset: auto 0 0 0; background: var(--avail-soft); }
.cell .n { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; font: 600 15px/1.1 var(--sans); font-variant-numeric: tabular-nums; }
.cell .n small { font: 400 10.5px var(--mono); color: var(--ink-3); margin-top: 2px; }
.cell.hot .n { color: var(--avail); }
.cell.off { cursor: default; opacity: .45; }
.cell.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* Layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.side-col { display: grid; gap: 14px; position: sticky; top: 14px; }

/* Controls */
.controls { display: grid; gap: 12px; }
.search { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px; background: var(--surface-2); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { border: 0; outline: 0; background: transparent; padding: 11px 0; width: 100%; min-width: 0; font-size: 16px; }
.seg-mini { flex: none; padding: 2px; }
.seg-mini button { padding: 4px 10px; font-size: 13px; }
.control-row { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; cursor: pointer; color: var(--ink-2); font-size: 14px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
.sel { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.sel select { border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 8px; padding: 6px 28px 6px 10px; font-size: 14px; color: var(--ink); appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; }
.toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.chips { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chips-label { font-size: 13px; color: var(--ink-3); margin-right: 2px; }
.chip { border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 999px; min-width: 34px; padding: 4px 10px; cursor: pointer; font: 500 13px var(--mono); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Results */
.result-meta { display: flex; justify-content: space-between; align-items: center; margin: 16px 4px 8px; color: var(--ink-2); font-size: 14px; }
.link { font-size: 13px; text-decoration: none; }
.link:hover { text-decoration: underline; }
.words { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.word { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(0, 2fr); gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.word:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.word:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.w-name { font: 600 24px/1.1 var(--serif); letter-spacing: -.01em; overflow-wrap: anywhere; }
.w-meta { display: flex; gap: 8px; align-items: center; margin-top: 5px; font-size: 12px; color: var(--ink-3); }
.tier { padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 11px; }
.tier.t1 { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.freq { display: inline-flex; gap: 2px; }
.freq i { width: 4px; height: 10px; border-radius: 1px; background: var(--line-2); }
.freq i.on { background: var(--ink-2); }
.w-def { grid-column: 1 / -1; margin: -4px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.w-def i { font-family: var(--serif); color: var(--ink-3); margin-right: 4px; }
.w-def .form { color: var(--ink-3); }
.w-def.none { color: var(--ink-3); font-style: italic; }
mark { background: var(--premium-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.tlds { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.t { display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 8px; border-radius: 7px; font: 500 12.5px var(--mono); border: 1px solid transparent; white-space: nowrap; }
.t b { font-weight: 500; }
.t em { font-style: normal; font-size: 11px; opacity: .8; }
.t.available { background: var(--avail-soft); color: var(--avail); border-color: color-mix(in srgb, var(--avail) 30%, transparent); }
.t.premium { background: var(--premium-soft); color: var(--premium); }
.t.taken { background: var(--taken-soft); color: var(--taken); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--taken) 50%, transparent); }
.t.pending { color: var(--ink-3); border: 1px dashed var(--pending); }
.t.unsupported, .t.error { color: var(--ink-3); opacity: .5; }
.t.focus { box-shadow: 0 0 0 1.5px currentColor; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--ink-3); background: var(--surface); border: 1px dashed var(--line-2); border-radius: 12px; }
.more { text-align: center; margin: 16px 0 8px; }
.btn { border: 1px solid var(--line-2); background: var(--surface); padding: 9px 20px; border-radius: 10px; cursor: pointer; font-weight: 500; }
.btn:hover { border-color: var(--accent); color: var(--accent); }

/* Feed */
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; max-height: 340px; overflow-y: auto; }
.feed li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 2px; font: 13px var(--mono); border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed li a { color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.feed li a:hover { color: var(--accent); }
.feed .st { flex: none; font-size: 12px; }
.feed .st.available { color: var(--avail); }
.feed .st.premium { color: var(--premium); }
.feed .st.taken, .feed .st.unsupported, .feed .st.error { color: var(--ink-3); }
.feed li.new { animation: flash 1.2s ease; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }
.feed .empty { font-family: var(--sans); color: var(--ink-3); border: 0; display: block; }
.about p { color: var(--ink-2); font-size: 13.5px; margin: 8px 0 0; }

/* Drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(10, 10, 8, .35); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: var(--surface); border-left: 1px solid var(--line); z-index: 21; transform: translateX(100%); transition: transform .25s ease; overflow-y: auto; padding: 28px 24px; }
.drawer.open { transform: none; }
.drawer-close { position: absolute; top: 14px; right: 16px; border: 0; background: transparent; font-size: 28px; cursor: pointer; color: var(--ink-3); line-height: 1; }
.d-word { font: 700 44px/1 var(--serif); letter-spacing: -.02em; margin: 6px 0 8px; }
.d-meta { color: var(--ink-2); font-size: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.d-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 14px; }
.d-table td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.d-table td.dom { font: 500 14px var(--mono); }
.d-table td.when { color: var(--ink-3); font-size: 12px; text-align: right; white-space: nowrap; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.available { background: var(--avail-soft); color: var(--avail); }
.pill.premium { background: var(--premium-soft); color: var(--premium); }
.pill.taken { background: var(--taken-soft); color: var(--taken); }
.pill.pending, .pill.unsupported, .pill.error { background: var(--surface-2); color: var(--ink-3); }
.copy { border: 1px solid var(--line-2); background: transparent; border-radius: 6px; padding: 2px 7px; font-size: 11px; cursor: pointer; color: var(--ink-2); }
.copy:hover { color: var(--accent); border-color: var(--accent); }
.d-section { margin-top: 26px; }
.defs { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: sense; }
.defs li { position: relative; padding-left: 26px; font-size: 15px; line-height: 1.5; }
.defs li::before { counter-increment: sense; content: counter(sense); position: absolute; left: 0; top: 1px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); font: 600 11px/17px var(--sans); text-align: center; color: var(--ink-3); }
.defs .pos { font-family: var(--serif); font-style: italic; color: var(--ink-3); margin-right: 6px; }
.defs .ex { display: block; color: var(--ink-3); font-size: 13.5px; font-style: italic; margin-top: 2px; }
.d-form { margin-top: 14px; color: var(--ink-2); font-size: 14px; }
.d-form a { cursor: pointer; }
.d-src { color: var(--ink-3); font-size: 12px; margin-top: 10px; }
.d-section h3 { font: 600 15px var(--serif); margin: 0 0 8px; }
.d-section p, .d-section li { color: var(--ink-2); font-size: 13.5px; }
.d-section ul { padding-left: 18px; margin: 0; }

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

@media (max-width: 1020px) {
  .layout { grid-template-columns: 1fr; }
  .side-col { position: static; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .top-inner { gap: 10px 16px; }
  .brand { font-size: 26px; }
  .tagline { font-size: 13.5px; order: 3; flex-basis: 100%; }
  .kpis { gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi-value { font-size: 24px; }
  .kpi-hero .kpi-value { font-size: 30px; }
  .word { grid-template-columns: 1fr; gap: 8px; }
  .tlds { justify-content: flex-start; }
  .w-name { font-size: 22px; }
  .w-def { margin-top: 0; }
  .side-col { grid-template-columns: 1fr; }
  .best-hero h1 { font-size: 27px; }
  .b-row { grid-template-columns: 1fr; gap: 6px; }
  .b-row-wrap .b-label { width: 100%; }
  .cards { grid-template-columns: 1fr; }
}
.foot a { color: inherit; text-decoration-color: var(--line, currentColor); text-underline-offset: 2px; }
