/* =========================================================================
   Orbita Admin — operations console
   A single, deliberately dark "cockpit" identity: near-black green-biased
   ground, one neon accent (#40E58A) spent only on intent, monospace for the
   things that are literally data (codes, tokens, IDs, traffic, counts).
   ========================================================================= */

:root {
  /* grounds */
  --bg-0: #080C0A;          /* app backdrop */
  --bg-1: #0C1210;          /* rail / gate */
  --bg-2: #0F1613;          /* panels */
  --bg-3: #131C18;          /* raised rows / inputs */
  --bg-hover: #17211C;

  /* hairlines */
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.12);
  --line-accent: rgba(64, 229, 138, 0.22);

  /* text */
  --tx-0: #EAF3EE;          /* primary */
  --tx-1: #9FB0A8;          /* secondary */
  --tx-2: #6B7C74;          /* muted */

  /* brand + semantic */
  --accent: #40E58A;
  --accent-dim: #2CB56C;
  --accent-glow: rgba(64, 229, 138, 0.18);
  --cyan: #47C7F0;
  --amber: #F5B841;
  --danger: #FF5C6C;
  --violet: #9E8BFF;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.85);
  --shadow-lg: 0 40px 120px -30px rgba(0, 0, 0, 0.9);

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

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--tx-0);
  background:
    radial-gradient(900px 620px at 14% -8%, rgba(64, 229, 138, 0.07), transparent 60%),
    radial-gradient(1000px 700px at 98% 0%, rgba(71, 199, 240, 0.05), transparent 55%),
    var(--bg-0);
  /*
   * Градиент — это фоновое ИЗОБРАЖЕНИЕ, а background-repeat по умолчанию repeat. Пока страница
   * помещалась в экран, это было незаметно; на длинной странице область отрисовки становится выше
   * картинки, и свечение начинало повторяться сверху вниз полосами.
   *
   * fixed привязывает область позиционирования к окну, а не к странице: подсветка остаётся в
   * верхних углах, как задумано, и при прокрутке не едет и не размножается.
   */
  background-repeat: no-repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
::selection { background: var(--accent-glow); }

/* ---- scrollbars ---- */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.14) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 20px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); background-clip: padding-box; }

/* =========================================================================
   Brand mark — globe cresting a downward parabola (app identity)
   ========================================================================= */
.mark { display: inline-block; line-height: 0; }
.mark svg { display: block; }

/* =========================================================================
   Login gate
   ========================================================================= */
.gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(700px 520px at 50% 12%, rgba(64, 229, 138, 0.10), transparent 60%),
    var(--bg-0);
  z-index: 60;
}
.gate-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 34px 30px 30px;
  box-shadow: var(--shadow-lg);
  animation: gate-in 520ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes gate-in { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }
.gate-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 26px; }
.gate-brand .name { font-weight: 700; letter-spacing: 0.14em; font-size: 15px; }
.gate-brand .sub { display: block; font-size: 11px; letter-spacing: 0.28em; color: var(--tx-2); text-transform: uppercase; margin-top: 2px; }
.gate h1 { font-size: 22px; margin: 0 0 6px; letter-spacing: -0.01em; }
.gate p.lead { margin: 0 0 22px; color: var(--tx-1); font-size: 13.5px; }
.gate .field { margin-bottom: 14px; }
.gate .hint { display: flex; align-items: center; gap: 8px; color: var(--tx-2); font-size: 12px; margin-top: 16px; }
.gate .hint .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); flex: none; }
.gate-error { color: var(--danger); font-size: 13px; margin: 4px 2px 0; min-height: 18px; }

/* =========================================================================
   App shell
   ========================================================================= */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.rail {
  position: sticky; top: 0; align-self: start;
  height: 100vh;
  display: flex; flex-direction: column;
  gap: 4px;
  padding: 22px 16px;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  border-right: 1px solid var(--line);
}
.rail-brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 22px; }
.rail-brand .name { font-weight: 700; letter-spacing: 0.14em; font-size: 14px; }
.rail-brand .sub { display: block; font-size: 10px; letter-spacing: 0.26em; color: var(--tx-2); text-transform: uppercase; margin-top: 3px; }
.rail-nav { display: flex; flex-direction: column; gap: 3px; }
.rail-nav button {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 11px 12px;
  background: transparent; border: 0; border-radius: var(--radius-sm);
  color: var(--tx-1); font-size: 14px; font-weight: 500;
  cursor: pointer; text-align: left;
  transition: background 140ms ease, color 140ms ease;
}
.rail-nav button svg { width: 18px; height: 18px; flex: none; opacity: 0.85; }
.rail-nav button:hover { background: var(--bg-hover); color: var(--tx-0); }
.rail-nav button.active { background: var(--bg-3); color: var(--tx-0); box-shadow: inset 2px 0 0 var(--accent); }
.rail-nav button.active svg { color: var(--accent); opacity: 1; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 16px; }
.rail-status { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--tx-2); padding: 0 8px; }
.rail-status .beat { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent-glow); animation: beat 2.4s infinite; flex: none; }
@keyframes beat { 0% { box-shadow: 0 0 0 0 rgba(64,229,138,0.5);} 70% { box-shadow: 0 0 0 8px rgba(64,229,138,0);} 100% { box-shadow: 0 0 0 0 rgba(64,229,138,0);} }
.rail-logout {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--line); color: var(--tx-1);
  font-size: 13px; cursor: pointer; transition: all 140ms ease;
}
.rail-logout:hover { border-color: var(--line-strong); color: var(--tx-0); background: var(--bg-hover); }

.workspace { min-width: 0; padding: 26px 32px 60px; }

/* ---- view header ---- */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.view-head .eyebrow { font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent-dim); margin: 0 0 8px; font-weight: 600; }
.view-head h1 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.view-head p.sub { margin: 8px 0 0; color: var(--tx-1); font-size: 14px; max-width: 62ch; }

/* =========================================================================
   Buttons / fields / pills — shared atoms
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--bg-3); color: var(--tx-0);
  font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: transform 90ms ease, background 140ms ease, border-color 140ms ease, opacity 140ms ease;
}
.btn:hover { background: var(--bg-hover); border-color: var(--line-accent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-accent { background: var(--accent); border-color: transparent; color: #05140C; box-shadow: 0 10px 26px -12px var(--accent-glow); }
.btn-accent:hover { background: #55ed98; border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-danger { background: transparent; border-color: rgba(255,92,108,0.32); color: #ff8c97; }
.btn-danger:hover { background: rgba(255,92,108,0.10); border-color: rgba(255,92,108,0.55); }
.btn-sm { padding: 7px 11px; font-size: 12.5px; border-radius: 9px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 12px; color: var(--tx-1); font-weight: 500; letter-spacing: 0.01em; }
.field input, .field select {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm);
  background: var(--bg-3); border: 1px solid var(--line);
  color: var(--tx-0); font-size: 14px; outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.field input::placeholder { color: var(--tx-2); }
.field input:focus, .field select:focus { border-color: var(--line-accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.field select { appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239FB0A8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid transparent; white-space: nowrap;
}
.pill .pdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok      { color: var(--accent); background: rgba(64,229,138,0.10); border-color: rgba(64,229,138,0.22); }
.pill.trial   { color: var(--cyan);   background: rgba(71,199,240,0.10); border-color: rgba(71,199,240,0.22); }
.pill.admin   { color: var(--violet); background: rgba(158,139,255,0.12); border-color: rgba(158,139,255,0.26); }
.pill.warn    { color: var(--amber);  background: rgba(245,184,65,0.10); border-color: rgba(245,184,65,0.24); }
.pill.off     { color: var(--tx-2);   background: rgba(255,255,255,0.04); border-color: var(--line); }
.pill.danger  { color: var(--danger); background: rgba(255,92,108,0.10); border-color: rgba(255,92,108,0.24); }

/* =========================================================================
   Metric cards
   ========================================================================= */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.metric {
  position: relative; overflow: hidden;
  padding: 18px 18px 16px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
}
.metric::after { content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 2px; background: linear-gradient(90deg, var(--accent), transparent 55%); opacity: 0.5; }
.metric.c-cyan::after   { background: linear-gradient(90deg, var(--cyan), transparent 55%); }
.metric.c-amber::after  { background: linear-gradient(90deg, var(--amber), transparent 55%); }
.metric.c-violet::after { background: linear-gradient(90deg, var(--violet), transparent 55%); }
.metric .k { font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--tx-2); font-weight: 600; }
.metric .v { display: block; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin: 10px 0 3px; font-variant-numeric: tabular-nums; }
.metric .c { font-size: 12.5px; color: var(--tx-1); }

/* =========================================================================
   Panels + tables
   ========================================================================= */
.panel { background: linear-gradient(180deg, var(--bg-2), var(--bg-1)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel + .panel { margin-top: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 16px; letter-spacing: -0.01em; }
.panel-head .eyebrow { font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--tx-2); margin: 0 0 5px; font-weight: 600; }

.toolbar { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 220px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--tx-2); pointer-events: none; }
.search input {
  width: 100%; padding: 11px 14px 11px 40px; border-radius: var(--radius-pill);
  background: var(--bg-3); border: 1px solid var(--line); color: var(--tx-0); font-size: 14px; outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.search input:focus { border-color: var(--line-accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.chip-count { font-size: 12.5px; color: var(--tx-2); white-space: nowrap; }

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl thead th {
  text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--tx-2); font-weight: 600; padding: 12px 18px;
  background: var(--bg-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tbl tbody td { padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl tbody tr.clickable { cursor: pointer; transition: background 120ms ease; }
table.tbl tbody tr.clickable:hover { background: var(--bg-hover); }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl .u-cell { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #05140C;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
}
.avatar.muted { background: var(--bg-3); color: var(--tx-1); border: 1px solid var(--line); }
.u-handle { font-weight: 600; font-family: var(--font-mono); font-size: 13px; }
.u-id { font-size: 11px; color: var(--tx-2); font-family: var(--font-mono); margin-top: 2px; }
.cell-muted { color: var(--tx-2); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

.empty { padding: 46px 20px; text-align: center; color: var(--tx-2); font-size: 13.5px; }
.empty .big { display: block; font-size: 15px; color: var(--tx-1); margin-bottom: 4px; }

/* =========================================================================
   Two-column + forms (promo)
   ========================================================================= */
.grid-2 { display: grid; grid-template-columns: minmax(0, 380px) 1fr; gap: 20px; align-items: start; }
.form-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.seg { display: inline-flex; padding: 3px; background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius-pill); }
.seg button { padding: 7px 14px; border: 0; background: transparent; color: var(--tx-1); font-size: 12.5px; font-weight: 600; border-radius: var(--radius-pill); cursor: pointer; transition: all 140ms ease; }
.seg button.on { background: var(--accent); color: #05140C; }
.note-line { font-size: 12px; color: var(--tx-2); line-height: 1.5; }

.result {
  margin: 0 20px 20px; padding: 14px 16px; border-radius: var(--radius-sm);
  background: rgba(64,229,138,0.06); border: 1px dashed var(--line-accent);
  font-size: 13px; color: var(--tx-1); display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.result .code { font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: var(--accent); letter-spacing: 0.04em; }
.result.err { background: rgba(255,92,108,0.06); border-color: rgba(255,92,108,0.3); }

/* =========================================================================
   Drawer (user detail)
   ========================================================================= */
.scrim { position: fixed; inset: 0; background: rgba(3, 6, 5, 0.62); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity 240ms ease; z-index: 40; }
.scrim.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(520px, 100%);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border-left: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  transform: translateX(102%); transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50; display: flex; flex-direction: column;
}
.drawer.show { transform: none; }
.drawer-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 22px 18px; border-bottom: 1px solid var(--line); }
.drawer-head .avatar { width: 46px; height: 46px; border-radius: 13px; font-size: 17px; }
.drawer-head .who { flex: 1; min-width: 0; }
.drawer-head .who h3 { margin: 0 0 4px; font-size: 17px; font-family: var(--font-mono); word-break: break-all; }
.drawer-head .who .meta { font-size: 12px; color: var(--tx-2); font-family: var(--font-mono); word-break: break-all; }
.drawer-close { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--bg-3); border: 1px solid var(--line); color: var(--tx-1); cursor: pointer; }
.drawer-close:hover { color: var(--tx-0); border-color: var(--line-strong); }
.drawer-body { overflow-y: auto; padding: 20px 22px 30px; display: flex; flex-direction: column; gap: 22px; }

.d-section > .d-title { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--tx-2); font-weight: 600; margin: 0 0 12px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 13px; }
.stat .l { font-size: 11px; color: var(--tx-2); text-transform: uppercase; letter-spacing: 0.06em; }
.stat .n { font-size: 18px; font-weight: 700; margin-top: 5px; font-variant-numeric: tabular-nums; }
.stat .n.sm { font-size: 14px; font-weight: 600; }

.kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv .kk { color: var(--tx-1); }
.kv .vv { color: var(--tx-0); font-weight: 500; text-align: right; }

.dev-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; }
.dev-row .dn { font-size: 13.5px; font-weight: 600; }
.dev-row .dm { font-size: 11.5px; color: var(--tx-2); margin-top: 2px; }

.event-row { display: flex; gap: 12px; padding: 8px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.event-row:last-child { border-bottom: 0; }
.event-row .et { color: var(--tx-2); font-family: var(--font-mono); font-size: 11.5px; white-space: nowrap; }
.event-row .ed { color: var(--tx-0); }

.action-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 15px; display: flex; flex-direction: column; gap: 13px; }

/* =========================================================================
   Toast
   ========================================================================= */
.toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 80; }
.toast {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--bg-3); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); font-size: 13.5px; min-width: 240px; max-width: 380px;
  animation: toast-in 260ms cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.out { animation: toast-out 200ms ease forwards; }
.toast .ic { width: 20px; height: 20px; flex: none; display: grid; place-items: center; }
.toast.ok .ic { color: var(--accent); }
.toast.err .ic { color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }

/* ---- skeleton loading ---- */
.skel { position: relative; overflow: hidden; background: var(--bg-3); border-radius: 6px; display: inline-block; }
.skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* =========================================================================
   Modal — the one blocking overlay (add server, edit, confirm)
   ========================================================================= */
.modal-host { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; }
.modal-host[hidden] { display: none; }
.modal-scrim { position: absolute; inset: 0; background: rgba(3, 6, 5, 0.66); backdrop-filter: blur(4px); opacity: 0; transition: opacity 200ms ease; }
.modal-host.show .modal-scrim { opacity: 1; }
.modal-card {
  position: relative;
  width: min(var(--modal-w, 480px), 100%);
  max-height: min(86vh, 860px);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line-strong); border-radius: 20px;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(12px) scale(0.98);
  transition: opacity 200ms ease, transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-host.show .modal-card { opacity: 1; transform: none; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 22px 22px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 18px; letter-spacing: -0.01em; }
.modal-head .eyebrow { font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent-dim); margin: 0 0 6px; font-weight: 600; }
.modal-body { overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px 20px; border-top: 1px solid var(--line); }
.modal-lead { margin: 0; color: var(--tx-1); font-size: 14px; line-height: 1.55; }

.callout { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.5; }
.callout svg { flex: none; margin-top: 1px; }
.callout.danger { background: rgba(255,92,108,0.08); border: 1px solid rgba(255,92,108,0.26); color: #ffa3ac; }
.callout.info { background: rgba(71,199,240,0.07); border: 1px solid rgba(71,199,240,0.22); color: var(--tx-1); }
.callout.accent { background: rgba(64,229,138,0.06); border: 1px solid var(--line-accent); color: var(--tx-1); }
.callout.warn { background: rgba(240,180,71,0.07); border: 1px solid rgba(240,180,71,0.26); color: #f3c778; }
.callout.ok   { background: rgba(64,229,138,0.07); border: 1px solid var(--line-accent); color: var(--tx-1); }

/* ---- служебное: приглушённый текст и блок с адресами для копирования ---- */
.dim { color: var(--tx-2); }
.codeblock {
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg-3); border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px;
  line-height: 1.9; color: var(--tx-1);
  /* Адреса длинные и не переносятся по словам: без собственной прокрутки они растянули бы
     панель и уронили бы разметку всей страницы. */
  overflow-x: auto; white-space: nowrap;
}
.codeblock .dim { display: inline-block; min-width: 58px; }

/* ---- field validation ---- */
.field .err { font-size: 11.5px; color: var(--danger); min-height: 14px; }
.field input.invalid, .field select.invalid, .field textarea.invalid { border-color: rgba(255,92,108,0.55); box-shadow: 0 0 0 3px rgba(255,92,108,0.12); }
.field textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm); resize: vertical; min-height: 74px;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--tx-0); font-size: 14px; outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.field textarea:focus { border-color: var(--line-accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.field .suffix-wrap { position: relative; }
.field .suffix-wrap input { padding-right: 46px; }
.field .suffix-wrap .suffix { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--tx-2); font-size: 13px; pointer-events: none; }

/* ---- role picker: radio cards ---- */
.pick-grid { display: grid; gap: 10px; }
.pick {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  padding: 13px 14px; border-radius: var(--radius-sm);
  background: var(--bg-3); border: 1px solid var(--line);
  transition: border-color 140ms ease, background 140ms ease;
}
.pick:hover { border-color: var(--line-strong); }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick .dot { width: 17px; height: 17px; border-radius: 50%; border: 2px solid var(--tx-2); flex: none; margin-top: 2px; display: grid; place-items: center; transition: border-color 140ms ease; }
.pick .dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1); }
.pick .t { font-size: 13.5px; font-weight: 600; }
.pick .d { font-size: 12px; color: var(--tx-2); margin-top: 3px; line-height: 1.45; }
.pick:has(input:checked) { border-color: var(--line-accent); background: rgba(64,229,138,0.05); }
.pick:has(input:checked) .dot { border-color: var(--accent); }
.pick:has(input:checked) .dot::after { transform: scale(1); }
.pick:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-glow); }

/* =========================================================================
   Save bar — a sticky, honest "you have unsaved changes" footer
   ========================================================================= */
.savebar {
  position: sticky; bottom: 0; z-index: 5;
  margin-top: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px 18px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(19,28,24,0.94), rgba(12,18,16,0.98));
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(10px);
  box-shadow: 0 -10px 40px -24px rgba(0,0,0,0.9);
}
.savebar .state { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--tx-1); }
.savebar .state .mark { width: 8px; height: 8px; border-radius: 50%; background: var(--tx-2); flex: none; }
.savebar.dirty .state .mark { background: var(--amber); box-shadow: 0 0 10px rgba(245,184,65,0.5); }
.savebar.saved .state .mark { background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.savebar .acts { display: flex; gap: 10px; }

/* =========================================================================
   Tariffs — plan price cards + period rows
   ========================================================================= */
.plan-card {
  display: grid; grid-template-columns: 1fr auto; gap: 14px 16px; align-items: center;
  padding: 16px 18px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--line);
  transition: border-color 140ms ease;
}
.plan-card:hover { border-color: var(--line-strong); }
.plan-card .who { min-width: 0; }
.plan-card .who .nm { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; }
.plan-card .who .meta { font-size: 12px; color: var(--tx-2); margin-top: 4px; }
.plan-card .price { width: 148px; }
.plan-card .preview { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 7px; padding-top: 13px; border-top: 1px dashed var(--line); }
.tag {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 5px 10px; border-radius: var(--radius-pill);
  background: var(--bg-3); border: 1px solid var(--line); font-size: 12px; color: var(--tx-1);
}
.tag b { font-variant-numeric: tabular-nums; color: var(--tx-0); font-weight: 650; }
.tag .was { text-decoration: line-through; color: var(--tx-2); font-size: 11px; }
.tag.off { opacity: 0.55; }
/* Статусы заказа. Цвет здесь несёт смысл, а не украшает: «требует возврата» означает, что деньги
   пришли, а услуга не выдана, и оператор обязан заметить это в списке из сотни строк. */
.tag.ok   { background: rgba(64,229,138,0.10); border-color: var(--line-accent); color: var(--accent); }
.tag.warn { background: rgba(240,180,71,0.10); border-color: rgba(240,180,71,0.30); color: #f3c778; }
.tag.err  { background: rgba(255,92,108,0.12); border-color: rgba(255,92,108,0.34); color: #ffa3ac; font-weight: 650; }

.period-card {
  display: grid; grid-template-columns: 92px 1fr 110px auto; gap: 12px; align-items: end;
  padding: 14px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--line);
}
.period-card .kill { align-self: center; margin-bottom: 2px; }
.icon-btn {
  width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line); color: var(--tx-2); cursor: pointer;
  transition: all 140ms ease;
}
.icon-btn:hover { color: var(--tx-0); border-color: var(--line-strong); background: var(--bg-hover); }
.icon-btn.danger:hover { color: #ff8c97; border-color: rgba(255,92,108,0.5); background: rgba(255,92,108,0.09); }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* =========================================================================
   Links — one card per destination, with a live test
   ========================================================================= */
.link-card { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 16px 18px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line); }
.link-card .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--bg-3); border: 1px solid var(--line); color: var(--accent); }
.link-card .hd .t { font-size: 14px; font-weight: 600; }
.link-card .hd .d { font-size: 12px; color: var(--tx-2); margin-top: 3px; line-height: 1.45; }
.link-card .row { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; }
.link-card .row .field { flex: 1; min-width: 0; }

/* =========================================================================
   Servers — fleet cards
   ========================================================================= */
.fleet { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.node {
  display: flex; flex-direction: column; gap: 14px;
  padding: 17px 18px 15px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.node:hover { border-color: var(--line-accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.node:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.node .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.node .code { font-family: var(--font-mono); font-size: 14.5px; font-weight: 650; word-break: break-all; }
.node .label { font-size: 12.5px; color: var(--tx-1); margin-top: 3px; }
.node .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 14px; }
.node .fact .l { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tx-2); font-weight: 600; }
.node .fact .v { font-size: 13px; margin-top: 3px; }
.node .fact .v.mono { font-family: var(--font-mono); font-size: 12.5px; }
.node .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--tx-2); }

.role {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 7px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid transparent; white-space: nowrap;
}
.role svg { width: 12px; height: 12px; }
.role.exit  { color: var(--accent); background: rgba(64,229,138,0.10); border-color: rgba(64,229,138,0.24); }
.role.proxy { color: var(--cyan);   background: rgba(71,199,240,0.10); border-color: rgba(71,199,240,0.24); }
.role.other { color: var(--violet); background: rgba(158,139,255,0.10); border-color: rgba(158,139,255,0.24); }

.load { display: flex; flex-direction: column; gap: 6px; }
.load .hdr { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--tx-2); }
.load .hdr b { color: var(--tx-0); font-variant-numeric: tabular-nums; font-weight: 650; font-size: 13px; }
.load .track { height: 6px; border-radius: 999px; background: var(--bg-3); overflow: hidden; border: 1px solid var(--line); }
.load .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-dim), var(--accent)); transition: width 320ms cubic-bezier(0.16, 1, 0.3, 1); }
.load .fill.warm { background: linear-gradient(90deg, #c99a2e, var(--amber)); }
.load .fill.hot  { background: linear-gradient(90deg, #d1495b, var(--danger)); }
.load .fill.idle { background: var(--bg-hover); }

.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter {
  padding: 7px 12px; border-radius: var(--radius-pill); cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--tx-1);
  font-size: 12.5px; font-weight: 600; transition: all 140ms ease;
}
.filter:hover { border-color: var(--line-strong); color: var(--tx-0); }
.filter.on { background: var(--bg-3); border-color: var(--line-accent); color: var(--tx-0); }
.filter .n { color: var(--tx-2); font-weight: 500; margin-left: 5px; font-variant-numeric: tabular-nums; }

/* server drawer bits */
.drawer-head .node-mark { width: 46px; height: 46px; border-radius: 13px; flex: none; display: grid; place-items: center; background: var(--bg-3); border: 1px solid var(--line-accent); color: var(--accent); }
.profile-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; }
.profile-row .pn { font-size: 13px; font-weight: 600; font-family: var(--font-mono); }
.profile-row .pm { font-size: 11.5px; color: var(--tx-2); margin-top: 2px; font-family: var(--font-mono); }
.task-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.task-row:last-child { border-bottom: 0; }
.task-row .tt { font-family: var(--font-mono); font-size: 12.5px; }
.task-row .tm { font-size: 11.5px; color: var(--tx-2); margin-top: 2px; }
.danger-zone { border: 1px solid rgba(255,92,108,0.24); background: rgba(255,92,108,0.04); border-radius: var(--radius-sm); padding: 15px; display: flex; flex-direction: column; gap: 11px; }
.danger-zone .t { font-size: 13.5px; font-weight: 600; color: #ff8c97; }
.danger-zone .d { font-size: 12.5px; color: var(--tx-1); line-height: 1.5; }

.btn-row { display: flex; gap: 9px; flex-wrap: wrap; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 14px; }
  .rail-brand { padding: 4px 6px 4px; }
  .rail-nav { flex-direction: row; flex-wrap: wrap; }
  .rail-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; padding-top: 0; }
  .rail-status { display: none; }
  .workspace { padding: 20px 16px 50px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .metrics { grid-template-columns: 1fr; }
  .view-head { flex-direction: column; align-items: flex-start; }
  .form-row { grid-template-columns: 1fr; }
  .fleet { grid-template-columns: 1fr; }
  .plan-card { grid-template-columns: 1fr; align-items: stretch; }
  .plan-card .price { width: 100%; }
  .period-card { grid-template-columns: 1fr 1fr; }
  .period-card .lbl { grid-column: 1 / -1; }
  .savebar { flex-direction: column; align-items: stretch; }
  .savebar .acts { justify-content: flex-end; }
  .modal-host { padding: 12px; }
}
/* ---- whitelisted entry block (Серверы) -----------------------------------
   Only shown for the entry role, so it reads as a distinct region rather than six
   more inputs in the same stack: its own hairline, its own legend, its own ground. */
.entry-block {
  margin-top: 4px;
  padding: 14px 14px 4px;
  border: 1px solid var(--line-accent);
  border-radius: var(--radius);
  background: var(--bg-3);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.entry-block[hidden], .entry-block.hidden { display: none; }
.entry-block legend {
  padding: 0 8px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.entry-block .hint { margin: 0; font-size: 12px; line-height: 1.5; color: var(--tx-2); }
.entry-block .hint b { color: var(--tx-1); font-weight: 600; }
.entry-block .check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--tx-0);
  cursor: pointer;
}
.entry-block .check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* =========================================================================
   Сообщения · Новости · Технические работы
   Ни одного нового цвета: всё берётся из токенов сверху. Единственное
   исключение — индиго режима работ, и оно намеренно чужеродно: этот экран
   обязан читаться как "не норма" с расстояния.
   ========================================================================= */

/* --- общие мелочи, которых до сих пор не было ---------------------------- */
.form-body > * + * { margin-top: 16px; }
.field-block { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 12px; color: var(--tx-1); font-weight: 500; }
.field > span .counter { float: right; font-style: normal; color: var(--tx-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.hint-line { font-size: 11.5px; color: var(--tx-2); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--tx-1); cursor: pointer; }
.check-row input { width: auto; accent-color: var(--accent); }
.empty-note { padding: 22px 20px; color: var(--tx-2); font-size: 13px; text-align: center; }
.editor-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.cover-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-wrap { flex-wrap: wrap; }
.rail-sep { height: 1px; background: var(--line); margin: 10px 12px; }

/* --- Сообщения ----------------------------------------------------------- */
.msg-grid, .news-grid, .mnt-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start;
}
@media (max-width: 1100px) {
  .msg-grid, .news-grid, .mnt-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Предпросмотр повторяет карточку из приложения: цветная риска слева и два
   уровня текста. Тон читается риской, а не заливкой — заливка на тёмном фоне
   спорит с акцентом панели. */
.msg-preview {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--bg-3); border: 1px solid var(--line); position: relative; overflow: hidden;
}
.msg-preview-dot { width: 3px; border-radius: 2px; background: var(--tx-2); flex: none; }
.msg-preview.kind-info .msg-preview-dot { background: var(--cyan); }
.msg-preview.kind-success .msg-preview-dot { background: var(--accent); }
.msg-preview.kind-warning .msg-preview-dot { background: var(--amber); }
.msg-preview.kind-promo .msg-preview-dot { background: var(--violet); }
.msg-preview-text { min-width: 0; }
.msg-preview-text .t { font-size: 14px; font-weight: 600; color: var(--tx-0); line-height: 1.35; }
.msg-preview-text .b { margin-top: 5px; font-size: 12.5px; color: var(--tx-1); line-height: 1.5; white-space: pre-wrap; }
.msg-preview-text .b.muted { color: var(--tx-2); font-style: italic; }

.sent-list { max-height: 640px; overflow-y: auto; }
.sent-row {
  display: flex; gap: 14px; align-items: flex-start; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
}
.sent-row:last-child { border-bottom: 0; }
.sent-main { min-width: 0; }
.sent-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sent-aud { font-size: 11.5px; color: var(--tx-2); }
.sent-title { margin-top: 6px; font-size: 13.5px; font-weight: 600; color: var(--tx-0); }
.sent-body { margin-top: 4px; font-size: 12.5px; color: var(--tx-1); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sent-side { display: flex; align-items: center; gap: 10px; flex: none; }
.sent-time { font-size: 11.5px; color: var(--tx-2); white-space: nowrap; }

/* --- Новости ------------------------------------------------------------- */
.news-list { max-height: 720px; overflow-y: auto; }
.news-row {
  display: flex; gap: 13px; width: 100%; text-align: left; align-items: center;
  padding: 13px 20px; background: transparent; border: 0; border-bottom: 1px solid var(--line);
  color: inherit; cursor: pointer; transition: background 140ms ease;
}
.news-row:last-child { border-bottom: 0; }
.news-row:hover { background: var(--bg-hover); }
.news-row.active { background: var(--bg-3); box-shadow: inset 2px 0 0 var(--accent); }
.news-thumb {
  width: 54px; height: 40px; border-radius: 8px; flex: none;
  background: var(--bg-3) center/cover no-repeat; border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--tx-2);
}
.news-thumb.has-image { border-color: var(--line-strong); }
.news-row-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.news-row-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.news-row-title { font-size: 13.5px; font-weight: 600; color: var(--tx-0);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-row-meta { font-size: 11.5px; color: var(--tx-2); }
.news-tag {
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
  color: var(--tx-1); background: var(--bg-hover); border: 1px solid var(--line);
  padding: 2px 7px; border-radius: var(--radius-pill);
}

.news-preview { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-3); }
/* contain, а не cover: приложение показывает баннер целиком, и превью, которое его обрезает,
   заставляло бы оператора компоновать картинку под кроп, которого больше нет. */
.news-preview-cover {
  display: block; width: 100%; height: auto; max-height: 260px; object-fit: contain;
  background: rgba(64, 229, 138, 0.10); border-bottom: 1px solid var(--line);
}
.news-preview-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.news-preview-body .t { font-size: 15px; font-weight: 650; color: var(--tx-0); line-height: 1.3; }
/* Приложение клампит анонс тремя строками — превью обязано клампить так же. */
.news-preview-body .e { font-size: 12.5px; color: var(--tx-1); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cover-missing { outline: 1px dashed rgba(255, 92, 108, 0.5); }

/* Предпросмотр открытой статьи — та же вёрстка, что в приложении: обложка, метка капсом,
   заголовок 22sp, дата, тело с межстрочником 1.45 и подсвеченными ссылками. */
.news-read { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-1);
  padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.news-read-cover { display: block; width: 100%; height: auto; max-height: 320px; object-fit: contain;
  border-radius: 10px; background: rgba(64, 229, 138, 0.10); }
.news-read-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.news-read-title { font-size: 20px; font-weight: 700; color: var(--tx-0); line-height: 1.18; }
.news-read-date { font-size: 11.5px; color: var(--tx-2); }
.news-read-body { font-size: 13px; color: var(--tx-0); line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.news-read-body .lnk { color: var(--accent); }

/* Предпросмотр шторки: заголовок ≤65, текст ≤240 — ровно те обрезки, что делает приложение. */
.notif-preview { border: 1px solid var(--line-strong); border-radius: 14px; background: var(--bg-3);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; }
.notif-head { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--tx-2); }
.notif-app { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; }
.notif-title { font-size: 13.5px; font-weight: 700; color: var(--tx-0); }
.notif-text { font-size: 12.5px; color: var(--tx-1); line-height: 1.45; }

.head-acts { display: flex; gap: 8px; }
#newsCount.warn { color: var(--amber); }

/* --- Технические работы -------------------------------------------------- */
.mnt-toggle {
  display: flex; align-items: center; gap: 13px; width: 100%; padding: 14px 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--bg-3); color: var(--tx-0); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 160ms ease;
}
.mnt-toggle:hover { background: var(--bg-hover); }
.mnt-toggle .knob {
  width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center;
  background: rgba(255,255,255,0.05); color: var(--tx-1); transition: all 160ms ease;
}
.mnt-toggle.on { border-color: rgba(245,184,65,0.45); background: rgba(245,184,65,0.08); }
.mnt-toggle.on .knob { background: rgba(245,184,65,0.16); color: var(--amber); }
.mnt-since { font-size: 12px; color: var(--tx-2); font-variant-numeric: tabular-nums; }

/* Миниатюра главного экрана в режиме работ: небо, туча, разряд, глобус.
   Индиго нарочно не из палитры "Оформление" в приложении: там занята лазурь
   #38BDF8, а этот тон холоднее и темнее — режим работ нельзя спутать с темой. */
.mnt-preview {
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
  background: linear-gradient(180deg, #0a1030, #0b1424 55%, var(--bg-1));
}
.mnt-sky { position: relative; height: 190px; }
.mnt-globe {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  width: 96px; height: 96px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, rgba(76,110,245,0.55), rgba(10,16,48,0.9) 68%);
  border: 1px solid rgba(76,110,245,0.5);
  box-shadow: 0 0 46px rgba(76,110,245,0.28);
}
.mnt-cloud {
  position: absolute; left: 50%; top: 22px; transform: translateX(-50%);
  width: 120px; height: 34px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(120,140,200,0.4), rgba(50,64,120,0.5));
  box-shadow: -26px 6px 0 -6px rgba(110,130,190,0.34), 28px 4px 0 -4px rgba(110,130,190,0.34);
}
.mnt-bolt {
  position: absolute; left: 50%; top: 56px; width: 3px; height: 44px; transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(160,190,255,0.95), rgba(76,110,245,0));
  filter: drop-shadow(0 0 6px rgba(150,180,255,0.8));
  animation: mnt-strike 6.5s ease-in-out infinite;
  opacity: 0;
}
/* Разряд редкий и неровный: две вспышки подряд, потом долгая пауза — ровное
   мигание читалось бы как индикатор загрузки, а не как гроза. */
@keyframes mnt-strike {
  0%, 4%, 100% { opacity: 0; }
  5% { opacity: 1; }
  7% { opacity: 0.1; }
  9% { opacity: 0.85; }
  12% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .mnt-bolt { animation: none; opacity: 0.35; } }

.mnt-copy { padding: 16px 18px 20px; text-align: center; border-top: 1px solid var(--line); }
.mnt-title { font-size: 15px; font-weight: 700; color: #AFC0FF; letter-spacing: 0.01em; }
.mnt-body { margin-top: 7px; font-size: 12.5px; color: var(--tx-1); line-height: 1.55; white-space: pre-wrap; }

/* Блок «как сообщить о статье»: сегменты выбора и скрытие текстов в режиме «молча». */
.notify-block .seg { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
/* Переменных --muted/--on-accent/--text в :root нет: невалидный var() даёт не откат к
   предыдущему правилу, а unset — то есть наследование от body. Из-за этого выбранный режим
   был почти белым на неоново-зелёном (контраст ~1.3:1), а невыбранные не отличались от него. */
.notify-block .seg button {
  flex: 1 1 auto; min-width: 132px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: transparent; color: var(--tx-2);
  font: inherit; font-size: 13px; cursor: pointer; transition: color .18s, border-color .18s, background .18s;
}
.notify-block .seg button.on { background: var(--accent); border-color: transparent; color: #05140C; }
.notify-block .seg button:not(.on):hover { color: var(--tx-0); border-color: var(--accent); }
.field.off, .field-block.off { opacity: .45; pointer-events: none; }
.field .hint, .field-block .hint { margin: 6px 0 0; font-size: 12px; line-height: 1.45; color: var(--tx-2); }


/* ---------------------------------------------------------- карточка тарифа
   Три яруса: кто и почём · пункты описания · как это увидит пользователь.
   Права тарифа показаны отдельными чипами и намеренно нередактируемы — оператор должен видеть,
   что число устройств и порог трафика живут не здесь. */
.plan-card { display: block; }
.plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.plan-head .price { max-width: 170px; }
.chips-ro { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.chip-ro {
  font-size: 11px; line-height: 1; padding: 5px 9px; border-radius: 999px;
  background: var(--bg-3); color: var(--tx-1); border: 1px solid var(--line);
}
.chip-ro.hint { background: transparent; border-style: dashed; }

.plan-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.plan-section .sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }

.feature-list { display: flex; flex-direction: column; gap: 8px; }
.feature-row { display: flex; align-items: center; gap: 10px; }
.feature-row .ord {
  flex: 0 0 22px; text-align: center; font-size: 11px; color: var(--tx-2);
  font-variant-numeric: tabular-nums;
}
.feature-row input {
  flex: 1 1 auto; min-width: 0; padding: 9px 12px; border-radius: 10px;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--tx-0); font-size: 13px;
}
.feature-row input:focus { outline: none; border-color: var(--accent); }
.feature-acts { display: flex; gap: 4px; }
/* Своего .icon-btn здесь больше нет: дубль перебивал канонический выше по файлу и на неописанных
   переменных гасил и приглушённый цвет, и hover у кнопок «Обновить»/«Удалить» во всех вкладках.
   Компактный размер задаётся модификатором, а не переопределением всего класса. */
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; font-size: 14px; line-height: 1; }
.feature-empty { margin: 0; font-size: 12.5px; color: var(--tx-2); }

/* Предпросмотр повторяет карточку приложения: галочка и текст, ничего больше. */
.plan-preview { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; }
.plan-preview .tick { display: flex; gap: 8px; align-items: baseline; font-size: 13px; color: var(--tx-0); }
.plan-preview .tick i { color: var(--accent); font-style: normal; }
.plan-preview .muted { color: var(--tx-2); font-size: 12.5px; }

/* --- Обновления ---------------------------------------------------------- */
.rel-progress { height: 6px; border-radius: 999px; background: var(--bg-3); overflow: hidden; margin-top: 8px; }
.rel-progress span { display: block; height: 100%; background: var(--accent); transition: width 160ms ease; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
td.right { text-align: right; white-space: nowrap; }
td.right > * + * { margin-left: 6px; }
#relHost .field-block + .field-block { margin-top: 18px; }
#relHost textarea { width: 100%; font-family: var(--font-mono); font-size: 12px; }
#relHost textarea + textarea { margin-top: 10px; }

/* Тариф, снятый с продажи: карточка гаснет целиком, чтобы её нельзя было спутать с активной. */
.plan-card.plan-off { opacity: .55; }
.plan-card.plan-off .plan-price { text-decoration: line-through; }
