/* MTAR — browser page. Plain CSS, no build step. Light/dark follows the system. */

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e7eaef;
  --border: #dfe3e9;
  --border-strong: #c7cdd6;
  --text: #19212c;
  --text-2: #475263;
  --muted: #768194;

  --accent: #2f6bd8;
  --accent-hover: #2459ba;
  --accent-bg: #e7eefb;

  --ok: #1b7f45;
  --ok-bg: #e1f3e8;
  --warn: #9a5b00;
  --warn-bg: #fcefd6;
  --bad: #c22b2b;
  --bad-bg: #fbe3e3;
  --idle: #6a7382;
  --idle-bg: #eaedf1;
  --live: #c23b16;
  --live-bg: #fde8df;
  --live-line: #e2643c;
  --plan: #6d48c9;
  --plan-bg: #eee8fb;
  --resp: #0f7b77;
  --resp-bg: #def3f1;

  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
  --radius: 8px;
  --radius-sm: 6px;
  --topbar-h: 52px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1217;
    --surface: #161b22;
    --surface-2: #1c222b;
    --surface-3: #252c37;
    --border: #2a323d;
    --border-strong: #3a4350;
    --text: #e3e8ef;
    --text-2: #aeb8c6;
    --muted: #7f8a9a;

    --accent: #5f9bff;
    --accent-hover: #7caeff;
    --accent-bg: rgba(95, 155, 255, .15);

    --ok: #4cc47f;
    --ok-bg: rgba(76, 196, 127, .14);
    --warn: #e6a640;
    --warn-bg: rgba(230, 166, 64, .15);
    --bad: #f26b6b;
    --bad-bg: rgba(242, 107, 107, .15);
    --idle: #8e97a5;
    --idle-bg: rgba(142, 151, 165, .14);
    --live: #ff8a5c;
    --live-bg: rgba(255, 138, 92, .15);
    --live-line: #ff7a45;
    --plan: #a98bff;
    --plan-bg: rgba(169, 139, 255, .15);
    --resp: #43c6bf;
    --resp-bg: rgba(67, 198, 191, .14);

    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
  }
}

* { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--topbar-h) + 12px); }

body {
  margin: 0;
  min-width: 1000px;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
h2, h3 { margin: 0; font-weight: 600; }
h2 { font-size: 15px; }
h3 { font-size: 16px; }
p { margin: 0 0 8px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }

[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.spacer { flex: 1 1 auto; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ───────────── Top bar ───────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.logo { font-weight: 750; font-size: 17px; letter-spacing: .04em; }
.brand-sub { color: var(--text-2); font-size: 13px; }

.tabs { display: flex; gap: 2px; align-self: stretch; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-2);
  cursor: pointer;
  font-weight: 500;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tab-badge {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
.tab-badge-bad { background: var(--bad); color: #fff; }

.topstatus { margin-left: auto; display: flex; align-items: center; gap: 10px; white-space: nowrap; }

/* Six tabs and the status on a 1024 px screen: drop the subtitle, tighten the tabs. */
@media (max-width: 1320px) {
  .topbar { gap: 12px; padding: 0 14px; }
  .brand-sub { display: none; }
  .tab { padding: 0 10px; }
  .topstatus { gap: 8px; }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
}
.pill-live { background: var(--live-bg); color: var(--live); border-color: color-mix(in srgb, var(--live) 30%, transparent); }
.pill-observer { background: var(--idle-bg); color: var(--text-2); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }

.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--idle); }
.conn.is-ok .dot { background: var(--ok); }
.conn.is-bad .dot { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.conn.is-wait .dot { background: var(--warn); }

/* ───────────── Banner "MTAR не отвечает" ───────────── */

.banner {
  position: sticky;
  top: var(--topbar-h);
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: var(--bad);
  color: #fff;
  box-shadow: var(--shadow);
}
.banner.is-wait { background: var(--warn); }
.banner-text { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.banner strong { font-size: 15px; }
.banner .btn { background: #fff; color: var(--bad); border-color: #fff; }

body.is-stale main { opacity: .62; transition: opacity .3s; }

/* ───────────── "Нет доступа к MTAR" (replaces the whole app) ───────────── */

body.is-locked .tabs,
body.is-locked .topstatus,
body.is-locked .banner,
body.is-locked main { display: none !important; }

.noaccess { padding: 32px 20px; }
.noaccess-box {
  max-width: 1520px;
  margin: 0 auto;
  padding: 28px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 6px solid var(--bad);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.noaccess-box h1 { margin: 0 0 10px; font-size: 24px; font-weight: 650; color: var(--bad); }
.noaccess-box p { margin: 0 0 10px; font-size: 16px; }
.noaccess-box p.muted { font-size: 14px; }

/* ───────────── Login (MTAR on a server) ───────────── */

.login-box {
  max-width: 440px;
  margin: 40px auto 0;
  padding: 28px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.login-box h1 { margin: 0 0 14px; font-size: 22px; font-weight: 650; }
.login-box p { margin: 0 0 10px; }
.login-box code { font-size: 13px; padding: 1px 5px; border-radius: 4px; background: var(--surface-2); }
.login-note { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn); }
.login-form { display: flex; flex-direction: column; gap: 8px; }
.login-form label { color: var(--text-2); font-size: 13px; }
.login-form .inp { height: 38px; font-size: 15px; }
.login-form .btn { align-self: flex-start; height: 36px; padding: 0 22px; }
.login-form .problems { margin: 0; }
.login-form p { margin: 6px 0 0; }
.export-password { margin-top: 12px; }

/* ───────────── Layout ───────────── */

main { max-width: 1520px; margin: 0 auto; padding: 16px 20px 64px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.summary-line { margin: 0 0 10px; color: var(--text-2); font-size: 13px; min-height: 19px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }

.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.empty { color: var(--muted); margin: 6px 0; }
.empty-big { padding: 40px 0; text-align: center; font-size: 15px; }

/* ───────────── Inputs and buttons ───────────── */

.inp {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}
.inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.inp-search { width: 260px; }
.inp-num { width: 76px; text-align: right; font-variant-numeric: tabular-nums; }
select.inp { padding-right: 6px; }
textarea.inp { height: auto; padding: 8px 10px; resize: vertical; width: 100%; font-family: var(--mono); font-size: 12.5px; }
.inp.is-invalid { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--bad) 85%, #000); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-link-danger { color: var(--bad); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 12px; }
.btn-big { height: 44px; padding: 0 22px; font-size: 15px; font-weight: 600; }

.icon-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.linklike {
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  text-align: left;
}
.linklike:hover { text-decoration: underline; }

.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg button {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--surface-2); }
.seg button[aria-pressed="true"] { background: var(--accent-bg); color: var(--accent); font-weight: 600; }

.chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
}
.chip .chip-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { border-color: currentColor; font-weight: 600; }
.chip[aria-pressed="true"].lvl-alarm { color: var(--bad); background: var(--bad-bg); }
.chip[aria-pressed="true"].lvl-warn { color: var(--warn); background: var(--warn-bg); }
.chip[aria-pressed="true"].lvl-cmd { color: var(--accent); background: var(--accent-bg); }
.chip[aria-pressed="true"].lvl-resp { color: var(--resp); background: var(--resp-bg); }
.chip[aria-pressed="true"].lvl-plan { color: var(--plan); background: var(--plan-bg); }
.chip[aria-pressed="true"].lvl-info { color: var(--text-2); background: var(--idle-bg); }

/* Toggle switch: a styled checkbox */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input {
  appearance: none;
  position: relative;
  width: 34px;
  height: 20px;
  margin: 0;
  border-radius: 10px;
  background: var(--border-strong);
  cursor: pointer;
  transition: background .15s;
  flex: none;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  transition: transform .15s;
}
.switch input:checked { background: var(--live-line); }
.switch input:checked::after { transform: translateX(14px); }
.switch input:disabled { opacity: .45; cursor: default; }
.switch-text { font-size: 13px; color: var(--text-2); }
.switch input:checked + .switch-text { color: var(--live); font-weight: 600; }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

/* ───────────── Badges ───────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
  background: var(--idle-bg);
  color: var(--text-2);
}
.badge::before { content: none; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-idle { background: var(--idle-bg); color: var(--idle); }
.b-live { background: var(--live-bg); color: var(--live); }
.b-neutral { background: var(--surface-3); color: var(--text-2); }
.b-pending { background: var(--accent-bg); color: var(--accent); }
.b-exch { background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); font-size: 11px; letter-spacing: .03em; padding: 0 6px; }
.b-demo { background: var(--plan-bg); color: var(--plan); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .06em; }

.dot-state { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--idle); flex: none; }
.dot-state.s-healthy { background: var(--ok); }
.dot-state.s-stop-only { background: var(--warn); }
.dot-state.s-down { background: var(--bad); }

/* ───────────── Problems (server errors near the form) ───────────── */

.problems {
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent);
  border-radius: var(--radius-sm);
  background: var(--bad-bg);
  color: var(--bad);
  font-size: 13px;
}
.problems strong { display: block; margin-bottom: 2px; }
.problems ul { margin: 0; padding-left: 18px; }
.problems li { margin: 2px 0; }
.problems.is-info { border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-bg); color: var(--ok); }

.note {
  margin: 8px 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
}
.note-warn { background: var(--warn-bg); color: var(--warn); }
.note-bad { background: var(--bad-bg); color: var(--bad); }
.note-live { background: var(--live-bg); color: var(--live); }

/* ───────────── Overview ───────────── */

.plate {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 20px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 5px solid var(--idle);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.plate.is-live { border-left-color: var(--live-line); background: linear-gradient(90deg, var(--live-bg), var(--surface) 55%); }
.plate.is-observer { border-left-color: var(--idle); }
.plate-text { flex: 1 1 auto; min-width: 0; }
.plate-title { font-size: 18px; font-weight: 650; margin-bottom: 4px; }
.plate.is-live .plate-title { color: var(--live); }
.plate-desc { color: var(--text-2); }
.plate-action { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; text-align: right; max-width: 380px; }
.plate-action .is-bad { color: var(--bad); font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  min-width: 0;
}
.tile-label { color: var(--text-2); font-size: 13px; }
.tile-value { font-size: 28px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.25; margin: 2px 0; }
.tile-value .of { color: var(--muted); font-weight: 500; font-size: 20px; }
.tile-sub { color: var(--muted); font-size: 12px; min-height: 17px; }
#tab-overview .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
/* Five tiles at about 1024 px: some labels take two lines; the numbers stay on one level. */
@media (max-width: 1120px) {
  #tab-overview .tile-label { min-height: calc(2 * 1.4em); line-height: 1.4; }
}
.tiles-auto { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
/* A tile that opens another tab («Команды MTAR за сегодня»). */
/* A flex column, not block: a button centres its content vertically, the other tiles start at the top. */
.tile-link { display: flex; flex-direction: column; justify-content: flex-start; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.tile-link > span { display: block; }
.tile-link:hover { border-color: var(--accent); }
.tile-link:hover .tile-label { color: var(--accent); }
.tile.is-bad .tile-value { color: var(--bad); }
.tile.is-warn .tile-value { color: var(--warn); }
.tile.is-live .tile-value { color: var(--live); }
/* «Команды MTAR за сегодня»: the counters themselves may be short (/api/stats `problem` / `gaps`); the reason is in its tooltip. */
.tile-mark {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  margin-left: 4px;
  border-radius: 8px;
  background: var(--warn);
  color: var(--surface);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  vertical-align: 1px;
}
.tile-mark[hidden] { display: none; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; align-items: start; }

.feed { display: flex; flex-direction: column; }
.feed-row {
  display: grid;
  grid-template-columns: 104px 150px minmax(0, 1fr);
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.feed-row:first-child { border-top: 0; }
.feed-time { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed-scope { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-text { overflow-wrap: anywhere; }

.plist { display: flex; flex-direction: column; }
.plist-row {
  display: grid;
  grid-template-columns: minmax(90px, auto) auto minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 6px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.plist-row:first-child { border-top: 0; }
.plist-reason { color: var(--text-2); overflow-wrap: anywhere; }

.about { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: 13px; }
.about dt { color: var(--muted); }
.about dd { margin: 0; overflow-wrap: anywhere; }

/* Update from GitHub (server only) */
.upd-new { margin-top: 12px; }
.upd-new-title { font-weight: 600; font-size: 13px; }
.upd-notes {
  margin-top: 6px;
  max-height: 220px;
  overflow: auto;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.upd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.upd-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 13px;
}
.upd-uptodate { margin: 8px 0 0; }
.spinner {
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.again-password { margin-top: 12px; }

.apply-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.apply-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.apply-list li { margin: 2px 0; overflow-wrap: anywhere; }

/* ───────────── Links tab: master cards ───────────── */

.masters { display: flex; flex-direction: column; gap: 8px; }

.mcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.mcard.is-live { border-left-color: var(--live-line); }
.mcard.is-draft { border-style: dashed; border-left-style: solid; border-left-color: var(--accent); }

.mcard-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 7px 14px 7px 8px;
  cursor: pointer;
  user-select: none;
}
.mcard-head:hover { background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.mcard.is-collapsed .mcard-head:hover { border-radius: var(--radius); }
.chev {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  cursor: pointer;
  transition: transform .15s;
  font-size: 12px;
}
.mcard.is-collapsed .chev { transform: rotate(-90deg); }
.mname { font-weight: 650; font-size: 15px; }
.mrole { color: var(--muted); font-size: 12px; }
.mreason { color: var(--text-2); font-size: 12px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mstats { display: inline-flex; gap: 14px; color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.mstats b { color: var(--text); font-weight: 600; }

.mcard-body { border-top: 1px solid var(--border); padding: 0 0 4px; }
.mcard.is-collapsed .mcard-body { display: none; }
.mcard-empty { padding: 12px 16px; color: var(--muted); }

/* ───────────── Tables ───────────── */

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.grid th {
  position: sticky;
  top: var(--topbar-h);
  z-index: 2;
  padding: 7px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  font-weight: 600;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}
.grid th:first-child { border-top-left-radius: var(--radius); }
.grid th:last-child { border-top-right-radius: var(--radius); }
.grid th[data-sort] { cursor: pointer; }
.grid th[data-sort]:hover { color: var(--text); }
.grid th .sort-arrow { color: var(--accent); margin-left: 4px; }
.grid td { padding: 6px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.grid .col-actions { width: 1%; white-space: nowrap; text-align: right; }

.cell-name { font-weight: 600; white-space: nowrap; }
.grid tr.is-busy { opacity: .6; pointer-events: none; }
/* «Наблюдать» is not a trading switch: blue, not the orange of «боевой». */
.switch-watch input:checked { background: var(--accent); }
.switch-watch input:checked + .switch-text { color: var(--accent); }
.name-cell { display: flex; align-items: center; gap: 6px; }
/* Reasons wrap (two lines at most) instead of widening the table. */
.cell-reason {
  color: var(--text-2);
  font-size: 12px;
  max-width: 300px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cell-reason.is-warn { color: var(--warn); }
.state-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }

/* Slaves table inside a master card: one <tbody> per slave (main row + problems row).
   Fixed column widths so the columns line up from one master card to the next. */
.slaves { table-layout: fixed; }
.slaves th { position: static; background: transparent; border-radius: 0 !important; padding-top: 8px; }
.slaves th:nth-child(1) { width: 180px; }
.slaves th:nth-child(2) { width: 210px; }
.slaves th:nth-child(3) { width: 104px; }
.slaves th:nth-child(4) { width: 140px; }
.slaves th:nth-child(5) { width: 124px; }
.slaves th:nth-child(7) { width: 88px; }
.slaves .slave-name { min-width: 0; }
.slaves .slave-name span:last-child { overflow: hidden; text-overflow: ellipsis; }
.slaves .slave-sub, .slaves .last-cmd-text { max-width: none; }
.slaves tbody td { border-bottom: 1px solid var(--border); }
.slaves tbody:last-of-type tr.main td { border-bottom: 0; }
.slaves tbody.has-problems tr.main td { border-bottom: 0; }
.slaves tr.problems-row td { padding-top: 0; }
.slaves tr.problems-row .problems { margin-top: 0; }
.slaves tbody.is-gone td { color: var(--muted); }
.slaves tbody.is-busy { opacity: .6; pointer-events: none; }

.slave-name { display: flex; align-items: center; gap: 7px; white-space: nowrap; font-weight: 600; }
.slave-sub { color: var(--text-2); font-size: 12px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slave-sub.is-warn { color: var(--warn); }
.slave-sub.is-bad { color: var(--bad); }

.size-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; white-space: nowrap; }
.size-edit .inp { height: 28px; }
.size-edit select.inp { width: 104px; }
.size-actions { display: none; gap: 4px; }
tbody.is-dirty .size-actions { display: inline-flex; }
tbody.is-dirty .size-edit .inp { border-color: var(--accent); }

.mode-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.mode-note { color: var(--muted); font-size: 12px; max-width: 240px; }
.applying { color: var(--accent); font-size: 12px; }
.applying.is-bad { color: var(--bad); font-weight: 600; }

.copies-main { font-variant-numeric: tabular-nums; white-space: nowrap; }
.copies-main b { font-weight: 600; }
.copies-states { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.copies-states .badge { font-size: 11px; padding: 0 6px; line-height: 16px; }
.virtual { color: var(--muted); font-size: 12px; }

.last-cmd-time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.last-cmd-text { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-line { margin-top: 2px; color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; }
/* Narrow screens (1024 px): give «Последняя команда» (and its «сегодня: …» line) more room. */
@media (max-width: 1280px) {
  .slaves th:nth-child(1) { width: 150px; }
  .slaves th:nth-child(2) { width: 208px; }
  .slaves th:nth-child(3) { width: 96px; }
  .slaves th:nth-child(4) { width: 124px; }
  .slaves th:nth-child(5) { width: 104px; }
  .slaves th:nth-child(7) { width: 80px; }
}
.today-line.is-quiet { color: var(--muted); }
.today-line.is-warn { color: var(--warn); }

/* Add-slaves form inside a master card */
.addform {
  margin: 8px 12px 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.addform-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.addform-head h3 { font-size: 14px; }
.addform-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 8px 0; }
.addform-row label.lbl { color: var(--text-2); font-size: 13px; }

.cand-list {
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  align-content: start;
}
.cand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  min-width: 0;
}
.cand:hover { background: var(--surface-2); }
.cand input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex: none; }
.cand-name { font-weight: 600; white-space: nowrap; }
.cand-addr { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cand.is-checked { background: var(--accent-bg); }
.cand-empty { padding: 12px; color: var(--muted); grid-column: 1 / -1; }

/* "New master" dialog list */
.pick-list {
  max-height: 360px;
  overflow: auto;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.pick {
  display: grid;
  grid-template-columns: minmax(120px, auto) auto auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}
.pick:hover, .pick:focus-visible { background: var(--accent-bg); }
.pick:last-child { border-bottom: 0; }

/* ───────────── Journal ───────────── */

.journal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-anchor: auto;
}
.jrow {
  display: grid;
  grid-template-columns: 116px 104px minmax(110px, 200px) minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding: 5px 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.jrow:first-child { border-top: 0; }
.jrow.is-fresh { animation: fresh 2.5s ease-out; }
@keyframes fresh { from { background: var(--accent-bg); } to { background: transparent; } }
.jrow.lvl-alarm { background: color-mix(in srgb, var(--bad-bg) 55%, transparent); }
.jtime { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12px; }
.jscope { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.jtext { white-space: pre-wrap; overflow-wrap: anywhere; }

.lvl { justify-self: start; font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.lvl.lvl-alarm { background: var(--bad); color: #fff; }
.lvl.lvl-warn { background: var(--warn-bg); color: var(--warn); }
.lvl.lvl-cmd { background: var(--accent-bg); color: var(--accent); }
.lvl.lvl-resp { background: var(--resp-bg); color: var(--resp); }
.lvl.lvl-plan { background: var(--plan-bg); color: var(--plan); }
.lvl.lvl-info { background: var(--idle-bg); color: var(--idle); }

.journal-more { padding: 10px 14px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); }

/* ───────────── Dialogs ───────────── */

dialog.dlg {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}
dialog.dlg:not([open]) { display: none; }
dialog.dlg-wide { width: min(780px, calc(100vw - 32px)); }
dialog.dlg::backdrop { background: rgba(10, 14, 20, .45); }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px 8px; }
.dlg-head h3 { flex: 1 1 auto; }
.dlg-body { padding: 4px 18px 8px; overflow: auto; }
.dlg-body p { color: var(--text-2); }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--border); margin-top: 8px; }
.dlg.is-busy .dlg-foot { opacity: .7; }
.dlg-danger .dlg-head h3 { color: var(--bad); }

.form-grid { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px 14px; align-items: center; }
.form-grid .inp { width: 100%; }
.form-grid .hint { grid-column: 2; margin-top: -6px; color: var(--muted); font-size: 12px; }
.form-grid label { color: var(--text-2); font-size: 13px; }
.key-row { display: flex; gap: 8px; align-items: center; }
.key-row .inp { flex: 1 1 auto; }
/* The key field is type=text (so no password manager offers to save it), hidden with dots unless «показать» is ticked. */
.key-mask { -webkit-text-security: disc; }
.key-mask::placeholder { -webkit-text-security: none; }

.dlg-status {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 13px;
}

.size-diff {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  align-items: baseline;
  margin: 8px 0 10px;
  font-size: 15px;
}

.confirm-list { margin: 6px 0 10px; padding-left: 20px; color: var(--text-2); }
.confirm-list li { margin: 4px 0; }

.result-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.result-table td { padding: 4px 8px; border-top: 1px solid color-mix(in srgb, var(--bad) 25%, transparent); vertical-align: top; }
.result-table td:first-child { white-space: nowrap; width: 1%; font-variant-numeric: tabular-nums; }

.file-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.help-list { margin: 4px 0 10px; padding-left: 18px; color: var(--text-2); font-size: 13px; }
.help-list li { margin: 2px 0; }

/* ───────────── Toasts and demo bar ───────────── */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;
}
.toast {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  animation: toast-in .18s ease-out;
}
.toast.is-bad { background: var(--bad); color: #fff; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.demobar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 20px;
  background: var(--plan-bg);
  color: var(--text-2);
  font-size: 12px;
  border-top: 1px solid var(--border);
  backdrop-filter: blur(6px);
}
.demobar strong { color: var(--plan); }
.demobar select.inp { height: 26px; font-size: 12px; max-width: 180px; }
/* At 1024 px the buttons go to a second line instead of squeezing the text into a column. */
.demobar { flex-wrap: wrap; row-gap: 4px; }
.demobar > span:first-child { flex: 1 1 420px; min-width: 0; }
.demobar .btn { flex: none; }
body.has-demobar main { padding-bottom: 110px; }
body.has-demobar .noaccess { padding-bottom: 64px; }
body.has-demobar .toasts { bottom: 56px; }

/* ───────────── Monitoring ───────────── */

.mon-groupbar { align-items: flex-start; flex-wrap: nowrap; }
.mon-groupbar > .btn { flex: none; }
.gchips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; }
.gchips-label { color: var(--muted); font-size: 12px; margin: 0 2px 0 8px; }
.gchips-group { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.gchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  max-width: 260px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
}
.gchip:hover { background: var(--surface-2); color: var(--text); }
.gchip.is-auto { border-style: dashed; }
.gchip.is-active { border: 1px solid var(--accent); background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.gchip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gchip-n { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 500; }
.gchip.is-active .gchip-n { color: var(--accent); }
.gchip-bad {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--bad);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-weight: 600;
}
.gchip-add, .gchip-more { border-style: dashed; color: var(--accent); }

.mon-table .col-chev { width: 34px; padding-right: 0; }
.mon-table tbody td, .stats-table tbody td { border-bottom: 1px solid var(--border); }
.mon-table tbody:last-of-type tr:last-child td, .stats-table tbody:last-of-type tr:last-child td { border-bottom: 0; }
.mon-table tr.main, .stats-table tr.main { cursor: pointer; }
.mon-table tbody:not(.is-open) .chev, .stats-table tbody:not(.is-open) .chev { transform: rotate(-90deg); }
.mon-table tbody.is-open tr.main td, .stats-table tbody.is-open tr.main td { background: var(--accent-bg); }
.mon-table .mon-at { color: var(--text-2); font-size: 12px; }
.mon-table .mon-at.is-live { color: var(--ok); }
.mon-table td.muted { color: var(--muted); }
.mon-acc.is-flash tr.main td { animation: fresh 2.5s ease-out; }
.mon-table .detail-row > td { padding: 0 10px 10px 44px; background: var(--surface-2); }

.algo-host { padding-top: 8px; }
.algo-wait { margin: 4px 0; }
.algo-head { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.algo-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.algo-table th { position: static; background: transparent; padding: 5px 8px; text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.algo-table td { padding: 4px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.algo-table tr:last-child td { border-bottom: 0; }
.algo-table th:first-child, .algo-table td:first-child { width: 1%; }
.algo-name { font-weight: 500; }
.algo-sig {
  margin-left: 8px;
  padding: 0 5px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}
.copy-of { white-space: nowrap; }

/* «Группы…» */
.grp-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; margin-top: 8px; }
.grp-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.grp-side-head { color: var(--text-2); font-size: 12px; font-weight: 600; }
.grp-list { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow: auto; }
.grp-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 13px;
}
.grp-item:hover { background: var(--surface-2); }
.grp-item.is-active { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.grp-item.is-new { font-style: italic; cursor: default; }
.grp-item-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-item-n { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.grp-edit { min-width: 0; }
.grp-edit-title { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.grp-name { grid-template-columns: 90px minmax(0, 1fr); }
dialog.dlg-groups { width: min(980px, calc(100vw - 32px)); }
.grp-edit .inp-search { flex: 1 1 180px; width: auto; min-width: 0; }
.grp-from { max-width: 260px; }
.grp-cands { max-height: min(280px, 30vh); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.grp-kept { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.grp-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }

/* ───────────── Statistics ───────────── */

.stats-table { font-variant-numeric: tabular-nums; }
.stats-table.is-loading tbody { opacity: .55; }
.stats-table th { white-space: normal; vertical-align: bottom; line-height: 1.25; padding: 7px 8px; }
.stats-table td { padding: 6px 8px; }
.stats-table th.num { text-align: right; }
.stats-table .th-sub { display: block; color: var(--muted); font-weight: 500; font-size: 11px; }
.stats-table .th-partial { color: var(--warn); font-weight: 700; margin-left: 2px; }
.stats-table .col-link { min-width: 190px; }
.stats-table .col-master { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.stats-table th.col-master { background: var(--surface-3); }
.stats-table .col-master-first { border-left: 2px solid var(--border-strong); }
.stats-table td.is-zero { color: var(--muted); }
.stats-table td.is-bad { color: var(--bad); font-weight: 600; }
.stats-table td.is-warn { color: var(--warn); font-weight: 600; }
.stats-link-cell { display: flex; align-items: flex-start; gap: 4px; }
.stats-link-cell .chev { flex: none; margin-top: -3px; }
.stats-link { white-space: nowrap; }
.stats-link .arrow { color: var(--muted); }
.stats-marks { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
.stats-marks .badge { font-size: 11px; padding: 0 6px; line-height: 16px; }
.stats-table tr.sub td { background: var(--surface-2); font-size: 12px; padding-top: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.stats-table tr.sub td.col-master { background: color-mix(in srgb, var(--surface-3) 60%, transparent); }
.stats-table tr.sub .col-link { padding-left: 38px; }
.stats-table tr.sub-note td { color: var(--muted); padding-left: 38px; }
.stats-table tr.sub-note.is-bad td { color: var(--bad); }
/* One line per algorithm: a long name is cut (the full name is in its tooltip), the signature stays beside it. */
.sub-algo { display: flex; align-items: baseline; gap: 6px; min-width: 0; white-space: nowrap; }
.sub-algo .algo-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sub-algo .algo-sig { flex: none; margin-left: 0; }
.sub-copy { display: flex; align-items: center; gap: 6px; margin-top: 1px; white-space: nowrap; }
.sub-copy .badge { font-size: 11px; padding: 0 6px; line-height: 16px; }
/* Per-algorithm numbers are all-time totals (GET /api/stats/copies), not the period: said on every row. */
.sub-alltime-mark { color: var(--plan); font-size: 11px; white-space: nowrap; }
.stats-table tr.sub-alltime td { color: var(--text-2); }
.stats-table tr.sub-alltime strong { color: var(--plan); font-weight: 600; }
.stats-table tr.sub td.num { font-style: italic; }
.stats-table tfoot td {
  padding: 7px 8px;
  border-top: 2px solid var(--border-strong);
  background: var(--surface-2);
  font-weight: 600;
}
.stats-table tfoot td:first-child { border-bottom-left-radius: var(--radius); }
.stats-table tfoot td:last-child { border-bottom-right-radius: var(--radius); }
.stats-since ul { margin: 4px 0; padding-left: 18px; }
.stats-since strong { display: block; }
.stats-trouble strong { margin-right: 4px; }
#accTable .col-watch { text-align: center; }
/* 1024 px: the accounts table (with «Наблюдать») and the statistics table fit without sideways scrolling. */
@media (max-width: 1280px) {
  #accTable th, #accTable td { padding-left: 7px; padding-right: 7px; }
  .stats-table th, .stats-table td { padding-left: 6px; padding-right: 6px; }
  .stats-table .col-link { min-width: 160px; }
}
/* About 1024 px (the page's narrowest): tighter still. The link column gets a fixed share (the numbers columns give
   way), an algorithm's name is cut to fit (full name in its tooltip) and its copy line may wrap. */
@media (max-width: 1120px) {
  #accTable th, #accTable td { padding-left: 5px; padding-right: 5px; }
  .stats-table th, .stats-table td { padding-left: 4px; padding-right: 4px; }
  .stats-table .col-link { min-width: 0; }
  .stats-table th.col-link { width: 230px; }
  .stats-table tr.sub .col-link, .stats-table tr.sub-note td { padding-left: 28px; }
  .sub-algo .algo-name { flex: 1 1 0; width: 0; }
  .sub-copy { flex-wrap: wrap; row-gap: 1px; white-space: normal; }
}
