:root {
  --bg: #eef1f5;
  --surface: #ffffff;
  --logo-bg: #1a2332;
  --logo-text: #ffffff;
  --border: #d0d7de;
  --border-soft: #eaeef2;
  --text: #24292f;
  --muted: #57606a;
  --ok: #1a7f37;
  --fail: #cf222e;
  --warn: #9a6700;
  --accent: #0969da;
  --radius: 12px;
  --shell-max: 1320px;
  --col-about: 240px;
  --col-side: 260px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}

.page {
  width: min(var(--shell-max), calc(100% - 24px));
  max-width: var(--shell-max);
  margin: 24px auto 32px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(26, 35, 50, 0.12);
  border-radius: var(--radius);
  overflow: hidden;
}

.check-progress {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: #f6f8fa;
}

.check-progress[hidden] {
  display: none;
}

.check-progress-status {
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.progress-track {
  height: 10px;
  background: var(--border-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #4da3ff);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.check-progress-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.site-logo {
  background: var(--logo-bg);
  color: var(--logo-text);
  padding: 20px 28px;
  text-align: center;
}

.logo-link {
  display: inline-block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.logo-link:hover .logo-title {
  opacity: 0.88;
}

.logo-title {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
}

.telegram-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
}

.telegram-link:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.52);
}

.telegram-link--footer {
  margin-top: 0;
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.06);
}

.telegram-link--footer:hover {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.55);
}

.site-footer {
  padding: 18px 28px 22px;
  text-align: center;
  background: var(--surface);
  border-top: 1px solid var(--border-soft);
}

.site-footer-label {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.shell {
  background: var(--surface);
}

.layout-3 {
  display: grid;
  grid-template-columns: 1fr var(--col-about);
  align-items: stretch;
  min-height: 520px;
}

.layout-3.has-results {
  min-height: min(88vh, 920px);
}

.layout-3.has-results .block-main {
  min-height: 0;
}

.layout-3.has-results #liveResults {
  flex: 1;
  min-height: 0;
}

.block-form {
  display: contents;
}

.block-about {
  padding: 20px 18px 24px;
  background: #f6f8fa;
  border-left: 1px solid var(--border-soft);
}

.about-toggle {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
}

.about-toggle-label {
  display: block;
  margin: 0 0 4px;
}

.about-toggle-icon {
  display: none;
}

.about-body[hidden] {
  display: none !important;
}

.block-main {
  padding: 18px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  min-height: 0;
}

#liveResults {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

#liveResults[hidden] {
  display: none;
}

#checkAlerts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#checkAlerts:empty {
  display: none;
}

#checkEmpty {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

#checkEmpty[hidden] {
  display: none;
}

#checkEmpty > .panel-chart-empty {
  margin: 0;
  flex-shrink: 0;
}

#checkEmpty > .empty {
  flex: 0 0 auto;
  margin: 0;
  min-height: 72px;
}

.block-locations {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  font-size: 0.74rem;
}

.block-locations .block-heading {
  font-size: 0.7rem;
}

.block-locations .sidebar-hint {
  font-size: 0.7rem;
  line-height: 1.35;
}

.block-locations .picker-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: none;
  overflow: visible;
  padding-bottom: 0;
}

.block-locations .picker-item-city {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 9px;
  padding: 6px 0;
  border: none;
  border-bottom: 1px solid var(--border-soft);
  border-radius: 0;
  background: transparent;
}

.block-locations .picker-item-city:last-child {
  border-bottom: none;
}

.block-locations .picker-item-city:hover {
  border-color: var(--border-soft);
}

.block-locations .picker-city-name {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 0.74rem;
  font-weight: 600;
}

.block-locations .picker-city-name::after {
  content: ':';
  margin-left: 2px;
  font-weight: 600;
  color: var(--muted);
}

.block-locations .picker-op-panel {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.block-locations .picker-op-panel[hidden] {
  display: none;
}

.block-locations .picker-op-text {
  font-size: 0.72rem;
  gap: 5px;
  padding: 0;
}

.block-locations .picker-op-text input {
  width: 13px;
  height: 13px;
}

.block-locations .op-label {
  padding: 1px 6px;
  font-size: 0.72rem;
  line-height: 1.35;
}

.block-heading {
  margin: 0 0 4px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.about-lead {
  margin: 0 0 14px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}

.about-list {
  margin: 0 0 14px;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  color: var(--text);
}

.about-list li {
  margin-bottom: 10px;
}

.about-list strong {
  color: var(--text);
}

.about-text {
  margin: 0 0 12px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text);
}

.about-block {
  margin-bottom: 14px;
}

.about-block:last-of-type {
  margin-bottom: 16px;
}

.about-subtitle {
  margin: 0 0 6px;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

.about-faq details {
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fff;
}

.about-faq summary {
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

.about-faq details .about-text {
  margin: 8px 0 0;
  font-size: 0.82rem;
}

.about-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.check-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.check-bar input {
  flex: 1;
  min-width: 180px;
  height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1.05rem;
  font-family: Consolas, "Courier New", monospace;
}

.check-bar input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.15);
}

.btn-go {
  height: 44px;
  padding: 0 22px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn-go:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-go:hover:not(:disabled) {
  background: #0860ca;
}

.feature-note {
  margin: -8px 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--muted);
}

.sidebar-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sidebar-section + .sidebar-section {
  flex: 1;
  min-height: 0;
}

.picker-col-title {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.picker-ops-hint {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

.picker-ops-hint[hidden] {
  display: none;
}

.picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-x: visible;
  overflow-y: auto;
  max-height: min(420px, 55vh);
  padding-bottom: 28px;
}

.picker-item-city {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: #fff;
  overflow: hidden;
}

.picker-item-city:hover {
  border-color: var(--accent);
}

.picker-item-city.is-city-off .picker-op-panel {
  opacity: 0.45;
  pointer-events: none;
}

.picker-city-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 11px;
}

.picker-city-toggle {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  position: relative;
}

.picker-city-toggle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  margin: -5px 0 0 -4px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.picker-item-city.is-expanded .picker-city-toggle::before {
  margin-top: -2px;
  transform: rotate(45deg);
}

.picker-city-toggle:hover {
  border-color: var(--accent);
}

.block-locations .picker-city-toggle {
  display: none;
}

.picker-city-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

.picker-city-name {
  cursor: pointer;
}

.picker-city-check input {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.picker-op-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 11px 12px 38px;
  border-top: 1px solid var(--border-soft);
  background: #fafbfc;
}

.picker-op-panel[hidden] {
  display: none;
}

.picker-op-text {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.3;
  padding: 4px 0;
}

.picker-op-text input {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.op-label {
  position: relative;
  z-index: 0;
  display: inline-block;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 2px;
  isolation: isolate;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.op-label::before,
.op-label::after {
  content: '';
  position: absolute;
  border-radius: inherit;
}

.op-label::before {
  inset: 0;
  z-index: -2;
}

.op-label::after {
  inset: 1px 2px;
  z-index: -1;
}

.op-label.op-beeline {
  color: #000;
}

.op-label.op-beeline::before {
  background: repeating-linear-gradient(
    -45deg,
    #e8ef00 0,
    #e8ef00 5px,
    #000 5px,
    #000 7px
  );
}

.op-label.op-beeline::after {
  background: #e8ef00;
}

.op-label.op-mts {
  color: #fff;
}

.op-label.op-mts::before {
  background: repeating-linear-gradient(
    -45deg,
    #b8040f 0,
    #b8040f 5px,
    #d4d4d4 5px,
    #d4d4d4 7px
  );
}

.op-label.op-mts::after {
  background: #b8040f;
}

.op-label.op-meg {
  color: #fff;
}

.op-label.op-meg::before {
  background: repeating-linear-gradient(
    -45deg,
    #007a3d 0,
    #007a3d 5px,
    #d4d4d4 5px,
    #d4d4d4 7px
  );
}

.op-label.op-meg::after {
  background: #007a3d;
}

.op-label.op-t2 {
  color: #fff;
}

.op-label.op-t2::before {
  background: repeating-linear-gradient(
    -45deg,
    #000 0,
    #000 4px,
    #fff 4px,
    #fff 6px,
    #ff4da6 6px,
    #ff4da6 8px,
    #000 8px,
    #000 10px
  );
}

.op-label.op-t2::after {
  background: #111;
}

.op-label.op-rt {
  color: #fff;
}

.op-label.op-rt::before {
  background: repeating-linear-gradient(
    -45deg,
    rgb(110, 75, 165) 0,
    rgb(110, 75, 165) 5px,
    rgb(180, 55, 12) 5px,
    rgb(180, 55, 12) 7px,
    #000 7px,
    #000 9px
  );
}

.op-label.op-rt::after {
  background: rgb(110, 75, 165);
}

.op-label.op-other {
  color: #334155;
}

.op-label.op-other::before {
  background: repeating-linear-gradient(
    -45deg,
    #e2e8f0 0,
    #e2e8f0 5px,
    #64748b 5px,
    #64748b 7px
  );
}

.op-label.op-other::after {
  background: #e2e8f0;
}

.block-locations .picker-op-text input:checked + .op-label {
  text-decoration: none;
}

.picker-op-text input:checked + .op-label {
  text-decoration: none;
}

.picker-op-text input:focus-visible + .op-label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.alert {
  flex-shrink: 0;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.95rem;
  border: 1px solid;
  word-break: break-word;
}

.alert-error {
  background: #ffebe9;
  border-color: #ff8182;
  color: #82071e;
}

.alert-warn {
  background: #fff8c5;
  border-color: #d4a72c;
  color: #633c01;
}

.summary {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  background: var(--bg);
}

.summary.is-ok {
  border-color: #86efac;
  background: linear-gradient(90deg, #f0fdf4, #fff);
}

.summary.is-fail {
  border-color: #fca5a5;
  background: linear-gradient(90deg, #fef2f2, #fff);
}

.summary.is-warn {
  border-color: #fde68a;
  background: linear-gradient(90deg, #fffbeb, #fff);
}

.summary-badge {
  font-size: 0.85rem;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 8px;
  flex-shrink: 0;
}

.summary.is-ok .summary-badge {
  background: #dafbe1;
  color: var(--ok);
}

.summary.is-fail .summary-badge {
  background: #ffebe9;
  color: var(--fail);
}

.summary.is-warn .summary-badge {
  background: #fff8c5;
  color: #9a6700;
}

.summary-main {
  min-width: min(100%, 200px);
  flex: 1 1 200px;
}

.summary-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 6px;
  word-break: break-word;
}

.summary-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-family: Consolas, "Courier New", monospace;
  word-break: break-word;
  line-height: 1.5;
}

.summary-stats {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.stat-pill {
  text-align: center;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border-soft);
  min-width: 52px;
}

.stat-pill b {
  display: block;
  font-size: 1.25rem;
  line-height: 1.1;
}

.stat-pill span {
  font-size: 0.62rem;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-pill.ok b {
  color: var(--ok);
}

.stat-pill.fail b {
  color: var(--fail);
}

.panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--bg);
  overflow: hidden;
}

.panel.panel-chart {
  overflow: auto;
}

.chart-head,
.chart-row {
  min-width: 760px;
}

.panel-title {
  flex-shrink: 0;
  padding: 10px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  border-bottom: 1px solid var(--border-soft);
  background: #fff;
}

.panel-chart {
  flex-shrink: 0;
  margin: 0;
}

.panel-chart-empty .chart-placeholder {
  margin: 0;
  padding: 24px 16px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}

.chart-head,
.chart-row {
  display: grid;
  grid-template-columns:
    minmax(120px, 1.1fr)
    78px
    repeat(4, minmax(48px, auto))
    minmax(48px, auto)
    minmax(52px, auto)
    36px;
  align-items: center;
  gap: 8px 8px;
  font-size: 0.85rem;
}

.chart-head {
  padding: 10px 16px 8px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: #fff;
  border-bottom: 1px solid var(--border-soft);
}

.chart-head-label {
  font-weight: 700;
}

.chart-head-stat,
.chart-stat {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.chart-head-pct {
  text-align: right;
}

.chart-head-bs {
  text-align: center;
}

.chart-stat {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 4px;
  min-width: 40px;
}

.chart-stat.is-ok {
  color: var(--ok);
  background: #dafbe1;
}

.chart-stat.is-fail {
  color: var(--fail);
  background: #ffebe9;
}

.chart-stat.is-muted {
  color: var(--muted);
  background: var(--border-soft);
}

.avail-chart {
  padding: 14px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
}

/* chart-row grid defined with .chart-head above */

.chart-action {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 28px;
}

.chart-retry-form {
  margin: 0;
  padding: 0;
}

.btn-chart-retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  cursor: pointer;
}

.btn-chart-retry:hover {
  border-color: var(--accent);
  background: #f0f6ff;
}

.btn-chart-retry:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon-retry {
  display: block;
}

.chart-label {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-head-bar {
  text-align: center;
  white-space: nowrap;
}

.chart-swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  justify-self: center;
  align-self: center;
  box-sizing: border-box;
}

.chart-bar {
  display: block;
  transition: background-color 0.25s ease, opacity 0.25s ease;
}

.chart-bar.is-bs {
  background: #2da44e;
}

.chart-bar.is-partial {
  background: #bf8700;
}

.chart-bar.is-off {
  background: #cf222e;
}

.chart-bar.is-blocked {
  background: #a40e26;
}

.chart-bar.is-nofilter {
  background: #6e7781;
}

.chart-bar.is-proxy {
  background: #8250df;
}

.chart-bar.is-pending {
  background: #d0d7de;
  animation: chart-pending 1.2s ease-in-out infinite alternate;
}

.chart-row.is-pending .chart-pct,
.chart-row.is-pending .chart-bs {
  color: #8c959f;
}

.result-line.is-pending {
  opacity: 0.75;
}

.result-line.is-pending .line-dot {
  background: #d0d7de;
}

@keyframes chart-pending {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

.chart-bar.is-reach {
  background: #c9b56a;
  border: 1px dashed #7a5a00;
}

.chart-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: right;
  min-width: 40px;
}

.chart-row .chart-bs {
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
  padding: 2px 4px;
  border-radius: 4px;
  background: var(--border-soft);
  color: var(--muted);
  min-width: 52px;
}

.chart-row:has(.chart-bar.is-bs) .chart-bs {
  background: #dafbe1;
  color: var(--ok);
}

.chart-row:has(.chart-bar.is-reach) .chart-bs {
  background: #fff8c5;
  color: #9a6700;
}

.chart-row:has(.chart-bar.is-blocked) .chart-bs {
  background: #ffebe9;
  color: #cf222e;
}

.chart-row:has(.chart-bar.is-nofilter) .chart-bs {
  background: #eaeef2;
  color: #57606a;
}

.legend-dot.is-blocked {
  background: linear-gradient(90deg, #a40e26, #cf222e);
}

.legend-dot.is-nofilter {
  background: #6e7781;
}

.legend-dot.is-proxy {
  background: #8250df;
}

.legend-dot.is-pending {
  background: #d0d7de;
}

.legend-dot.is-reach {
  background: #d4a72c;
}

.result-line.is-warn {
  border-color: #d4a72c;
  background: #fffbeb;
}

.result-line.is-warn .line-dot {
  background: #9a6700;
}

.chart-legend {
  margin: 0;
  padding: 8px 16px 12px;
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  background: #fff;
  border-top: 1px solid var(--border-soft);
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}

.legend-dot.is-bs {
  background: var(--ok);
}

.legend-dot.is-partial {
  background: #bf8700;
}

.legend-dot.is-off {
  background: var(--fail);
}

.main-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  min-height: 0;
  margin: 0;
}

.layout-3.has-results .main-stack {
  flex: 1;
  min-height: 0;
}

.panel-results {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.panel-results-toolbar {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  background: #fff;
}

.panel-results .result-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  max-height: none;
}

.log-box-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.btn-copy {
  height: 32px;
  padding: 0 14px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.btn-copy:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.result-list {
  list-style: none;
  margin: 0;
  padding: 10px 12px;
}

.result-line {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: #fff;
  font-size: 0.92rem;
  line-height: 1.4;
}

.result-line:last-child {
  margin-bottom: 0;
}

.result-line.is-ok {
  border-color: #b7e4c7;
  background: #f6fffa;
}

.result-line.is-fail {
  border-color: #ffcdd2;
  background: #fff8f8;
}

.line-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.result-line.is-ok .line-dot {
  background: var(--ok);
}

.result-line.is-fail .line-dot {
  background: var(--fail);
}

.line-text {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  word-break: break-word;
}

.log-box {
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: none;
  resize: none;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text);
  background: #fff;
  outline: none;
  overflow: auto;
  white-space: pre;
  word-break: break-all;
}

.log-box:focus {
  box-shadow: inset 0 0 0 2px rgba(9, 105, 218, 0.2);
}

.empty {
  flex: 1;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 20px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  text-align: center;
}

@media (min-width: 1025px) {
  .about-toggle {
    pointer-events: none;
    cursor: default;
  }

  .about-body {
    display: block !important;
  }

  .about-body[hidden] {
    display: block !important;
  }
}

@media (max-width: 1024px) {
  .layout-3 {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .block-about {
    order: -1;
    border-left: none;
    border-top: none;
    border-bottom: 1px solid var(--border-soft);
    padding: 12px 16px;
  }

  .block-main {
    padding: 14px 16px 20px;
  }

  .block-about.is-expanded {
    padding-bottom: 20px;
  }

  .about-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 4px 0;
    cursor: pointer;
  }

  .about-toggle-label {
    margin: 0;
  }

  .about-toggle-icon {
    display: block;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    position: relative;
  }

  .about-toggle-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    margin: -5px 0 0 -4px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
  }

  .about-toggle[aria-expanded="true"] .about-toggle-icon::before {
    margin-top: -2px;
    transform: rotate(-135deg);
  }

  .about-body {
    padding-top: 12px;
  }

  .block-locations .picker-item-city {
    gap: 5px 8px;
  }

  .block-locations .picker-op-panel {
    flex-basis: 100%;
    padding-left: 0;
  }
}

@media (max-width: 640px) {
  .page {
    width: calc(100% - 16px);
    margin: 12px auto 20px;
  }

  .summary-stats {
    width: 100%;
    justify-content: center;
  }

  .block-main {
    gap: 12px;
    padding: 12px 12px 16px;
  }

  .block-locations {
    gap: 5px;
    font-size: 0.66rem;
  }

  .block-locations .block-heading,
  .block-locations .sidebar-hint {
    font-size: 0.64rem;
  }

  .block-locations .picker-item-city {
    gap: 4px 7px;
    padding: 5px 0;
  }

  .block-locations .picker-city-toggle {
    display: inline-flex;
    width: 22px;
    height: 22px;
    border-radius: 6px;
  }

  .block-locations .picker-city-toggle::before {
    width: 6px;
    height: 6px;
    margin: -4px 0 0 -4px;
  }

  .block-locations .picker-city-name {
    font-size: 0.66rem;
  }

  .block-locations .picker-op-panel {
    flex-basis: 100%;
    gap: 4px 7px;
    padding-left: 29px;
  }

  .block-locations .picker-op-text {
    font-size: 0.64rem;
    gap: 4px;
  }

  .block-locations .picker-op-text input {
    width: 12px;
    height: 12px;
  }

  .block-locations .op-label {
    padding: 1px 5px;
    font-size: 0.64rem;
  }

  .check-bar {
    gap: 8px;
  }

  .check-bar input,
  .btn-go {
    width: 100%;
  }

  .check-progress,
  .summary,
  .empty {
    padding: 12px;
  }

  .panel.panel-chart {
    overflow: visible;
  }

  .chart-head,
  .chart-row {
    min-width: 0;
  }

  .chart-head {
    display: grid;
    grid-template-columns:
      minmax(0, 1fr)
      18px
      repeat(4, minmax(31px, auto))
      minmax(38px, auto)
      minmax(42px, auto)
      28px;
    gap: 6px 4px;
    padding: 8px 10px 6px;
    font-size: 0;
    letter-spacing: 0;
  }

  .chart-head-label::before { content: 'Локация'; }
  .chart-head-bar::before { content: 'Цвет'; }
  .chart-head-pct::before { content: 'Итог'; }
  .chart-head-bs::before { content: 'БС'; }

  .chart-head-stat,
  .chart-head-label::before,
  .chart-head-bar::before,
  .chart-head-pct::before,
  .chart-head-bs::before {
    font-size: 0.54rem;
    line-height: 1.1;
  }

  .chart-head-stat {
    min-width: 31px;
  }

  .avail-chart {
    padding: 10px 10px 6px;
    gap: 8px;
  }

  .chart-row {
    grid-template-columns:
      minmax(0, 1fr)
      18px
      repeat(4, minmax(31px, auto))
      minmax(38px, auto)
      minmax(42px, auto)
      28px;
    gap: 6px 4px;
    font-size: 0.72rem;
  }

  .chart-label {
    min-width: 0;
  }

  .chart-swatch {
    width: 14px;
    height: 14px;
  }

  .chart-stat {
    min-width: 31px;
    padding: 2px 3px;
    font-size: 0.64rem;
  }

  .chart-pct {
    min-width: 38px;
    font-size: 0.68rem;
  }

  .chart-row .chart-bs {
    min-width: 42px;
    font-size: 0.6rem;
    padding: 2px 3px;
  }

  .chart-action {
    min-height: 24px;
  }

  .btn-chart-retry {
    width: 26px;
    height: 26px;
    border-radius: 7px;
  }

  .chart-legend {
    padding: 8px 10px 10px;
    gap: 8px 10px;
    font-size: 0.68rem;
  }

  .panel-results-toolbar {
    justify-content: stretch;
    padding: 8px 10px;
  }

  .btn-copy {
    width: 100%;
  }

  .result-list {
    padding: 8px;
  }

  .result-line {
    gap: 8px;
    padding: 8px;
    font-size: 0.78rem;
  }
}
