/* Scrapper SS.LV — brand tokens from the brand sheet:
   ink #111820, lime #C7F36B, slate #6B7280, paper #F4F3EE, Manrope. */

@font-face { font-family: Manrope; font-weight: 400; font-display: swap; src: url(fonts/manrope-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Manrope; font-weight: 600; font-display: swap; src: url(fonts/manrope-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Manrope; font-weight: 700; font-display: swap; src: url(fonts/manrope-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Manrope; font-weight: 800; font-display: swap; src: url(fonts/manrope-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Manrope; font-weight: 400; font-display: swap; src: url(fonts/manrope-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Manrope; font-weight: 600; font-display: swap; src: url(fonts/manrope-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Manrope; font-weight: 700; font-display: swap; src: url(fonts/manrope-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Manrope; font-weight: 800; font-display: swap; src: url(fonts/manrope-latin-ext-800-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Manrope; font-weight: 400; font-display: swap; src: url(fonts/manrope-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Manrope; font-weight: 600; font-display: swap; src: url(fonts/manrope-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Manrope; font-weight: 700; font-display: swap; src: url(fonts/manrope-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Manrope; font-weight: 800; font-display: swap; src: url(fonts/manrope-cyrillic-800-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --ink: #111820;
  --ink-2: #19222d;
  --ink-3: #26313f;
  --ink-line: #2f3b4b;
  --on-ink: #F4F3EE;
  --on-ink-muted: #9AA3AF;
  --lime: #C7F36B;
  --lime-deep: #4F8410;
  --slate: #6B7280;
  --paper: #F4F3EE;
  --card: #FFFFFF;
  --line: #E3E1D8;
  --line-strong: #CFCBBE;
  --text: #111820;
  --muted: #5F6672;
  --err: #B42318;
  --err-bg: #FDECEA;
  --warn: #9A5B00;
  --r-panel: 16px;
  --r-ctl: 10px;
  --skew: -18deg;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  font-family: Manrope, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--paper);
  font-feature-settings: "tnum" 1;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lime-deep); outline-offset: 2px; }
.side :focus-visible, .monitor :focus-visible, .popup :focus-visible { outline-color: var(--lime); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  background: var(--ink); color: var(--on-ink); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: var(--s5) var(--s4);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 0 var(--s2) var(--s6); }
.brand-mark { width: 38px; height: 28px; color: var(--on-ink); flex: none; }
.brand-word { font-weight: 800; font-size: 15px; letter-spacing: .02em; line-height: 1.1; }
.brand-word b { color: var(--lime); font-weight: 800; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  text-decoration: none; color: var(--on-ink-muted); font-weight: 600; border-radius: 8px; isolation: isolate;
}
.nav a svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.nav a svg path.stroke { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.nav a:hover { color: var(--on-ink); background: var(--ink-2); }
.nav a[aria-current="page"] { color: var(--ink); background: transparent; }
.nav a[aria-current="page"]::before {
  content: ""; position: absolute; inset: 0 6px; background: var(--lime); transform: skewX(var(--skew));
  border-radius: 4px; z-index: -1;
}
.nav-count {
  margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 11px; background: var(--lime); color: var(--ink);
  font-size: 12px; font-weight: 800; text-align: center; line-height: 20px;
}
.nav a[aria-current="page"] .nav-count { background: var(--ink); color: var(--lime); }
.side-status { margin-top: auto; padding: var(--s3); border-radius: 12px; background: var(--ink-2); font-size: 13px; color: var(--on-ink-muted); }
.side-status strong { color: var(--on-ink); font-weight: 700; display: block; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; transform: skewX(var(--skew)); flex: none; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--on-ink-muted); margin-right: 6px; vertical-align: 1px; }
.dot.live { background: var(--lime); box-shadow: 0 0 0 3px rgba(199, 243, 107, .18); }
.dot.err { background: #F97066; }
.dot.pause { background: #F2C14E; }

.main { padding: var(--s5) var(--s6) var(--s7); min-width: 0; outline: none; }
.topbar { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s5); flex-wrap: wrap; }
.topbar h1 { font-size: 28px; line-height: 1.15; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.topbar .sub { color: var(--muted); margin: 2px 0 0; }
.topbar .actions { margin-left: auto; display: flex; gap: var(--s2); flex-wrap: wrap; }

/* ------------------------------------------------------------ controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: var(--card); font-weight: 700;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--lime); border-color: var(--ink); }
.btn.primary:hover { background: var(--ink-3); }
.btn.lime { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.btn.lime:hover { filter: brightness(.96); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: rgba(17, 24, 32, .05); }
.btn.danger { color: var(--err); }
.btn.danger:hover { border-color: var(--err); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.icon-btn { width: 34px; height: 34px; padding: 0; border-radius: 9px; border: 1px solid transparent; background: transparent; cursor: pointer; display: inline-grid; place-items: center; color: var(--muted); }
.icon-btn:hover { background: rgba(17, 24, 32, .06); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.icon-btn.on { color: #B7791F; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 700; }
.field small, .hint { color: var(--muted); font-size: 13px; }
.input, select.input, textarea.input {
  height: 38px; padding: 0 12px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: var(--card); width: 100%;
}
textarea.input { height: auto; min-height: 72px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(94, 154, 18, .22); }
.input.mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; }
.row { display: flex; gap: var(--s3); align-items: flex-end; flex-wrap: wrap; }
.row > .field { flex: 1 1 160px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 40px; height: 24px; border-radius: 12px; background: var(--line-strong); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--ink); }
.switch input:checked + .track::after { transform: translateX(16px); background: var(--lime); }
.switch input:focus-visible + .track { outline: 2px solid var(--lime-deep); outline-offset: 2px; }

.seg { align-self: flex-start; display: inline-flex; padding: 3px; border-radius: 11px; background: #E9E7DF; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; height: 32px; padding: 0 12px; border-radius: 8px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(17, 24, 32, .12); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 30px; padding: 0 11px; border-radius: 15px; border: 1px solid var(--line-strong); background: var(--card); font-weight: 600; font-size: 13px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--lime); }

/* skewed tag: the logo's parallelogram as a status marker */
.tag { display: inline-block; position: relative; padding: 1px 9px; font-size: 12px; font-weight: 800; isolation: isolate; color: var(--ink); white-space: nowrap; }
.tag::before { content: ""; position: absolute; inset: 0; transform: skewX(var(--skew)); border-radius: 3px; background: var(--lime); z-index: -1; }
.tag.drop::before { background: #FFE2C7; }
.tag.new::before { background: #E6E3D9; }
.tag.err { color: #fff; }
.tag.err::before { background: var(--err); }
.tag.ok::before { background: #DDF5B5; }

/* ------------------------------------------------------------ panels */
.panel { background: var(--card); border-radius: var(--r-panel); border: 1px solid var(--line); padding: var(--s5); min-width: 0; }
.panel + .panel, .grid2 + .panel, .panel + .grid2, .grid2 + .grid2, #askOut > .panel { margin-top: var(--s4); }
.panel h2 { font-size: 18px; margin: 0 0 var(--s1); font-weight: 800; }
.panel h3 { font-size: 15px; margin: 0 0 var(--s2); font-weight: 800; }
.panel .lead { color: var(--muted); margin: 0 0 var(--s4); max-width: 70ch; }
.panel-head { display: flex; align-items: flex-start; gap: var(--s3); margin-bottom: var(--s4); flex-wrap: wrap; }
.panel-head > div:first-child { flex: 1 1 0; min-width: 220px; }
.panel-head h2 { margin: 0; }
.panel-head p { margin: 2px 0 0; color: var(--muted); }
.cols > .panel, .grid2 > .panel, .grid3 > .panel { margin-top: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: var(--s4); margin-top: var(--s4); align-items: start; }
.divider { height: 1px; background: var(--line); margin: var(--s5) 0; border: 0; }

/* ------------------------------------------------------------ monitor (the signature element) */
.monitor { background: var(--ink); color: var(--on-ink); border-radius: 20px; padding: var(--s5) var(--s5) var(--s4); position: relative; overflow: hidden; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: var(--s5); }
.kpi { padding: 0 var(--s5); border-left: 1px solid var(--ink-line); }
.kpi:first-child { padding-left: 0; border-left: 0; }
.kpi .num { font-size: 40px; line-height: 1.05; font-weight: 800; letter-spacing: -.02em; }
.kpi .num.lime { color: var(--lime); }
.kpi .lbl { color: var(--on-ink-muted); font-size: 13px; font-weight: 600; margin-top: 4px; }
.kpi .delta { font-size: 12px; color: var(--on-ink-muted); }
.lanes { display: flex; flex-direction: column; gap: 2px; }
.lanes-head { display: flex; align-items: baseline; gap: var(--s3); margin-bottom: var(--s2); }
.lanes-head h2 { font-size: 15px; margin: 0; font-weight: 800; }
.lanes-head span { color: var(--on-ink-muted); font-size: 13px; }
.lane { display: grid; grid-template-columns: 12px minmax(150px, 230px) minmax(0, 1fr) 118px 190px; align-items: center; gap: var(--s3); padding: 9px 10px; border-radius: 10px; }
.lane:hover { background: var(--ink-2); }
.lane .sw { width: 10px; height: 10px; border-radius: 3px; transform: skewX(var(--skew)); }
.lane .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane .nm small { display: block; color: var(--on-ink-muted); font-weight: 500; font-size: 12px; }
.lane .track { position: relative; height: 10px; }
.lane .track::before { content: ""; position: absolute; inset: 0; transform: skewX(var(--skew)); background: var(--ink-3); border-radius: 2px; }
.lane .fill { position: absolute; left: 0; top: 0; bottom: 0; transform: skewX(var(--skew)); background: var(--lime); border-radius: 2px; transition: width .9s linear; }
.lane.scanning .fill {
  width: 100% !important; transition: none;
  background: repeating-linear-gradient(90deg, var(--lime) 0 14px, rgba(199,243,107,.35) 14px 28px);
  background-size: 28px 100%; animation: sweep .6s linear infinite;
}
.lane.paused .fill, .lane.off .fill { background: var(--on-ink-muted); opacity: .45; }
.lane.error .fill { background: #F97066; }
@keyframes sweep { to { background-position: 28px 0; } }
.lane .when { font-size: 13px; color: var(--on-ink); text-align: right; white-space: nowrap; }
.lane .when.err { color: #FDA29B; }
.lane .res { font-size: 13px; color: var(--on-ink-muted); text-align: right; white-space: nowrap; }
.lane .res b { color: var(--lime); }
.lane button { background: none; border: 0; color: inherit; text-align: left; padding: 0; cursor: pointer; font: inherit; min-width: 0; }
.monitor .empty { padding: var(--s5) 0 var(--s2); color: var(--on-ink-muted); }

/* ------------------------------------------------------------ listings */
.toolbar { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; margin-bottom: var(--s4); }
.toolbar .input { width: auto; }
.toolbar .grow { flex: 1 1 220px; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.item { display: grid; grid-template-columns: 116px minmax(0, 1fr) auto; gap: var(--s4); padding: 14px var(--s4); border-top: 1px solid var(--line); align-items: center; }
.item:first-child { border-top: 0; }
.item:hover { background: #FBFAF7; }
.item.is-match { box-shadow: inset 3px 0 0 var(--lime-deep); }
.thumb { width: 116px; height: 87px; border-radius: 10px; background: #ECEAE3 center/cover no-repeat; display: block; }
.thumb.none { text-decoration: none; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.item h3 { font-size: 15px; font-weight: 700; margin: 0 0 4px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item h3 a { text-decoration: none; }
.item h3 a:hover { text-decoration: underline; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 13px; }
.facts b { color: var(--text); font-weight: 700; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--muted); }
.why { color: var(--lime-deep); font-weight: 600; }
.price { text-align: right; min-width: 128px; }
.price .p { font-size: 21px; font-weight: 800; white-space: nowrap; letter-spacing: -.01em; }
.price .was { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.price .acts { display: flex; justify-content: flex-end; gap: 2px; margin-top: 4px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: var(--s3); color: var(--muted); }
.empty-state { padding: var(--s7) var(--s5); text-align: center; color: var(--muted); }
.empty-state h3 { color: var(--text); font-size: 18px; margin: 0 0 6px; }
.empty-state p { margin: 0 auto var(--s4); max-width: 46ch; }

/* recent matches on overview */
.mini { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: var(--s3); padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; align-items: center; }
.mini:first-of-type { border-top: 0; }
.mini .thumb { width: 72px; height: 54px; border-radius: 8px; }
.mini .t { font-weight: 700; font-size: 13px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mini .s { font-size: 12px; color: var(--muted); }
.mini .s b { color: var(--text); font-size: 13px; }
.mini:hover .t { text-decoration: underline; }

/* ------------------------------------------------------------ categories */
.cat-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto auto; gap: var(--s4); align-items: center; padding: var(--s4); border-top: 1px solid var(--line); }
.cat-row:first-child { border-top: 0; }
.cat-row .sw { width: 12px; height: 12px; border-radius: 3px; transform: skewX(var(--skew)); }
.cat-row h3 { margin: 0; font-size: 15px; }
.cat-row .u { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.cat-row .stats { display: flex; gap: var(--s5); font-size: 13px; color: var(--muted); text-align: right; }
.cat-row .stats b { display: block; color: var(--text); font-size: 16px; }
.cat-row .errline { color: var(--err); font-size: 12px; margin-top: 2px; }
.cat-row.off { opacity: .6; }

/* drawer */
.modal-root:empty { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(17, 24, 32, .45); z-index: 40; display: flex; justify-content: flex-end; }
.scrim.center { justify-content: center; align-items: flex-start; padding-top: 8vh; }
.drawer { width: min(760px, 100%); height: 100%; background: var(--paper); overflow: auto; display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(17, 24, 32, .25); }
.dialog { width: min(720px, calc(100% - 32px)); max-height: 84vh; overflow: auto; background: var(--paper); border-radius: 18px; box-shadow: 0 24px 60px rgba(17, 24, 32, .35); }
.sheet-head { position: sticky; top: 0; z-index: 2; background: var(--ink); color: var(--on-ink); padding: var(--s4) var(--s5); display: flex; align-items: center; gap: var(--s3); }
.sheet-head h2 { margin: 0; font-size: 18px; font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-head .icon-btn { color: var(--on-ink-muted); }
.sheet-head .icon-btn:hover { background: var(--ink-3); color: var(--on-ink); }
.sheet-body { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s4); flex: 1; }
.sheet-foot { position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: var(--s3) var(--s5); display: flex; gap: var(--s2); align-items: center; }
.sheet-foot .spacer { flex: 1; }
.preview-bar { display: flex; align-items: center; gap: var(--s2); font-size: 13px; color: var(--muted); }
.preview-bar b { color: var(--text); font-size: 15px; }
.section-title { font-size: 15px; font-weight: 800; margin: 0 0 2px; }
.section-note { color: var(--muted); margin: 0 0 var(--s3); font-size: 13px; }
.rule { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) 34px; gap: var(--s2); align-items: center; margin-bottom: var(--s2); }
.rule.two { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, .5fr) minmax(0, .5fr) 34px; }
.cols-list { display: flex; flex-wrap: wrap; gap: 6px; }
.cols-list span.dt { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.probe-out { display: flex; flex-direction: column; gap: var(--s4); }
.probe-out:empty { display: none; }
.cols-list span { background: #ECEAE3; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; }
.sample { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.sample .thumb { width: 58px; height: 44px; border-radius: 6px; }
.notice { padding: var(--s3) var(--s4); border-radius: 12px; background: #ECEAE3; font-size: 13px; }
.notice.err { background: var(--err-bg); color: var(--err); }
.notice.ok { background: #E9F7CF; color: #2F5A07; }
.steps { margin: 0 0 var(--s4); padding-left: 20px; color: var(--muted); }
.steps li { margin-bottom: 4px; }
.steps b { color: var(--text); }
.kbd { font-family: Consolas, monospace; font-size: 12px; background: #ECEAE3; padding: 1px 6px; border-radius: 5px; color: var(--text); }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 700; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; }
.table .errtxt { color: var(--err); }

/* charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid line { stroke: #ECEAE3; }
.chart .axis text, .chart text.axis { fill: var(--muted); font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: var(--s3); font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; transform: skewX(var(--skew)); display: inline-block; }
.tip {
  position: absolute; pointer-events: none; background: var(--ink); color: var(--on-ink); padding: 8px 10px; border-radius: 9px;
  font-size: 12px; line-height: 1.45; white-space: nowrap; z-index: 5; box-shadow: 0 6px 20px rgba(17, 24, 32, .25); transform: translate(-50%, calc(-100% - 10px));
}
.tip b { color: var(--lime); }
.tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.market-stats { display: flex; gap: var(--s6); margin-bottom: var(--s4); flex-wrap: wrap; }
.market-stats div b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.market-stats div span { color: var(--muted); font-size: 13px; }

/* in-app popups */
.popups { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 60; width: 360px; max-width: calc(100vw - 40px); }
.popup { background: var(--ink); color: var(--on-ink); border-radius: 14px; padding: 12px; display: grid; grid-template-columns: 76px minmax(0, 1fr) 26px; gap: 12px; box-shadow: 0 14px 40px rgba(17, 24, 32, .35); animation: pop .22s ease-out; }
.popup .thumb { width: 76px; height: 57px; border-radius: 8px; background-color: var(--ink-3); }
.popup .k { font-size: 12px; color: var(--lime); font-weight: 800; }
.popup .t { font-weight: 700; font-size: 13px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.popup .p { font-size: 13px; color: var(--on-ink-muted); margin-top: 2px; }
.popup .p b { color: var(--on-ink); }
.popup a { color: var(--lime); font-weight: 700; font-size: 13px; }
.popup .x { background: none; border: 0; color: var(--on-ink-muted); cursor: pointer; font-size: 18px; line-height: 1; align-self: start; padding: 2px; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--on-ink); padding: 10px 16px; border-radius: 10px; z-index: 70; font-weight: 600; box-shadow: 0 10px 30px rgba(17,24,32,.3); }
.toast.err { background: var(--err); color: #fff; }

.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rot .7s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
  .lane.scanning .fill { background: var(--lime); }
}

@media (max-width: 1100px) {
  .cols { grid-template-columns: 1fr; }
  .lane { grid-template-columns: 12px minmax(120px, 1fr) minmax(0, 1.4fr) 104px; }
  .lane .res { display: none; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: var(--s3); }
  .brand { padding: 0 var(--s3) 0 0; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a { padding: 8px 10px; }
  .side-status { display: none; }
  .main { padding: var(--s4); }
  .kpis { grid-template-columns: repeat(2, 1fr); row-gap: var(--s4); }
  .kpi:nth-child(3) { padding-left: 0; border-left: 0; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .item { grid-template-columns: 88px minmax(0, 1fr); }
  .thumb { width: 88px; height: 66px; }
  .price { grid-column: 2; text-align: left; }
  .price .acts { justify-content: flex-start; }
  .lane { grid-template-columns: 12px minmax(0, 1fr) 96px; }
  .lane .track { grid-column: 2 / 4; grid-row: 2; }
  .cat-row { grid-template-columns: 14px minmax(0, 1fr); }
  .cat-row .stats, .cat-row .ops { grid-column: 2; }
}

/* ---------------------------------------------------------------- v1.1 */
.val { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 6px; font-size: 13px; }
.val.muted, .val .muted { color: var(--muted); }
.disc { font-weight: 800; padding: 1px 8px; border-radius: 6px; background: #ECEAE3; }
.disc.good { background: var(--lime); color: var(--ink); }
.disc.ok { background: #E9F7CF; color: #2F5A07; }
.disc.bad { background: #FDECEA; color: var(--err); }
.score { display: inline-flex; align-items: baseline; gap: 1px; font-weight: 800; font-size: 15px; background: var(--ink); color: var(--lime); padding: 1px 8px; border-radius: 7px; }
.score small { font-size: 10px; color: var(--on-ink-muted); font-weight: 700; }
.score.sm { font-size: 12px; padding: 0 6px; }
.ssf { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s3); }
.pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; color: var(--muted); }
.notes { margin: 8px 0 0; padding-left: 18px; }
.notes li { margin-top: 2px; }
.panel.tight { padding: var(--s4); }
.qr-card { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: var(--s4); align-items: start; background: #FBFAF7; border: 1px solid var(--line); border-radius: 14px; padding: var(--s4); }
.qr svg { width: 180px; height: 180px; display: block; background: #fff; border-radius: 10px; }
.mono-link { font-family: Consolas, monospace; font-size: 12px; word-break: break-all; color: var(--lime-deep); }
.chat-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.chat-row:first-child { border-top: 0; }
.welcome { padding-left: 22px; margin: 0; font-size: 15px; line-height: 1.6; }
.welcome li { margin-bottom: 8px; }
a.sample { text-decoration: none; color: inherit; }
a.sample:hover > div { text-decoration: underline; }
.sample .score { margin-top: 2px; }
@media (max-width: 820px) { .qr-card { grid-template-columns: 1fr; } }

/* lane v1.1: the countdown sits under the bar, so long RU/LV phrases never collide */
.lane { grid-template-columns: 12px minmax(160px, 250px) minmax(0, 1fr) 190px; }
.lane .prog { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lane .prog .when { text-align: left; font-size: 12.5px; color: var(--on-ink-muted); font-variant-numeric: tabular-nums; }
.lane .nm small { white-space: normal; }
@media (max-width: 1100px) { .lane { grid-template-columns: 12px minmax(120px, 1fr) minmax(0, 1.4fr); } }
@media (max-width: 820px) { .lane { grid-template-columns: 12px minmax(0, 1fr); } .lane .prog { grid-column: 2; } }
.item > a, .mini, a.sample { text-decoration: none; }

/* v1.2 profile conditions */
h2 .tag { margin-left: 8px; vertical-align: middle; }
.conds { align-items:end; }
.conds .switch.cond { align-self:center; line-height:1.25; }
.field .pg, .switch .pg { display:inline-block; margin-top:4px; font-size:11.5px; color:var(--muted); }

/* v1.2 assistant */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }
.ask-text { font-size:17px; line-height:1.45; min-height:96px; resize:vertical; }
.ask-row { margin-top:12px; align-items:center; justify-content:space-between; gap:12px; }
.ask-row .ex { flex:1; }
.ask-row .ex .chip { max-width:100%; white-space:normal; text-align:left; height:auto; padding:6px 10px; line-height:1.3; }
.ask-note { margin:12px 0 0; }
.plan .plan-goal { margin:4px 0 10px; }
.checks { list-style:none; margin:0 0 12px; padding:0; display:grid; gap:6px; }
.checks li { position:relative; padding-left:26px; line-height:1.4; }
.checks li::before { content:""; position:absolute; left:0; top:2px; width:18px; height:18px; border-radius:5px;
  background:var(--lime) no-repeat center/12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5 5 9l5-6' fill='none' stroke='%23111820' stroke-width='2'/%3E%3C/svg%3E"); }
.checks.warn li::before { background:#FFE2C7 no-repeat center/12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 2v5M6 9v1' stroke='%239A5B00' stroke-width='2'/%3E%3C/svg%3E"); }
.plan details { margin:10px 0; }
.plan details > summary { cursor:pointer; font-weight:700; }
.plan details .conds { margin-top:12px; }
.plan .fixes ul { margin:8px 0 0; padding-left:18px; color:var(--muted); }
.plan-foot { margin-top:16px; align-items:center; }

/* v1.2 accounts */
.side-user { margin-top: auto; margin-bottom: var(--s3); padding: var(--s3); border-radius: 12px; background: var(--ink-2); color: var(--on-ink); font-size: 13px; }
.side-user + .side-status { margin-top: 0; }
.side-user .who { display: flex; align-items: center; gap: 10px; }
.side-user .avatar { flex: 0 0 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--ink); font-weight: 800; }
.side-user .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.side-user .name small { color: var(--on-ink-muted); font-weight: 600; }
.side-user .icon-btn { color: var(--on-ink-muted); }
.side-user .icon-btn:hover { color: var(--on-ink); }
.side-user .as { display: block; margin-top: 10px; }
.side-user .as span { display: block; color: var(--on-ink-muted); font-size: 12px; margin-bottom: 4px; }
.side-user .as .input { background: var(--ink-3); color: var(--on-ink); border-color: var(--ink-line); height: 34px; }
.shell.auth { display: block; }
.shell.auth .side { display: none; }
.shell.auth .main { max-width: none; padding: 0; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(420px, 100%); }
.auth-card h1 { margin: 6px 0 12px; font-size: 26px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; color: var(--ink); }
.auth-brand svg { width: 42px; height: 30px; }
.auth-form { display: grid; gap: 12px; margin-top: 8px; }
.auth-form .btn { justify-self: start; }
.table-wrap { overflow-x: auto; }
.table .row-actions { text-align: right; min-width: 210px; }
.table .row-actions .btn { margin: 0 0 4px 4px; }
.err-txt { color: var(--err); }
.btn.danger { color: var(--err); }
.mono-link.big { font-size: 15px; margin: 4px 0 12px; }
.tun-on { display: flex; align-items: center; gap: 8px; font-weight: 700; margin: 0; }

/* v1.4 new search: the main action, always in view */
.new-search {
  position: relative; display: flex; align-items: center; gap: 10px; margin: 0 0 var(--s4); padding: 0 16px; height: 48px;
  background: var(--lime); color: var(--ink); border-radius: 10px; text-decoration: none; font-weight: 800; font-size: 15.5px;
  box-shadow: 0 0 0 0 rgba(199, 243, 107, 0); transition: box-shadow .15s, filter .15s;
}
.new-search svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.new-search:hover { filter: brightness(1.04); box-shadow: 0 0 0 4px rgba(199, 243, 107, .22); }
.new-search[aria-current="page"] { box-shadow: 0 0 0 3px var(--ink), 0 0 0 5px var(--lime); }
.new-search:focus-visible { outline: 2px solid var(--on-ink); outline-offset: 3px; }
.ask-alt { margin: 14px 2px 0; color: var(--muted); }
.linkbtn { border: 0; background: none; padding: 0; color: var(--text); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
@media (max-width: 820px) { .new-search { margin: 0 var(--s3) 0 0; height: 40px; } }

/* v1.4 market trends */
.mk-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: var(--s4); }
.mk-bar .input { width: 240px; }
.mk-status { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 13px; margin: -8px 0 var(--s4); }
.mk-status b { color: var(--text); }
.table tr.mk-row { cursor: pointer; }
.table tr.mk-row:hover td { background: #F6F5EF; }
.table tr.mk-row[aria-selected="true"] td { background: #F1F8E2; }
.table td .sub { display: block; color: var(--muted); font-size: 12px; }
.ch-up { color: var(--err); font-weight: 700; }
.ch-down { color: var(--lime-deep); font-weight: 700; }
.mk-detail .grid2 { margin-top: 8px; }

/* assistant answers + knowledge editor (v1.5) */
.help-answer .help-body { line-height: 1.55; margin: 6px 0 10px; }
.refusal .lead { margin: 0; }
.plan-rubric { margin: 6px 0; }
.kn-grid { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: var(--s4); align-items: start; margin-bottom: var(--s4); }
.kn-list { max-height: 78vh; overflow: auto; }
.kn-list .section-title { margin: 12px 0 4px; }
.kn-file { display: block; width: 100%; text-align: left; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 6px 8px; cursor: pointer; }
.kn-file span { display: block; font-weight: 700; font-size: 13px; }
.kn-file small { color: var(--muted); font-size: 11px; }
.kn-file:hover { background: #F2F0E8; }
.kn-file.on { border-color: var(--line-strong); background: #F2F0E8; }
textarea.input.kn-text { width: 100%; height: 58vh; min-height: 300px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.45; resize: vertical; }
.kn-stats { margin: 6px 0 10px; padding-left: 18px; }
.kn-hit { border-top: 1px solid var(--line); padding: 8px 0; }
.kn-hit pre { white-space: pre-wrap; font-size: 12px; margin: 6px 0; }
.kn-score { margin: 10px 0 6px; }
.kn-ev tr.bad td:first-child { color: var(--err); font-weight: 800; }
.kn-ev tr.ok td:first-child { color: #3c7a12; font-weight: 800; }
.kn-ev td { vertical-align: top; font-size: 13px; }
@media (max-width: 900px) { .kn-grid { grid-template-columns: 1fr; } }
.kn-ev td:nth-child(3) { width: 45%; }

/* update bar: "A new version is available. Update" */
.update-bar { position: fixed; top: 16px; right: 20px; z-index: 70; display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--on-ink); border-radius: 14px; padding: 10px 12px 10px 16px; box-shadow: 0 14px 40px rgba(17, 24, 32, .35); font-size: 14px; max-width: calc(100vw - 40px); }
.update-bar[hidden] { display: none; }
.update-bar .x { background: none; border: 0; color: inherit; font-size: 20px; cursor: pointer; line-height: 1; padding: 0 4px; opacity: .7; }
.update-bar .x:hover { opacity: 1; }
