/* Shortly - styles. Light & dark automatically. */
:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #171923;
  --muted: #6b7183;
  --border: #e4e6ee;
  --soft: #f0f1f7;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --accent-2: #0ea5a4;
  --success: #15803d;
  --success-soft: #e7f6ec;
  --warn: #b45309;
  --warn-soft: #fdf3e2;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --shadow: 0 1px 2px rgba(20, 22, 40, .04), 0 4px 16px rgba(20, 22, 40, .05);
  --radius: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
/* Dark theme: follows the device unless the user picks one with the moon/sun button */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1117;
    --card: #181b24;
    --text: #e9eaf0;
    --muted: #9399ab;
    --border: #2a2e3b;
    --soft: #212532;
    --accent: #8b85ff;
    --accent-hover: #a29dff;
    --accent-soft: #252548;
    --accent-2: #2dd4bf;
    --success: #4ade80;
    --success-soft: #16301f;
    --warn: #fbbf24;
    --warn-soft: #332611;
    --danger: #f87171;
    --danger-soft: #3a1a1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1117;
  --card: #181b24;
  --text: #e9eaf0;
  --muted: #9399ab;
  --border: #2a2e3b;
  --soft: #212532;
  --accent: #8b85ff;
  --accent-hover: #a29dff;
  --accent-soft: #252548;
  --accent-2: #2dd4bf;
  --success: #4ade80;
  --success-soft: #16301f;
  --warn: #fbbf24;
  --warn-soft: #332611;
  --danger: #f87171;
  --danger-soft: #3a1a1a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { margin: 0; line-height: 1.25; }
h1 { font-size: 24px; letter-spacing: -.02em; }
h2 { font-size: 15px; font-weight: 600; }
code { font-family: var(--mono); font-size: .9em; background: var(--soft); padding: 1px 5px; border-radius: 5px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; margin: 12px 0 0; }
.center { text-align: center; }
[hidden] { display: none !important; }

.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.sm { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- layout */
.container { max-width: 1120px; margin: 0 auto; padding: 24px 16px 64px; }
.topbar { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 0 16px; height: 60px; display: flex; align-items: center; gap: 16px; }
.topbar-inner .nav { margin-left: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; }
.brand-mark svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }
.brand-mark.lg { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 14px; }
.brand-mark.lg svg { width: 30px; height: 30px; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--muted); padding: 7px 12px; border-radius: 8px; font-weight: 500; font-size: 14px; }
.nav a:hover { background: var(--soft); color: var(--text); text-decoration: none; }
.nav a.active { color: var(--accent); background: var(--accent-soft); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head.wrap { flex-wrap: wrap; }
.card-head.sub { margin-top: 22px; }
.card-title { margin: 6px 0 14px; font-size: 16px; }
.card-title:not(:first-of-type) { margin-top: 26px; }
.page-title { margin-bottom: 20px; }

.grid-main { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; }
.grid-main > .card { margin-bottom: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-3 > .card { margin-bottom: 0; }
.grid-3 { margin-bottom: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.grid-2.top { align-items: start; gap: 20px; }
.span-2 { grid-column: span 2; }

/* --------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card); color: var(--text); font: 600 14px var(--font); cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--soft); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--soft); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 50px; padding: 0 28px; font-size: 16px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 1px; }
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; }
.icon-btn:hover { background: var(--soft); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.link-btn { border: 0; background: none; color: var(--muted); font: 500 13px var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 4px 0; margin-top: 10px; }
.link-btn:hover { color: var(--text); }
.link-btn .ico { width: 16px; height: 16px; transition: transform .2s; }
.link-btn.open .ico { transform: rotate(180deg); }

/* ----------------------------------------------------------------- forms */
input, select, textarea { font: 14px var(--font); color: var(--text); background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; height: 40px; width: 100%; }
textarea { height: auto; padding: 10px 12px; }
textarea.code { font-family: var(--mono); font-size: 12.5px; margin-top: 10px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.form .grid-2 label { margin-bottom: 0; }
.form label small { font-weight: 400; }
label.check { flex-direction: row !important; align-items: flex-start; gap: 10px !important; font-weight: 500; cursor: pointer; }
label.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.form .btn.block { margin-top: 22px; }
.prefix-input { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--card); }
.prefix-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.prefix-input span { background: var(--soft); color: var(--muted); padding: 0 10px; display: flex; align-items: center; font-weight: 400; font-size: 13px; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.prefix-input input { border: 0; border-radius: 0; box-shadow: none !important; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.success { background: var(--success-soft); color: var(--success); }

/* ------------------------------------------------------------ auth pages */
.auth-wrap { max-width: 400px; margin: 7vh auto 0; }
.auth-wrap.wide { max-width: 640px; margin-top: 4vh; }
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-brand p { margin: 6px 0 0; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; }
.checklist li { display: flex; align-items: center; gap: 10px; }
.checklist .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--success); flex: none; }
.checklist .bad .dot { background: var(--warn); }
.notfound { text-align: center; margin-top: 14vh; }
.big-404 { font-size: 72px; font-weight: 800; color: var(--accent); letter-spacing: -.04em; line-height: 1; margin-bottom: 12px; }

/* --------------------------------------------------------- shorten hero */
.hero { padding: 28px; }
.hero h1 { margin-bottom: 16px; }
.shorten-row { display: flex; gap: 10px; }
.shorten-row .domain-select { width: auto; max-width: 220px; height: 50px; border-radius: 12px; font-size: 15px; font-weight: 600; }
.shorten-row input { height: 50px; font-size: 16px; border-radius: 12px; padding: 0 16px; }
.options { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 14px; margin-top: 12px; }
.options label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.options .muted { font-weight: 400; }
.created { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.created.pop { animation: pop .35s ease; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.created-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.created-main a { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.created-actions { display: flex; gap: 8px; }

/* ------------------------------------------------------------------ KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; min-width: 0; }
.kpi-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 2px 0; }
.kpi-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- charts */
.chart { position: relative; height: 240px; }
.chart.tall { height: 300px; }
.grid-main .chart { height: 330px; }
@media (max-width: 960px) { .grid-main .chart { height: 240px; } }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .line { fill: none; stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.a { stroke: var(--accent); }
.chart .line.b { stroke: var(--accent-2); stroke-dasharray: 4 4; stroke-width: 1.75; }
.chart .area.a { fill: color-mix(in srgb, var(--accent) 12%, transparent); }
.chart .hover-line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hover-dot { stroke: var(--card); stroke-width: 2; }
.chart .hover-dot.a { fill: var(--accent); }
.chart .hover-dot.b { fill: var(--accent-2); }
.tip { position: absolute; pointer-events: none; background: var(--text); color: var(--card); font-size: 12px; padding: 8px 10px; border-radius: 8px; white-space: nowrap; transform: translateY(-100%); margin-top: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.tip strong { display: block; margin-bottom: 2px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw.a { background: var(--accent); }
.sw.b { background: var(--accent-2); }
.legend { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 2px; }
.legend .sw.b { margin-left: 12px; }
.spark { display: block; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }

.bars { display: grid; gap: 6px; }
.bar-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 8px; font-size: 13.5px; overflow: hidden; }
.bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); border-radius: 8px; z-index: 0; transition: width .4s ease; }
.bar-label, .bar-val { position: relative; z-index: 1; }
.bar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bar-val { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-val small { color: var(--muted); font-weight: 500; margin-left: 4px; }

.toplist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: t; }
.toplist li { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); counter-increment: t; }
.toplist li:last-child { border-bottom: 0; }
.toplist li::before { content: counter(t); width: 22px; height: 22px; border-radius: 6px; background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: none; }
.toplist a { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--text); }
.toplist a:hover { text-decoration: none; }
.toplist a:hover .tl-name { color: var(--accent); }
.tl-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.empty-sm { color: var(--muted); font-size: 13px; margin: 6px 0; text-align: center; padding: 12px; }

/* ------------------------------------------------------------ links list */
.count { color: var(--muted); font-weight: 500; margin-left: 6px; }
.table-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.table-tools select { width: auto; height: 38px; }
.search { position: relative; }
.search .ico { position: absolute; left: 11px; top: 10px; color: var(--muted); width: 17px; height: 17px; }
.search input { padding-left: 34px; height: 38px; width: 230px; }
.links { display: grid; transition: opacity .2s; }
.links.loading, #stats.loading { opacity: .55; }
.link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 150px auto; align-items: center; gap: 18px; padding: 14px 4px; border-top: 1px solid var(--border); }
.link-row:first-child { border-top: 0; }
.link-row.off .lr-main, .link-row.off .lr-stats { opacity: .55; }
.lr-main { min-width: 0; }
.lr-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-short { display: flex; align-items: center; gap: 2px; }
.lr-short a { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-short .icon-btn { width: 28px; height: 28px; }
.lr-short .icon-btn .ico { width: 15px; height: 15px; }
.lr-dest { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-stats { display: flex; align-items: center; gap: 14px; }
.lr-clicks { display: flex; flex-direction: column; align-items: flex-end; min-width: 54px; }
.lr-clicks strong { font-size: 18px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.lr-clicks span { font-size: 11px; color: var(--muted); }
.lr-meta { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.lr-actions { display: flex; align-items: center; gap: 2px; }
.lr-actions .btn { margin-right: 4px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.empty { text-align: center; padding: 36px 16px; }
.empty p { margin: 4px 0; }
.empty-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 0 auto 12px; }
.empty-icon .ico { width: 26px; height: 26px; }

.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; vertical-align: 1px; text-transform: uppercase; letter-spacing: .03em; }
.badge:empty { display: none; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.muted { background: var(--soft); color: var(--muted); }

.switch { position: relative; display: inline-block; width: 38px; height: 22px; margin: 0 6px; cursor: pointer; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: background .2s; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); }

/* ------------------------------------------------------------ stats page */
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; font-weight: 500; margin-bottom: 14px; }
.back:hover { color: var(--text); text-decoration: none; }
.link-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.link-head-main { min-width: 0; flex: 1; }
.short-line { display: flex; align-items: center; gap: 6px; margin: 6px 0 4px; }
.short-line a { font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.dest { display: flex; align-items: center; gap: 6px; font-size: 14px; min-width: 0; }
.dest a { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#s-meta { margin-top: 6px; }
.seg { display: inline-flex; background: var(--soft); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; font: 600 13px var(--font); color: var(--muted); padding: 7px 12px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.qr-box { display: grid; place-items: center; min-height: 120px; }
.qr-box canvas { width: 180px; height: 180px; border-radius: 8px; image-rendering: pixelated; }
.qr-card .btn { margin-top: 12px; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tr.bot td { color: var(--muted); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: 14px; margin: 0 0 16px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* --------------------------------------------------------------- dialogs */
.dialog { border: 0; border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 32px)); background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.dialog.narrow { width: min(400px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(15, 17, 25, .5); backdrop-filter: blur(2px); }
.dialog-body { padding: 24px; }
.dialog h2 { font-size: 18px; margin-bottom: 16px; }
.dialog p { margin: 0 0 8px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--text); color: var(--card); padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); color: #fff; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 960px) {
  .grid-main { grid-template-columns: 1fr; gap: 0; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .link-row { grid-template-columns: minmax(0, 1fr) auto; }
  .lr-meta { display: none; }
  .lr-actions { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .container { padding-top: 16px; }
  .hero { padding: 20px; }
  .shorten-row { flex-direction: column; }
  .shorten-row .domain-select { max-width: none; width: 100%; }
  .options, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .kpi-value { font-size: 24px; }
  .search input { width: 100%; }
  .table-tools, .search { width: 100%; }
  .table-tools select, .table-tools .btn { flex: 1; }
  .lr-stats .spark { display: none; }
  .nav a { padding: 7px 8px; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }
}

/* --------------------------------------------------------------- domains */
.nomargin { margin: 4px 0 0; }
.domain-add { display: flex; gap: 10px; margin-bottom: 8px; }
.domain-add input { max-width: 420px; }
.domain-list { display: grid; }
.domain-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--border); }
.domain-row:last-child { border-bottom: 0; }
.dr-main { min-width: 0; overflow-wrap: anywhere; }
.dr-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.howto { margin-top: 12px; background: var(--soft); border-radius: 10px; padding: 12px 16px; font-size: 14px; }
.howto summary { cursor: pointer; font-weight: 600; }
.howto ol { padding-left: 20px; margin: 12px 0; display: grid; gap: 8px; }
.lr-domain { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--soft); padding: 1px 7px; border-radius: 6px; margin-left: 6px; }
@media (max-width: 640px) { .domain-add { flex-direction: column; } .domain-add input { max-width: none; } }
.dns-table { border-collapse: collapse; margin: 8px 0 2px; font-size: 13px; width: 100%; max-width: 520px; background: var(--card); border-radius: 8px; overflow: hidden; }
.dns-table th, .dns-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); }
.dns-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.dns-table tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------- theme toggle */
.theme-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: 9px; cursor: pointer; margin-left: 4px; }
.theme-btn:hover { background: var(--soft); color: var(--text); }
.theme-btn .ico { width: 19px; height: 19px; }
.theme-btn .sun { display: none; }
.is-dark .theme-btn .sun { display: block; }
.is-dark .theme-btn .moon { display: none; }
.theme-float { position: fixed; top: 14px; right: 14px; }
.panel-note { display: flex; gap: 12px; align-items: flex-start; background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; font-size: 14px; margin: 4px 0 16px; }
.panel-note .ico { color: var(--accent); margin-top: 2px; }
.home-form { margin: 18px 0 4px; padding-top: 16px; border-top: 1px solid var(--border); }
.home-form label { display: block; font-size: 14px; margin-bottom: 8px; }

/* ----------------------------------------------------- Cloudflare / provisioning */
.domain-form { margin-bottom: 8px; }
.df-cf { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.df-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.df-field select, .df-field input { height: 36px; }
.cf-form { margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--border); }
.cf-form .btn.primary { margin-top: 4px; }
.ns-box { margin-top: 8px; padding: 10px 12px; background: var(--warn-soft); color: var(--warn); border-radius: 8px; font-size: 13px; font-family: var(--mono); }
.ns-box strong { font-family: var(--font); }
.setup-inline { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.setup-inline select, .setup-inline input { height: 32px; width: auto; font-size: 13px; }
.setup-inline .si-ip { max-width: 170px; }
@media (max-width: 640px) { .df-cf { flex-direction: column; } .df-field { width: 100%; } .df-field select, .df-field input { width: 100%; } }
