:root {
  /* токены сняты с vshtab.ru — см. DESIGN.md */
  --ink: #16181d;
  --accent: #001aff;
  --accent-soft: #e4e8ff;
  --paper: #ffffff;
  --muted: #5b6068;
  --hairline: #e4e7ec;
  --glass: rgba(18, 20, 30, 0.55);
  --on-dark: #ffffff;
  --on-dark-2: rgba(255, 255, 255, 0.78);
  --on-dark-3: rgba(255, 255, 255, 0.45);
  --edge: rgba(255, 255, 255, 0.18);
  --pill: 999px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--on-dark);
  font-family: Manrope, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }

#app {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: 100%;
}

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

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--ink);
  border-right: 1px solid var(--edge);
}

.brand, .meta, .list-title { padding: 24px 24px 0; }

.brand { padding-bottom: 4px; }

.eyebrow {
  margin: 0 0 14px;
  color: var(--on-dark-3);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
}

.host {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  font-family: Montserrat, Manrope, sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--on-dark);
}

.host::before {
  content: "";
  width: 22px;
  height: 3px;
  border-radius: var(--pill);
  background: var(--accent);
}

.brand h1 {
  margin: 0 0 10px;
  font-family: Montserrat, Manrope, sans-serif;
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.lede {
  margin: 0;
  color: var(--on-dark-2);
  font-size: 13.5px;
  line-height: 1.5;
}

/* ---------- поиск ---------- */

/* заголовок списка на месте бывшей строки поиска */
.list-title { padding-top: 22px; margin-bottom: 10px; }

.search > span {
  display: block;
  margin-bottom: 8px;
  color: var(--on-dark-3);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  font-weight: 600;
}

.search input {
  width: 100%;
  padding: 12px 18px;
  border-radius: var(--pill);
  border: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.07);
  color: var(--on-dark);
  outline: none;
  transition: border-color 0.16s, background 0.16s;
}

.search input::placeholder { color: var(--on-dark-3); }

.search input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.12);
}

/* ---------- список корпусов ---------- */

.list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 18px 0 0;
  padding: 0 14px 14px;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: var(--edge) transparent;
}

.list li { margin-bottom: 2px; }

.list button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  transition: background 0.14s;
}

.list button:hover { background: rgba(255, 255, 255, 0.07); }

.list button strong {
  display: block;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.list button small {
  display: block;
  margin-top: 2px;
  color: var(--on-dark-3);
  font-size: 11.5px;
}

.list li.active button { background: var(--accent); }
.list li.active button small { color: var(--accent-soft); }

.list .empty {
  padding: 14px;
  color: var(--on-dark-3);
  font-size: 13px;
}

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

.meta {
  padding: 16px 24px 22px;
  border-top: 1px solid var(--edge);
}

#stats {
  margin: 0 0 14px;
  color: var(--on-dark-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.actions { display: flex; gap: 8px; }

.actions button {
  flex: 1;
  padding: 11px 14px;
  border-radius: var(--pill);
  border: 1px solid var(--edge);
  background: transparent;
  color: var(--on-dark);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s;
}

.actions button:hover { background: rgba(255, 255, 255, 0.08); }

#reset {
  background: var(--accent);
  border-color: var(--accent);
}

#reset:hover { background: #0014cc; border-color: #0014cc; }

.actions button[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--ink);
}

/* ---------- сцена ---------- */

.stage { position: relative; min-width: 0; }

#view { display: block; width: 100%; height: 100%; }

.hint {
  position: absolute;
  left: 18px;
  bottom: 16px;
  padding: 8px 16px;
  border-radius: var(--pill);
  border: 1px solid var(--edge);
  background: var(--glass);
  backdrop-filter: blur(10px);
  color: var(--on-dark-2);
  font-size: 12px;
  pointer-events: none;
}

/* ---------- загрузка ---------- */

.loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--ink);
  transition: opacity 0.4s;
}

.loader.hidden { opacity: 0; pointer-events: none; }

.loader-card { width: min(380px, 78vw); text-align: left; }

.loader-card h2 {
  margin: 0 0 20px;
  font-family: Montserrat, Manrope, sans-serif;
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.bar {
  height: 4px;
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: var(--pill);
  background: var(--accent);
  transition: width 0.25s;
}

#loader-text {
  margin: 12px 0 0;
  color: var(--on-dark-3);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

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

@media (max-width: 860px) {
  #app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .panel { border-right: 0; border-bottom: 1px solid var(--edge); max-height: 46vh; }
  .brand h1 { font-size: 26px; }
}
