:root {
  color-scheme: dark;
  --bg: #030101;
  --bg-2: #080303;
  --ink: rgba(255, 255, 255, .95);
  --muted: rgba(255, 255, 255, .58);
  --faint: rgba(255, 255, 255, .36);
  --hair: rgba(255, 255, 255, .12);
  --hair-strong: rgba(255, 255, 255, .22);
  --glass: rgba(18, 17, 17, .58);
  --glass-2: rgba(255, 255, 255, .055);
  --red: #ff2a1f;
  --red-2: #ff6f62;
  --amber: #ffb05f;
  --radius: 18px;
  --radius-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Aptos Display", "Segoe UI", sans-serif;
  font-family: var(--font);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 54% -8%, rgba(255, 42, 31, .48), transparent 30rem),
    radial-gradient(circle at 92% 16%, rgba(255, 100, 82, .34), transparent 30rem),
    radial-gradient(circle at 70% 34%, rgba(255, 42, 31, .2), transparent 34rem),
    radial-gradient(circle at 10% 48%, rgba(255, 42, 31, .2), transparent 30rem),
    linear-gradient(180deg, #050101 0%, #0a0303 38%, #020101 100%);
  overflow-x: hidden;
}

body:before,
body:after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

body.locked {
  overflow: hidden;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 16%, rgba(255,42,31,.34), transparent 30rem),
    rgba(3,1,1,.9);
  backdrop-filter: blur(18px);
}

.login-gate.hidden {
  display: none;
}

.login-card {
  width: min(460px, 100%);
  border-radius: 22px;
  padding: 28px;
}

.login-card small {
  color: var(--red-2);
  letter-spacing: .2em;
  text-transform: uppercase;
}

.login-card h1 {
  margin: 12px 0 8px;
  font-size: 54px;
  line-height: .94;
}

.login-card p {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 22px;
}

.login-card button {
  width: 100%;
}

.legacy-login.hidden {
  display: none;
}

.telegram-login-widget {
  min-height: 48px;
  display: grid;
  place-items: center;
  margin: 22px 0 14px;
}

.telegram-login-widget iframe {
  max-width: 100%;
}

.login-status {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  color: rgba(255,255,255,.72);
  text-align: center;
  font-size: 14px;
  line-height: 1.35;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 12px;
  background: rgba(255,255,255,.055);
}

body:before {
  height: 1120px;
  opacity: .38;
  background:
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.024) 1px, transparent 1px);
  background-size: 92px 92px;
}

body:after {
  height: 980px;
  opacity: .48;
  background:
    linear-gradient(118deg, transparent 0 20%, rgba(255, 42, 31, .12) 28%, transparent 42% 100%),
    linear-gradient(72deg, transparent 0 56%, rgba(255, 95, 72, .14) 64%, transparent 78% 100%),
    radial-gradient(ellipse at 52% 18%, rgba(255, 42, 31, .16), transparent 44%);
}

button, input, textarea, select, a.button {
  font: inherit;
  color: var(--ink);
}

button, a.button, .file-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  background: rgba(255,255,255,.065);
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

button:hover, a.button:hover, .file-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 90, 77, .58);
  background: rgba(255,255,255,.105);
  box-shadow: 0 0 32px rgba(255, 42, 31, .18);
}

h1, h2, h3, p { margin-top: 0; }

.shell {
  width: min(1280px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 26px 0 128px;
  position: relative;
  z-index: 1;
}

.page { display: none; animation: page-in .32s ease-out both; }
.page.active { display: block; }

@keyframes page-in {
  from { opacity: 0; transform: translateY(12px); }
}

.glass {
  background:
    linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.035) 48%, rgba(255,42,31,.045)),
    rgba(8, 7, 7, .5);
  border: 1px solid rgba(255,255,255,.11);
  box-shadow:
    inset 0 1px rgba(255,255,255,.12),
    0 18px 58px rgba(0,0,0,.28);
}

.topbar {
  min-height: 58px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  margin-bottom: 68px;
}

.brand-link {
  color: var(--ink);
  text-decoration: none;
  font-size: 24px;
  line-height: 1;
  font-weight: 780;
}

.brand-link span,
.hero h1 span { color: var(--red); text-shadow: 0 0 32px rgba(255, 42, 31, .62); }

.top-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-links a {
  color: rgba(255,255,255,.76);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.115);
  background: rgba(255,255,255,.055);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
}

.top-links a:hover {
  color: #fff;
  border-color: rgba(255, 83, 70, .58);
  box-shadow: 0 0 34px rgba(255,42,31,.22);
}

.top-logout {
  min-height: 38px;
  padding: 9px 14px;
  color: rgba(255,255,255,.82);
  border-color: rgba(255, 42, 31, .32);
  background: rgba(255, 42, 31, .13);
}

.top-admin {
  min-height: 38px;
  padding: 9px 14px;
  border-color: rgba(255, 112, 92, .45);
  background: rgba(255, 255, 255, .09);
}

.hidden { display: none !important; }

.hero {
  min-height: 610px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: 72px;
  align-items: center;
  padding: 12px 0 86px;
  position: relative;
}

.hero-copy { min-width: 0; }

.hero:before {
  content: "";
  position: absolute;
  left: -4vw;
  right: -4vw;
  bottom: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,42,31,.52), rgba(255,255,255,.18), transparent);
}

.eyebrow,
.section-intro small,
.settings-strip small,
.page-head small {
  display: block;
  margin-bottom: 14px;
  color: var(--red-2);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 22px;
  font-size: 152px;
  line-height: .82;
  letter-spacing: 0;
  font-weight: 800;
}

.hero p {
  max-width: 640px;
  margin-bottom: 30px;
  color: rgba(255,255,255,.68);
  font-size: 23px;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.accent, .mega-run {
  background: linear-gradient(180deg, #ff655b 0%, #ff2a1f 46%, #bf1009 100%);
  border-color: rgba(255, 115, 103, .68);
  color: #fff;
  box-shadow:
    0 0 38px rgba(255, 42, 31, .46),
    0 0 110px rgba(255, 42, 31, .22);
}

.soft, .ghost {
  background: rgba(255,255,255,.065);
}

.robot-stage {
  position: relative;
  min-height: 520px;
  display: grid;
  place-items: center;
  overflow: visible;
  isolation: isolate;
  transform: translateX(-28px);
}

.robot-stage:before,
.robot-stage:after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

.robot-stage:before {
  width: min(680px, 92vw);
  height: 620px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 61, 46, .42), transparent 25%),
    radial-gradient(circle at 52% 52%, rgba(132, 8, 5, .34), transparent 58%),
    radial-gradient(ellipse at center, rgba(255, 255, 255, .055), transparent 64%);
}

.robot-stage:after {
  width: min(620px, 88vw);
  height: 520px;
  border-radius: 42% 58% 54% 46%;
  background:
    conic-gradient(from 218deg at 50% 52%, transparent 0 22deg, rgba(255, 58, 45, .22) 28deg 34deg, transparent 42deg 144deg, rgba(255, 255, 255, .07) 150deg 154deg, transparent 164deg 360deg),
    radial-gradient(circle at 50% 55%, rgba(255,42,31,.12), transparent 62%);
  opacity: .62;
}

.robot-orbit {
  position: absolute;
  width: 510px;
  height: 510px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 44% 56% 52% 48%;
  transform: rotate(-18deg);
  box-shadow: inset 0 0 54px rgba(255,42,31,.1), 0 0 96px rgba(255,42,31,.14);
}

.robot-glow {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 105, 92, .48), transparent 26%),
    radial-gradient(circle at 54% 50%, rgba(255,42,31,.3), transparent 64%),
    radial-gradient(circle at 28% 68%, rgba(255,130,90,.16), transparent 34%);
}

.spark {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff4a3e;
  box-shadow: 0 0 18px #ff2a1f, 0 0 44px rgba(255,42,31,.55);
  opacity: .5;
}

.spark-a { right: 22%; top: 23%; animation-delay: -.8s; }
.spark-b { right: 13%; bottom: 31%; width: 5px; height: 5px; animation-delay: -2.2s; }
.spark-c { left: 17%; bottom: 24%; width: 4px; height: 4px; animation-delay: -3.7s; }

.robot {
  --eye-x: 0px;
  --eye-y: 0px;
  position: relative;
  z-index: 1;
  width: min(430px, 88vw);
  aspect-ratio: 1122 / 1402;
  animation: robot-idle 6.8s ease-in-out infinite;
  transform-origin: 50% 68%;
  will-change: transform;
}

.robot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.robot-eyes {
  position: absolute;
  left: 24.8%;
  top: 27.7%;
  width: 50.4%;
  height: 21%;
  pointer-events: none;
}

.eye {
  position: absolute;
  width: 17%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #fff 0 9%, #ffb0a8 10% 21%, #ff2a1f 48%, rgba(255,42,31,.38) 74%),
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(0,0,0,.2) 4px 6px);
  transform: translate(var(--eye-x), var(--eye-y));
  transition: transform .08s linear;
  opacity: .98;
  box-shadow: 0 0 16px rgba(255,42,31,.86), 0 0 26px rgba(255,42,31,.42);
  animation: eye-pulse 2.8s ease-in-out infinite;
  will-change: transform;
}

.eye-left { left: 17.5%; top: 19%; }
.eye-right { right: 17.5%; top: 19%; animation-delay: -1.1s; }

.robot-eyes:after {
  content: "";
  position: absolute;
  left: 39%;
  top: 68%;
  width: 22%;
  height: 10%;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(180deg, rgba(255,114,105,.95), rgba(255,42,31,.88));
  box-shadow: 0 0 14px rgba(255,42,31,.58);
  transform-origin: center top;
  animation: mouth-talk 3.4s ease-in-out infinite;
}

@keyframes eye-pulse {
  50% { opacity: .88; transform: translate(var(--eye-x), var(--eye-y)) scale(1.04); }
}

@keyframes mouth-talk {
  0%, 100% { opacity: .95; transform: translateY(0) scaleX(1) scaleY(1); }
  34% { opacity: .84; transform: translateY(1px) scaleX(1.08) scaleY(.72); }
  62% { opacity: 1; transform: translateY(-1px) scaleX(.94) scaleY(1.08); }
}

@keyframes robot-idle {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  45% { transform: translate3d(0, -10px, 0) rotate(.7deg); }
  72% { transform: translate3d(0, -4px, 0) rotate(-.35deg); }
}

.stat-grid, .live-grid, .route-grid, .work-grid, .compact-grid {
  display: grid;
  gap: 24px;
}

.live-grid,
.settings-strip,
.route-grid {
  content-visibility: auto;
  contain-intrinsic-size: 720px;
}

.stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  gap: 22px;
  margin: 2px 0 122px;
}

.metric {
  min-height: 122px;
  border-radius: 18px;
  padding: 20px 22px;
  display: grid;
  align-content: space-between;
  border-color: rgba(255,255,255,.08);
  background:
    linear-gradient(135deg, rgba(255,255,255,.095), rgba(255,255,255,.026) 48%, rgba(255,42,31,.06)),
    radial-gradient(circle at 20% 8%, rgba(255, 42, 31, .18), transparent 56%),
    rgba(255,255,255,.032);
  box-shadow:
    inset 0 1px rgba(255,255,255,.08),
    0 18px 54px rgba(0,0,0,.22);
}

.metric small, .route small, .panel small, .settings-strip p, .page-head p {
  color: var(--muted);
}

.metric strong {
  font-size: clamp(46px, 5vw, 72px);
  line-height: .9;
  font-weight: 780;
}

.section-intro {
  margin: 0 0 26px;
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(260px, .42fr);
  gap: 28px;
  align-items: end;
}

.section-intro h2,
.settings-strip h2 {
  margin: 0;
  font-size: 60px;
  line-height: .92;
  letter-spacing: 0;
}

.section-intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.live-grid {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 118px;
}

.log-card, .panel, .settings-strip, .route, .toolbar, .table-wrap, .table-summary {
  border-radius: var(--radius);
  padding: 20px;
}

.log-card { min-height: 360px; }

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.card-title span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 18px var(--red);
}

.card-title h3 { margin: 0; font-size: 19px; }
.status-line { color: var(--red-2); margin-bottom: 12px; min-height: 20px; }

pre {
  min-height: 210px;
  max-height: 310px;
  overflow: auto;
  white-space: pre-wrap;
  margin: 0;
  padding: 16px;
  border-radius: 14px;
  background: rgba(0,0,0,.42);
  border: 1px solid rgba(255,255,255,.07);
  color: rgba(255,255,255,.75);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.settings-strip {
  margin: 0 0 110px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.settings-head {
  max-width: 760px;
}

.settings-strip p {
  margin: 14px 0 0;
  max-width: 430px;
  line-height: 1.48;
}

.settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.add-card {
  min-height: 58px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  text-align: left;
  padding: 10px 12px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.03)),
    rgba(0,0,0,.22);
}

.add-card span {
  grid-row: 1 / 3;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: rgba(255,42,31,.18);
  border: 1px solid rgba(255,42,31,.38);
  box-shadow: inset 0 1px rgba(255,255,255,.1), 0 0 24px rgba(255,42,31,.14);
  font-size: 19px;
  line-height: 1;
}

.add-card strong {
  min-width: 0;
  font-size: 14px;
  line-height: 1.12;
}

.add-card small {
  color: var(--muted);
  font-size: 11px;
}

.telegram-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.settings-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.mini-list {
  min-height: 150px;
}

.access-card {
  height: 100%;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.105);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.026)),
    rgba(0,0,0,.24);
}

.access-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.access-head small {
  margin: 0 0 7px;
  color: var(--red-2);
  letter-spacing: .18em;
  text-transform: uppercase;
}

.access-head strong {
  display: block;
  font-size: 23px;
  line-height: 1.02;
}

.access-count {
  min-width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(255,42,31,.16);
  border: 1px solid rgba(255,42,31,.34);
  color: #fff;
  font-size: 22px;
  font-weight: 760;
}

.access-list {
  display: grid;
  gap: 8px;
}

.access-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 30px;
  gap: 10px;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.075);
}

.access-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255,255,255,.78);
  font-size: 13px;
}

.access-row em {
  color: rgba(255,255,255,.48);
  font-style: normal;
  font-size: 12px;
  white-space: nowrap;
}

.delete-access {
  min-height: 30px;
  width: 30px;
  padding: 0;
  border-radius: 9px;
  color: rgba(255,255,255,.64);
  background: rgba(255,255,255,.045);
  border-color: rgba(255,255,255,.08);
}

.delete-access:hover {
  color: #fff;
  background: rgba(255,42,31,.18);
  border-color: rgba(255,42,31,.46);
}

.access-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.routes-heading { grid-template-columns: 1fr; margin-bottom: 20px; }

.route-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.route {
  min-height: 238px;
  text-align: left;
  display: grid;
  align-content: space-between;
  background:
    linear-gradient(150deg, rgba(255,255,255,.072), rgba(255,255,255,.025)),
    rgba(0,0,0,.2);
  border-color: rgba(255,255,255,.09);
}

.route:hover {
  background:
    linear-gradient(150deg, rgba(255,42,31,.18), rgba(255,255,255,.042)),
    rgba(0,0,0,.18);
}

.route strong {
  font-size: 34px;
  line-height: 1;
  max-width: 280px;
}

.route span {
  color: var(--muted);
  line-height: 1.42;
}

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  min-height: 170px;
  margin-bottom: 42px;
  padding: 56px 0 32px;
  border-bottom: 1px solid rgba(255,255,255,.09);
  position: relative;
}

.page-head .ghost {
  position: absolute;
  left: 0;
  top: 0;
}

.page-head h2 {
  margin: 0 0 10px;
  font-size: 72px;
  line-height: .88;
  letter-spacing: 0;
}

.page-head p { margin: 0; line-height: 1.45; }

.mega-run {
  min-width: 174px;
  min-height: 68px;
  font-size: 22px;
  font-weight: 760;
}

.mega-run.stop {
  background: rgba(255,255,255,.08);
  box-shadow: 0 0 40px rgba(255,42,31,.16);
  border-color: rgba(255,42,31,.68);
  color: var(--red-2);
}

.work-grid {
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, .96fr);
  align-items: start;
}

.sender-layout { grid-template-columns: minmax(0, 1fr) minmax(320px, .86fr); }
.wide { grid-column: 1 / -1; }

details.panel { padding: 0; overflow: hidden; }

summary {
  cursor: pointer;
  padding: 20px;
  font-size: 19px;
  font-weight: 740;
}

details .compact-grid { padding: 0 20px 20px; }

.compact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.compact-grid.one { grid-template-columns: 1fr; }
.inline-controls { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  margin-bottom: 14px;
  font-size: 13px;
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
}

input, textarea, select {
  width: 100%;
  border: 1px solid rgba(255,255,255,.115);
  border-radius: 13px;
  background: rgba(0,0,0,.34);
  padding: 12px 13px;
  outline: none;
}

textarea { resize: vertical; min-height: 92px; }

input:focus, textarea:focus, select:focus {
  border-color: rgba(255, 75, 61, .72);
  box-shadow: 0 0 0 3px rgba(255,42,31,.14);
}

.full { width: 100%; }

.history-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
}

.history-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.095);
}

.history-item small { color: var(--red-2); white-space: nowrap; }

.filter-switch {
  min-height: 54px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,.24);
  border: 1px solid rgba(255,255,255,.085);
  cursor: pointer;
}

.filter-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.filter-switch span {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.12);
  position: relative;
  transition: .18s ease;
}

.filter-switch span:after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: rgba(255,255,255,.78);
  transition: .18s ease;
}

.filter-switch input:checked + span {
  background: rgba(255,42,31,.34);
  border-color: rgba(255,42,31,.56);
}

.filter-switch input:checked + span:after {
  transform: translateX(18px);
  background: #fff;
  box-shadow: 0 0 18px rgba(255,42,31,.48);
}

.filter-switch strong {
  color: rgba(255,255,255,.72);
  font-size: 13px;
  font-weight: 560;
}

.disabled-filter {
  opacity: .43;
  filter: grayscale(.25);
}

.disabled-filter input {
  cursor: not-allowed;
  background: rgba(255,255,255,.045);
  border-color: rgba(255,255,255,.07);
}

.recipient-preview {
  min-height: 168px;
}

.recipient-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.recipient-head span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.recipient-head strong {
  min-width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255,42,31,.16);
  border: 1px solid rgba(255,42,31,.34);
}

.recipient-list {
  display: grid;
  gap: 8px;
  max-height: 230px;
  overflow: auto;
}

.recipient-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0,0,0,.26);
  border: 1px solid rgba(255,255,255,.075);
}

.recipient-row a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ff938b;
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,147,139,.3);
  width: fit-content;
  max-width: 100%;
}

.recipient-row a:hover {
  color: #fff;
  border-bottom-color: rgba(255,255,255,.65);
}

.recipient-row em,
.recipient-empty {
  color: rgba(255,255,255,.48);
  font-size: 12px;
  font-style: normal;
}

progress {
  width: 100%;
  height: 9px;
  margin-bottom: 14px;
  accent-color: var(--red);
}

.tabs, .toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar .button,
.toolbar button,
.toolbar .file-button {
  min-width: 142px;
  min-height: 42px;
  line-height: 1;
}

.tab.active { background: rgba(255,42,31,.22); border-color: rgba(255,42,31,.6); }
.file-button input { display: none; }
.contact-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -2px 0 16px;
}

.contact-filters.hidden { display: none; }

.chip {
  min-height: 36px;
  padding: 8px 13px;
  color: rgba(255,255,255,.7);
}

.chip.active {
  color: #fff;
  background: rgba(255,42,31,.2);
  border-color: rgba(255,42,31,.52);
  box-shadow: 0 0 26px rgba(255,42,31,.14);
}

.table-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  width: fit-content;
  margin: 0 0 16px;
  padding: 12px 18px;
}

.table-summary span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.table-summary strong {
  color: #fff;
  font-size: 28px;
  line-height: 1;
}

.table-wrap { padding: 0; overflow: auto; max-height: 66vh; }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.075); font-size: 13px; vertical-align: top; }
th { color: var(--muted); position: sticky; top: 0; background: rgba(14, 10, 10, .96); }
td { color: rgba(255,255,255,.78); }
.table-link {
  color: #ff938b;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,147,139,.35);
}

.table-link:hover {
  color: #fff;
  border-bottom-color: rgba(255,255,255,.65);
}

.row-number {
  width: 52px;
  min-width: 52px;
  color: rgba(255,255,255,.44);
  text-align: center;
}

td.row-number {
  font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,.6);
}

.empty-table {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .7fr);
  gap: 18px;
  margin-bottom: 18px;
}

.admin-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.admin-row,
.admin-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.admin-row {
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  background: rgba(255,255,255,.045);
}

.admin-row small,
#adminUsersTable small {
  display: block;
  color: var(--faint);
  margin-top: 3px;
}

.admin-row button {
  width: 34px;
  min-height: 34px;
  padding: 0;
}

.admin-inline {
  grid-template-columns: minmax(0, 1fr) auto;
}

.admin-users-panel { margin-top: 18px; }
.admin-table-wrap { overflow-x: auto; }

#adminUsersTable {
  min-width: 1080px;
}

#adminUsersTable td,
#adminUsersTable th {
  vertical-align: top;
}

.admin-actions-cell {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-actions-cell button {
  min-height: 34px;
  padding: 8px 10px;
  font-size: 12px;
}

.admin-error {
  max-width: 260px;
  color: rgba(255,255,255,.7);
  font-size: 12px;
  line-height: 1.35;
  margin-bottom: 5px;
}

.danger-text { color: var(--red-2); }
.muted-copy { color: var(--muted); line-height: 1.5; }

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

.modal.hidden { display: none; }

.modal-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 22px;
  padding: 24px;
  position: relative;
}

.modal-close {
  position: absolute;
  right: 16px;
  top: 14px;
  width: 36px;
  height: 36px;
  padding: 0;
}

.modal-card h2 { font-size: 30px; margin-bottom: 8px; }
.modal-card p { color: var(--muted); line-height: 1.45; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

.qr-box {
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: 18px;
  background: #fff;
  margin: 14px 0;
}

.qr-box svg { width: 230px; height: 230px; }
.code-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }

#toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 430px;
  padding: 13px 16px;
  border-radius: 14px;
  background: rgba(20,14,14,.92);
  border: 1px solid rgba(255,255,255,.14);
  opacity: 0;
  transform: translateY(16px);
  transition: .2s;
  z-index: 30;
}

#toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .shell { width: min(100vw - 24px, 760px); padding-top: 18px; }
  .robot-orbit, .spark { animation: none; }
  .topbar { display: grid; margin-bottom: 42px; }
  .top-links { justify-content: start; }
  .hero, .page-head, .settings-strip, .settings-head, .section-intro { grid-template-columns: 1fr; }
  .hero { min-height: auto; gap: 28px; padding-bottom: 64px; }
  .robot-stage { order: -1; min-height: 310px; transform: none; }
  .robot { width: min(320px, 88vw); }
  .robot-orbit { width: 300px; height: 300px; }
  .robot-glow { width: 300px; height: 300px; }
  .hero h1 { font-size: 96px; }
  .hero p { font-size: 19px; }
  .section-intro h2, .settings-strip h2 { font-size: 44px; }
  .route strong { font-size: 30px; }
  .page-head h2 { font-size: 48px; }
  .hero-actions, .settings-actions { justify-content: start; flex-wrap: wrap; }
  .stat-grid, .live-grid, .route-grid, .work-grid, .compact-grid, .settings-lists { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-inline { grid-template-columns: 1fr; }
  .stat-grid { max-width: none; margin: 0 0 72px; }
  .settings-actions, .telegram-actions { display: grid; grid-template-columns: 1fr; }
  .inline-controls { grid-template-columns: 1fr; }
  .page-head { min-height: auto; align-items: start; padding-top: 58px; }
}

@media (max-width: 560px) {
  .shell { width: min(100vw - 18px, 520px); }
  .top-links a, button, a.button, .file-button { width: 100%; justify-content: center; }
  .hero-actions { display: grid; }
  .hero h1 { font-size: 66px; }
  .hero p { font-size: 17px; max-width: 320px; }
  .hero-actions { max-width: 320px; }
  .section-intro h2, .settings-strip h2 { font-size: 38px; }
  .page-head h2 { font-size: 40px; }
  .page-head { gap: 14px; }
  .page-head .ghost, .mega-run { width: 100%; }
  .code-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}
