/* FP Scout v6 — Sidepanel Styles — Советский Конструктивизм */

/* ── Russo One — заголовки, навигация, акценты ── */
@font-face {
  font-family: 'RussoOne';
  src: url('../fonts/RussoOne-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ── IBM Plex Mono — метаданные, статусы, числа ── */
@font-face {
  font-family: 'IBMPlexMono';
  src: url('../fonts/IBMPlexMono-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBMPlexMono';
  src: url('../fonts/IBMPlexMono-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --c-bg:       #F6F1E8;
  --c-bg-2:     #FFFAF2;
  --c-bg-3:     #EEE5D8;
  --c-dark:     #1C1410;
  --c-dark-2:   #2E2218;
  --c-dark-3:   #3D2E22;
  --c-accent:   #A01A06;
  --c-accent-2: #7F160E;
  --c-muted:    #7A6A5D;
  --c-ghost:    #D5C7B8;
  --t-primary:  #241C16;
  --t-secondary:#6F6054;
  --t-on-dark:  #F7F3EC;
  --t-on-accent:#F7F3EC;
  --f-display:  'RussoOne', 'Arial Black', sans-serif;
  --f-body:     Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --f-mono:     'IBMPlexMono', 'Courier New', monospace;
  --transition: 140ms ease;

  /* Semantic colours */
  --green:  #1F8A4C;
  --blue:   #2563EB;
  --yel:    #B7791F;
  --danger: #B42318;
  --purple: #6C4C9C;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font: 12px/1.55 var(--f-body);
  background: var(--c-bg);
  color: var(--t-primary);
  width: 100%;
  min-height: 100vh;
  padding-bottom: 40px;
}

/* ── Header ───────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--c-dark);
  border-bottom: 2px solid var(--c-accent);
  position: relative;
}
header h1 {
  font-family: var(--f-display);
  font-size: 16px;
  color: var(--t-on-dark);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
header small {
  color: rgba(247,243,236,0.5);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
}
.brand-link {
  color: inherit;
  text-decoration: none;
}
.brand-link:hover { color: var(--t-on-dark); }

/* ── Update notice ────────────────────────── */
.update-bar {
  background: var(--c-accent);
  color: var(--t-on-accent);
  padding: 9px 12px;
  font-size: 11px;
}
.update-line,
.update-action,
.update-links {
  text-align: center;
}
.update-line { margin-bottom: 5px; }
.upd-notes {
  opacity: .82;
  margin-left: 4px;
}
.update-action {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 7px;
  flex-wrap: wrap;
}
.upd-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(0,0,0,0.28);
  padding: 5px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 800;
}
.upd-link-secondary {
  padding: 4px 10px;
  font-size: 10px;
}
.upd-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.34);
  padding: 5px 12px;
  border-radius: 4px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.upd-button:disabled {
  opacity: .66;
  cursor: wait;
}
.update-status {
  background: rgba(0,0,0,0.16);
  border-radius: 4px;
  padding: 6px 8px;
  margin-bottom: 7px;
  font-size: 10px;
  text-align: center;
}
.update-status[data-level="ok"] { background: rgba(31,138,76,0.34); }
.update-status[data-level="err"] { background: rgba(0,0,0,0.28); color: #fff; }
.update-instructions {
  background: rgba(0,0,0,0.18);
  border-radius: 4px;
  padding: 7px 9px;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}
.update-repair-action {
  margin-top: 7px;
}
.update-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 5px;
}
.link-button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--f-body);
  font-size: 10px;
  padding: 2px 0;
}
.link-button-light { color: rgba(255,255,255,.74); text-decoration: underline; }
.link-button-muted { color: rgba(255,255,255,.56); }
.link-button:hover { color: #fff; }

/* ── First-run onboarding ─────────────────── */
body.onboarding-open { overflow: hidden; }
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(28, 20, 16, 0.62);
}
.onboarding-card {
  width: min(720px, 100%);
  max-height: calc(100vh - 28px);
  overflow: auto;
  background: var(--c-bg-2);
  border: 1px solid var(--c-ghost);
  border-top: 4px solid var(--c-accent);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(28, 20, 16, 0.32);
}
.onboarding-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--c-bg-3);
}
.onboarding-kicker {
  color: var(--c-accent);
  font-size: 11px;
  font-weight: 800;
}
.onboarding-head h2 {
  margin-top: 2px;
  font-family: var(--f-body);
  font-size: 22px;
  line-height: 1.15;
  font-weight: 900;
  color: var(--t-primary);
}
.onboarding-close {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--c-ghost);
  border-radius: 4px;
  background: var(--c-bg);
  color: var(--t-secondary);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.onboarding-close:hover {
  background: var(--c-bg-3);
  color: var(--t-primary);
}
.onboarding-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--c-bg-3);
}
.onboarding-progress-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--c-ghost);
  border-radius: 4px;
  background: var(--c-bg);
  color: var(--t-secondary);
  cursor: pointer;
  font: 800 11px/1.2 var(--f-body);
}
.onboarding-progress-step span {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--c-bg-3);
  color: var(--t-secondary);
  font-family: var(--f-mono);
  font-size: 10px;
}
.onboarding-progress-step.active {
  border-color: var(--c-accent);
  background: rgba(160, 26, 6, 0.08);
  color: var(--t-primary);
}
.onboarding-progress-step.active span {
  background: var(--c-accent);
  color: var(--t-on-accent);
}
.onboarding-important {
  margin: 12px 18px 0;
  padding: 10px 12px;
  border: 1px solid rgba(183, 121, 31, 0.45);
  border-left: 3px solid var(--yel);
  border-radius: 6px;
  background: rgba(183, 121, 31, 0.1);
  color: var(--t-secondary);
  font-size: 12px;
  line-height: 1.45;
}
.onboarding-important b {
  color: var(--t-primary);
}
.onboarding-body {
  padding: 16px 18px;
}
.onboarding-step { display: none; }
.onboarding-step.active { display: block; }
.onboarding-step h3 {
  display: block;
  padding: 0;
  margin: 0 0 10px;
  border: 0;
  cursor: default;
  color: var(--t-primary);
  font-size: 18px;
}
.onboarding-step p {
  color: var(--t-secondary);
  font-size: 12px;
}
.onboarding-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 16px;
  align-items: start;
}
.onboarding-license-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--c-ghost);
  border-radius: 6px;
  background: var(--c-bg);
}
.onboarding-license-state {
  padding: 7px 9px;
  border: 1px solid var(--c-bg-3);
  border-radius: 4px;
  background: var(--c-bg-2);
  color: var(--t-secondary);
  font-size: 11px;
}
.onboarding-license-state.active { color: var(--green); }
.onboarding-license-state.inactive { color: var(--c-accent); }
.onboarding-list {
  display: grid;
  gap: 8px;
}
.onboarding-list div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--c-bg-3);
  border-radius: 6px;
  background: var(--c-bg);
  color: var(--t-secondary);
  font-size: 12px;
}
.onboarding-list span {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--c-dark);
  color: var(--t-on-dark);
  font-family: var(--f-mono);
  font-size: 11px;
}
.onboarding-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--c-bg-3);
}

@media (max-width: 520px) {
  .onboarding-overlay { align-items: stretch; padding: 8px; }
  .onboarding-card { max-height: calc(100vh - 16px); }
  .onboarding-head,
  .onboarding-important,
  .onboarding-body,
  .onboarding-actions { padding-left: 12px; padding-right: 12px; }
  .onboarding-important {
    margin-left: 12px;
    margin-right: 12px;
  }
  .onboarding-progress {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-left: 12px;
    padding-right: 12px;
  }
  .onboarding-split { grid-template-columns: 1fr; }
  .onboarding-actions .btn { flex: 1; }
}

/* ── Badge ────────────────────────────────── */
.badge {
  font-family: var(--f-body);
  font-size: 10px;
  padding: 2px 8px;
  letter-spacing: 0;
  background: var(--c-bg-3);
  color: var(--t-secondary);
}
.badge.running { background: rgba(74,140,63,0.15); color: #4A8C3F; }
.badge.captcha { background: rgba(140,104,32,0.15); color: #8C6820; animation: pulse 1s infinite; }
.badge.done    { background: rgba(74,140,63,0.15); color: #4A8C3F; }
.badge.waiting { background: rgba(160,26,6,0.08); color: var(--c-accent); }
.badge.paused  { background: rgba(140,104,32,0.15); color: #8C6820; }
.badge.warning { background: rgba(183,121,31,0.15); color: var(--yel); }
.badge.err     { background: rgba(180,35,24,0.12); color: var(--danger); }

@keyframes pulse { 0%,100%{ opacity:1 } 50%{ opacity:.5 } }

/* ── Tabs ─────────────────────────────────── */
.tabs { display: flex; background: var(--c-bg-2); border-bottom: 1px solid var(--c-ghost); }
.tab {
  flex: 1;
  padding: 9px 2px;
  border: none;
  background: none;
  color: var(--t-secondary);
  cursor: pointer;
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  outline: none;
}
.tab.active { color: var(--t-primary); border-bottom-color: var(--c-accent); }
.tab:hover:not(.active) { color: var(--t-primary); background: var(--c-bg-3); }

/* ── Panels ───────────────────────────────── */
.panel { display: none; padding: 10px 12px; }
.panel.active { display: block; }

/* ── Sub-tabs ─────────────────────────────── */
.sub-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.sub-tab {
  padding: 4px 10px;
  border: 1px solid var(--c-ghost);
  background: none;
  color: var(--t-secondary);
  cursor: pointer;
  font-family: var(--f-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  transition: var(--transition);
}
.sub-tab.active {
  background: rgba(160,26,6,0.08);
  color: var(--c-accent);
  border-color: var(--c-accent);
}
.sub-panel { display: none; }
.sub-panel.active { display: block; }

/* ── Buttons ──────────────────────────────── */
.btn {
  padding: 7px 14px;
  border: 1px solid var(--c-ghost);
  background: var(--c-bg-2);
  color: var(--t-primary);
  cursor: pointer;
  font-family: var(--f-body);
  font-size: 12px;
  clip-path: none;
  border-radius: 4px;
  transition: var(--transition);
  letter-spacing: 0;
}
.btn:hover { background: var(--c-bg-3); }
.btn:disabled { opacity: .55; cursor: default; color: #9A8B7C; background: #E5DED4; }

.btn-primary {
  background: var(--c-dark);
  border-color: var(--c-dark);
  color: var(--t-on-dark);
  font-family: var(--f-body);
  font-weight: 700;
  letter-spacing: 0;
}
.btn-primary:hover:not(:disabled) { background: var(--c-dark-2); border-color: var(--c-dark-2); }

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #8F1C14; }

.btn-sm {
  padding: 5px 10px;
  font-size: 11px;
  min-height: 28px;
  clip-path: none;
}
.btn-sm.btn-danger { background: var(--danger); }
.btn-outline {
  background: transparent;
  border-color: var(--c-ghost);
}
.btn-outline:hover { background: var(--c-bg-3); }
.btn-gap-top { margin-top: 4px; }

/* ── Inputs ───────────────────────────────── */
.input {
  width: 100%;
  padding: 6px 8px;
  background: var(--c-bg);
  border: 1px solid var(--c-ghost);
  color: var(--t-primary);
  font-family: var(--f-body);
  font-size: 12px;
  margin: 3px 0;
  transition: border-color var(--transition);
  border-radius: 4px;
}
.input:focus { border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(160,26,6,0.12); outline: none; }
.input::placeholder { color: var(--c-muted); }

.input-sm {
  padding: 4px 6px;
  background: var(--c-bg);
  border: 1px solid var(--c-ghost);
  color: var(--t-primary);
  font-family: var(--f-body);
  font-size: 12px;
  min-width: 60px;
  border-radius: 4px;
  transition: border-color var(--transition);
}
.input-sm:focus { border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(160,26,6,0.12); outline: none; }

.input-xs {
  width: 54px;
  padding: 3px 5px;
  background: var(--c-bg);
  border: 1px solid var(--c-ghost);
  color: var(--t-primary);
  font-family: var(--f-mono);
  font-size: 11px;
  text-align: center;
  border-radius: 4px;
  transition: border-color var(--transition);
}
.input-xs:focus { border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(160,26,6,0.12); outline: none; }

select.input-sm { min-width: 100px; }
input[type="time"].input-xs { width: 80px; }

/* ── Layout ───────────────────────────────── */
.row { display: flex; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.row label { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--t-secondary); white-space: nowrap; }
.hint { font-size: 11px; color: var(--c-muted); }
.row-tight { margin-top: 4px; margin-bottom: 4px; }
.row-spaced { margin-top: 8px; }
.row-compact { align-items: center; gap: 6px; }
.row-days { margin-top: 4px; flex-wrap: wrap; gap: 4px; }
.row-label {
  font-size: 11px;
  color: var(--c-muted);
}
.license-input {
  font-family: var(--f-mono);
  letter-spacing: 1px;
}
.preset-select {
  flex: 1;
  min-width: 150px;
  width: auto;
  font-family: var(--f-body);
  text-align: left;
}

/* ── Controls ─────────────────────────────── */
.controls { display: flex; gap: 8px; margin: 10px 0; align-items: center; }
.controls .btn { min-height: 36px; }
#btnStartAll, #btnStop { min-width: 110px; }

/* ── Scout preset row ─────────────────────── */
.scout-workspace { display: grid; gap: 10px; margin-bottom: 10px; }
.scout-status-card,
.scout-source-card,
.settings-card {
  background: var(--c-bg-2);
  border: 1px solid var(--c-ghost);
  border-radius: 6px;
  padding: 12px;
}
.scout-status-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-left: 3px solid var(--c-accent);
}
.eyebrow {
  font-size: 10px;
  color: var(--c-muted);
  letter-spacing: 0;
  font-weight: 700;
}
.scout-status-card h2 {
  font-family: var(--f-body);
  font-size: 20px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0;
  margin: 2px 0 4px;
}
.scout-controls { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.section-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.section-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.section-head h3,
.settings-card-title {
  font-size: 13px;
  line-height: 1.2;
  color: var(--t-primary);
  font-weight: 800;
  margin-bottom: 2px;
}
.scout-active-sources { display: grid; gap: 5px; margin-bottom: 10px; }
.scout-source-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--c-bg);
  border: 1px solid var(--c-bg-3);
  color: var(--t-primary);
  text-decoration: none;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scout-source-pill span {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  background: var(--c-dark);
  color: var(--t-on-dark);
  border-radius: 50%;
  font-size: 10px;
  flex: 0 0 auto;
}
.scout-source-empty {
  padding: 8px;
  border: 1px dashed var(--c-ghost);
  border-radius: 4px;
  color: var(--c-muted);
  font-size: 11px;
}
.scout-group-title {
  font-size: 12px;
  letter-spacing: 0;
  color: var(--c-muted);
  margin: 8px 0 5px;
  font-weight: 800;
}
.scout-preset-row {
  margin-bottom: 8px;
  padding: 6px 8px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-ghost);
}
.preset-checklist { display: flex; flex-direction: column; gap: 4px; }
.preset-checklist .hint { font-size: 10px; }
.preset-check { display: flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; padding: 2px 0; }
.preset-check input { margin: 0; }
.preset-check b { color: var(--t-primary); }
.preset-expand { cursor: pointer; color: var(--t-hint); font-size: 10px; margin-left: auto; padding: 0 4px; }
.preset-expand:hover { color: var(--c-accent); }
.preset-urls { display: none; flex-direction: column; gap: 2px; padding: 2px 0 4px 22px; }
.preset-item.open .preset-urls { display: flex; }
.preset-url { font-size: 10px; font-family: 'IBMPlexMono', monospace; color: var(--c-accent); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preset-url:hover { text-decoration: underline; }
.scout-start-mode-hint {
  margin-top: 7px;
  padding: 7px 8px;
  border: 1px solid var(--c-bg-3);
  border-radius: 4px;
  background: var(--c-bg);
}
.scout-start-mode-hint:empty { display: none; }
.scout-start-mode-hint.warn {
  border-color: rgba(183, 121, 31, 0.45);
  background: rgba(183, 121, 31, 0.08);
  color: var(--t-secondary);
}
.scout-companies-card,
.scout-settings-card { padding: 0; overflow: hidden; }
.scout-companies-card details,
.scout-settings-card details { padding: 10px 12px; }
.scout-companies-card summary,
.scout-settings-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  color: var(--t-primary);
  font-family: var(--f-body);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 800;
}
.settings-summary {
  color: var(--c-muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.settings-intro {
  margin: 7px 0 10px;
}
#secScout,
#secScout label,
#secScout summary,
#secScout .hint,
#secScout .btn,
#secScout .input,
#secScout .input-sm,
#secScout .input-xs {
  font-family: var(--f-body);
  letter-spacing: 0;
}
#secScout .input-xs {
  font-size: 12px;
  text-align: center;
}
#secScout > label {
  display: block;
  margin: 9px 0 4px;
  color: var(--t-secondary);
  font-size: 11px;
  font-weight: 700;
}
.company-summary {
  color: var(--c-muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.company-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0 8px;
}
.company-filter-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--t-secondary);
  font-size: 11px;
  cursor: pointer;
}
.company-filter-row input { accent-color: var(--c-accent); }
.company-block-title {
  margin: 4px 0 7px;
  padding-top: 8px;
  border-top: 1px solid var(--c-ghost);
  color: var(--t-primary);
  font-size: 12px;
  font-weight: 800;
}
.company-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.company-column {
  min-width: 0;
}
.compact-target-add {
  margin-top: 7px;
  gap: 6px;
}
.compact-target-add .input-sm { min-width: 0; flex: 1 1 120px; }
.es-example { margin: 8px 0; font-family: var(--f-mono); font-size: 10px; color: var(--c-muted); }
.settings-card { margin: 10px 0; }
.settings-card summary { cursor: pointer; font-weight: 800; color: var(--t-primary); }
.settings-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--c-bg-3);
  font-size: 11px;
  text-align: center;
}
.settings-footer a {
  color: var(--c-accent);
  text-decoration: none;
}
.settings-footer a:hover { text-decoration: underline; }
.captcha-card { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.advanced-subsection {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--c-ghost);
}
.connection-card { display: grid; gap: 8px; margin-top: 10px; }
.diagnose-box {
  padding: 8px;
  background: var(--c-bg);
  border: 1px solid var(--c-bg-3);
  border-radius: 4px;
  font-size: 11px;
}
.warning-note {
  margin: 6px 0 10px;
  padding: 8px;
  border-left: 3px solid var(--yel);
  background: rgba(183, 121, 31, 0.1);
  color: var(--t-secondary);
  font-size: 11px;
}
.backup-note {
  max-width: 820px;
  margin: 4px 0 10px;
  line-height: 1.45;
}
.backup-actions .btn {
  min-width: 210px;
}
.scout-mode-card {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--c-ghost);
}
.scout-mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 6px;
}
.scout-mode-option {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 9px;
  border: 1px solid var(--c-ghost);
  border-radius: 6px;
  background: var(--c-bg);
  cursor: pointer;
}
.scout-mode-option:has(input:checked) {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 2px rgba(159, 29, 18, 0.1);
}
.scout-mode-option input { margin-top: 2px; accent-color: var(--c-accent); }
.scout-mode-option b {
  display: block;
  color: var(--t-primary);
  font-size: 12px;
  line-height: 1.2;
}
.scout-mode-option small {
  display: block;
  margin-top: 2px;
  color: var(--c-muted);
  font-size: 10px;
  line-height: 1.25;
}
.scout-save-row {
  justify-content: flex-start;
  align-items: center;
  margin-top: 10px;
}

/* ── Stats ────────────────────────────────── */
.stats-row { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.stat {
  background: var(--c-bg-2);
  padding: 5px 10px;
  font-family: var(--f-body);
  font-size: 10px;
  color: var(--t-secondary);
  border: 1px solid var(--c-ghost);
  letter-spacing: 0;
}
.stat span {
  font-family: var(--f-body);
  font-weight: 800;
  color: var(--c-accent);
  font-size: 13px;
}

/* ── Workers ──────────────────────────────── */
.scout-progress-area {
  display: grid;
  gap: 4px;
}
.scout-progress-area:empty { display: none; }
.worker { display: grid; grid-template-columns: minmax(120px, 0.36fr) minmax(0, 1fr); align-items: center; gap: 6px; margin: 4px 0; font-size: 11px; color: var(--t-secondary); }
.worker-bar { flex: 1; height: 4px; background: var(--c-bg-3); overflow: hidden; }
.worker-fill { height: 100%; background: var(--c-accent); transition: width .3s; }
.worker-fill.done { background: var(--green); }
.worker-link { color: var(--t-secondary); text-decoration: none; }
.worker-link:hover { color: var(--c-accent); text-decoration: underline; }
.worker-meta {
  grid-column: 1 / -1;
  color: var(--c-muted);
  font-size: 10px;
  font-family: var(--f-mono);
}
.scout-attention,
.scout-run-summary {
  padding: 9px 11px;
  border: 1px solid var(--c-ghost);
  border-radius: 6px;
  background: var(--c-bg-2);
  color: var(--t-secondary);
  font-size: 11px;
}
.scout-attention {
  border-left: 3px solid var(--yel);
  background: rgba(183, 121, 31, 0.08);
}
.scout-attention.err { border-left-color: var(--danger); background: rgba(180, 35, 24, 0.08); }
.scout-run-summary b { color: var(--t-primary); }

/* ── URL rows ─────────────────────────────── */
.url-row { display: flex; gap: 4px; margin: 3px 0; align-items: center; }
.url-row .input { flex: 1; margin: 0; }
.btn-url-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  background: rgba(160, 26, 6, 0.08);
  border: 1px solid rgba(160, 26, 6, 0.18);
  border-radius: 4px;
  color: var(--c-accent);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  opacity: .75;
}
.btn-url-del:hover { opacity: 1; background: rgba(160, 26, 6, 0.14); }
.btn-url-go { background: none; border: none; color: var(--green); cursor: pointer; font-size: 14px; padding: 2px 4px; }

/* ── Section toggles ──────────────────────── */
h3 {
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 800;
  color: var(--t-secondary);
  padding: 8px 0 6px;
  cursor: pointer;
  border-bottom: 1px solid var(--c-ghost);
  margin-top: 12px;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: color var(--transition);
}
h3:hover { color: var(--t-primary); }
h3.section-toggle::after {
  content: '▾';
  font-size: 10px;
  color: var(--c-accent);
  margin-left: 6px;
  transition: transform .2s;
  display: inline-block;
}
h3.section-toggle.collapsed::after { transform: rotate(-90deg); }

.hidden { display: none !important; }
label { font-size: 11px; font-family: var(--f-body); }

/* ── Reasons checkboxes ───────────────────── */
#reasons label { display: block; padding: 3px 0; color: var(--t-secondary); cursor: pointer; }
#reasons label:hover { color: var(--t-primary); }
#reasons input { margin-right: 6px; accent-color: var(--c-accent); }

/* ── Day checkboxes ───────────────────────── */
.day-cb {
  display: inline-flex !important;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border: 1px solid var(--c-ghost);
  cursor: pointer;
  font-family: var(--f-body);
  font-size: 10px !important;
  letter-spacing: 0;
  color: var(--t-secondary) !important;
  background: var(--c-bg-2);
  white-space: nowrap;
  transition: var(--transition);
}
.day-cb:has(input:checked) {
  background: rgba(160,26,6,0.08);
  border-color: var(--c-accent);
  color: var(--c-accent) !important;
}
.day-cb input { display: none; }

/* ── Company cards ────────────────────────── */
.company-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  background: var(--c-bg-2);
  margin: 3px 0;
  border: 1px solid var(--c-ghost);
}
.company-card b { color: var(--t-primary); font-size: 12px; font-family: var(--f-body); font-weight: 800; }
.company-card small { color: var(--c-muted); font-size: 10px; margin-left: 6px; font-family: var(--f-body); letter-spacing: 0; }
.target-card { border-left: 3px solid var(--yel); }
.btn-rm-comp, .btn-rm-target { background: none; border: none; color: var(--c-accent); cursor: pointer; font-size: 14px; opacity: .6; }
.btn-rm-comp:hover, .btn-rm-target:hover { opacity: 1; }

/* ── Empty state ──────────────────────────── */
.empty-state {
  text-align: center;
  padding: 24px 12px;
  color: var(--c-muted);
  font-family: var(--f-body);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0;
}
.empty-state .es-icon { font-size: 28px; margin-bottom: 8px; }
.empty-state .es-title {
  color: var(--t-primary);
  font-family: var(--f-body);
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 4px;
}
.empty-state .es-link {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 14px;
  background: rgba(160,26,6,0.08);
  border: 1px solid var(--c-accent);
  color: var(--c-accent);
  font-size: 11px;
  cursor: pointer;
  letter-spacing: 0;
  clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
}
.empty-state .es-link:hover { background: rgba(160,26,6,0.15); }
.bid-empty-state {
  text-align: left;
  padding: 16px;
  margin: 8px 0 12px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-ghost);
  border-radius: 6px;
}
.bid-empty-steps {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.bid-empty-steps div {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--t-secondary);
}
.bid-empty-steps b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(160,26,6,0.10);
  color: var(--c-accent);
  flex: 0 0 auto;
}

/* ── Log ──────────────────────────────────── */
.settings-log-panel {
  padding-top: 8px;
}
.log-filters { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.log-filter {
  padding: 3px 8px;
  border: 1px solid var(--c-ghost);
  background: none;
  color: var(--t-secondary);
  cursor: pointer;
  font-family: var(--f-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  transition: var(--transition);
}
.log-filter.active {
  background: rgba(160,26,6,0.08);
  color: var(--c-accent);
  border-color: var(--c-accent);
}
#logBox { max-height: 65vh; overflow-y: auto; }
.le { padding: 5px 6px; border-bottom: 1px solid var(--c-ghost); font-size: 11px; line-height: 1.5; }
.le-t  { color: var(--c-muted); margin-right: 4px; font-family: var(--f-body); font-size: 10px; letter-spacing: 0; }
.le-id { color: var(--c-muted); font-family: var(--f-body); font-size: 10px; letter-spacing: 0; }
.le-b  { display: inline-block; padding: 0 5px; font-size: 10px; font-weight: 700; margin-right: 4px; font-family: var(--f-body); letter-spacing: 0; }
.le-b.skipped    { background: rgba(74,140,63,0.12); color: #4A8C3F; }
.le-b.checked    { background: var(--c-bg-3); color: var(--t-secondary); }
.le-b.complained { background: rgba(160,26,6,0.10); color: var(--c-accent); }
.le-b.error      { background: rgba(160,26,6,0.18); color: var(--c-accent); }
.le-b.warning    { background: rgba(140,104,32,0.12); color: #8C6820; }
.le-b.info       { background: rgba(58,92,156,0.10); color: #3A5C9C; }
.le-b.filtered   { background: var(--c-bg-3); color: var(--c-muted); }
.le-b.bid        { background: rgba(160,26,6,0.08); color: var(--c-accent); }
.le-b.position   { background: var(--c-bg-3); color: #3A5C9C; }
.le-b.system     { background: var(--c-bg-3); color: var(--t-secondary); }
.le-phone { color: var(--green); font-family: var(--f-body); letter-spacing: 0; }
.le-hint {
  color: var(--yel);
  font-size: 10px;
  margin-top: 3px;
  padding: 2px 6px;
  background: rgba(140,104,32,0.08);
  border-left: 2px solid var(--yel);
}

/* ── Analytics table ──────────────────────── */
#aTable { overflow-x: auto; padding-bottom: 4px; }
#aTable table { width: 100%; border-collapse: collapse; font-size: 11px; }
#aTable th { text-align: left; padding: 5px 4px; color: var(--t-secondary); border-bottom: 2px solid var(--c-ghost); font-family: var(--f-body); font-size: 11px; font-weight: 800; letter-spacing: 0; }
#aTable td { padding: 5px 4px; border-bottom: 1px solid var(--c-ghost); font-family: var(--f-body); font-size: 11px; color: var(--t-primary); }
#aTable td:first-child { font-family: var(--f-body); }
.a-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.a-table.resizable-table { table-layout: fixed; min-width: 720px; }
.a-table th { position: relative; text-align: left; padding: 5px 10px 5px 4px; color: var(--t-secondary); border-bottom: 2px solid var(--c-ghost); font-family: var(--f-body); font-size: 11px; font-weight: 800; letter-spacing: 0; cursor: pointer; user-select: none; white-space: nowrap; }
.a-table th:hover { color: var(--t-primary); }
.a-table th .th-content { display: block; overflow: hidden; text-overflow: ellipsis; }
.col-resize-handle {
  position: absolute;
  top: 0;
  right: -3px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
}
.col-resize-handle::after {
  content: '';
  position: absolute;
  top: 25%;
  right: 3px;
  width: 1px;
  height: 50%;
  background: var(--c-ghost);
}
.col-resize-handle:hover::after,
body.resizing-column .col-resize-handle::after { background: var(--c-accent); }
body.resizing-column { cursor: col-resize; user-select: none; }
.a-table th .sort-arrow { font-size: 9px; color: var(--c-accent); }
.a-table th .sort-none { color: var(--c-ghost); }
.a-table td { padding: 5px 4px; border-bottom: 1px solid var(--c-ghost); font-family: var(--f-body); font-size: 11px; color: var(--t-primary); vertical-align: middle; overflow: hidden; text-overflow: ellipsis; }
.a-table .col-id { font-size: 10px; min-width: 52px; }
.a-table .col-seller { color: var(--t-secondary); font-size: 10px; }
.a-table .col-pos { font-size: 10px; }
.a-table .col-pos.has-history { cursor: pointer; }
.a-table .col-pos.has-history:hover { color: var(--c-accent); }
.pos-chart-row td { padding: 6px 8px; background: rgba(0,0,0,0.03); }
.pos-chart-wrap { display: inline-block; }
.pos-chart-title { font-size: 10px; color: var(--t-secondary); margin-bottom: 2px; font-family: var(--f-body); }
.pos-chart-svg { display: block; overflow: visible; }
.a-table .id-link { color: var(--c-accent); text-decoration: none; }
.a-table .id-link:hover { text-decoration: underline; }
.a-table .row-mine td { background: rgba(160,26,6,0.04); }
.a-table .row-warning td { background: rgba(183,121,31,0.08); }
.a-table .row-danger td { background: rgba(180,35,24,0.08); }
.a-table .row-danger td:first-child { border-left: 3px solid var(--danger); }
.a-table .row-warning td:first-child { border-left: 3px solid var(--yel); }
.a-badge {
  display: inline-flex;
  align-items: center;
  margin: 2px 3px 0 0;
  padding: 1px 5px;
  border-radius: 999px;
  border: 1px solid var(--c-ghost);
  color: var(--t-secondary);
  background: rgba(255,250,242,0.8);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0;
}
.a-badge.mine { color: var(--c-accent); border-color: rgba(160,26,6,0.22); background: rgba(160,26,6,0.07); }
.a-badge.warn { color: #8c5b16; border-color: rgba(183,121,31,0.28); background: rgba(183,121,31,0.11); }
.a-badge.danger { color: var(--danger); border-color: rgba(180,35,24,0.28); background: rgba(180,35,24,0.11); }
.a-badge.new { color: #1f6f8a; border-color: rgba(37,99,235,0.24); background: rgba(37,99,235,0.08); }
.btn-mine-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--c-muted); font-size: 11px; padding: 0 2px;
  vertical-align: middle; line-height: 1; margin-left: 3px;
  opacity: 0.5; transition: opacity var(--transition), color var(--transition);
}
.btn-mine-toggle:hover { opacity: 1; }
.btn-mine-toggle.is-mine { color: var(--c-accent); opacity: 1; }
.g-pos { color: var(--green); }
.g-neg { color: var(--c-accent); }
.check-label { display: flex; align-items: center; gap: 5px; font-size: 11px; font-family: var(--f-body); cursor: pointer; white-space: nowrap; letter-spacing: 0; }
.check-label input[type="checkbox"] { width: 13px; height: 13px; accent-color: var(--c-accent); }
.leader {
  background: var(--c-bg-2);
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 11px;
  border-left: 3px solid var(--c-accent);
  border: 1px solid var(--c-ghost);
  border-left-width: 3px;
  font-family: var(--f-body);
  letter-spacing: 0;
}
.filter-row { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.analytics-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 8px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-ghost);
  border-radius: 6px;
}
.toolbar-compact { margin-bottom: 8px; }
.toolbar-search {
  flex: 1 1 180px;
  min-width: 160px;
}
.multi-select {
  position: relative;
  min-width: 210px;
}
.multi-select-btn {
  width: 100%;
  min-height: 30px;
  text-align: left;
  cursor: pointer;
  padding-right: 24px;
  position: relative;
}
.multi-select-btn::after {
  content: '▾';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-muted);
  font-size: 10px;
}
.multi-select-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  width: min(520px, calc(100vw - 32px));
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--c-ghost);
  border-radius: 6px;
  background: var(--c-bg-2);
  box-shadow: 0 12px 28px rgba(36,28,22,0.16);
}
.multi-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 31px;
  padding: 5px 7px;
  border-radius: 4px;
  color: var(--t-primary);
  font-size: 12px;
  cursor: pointer;
}
.multi-option:hover {
  background: var(--c-bg-3);
}
.multi-option input {
  width: 14px;
  height: 14px;
  accent-color: var(--c-accent);
  flex: 0 0 auto;
}
.multi-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.multi-option-all {
  margin-bottom: 4px;
  border-bottom: 1px solid var(--c-ghost);
  border-radius: 4px 4px 0 0;
  font-weight: 800;
}
.toolbar-label {
  font-size: 11px;
  color: var(--c-muted);
  letter-spacing: 0;
  font-weight: 800;
}
.analytics-sync-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--c-ghost);
  margin-bottom: 10px;
}
.sync-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--t-primary);
}
.sync-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.overview-search-stats { margin-top: 10px; }
.search-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.search-stats-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--t-primary);
  margin-bottom: 6px;
}
.search-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.search-stats-table th,
.search-stats-table td {
  border-bottom: 1px solid var(--c-ghost);
  padding: 5px 4px;
  text-align: left;
  vertical-align: top;
}
.search-stats-table th {
  color: var(--c-muted);
  font-weight: 800;
}
.search-stat-label {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.danger-zone {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--c-muted);
}
.danger-zone summary { cursor: pointer; }
.analytics-state {
  background: var(--c-bg-2);
  border: 1px solid var(--c-ghost);
  border-radius: 6px;
  padding: 14px;
  text-align: center;
  margin: 8px 0;
}
.state-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--t-primary);
  margin-bottom: 3px;
}
.insight-actions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.insight-actions .btn { font-size: 10px; padding: 3px 7px; }
.compact-analytics-table th,
.compact-analytics-table td { vertical-align: top; }

.analytics-focus {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.focus-card {
  min-height: 86px;
  padding: 10px;
  border: 1px solid var(--c-ghost);
  border-radius: 6px;
  background: var(--c-bg-2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.focus-card[data-analytics-filter] {
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.focus-card[data-analytics-filter]:hover {
  transform: translateY(-1px);
  border-color: var(--c-accent);
  box-shadow: 0 6px 16px rgba(36,28,22,0.08);
}
.focus-card.primary { border-left: 3px solid var(--c-accent); }
.focus-card.danger { border-left: 3px solid var(--danger); background: rgba(180,35,24,0.06); }
.focus-card.warning { border-left: 3px solid var(--yel); background: rgba(183,121,31,0.06); }
.focus-card.ok { border-left: 3px solid var(--green); background: rgba(31,138,76,0.05); }
.focus-label {
  color: var(--c-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}
.focus-value {
  color: var(--t-primary);
  font: 800 24px/1 var(--f-body);
  letter-spacing: 0;
  margin: 6px 0 4px;
}
.focus-note {
  color: var(--t-secondary);
  font-size: 11px;
  line-height: 1.25;
}
.analytics-details {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--c-ghost);
  border-radius: 6px;
  background: rgba(255,250,242,0.65);
}
.analytics-details summary {
  cursor: pointer;
  color: var(--t-secondary);
  font-weight: 800;
  font-size: 11px;
}
.ov-grid.compact {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 8px 0;
}
.ov-grid.compact .ov-card {
  padding: 6px;
  min-height: 54px;
}
.ov-grid.compact .ov-num { font-size: 15px; }
.overview-insights {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.insight-block {
  margin-bottom: 0;
  padding: 10px;
  border: 1px solid var(--c-ghost);
  border-radius: 6px;
  background: var(--c-bg-2);
}
.insight-block.priority {
  grid-row: span 2;
  border-left: 3px solid var(--danger);
}
.insight-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--t-primary);
  margin-bottom: 7px;
  cursor: pointer;
  user-select: none;
}
.insight-item {
  font-size: 12px;
  color: var(--t-secondary);
  padding: 6px 0;
  line-height: 1.45;
  border-top: 1px solid rgba(213,199,184,0.55);
}
.insight-item:first-of-type { border-top: none; }
.chart-block {
  padding: 8px 10px;
  border: 1px solid var(--c-ghost);
  border-radius: 6px;
  background: var(--c-bg-2);
}
.chart-block summary { cursor: pointer; }

/* ── Seller list ──────────────────────────── */
.seller-item {
  padding: 8px 10px;
  background: var(--c-bg-2);
  margin: 4px 0;
  cursor: pointer;
  border: 1px solid var(--c-ghost);
  transition: border-color var(--transition), background var(--transition);
}
.seller-item:hover { background: var(--c-bg-3); border-color: var(--c-accent); }
.seller-main-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.seller-item b { color: var(--t-primary); font-family: var(--f-body); font-weight: 800; }
.seller-item .meta { font-size: 10px; color: var(--c-muted); margin-top: 2px; font-family: var(--f-body); letter-spacing: 0; }
.seller-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 7px;
}
.seller-badges span {
  padding: 2px 6px;
  border: 1px solid var(--c-ghost);
  border-radius: 999px;
  background: rgba(255,250,242,0.72);
  color: var(--t-secondary);
  font-size: 10px;
  line-height: 1.3;
}
.seller-reason {
  margin-top: 6px;
  color: var(--c-muted);
  font-size: 11px;
  line-height: 1.35;
}
.btn-add-target-seller:disabled {
  opacity: .62;
  cursor: default;
}

/* ── Seller card ──────────────────────────── */
.seller-card-header {
  padding: 10px;
  background: var(--c-bg-2);
  margin-bottom: 8px;
  border-bottom: 3px solid var(--c-accent);
  border: 1px solid var(--c-ghost);
  border-bottom-width: 3px;
}
.seller-card-header h4 { color: var(--c-accent); margin-bottom: 6px; font-size: 13px; font-family: var(--f-body); font-weight: 800; letter-spacing: 0; }
.seller-card-header .stats { display: flex; gap: 12px; font-size: 11px; color: var(--t-secondary); flex-wrap: wrap; }
.seller-card-header .stats b { color: var(--t-primary); font-family: var(--f-body); font-weight: 800; }
.seller-card-dates { margin-top: 4px; }
.back-btn { background: none; border: none; color: var(--c-accent); cursor: pointer; font-size: 11px; margin-bottom: 6px; font-family: var(--f-body); letter-spacing: 0; }
.back-btn:hover { text-decoration: underline; }

/* ── Phone list ───────────────────────────── */
.phone-item { display: flex; justify-content: space-between; padding: 5px 6px; border-bottom: 1px solid var(--c-ghost); font-size: 11px; }
.phone-company { gap: 12px; align-items: flex-start; background: var(--c-bg-2); border: 1px solid var(--c-ghost); margin-bottom: 5px; border-radius: 4px; }
.phone-company b { color: var(--t-primary); }
.phone-titles { color: var(--c-muted); max-width: 640px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-num { color: var(--green); font-weight: 600; font-family: var(--f-body); letter-spacing: 0; }
.phone-seller { color: var(--c-muted); font-family: var(--f-body); }
.phone-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-left: auto;
}
.phone-actions .btn { white-space: nowrap; }

/* ── Bid dashboard ────────────────────────── */
.bid-header { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.bid-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-ghost);
  border-left: 3px solid var(--c-accent);
  border-radius: 6px;
}
.bid-status-copy { min-width: 0; flex: 1; }
.bid-status-line { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.bid-safety-text {
  color: var(--t-secondary);
  font-size: 12px;
  line-height: 1.45;
}
.bid-schedule-status {
  margin-top: 4px;
  color: var(--c-muted);
  font-size: 11px;
  line-height: 1.35;
}
.bid-schedule-status.is-active { color: var(--green); }
.bid-schedule-status.is-inactive { color: var(--yel); }
.bid-main-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.bid-intervals-bar {
  padding: 7px 10px;
  background: rgba(255,250,242,0.72);
  font-size: 12px;
  border: 1px solid var(--c-ghost);
  border-radius: 6px;
}
.bid-intervals-bar summary {
  cursor: pointer;
  color: var(--t-secondary);
  font-weight: 700;
}
.bid-intervals-grid { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.bid-intervals-bar label { display: flex; align-items: center; gap: 5px; color: var(--c-muted); font-family: var(--f-body); }
.bid-intervals-bar .input-xs { width: 48px; }
.bid-import-row { align-items: center; justify-content: space-between; }
#bid-import-msg { flex: 1; color: var(--t-secondary); }
.bid-add-toggle { margin-top: 12px; }
.bid-add-card {
  padding: 12px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-ghost);
  border-radius: 6px;
}
.bid-import-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  margin-bottom: 10px;
  background: var(--c-bg);
  border: 1px solid var(--c-ghost);
  border-radius: 6px;
}
.bid-import-title {
  color: var(--t-primary);
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 2px;
}
.bid-import-preview {
  margin: 8px 0 12px;
  padding: 10px;
  border: 1px solid var(--c-ghost);
  border-radius: 6px;
  background: var(--c-bg);
}
.bid-import-count { font-size: 12px; color: var(--t-secondary); margin-bottom: 6px; }
.bid-preview-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.bid-preview-toolbar .hint { margin-right: auto; }
.bid-preview-list {
  max-height: 220px;
  overflow-y: auto;
  display: grid;
  gap: 5px;
  font-size: 12px;
}
.bid-preview-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  cursor: pointer;
  border: 1px solid var(--c-ghost);
  border-radius: 4px;
  background: var(--c-bg-2);
}
.bid-preview-row:hover { border-color: var(--c-accent); }
.bid-preview-check {
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--c-accent);
}
.bid-preview-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bid-preview-id {
  color: var(--c-muted);
  font-size: 10px;
  font-family: var(--f-mono);
  white-space: nowrap;
}
.bid-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}
.bid-form-grid.compact { margin-top: 10px; }
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--t-secondary);
  font-size: 11px;
  font-weight: 700;
  min-width: 0;
}
.field-full { grid-column: 1 / -1; }
.field .input, .field .input-sm { width: 100%; margin: 0; }
.money-input { display: inline-flex; align-items: center; gap: 5px; color: var(--t-primary); }
.bid-mode-row { margin: 10px 0; }
.bid-advanced {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--c-ghost);
  border-radius: 6px;
  background: rgba(246,241,232,0.75);
}
.bid-global-settings {
  margin: 0 0 12px;
  background: var(--c-bg-2);
}
.bid-global-settings #secBid { margin-top: 10px; }
.bid-schedule-heading {
  margin-top: 12px;
  padding-top: 9px;
  border-top: 1px solid var(--c-ghost);
  color: var(--t-secondary);
  font-size: 12px;
  font-weight: 800;
}
.bid-day-presets {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 6px 0 0 32px;
}
.bid-day-preset { min-width: 0; }
.bid-day-preset.is-active {
  color: var(--c-accent);
  border-color: var(--c-accent);
  background: rgba(160,26,6,0.08);
}
.bid-schedule-explain {
  margin-top: 7px;
  color: var(--c-muted);
  font-size: 11px;
  line-height: 1.4;
}
.bid-advanced summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--t-secondary);
}
.bid-hour-block { margin-top: 10px; }
.bid-hour-title { font-size: 12px; color: var(--t-secondary); margin-bottom: 5px; font-weight: 700; }
.bid-hour-helper { color: var(--c-muted); font-size: 11px; line-height: 1.4; margin-bottom: 6px; }
.bid-hour-summary { color: var(--c-muted); font-size: 11px; line-height: 1.4; margin-top: 5px; }
.bid-hour-summary.has-warning { color: var(--yel); }
.bid-add-submit { margin-top: 12px; width: 100%; min-height: 38px; }
.bid-list-tools {
  margin-top: 10px;
  border-top: 1px solid var(--c-ghost);
  padding-top: 10px;
}

/* ── Dot ──────────────────────────────────── */
.dot {
  width: 10px; height: 10px;
  background: var(--c-accent);
  flex-shrink: 0;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
.dot.on {
  background: #4A8C3F;
  box-shadow: 0 0 6px rgba(74,140,63,0.5);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
.dot.paused {
  background: #d99400;
  box-shadow: 0 0 6px rgba(217,148,0,0.5);
  animation: dotBlink 1.2s ease-in-out infinite;
}
.dot.stopped {
  background: #c23434;
  box-shadow: 0 0 6px rgba(194,52,52,0.5);
}
@keyframes dotBlink { 0%,100% { opacity:1 } 50% { opacity:0.3 } }

/* ── Группировка ставок ───────────────────── */
.bid-group { margin-bottom: 14px; }
.bid-group-hdr {
  display: flex; align-items: center; gap: 6px;
  background: var(--c-bg-3);
  padding: 6px 10px; margin-bottom: 4px;
  border: 1px solid var(--c-ghost);
}
.g-collapse {
  background: none; border: none; color: var(--c-muted);
  cursor: pointer; padding: 0 2px; font-size: 11px;
  line-height: 1;
}
.g-name {
  font-family: var(--f-body);
  font-weight: 800;
  font-size: 12px;
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--t-primary);
  letter-spacing: 0;
}
.g-count { font-size: 10px; white-space: nowrap; color: var(--t-secondary); font-family: var(--f-body); letter-spacing: 0; }
.g-hdr-acts { display: flex; gap: 4px; margin-left: auto; flex-shrink: 0; }
.g-settings-panel {
  background: var(--c-bg-2); border: 1px solid var(--c-ghost);
  padding: 8px 10px; margin-bottom: 6px;
}
.g-note { font-size: 10px; margin-top: 4px; color: var(--c-muted); font-family: var(--f-body); }
.g-items > .dcard { margin-left: 6px; }
.bid-group-ungrouped { margin-top: 8px; }
.bid-ungrouped-hdr { font-size: 11px; margin: 4px 0; color: var(--t-secondary); font-family: var(--f-body); font-weight: 800; letter-spacing: 0; }

/* ── dcard ────────────────────────────────── */
.dcard {
  background: var(--c-bg);
  padding: 10px;
  margin: 6px 0;
  border: 1px solid var(--c-ghost);
  border-left: 3px solid var(--c-accent);
  border-radius: 6px;
  transition: border-color var(--transition);
}
.dcard:hover { border-color: var(--c-accent); background: var(--c-bg-2); }
.dcard .top { display: flex; gap: 8px; align-items: flex-start; }

.left-pack { min-width: 50px; }
.dcard .rank {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  font-family: var(--f-body);
  font-weight: 800;
  font-size: 18px;
  min-width: 50px;
  text-decoration: none;
  flex-shrink: 0;
}
.rank.ok   { background: rgba(74,140,63,0.12); color: #4A8C3F; }
.rank.bad  { background: rgba(160,26,6,0.10); color: var(--c-accent); }
.rank.wait { background: var(--c-bg-3); color: var(--c-muted); }
.rank.err  { background: rgba(180,35,24,0.12); color: var(--danger); }
.rank.warn { background: rgba(183,121,31,0.15); color: var(--yel); }

.dcard .info { flex: 1; min-width: 0; }
.dcard .ttl { font-family: var(--f-body); font-weight: 800; font-size: 13px; letter-spacing: 0; color: var(--t-primary); }
.dcard .ttl-link { color: var(--t-primary); text-decoration: none; }
.dcard .ttl-link:hover { color: var(--c-accent); }

/* ── Tags ─────────────────────────────────── */
.tag { display: inline-block; font-size: 9px; padding: 1px 5px; margin-left: 3px; font-family: var(--f-body); letter-spacing: 0; }
.tag-id   { background: rgba(36,28,22,0.08); color: var(--c-text); }
.tag-city { background: var(--c-bg-3); color: var(--c-muted); }
.tag-sec  { background: rgba(58,92,156,0.10); color: #3A5C9C; }
.tag-svc  { background: rgba(140,104,32,0.12); color: #8C6820; }
.tag-grp  { background: rgba(108,76,156,0.12); color: #6C4C9C; }
.tag-hr   { background: rgba(40,140,120,0.12); color: #288C78; }
.tag-confirm      { letter-spacing: 0; }
.tag-confirm.bad  { background: rgba(160,26,6,0.12); color: var(--c-accent); }
.tag-confirm.ok   { background: rgba(74,140,63,0.12); color: #4A8C3F; }
.tag-status { margin-left: 0; border-radius: 999px; font-weight: 800; }
.tag-status.ok { background: rgba(31,138,76,0.12); color: var(--green); }
.tag-status.bad { background: rgba(180,35,24,0.10); color: var(--danger); }
.tag-status.wait { background: var(--c-bg-3); color: var(--c-muted); }
.tag-status.err { background: rgba(180,35,24,0.12); color: var(--danger); }
.tag-status.warn { background: rgba(183,121,31,0.15); color: var(--yel); }

/* ── Hour rules ───────────────────────────── */
.hour-rule {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  margin-bottom: 4px; padding: 4px 6px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-ghost);
  font-size: 11px;
  font-family: var(--f-body);
}
.hour-rule .input-xs { width: 38px; }
.hour-rule .hint { color: var(--c-muted); }

.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.tag-row { margin: 2px 0 4px; }
.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  font-size: 11px;
  color: var(--t-secondary);
}
.meta-grid .label { display: block; color: var(--c-muted); font-size: 10px; margin-bottom: 1px; font-family: var(--f-body); font-weight: 700; letter-spacing: 0; }
.meta-grid b {
  color: var(--t-primary);
  font-size: 12px;
  font-family: var(--f-body);
  font-weight: 800;
}

.dcard .meta { font-size: 10px; color: var(--c-muted); margin-top: 2px; font-family: var(--f-body); letter-spacing: 0; }
.meta-line { font-size: 11px; color: var(--t-secondary); font-family: var(--f-body); line-height: 1.4; }
.meta-line b { color: var(--t-primary); font-family: var(--f-body); font-weight: 800; font-size: 11px; }
.dcard .acts { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.dcard .acts .btn { font-size: 10px; padding: 2px 8px; }
.acts.acts-top { margin-top: 0; margin-left: auto; justify-content: flex-end; flex-wrap: nowrap; }
.acts.acts-top .btn:first-child { min-width: auto; }
.bid-result-card .acts.acts-top { flex-wrap: wrap; }
.bid-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px 10px;
  padding: 6px 0;
  font-size: 11px;
  color: var(--t-secondary);
}
.bid-card-grid b { color: var(--t-primary); font-weight: 800; }
.decision-line {
  padding: 6px 8px;
  background: var(--c-bg);
  border-left: 3px solid var(--c-ghost);
  color: var(--t-secondary);
  font-size: 11px;
  border-radius: 4px;
}

/* ── Change indicators ────────────────────── */
.change { font-size: 10px; margin-left: 4px; font-family: var(--f-body); letter-spacing: 0; }
.change.up { color: var(--green); }
.change.dn { color: var(--c-accent); }

/* ── Mini log ─────────────────────────────── */
.mini-log { display: none; margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--c-ghost); }
.mini-log.open { display: block; }
.mle { font-size: 10px; line-height: 1.5; color: var(--t-secondary); font-family: var(--f-body); letter-spacing: 0; }
.mle .tm { color: var(--c-muted); margin-right: 4px; }
.mle.t-error { color: var(--c-accent); }
.mle.t-bid   { color: var(--c-accent); }
.mle.t-alert { color: var(--yel); }
/* ── Dcard tabs (Лог / Позиции) ── */
.dcard-tabs { display: flex; gap: 8px; margin-top: 6px; }
.dcard-tab {
  background: none;
  border: none;
  color: var(--c-accent);
  cursor: pointer;
  font-size: 10px;
  font-family: var(--f-body);
  letter-spacing: 0;
  opacity: .7;
  padding: 0;
}
.dcard-tab:hover { opacity: 1; }

/* ── Mini position history ── */
.mini-pos { display: none; margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--c-ghost); }
.mini-pos.open { display: block; }
.ph-day { font-size: 10px; line-height: 1.6; color: var(--t-secondary); font-family: var(--f-body); margin-bottom: 4px; display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.ph-label { font-weight: 700; color: var(--t-primary); min-width: 55px; }
.ph-entry { white-space: nowrap; }
.ph-range { font-weight: 600; color: var(--t-primary); }

/* ── Статус-лейбл биддера (рядом с кнопками) ── */
.bid-status-label { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; font-family: var(--f-body); background: var(--c-bg-3); color: var(--t-secondary); min-width: 88px; text-align: center; }
.bid-status-label.running { background: rgba(31, 138, 76, 0.14); color: var(--green); }
.bid-status-label.paused  { background: rgba(183, 121, 31, 0.16); color: var(--yel); }
.bid-status-label.stopped { background: rgba(180, 35, 24, 0.13); color: var(--danger); }

/* ── График истории позиций (биддер) ── */
.ph-chart { margin: 4px 0 8px; padding: 6px 4px; background: var(--c-bg-2, rgba(0,0,0,0.02)); border-radius: 4px; }
.ph-chart-title { font-size: 10px; color: var(--t-secondary); font-family: var(--f-body); margin-bottom: 4px; padding: 0 4px; }
.ph-chart-title b { color: var(--t-primary); font-weight: 700; }
.ph-chart-svg { display: block; width: 100%; height: auto; max-height: 120px; overflow: visible; }
.ph-chart-svg circle { cursor: help; }
.ph-chart-svg circle:hover { r: 5; }

/* ── Price changes ────────────────────────── */
#priceChanges {
  background: var(--c-bg-2);
  padding: 6px 10px;
  margin-bottom: 8px;
  font-size: 11px;
  border: 1px solid var(--c-ghost);
  border-left: 3px solid var(--c-accent);
  font-family: var(--f-body);
}
.pc-item { padding: 2px 0; }
.price-old { text-decoration: line-through; color: var(--c-muted); font-family: var(--f-body); }
.price-new { color: var(--green); font-family: var(--f-body); font-weight: 800; letter-spacing: 0; }

/* ── Лицензия ─────────────────────────────── */
.license-status {
  font-family: var(--f-body);
  font-size: 11px;
  padding: 6px 10px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-ghost);
  letter-spacing: 0;
}
.lic-active   { color: #4A8C3F; }
.lic-inactive { color: var(--c-accent); }
.lic-cached   { color: #8C6820; }

/* ── Scrollbar ────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--c-bg-2); }
::-webkit-scrollbar-thumb { background: var(--c-ghost); }
::-webkit-scrollbar-thumb:hover { background: var(--c-accent); }

/* ── Inline edit (bid cards) ─────────────── */
.inline-edit {
  margin-top: 8px; padding: 10px; border-top: 1px solid var(--c-bg-3);
  background: var(--c-bg-2); border-radius: 0 0 6px 6px;
}
.ie-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.ie-row label { font-size: 11px; color: var(--t-secondary); display: flex; align-items: center; gap: 3px; }
.ie-row .input, .ie-row .input-sm { font-size: 12px; }
.ie-hours { margin: 6px 0; }
.ie-add-hr { font-size: 11px; }
.ie-hours-heading { color: var(--t-secondary); font-size: 11px; font-weight: 800; margin-top: 8px; }
.ie-hours-note { color: var(--c-muted); font-size: 10px; line-height: 1.35; margin-top: 2px; }

/* ── Overview analytics ───────────────────── */
.ov-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.ov-card { background: var(--c-bg-2); border: 1px solid var(--c-bg-3); border-radius: 6px; padding: 8px; text-align: center; }
.ov-num { font-family: var(--f-body); font-weight: 800; font-size: 18px; color: var(--t-primary); }
.ov-label { font-size: 10px; color: var(--t-secondary); margin-top: 2px; }
.insight-title { font-size: 12px; font-weight: 800; color: var(--t-primary); margin-bottom: 7px; cursor: pointer; user-select: none; }
.insight-title::before { content: '▾ '; font-size: 10px; }
.insight-block.collapsed .insight-title::before { content: '▸ '; }
.insight-block.collapsed .insight-item { display: none; }
.insight-link { color: var(--c-accent); text-decoration: none; word-break: break-word; }
.insight-link:hover { text-decoration: underline; }
.chart-title { font-size: 12px; font-weight: 800; color: var(--t-primary); margin-bottom: 6px; }
.bar-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 11px; }
.bar-label { width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--t-secondary); }
.bar-track { flex: 1; height: 14px; background: var(--c-bg-3); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--c-accent); border-radius: 3px; transition: width 0.3s; }
.bar-val { width: 60px; text-align: right; font-family: var(--f-body); color: var(--t-primary); }
.pie-legend { font-size: 11px; }
.pie-item { display: flex; align-items: center; gap: 6px; padding: 2px 0; color: var(--t-secondary); }
.pie-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ── Мои vs Конкуренты ── */
.ov-section-title { font-size: 12px; font-weight: 800; color: var(--t-primary); margin: 10px 0 6px; font-family: var(--f-body); letter-spacing: 0; }
.ov-compare { width: 100%; border-collapse: collapse; font-size: 11px; margin-bottom: 12px; }
.ov-compare th { font-size: 11px; font-weight: 800; color: var(--t-secondary); padding: 4px 6px; text-align: center; border-bottom: 2px solid var(--c-accent); }
.ov-compare th:first-child { text-align: left; }
.ov-compare td { padding: 4px 6px; text-align: center; border-bottom: 1px solid var(--c-bg-3); color: var(--t-primary); }
.ov-compare td:first-child { text-align: left; color: var(--t-secondary); font-size: 10px; }
.ov-compare td:nth-child(2) { background: rgba(160,26,6,0.04); }

/* ── Sparkline ── */
.sparkline { display: inline-block; vertical-align: middle; }
.sparkline polyline { fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.spark-up { stroke: var(--c-success, #2a7a2a); }
.spark-down { stroke: var(--c-accent); }
.spark-flat { stroke: var(--t-secondary); }

/* ── Price history chart ── */
.price-chart-wrap { padding: 8px; background: var(--c-bg-2); border: 1px solid var(--c-bg-3); border-radius: 6px; margin-top: 4px; }
.price-chart-wrap svg { width: 100%; }

/* ── Responsive ───────────────────────────── */
@media (max-width: 760px) {
  .title-row, .dcard .top { flex-direction: column; }
  .acts.acts-top { width: 100%; justify-content: flex-start; }
  .meta-grid { grid-template-columns: 1fr; }
  .scout-status-card,
  .section-head { flex-direction: column; align-items: stretch; }
  .scout-controls { justify-content: flex-start; }
  .company-columns { grid-template-columns: 1fr; }
  .scout-companies-card summary,
  .company-filter-row { align-items: flex-start; }
  .analytics-focus,
  .overview-insights,
  .search-stats-grid,
  .ov-grid.compact { grid-template-columns: 1fr; }
  .bid-card-grid { grid-template-columns: 1fr; }
  .analytics-toolbar .input-sm { width: 100%; }
  .analytics-sync-panel {
    display: grid;
    align-items: stretch;
  }
  .sync-actions {
    justify-content: stretch;
  }
  .sync-actions .btn {
    flex: 1 1 160px;
  }
}

@media (max-width: 520px) {
  body { font-size: 12px; }
  header {
    padding: 9px 10px;
    gap: 8px;
  }
  header h1 { font-size: 14px; }
  .tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
  }
  .tab {
    min-width: 0;
    padding: 8px 4px;
  }
  .panel { padding: 9px; }
  .sub-tabs {
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .sub-tab {
    flex: 0 0 auto;
    min-height: 30px;
  }
  .btn {
    min-height: 34px;
    white-space: normal;
  }
  .scout-controls,
  .bid-main-controls,
  .section-actions,
  .dcard .acts {
    width: 100%;
  }
  .bid-group-hdr {
    flex-wrap: wrap;
  }
  .g-hdr-acts {
    flex: 1 1 100%;
    margin-left: 0;
    min-width: 0;
  }
  .g-hdr-acts .btn {
    flex: 1 1 120px;
  }
  .scout-controls .btn,
  .bid-main-controls .btn,
  .section-actions .btn {
    flex: 1 1 150px;
  }
  .analytics-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }
  .toolbar-label {
    margin-bottom: -2px;
  }
  .toolbar-search,
  .analytics-toolbar .input-sm,
  .analytics-toolbar .btn,
  .multi-select {
    width: 100%;
    min-width: 0;
  }
  .multi-select-panel {
    position: static;
    width: 100%;
    max-height: 260px;
    box-shadow: none;
    margin-top: 4px;
  }
  .bid-status-card,
  .bid-import-panel {
    grid-template-columns: 1fr;
    display: grid;
  }
  .bid-import-panel .btn {
    width: 100%;
  }
  .bid-form-grid,
  .scout-mode-toggle {
    grid-template-columns: 1fr;
  }
  .phone-company,
  .phone-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .phone-actions {
    width: 100%;
    margin-left: 0;
  }
  .phone-titles { white-space: normal; }
  .stats-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat { min-width: 0; }
  .worker {
    grid-template-columns: 1fr;
  }
  .worker-meta { grid-column: auto; }
}

/* Иконка-кнопка ↻ перезагрузки в шапке (вынесено из inline-стилей из-за CSP MV3) */
.btn-reload-icon {
  background: none;
  border: 1px solid rgba(247, 243, 236, 0.2);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  color: var(--t-on-dark);
  opacity: 0.6;
  transition: opacity .15s;
}
.btn-reload-icon:hover { opacity: 1; }
