/* Risk Desk — пульт дежурного Take Funded.
   Палитра взята из пакета регламентов: графит #23272B, золото #8C6B3F,
   светло-серый #F2F3F4. Тёмная боковая панель держит навигацию,
   рабочая область светлая — в неё смотрят по двенадцать часов. */

:root {
  --graphite:   #23272b;
  --graphite-2: #2e343a;
  --graphite-3: #3c444c;
  --gold:       #8c6b3f;
  --gold-lift:  #a6834f;
  --gold-soft:  #f3ece2;

  --paper:      #f2f3f4;
  --surface:    #ffffff;
  --ink:        #23272b;
  --ink-2:      #4b545d;
  --muted:      #7b858f;
  --line:       #dcdfe3;
  --line-soft:  #e9ebee;

  --breach:     #9d2f28;
  --breach-bg:  #f8ebe9;
  --advisory:   #8c6b3f;
  --advisory-bg:#f6efe4;
  --settled:    #3f6b5a;
  --settled-bg: #eaf1ee;

  --sans: 'Archivo', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --radius: 2px;
}

* { box-sizing: border-box; }

/*
 * Атрибут hidden должен побеждать всегда.
 *
 * Браузер скрывает [hidden] правилом display:none из своей таблицы стилей,
 * но любое авторское правило вроде .shell { display: flex } его перебивает —
 * и элемент остаётся видимым, хотя в коде он «скрыт». Именно так экран входа
 * не исчезал после успешного входа.
 */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; cursor: pointer; }
h1, h2 { margin: 0; }

.shell { display: flex; min-height: 100vh; }

/* ---------- боковая панель ---------- */

.rail {
  width: 208px; flex: none;
  background: var(--graphite); color: #e7e9ea;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}

.rail-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 18px 22px;
  border-bottom: 1px solid var(--graphite-2);
}

.crest { color: var(--gold); display: flex; }

.rail-title { font-weight: 700; letter-spacing: -0.015em; font-size: 15px; }

.rail-sub {
  font: 500 9.5px/1 var(--mono);
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold-lift); margin-top: 3px;
}

.rail-nav { padding: 12px 10px; display: grid; gap: 1px; }

.nav-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; border: 0; background: none;
  color: #a7b0b8; text-align: left;
  padding: 9px 12px; border-radius: var(--radius);
  position: relative;
}

.nav-item:hover { background: var(--graphite-2); color: #e7e9ea; }

.nav-item.is-on { background: var(--graphite-2); color: #fff; }

.nav-item.is-on::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 2px; background: var(--gold);
}

.nav-label { flex: 1; font-weight: 500; font-size: 13.5px; }

.nav-count {
  font: 600 11px/1 var(--mono); font-variant-numeric: tabular-nums;
  background: var(--graphite-3); color: #cfd5da;
  padding: 3px 6px; border-radius: 100px; min-width: 22px; text-align: center;
}

.nav-item.is-on .nav-count { background: var(--gold); color: #fff; }

.rail-foot { margin-top: auto; padding: 16px 18px 18px; border-top: 1px solid var(--graphite-2); }

.link-state {
  display: flex; align-items: center; gap: 8px;
  font: 400 11px/1.4 var(--mono); color: #8b959e;
}

.beacon {
  width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: #5f9c84; box-shadow: 0 0 0 3px rgba(95, 156, 132, .18);
}

.beacon.stale { background: var(--gold-lift); box-shadow: 0 0 0 3px rgba(166, 131, 79, .2); }
.beacon.down { background: #b8544c; box-shadow: 0 0 0 3px rgba(184, 84, 76, .2); }

.operator {
  margin-top: 10px; font-size: 12px; color: #6f7982;
}

.operator button {
  border: 0; background: none; color: var(--gold-lift);
  padding: 0; font-size: 12px; text-decoration: underline;
}

/* ---------- рабочая область ---------- */

.stage { flex: 1; min-width: 0; }

.stage-head {
  display: flex; align-items: center; gap: 20px;
  padding: 20px 26px 16px;
}

.stage-head h1 {
  font-size: 20px; font-weight: 600; letter-spacing: -0.02em;
}

.ticker { display: flex; gap: 18px; margin-left: auto; }

.tick { text-align: right; }

.tick b {
  display: block;
  font: 600 17px/1 var(--mono); font-variant-numeric: tabular-nums;
}

.tick span {
  font: 500 9.5px/1.6 var(--mono);
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}

.tick.hot b { color: var(--breach); }

.view { display: none; padding: 0 26px 48px; }
.view.is-on { display: block; }

/* ---------- фильтры ---------- */

.filters {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 4px 16px; margin-bottom: 14px;
}

.filter-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0;
}

.filter-row + .filter-row { border-top: 1px solid var(--line-soft); }

.filter-tag {
  font: 500 9.5px/1 var(--mono);
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); width: 62px; flex: none;
}

.chips { display: flex; flex-wrap: wrap; gap: 5px; }

.chip {
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); padding: 4px 11px;
  border-radius: 100px; font-size: 12.5px;
}

.chip:hover { border-color: var(--gold); color: var(--gold); }

.chip.is-on {
  background: var(--graphite); border-color: var(--graphite); color: #fff;
}

/* ---------- лента ---------- */

.feed { display: grid; gap: 7px; }

.daymark {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 0 4px;
  font: 500 9.5px/1 var(--mono);
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}

.daymark::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}

.card {
  display: grid;
  grid-template-columns: 2px 178px minmax(0, 1fr) 232px 116px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding-right: 16px; text-align: left; width: 100%;
  transition: border-color .12s ease, box-shadow .12s ease;
}

.card:hover {
  border-color: var(--line);
  box-shadow: 0 1px 0 rgba(35, 39, 43, .06), 0 3px 10px rgba(35, 39, 43, .05);
}

.edge { align-self: stretch; background: var(--breach); }
.card.advisory .edge { background: var(--gold); }
.card.settled .edge { background: var(--settled); }

.card-rule { padding: 14px 0 14px 16px; }

.rule-name { font-weight: 600; font-size: 13.5px; letter-spacing: -0.01em; }

.rule-stamp {
  font: 400 11px/1.5 var(--mono); color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.card-who { padding: 14px 16px 14px 0; min-width: 0; }

.who-name { font-weight: 500; font-size: 13.5px; }

.who-meta {
  font: 400 11px/1.5 var(--mono); color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Шкала — главный элемент строки.
   Порог стоит золотой засечкой, превышение видно как выход за неё. */

.gauge { padding: 14px 0; }

.gauge-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 6px;
}

.gauge-value {
  font: 600 14px/1 var(--mono); font-variant-numeric: tabular-nums;
  color: var(--breach); letter-spacing: -0.02em;
}

.card.advisory .gauge-value { color: var(--gold); }
.card.settled .gauge-value { color: var(--settled); }

.gauge-limit {
  font: 400 10.5px/1 var(--mono); color: var(--muted);
}

.gauge-track {
  position: relative; height: 6px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 1px;
}

.gauge-fill {
  position: absolute; top: 0; bottom: 0; left: 0;
  background: var(--breach); opacity: .85;
}

.card.advisory .gauge-fill { background: var(--gold); }
.card.settled .gauge-fill { background: var(--settled); }

.gauge-notch {
  position: absolute; top: -4px; bottom: -4px; width: 2px;
  background: var(--graphite);
}

.gauge-notch::after {
  content: ''; position: absolute; top: -4px; left: -2px;
  border-left: 3px solid transparent; border-right: 3px solid transparent;
  border-top: 4px solid var(--gold);
}

.card-state { padding: 14px 0; text-align: right; }

.pill {
  display: inline-block; padding: 3px 10px; border-radius: 100px;
  font: 500 10.5px/1.5 var(--mono); letter-spacing: 0.02em;
  background: var(--paper); color: var(--ink-2);
}

.pill.new { background: var(--breach-bg); color: var(--breach); }
.pill.in_progress { background: var(--advisory-bg); color: var(--advisory); }
.pill.confirmed { background: var(--settled-bg); color: var(--settled); }

.state-who { font: 400 10.5px/1.6 var(--mono); color: var(--muted); margin-top: 4px; }

.blank {
  padding: 56px 24px; text-align: center;
  background: var(--surface); border: 1px dashed var(--line);
  border-radius: var(--radius); color: var(--muted);
}

.blank b { display: block; color: var(--ink); margin-bottom: 5px; font-size: 15px; }

/* ---------- панели ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel + .panel { margin-top: 14px; }
.panel.pad { padding: 18px 20px; }

.panel-title {
  font: 500 9.5px/1 var(--mono);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
}

.split { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.split > .panel + .panel { margin-top: 0; }

.panel-actions {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft);
}

.hint { color: var(--muted); font-size: 12.5px; margin: 0; }

/* ---------- таблицы ---------- */

.grid { width: 100%; border-collapse: collapse; }

.grid th {
  font: 500 9.5px/1 var(--mono);
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  text-align: left; padding: 12px 16px; white-space: nowrap;
  background: #fafbfb; border-bottom: 1px solid var(--line);
}

.grid td {
  padding: 11px 16px; border-bottom: 1px solid var(--line-soft); white-space: nowrap;
}

.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover td { background: #fafbfb; }

.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hot { color: var(--breach); font-weight: 600; }

/* ---------- поля ---------- */

.fields { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.fields.wide { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.field label {
  display: block;
  font: 500 9.5px/1.4 var(--mono);
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 6px;
}

.field input, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 10px; background: var(--surface); color: var(--ink);
  font: 500 14px/1.2 var(--mono); font-variant-numeric: tabular-nums;
}

.field input:focus, .field select:focus {
  outline: 2px solid var(--gold); outline-offset: -1px; border-color: var(--gold);
}

.field.check { display: flex; align-items: center; gap: 9px; }
.field.check input { width: auto; }
.field.check label { margin: 0; text-transform: none; letter-spacing: 0; font-size: 13px; font-family: var(--sans); }

/* ---------- кнопки ---------- */

.btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 8px 14px; border-radius: var(--radius); font-weight: 500; font-size: 13px;
}

.btn:hover { border-color: var(--gold); color: var(--gold); }

.btn.primary {
  background: var(--graphite); border-color: var(--graphite); color: #fff;
}

.btn.primary:hover { background: #171a1d; color: #fff; }

.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.gold:hover { background: var(--gold-lift); color: #fff; }

.btn.ghost-danger { border-color: var(--breach); color: var(--breach); }
.btn.ghost-danger:hover { background: var(--breach-bg); }

/* ---------- загрузка календаря ---------- */

.drop {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 18px; margin: 14px 0;
}

.drop.over { border-color: var(--gold); background: var(--gold-soft); }

.stat-line {
  display: flex; gap: 20px; flex-wrap: wrap;
  font: 400 12.5px/1.6 var(--mono); color: var(--ink-2);
}

.stat-line b { font-weight: 600; }

/* ---------- карточка разбора ---------- */

.scrim { position: fixed; inset: 0; background: rgba(35, 39, 43, .42); z-index: 40; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(580px, 100%);
  background: var(--surface); z-index: 50; overflow-y: auto;
  box-shadow: -8px 0 32px rgba(35, 39, 43, .16);
  animation: slidein .16s ease-out;
}

@keyframes slidein { from { transform: translateX(20px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .drawer { animation: none; }
  .card { transition: none; }
}

.drawer-head {
  position: sticky; top: 0; z-index: 2;
  background: var(--graphite); color: #fff;
  padding: 18px 22px; display: flex; align-items: flex-start; gap: 14px;
  border-bottom: 2px solid var(--gold);
}

.drawer-head h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }

.drawer-head p {
  margin: 4px 0 0; font: 400 12px/1.4 var(--mono); color: #a7b0b8;
}

.shut {
  margin-left: auto; border: 0; background: none; color: #8b959e;
  font-size: 24px; line-height: 1; padding: 0 4px;
}

.shut:hover { color: #fff; }

.slab { padding: 16px 22px; border-bottom: 1px solid var(--line-soft); }

.slab h3 {
  margin: 0 0 11px;
  font: 500 9.5px/1 var(--mono);
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}

.verdict {
  background: var(--breach-bg); border-left: 2px solid var(--breach);
  padding: 12px 14px; font-size: 13.5px; line-height: 1.5; color: #6d201b;
}

.verdict.advisory { background: var(--advisory-bg); border-left-color: var(--gold); color: #6a5030; }

.kv { display: grid; grid-template-columns: 158px 1fr; gap: 6px 14px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; }

pre.raw {
  margin: 0; padding: 13px; background: var(--graphite); color: #cdd3d8;
  border-radius: var(--radius); overflow-x: auto;
  font: 400 11.5px/1.6 var(--mono);
}

.mini { width: 100%; border-collapse: collapse; font-size: 12px; }

.mini th {
  text-align: left; padding: 5px 8px 5px 0; color: var(--muted);
  font: 500 9.5px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  border-bottom: 1px solid var(--line-soft);
}

.mini td {
  padding: 6px 8px 6px 0; font-family: var(--mono);
  border-bottom: 1px solid var(--line-soft); font-variant-numeric: tabular-nums;
}

.mini tr:last-child td { border-bottom: 0; }

.row-actions { display: flex; flex-wrap: wrap; gap: 7px; }

.memo {
  width: 100%; min-height: 70px; resize: vertical; margin-top: 10px;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; font: 400 13px/1.5 var(--sans); color: var(--ink);
}

.memo:focus, .btn:focus-visible, .chip:focus-visible,
.nav-item:focus-visible, .card:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 1px;
}

.copy-row { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }

/* ---------- уведомление ---------- */

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--graphite); color: #fff;
  padding: 11px 18px; border-radius: var(--radius); z-index: 60;
  border-left: 2px solid var(--gold);
  font-size: 13px; box-shadow: 0 6px 22px rgba(35, 39, 43, .22);
}

/* ---------- узкий экран ---------- */

@media (max-width: 1080px) {
  .card { grid-template-columns: 2px 150px minmax(0, 1fr) 190px 100px; }
}

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .rail { width: 100%; height: auto; position: static; }
  .rail-nav { grid-auto-flow: column; overflow-x: auto; }
  .nav-item.is-on::before { top: auto; bottom: 0; left: 12px; right: 12px; width: auto; height: 2px; }
  .rail-foot { display: flex; gap: 18px; align-items: center; }
  .operator { margin-top: 0; }
  .card { grid-template-columns: 2px minmax(0, 1fr); padding-bottom: 12px; }
  .card-who, .gauge, .card-state { padding-left: 16px; }
  .card-state { text-align: left; }
  .stage-head { flex-wrap: wrap; }
  .view { padding: 0 16px 40px; }
}

/* ---------- экран входа ---------- */

.gate {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center;
  background: var(--graphite);
  padding: 24px;
}

/* Тонкая золотая линия сверху — та же деталь, что и в шапке карточки разбора */
.gate-card {
  width: min(380px, 100%);
  background: var(--surface);
  border-top: 2px solid var(--gold);
  padding: 30px 30px 24px;
}

.gate-brand {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 22px; margin-bottom: 22px;
  border-bottom: 1px solid var(--line-soft);
}

.gate-brand .crest { color: var(--gold); display: flex; }

.gate-title { font-weight: 700; font-size: 17px; letter-spacing: -0.015em; }

.gate-sub {
  font: 500 9.5px/1 var(--mono);
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); margin-top: 4px;
}

.gate-form { display: grid; gap: 14px; }

.gate-submit { width: 100%; padding: 10px; }

.gate-error {
  background: var(--breach-bg); border-left: 2px solid var(--breach);
  color: #6d201b; padding: 9px 12px; font-size: 13px;
}

.gate-note {
  margin: 20px 0 0; padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted); font-size: 12px;
}

/* ---------- доступы ---------- */

.field-submit { display: flex; align-items: flex-end; }
.field-submit .btn { width: 100%; }

.secret {
  margin-top: 14px; padding: 13px 15px;
  background: var(--gold-soft); border-left: 2px solid var(--gold);
}

.secret-label { font-size: 12.5px; color: #6a5030; margin-bottom: 7px; }

.secret-value {
  font: 600 16px/1 var(--mono); letter-spacing: 0.04em;
  user-select: all; word-break: break-all;
}

.role-select {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 4px 8px; font: 400 12.5px/1.4 var(--sans); color: var(--ink);
  background: var(--surface);
}

.row-tools { display: flex; gap: 6px; justify-content: flex-end; }

.row-tools .btn { padding: 4px 10px; font-size: 12px; }

.tag-off { color: var(--muted); }
.tag-on { color: var(--settled); font-weight: 500; }

.you { color: var(--gold); font-size: 11px; margin-left: 6px; }

/* ---------- панель инструментов ленты ---------- */

.toolbar { display: flex; gap: 10px; margin-bottom: 12px; }

.search {
  flex: 1; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 13px; font: 400 13.5px/1.3 var(--sans);
  background: var(--surface); color: var(--ink);
}

.search:focus { outline: 2px solid var(--gold); outline-offset: -1px; border-color: var(--gold); }

.toolbar .btn { text-decoration: none; display: flex; align-items: center; }

/* ---------- утечка денег: пробит, но не отключён ---------- */

.leak {
  background: var(--surface);
  border: 1px solid var(--breach);
  border-left-width: 2px;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.leak-head {
  padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
}

.leak-title { font-weight: 600; font-size: 13.5px; color: var(--breach); }

.leak-sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }

.leak-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px; border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}

.leak-row:last-child { border-bottom: 0; }

.leak-who { flex: 1; min-width: 0; }

.leak-age {
  font: 600 12px/1 var(--mono); color: var(--breach);
  font-variant-numeric: tabular-nums;
}

/* ---------- шкала занятого лимита ---------- */

.bar {
  position: relative; height: 6px; width: 140px;
  background: var(--paper); border: 1px solid var(--line-soft); border-radius: 1px;
}

.bar-fill { position: absolute; top: 0; bottom: 0; left: 0; background: var(--settled); }
.bar-fill.warn { background: var(--gold); }
.bar-fill.over { background: var(--breach); }

.cell-link {
  border: 0; background: none; padding: 0; color: var(--ink);
  font: inherit; text-align: left; text-decoration: underline;
  text-decoration-color: var(--line); text-underline-offset: 3px;
}

.cell-link:hover { color: var(--gold); text-decoration-color: var(--gold); }

/* ---------- предупреждение по календарю ---------- */

.warn-line {
  background: var(--advisory-bg); border-left: 2px solid var(--gold);
  padding: 10px 13px; margin-top: 12px; font-size: 13px; color: #6a5030;
}

/* ---------- видимый сбой ---------- */

.fatal {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  background: var(--breach); color: #fff;
  padding: 12px 20px; font-size: 13.5px; line-height: 1.5;
}


/* ---------- вход через Google ---------- */

.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px; margin-bottom: 4px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  text-decoration: none; font-weight: 500;
}

.google-btn:hover { border-color: var(--gold); color: var(--ink); }

.google-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--graphite); color: #fff;
  font: 700 13px/1 var(--sans);
}

.gate-or {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0 12px; color: var(--muted); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
}

.gate-or::before, .gate-or::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }

/* ---------- режим наблюдения ---------- */

/* Штриховка — общий знак «посчитано, но не применено»: в шапке,
   на кромке карточки и в тексте разбора. */

.mode-badge {
  display: inline-flex; align-items: center;
  padding: 4px 11px; border-radius: 100px;
  border: 1px dashed var(--gold); background: var(--gold-soft); color: #6a5030;
  font: 600 10.5px/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap;
}

body.dry-run .rail { box-shadow: inset 0 3px 0 var(--gold); }

.card.dry .edge {
  background: repeating-linear-gradient(180deg, var(--breach) 0 5px, transparent 5px 9px);
}
.card.dry.advisory .edge {
  background: repeating-linear-gradient(180deg, var(--gold) 0 5px, transparent 5px 9px);
}
.card.dry.settled .edge {
  background: repeating-linear-gradient(180deg, var(--settled) 0 5px, transparent 5px 9px);
}

.dry-tag {
  display: inline-block; margin-top: 5px; padding: 1px 6px;
  border: 1px dashed var(--gold); border-radius: var(--radius);
  font: 500 10px/1.4 var(--mono); color: #6a5030; background: var(--gold-soft);
}

.dry-note {
  margin-top: 8px; padding: 10px 13px;
  border: 1px dashed var(--gold); background: var(--gold-soft);
  font-size: 13px; line-height: 1.5; color: #6a5030;
}

.kv dd.dry-dd { color: #6a5030; }

@media (max-width: 860px) {
  .mode-badge { white-space: normal; }
}

/* ---------- клиенты и оценка ---------- */

.view-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 14px; flex-wrap: wrap; margin-bottom: 14px;
}

.view-head h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.view-sub { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.empty { color: var(--muted); font-size: 13px; padding: 24px 0; }

.verdict-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }

.vt {
  font-size: 11px; padding: 3px 10px; border-radius: 3px;
  letter-spacing: 0.04em; white-space: nowrap;
}

.vt-candidate  { background: rgba(63,107,90,.14);  color: #2C6455; }
.vt-watch      { background: rgba(140,107,63,.14); color: #8A5A12; }
.vt-dropped    { background: rgba(168,48,42,.10);  color: #A8302A; }
.vt-collecting { background: var(--surface);        color: var(--muted); }
.vt-rejected   { background: rgba(168,48,42,.14);  color: #A8302A; }

.clients-grid { display: grid; gap: 12px; }

.client-card {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--line); border-radius: 3px;
  padding: 16px 18px; cursor: pointer;
}

.client-card:hover { border-color: var(--gold); }
.client-card.is-candidate  { border-left-color: #3F6B5A; }
.client-card.is-watch      { border-left-color: var(--gold); }
.client-card.is-dropped,
.client-card.is-rejected   { border-left-color: #A8302A; }

.client-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 14px; margin-bottom: 10px;
}

.client-id { font-weight: 600; font-size: 14px; }
.client-reason { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.5; }

.client-score {
  font-family: var(--mono); font-size: 26px; font-weight: 700;
  line-height: 1; white-space: nowrap;
}

.client-score small { font-size: 12px; font-weight: 400; color: var(--muted); }

.score-bar {
  height: 4px; background: var(--line-soft); border-radius: 2px;
  overflow: hidden; margin: 12px 0 10px;
}

.score-bar span { display: block; height: 100%; background: var(--gold); }
.client-card.is-candidate .score-bar span { background: #3F6B5A; }

.group-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; padding: 3px 0;
}

.group-row .gr-label { width: 150px; color: var(--muted); }
.group-row .gr-bar { flex: 1; height: 3px; background: var(--line-soft); border-radius: 2px; }
.group-row .gr-bar span { display: block; height: 100%; background: var(--gold); }
.group-row .gr-val { font-family: var(--mono); width: 56px; text-align: right; }

.weakest { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.weakest-item { font-size: 12px; color: var(--muted); line-height: 1.6; padding: 2px 0; }
.weakest-item b { color: var(--ink); font-weight: 500; }
.weakest-item .lost { font-family: var(--mono); color: #A8302A; }

.progress-line { font-size: 12px; color: var(--muted); font-family: var(--mono); }
