/*
  Оформление панели.

  Правила, из которых всё вытекает: открывают её с телефона и в плохой момент,
  поэтому крупные цели для пальца, спокойный контраст и никакой «тревожной»
  раскраски там, где всё в порядке. Тема следует за системной.
*/

:root {
  color-scheme: light dark;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e3e6eb;
  --border-strong: #cfd4dc;

  --text: #16181d;
  --text-dim: #5c6270;
  --text-faint: #8b91a0;

  --accent: #3b5bdb;
  --accent-text: #ffffff;
  --accent-soft: #e8ecfb;

  --ok: #2f9e5e;
  --ok-soft: #e4f4ea;
  --warn: #b8860b;
  --warn-soft: #fbf1da;
  --down: #d0433b;
  --down-soft: #fbe7e6;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 20, 30, .06), 0 4px 16px rgba(16, 20, 30, .06);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --surface: #1c1f25;
    --surface-2: #23272e;
    --border: #2c313a;
    --border-strong: #3a4049;

    --text: #e8eaee;
    --text-dim: #a2a9b6;
    --text-faint: #737b8a;

    --accent: #7590ff;
    --accent-text: #10131a;
    --accent-soft: #232a45;

    --ok: #59c98a;
    --ok-soft: #1b2f24;
    --warn: #e0b64b;
    --warn-soft: #302819;
    --down: #f0736a;
    --down-soft: #33201f;

    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }

/*
  Атрибут `hidden` прячет через display:none в стилях браузера, а любой наш
  собственный display (у экрана входа — grid, у приложения — flex) оказывается
  сильнее и показывает спрятанное. Без этой строки форма входа и само
  приложение видны одновременно.
*/
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ─────────────────────────────── Вход ─────────────────────────────── */

.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gate form {
  width: min(380px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}

.gate h1 {
  margin: 0 0 6px;
  font-size: 21px;
  letter-spacing: -.01em;
}

.gate p {
  margin: 0 0 20px;
  color: var(--text-dim);
  font-size: 14px;
}

/* ───────────────────────────── Каркас ─────────────────────────────── */

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar .brand {
  font-weight: 640;
  letter-spacing: -.01em;
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar .brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 17px;
  flex: none;
  transition: background .15s, border-color .15s;
}

.icon-btn:hover { background: var(--surface-2); }
.icon-btn:disabled { cursor: default; }

/* Идёт опрос состояния: значок обновления крутится. */
.icon-btn.spinning { color: var(--text-faint); }
.icon-btn.spinning { animation: spin 1.1s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.main {
  flex: 1;
  display: flex;
  min-height: 0;
}

.content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ──────────────────────── Боковая: разговоры ──────────────────────── */

.side {
  width: 268px;
  flex: none;
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.side header {
  padding: 12px 14px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.side header b {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-faint);
  margin-right: auto;
}

.chat-list {
  overflow-y: auto;
  padding: 4px 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  color: var(--text);
  transition: background .12s;
}

.chat-item:hover { background: var(--surface-2); }
.chat-item[aria-current="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 560; }

.chat-item .t {
  display: block;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-item .d {
  display: block;
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 1px;
}

/* ────────────────────────── Главная: статус ───────────────────────── */

.scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 18px 16px 28px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 15px;
  min-width: 0;
}

.card .k {
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card .v {
  font-size: 17px;
  font-weight: 600;
  margin-top: 5px;
  letter-spacing: -.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card .s {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--text-faint);
}

.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.down { background: var(--down); }
.dot.pulse { animation: pulse 1.4s ease-in-out infinite; }

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

/* Заметный блок: вход в Клода, деньги на исходе, ветка отстала. */
.notice {
  border-radius: var(--radius);
  padding: 15px 17px;
  margin-bottom: 16px;
  border: 1px solid;
  display: flex;
  gap: 13px;
  align-items: flex-start;
}

.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 32%, transparent); }
.notice.down { background: var(--down-soft); border-color: color-mix(in srgb, var(--down) 32%, transparent); }
.notice.info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 28%, transparent); }

.notice .body { flex: 1; min-width: 0; }
.notice b { display: block; margin-bottom: 3px; letter-spacing: -.01em; }
.notice p { margin: 0; font-size: 14px; color: var(--text-dim); }
.notice .em { font-size: 21px; line-height: 1.2; flex: none; }

h2.sec {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-faint);
  margin: 22px 0 10px;
  font-weight: 600;
}

/* Сценарии — главные кнопки панели. */
.scenarios {
  display: grid;
  gap: 9px;
}

.scenario {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px;
  transition: border-color .15s, transform .06s, box-shadow .15s;
}

.scenario:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.scenario:active { transform: scale(.994); }

.scenario .em { font-size: 22px; flex: none; }
.scenario .t { font-weight: 570; letter-spacing: -.01em; }
.scenario .d { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.scenario .arrow { margin-left: auto; color: var(--text-faint); flex: none; }

/* ──────────────────────────── Разговор ────────────────────────────── */

.feed {
  max-width: 780px;
  margin: 0 auto;
  padding: 18px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg { display: flex; flex-direction: column; }
.msg.user { align-items: flex-end; }

.bubble {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg.assistant .body {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.msg.user img {
  max-width: 190px;
  border-radius: 12px;
  margin-bottom: 6px;
  display: block;
}

/* Разметка ответа */
.body p { margin: 0 0 11px; }
.body p:last-child { margin-bottom: 0; }
.body ul, .body ol { margin: 0 0 11px; padding-left: 22px; }
.body li { margin: 3px 0; }
.body h1, .body h2, .body h3 { font-size: 16px; margin: 16px 0 8px; letter-spacing: -.01em; }
.body code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}
.body pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  overflow-x: auto;
  margin: 0 0 11px;
}
.body pre code { background: none; border: 0; padding: 0; font-size: 13px; }
.body a { color: var(--accent); }
.body strong { font-weight: 620; }

/* Карточка инструмента: что помощник делает руками. */
.tool {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 14px;
}

.tool summary {
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  list-style: none;
  color: var(--text-dim);
}

.tool summary::-webkit-details-marker { display: none; }
.tool summary .t { color: var(--text); font-weight: 520; }
.tool summary .d {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.tool pre {
  margin: 0;
  padding: 11px 13px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Строка о сверке с веткой. */
.repo-line {
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.thinking {
  font-size: 13px;
  color: var(--text-faint);
  font-style: italic;
  white-space: pre-wrap;
  border-left: 2px solid var(--border-strong);
  padding-left: 11px;
  margin-bottom: 4px;
}

.typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  color: var(--text-faint);
  font-size: 14px;
}

.typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1.3s infinite;
}

.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }

@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* ───────────────────────────── Ввод ───────────────────────────────── */

.composer {
  position: sticky;
  bottom: 0;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}

.composer .inner {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.composer textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 11px 13px;
  max-height: 168px;
  min-height: 44px;
  outline: none;
  transition: border-color .15s;
}

.composer textarea:focus { border-color: var(--accent); }

.thumbs {
  max-width: 780px;
  margin: 0 auto 8px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.thumbs figure {
  margin: 0;
  position: relative;
}

.thumbs img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 9px;
  display: block;
  border: 1px solid var(--border);
}

.thumbs button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 12px;
  line-height: 1;
  padding: 0;
}

/* ─────────────────────────── Элементы ─────────────────────────────── */

.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 15px;
  font-weight: 530;
  transition: background .15s, border-color .15s, opacity .15s;
}

.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.btn.primary:hover { filter: brightness(1.06); background: var(--accent); }
.btn.wide { width: 100%; }
.btn.send { width: 44px; height: 44px; padding: 0; flex: none; display: grid; place-items: center; font-size: 17px; }

.field {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  outline: none;
  margin-bottom: 11px;
}

.field:focus { border-color: var(--accent); }

.err {
  color: var(--down);
  font-size: 14px;
  margin: 10px 0 0;
  min-height: 20px;
}

.muted { color: var(--text-dim); font-size: 14px; }
.center { text-align: center; }

/* ───────────────────────── Окно поверх ────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 12, 18, .5);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal .sheet {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  max-height: 88dvh;
  overflow-y: auto;
}

.modal h3 { margin: 0 0 6px; letter-spacing: -.01em; }
.modal .steps { margin: 0 0 16px; padding-left: 20px; color: var(--text-dim); font-size: 14px; }
.modal .steps li { margin: 5px 0; }

.linkbox {
  display: block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-family: var(--mono);
  font-size: 12px;
  overflow-wrap: anywhere;
  margin-bottom: 13px;
  color: var(--accent);
}

.row { display: flex; gap: 9px; }
.row > * { flex: 1; }

/* ───────────────────────────── Телефон ────────────────────────────── */

@media (max-width: 760px) {
  .side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: 82vw;
    max-width: 300px;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow);
  }

  .side.open { transform: none; }

  .scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(10, 12, 18, .45);
  }

  .cards { grid-template-columns: repeat(2, 1fr); }
  .bubble { max-width: 92%; }
}

@media (min-width: 761px) {
  .scrim { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ─────────────── Куда смотрят клубы (внешний DNS панели) ─────────────── */

/* Карточка на главной, которая открывает управление. */
.card.clickable {
  cursor: pointer;
  transition: border-color .15s ease, transform .1s ease;
}
.card.clickable:hover { border-color: var(--border-strong); }
.card.clickable:active { transform: scale(.99); }

.dns-club {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  margin-top: 10px;
}

.dns-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

/* Куда город смотрит прямо сейчас — цветом, чтобы читалось одним взглядом. */
.pill {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }

.dns-why {
  font-size: 12.5px;
  opacity: .7;
  margin-top: 3px;
}

.dns-ips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 9px 0;
}

/* Внешний адрес клуба; крестик отвязывает. Каналов у клуба может быть
   несколько, поэтому это список, а не одно поле. */
.ipchip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 3px 5px 3px 10px;
  font-size: 12.5px;
}
.ipchip button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0 4px;
  opacity: .55;
  color: inherit;
}
.ipchip button:hover { opacity: 1; }

.dns-club .row { gap: 6px; }
.dns-club .row .btn { flex: 1; padding: 7px 4px; font-size: 13px; }
.dns-club select.field { flex: 1; margin: 0; }

/* ───────────── Главная и разговоры «как в Клоде» (23.09) ───────────── */

/* Боковая: «Новый чат» и «История» над списком. */
.side-actions {
  padding: 12px 10px 4px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.side-actions .btn { text-align: center; text-decoration: none; display: block; }

.chat-item { display: flex; align-items: center; gap: 6px; }
.chat-item .txt { flex: 1; min-width: 0; }
.chat-item .pin { font-size: 11px; color: var(--text-faint); flex: none; }
.chat-item .more {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--text-faint);
  border-radius: 7px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity .12s, background .12s;
}
.chat-item:hover .more, .chat-item[aria-current="true"] .more { opacity: 1; }
.chat-item .more:hover { background: var(--surface-2); color: var(--text); }
@media (hover: none) { .chat-item .more { opacity: .7; } }

/* Две большие кнопки сверху главной. */
.home-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.big-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px;
  min-height: 72px;
  transition: border-color .15s, box-shadow .15s, transform .06s;
}
.big-btn:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.big-btn:active { transform: scale(.994); }
.big-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.big-btn .em { font-size: 24px; line-height: 1; flex: none; }
.big-btn b { display: block; font-size: 16px; letter-spacing: -.01em; }
.big-btn small { display: block; font-size: 12.5px; opacity: .78; margin-top: 2px; }
@media (max-width: 480px) { .home-actions { grid-template-columns: 1fr; } }

/* Всплывающее меню разговора (переименовать / закрепить / удалить). */
.popover {
  position: fixed;
  z-index: 70;
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 5px;
}
.popover button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 14px;
}
.popover button:hover { background: var(--surface-2); }
.popover button.danger { color: var(--down); }
.popover-scrim { position: fixed; inset: 0; z-index: 65; }

/* История чатов. */
.history-head { display: flex; gap: 9px; margin-bottom: 12px; }
.history-head .field { margin: 0; flex: 1; }
.history-head .btn { flex: none; white-space: nowrap; }
.history-group {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-faint);
  margin: 16px 0 6px;
  font-weight: 600;
}
.history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  margin-bottom: 7px;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s;
}
.history-row:hover { border-color: var(--border-strong); }
.history-row .txt { flex: 1; min-width: 0; }
.history-row .t { font-weight: 560; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-row .p { font-size: 13px; color: var(--text-dim); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.history-row .d { font-size: 12px; color: var(--text-faint); flex: none; }
.history-row .more { flex: none; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; width: 30px; height: 30px; display: grid; place-items: center; color: var(--text-dim); }

/* Стартовый экран нового чата: «Что случилось?» */
.starter { display: grid; gap: 9px; }
.starter .hint { font-size: 14px; color: var(--text-dim); margin: 6px 0 4px; }

/* ───────────────────── Серверы (как «Серверы» в Щите) ───────────────────── */

.srv {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 15px;
  margin-bottom: 10px;
}
.srv .head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.srv .head b { font-size: 15px; letter-spacing: -.01em; }
.srv .line { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.srv .line.ok { color: var(--ok); }
.srv .line.warn { color: var(--warn); }
.srv .line.down { color: var(--down); }
.srv .ctrls { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; align-items: flex-end; }
.srv .ctrl { display: flex; flex-direction: column; gap: 4px; }
.srv .ctrl label { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; }
.pill.down { background: var(--down-soft); color: var(--down); font-weight: 600; }
.pill.info { background: var(--accent-soft); color: var(--accent); }
.pill.dim { background: var(--surface-2); color: var(--text-dim); }

/* Сегментный переключатель: Сам / МТС / Билайн, Сам / Клуб / Централь. */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 2px; background: var(--surface-2); }
.seg button {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 13px;
  font-weight: 540;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg button:disabled { opacity: .5; cursor: default; }

/* Тумблер. */
.toggle {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  border: 0;
  background: var(--border-strong);
  transition: background .15s;
  padding: 0;
}
.toggle[aria-checked="true"] { background: var(--ok); }
.toggle.sky[aria-checked="true"] { background: var(--accent); }
.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: left .15s;
}
.toggle[aria-checked="true"]::after { left: 21px; }
.toggle:disabled { opacity: .45; cursor: default; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.srv .foot { font-size: 12.5px; color: var(--text-faint); margin-top: 10px; }
