/* Ads Profit Lens - website design system.
   Warm pastel base; each tool owns an accent hue (--view) set by body[data-view]. */

:root {
  color-scheme: light dark;
  --side: 256px;
  --deck: 120px;                  /* sticky header height, kept in sync by app.js */

  --bg: #fbf6f1;
  --panel: #ffffff;
  --raise: #fffcf9;
  --ink: #221a15;
  --ink-2: #574840;
  --muted: #9a877a;
  --line: #f0e4d9;
  --line-2: #e4d3c3;

  --brand: #f2823c;
  --good: #12864a;  --good-soft: #e8f8ee;
  --bad: #d4453c;   --bad-soft: #fdf0ee;
  --warn: #b06a06;  --warn-soft: #fef5e4;

  --shadow-sm: 0 1px 2px rgba(80, 52, 30, .06);
  --shadow: 0 1px 2px rgba(80, 52, 30, .05), 0 10px 30px -14px rgba(80, 52, 30, .22);
  --shadow-lg: 0 20px 60px -20px rgba(60, 38, 22, .38);
  --r: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #120f0c;
    --panel: #1b1612;
    --raise: #211b16;
    --ink: #f5ece5;
    --ink-2: #d2c2b6;
    --muted: #9d8b7e;
    --line: #2b231d;
    --line-2: #3a2f27;
    --brand: #f79f60;
    --good: #5cd190;  --good-soft: #13251a;
    --bad: #f58c85;   --bad-soft: #2b1918;
    --warn: #e5ad5a;  --warn-soft: #2a2013;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 14px 34px -16px rgba(0, 0, 0, .7);
    --shadow-lg: 0 24px 70px -20px rgba(0, 0, 0, .8);
  }
}

body[data-view="terms"]      { --view: #f2823c; --view-soft: #fff0e3; --view-ink: #b04810; }
body[data-view="grams"]      { --view: #8b6ff0; --view-soft: #f1ecff; --view-ink: #5a3fd0; }
body[data-view="harvest"]    { --view: #35a75d; --view-soft: #e8f8ed; --view-ink: #1c7340; }
body[data-view="compare"]    { --view: #d99017; --view-soft: #fdf3e1; --view-ink: #8f5c08; }
body[data-view="bids"]       { --view: #3f8ae0; --view-soft: #eaf2ff; --view-ink: #1c5fae; }
body[data-view="placements"] { --view: #10a89a; --view-soft: #e2f9f5; --view-ink: #07766c; }
body[data-view="block"]      { --view: #d9537a; --view-soft: #fdedf2; --view-ink: #a3284f; }
body[data-view="edit"]       { --view: #5d6b85; --view-soft: #edf0f6; --view-ink: #3b475e; }
@media (prefers-color-scheme: dark) {
  body[data-view="terms"]      { --view: #f79f60; --view-soft: #2d1f15; --view-ink: #ffc999; }
  body[data-view="grams"]      { --view: #a793f5; --view-soft: #211d33; --view-ink: #cbbcff; }
  body[data-view="harvest"]    { --view: #5cc27f; --view-soft: #14261a; --view-ink: #9fe0b5; }
  body[data-view="compare"]    { --view: #e5ab4a; --view-soft: #2a2113; --view-ink: #f5cd8a; }
  body[data-view="bids"]       { --view: #6fa9ea; --view-soft: #16212e; --view-ink: #a8cdf7; }
  body[data-view="placements"] { --view: #3ec8b8; --view-soft: #112724; --view-ink: #8ae5da; }
  body[data-view="block"]      { --view: #ec7c9c; --view-soft: #2c1920; --view-ink: #f7b3c6; }
  body[data-view="edit"]       { --view: #9aa8c2; --view-soft: #1a1f28; --view-ink: #c9d3e6; }
}

* { box-sizing: border-box; }
html { scroll-padding-top: var(--deck); }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--ink);
  font: 13.5px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* Soft light that takes the tool's hue. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 22% -12%, color-mix(in srgb, var(--view) 15%, transparent), transparent 62%),
    radial-gradient(760px 520px at 105% 8%, color-mix(in srgb, var(--brand) 9%, transparent), transparent 60%);
}
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- controls ---------- */
input, select, button {
  font: inherit; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 7px 11px;
  transition: border-color .15s, box-shadow .15s, background .15s, transform .15s;
}
input:focus, select:focus {
  outline: none; border-color: var(--view);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--view) 17%, transparent);
}
input[type=number] { width: 100%; text-align: right; font-variant-numeric: tabular-nums; }
input::placeholder { color: var(--muted); }
button { cursor: pointer; }
button:hover { border-color: var(--view); }
button:focus-visible { outline: 2px solid var(--view); outline-offset: 2px; }

.icon-btn {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); box-shadow: var(--shadow-sm);
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.on { background: var(--view-soft); border-color: var(--view); color: var(--view-ink); }
.icon-btn .badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--view); color: #fff; font-size: 10.5px; font-weight: 700;
  display: inline-grid; place-items: center;
}
.ghost { border-color: var(--view); color: var(--view-ink); background: var(--view-soft); }

/* ---------- sidebar ---------- */
#side {
  position: fixed; inset: 0 auto 0 0; width: var(--side); z-index: 40;
  display: flex; flex-direction: column; padding: 18px 14px 14px;
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  backdrop-filter: saturate(160%) blur(18px);
  border-right: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.logo img { width: 34px; height: 34px; border-radius: 10px; box-shadow: var(--shadow); }
.logo b { display: block; font-size: 14.5px; font-weight: 720; letter-spacing: -.02em; }
.logo span { display: block; font-size: 11.5px; color: var(--muted); margin-top: -1px; }

.tabs { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.navlabel {
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); padding: 14px 10px 6px;
}
.navlabel:first-child { padding-top: 2px; }
.tabs button {
  position: relative; display: flex; align-items: center; gap: 11px; text-align: left;
  width: 100%; border: none; background: transparent; border-radius: 11px; padding: 8px 10px;
  color: var(--ink-2);
}
.tabs button[data-v="terms"]      { --h: #f2823c; }
.tabs button[data-v="grams"]      { --h: #8b6ff0; }
.tabs button[data-v="harvest"]    { --h: #35a75d; }
.tabs button[data-v="compare"]    { --h: #d99017; }
.tabs button[data-v="bids"]       { --h: #3f8ae0; }
.tabs button[data-v="placements"] { --h: #10a89a; }
.tabs button[data-v="block"]      { --h: #d9537a; }
.tabs button[data-v="edit"]       { --h: #5d6b85; }
.tabs button svg {
  width: 32px; height: 32px; padding: 7px; border-radius: 9px;
  color: var(--h); background: color-mix(in srgb, var(--h) 12%, transparent);
  transition: background .15s, color .15s;
}
.tabs button b { display: block; font-size: 13px; font-weight: 640; color: var(--ink); }
.tabs button i { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); }
.tabs button:hover { background: color-mix(in srgb, var(--h) 8%, transparent); }
.tabs button.on { background: color-mix(in srgb, var(--h) 14%, var(--panel)); box-shadow: var(--shadow-sm); }
.tabs button.on svg { background: var(--h); color: #fff; }
.tabs button.on::before {
  content: ""; position: absolute; left: -14px; top: 12px; bottom: 12px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--h);
}

.side-foot { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.side-btn {
  display: flex; align-items: center; gap: 9px; width: 100%;
  font-weight: 620; font-size: 12.5px; color: var(--ink-2); box-shadow: var(--shadow-sm);
}
.privacy {
  display: flex; gap: 9px; align-items: flex-start; padding: 10px;
  border-radius: 12px; background: var(--good-soft); color: var(--good);
}
.privacy svg { margin-top: 1px; }
.privacy b { display: block; font-size: 12px; }
.privacy i { display: block; font-style: normal; font-size: 11px; color: var(--ink-2); line-height: 1.4; }

/* ---------- main + sticky header ---------- */
#main { margin-left: var(--side); padding: 0 28px 110px; }

#top {
  position: sticky; top: 0; z-index: 30; margin: 0 -28px; padding: 18px 28px 12px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(170%) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}
.head-row { display: flex; align-items: center; gap: 16px; }
.title { min-width: 0; flex: 1; }
.title h1 { margin: 0; font-size: 22px; font-weight: 740; letter-spacing: -.025em; line-height: 1.2; }
.title p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.head-actions { display: flex; align-items: center; gap: 8px; }

#fileChip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 260px;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  background: var(--view-soft); color: var(--view-ink); font-size: 12px; font-weight: 640;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border: 1px solid color-mix(in srgb, var(--view) 30%, transparent);
}
#fileChip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex: none; }

.search {
  display: flex; align-items: center; gap: 7px; width: 260px; padding: 0 10px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow-sm);
  color: var(--muted); transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--view); box-shadow: 0 0 0 4px color-mix(in srgb, var(--view) 17%, transparent); }
.search input { border: none; box-shadow: none; padding: 7px 0; flex: 1; min-width: 0; background: transparent; }
.search input:focus { box-shadow: none; }
kbd {
  font: 600 11px ui-monospace, monospace; color: var(--muted);
  border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px;
}

/* Filters: a popover, so it never pushes the table down. */
#filters {
  position: absolute; right: 28px; top: calc(100% - 4px); width: 420px; z-index: 35;
  padding: 16px; border-radius: 16px; background: var(--panel);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.field { min-width: 0; }
.field span {
  display: flex; align-items: center; font-size: 10.5px; font-weight: 680; color: var(--muted);
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: 4px;
}
.field select { width: 100%; }
.seg { display: flex; gap: 4px; margin-top: 12px; padding: 3px; border-radius: 11px; background: var(--raise); border: 1px solid var(--line); }
.seg button { flex: 1; border: none; background: transparent; padding: 5px 0; font-size: 12.5px; font-weight: 620; color: var(--muted); border-radius: 8px; }
.seg button.on { background: var(--view); color: #fff; box-shadow: var(--shadow-sm); }
.toggle { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }

.toolbar { display: flex; align-items: center; gap: 7px; margin-top: 12px; flex-wrap: wrap; }
.toolbar select { font-size: 12.5px; padding: 6px 9px; }
#msg { margin-left: auto; font-size: 11.5px; color: var(--muted); text-align: right; }

/* ---------- hero (no file yet) ---------- */
.drop { cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.hero {
  margin: 34px auto 0; max-width: 760px; padding: 54px 30px 40px; text-align: center;
  border-radius: 24px; border: 1.5px dashed color-mix(in srgb, var(--view) 45%, var(--line-2));
  background:
    radial-gradient(500px 220px at 50% 0%, color-mix(in srgb, var(--view) 12%, transparent), transparent 70%),
    var(--panel);
  box-shadow: var(--shadow);
}
.hero:hover, .hero.over { border-color: var(--view); transform: translateY(-2px); }
.hero-icon {
  width: 68px; height: 68px; margin: 0 auto 18px; border-radius: 20px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--view), color-mix(in srgb, var(--view) 60%, #ffb27a));
  color: #fff; box-shadow: 0 14px 30px -10px color-mix(in srgb, var(--view) 70%, transparent);
  animation: float 3.6s ease-in-out infinite;
}
.hero-icon svg { width: 30px; height: 30px; stroke-width: 2; }
.hero b { display: block; font-size: 21px; font-weight: 740; letter-spacing: -.02em; }
.hero > span { display: block; margin-top: 5px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 24px; }
.chips em {
  font-style: normal; font-size: 12px; font-weight: 600; color: var(--ink-2);
  padding: 5px 11px; border-radius: 999px; background: var(--raise); border: 1px solid var(--line);
}
@keyframes float { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .hero-icon { animation: none; } .hero:hover { transform: none; } }

/* How it works (start screen only) */
.how {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
  max-width: 760px; margin: 18px auto 0;
}
.how > div { padding: 16px; border-radius: var(--r); background: color-mix(in srgb, var(--panel) 70%, transparent); border: 1px solid var(--line); }
.how em {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px;
  font-style: normal; font-weight: 750; font-size: 12px; color: #fff; background: var(--view);
}
.how b { display: block; margin-top: 10px; font-size: 13.5px; font-weight: 700; }
.how span { display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
body.loaded .how { display: none; }

/* Before a file is loaded only the hero shows. */
body:not(.loaded) .stats, body:not(.loaded) .table-card, body:not(.loaded) .toolbar { display: none; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.4fr); gap: 12px; margin: 20px 0 16px; }
.stat {
  position: relative; overflow: hidden; padding: 14px 16px; border-radius: var(--r);
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.stat::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--view), color-mix(in srgb, var(--view) 20%, transparent));
}
.stat i {
  display: block; font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
}
.stat b { display: block; margin-top: 4px; font-size: 26px; font-weight: 740; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat.loss b { color: var(--bad); }
.stat.loss::before { background: linear-gradient(90deg, var(--bad), color-mix(in srgb, var(--bad) 20%, transparent)); }
.stat.note { display: flex; align-items: center; font-size: 12.5px; color: var(--ink-2); background: var(--raise); }
.stat.note::before { display: none; }
#beNote { cursor: pointer; line-height: 1.45; }
#beNote:hover { color: var(--view-ink); }
#beNote.warn { color: var(--warn); }

#dropPrev {
  margin-bottom: 14px; padding: 14px; text-align: center; font-weight: 600; color: var(--ink-2);
  border-radius: var(--r); border: 1.5px dashed color-mix(in srgb, var(--view) 50%, var(--line-2));
  background: var(--view-soft);
}
#dropPrev.over { border-color: var(--view); }

/* ---------- tool control cards (Block, Edit) ---------- */
.ctl {
  margin-bottom: 16px; padding: 16px; border-radius: 16px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.ctl-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.ctl-row > input, .ctl-row > select { flex: 1; min-width: 0; }
#blockText { font-weight: 640; font-size: 14px; }
.mseg { display: inline-flex; gap: 3px; padding: 3px; border-radius: 11px; background: var(--raise); border: 1px solid var(--line); }
.mseg button { border: none; background: transparent; padding: 6px 13px; font-size: 12.5px; font-weight: 620; color: var(--muted); border-radius: 8px; }
.mseg button.on { background: var(--view); color: #fff; box-shadow: var(--shadow-sm); }
#editMode { display: flex; margin-bottom: 12px; }
#editMode button { flex: 1; }
.case { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; cursor: pointer; }

.asin-list {
  max-height: 210px; overflow-y: auto; border-radius: 11px;
  border: 1px solid var(--line); background: var(--raise);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.asin-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 11px; cursor: pointer; min-width: 0;
  border-bottom: 1px solid var(--line); font-size: 12.5px; white-space: nowrap;
}
.asin-item:hover { background: var(--view-soft); }
.asin-item b { font: 600 12px ui-monospace, monospace; }
.asin-item i { font-style: normal; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#blockAsinCount { display: block; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.ctl-sum { margin-top: 10px; font-size: 12.5px; font-weight: 620; color: var(--ink-2); }
.ctl-sum.warn { color: var(--warn); }
.ctl-sum.err { color: var(--bad); }

/* ---------- table ---------- */
.table-card {
  border-radius: 16px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 0 6px 6px;
}
/* Visible overflow keeps the header sticky against the page scroll. */
#tableWrap { overflow: visible; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
th {
  position: sticky; top: var(--deck); z-index: 2;
  background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(8px);
  color: var(--muted); font-weight: 700; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .07em; text-align: left;
  padding: 12px 10px 10px; border-bottom: 1px solid var(--line-2);
  cursor: pointer; user-select: none; white-space: nowrap;
}
th.num { text-align: right; }
th:hover { color: var(--view-ink); }
th.sorted { color: var(--view); }
/* 30px is load-bearing: panel.js windows rows assuming ROW_H = 30. */
td {
  height: 30px; padding: 0 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; color: var(--ink-2);
}
td:nth-child(2) { color: var(--ink); font-weight: 520; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.mono { font: 12.5px ui-monospace, monospace; }
td.ell { max-width: 340px; text-overflow: ellipsis; }
td.good { color: var(--good); font-weight: 640; }
td.bad { color: var(--bad); font-weight: 640; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: var(--view-soft); }
tr.waste td { background: color-mix(in srgb, var(--bad-soft) 70%, transparent); }
tr.waste td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
tr.win td { background: color-mix(in srgb, var(--good-soft) 70%, transparent); }
tr.win td:first-child { box-shadow: inset 3px 0 0 var(--good); }
tr.inef td { background: color-mix(in srgb, var(--warn-soft) 75%, transparent); }
tr.inef td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
tr.done td { opacity: .42; }

/* state + confidence pills */
td.st { font-size: 11.5px; font-weight: 700; }
td.st::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 6px; vertical-align: 1px; background: currentColor;
}
td.st[data-cls="WASTE"]             { color: var(--bad); }
td.st[data-cls="INEFFICIENT"]       { color: var(--warn); }
td.st[data-cls="HARVEST"]           { color: var(--good); }
td.st[data-cls="WINNER"]            { color: var(--good); }
td.st[data-cls="WATCH"]             { color: var(--muted); }
td.st[data-cls="ASIN_TARGET"]       { color: var(--view-ink); }
td.st[data-cls="EXISTING_NEGATIVE"] { color: var(--muted); }
td.conf { font-size: 11.5px; font-weight: 700; color: var(--muted); }
td.conf[data-conf="HIGH"], td.conf[data-conf="VERY_HIGH"] { color: var(--ink); }
td.conf[data-conf="VERY_LOW"] { opacity: .5; }

input[type=checkbox] { accent-color: var(--view); width: 15px; height: 15px; cursor: pointer; vertical-align: middle; padding: 0; }
input[type=checkbox]:disabled { cursor: not-allowed; opacity: .3; }

#empty { padding: 50px 20px; text-align: center; color: var(--muted); }

/* ---------- floating action bar ---------- */
#actions {
  position: fixed; left: var(--side); right: 0; bottom: 18px; z-index: 45;
  display: flex; justify-content: center; pointer-events: none;
}
.pill {
  pointer-events: auto; display: flex; align-items: center; gap: 16px;
  padding: 7px 7px 7px 20px; border-radius: 999px; max-width: min(760px, 92%);
  background: color-mix(in srgb, var(--panel) 86%, transparent); backdrop-filter: saturate(170%) blur(18px);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
body:not(.loaded) #actions { display: none; }
#count { font-size: 13px; font-weight: 640; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#export {
  border: none; border-radius: 999px; padding: 9px 20px; font-weight: 700; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, var(--view), color-mix(in srgb, var(--view) 72%, #000));
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--view) 80%, transparent);
}
#export:hover { transform: translateY(-1px); filter: brightness(1.05); }
#export.dim { opacity: .45; box-shadow: none; transform: none; }

/* ---------- info markers + tooltip ---------- */
.info {
  display: inline-grid; place-items: center; width: 14px; height: 14px; margin-left: 5px; border-radius: 50%;
  background: var(--line-2); color: var(--panel); font-size: 9.5px; font-weight: 800; font-style: normal;
  cursor: help; vertical-align: middle; text-transform: none; letter-spacing: 0;
}
.info:hover, .info:focus-visible { background: var(--view); outline: none; }
th .info { background: none; color: var(--muted); border: 1px solid var(--line-2); }
th .info:hover { background: var(--view); color: #fff; border-color: var(--view); }
#tip {
  position: fixed; z-index: 100; max-width: 280px; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 8px 11px; border-radius: 10px;
  font-size: 12px; font-weight: 500; line-height: 1.45; box-shadow: var(--shadow-lg);
  opacity: 0; transition: opacity .12s;
}
#tip.show { opacity: 1; }

/* ---------- settings modal ---------- */
#settingsModal {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: rgba(20, 12, 6, .38); backdrop-filter: blur(6px);
  animation: fade .18s ease-out;
}
.sheet {
  width: min(900px, 94vw); height: min(88vh, 940px); display: flex; flex-direction: column;
  border-radius: 20px; overflow: hidden; background: var(--bg); box-shadow: var(--shadow-lg);
  border: 1px solid var(--line); animation: rise .22s ease-out;
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.sheet-head b { font-size: 14px; }
#settingsFrame { flex: 1; width: 100%; border: none; background: var(--bg); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }

/* ---------- whole-window drop ---------- */
#dragOverlay {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; pointer-events: none;
  background: color-mix(in srgb, var(--view) 14%, rgba(20, 12, 6, .3)); backdrop-filter: blur(4px);
}
#dragOverlay > div {
  padding: 40px 60px; text-align: center; border-radius: 24px; background: var(--panel);
  border: 2px dashed var(--view); box-shadow: var(--shadow-lg);
}
#dragOverlay b { display: block; font-size: 20px; font-weight: 740; }
#dragOverlay span { color: var(--muted); }

/* ---------- smaller screens: sidebar becomes a top strip ---------- */
@media (max-width: 960px) {
  #side { position: static; width: auto; flex-direction: row; align-items: center; padding: 10px 14px; border-right: none; border-bottom: 1px solid var(--line); }
  .logo { padding: 0 10px 0 0; }
  .logo span, .navlabel, .tabs button i, .privacy, .side-foot { display: none; }
  .tabs { flex-direction: row; overflow-x: auto; }
  .tabs button { width: auto; padding: 6px 8px; }
  .tabs button.on::before { display: none; }
  #main { margin-left: 0; padding: 0 16px 110px; }
  #top { margin: 0 -16px; padding: 14px 16px 10px; }
  .search { width: 180px; }
  #filters { right: 16px; width: min(420px, calc(100vw - 32px)); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat.note { grid-column: 1 / -1; }
  .how { grid-template-columns: 1fr; }
  #actions { left: 0; }
}
