/* PinSleuth design system — warm paper light theme, deep ink dark theme, crimson accent. */
:root {
  --bg: #f7f6f3; --bg-2: #efede8; --card: #ffffff; --card-2: #faf9f7;
  --ink: #17171a; --ink-2: #3b3b42; --muted: #70707a; --line: #e7e5df; --line-2: #d9d6ce;
  --accent: #e11d48; --accent-2: #f43f5e; --accent-ink: #ffffff; --accent-soft: #fff1f3; --accent-ring: rgba(225, 29, 72, .22);
  --green: #15803d; --green-soft: #e8f7ee; --amber: #b45309; --amber-soft: #fef3e2; --bad: #dc2626; --bad-soft: #fdecec; --blue: #1d4ed8; --blue-soft: #e8efff;
  --shadow-sm: 0 1px 2px rgba(23, 23, 26, .05); --shadow: 0 1px 2px rgba(23, 23, 26, .04), 0 10px 28px -14px rgba(23, 23, 26, .16); --shadow-lg: 0 24px 60px -20px rgba(23, 23, 26, .35);
  --r: 14px; --r-sm: 10px; --side: 264px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --red: var(--accent);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d10; --bg-2: #141418; --card: #17171c; --card-2: #1c1c22;
    --ink: #f4f4f5; --ink-2: #d4d4d8; --muted: #9a9aa5; --line: #26262d; --line-2: #34343d;
    --accent: #fb7185; --accent-2: #f43f5e; --accent-ink: #1a0509; --accent-soft: #2a1218; --accent-ring: rgba(251, 113, 133, .28);
    --green: #4ade80; --green-soft: #12281b; --amber: #fbbf24; --amber-soft: #2b2110; --bad: #f87171; --bad-soft: #2c1414; --blue: #7aa2ff; --blue-soft: #14203a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 32px -14px rgba(0, 0, 0, .7); --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 14px/1.5 var(--font); font-feature-settings: "cv11", "ss01"; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent-ring); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* ---------- app shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side); display: flex; flex-direction: column; background: var(--card); border-right: 1px solid var(--line); padding: 20px 14px 14px; z-index: 40; overflow-y: auto; transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 20px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand .logo { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, #fb4a6b, #be123c); box-shadow: 0 1px 2px rgba(190, 18, 60, .35), inset 0 1px 0 rgba(255, 255, 255, .22); }
.brand .logo svg { width: 32px; height: 32px; }
#nav { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; }
.nav-search { position: relative; margin: 2px 0 12px; }
.nav-search svg { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); opacity: .55; pointer-events: none; }
.nav-search input { width: 100%; padding: 8px 40px 8px 33px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card-2); font-size: 13px; box-shadow: none; }
.nav-search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 600 10.5px system-ui; color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; pointer-events: none; }
.nav-search input:focus + kbd { display: none; }
.nav-sec { margin-top: 2px; }
.nav-items { display: none; flex-direction: column; gap: 1px; padding: 2px 0 6px; }
.nav-sec.open .nav-items { display: flex; }
.nav-group { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0; padding: 8px 10px; background: none; border: 0; box-shadow: none; border-radius: 9px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); cursor: pointer; text-align: left; }
#nav .nav-group, #nav .nav-group:hover, #nav .nav-group:active, #nav .nav-group:focus { box-shadow: none; transform: none; filter: none; }
#nav .nav-group { background: transparent; transition: background .15s, color .15s; }
#nav .nav-group:hover { background: var(--bg-2); color: var(--ink); }
#nav .nav-group:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: -2px; }
#nav .nav-sec.open > .nav-group { color: var(--ink-2); }
.nav-group span { flex: 1; }
.nav-group small { font-size: 10.5px; font-weight: 600; opacity: .7; letter-spacing: 0; }
.nav-group svg { width: 14px; height: 14px; transition: transform .15s; transform: rotate(-90deg); }
.nav-sec.open > .nav-group svg { transform: none; }
#nav a { display: flex; align-items: center; gap: 11px; padding: 7px 12px; border-radius: 11px; color: var(--ink-2); font-weight: 550; transition: background .15s, color .15s; position: relative; }
#nav a svg { width: 18px; height: 18px; flex: none; stroke: currentColor; opacity: .75; }
#nav a:hover { background: var(--bg-2); color: var(--ink); }
#nav a.on { background: var(--accent-soft); color: var(--accent); }
#nav a.on svg { opacity: 1; }
#nav a.on::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
#badge:not(:empty) { margin-left: auto; background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 1px 8px; font-size: 11px; font-weight: 700; }
.side-foot { margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); font-size: 12px; color: var(--muted); line-height: 1.4; }
.side-foot b { color: var(--ink); font-size: 13px; display: block; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 6px; vertical-align: 1px; }
.dot.ok { background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); animation: pulse 2s infinite; }
.dot.warn { background: #f59e0b; } .dot.bad { background: var(--bad); }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.content { flex: 1; min-width: 0; margin-left: var(--side); }
.topbar { display: none; position: sticky; top: 0; z-index: 30; align-items: center; gap: 12px; padding: 10px 16px; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 12px; background: var(--card-2); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; }
.scrim { display: none; position: fixed; inset: 0; background: rgba(10, 10, 14, .5); backdrop-filter: blur(3px); z-index: 35; opacity: 0; transition: opacity .25s; }
main { max-width: 1320px; margin: 0 auto; padding: 32px 36px 80px; }
main > * { animation: rise .35s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- type ---------- */
h1 { font-size: 30px; line-height: 1.15; letter-spacing: -.03em; margin: 0 0 18px; font-weight: 800; }
h3 { font-size: 16px; letter-spacing: -.01em; margin: 22px 0 10px; }
.note { color: var(--muted); font-size: 13.5px; margin: -6px 0 18px; max-width: 78ch; }
.muted { color: var(--muted); } .up { color: var(--green); } .down { color: var(--bad); }
code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg-2); padding: 2px 6px; border-radius: 6px; }

/* ---------- controls ---------- */
.bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
input[type=text], input[type=password], textarea, select { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 11px 14px; transition: border-color .15s, box-shadow .15s; box-shadow: var(--shadow-sm); }
input[type=text], input[type=password], textarea { flex: 1; min-width: 220px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:hover, textarea:hover, select:hover { border-color: var(--muted); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
select { appearance: none; padding-right: 36px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2370707a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; cursor: pointer; }
form.bar#f > input[type=text]:first-child { padding-left: 42px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2370707a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center; font-size: 15px; padding-top: 13px; padding-bottom: 13px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); vertical-align: -3px; cursor: pointer; }
label { cursor: pointer; }
button { font: inherit; font-weight: 650; cursor: pointer; border: 0; border-radius: var(--r-sm); padding: 11px 18px; color: var(--accent-ink); background: linear-gradient(180deg, var(--accent-2), var(--accent)); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 6px 14px -8px var(--accent); transition: transform .12s, box-shadow .15s, filter .15s; }
button:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 10px 20px -10px var(--accent); }
button:active { transform: none; }
button.ghost, .icon-btn { color: var(--ink); background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); }
button.ghost:hover { border-color: var(--muted); background: var(--card-2); box-shadow: var(--shadow-sm); filter: none; }
button:disabled { opacity: .5; cursor: progress; transform: none; }
.field { display: grid; gap: 6px; margin-bottom: 16px; } .field label { font-weight: 650; font-size: 13px; }

/* ---------- surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.stat { padding: 16px 18px; }
.stat > .muted:first-child, .stat > span.muted:first-child { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.stat b { display: block; margin-top: 4px; font-size: 26px; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 18px; align-items: center; padding: 18px 20px; flex-wrap: wrap; }
.row .pill { align-self: center; }
.row img { width: 76px; height: 76px; border-radius: 50%; border: 3px solid var(--card); box-shadow: 0 0 0 2px var(--accent-ring), var(--shadow); object-fit: cover; }
.empty { padding: 56px 24px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line-2); border-radius: var(--r); background: var(--card-2); }
.card.empty { box-shadow: none; }
.err { padding: 13px 16px; border-radius: var(--r-sm); background: var(--bad-soft); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); margin-bottom: 14px; }

/* ---------- tables ---------- */
table { border-collapse: separate; border-spacing: 0; width: 100%; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { position: sticky; top: 0; z-index: 2; background: var(--card-2); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); cursor: pointer; white-space: nowrap; user-select: none; border-bottom: 1px solid var(--line-2); }
th:hover { color: var(--ink); }
tbody tr, tr { transition: background .12s; }
tr:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
tr:last-child td { border-bottom: 0; }
td a { font-weight: 550; } td a:hover { text-decoration: underline; text-underline-offset: 3px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.thumb { width: 52px; height: 68px; object-fit: cover; border-radius: 10px; background: var(--bg-2); box-shadow: var(--shadow-sm); transition: transform .15s; }
.thumb:hover { transform: scale(1.06); }
.spark { vertical-align: middle; }
tr.unread td:first-child { box-shadow: inset 3px 0 0 var(--accent); } tr.unread { background: var(--accent-soft); }

/* ---------- chips, pills, tabs ---------- */
.chip { display: inline-block; padding: 4px 11px; margin: 3px 4px 3px 0; border-radius: 99px; background: var(--card); border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 550; cursor: pointer; transition: all .15s; color: var(--ink-2); }
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.chip small { color: var(--muted); margin-left: 5px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.score { display: inline-block; min-width: 34px; text-align: center; padding: 2px 9px; border-radius: 99px; color: #fff; font-weight: 700; font-size: 12px; }
.tabs { display: inline-flex; gap: 2px; padding: 4px; margin: 0 0 18px; background: var(--bg-2); border-radius: 13px; flex-wrap: wrap; max-width: 100%; border: 0; }
.tabs a { padding: 8px 16px; border-radius: 10px; color: var(--muted); font-weight: 600; transition: all .15s; border: 0; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- keyword explorer layout ---------- */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.layout > * { min-width: 0; }
.side { padding: 10px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.side a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 550; color: var(--ink-2); }
.side a:hover { background: var(--bg-2); color: var(--ink); }
.side a.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.side small { color: var(--muted); font-variant-numeric: tabular-nums; }
.side hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }

/* ---------- dialog + toast ---------- */
dialog { border: 1px solid var(--line); border-radius: 20px; background: var(--card); color: var(--ink); padding: 24px; min-width: 300px; max-width: min(640px, calc(100vw - 24px)); box-shadow: var(--shadow-lg); animation: pop .22s cubic-bezier(.2, .8, .2, 1); }
dialog::backdrop { background: rgba(10, 10, 14, .55); backdrop-filter: blur(4px); }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } }
#toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 11px 20px; border-radius: 99px; z-index: 60; display: none; font-weight: 600; box-shadow: var(--shadow-lg); }
#toast[style*="block"] { animation: toast .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 12px); } }


/* ---------- pins: rows, grid, slide-over panel ---------- */
.thumb { width: 64px; height: 84px; border-radius: 12px; }
tr.rowlink { cursor: pointer; }
tr.rowlink:hover .ptitle { color: var(--accent); }
.ptitle { font-weight: 650; line-height: 1.3; }
.ext { color: var(--muted); font-size: 12px; margin-left: 4px; } .ext:hover { color: var(--accent); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-2); border-radius: 12px; }
.seg button { padding: 7px 14px; border-radius: 9px; background: transparent; color: var(--muted); box-shadow: none; font-weight: 600; transform: none; }
.seg button:hover { color: var(--ink); filter: none; transform: none; box-shadow: none; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.gcard { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s; }
.gcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.gimg { position: relative; background: var(--bg-2); }
.gimg img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.grank { position: absolute; top: 10px; left: 10px; background: rgba(12, 12, 16, .72); color: #fff; font-weight: 700; font-size: 12px; padding: 3px 10px; border-radius: 99px; backdrop-filter: blur(6px); }
.gsel { position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; }
.gbody { padding: 11px 13px 13px; }
.gtitle { font-weight: 650; font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 6px; }
.g-stats { font-size: 12.5px; }

.drawer-scrim { position: fixed; inset: 0; background: rgba(10, 10, 14, .5); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 70; }
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--bg); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); transform: translateX(104%); transition: transform .32s cubic-bezier(.2, .8, .2, 1); z-index: 71; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
body.drawer-open { overflow: hidden; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.drawer-rank { font-size: 24px; letter-spacing: -.02em; }
.icon-btn.dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.icon-btn:disabled { opacity: .4; cursor: default; transform: none; }
.drawer-body { overflow-y: auto; padding: 22px 24px 40px; }
.pv-top { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 22px; margin-bottom: 20px; }
.pv-img { width: 100%; border-radius: 18px; box-shadow: var(--shadow); background: var(--bg-2); object-fit: cover; align-self: start; }
.pv-meta h2 { font-size: 21px; line-height: 1.25; letter-spacing: -.02em; margin: 6px 0 12px; }
.pv-domain { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
.pv-by { display: flex; align-items: center; gap: 8px; font-weight: 650; margin-bottom: 8px; }
.pv-by a, .pv-line a { text-decoration: underline; text-underline-offset: 3px; }
.pv-line { font-size: 13.5px; }
.pv-desc { margin: 12px 0 0; color: var(--ink-2); max-height: 190px; overflow: auto; white-space: pre-line; }
.av { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line-2); }
.av-fallback { display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.pv-perf, .pv-ann { padding: 18px 20px; margin-bottom: 14px; }
.pv-perf h3 { margin: 0 0 14px; font-size: 18px; }
.pv-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 10px; text-align: center; }
.pv-stat span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.pv-stat b { font-size: 28px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .pv-top { grid-template-columns: 1fr; } .pv-img { max-width: 320px; } .drawer-body { padding: 16px 16px 32px; } .pgrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; } .pv-stat b { font-size: 24px; } }


/* ---------- keyword explorer v2 / pin explorer ---------- */
.kx-chk { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px; font-weight: 600; cursor: pointer; }
.kx-chk.sub { margin-left: 22px; } .kx-chk:hover { background: var(--bg-2); }
.help { color: var(--muted); display: inline-flex; cursor: help; } .help:hover { color: var(--accent); }
.tree { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); max-height: 420px; overflow-y: auto; }
.tn { display: flex; align-items: center; } .tn-row { flex: 1; display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 9px; font-size: 13px; font-weight: 550; min-width: 0; }
.tn-row:hover { background: var(--bg-2); } .tn-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .tn-row small { color: var(--muted); font-variant-numeric: tabular-nums; }
.tn-ch { width: 26px; height: 26px; padding: 0; display: grid; place-items: center; background: transparent; color: var(--muted); border: 0; box-shadow: none; border-radius: 8px; }
.tn-ch:hover { background: var(--bg-2); color: var(--ink); transform: none; box-shadow: none; filter: none; } .tn-ch svg { transition: transform .15s; } .tn-ch.open svg { transform: rotate(90deg); }
.rowicons { display: inline-flex; gap: 2px; margin-right: 8px; vertical-align: middle; }
.ri { width: 30px; height: 30px; padding: 0; display: inline-grid; place-items: center; border-radius: 9px; background: transparent; color: var(--ink-2); border: 0; box-shadow: none; }
.ri:hover { background: var(--accent-soft); color: var(--accent); transform: none; box-shadow: none; filter: none; }
.kwlink { font-weight: 650; } .ext svg { vertical-align: -3px; }
.pager { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { main { padding: 26px 22px 72px; } .layout { grid-template-columns: 210px 1fr; } }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-102%); box-shadow: var(--shadow-lg); width: min(300px, 86vw); }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .scrim { display: block; opacity: 1; }
  .content { margin-left: 0; }
  .topbar { display: flex; }
  .topbar .brand { padding: 0; font-size: 17px; } .topbar .brand .logo { width: 32px; height: 32px; } .topbar .brand .logo svg { width: 26px; height: 26px; }
  main { padding: 20px 14px 64px; }
  h1 { font-size: 25px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: 240px; }
  #crawl > span[style*="float"] { float: none !important; display: block; margin-top: 12px; }
  #crawl > span[style*="float"] button { width: 100%; }
  .row { gap: 14px; } .row img { width: 60px; height: 60px; } .row > div:last-child { width: 100%; }
  .card table { min-width: 560px; }
  input[type=text], input[type=password], textarea { min-width: 0; width: 100%; flex-basis: 100%; }
  .bar > button, .bar > select { flex: 1 1 auto; }
  .tabs { display: flex; overflow-x: auto; flex-wrap: nowrap; } .tabs a { white-space: nowrap; }
  th, td { padding: 10px 11px; }
  .grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .stat b { font-size: 22px; }
  dialog { padding: 18px; border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* =====================================================================
   Design pass 2: calmer buttons, page headers, sticky tables, density,
   skeletons, theme-aware status pills, tooltips, command palette
   ===================================================================== */

/* buttons: flat and solid, no lift or glow */
button { background: var(--accent); color: var(--accent-ink); box-shadow: none; padding: 9px 16px; border-radius: var(--r-sm); transition: background .15s, border-color .15s, color .15s, opacity .15s; }
button:hover { filter: none; transform: none; box-shadow: none; background: color-mix(in srgb, var(--accent) 86%, #000); }
button:active { background: color-mix(in srgb, var(--accent) 74%, #000); transform: none; }
button.ghost, .icon-btn { background: var(--card); color: var(--ink); border: 1px solid var(--line-2); box-shadow: none; }
button.ghost:hover, .icon-btn:hover { background: var(--bg-2); border-color: var(--muted); box-shadow: none; filter: none; }
button:disabled { opacity: .5; cursor: default; }
.chip:hover { transform: none; }
form.bar > button { padding: 12px 22px; }

/* page header: one pattern for every page */
.page-head { margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 6px 0 0; max-width: 74ch; color: var(--muted); font-size: 14px; line-height: 1.5; }
main > h1 { margin-bottom: 16px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 550; font-size: 13px; margin-bottom: 10px; }
.back:hover { color: var(--accent); }

/* tables: header stays in view while scrolling long lists */
.card { overflow: clip; }
@media (max-width: 1100px) { .card { overflow-x: auto; } }
th { top: 0; box-shadow: 0 1px 0 var(--line-2); }
body.dense th, body.dense td { padding: 6px 12px; font-size: 13px; }
body.dense .thumb { width: 38px; height: 50px; }
body.dense .stat { padding: 12px 14px; }
.side-tools { margin-top: 8px; display: flex; gap: 6px; }
.side-tools button { flex: 1; padding: 6px 10px; font-size: 12px; font-weight: 600; }
.side-tools button.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* loading skeletons */
.loading { display: grid; gap: 12px; padding: 22px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.loading .sk { height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--bg-2) 25%, var(--line) 45%, var(--bg-2) 65%); background-size: 220% 100%; animation: shimmer 1.3s linear infinite; }
.loading .sk.s { width: 62%; } .loading .sk.m { width: 82%; }
.loading span { color: var(--muted); font-size: 13px; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* status pills: soft tints that read well in light and dark */
.pill[data-tone=ok] { background: var(--green-soft); color: var(--green); border-color: color-mix(in srgb, var(--green) 28%, transparent); }
.pill[data-tone=warn] { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 28%, transparent); }
.pill[data-tone=bad] { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 28%, transparent); }
.pill[data-tone=info] { background: var(--blue-soft); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 28%, transparent); }
.pill[data-tone=neutral] { background: var(--bg-2); color: var(--ink-2); }

/* chart tooltip */
#tip { position: fixed; z-index: 90; pointer-events: none; padding: 5px 9px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 600; box-shadow: var(--shadow); opacity: 0; transition: opacity .1s; white-space: nowrap; }
#tip.on { opacity: 1; }
[data-tip] { cursor: default; }
svg circle[data-tip]:hover { fill: var(--accent); fill-opacity: 1; }

/* command palette */
#pal { position: fixed; inset: 0; z-index: 80; display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; background: rgba(10, 10, 14, .5); backdrop-filter: blur(4px); }
#pal.on { display: flex; }
.pal-box { width: min(620px, 100%); max-height: 70vh; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: rise .18s ease both; }
.pal-box input { width: 100%; flex: none; min-width: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 18px; font-size: 16px; background: transparent; box-shadow: none; }
.pal-box input:focus { box-shadow: none; border-color: var(--line); }
.pal-list { overflow-y: auto; padding: 6px; }
.pal-h { padding: 10px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.pal-i { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; cursor: pointer; color: var(--ink-2); font-weight: 550; }
.pal-i small { margin-left: auto; color: var(--muted); font-weight: 500; }
.pal-i.on { background: var(--accent-soft); color: var(--accent); }
.pal-i svg { width: 17px; height: 17px; flex: none; stroke: currentColor; opacity: .75; }
.pal-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.pal-foot kbd, .nav-search kbd { font-family: inherit; }
.nav-search input { cursor: pointer; }
@media (max-width: 860px) { #pal { padding-top: 8vh; } .page-head p { font-size: 13.5px; } }

/* ---------------- sign-in, account and admin ---------------- */
body.locked .shell { display: none; }
#auth { display: none; }
body.locked #auth { display: grid; min-height: 100vh; place-items: center; padding: 20px; background: radial-gradient(900px 500px at 15% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 34px 30px; box-shadow: var(--shadow-lg); }
.auth-card .logo { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #fb4a6b, #be123c); margin-bottom: 18px; }
.auth-card .logo svg { width: 38px; height: 38px; }
.auth-card h1 { font-size: 26px; margin: 0 0 4px; } .auth-card > p { margin: 0 0 22px; color: var(--muted); }
.auth-card input[type=text], .auth-card input[type=password], .auth-card input[type=email] { width: 100%; min-width: 0; margin-bottom: 12px; flex: none; }
.auth-card button { width: 100%; } .auth-err { color: var(--bad); min-height: 1.4em; margin-top: 10px; font-size: 14px; }
.who { display: block; margin-top: 8px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 13px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; }
.who small { color: var(--muted); } .who:hover { border-color: var(--muted); color: var(--ink); }
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--card-2); border: 1px dashed var(--line-2); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.linkbox code { flex: 1; word-break: break-all; font-size: 12.5px; background: none; padding: 0; }
.meter { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; margin-top: 6px; } .meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
body.not-admin .admin-only { display: none; }
input[type=email] { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 11px 14px; transition: border-color .15s, box-shadow .15s; }
input[type=email]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }

/* thin loading bar shown while the app waits for the server */
#apibar{position:fixed;top:0;left:0;right:0;height:3px;z-index:99999;overflow:hidden;opacity:0;transition:opacity .2s;pointer-events:none}
#apibar.on{opacity:1}#apibar::after{content:"";display:block;height:100%;width:30%;background:var(--accent,#d6202b);border-radius:3px;animation:apibar 1.1s ease-in-out infinite}
@keyframes apibar{0%{margin-left:-30%}100%{margin-left:100%}}

/* get started checklist */
.st-bar{height:6px;border-radius:6px;background:var(--line,#ececec);margin-top:10px;overflow:hidden}.st-bar i{display:block;height:100%;background:var(--accent);border-radius:6px;transition:width .4s}
.st-step{display:flex;gap:14px;padding:16px 18px;margin-bottom:12px}.st-step.done{opacity:.7}
.st-n{flex:none;width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent);font-weight:700}.st-step.done .st-n{background:var(--accent);color:#fff}
.st-f input{flex:1;min-width:150px}.btn{display:inline-block;padding:8px 14px;border-radius:99px;background:var(--accent);color:#fff;text-decoration:none;font-weight:600;font-size:13px}.btn.ghost{background:transparent;color:inherit;border:1px solid var(--line,#ddd)}

/* friendly empty screens */
.em{padding:40px 24px 28px;text-align:center;border:1.5px dashed var(--line-2);border-radius:var(--r);background:var(--card-2)}
.em-ic{display:inline-grid;place-items:center;width:52px;height:52px;border-radius:50%;background:var(--accent-soft);color:var(--accent);margin-bottom:10px}.em-ic svg{width:26px;height:26px}
.em b{display:block;font-size:18px;margin-bottom:6px}.em p{max-width:520px;margin:0 auto 16px;color:var(--muted);line-height:1.55}
.em-sample{position:relative;max-width:560px;margin:26px auto 0;text-align:left;opacity:.7;pointer-events:none;user-select:none}.em-sample table{width:100%}
.em-tag{position:absolute;top:6px;right:10px;background:var(--ink,#17171a);color:#fff;font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;padding:2px 9px;border-radius:99px;z-index:1}

.auth-fine{margin:14px 0 0;font-size:13px;color:var(--muted);text-align:center}.auth-fine a{color:var(--accent)}.auth-ok{margin:0;color:var(--green,#1a8a4a);line-height:1.5}

/* subscription notice */
#billbar{display:flex;gap:12px;justify-content:center;align-items:center;flex-wrap:wrap;padding:9px 16px;font-size:14px;background:#fff7e6;color:#7a4b00;border-bottom:1px solid #f3dca8}
#billbar[data-tone=bad]{background:#fdecea;color:#8a1f16;border-color:#f3c6c1}#billbar a{font-weight:700;color:inherit;text-decoration:underline}

/* ---- extension + account pages ---- */
.hero2 { position: relative; overflow: hidden; border-radius: 20px; padding: 28px 28px 26px; margin-bottom: 18px; color: #fff; background: radial-gradient(120% 140% at 0% 0%, #fb7185 0%, #e11d48 45%, #9f1239 100%); box-shadow: 0 18px 40px -22px rgba(225, 29, 72, .6); }
.hero2::after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255, 255, 255, .10); }
.hero2 h2 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.02em; position: relative; z-index: 1; } .hero2 p { margin: 0; max-width: 560px; opacity: .92; font-size: 15px; position: relative; z-index: 1; }
.hero2 .hero-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero2 .btn, .hero2 button { background: #fff; color: #be123c; border-color: #fff; font-weight: 700; } .hero2 .btn.ghost, .hero2 button.ghost { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .45); }
.hero2 a:hover { color: inherit; }
.ext-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 640px) { .ext-how { grid-template-columns: 1fr; gap: 8px; } .ext-how > div { padding: 11px 14px; } }
.ext-how > div { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.ext-how i { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font: 800 14px var(--font); font-style: normal; background: var(--accent-soft); color: var(--accent); }
.ext-how b { display: block; font-size: 14px; } .ext-how span { color: var(--muted); font-size: 13px; }
.br-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.br { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 18px; background: var(--card); border: 1.5px solid var(--line); color: var(--ink); cursor: pointer; font: inherit; box-shadow: none; transition: transform .15s, border-color .15s, box-shadow .15s; }
.br:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 10px 24px -16px rgba(0, 0, 0, .35); }
.br[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.br .logo { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 8px; background: var(--card-2); border: 1px solid var(--line); } .br .logo svg { width: 28px; height: 28px; }
.br b { font-size: 16px; } .br span { color: var(--muted); font-size: 12.5px; }
.ext-panel { border-radius: 20px; background: var(--card); border: 1px solid var(--line); padding: 22px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 760px) { .ext-panel { grid-template-columns: 1fr; } }
.ext-panel h3 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.01em; } .ext-panel ol { list-style: none; counter-reset: s; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.ext-panel li { counter-increment: s; position: relative; padding-left: 36px; color: var(--ink-2); } .ext-panel li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 700 12px var(--font); background: var(--accent-soft); color: var(--accent); }
.ext-side { border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); padding: 16px; } .ext-side ul { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 7px; color: var(--ink-2); font-size: 13.5px; } .ext-side li { padding-left: 22px; position: relative; } .ext-side li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.acc-hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 22px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); margin-bottom: 14px; }
.avatar { flex: none; width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font: 800 24px var(--font); color: #fff; background: linear-gradient(135deg, #fb7185, #e11d48); box-shadow: 0 10px 22px -12px rgba(225, 29, 72, .7); }
.acc-hero h2 { margin: 0; font-size: 22px; letter-spacing: -.01em; } .acc-hero .grow { flex: 1; min-width: 200px; }
.acc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; } @media (max-width: 820px) { .acc-grid { grid-template-columns: 1fr; } }
.acc-card { border-radius: 20px !important; padding: 22px !important; }
.acc-card h3 { margin: 0 0 4px; font-size: 17px; display: flex; align-items: center; gap: 9px; } .acc-card h3 .ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 15px; }
.acc-card .sub { color: var(--muted); margin: 0 0 14px; font-size: 13.5px; }
.acc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 4px; } .acc-stats > div { background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; } .acc-stats .meter { height: 6px; }
.acc-stats .n { font-size: 22px; font-weight: 800; letter-spacing: -.02em; } .acc-stats .n small { color: var(--muted); font-size: 13px; font-weight: 600; }
.acc-grid #billcard { order: -1; border-radius: 20px !important; padding: 22px !important; }
.keyrow { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-2); margin-top: 8px; } .keyrow .k { flex: 1; min-width: 0; } .keyrow small { color: var(--muted); display: block; }
button.br:hover, button.br:active, button.br:focus { background: var(--card); color: var(--ink); filter: none; }
button.br[aria-pressed=true], button.br[aria-pressed=true]:hover { background: var(--accent-soft); }
button.br:hover span:not(.logo), button.br:active span:not(.logo) { color: var(--muted); }
button.br:hover b { color: var(--ink); }

.acc-stats { grid-template-columns: 1fr; } .acc-stats > div { padding: 16px 18px; } @media (min-width: 1100px) { .acc-stats { grid-template-columns: 1fr 1fr; } }
.plans-wrap { margin-top: 4px; } .plans-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; } .plans-head b { font-size: 19px; letter-spacing: -.01em; }
.seg { display: inline-flex; padding: 4px; border-radius: 99px; background: var(--bg-2); border: 1px solid var(--line); } .seg button { border: 0; background: none; box-shadow: none; color: var(--ink-2); border-radius: 99px; padding: 6px 14px; font-weight: 650; font-size: 13px; } .seg button em { font-style: normal; color: var(--green); font-size: 11.5px; margin-left: 4px; }
.seg button[aria-pressed=true], .seg button[aria-pressed=true]:hover { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); } .seg button:hover { background: none; color: var(--ink); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; align-items: stretch; }
.plan-c { position: relative; display: flex; flex-direction: column; padding: 22px; border-radius: 20px; background: var(--card); border: 1.5px solid var(--line); } .plan-c.pop { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring), 0 18px 36px -24px rgba(225, 29, 72, .55); }
.plan-c .ptag { position: absolute; top: -11px; left: 20px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 3px 10px; border-radius: 99px; }
.plan-c h4 { margin: 0; font-size: 18px; } .plan-c .for { margin: 4px 0 14px; color: var(--muted); font-size: 13px; min-height: 36px; }
.plan-c .pprice { font-size: 15px; color: var(--muted); } .plan-c .pprice b { font-size: 40px; letter-spacing: -.03em; color: var(--ink); line-height: 1; } .plan-c .pbilled { color: var(--muted); font-size: 12.5px; margin: 4px 0 14px; }
.plan-c ul { list-style: none; margin: 0 0 18px; padding: 14px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; flex: 1; font-size: 13.5px; color: var(--ink-2); } .plan-c li { position: relative; padding-left: 24px; } .plan-c li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 17px; height: 17px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 10px; font-weight: 800; margin-top: 2px; }
.plan-c li.soon { color: var(--muted); } .plan-c li em { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 99px; background: var(--bg-2); border: 1px solid var(--line); }
.plan-c button { width: 100%; }

/* ---- settings ---- */
.set-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 99px; background: var(--bg-2); border: 1px solid var(--line); margin-bottom: 18px; max-width: 100%; overflow-x: auto; }
.set-tabs button { border: 0; background: none; box-shadow: none; color: var(--ink-2); border-radius: 99px; padding: 8px 18px; font-weight: 650; font-size: 13.5px; white-space: nowrap; }
.set-tabs button:hover { background: none; color: var(--ink); } .set-tabs button[aria-pressed=true], .set-tabs button[aria-pressed=true]:hover { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
body.not-admin .set-tabs .admin-only, body.not-admin .set-panel.admin-only { display: none; }
.set-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; align-items: start; padding-bottom: 80px; } .set-panel[hidden] { display: none; }
.set-panel .card { border-radius: 20px; } .set-panel .card h3 { font-size: 17px; margin-bottom: 10px; }
.set-panel[data-p=crawl] .card:first-child { grid-column: 1 / -1; }
.save-dock { position: sticky; bottom: 0; display: flex; gap: 12px; align-items: center; padding: 12px 0 14px; margin-top: -60px; background: linear-gradient(to top, var(--bg) 70%, transparent); z-index: 5; }

/* add-keyword composer: one card, a roomy text area on top, a tidy row of equal-height controls below */
.compose { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 8px; margin-bottom: 18px; box-shadow: 0 1px 2px rgba(0, 0, 0, .03); transition: border-color .15s, box-shadow .15s; }
.compose:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.compose textarea { display: block; width: 100%; box-sizing: border-box; border: 0; background: transparent; box-shadow: none; resize: vertical; min-height: 64px; padding: 10px 12px; outline: none; }
.compose textarea:focus { box-shadow: none; border: 0; }
.compose-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 4px 2px; border-top: 1px solid var(--line); margin-top: 4px; }
.compose-row .grow { flex: 1; } .compose-row select, .compose-row input[type=text], .compose-row button { height: 40px; box-sizing: border-box; margin: 0; }
.compose-row input[type=text] { flex: 1 1 220px; min-width: 0; max-width: 340px; } .compose-row select { width: auto; }
@media (max-width: 600px) { .compose-row input[type=text] { max-width: none; flex-basis: 100%; } .compose-row .grow { display: none; } .compose-row button { flex: 1; } }
.compose-row select, .compose-row input[type=text] { padding-top: 0; padding-bottom: 0; line-height: 38px; font-size: 14px; }
.compose-row select { padding-left: 14px; padding-right: 38px; background-position: right 14px center; }

/* a.btn: keep the label readable on hover (the global link hover colour made it vanish on the red button) */
a.btn:hover, a.btn:focus-visible { color: var(--accent-ink, #fff); filter: brightness(1.07); } a.btn.ghost:hover { color: var(--accent); background: var(--accent-soft); filter: none; }
/* dashboard */
.dhero { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; } .dhero h1 { margin: 0 0 4px; } .dhero p { margin: 0; color: var(--ink-2); font-size: 15px; max-width: 760px; } .dhero-r { display: flex; gap: 10px; align-items: center; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; } @media (max-width: 720px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { position: relative; display: grid; gap: 2px; padding: 16px 18px 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); color: var(--ink); overflow: hidden; transition: transform .15s, border-color .15s, box-shadow .15s; } .kpi:hover { color: var(--ink); transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 12px 26px -18px rgba(0, 0, 0, .4); }
.kpi .kl { font-size: 12.5px; color: var(--muted); font-weight: 650; } .kpi .kv { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; } .kpi .kv small { font-size: 15px; color: var(--muted); font-weight: 700; } .kpi .kd { min-height: 20px; font-size: 12.5px; }
.kpi .dsp { position: absolute; right: 12px; bottom: 12px; opacity: .95; }
.dl { font-weight: 700; font-size: 12.5px; } .dl.up, .up { color: var(--green); } .dl.down, .down { color: var(--bad); } .dl.flat { color: var(--muted); font-weight: 500; }
.dgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; } .dcard { padding: 18px 20px; border-radius: 20px; display: flex; flex-direction: column; } .dcard.span2 { grid-column: 1 / -1; }
@media (max-width: 860px) { .dgrid { grid-template-columns: 1fr; } }
.dh { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; } .dh h3 { margin: 0; font-size: 16px; } .dh a { font-size: 12.5px; }
.dchart { width: 100%; height: auto; display: block; } .dleg, .dlegrid { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; } .dleg i, .dlegrid i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; } .dlegrid b { margin-left: 6px; color: var(--ink); } .dlegrid span { display: inline-flex; align-items: center; }
.dstack { display: flex; height: 16px; border-radius: 99px; overflow: hidden; background: var(--bg-2); gap: 2px; } .dstack i { display: block; height: 100%; }
.drow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 2px; border-top: 1px solid var(--line); color: var(--ink); } .drow:first-of-type { border-top: 0; } .drow:hover { color: var(--ink); background: var(--card-2); } .drow.unread .dk { font-weight: 700; }
.dk { display: grid; min-width: 0; font-weight: 600; font-size: 14px; } .dk small { color: var(--muted); font-weight: 500; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .dp { flex: none; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.empty-in { color: var(--muted); font-size: 13.5px; padding: 14px 0; line-height: 1.5; }
.dacct { display: flex; align-items: center; gap: 14px; padding: 10px 2px; color: var(--ink); flex-wrap: wrap; } .dacct:hover { color: var(--ink); } .dacct img, .av2 { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; } .av2 { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.dacct .dk { flex: 1; min-width: 140px; } .dnums { display: grid; text-align: right; min-width: 90px; } .dnums b { font-size: 20px; letter-spacing: -.02em; } .dnums small { color: var(--muted); font-size: 12px; }
.dhot { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; } .dhot a { display: grid; gap: 4px; color: var(--ink); } .dhot img, .dhot .ph { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; background: var(--bg-2); } .dhot b { color: var(--green); font-size: 13px; } .dhot small { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dmeter { margin: 10px 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 13.5px; } .dmeter .meter { grid-column: 1 / -1; margin-top: 0; }

/* dashboard hover card */
#dtip { position: fixed; z-index: 90; display: none; pointer-events: none; min-width: 150px; padding: 10px 12px; border-radius: 14px; background: var(--card); color: var(--ink); border: 1px solid var(--line-2); box-shadow: 0 14px 32px -12px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .08); font-size: 12.5px; }
#dtip b { display: block; margin-bottom: 6px; font-size: 12px; color: var(--muted); font-weight: 650; }
#dtip .tr { display: flex; align-items: center; gap: 8px; padding: 2px 0; font-weight: 650; } #dtip .tr i { width: 9px; height: 9px; border-radius: 3px; flex: none; } #dtip .tr span { margin-left: auto; padding-left: 14px; font-variant-numeric: tabular-nums; font-weight: 800; } #dtip .tr.mut { color: var(--muted); font-weight: 500; } #dtip .tr.mut span { color: var(--ink-2); font-weight: 650; }
.dchartw { position: relative; } .dchart { cursor: crosshair; touch-action: pan-y; } .dsp { cursor: crosshair; }

.tblwrap { overflow-x: auto; } .dsec { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 2px 10px; } .dsec h3 { margin: 0; font-size: 16px; } .dsec h3 small { color: var(--muted); font-weight: 500; font-size: 12.5px; margin-left: 6px; } .dsec a { font-size: 12.5px; }
.kpis4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } @media (max-width: 900px) { .kpis4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* phones: sparklines sit under the numbers instead of on top of them, headings wrap tidily */
@media (max-width: 720px) {
  .kpi .dsp { position: static; width: 100%; height: 30px; margin-top: 6px; }
  .kpi { padding: 14px 16px 12px; } .kpi .kv { font-size: 28px; }
  .dsec { flex-wrap: wrap; gap: 2px 12px; } .dsec h3 small { display: block; margin: 2px 0 0; }
  .dhero { align-items: flex-start; } .dhero-r { width: 100%; justify-content: space-between; }
}
