/* Пульт бота — тема «Лунная» (moon).
   Ночь над водой: глубокий синий, холодный свет, луна-циферблат, отражение, косые панели. */

:root {
  --bg0: #01040d;
  --bg1: #030a1f;
  --ink: #eef6ff;
  --ink2: #b3c8ea;
  --ink3: #7791be;
  --ink4: #4d6593;
  --cyan: #74d9ff;
  --ice: #cdeeff;
  --blue: #3d7bff;
  --violet: #9a9cff;
  --danger: #ff5674;
  --danger2: #ffa3b5;
  --display: 'Exo 2', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --col: min(100vw, 480px);
  --side: calc((100vw - var(--col)) / 2);
  --safe-t: max(env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.7, 0, .84, 0);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg1);
  color: var(--ink);
  font: 500 15px/1.35 var(--body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  /* Положение луны (левый верх «рига» 220×220), масштаб и линия горизонта — по экрану. */
  --mx: calc(var(--side) + var(--col) - 226px);
  --my: 34px;
  --ms: 1;
  --hz: 300px;
}
body[data-screen="sub"] { --mx: calc(var(--side) + var(--col) - 162px); --my: -44px; --ms: .36; --hz: 126px; }
body.tg-native[data-screen="sub"] { --my: -60px; --hz: 84px; }
body[data-screen="home"].is-scrolled { --mx: calc(var(--side) + var(--col) - 162px); --my: -44px; --ms: .36; --hz: 126px; }
body.booting { --mx: calc(50vw - 110px); --my: calc(30vh - 110px); --ms: .82; --hz: calc(30vh + 118px); }
html body.is-waiting.is-waiting[data-screen] { --mx: calc(50vw - 110px); --my: calc(23vh - 110px); --ms: 1.1; --hz: calc(23vh + 142px); }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
button:disabled { cursor: default; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
svg { display: block; }

/* ======================= НЕБО ======================= */

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(90% 55% at 72% 22%, rgba(56, 110, 255, .20), transparent 65%),
    radial-gradient(70% 40% at 10% 0%, rgba(40, 60, 160, .25), transparent 70%),
    linear-gradient(180deg, #01030c 0%, #020920 26%, #061847 52%, #0b2a72 72%, #0f3796 100%);
}
.sky-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 30% at 50% 100%, rgba(30, 80, 220, .25), transparent 70%);
}

.stars { position: absolute; inset: 0 0 35% 0; }
.stars i {
  position: absolute;
  width: var(--s, 2px);
  height: var(--s, 2px);
  border-radius: 50%;
  background: #e4f4ff;
  box-shadow: 0 0 6px rgba(160, 215, 255, .9);
  opacity: var(--o, .7);
  animation: twinkle calc(var(--d, 4s) * var(--tempo, 1)) ease-in-out var(--dl, 0s) infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: var(--o, .7); transform: scale(1); }
  45% { opacity: .15; transform: scale(.6); }
  55% { opacity: calc(var(--o, .7) + .3); transform: scale(1.25); }
}

.meteor {
  position: absolute;
  top: 9%;
  left: 8%;
  width: 140px;
  height: 1.5px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(220, 240, 255, .95));
  border-radius: 2px;
  transform: rotate(-24deg) translateX(-200px);
  opacity: 0;
  animation: meteor 13s ease-in 4s infinite;
}
@keyframes meteor {
  0%, 92% { opacity: 0; transform: rotate(-24deg) translateX(-200px); }
  93% { opacity: 1; }
  100% { opacity: 0; transform: rotate(-24deg) translateX(320px); }
}

/* --- луна --- */
.rig {
  position: absolute;
  left: 0;
  top: 0;
  width: 220px;
  height: 220px;
  transform: translate3d(var(--mx), var(--my), 0) scale(var(--ms));
  transform-origin: 50% 50%;
  transition: transform 1.1s var(--ease-out), filter 1s ease, opacity 1s ease;
  will-change: transform;
}
.halo {
  position: absolute;
  inset: -70px;
  border-radius: 50%;
  animation: flicker calc(7s * var(--tempo, 1)) linear infinite;
}
.halo::before, .halo::after { content: ''; position: absolute; inset: 0; border-radius: 50%; transition: opacity 3s ease; }
.halo::before { background: radial-gradient(circle, rgba(185, 225, 255, .50) 0%, rgba(110, 170, 255, .22) 28%, rgba(50, 100, 255, .08) 48%, transparent 66%); }
.halo::after { background: radial-gradient(circle, rgba(225, 250, 150, .55) 0%, rgba(160, 205, 60, .26) 30%, rgba(90, 140, 30, .1) 50%, transparent 68%); opacity: 0; }
body.dark-hour .halo::before { opacity: 0; }
body.dark-hour .halo::after { opacity: 1; }
@keyframes flicker {
  0%, 100% { opacity: .86; }
  8% { opacity: .95; }
  9% { opacity: .74; }
  11% { opacity: .98; }
  37% { opacity: .9; }
  52% { opacity: 1; }
  53% { opacity: .78; }
  56% { opacity: .96; }
  78% { opacity: .88; }
}
.moon {
  position: absolute;
  inset: 36px;
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, .95) 0 6%, rgba(255, 255, 255, 0) 36%),
    radial-gradient(circle at 50% 50%, #f6f9ff 0 52%, #d6e5ff 72%, #a3bdf0 92%, #8eaae6 100%);
  box-shadow:
    0 0 26px 6px rgba(190, 228, 255, .55),
    0 0 90px 26px rgba(90, 150, 255, .28),
    inset -16px -12px 28px rgba(70, 100, 180, .38),
    inset 6px 6px 18px rgba(255, 255, 255, .7);
  transition: box-shadow 3s ease;
}
body.dark-hour .moon {
  box-shadow:
    0 0 30px 8px rgba(210, 245, 130, .5),
    0 0 110px 34px rgba(120, 170, 40, .3),
    inset -18px -14px 30px rgba(70, 90, 20, .5),
    inset 6px 6px 18px rgba(255, 255, 220, .6);
}
.crater {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 60% 60%, rgba(140, 165, 220, .42), rgba(160, 185, 230, .2) 55%, rgba(255, 255, 255, 0) 72%);
  box-shadow: inset 2px 2px 3px rgba(110, 135, 200, .25);
}
.crater.c1 { width: 34px; height: 30px; left: 54%; top: 50%; }
.crater.c2 { width: 20px; height: 18px; left: 26%; top: 60%; }
.crater.c3 { width: 15px; height: 14px; left: 62%; top: 22%; }
.crater.c4 { width: 44px; height: 38px; left: 18%; top: 22%; opacity: .55; }
.moon .shade {
  position: absolute;
  inset: -3%;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 44%, #0c1a48 0%, #050c26 60%, #030818 100%);
  box-shadow: 0 0 24px 8px rgba(3, 8, 24, .8);
  transform: translateX(118%);
}

.dial { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dial .tick { stroke: rgba(190, 225, 255, .32); stroke-width: 1; }
.dial .tick.major { stroke: rgba(225, 242, 255, .8); stroke-width: 2; }
.dial .noon { fill: #e9f7ff; filter: url(#dglow); }
.dial .ctx-track { fill: none; stroke: rgba(120, 170, 255, .16); stroke-width: 3; }
.dial .ctx-arc {
  fill: none;
  stroke: url(#arcGrad);
  stroke-width: 3.6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.4s var(--ease-out), stroke .4s;
}
.dial .ctx-dot { fill: #fff; transition: transform 1.4s var(--ease-out); }
.dial .ticks, .dial .arcs { transform-box: view-box; transform-origin: 120px 120px; }
body.ctx-warn .dial .ctx-arc { stroke: #ffffff; }
body.ctx-hot .dial .ctx-arc { stroke: var(--danger); }

/* --- вода --- */
.sea {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 170vh;
  transform: translate3d(0, var(--hz), 0);
  transition: transform 1.1s var(--ease-out);
  background: linear-gradient(180deg, #123c9a 0%, #0b2766 3%, #071b4c 16%, #041236 42%, #020a20 78%, #01050f 100%);
}
.horizon {
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(140, 195, 255, .35) 18%, rgba(225, 242, 255, .85) 62%, rgba(140, 195, 255, .35) 90%, transparent 100%);
  box-shadow: 0 0 16px 2px rgba(120, 190, 255, .55);
}
.sea-lines {
  position: absolute;
  inset: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 6%, #000 48%, transparent 80%);
  mask-image: linear-gradient(180deg, transparent 0, #000 6%, #000 48%, transparent 80%);
}
.swell {
  position: absolute;
  left: 0;
  right: 0;
  top: -24px;
  height: calc(100% + 24px);
  background: repeating-linear-gradient(180deg, rgba(130, 180, 255, .075) 0 1px, transparent 1px 12px);
  animation: swell calc(4.5s * var(--tempo, 1)) linear infinite;
}
@keyframes swell { to { transform: translateY(24px); } }
.mist {
  position: absolute;
  left: -30%;
  right: -30%;
  top: -46px;
  height: 92px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(120, 170, 255, .16), transparent 70%);
  animation: drift calc(26s * var(--tempo, 1)) ease-in-out infinite alternate;
}
@keyframes drift { from { transform: translateX(-8%); } to { transform: translateX(8%); } }

.path {
  position: absolute;
  top: 3px;
  left: 0;
  width: 200px;
  height: 64vh;
  transform: translateX(calc(var(--mx) + 10px)) scaleX(var(--ms));
  transform-origin: 50% 0;
  transition: transform 1.1s var(--ease-out), opacity 1s;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .7) 40%, transparent 92%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .7) 40%, transparent 92%);
}
.path::before {
  content: '';
  position: absolute;
  left: 18%;
  right: 18%;
  top: 0;
  bottom: 10%;
  background: radial-gradient(50% 55% at 50% 0%, rgba(150, 205, 255, .38), transparent 75%);
}
.path i {
  position: absolute;
  height: var(--h, 3px);
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(225, 242, 255, 0), rgba(225, 242, 255, .9) 28%, #fff 50%, rgba(225, 242, 255, .9) 72%, rgba(225, 242, 255, 0));
  opacity: .8;
  animation: shimmer calc(var(--d, 2.4s) * var(--tempo, 1)) ease-in-out var(--dl, 0s) infinite alternate;
}
@keyframes shimmer {
  0% { transform: translateX(-7px) scaleX(.55); opacity: .3; }
  50% { opacity: .95; }
  100% { transform: translateX(8px) scaleX(1.12); opacity: .6; }
}

.ripples {
  position: absolute;
  top: 18px;
  left: 0;
  width: 220px;
  height: 90px;
  transform: translateX(var(--mx));
  transition: transform 1.1s var(--ease-out), opacity .8s;
  opacity: 0;
}
.ripples i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 260px;
  height: 260px;
  margin: -130px 0 0 -130px;
  border: 1.5px solid rgba(180, 225, 255, .7);
  border-radius: 50%;
  transform: scale(.08, .016);
  opacity: 0;
}
body.is-busy .ripples, body.is-eclipse .ripples { opacity: 1; }
body.is-busy .ripples i, body.is-eclipse .ripples i { animation: ripple calc(3s * var(--tempo, 1)) ease-out infinite; }
.ripples i:nth-child(2) { animation-delay: 1s !important; }
.ripples i:nth-child(3) { animation-delay: 2s !important; }
@keyframes ripple {
  0% { transform: scale(.08, .016); opacity: .9; }
  100% { transform: scale(1, .2); opacity: 0; }
}

/* состояния неба */
body.is-busy .halo { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: .8; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }
body.is-eclipse .moon .shade { animation: eclipse 3.6s ease-in-out infinite; }
@keyframes eclipse {
  0% { transform: translateX(118%); }
  45%, 55% { transform: translateX(8%); }
  100% { transform: translateX(-118%); }
}
body.is-eclipse .dial .ticks { animation: spin 14s linear infinite; }
body.is-eclipse .dial .arcs { animation: spin 1.8s linear infinite; }
body.is-eclipse .dial .ctx-arc { stroke-dasharray: 90 507 !important; stroke-dashoffset: 0 !important; }
body.is-eclipse .dial .ctx-dot { opacity: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
body[data-screen="sub"] .path, body.is-scrolled .path { opacity: .55; }
body.is-waiting .path, body.booting .path { opacity: .42; }
body.is-offline .rig { filter: grayscale(.75) brightness(.45); }
body.is-offline .path, body.is-offline .halo { opacity: .2; }
body.is-offline .stars { opacity: .45; }

/* ======================= КАРКАС ======================= */

.app {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  width: var(--col);
  margin: 0 auto;
  transition: opacity .55s ease, transform .7s var(--ease-out);
}
body.is-waiting .app { opacity: 0; transform: scale(.96) translateY(14px); pointer-events: none; }

.stage { position: absolute; inset: 0; }
.screen {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 16px;
}
.screen::-webkit-scrollbar { display: none; }
.screen-in { padding: calc(14px + var(--safe-t)) 0 calc(110px + var(--safe-b)); min-height: 100%; }

.screen.enter-fwd { animation: enterFwd .6s var(--ease-out) both; }
.screen.enter-back { animation: enterBack .6s var(--ease-out) both; }
.screen.leave-fwd { animation: leaveFwd .42s var(--ease-in) both; pointer-events: none; }
.screen.leave-back { animation: leaveBack .42s var(--ease-in) both; pointer-events: none; }
@keyframes enterFwd { from { opacity: 0; transform: translateX(54px) skewX(-7deg); } }
@keyframes enterBack { from { opacity: 0; transform: translateX(-54px) skewX(7deg); } }
@keyframes leaveFwd { to { opacity: 0; transform: translateX(-70px) skewX(7deg); } }
@keyframes leaveBack { to { opacity: 0; transform: translateX(70px) skewX(-7deg); } }
.enter-fwd .st, .enter-back .st { animation: rise .7s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms + 90ms); }
@keyframes rise { from { opacity: 0; transform: translateY(18px) skewY(2deg); } }

.sweep {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  background: linear-gradient(104deg, transparent 34%, rgba(110, 180, 255, .16) 43%, rgba(200, 235, 255, .55) 49%, #fff 50%, rgba(200, 235, 255, .55) 51%, rgba(110, 180, 255, .16) 57%, transparent 66%);
  transform: translateX(-110%);
}
.sweep.run-fwd { animation: sweepFwd .62s var(--ease-out); }
.sweep.run-back { animation: sweepBack .62s var(--ease-out); }
@keyframes sweepFwd { 0% { opacity: 1; transform: translateX(110%); } 100% { opacity: .2; transform: translateX(-110%); } }
@keyframes sweepBack { 0% { opacity: 1; transform: translateX(-110%); } 100% { opacity: .2; transform: translateX(110%); } }

/* нажатия */
.press { position: relative; overflow: hidden; transition: transform .22s var(--spring), filter .2s ease; }
.press:active:not(:disabled) { transform: scale(.965) skewX(-2deg); filter: brightness(1.22); transition-duration: .08s; }
.rip {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(230, 245, 255, .5), rgba(150, 210, 255, .18) 40%, rgba(150, 210, 255, 0) 68%);
  transform: scale(0);
  animation: rip .7s var(--ease-out) forwards;
  z-index: 3;
}
@keyframes rip { to { transform: scale(1); opacity: 0; } }
@media (hover: hover) {
  .tile:hover, .card:hover, .act:hover, .sess:hover { filter: brightness(1.14); }
}

/* ======================= ГЛАВНАЯ ======================= */

.topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-height: 52px; }
.clock b {
  display: block;
  font: italic 800 34px/0.95 var(--display);
  letter-spacing: -.01em;
  color: #fff;
  text-shadow: 0 0 18px rgba(130, 195, 255, .55);
}
.clock span { display: block; margin-top: 5px; font: 600 11.5px/1.2 var(--body); color: var(--ink2); letter-spacing: .02em; }
.clock em { font-style: normal; color: var(--cyan); }
.link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  padding: 5px 11px 5px 9px;
  font: 700 10.5px/1 var(--body);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink2);
  background: rgba(20, 50, 120, .45);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.link i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.link.ping i { animation: ping .9s ease-out; }
@keyframes ping { 0% { transform: scale(1.9); background: #fff; } 100% { transform: scale(1); } }
.link.is-bad { color: var(--danger2); }
.link.is-bad i { background: var(--danger); box-shadow: 0 0 8px var(--danger); animation: blink 1s steps(2) infinite; }
.link.is-demo i { background: var(--violet); box-shadow: 0 0 8px var(--violet); }

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  min-height: 210px;
  padding-bottom: 20px;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px 7px 13px;
  font: italic 800 13px/1 var(--display);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #03122e;
  background: linear-gradient(100deg, #f1f9ff, #9fdcff 70%, #7fc1ff);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.status .beacon { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #082460; }
.status .beacon::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #082460;
  animation: beacon 2s ease-out infinite;
}
@keyframes beacon { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.status--busy { background: linear-gradient(100deg, #ffffff, #a8eaff 35%, #6fa6ff 60%, #ffffff 90%); background-size: 220% 100%; animation: sheen 1.6s linear infinite; }
.status--restart { background: linear-gradient(100deg, #e1dfff, #9aa0ff); }
.status--restart .beacon { animation: spinDot 1s linear infinite; border-radius: 2px; }
.status--offline { color: #2b0612; background: linear-gradient(100deg, #ffc1cd, #ff6683); }
.status--offline .beacon, .status--offline .beacon::after { background: #2b0612; border-color: #2b0612; animation: none; }
.status--unknown { background: linear-gradient(100deg, #b9c9e6, #7f93bd); }
@keyframes sheen { from { background-position: 100% 0; } to { background-position: -120% 0; } }
@keyframes spinDot { to { transform: rotate(360deg); } }
.wave { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.wave i { width: 3px; height: 100%; background: #082460; transform-origin: 50% 100%; animation: wave .9s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: .15s; }
.wave i:nth-child(3) { animation-delay: .3s; }
@keyframes wave { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.status-msg { margin-top: 7px; font: 600 12.5px/1.3 var(--body); color: var(--ink2); }

.ai-name {
  position: relative;
  isolation: isolate;
  margin: 14px 0 0 -2px;
  font: italic 900 52px/0.92 var(--display);
  letter-spacing: -.02em;
  color: #f6fbff;
  white-space: nowrap;
  text-shadow: 2px 3px 0 #061a4d, 0 0 2px #02081c, 0 0 26px rgba(120, 190, 255, .6);
}
.ai-name::before {
  content: attr(data-text);
  position: absolute;
  z-index: -1;
  left: 12px;
  top: -16px;
  font-size: 1.32em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(150, 210, 255, .28);
  text-shadow: none;
  pointer-events: none;
}
.ai-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 10px;
  font: 700 13.5px/1.2 var(--body);
  color: var(--ink);
  text-shadow: 0 1px 8px rgba(2, 8, 28, .9);
}
.ai-meta i { width: 10px; height: 2px; background: var(--cyan); transform: skewX(-30deg); }
.ai-meta span:last-child { color: var(--ink2); }

/* плитки */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 7px; }
.tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100px;
  padding: 13px 16px 13px 20px;
  background: linear-gradient(118deg, rgba(36, 84, 190, .62), rgba(10, 30, 82, .62) 62%, rgba(6, 18, 52, .5));
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  clip-path: polygon(13px 0, 100% 0, calc(100% - 13px) 100%, 0 100%);
}
.tile::before {
  content: '';
  position: absolute;
  left: 13px;
  right: 0;
  top: 0;
  height: 1.5px;
  background: linear-gradient(90deg, rgba(210, 240, 255, .95), rgba(120, 190, 255, .15) 70%, transparent);
}
.tile::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 13px;
  background: linear-gradient(to bottom right, transparent 47%, rgba(150, 215, 255, .85) 50%, transparent 55%);
}
.k {
  font: 800 10px/1 var(--body);
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--cyan);
}
.tile .v {
  margin-top: 9px;
  padding-right: 4px;
  font: italic 800 19px/1.08 var(--display);
  color: #fff;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile .s {
  margin-top: 5px;
  font: 500 11.5px/1.3 var(--body);
  color: var(--ink2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile .s.bad, .bad { color: var(--danger2); }
.tile .go { position: absolute; right: 18px; top: 11px; width: 14px; height: 14px; color: var(--ice); opacity: .55; }
.tile--wide { grid-column: 1 / -1; }

/* панели */
.panel {
  position: relative;
  margin-top: 10px;
  padding: 15px 18px 15px 20px;
  background: linear-gradient(112deg, rgba(26, 66, 160, .55), rgba(8, 24, 68, .58) 60%, rgba(5, 14, 42, .5));
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
}
.panel::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 72%;
  height: 1.5px;
  background: linear-gradient(90deg, rgba(210, 240, 255, .9), transparent);
}
.panel::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 56%;
  background: linear-gradient(180deg, var(--cyan), transparent);
  box-shadow: 0 0 10px var(--cyan);
}
.p-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.p-big { font: italic 900 30px/1 var(--display); color: #fff; }
.p-big small { font-size: .55em; font-weight: 800; color: var(--ink2); margin-left: 2px; }
.p-note { margin: 8px 0 0; font: 500 12px/1.4 var(--body); color: var(--ink3); }

.ctx-nums { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.ctx-nums b { font: italic 800 22px/1 var(--display); color: #fff; }
.ctx-nums span { font: 600 12.5px var(--body); color: var(--ink2); }
.segs { display: flex; gap: 3px; height: 13px; margin: 11px 2px 2px; }
.segs i { flex: 1; transform: skewX(-26deg); background: rgba(110, 160, 255, .15); border-radius: 1px; transition: background .5s, box-shadow .5s; }
.segs i.on { background: linear-gradient(180deg, #e4f7ff, #66c6ff); box-shadow: 0 0 8px rgba(110, 200, 255, .65); }
.segs i.tip { animation: blink 1.3s ease-in-out infinite; }
.segs.warn i.on { background: linear-gradient(180deg, #ffffff, #c8dcff); box-shadow: 0 0 10px rgba(255, 255, 255, .7); }
.segs.hot i.on { background: linear-gradient(180deg, #ffd3dc, #ff5674); box-shadow: 0 0 10px rgba(255, 86, 116, .7); }
@keyframes blink { 50% { opacity: .35; } }

.ds-balance { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.ds-balance .cur { font: italic 800 26px/1 var(--display); color: var(--cyan); }
.ds-balance b { font: italic 900 46px/0.95 var(--display); letter-spacing: -.02em; color: #fff; text-shadow: 0 0 22px rgba(120, 200, 255, .55); }
.ds-balance em { margin-left: 4px; font: 700 11px var(--body); font-style: normal; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); }
.ds-balance.low b { color: var(--danger2); text-shadow: 0 0 20px rgba(255, 86, 116, .5); }
.ds-spent { margin-top: 4px; font: 600 13px var(--body); color: var(--ink2); }
.ds-spent b { color: #fff; font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip-s {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  background: rgba(70, 120, 230, .2);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  font: 600 11px var(--body);
  color: var(--ink3);
}
.chip-s b { font: italic 800 14px var(--display); color: var(--ice); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: blink 2.4s ease-in-out infinite; }

/* плашка «Мак»: на связи — голубой огонёк, подключается — мигает, выключен — луна в тени */
.mac-st {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px 4px 10px;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  background: rgba(120, 130, 200, .2);
  font: italic 800 12.5px/1.2 var(--display);
  letter-spacing: .04em;
  color: var(--ink2);
}
.mac-st i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink4); }
.mac--on .mac-st { background: rgba(116, 217, 255, .18); color: var(--ice); }
.mac--on .mac-st i { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.mac--connecting .mac-st { color: var(--ice); }
.mac--connecting .mac-st i { background: var(--violet); box-shadow: 0 0 10px var(--violet); animation: blink 1s ease-in-out infinite; }
.mac--off::after { background: linear-gradient(180deg, var(--violet), transparent); box-shadow: 0 0 10px var(--violet); }
.mac-how { color: var(--ink2); }

/* заголовок раздела */
.sect {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 2px 11px;
  font: italic 800 13px/1 var(--display);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ice);
}
.sect::before { content: ''; width: 18px; height: 6px; background: var(--cyan); transform: skewX(-32deg); box-shadow: 0 0 10px var(--cyan); }
.sect::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(160, 210, 255, .5), transparent); }

/* действия */
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.act {
  display: grid;
  grid-template-columns: 30px 1fr;
  column-gap: 11px;
  align-items: center;
  min-height: 72px;
  padding: 14px 14px 14px 16px;
  background: linear-gradient(118deg, rgba(30, 72, 170, .6), rgba(8, 22, 62, .62));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 15px, 100% 100%, 15px 100%, 0 calc(100% - 15px));
}
.act svg { grid-row: span 2; width: 28px; height: 28px; color: var(--ice); filter: drop-shadow(0 0 6px rgba(140, 210, 255, .6)); }
.act b { font: italic 800 17px/1.05 var(--display); color: #fff; }
.act small { margin-top: 3px; font: 500 11px/1.25 var(--body); color: var(--ink3); }
.act--danger { background: linear-gradient(118deg, rgba(170, 26, 70, .55), rgba(48, 6, 28, .65)); }
.act--danger svg { color: var(--danger2); filter: drop-shadow(0 0 6px rgba(255, 86, 116, .7)); }
.act--danger small { color: #d78b9b; }
.act:disabled { opacity: .45; }
.act.is-loading svg, .card.is-loading .card-go svg, .sess.is-loading .sess-go svg { animation: spinDot 1s linear infinite; }
.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(200, 235, 255, .22) 50%, transparent 70%);
  background-size: 250% 100%;
  animation: sheen 1.1s linear infinite;
}

.foot { margin: 22px 2px 0; font: 600 11px/1.4 var(--body); color: var(--ink4); letter-spacing: .04em; }

/* бот выключен */
.offline {
  margin-top: 4px;
  padding: 18px 18px 18px 20px;
  background: linear-gradient(112deg, rgba(120, 18, 52, .55), rgba(36, 6, 24, .6));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
}
.offline h3 { margin: 0 0 6px; font: italic 900 26px/1 var(--display); color: #fff; }
.offline p { margin: 0 0 10px; color: #f0c2cd; font-size: 13.5px; }
.cmd {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  background: rgba(0, 0, 0, .32);
  font: 500 12px/1.4 var(--mono);
  color: var(--ice);
  word-break: break-all;
}
.cmd svg { flex: none; width: 16px; height: 16px; opacity: .8; }
.cmd span { flex: 1; user-select: text; -webkit-user-select: text; }

/* ======================= ВЛОЖЕННЫЕ ЭКРАНЫ ======================= */

.sub-head { position: relative; padding: 4px 0 20px; min-height: 120px; }
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px -2px;
  padding: 8px 16px 8px 11px;
  font: italic 800 12px/1 var(--display);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ice);
  background: rgba(50, 100, 220, .28);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.back svg { width: 14px; height: 14px; }
.kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  font: 800 10.5px/1 var(--body);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--cyan);
}
.kicker::before { content: ''; width: 22px; height: 2px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.title {
  position: relative;
  isolation: isolate;
  margin: 12px 0 0 -2px;
  max-width: calc(100% - 70px);
  font: italic 900 44px/0.95 var(--display);
  letter-spacing: -.02em;
  color: #f6fbff;
  text-shadow: 2px 3px 0 #061a4d, 0 0 24px rgba(120, 190, 255, .55);
}
.title::before {
  content: attr(data-text);
  position: absolute;
  z-index: -1;
  left: 14px;
  top: -14px;
  font-size: 1.3em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(150, 210, 255, .26);
  text-shadow: none;
}
.title--long { font-size: 36px; white-space: nowrap; }
.lead { margin: 12px 0 0; max-width: 330px; font: 500 13.5px/1.45 var(--body); color: var(--ink2); }

.list { display: flex; flex-direction: column; gap: 10px; }
.card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 16px 54px 16px 22px;
  background: linear-gradient(112deg, rgba(28, 66, 160, .52), rgba(8, 22, 64, .58) 64%, rgba(5, 14, 42, .5));
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
}
.card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: rgba(130, 190, 255, .35);
  transition: background .3s, box-shadow .3s;
}
.card.is-on {
  background: linear-gradient(112deg, rgba(110, 185, 255, .36), rgba(28, 76, 190, .52) 50%, rgba(8, 22, 64, .6));
}
.card.is-on::before { width: 4px; background: #e6f7ff; box-shadow: 0 0 14px 2px var(--cyan); }
.card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.card-title { margin-top: 8px; font: italic 800 25px/1.02 var(--display); color: #fff; }
.card-sub { margin-top: 5px; font: 700 13.5px/1.3 var(--body); color: var(--ice); word-break: break-word; }
.card-detail { margin-top: 3px; font: 500 12.5px/1.35 var(--body); color: var(--ink2); }
.card-note { margin-top: 8px; padding: 6px 10px; font: 700 12px/1.35 var(--body); color: #ffd3dc; background: rgba(255, 70, 110, .16); border-left: 2px solid var(--danger); }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.card-go { position: absolute; right: 18px; top: 50%; width: 22px; height: 22px; margin-top: -11px; color: var(--ice); opacity: .6; }
.card.is-on .card-go { opacity: 1; color: #fff; filter: drop-shadow(0 0 8px var(--cyan)); }
.card-go svg { width: 100%; height: 100%; }
.card-id { font: 500 11px var(--mono); color: var(--ink4); margin-top: 8px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  font: 800 9.5px/1 var(--body);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #04122e;
  background: linear-gradient(100deg, #f1faff, #a3dcff);
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
}
.badge--ghost { color: var(--ice); background: rgba(90, 140, 240, .24); }
.badge--bad { color: #fff; background: linear-gradient(100deg, #ff8ba1, #e3365a); }
.badge--live { color: #04122e; background: linear-gradient(100deg, #c9fff0, #6fe6ff); }
.badge--live i { width: 6px; height: 6px; border-radius: 50%; background: #04122e; animation: blink 1.2s ease-in-out infinite; }

/* сессии */
.sess {
  display: grid;
  grid-template-columns: 44px 1fr 22px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px 13px 14px;
  background: linear-gradient(112deg, rgba(24, 58, 146, .48), rgba(8, 22, 62, .55) 70%);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.sess-idx {
  font: italic 900 30px/1 var(--display);
  color: transparent;
  -webkit-text-stroke: 1.2px rgba(170, 220, 255, .7);
  text-align: center;
}
.sess.is-on {
  background: linear-gradient(112deg, rgba(110, 185, 255, .34), rgba(28, 76, 190, .5) 55%, rgba(8, 22, 64, .58));
}
.sess.is-on .sess-idx { color: #fff; -webkit-text-stroke: 0; text-shadow: 0 0 16px var(--cyan); }
.sess-body { min-width: 0; }
.sess-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font: italic 800 16.5px/1.15 var(--display);
  color: #fff;
}
.sess-meta { display: block; margin-top: 4px; font: 500 11.5px/1.3 var(--body); color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.sess-badges:empty { display: none; }
.sess-go { width: 18px; height: 18px; color: var(--ice); opacity: .55; }
.sess.is-on .sess-go { opacity: 1; }
.sess--main { padding: 17px 16px 17px 14px; }
.sess--main .sess-title { font-size: 21px; }
.sess-gap { height: 10px; }

/* effort */
.eff { position: relative; margin: 8px -4px 0; padding: 14px 0 8px; touch-action: pan-y; }
.eff-stops { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(var(--n), 1fr); }
.eff-stop { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 4px 0; text-align: center; }
.eff-stop svg {
  width: 36px;
  height: 36px;
  transition: transform .4s var(--spring), filter .4s;
}
.eff-stop .ph-dark { fill: rgba(40, 70, 140, .55); stroke: rgba(160, 210, 255, .35); stroke-width: 1; }
.eff-stop .ph-lit { fill: #e8f4ff; }
.eff-stop b { font: italic 800 11.5px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); text-shadow: 0 1px 6px rgba(2, 8, 28, .95); transition: color .3s; }
.eff-stop.is-sel svg { transform: scale(1.3) translateY(-2px); filter: drop-shadow(0 0 10px rgba(180, 225, 255, .95)); }
.eff-stop.is-sel b { color: #fff; }
.eff-stop.is-cur b::after { content: ''; display: block; width: 5px; height: 5px; margin: 6px auto 0; background: var(--cyan); transform: rotate(45deg); box-shadow: 0 0 6px var(--cyan); }
.eff-track { position: relative; height: 26px; margin: 10px calc(50% / var(--n)) 0; }
.eff-rail, .eff-fill { position: absolute; left: 0; top: 50%; height: 4px; margin-top: -2px; transform: skewX(-32deg); }
.eff-rail { right: 0; background: rgba(120, 170, 255, .18); }
.eff-fill {
  width: calc(var(--p) * 100%);
  background: linear-gradient(90deg, #3a6dff, #c4ecff);
  box-shadow: 0 0 12px rgba(130, 205, 255, .85);
  transition: width .45s var(--ease-out), opacity .3s;
}
.eff-knob {
  position: absolute;
  top: 50%;
  left: calc(var(--p) * 100%);
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, #d4e9ff 58%, #90b6f2);
  box-shadow: 0 0 0 5px rgba(120, 190, 255, .22), 0 0 24px rgba(180, 225, 255, .95);
  transition: left .45s var(--spring), background .3s, box-shadow .3s;
}
.eff.is-default .eff-fill { opacity: .25; }
.eff.is-default .eff-knob { background: rgba(10, 30, 80, .6); border: 2px dashed rgba(210, 236, 255, .85); box-shadow: 0 0 14px rgba(150, 210, 255, .5); }
.eff-read { margin-top: 18px; }
.eff-big {
  position: relative;
  isolation: isolate;
  margin-top: 8px;
  font: italic 900 36px/1 var(--display);
  color: #fff;
  text-shadow: 0 0 22px rgba(130, 200, 255, .6);
}
.eff-key { margin-left: 8px; font: 700 13px var(--mono); color: var(--cyan); text-shadow: none; }
.eff-desc { margin: 8px 0 0; font: 500 13.5px/1.45 var(--body); color: var(--ink2); }
.eff-now { margin-top: 10px; font: 700 11.5px var(--body); color: var(--ink3); letter-spacing: .04em; }
.eff-now b { color: var(--ice); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 11px 18px 11px 14px;
  font: italic 800 14px/1 var(--display);
  color: var(--ice);
  background: rgba(60, 110, 220, .22);
  clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
}
.chip small { font: 600 11.5px var(--body); color: var(--ink3); font-style: normal; }
.chip .box { width: 14px; height: 14px; border: 2px solid rgba(190, 225, 255, .7); transform: skewX(-12deg); }
.chip.is-on { background: linear-gradient(100deg, rgba(150, 210, 255, .42), rgba(60, 110, 220, .35)); color: #fff; }
.chip.is-on .box { background: #fff; border-color: #fff; box-shadow: 0 0 10px var(--cyan); }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 54px;
  padding: 0 22px;
  font: italic 800 16px/1.1 var(--display);
  letter-spacing: .03em;
  text-align: center;
  clip-path: polygon(13px 0, 100% 0, calc(100% - 13px) 100%, 0 100%);
}
.btn svg { width: 18px; height: 18px; }
.btn--primary { color: #04112e; background: linear-gradient(100deg, #f4fbff, #9ad9ff 55%, #5f9cff); }
.btn--primary:disabled { color: var(--ink3); background: rgba(80, 120, 210, .18); }
.btn--danger { color: #fff; background: linear-gradient(100deg, #ff8ba1, #e02a52 70%, #b3123c); }
.btn--ghost { color: var(--ice); background: rgba(80, 130, 230, .18); }
.apply { margin-top: 22px; }

.empty { padding: 26px 4px; font: 600 14px var(--body); color: var(--ink3); text-align: center; }

/* особые экраны: загрузка, нет связи, нет доступа */
.special {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: calc(30vh + 140px) 12px 0;
}
.special h2 {
  margin: 0;
  font: italic 900 32px/1 var(--display);
  color: #fff;
  text-shadow: 0 0 22px rgba(120, 190, 255, .55);
}
.special p { margin: 12px 0 0; max-width: 320px; font: 500 14px/1.5 var(--body); color: var(--ink2); }
.special p.small { font-size: 12px; color: var(--ink3); }
.special .btn { max-width: 280px; margin-top: 22px; }
.special .dots { display: inline-flex; gap: 6px; margin-top: 18px; }
.special .dots i { width: 7px; height: 7px; background: var(--cyan); transform: rotate(45deg); box-shadow: 0 0 8px var(--cyan); animation: blink 1.2s ease-in-out infinite; }
.special .dots i:nth-child(2) { animation-delay: .2s; }
.special .dots i:nth-child(3) { animation-delay: .4s; }

/* ======================= ОЖИДАНИЕ ПЕРЕЗАПУСКА ======================= */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(23vh + 160px) 24px calc(24px + var(--safe-b));
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .45s ease, visibility 0s linear .45s;
}
body.is-waiting .overlay { opacity: 1; visibility: visible; transition: opacity .7s ease .2s; }
.w-kick { font: 800 10.5px/1 var(--body); letter-spacing: .3em; text-transform: uppercase; color: var(--cyan); }
.w-title {
  margin-top: 10px;
  font: italic 900 46px/1 var(--display);
  letter-spacing: -.01em;
  color: transparent;
  background: linear-gradient(100deg, #8fb8ff 15%, #ffffff 35%, #8fb8ff 55%) 0 0 / 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 18px rgba(120, 190, 255, .55));
  animation: sheen 2.4s linear infinite;
}
.w-kick, .w-msg, .w-hint, .w-timer, .special p { text-shadow: 0 1px 8px rgba(2, 8, 28, .95), 0 0 2px rgba(2, 8, 28, .9); }
.w-msg { margin-top: 12px; max-width: 320px; font: 600 14px/1.45 var(--body); color: var(--ice); }
.w-timer { margin-top: 16px; font: italic 800 30px/1 var(--display); color: #fff; font-variant-numeric: tabular-nums; }
.w-hint { margin-top: 6px; font: 500 12px var(--body); color: var(--ink3); }
.w-hide {
  margin-top: 24px;
  padding: 10px 20px;
  font: italic 800 12px/1 var(--display);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ice);
  background: rgba(60, 110, 220, .22);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.wait-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 14px 6px 10px;
  font: italic 800 11.5px/1 var(--display);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ice);
  background: rgba(120, 120, 255, .25);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}

/* ======================= ВСПЛЫВАЮЩЕЕ ======================= */

.netbar {
  position: fixed;
  top: calc(8px + var(--safe-t));
  left: 50%;
  z-index: 7;
  max-width: min(92vw, 440px);
  padding: 9px 18px 9px 14px;
  font: 700 12.5px/1.3 var(--body);
  color: #fff;
  background: linear-gradient(100deg, rgba(190, 30, 72, .94), rgba(90, 10, 40, .94));
  clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
  transform: translate(-50%, -160%);
  transition: transform .5s var(--ease-out);
  pointer-events: none;
}
body.is-stale .netbar { transform: translate(-50%, 0); }
.netbar small { display: block; font-weight: 500; opacity: .8; }

.toasts {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(18px + var(--safe-b));
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: 440px;
  padding: 13px 20px 13px 16px;
  font: 700 14px/1.35 var(--body);
  color: #fff;
  background: linear-gradient(100deg, rgba(30, 80, 200, .95), rgba(10, 28, 80, .95));
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  opacity: 0;
  transform: translateY(26px) skewX(-8deg);
  transition: opacity .45s ease, transform .55s var(--ease-out);
}
.toast.in { opacity: 1; transform: none; }
.toast.out { opacity: 0; transform: translateX(46px) skewX(-8deg); transition-duration: .3s; }
.toast i { flex: none; width: 8px; height: 8px; background: var(--cyan); transform: rotate(45deg); box-shadow: 0 0 10px var(--cyan); }
.toast--err { background: linear-gradient(100deg, rgba(190, 28, 70, .96), rgba(80, 8, 32, .96)); }
.toast--err i { background: #ffc0cc; box-shadow: 0 0 10px #ff7f98; }
.toast--info { background: linear-gradient(100deg, rgba(60, 80, 150, .95), rgba(20, 30, 70, .95)); }
.toast--info i { background: var(--violet); box-shadow: 0 0 10px var(--violet); }

.sheet-layer { position: fixed; inset: 0; z-index: 8; display: flex; align-items: flex-end; justify-content: center; }
.sheet-layer[hidden] { display: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(1, 4, 14, .62); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: fadeIn .35s ease both; }
.sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  padding: 34px 22px calc(22px + var(--safe-b));
  background: linear-gradient(168deg, #133385 0%, #0a1c52 45%, #050e2c 100%);
  clip-path: polygon(0 26px, 100% 0, 100% 100%, 0 100%);
  animation: sheetIn .55s var(--ease-out) both;
}
.sheet::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 26px;
  background: linear-gradient(to top right, transparent 46%, rgba(200, 235, 255, .9) 50%, transparent 54%);
}
.sheet--danger { background: linear-gradient(168deg, #4a0f35 0%, #250826 45%, #10041a 100%); }
.sheet--danger::before { background: linear-gradient(to top right, transparent 46%, rgba(255, 150, 175, .95) 50%, transparent 54%); }
.sheet--danger .w-kick, .sheet--danger .kicker { color: #ff9db0; }
.sheet--danger .kicker::before { background: #ff9db0; box-shadow: 0 0 8px #ff6f8c; }
.sheet h2 { margin: 12px 0 12px; font: italic 900 34px/1 var(--display); color: #fff; text-shadow: 2px 3px 0 rgba(0, 0, 0, .35), 0 0 22px rgba(120, 190, 255, .35); }
.sheet p { margin: 0 0 8px; font: 500 14px/1.5 var(--body); color: var(--ink2); }
.sheet--danger p { color: #f1c6d1; }
.sheet .cmd { margin: 6px 0 4px; }
.sheet-actions { display: grid; gap: 10px; margin-top: 20px; }
.sheet-layer.is-out .sheet { animation: sheetOut .32s var(--ease-in) both; }
.sheet-layer.is-out .sheet-bg { animation: fadeOut .32s ease both; }
@keyframes sheetIn { from { transform: translateY(105%) skewY(-3deg); } }
@keyframes sheetOut { to { transform: translateY(105%) skewY(-3deg); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }

/* ======================= ВКЛАДКИ ======================= */

.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: calc(60px + var(--safe-b));
  padding: 0 14px var(--safe-b);
  background: linear-gradient(180deg, rgba(3, 10, 30, .55), rgba(2, 6, 20, .92));
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  border-top: 1px solid rgba(150, 205, 255, .16);
  transform: translateY(110%);
  transition: transform .45s var(--ease-out);
}
body.has-tabs .tabbar { transform: none; }
body.typing .tabbar, body.is-recording .tabbar { transform: translateY(110%); }
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  color: var(--ink3);
  font: italic 800 11px/1 var(--display);
  letter-spacing: .18em;
  text-transform: uppercase;
  transition: color .3s, transform .22s var(--spring), filter .2s;
}
.tab svg { width: 24px; height: 24px; transition: transform .4s var(--spring), filter .3s; }
.tab.is-on { color: #fff; }
.tab.is-on svg { color: var(--ice); transform: translateY(-1px) scale(1.08); filter: drop-shadow(0 0 8px var(--cyan)); }
.tab-ind {
  position: absolute;
  top: -1px;
  left: 14px;
  width: calc((100% - 28px) / 2);
  height: 3px;
  transform: translateX(calc(var(--t) * 100%));
  transition: transform .5s var(--spring);
  pointer-events: none;
}
.tab-ind::before {
  content: '';
  position: absolute;
  left: 28%;
  right: 28%;
  top: 0;
  bottom: 0;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
  transform: skewX(-32deg);
}
.tab-badge {
  position: absolute;
  top: 7px;
  left: calc(50% + 8px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  box-shadow: 0 0 10px rgba(255, 86, 116, .7);
  color: #fff;
  font: 800 10.5px/18px var(--body);
  font-style: normal;
  letter-spacing: 0;
  animation: pop .5s var(--spring);
}
@keyframes pop { from { transform: scale(.3); } }
body.has-tabs .screen[data-screen="home"] .screen-in { padding-bottom: calc(170px + var(--safe-b)); }

/* ======================= ЧАТ ======================= */

body[data-screen="chat"] { --mx: calc(var(--side) + var(--col) - 154px); --my: -56px; --ms: .3; --hz: 108px; }
body[data-screen="chat"] .path { opacity: .5; }

.screen--chat { overflow: hidden; padding: 0; }
.screen--chat .screen-in { padding: 0; min-height: 0; height: 100%; }
.chat {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  transition: bottom .4s var(--ease-out);
}
body.has-tabs .chat { bottom: calc(60px + var(--safe-b)); }
body.typing .chat, body.is-recording .chat { bottom: 0; }

.chat-top {
  position: relative;
  z-index: 2;
  flex: none;
  padding: calc(10px + var(--safe-t)) 14px 8px;
  background: linear-gradient(180deg, rgba(2, 7, 22, .6) 0%, rgba(2, 7, 22, .25) 70%, rgba(2, 7, 22, 0));
}
.ch-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-height: 30px; padding-right: 66px; }
.ch-st {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 9px;
  padding-top: 4px;
  font: italic 800 13px/1 var(--display);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #fff;
}
.ch-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.ch-st--busy .ch-dot { animation: breathe 1.2s ease-in-out infinite; }
.ch-st--restart .ch-dot { background: var(--violet); box-shadow: 0 0 10px var(--violet); border-radius: 2px; animation: spinDot 1s linear infinite; }
.ch-st--offline .ch-dot { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.ch-ctx { font: 600 11px/1 var(--body); letter-spacing: .03em; text-transform: none; font-style: normal; color: var(--ink3); }
.ch-clock { text-align: right; cursor: default; }
.ch-clock b { display: block; font: italic 800 21px/1 var(--display); color: #fff; text-shadow: 0 0 14px rgba(130, 195, 255, .5); }
.ch-clock span { display: block; margin-top: 3px; font: 700 9.5px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; }

.chips-row {
  display: flex;
  gap: 6px;
  margin: 10px -14px 0;
  padding: 0 14px 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 24px), transparent);
}
.chips-row::-webkit-scrollbar { display: none; }
.cchip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 78vw;
  padding: 9px 14px 9px 13px;
  background: linear-gradient(110deg, rgba(46, 98, 210, .58), rgba(10, 30, 82, .66));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.cc-k { font: 800 9.5px/1 var(--body); letter-spacing: .15em; text-transform: uppercase; color: var(--cyan); white-space: nowrap; }
.cchip b { max-width: 44vw; font: italic 800 14px/1.1 var(--display); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cchip svg { flex: none; width: 12px; height: 12px; opacity: .7; }
.cchip:disabled { opacity: .45; }

.feed-wrap { position: relative; flex: 1; min-height: 0; }
.feed {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 10px 12px 12px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16px, #000 calc(100% - 8px), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 16px, #000 calc(100% - 8px), transparent 100%);
}
.feed::-webkit-scrollbar { display: none; }
.feed-in { display: flex; flex-direction: column; justify-content: flex-end; gap: 7px; min-height: 100%; }
.feed-empty { margin: auto; padding: 30px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink2); }
.feed-empty b { font: italic 900 24px/1 var(--display); color: #fff; }
.feed-empty span { max-width: 280px; font: 500 13.5px/1.45 var(--body); }

.to-bottom {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 3;
  width: 46px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(22, 56, 140, .88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .3s, transform .35s var(--ease-out);
}
.to-bottom.show { opacity: 1; transform: none; pointer-events: auto; }
.to-bottom svg { width: 18px; height: 18px; }
.tb-n { position: absolute; top: 3px; right: 7px; font: 800 9.5px/1 var(--body); color: var(--cyan); }

/* сообщения */
.m { display: flex; flex-direction: column; max-width: 100%; }
.m-in { animation: msgIn .55s var(--ease-out) both; }
.m-user.m-in { animation-name: msgInR; }
@keyframes msgIn { from { opacity: 0; transform: translate(-22px, 10px) skewX(6deg); } }
@keyframes msgInR { from { opacity: 0; transform: translate(22px, 10px) skewX(-6deg); } }
.m-user { align-items: flex-end; padding-left: 40px; }
.m-bot { flex-direction: row; align-items: flex-end; gap: 8px; padding-right: 26px; }
.m-col { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; max-width: 100%; }
.bub {
  position: relative;
  max-width: 100%;
  padding: 10px 14px 11px;
  font: 500 15px/1.42 var(--body);
  overflow-wrap: anywhere;
}
.m-text { user-select: text; -webkit-user-select: text; }
.m-text b { font-weight: 800; }
.m-text code { padding: 1px 5px; font: 500 13px var(--mono); background: rgba(0, 0, 0, .28); border-radius: 3px; }
.m-pre {
  margin: 6px -4px;
  padding: 10px 12px;
  max-width: 100%;
  overflow-x: auto;
  font: 500 12.5px/1.45 var(--mono);
  background: rgba(0, 0, 0, .35);
  white-space: pre;
  user-select: text;
  -webkit-user-select: text;
}
.m-link { color: var(--cyan); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.m-muted { opacity: .7; font-style: italic; }
.m-meta { margin-top: 4px; padding: 0 4px; font: 600 10.5px/1.2 var(--body); color: var(--ink4); letter-spacing: .03em; }
.m-from { margin-bottom: 5px; font: 800 9px/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }

.m-app .bub {
  color: #04122e;
  background: linear-gradient(135deg, #f4fbff 0%, #c4e8ff 55%, #95cbff 100%);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}
.m-app .m-text code { background: rgba(4, 18, 46, .1); }
.m-app .m-link { color: #0b4fb3; }
.m-tg .bub {
  color: var(--ink);
  background: linear-gradient(135deg, rgba(74, 128, 240, .62), rgba(30, 62, 160, .62));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}
.m-bot .bub {
  color: var(--ink);
  background: linear-gradient(160deg, rgba(22, 52, 128, .84), rgba(8, 22, 64, .88));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%, 0 12px);
}
.m-bot .bub::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--cyan), transparent);
  box-shadow: 0 0 8px var(--cyan);
}
.m-ava {
  flex: none;
  width: 26px;
  height: 26px;
  margin-bottom: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff 0 12%, #dbe9ff 45%, #93b2ea 100%);
  box-shadow: 0 0 12px rgba(170, 215, 255, .65);
}
.m-out.is-sending .bub { opacity: .78; }
.m-out.is-error .bub { opacity: .65; filter: saturate(.4); }
.m-out.is-error .m-meta { color: var(--danger2); }
.m-retry { display: inline-flex; align-items: center; gap: 4px; font: 800 10.5px var(--body); color: var(--cyan); }
.m-retry svg { width: 12px; height: 12px; }

/* картинки и файлы */
.m-imgs { display: grid; gap: 3px; width: min(250px, 64vw); margin: -4px -8px 8px; }
.m-imgs:last-child { margin-bottom: -5px; }
.m-imgs.n1 { grid-template-columns: 1fr; }
.m-imgs.n2, .m-imgs.n4 { grid-template-columns: 1fr 1fr; }
.m-imgs.n3 { grid-template-columns: 1fr 1fr 1fr; }
.m-img {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: rgba(120, 170, 255, .18);
}
.m-imgs.n1 .m-img { aspect-ratio: auto; min-height: 120px; max-height: 320px; }
.m-img img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s; }
.m-imgs.n1 .m-img img { height: auto; max-height: 320px; }
.m-img.ok img { opacity: 1; }
.m-img:not(.ok)::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(200, 235, 255, .25) 50%, transparent 70%) 0 0 / 250% 100%;
  animation: sheen 1.2s linear infinite;
}
.m-img.fail::after { content: 'нет картинки'; display: grid; place-items: center; font: 600 11px var(--body); color: var(--ink3); background: rgba(10, 30, 80, .6); animation: none; }
.m-file {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(250px, 64vw);
  margin: 2px 0 6px;
  padding: 8px 12px 8px 8px;
  color: inherit;
  background: rgba(0, 0, 0, .2);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.m-file:last-child { margin-bottom: 0; }
.m-app .m-file { background: rgba(4, 18, 46, .1); }
.m-file svg { flex: none; width: 18px; height: 18px; opacity: .75; }
.f-ic {
  flex: none;
  width: 36px;
  height: 42px;
  display: grid;
  place-items: center;
  padding-top: 8px;
  font: italic 900 9.5px/1 var(--display);
  color: #04122e;
  background: linear-gradient(160deg, #f1faff, #96d4ff);
  clip-path: polygon(0 0, 68% 0, 100% 28%, 100% 100%, 0 100%);
}
.m-app .f-ic { background: linear-gradient(160deg, #0d2c6c, #2b62c9); color: #e7f5ff; }
.f-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.f-name { font: 700 13.5px/1.25 var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-sub { font: 600 11px/1.2 var(--body); opacity: .65; }

/* голосовые */
.m-voice { display: flex; align-items: center; gap: 10px; min-width: 190px; margin-bottom: 5px; }
.v-ic, .v-play {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #cdeeff;
  background: #0a2a6a;
  box-shadow: 0 0 0 3px rgba(10, 42, 106, .15);
}
.v-ic svg, .v-play svg { width: 16px; height: 16px; }
.m-tg .v-ic, .m-bot .v-ic, .m-tg .v-play, .m-bot .v-play { color: #04122e; background: var(--ice); }
.v-wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 26px; }
.v-wave i { flex: 1; height: calc(var(--v) * 100%); background: currentColor; opacity: .5; border-radius: 1px; transform: skewX(-14deg); }
.v-dur { font: 700 11px var(--mono); opacity: .75; }

/* статусы, ошибки, разделители */
.m.m-status {
  align-self: center;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 1px 0;
  padding: 6px 15px 6px 12px;
  font: italic 700 12px/1.2 var(--display);
  letter-spacing: .06em;
  color: var(--ink3);
  background: rgba(40, 80, 170, .2);
  clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
}
.st-ic { display: inline-flex; align-items: center; gap: 3px; }
.st-ic svg { width: 8px; height: 8px; color: var(--ink4); }
.st-ic i { width: 5px; height: 5px; background: var(--cyan); transform: rotate(45deg); box-shadow: 0 0 6px var(--cyan); animation: blink 1s ease-in-out infinite; }
.st-ic i:nth-child(2) { animation-delay: .2s; }
.st-ic i:nth-child(3) { animation-delay: .4s; }
.m-status.is-live { color: #fff; background: linear-gradient(100deg, rgba(70, 130, 250, .42), rgba(30, 70, 170, .3)); }
.m-status.is-live .st-t {
  background: linear-gradient(100deg, #9fc8ff 20%, #fff 40%, #9fc8ff 60%) 0 0 / 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 2s linear infinite;
}
.m.m-sep, .m-day {
  align-self: stretch;
  flex-direction: row;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 6px;
  font: italic 800 10px/1 var(--display);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink3);
}
.m-sep::before, .m-sep::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(150, 205, 255, .4)); }
.m-sep::after { background: linear-gradient(90deg, rgba(150, 205, 255, .4), transparent); }
.m-day { justify-content: center; }
.m-day span { padding: 5px 13px; color: var(--ice); background: rgba(10, 30, 80, .62); clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.m-err { align-items: flex-start; padding-right: 26px; }
.err-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px 11px 12px;
  color: #ffd6df;
  font: 500 13.5px/1.4 var(--body);
  background: linear-gradient(120deg, rgba(180, 28, 72, .5), rgba(60, 8, 30, .62));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-left: 3px solid var(--danger);
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.err-card svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--danger2); }
.err-card b { display: block; margin-bottom: 2px; font: italic 800 13px var(--display); letter-spacing: .05em; color: #fff; }

.m-typing .bub { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ice); animation: dotPulse 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .16s; }
.dots i:nth-child(3) { animation-delay: .32s; }
@keyframes dotPulse { 0%, 80%, 100% { transform: scale(.5); opacity: .35; } 40% { transform: scale(1); opacity: 1; box-shadow: 0 0 8px var(--cyan); } }
.ty-t { font: italic 700 12.5px var(--display); letter-spacing: .05em; color: var(--ink2); }

/* запрос разрешения */
.m.m-perm { align-self: stretch; }
.perm {
  position: relative;
  margin: 8px 0 4px;
  padding: 15px 16px 16px 20px;
  background: linear-gradient(128deg, rgba(255, 196, 96, .2), rgba(30, 66, 160, .66) 42%, rgba(8, 22, 64, .8));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}
.perm::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 18px;
  width: 3px;
  background: linear-gradient(180deg, #ffd27a, rgba(255, 210, 122, 0));
  box-shadow: 0 0 12px #ffc861;
}
.perm-k { display: flex; align-items: center; gap: 8px; font: 800 10.5px/1 var(--body); letter-spacing: .18em; text-transform: uppercase; color: #ffdc94; }
.perm-k svg { width: 16px; height: 16px; animation: blink 1.6s ease-in-out infinite; }
.perm-tool { margin-top: 9px; font: italic 900 26px/1 var(--display); color: #fff; }
.perm-desc { margin-top: 6px; font: 600 14px/1.4 var(--body); color: var(--ice); }
.perm-more { display: inline-flex; align-items: center; gap: 5px; margin-top: 9px; font: 700 12.5px var(--body); color: var(--cyan); }
.perm-more svg { width: 14px; height: 14px; }
.perm-pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  max-height: 180px;
  overflow: auto;
  font: 500 12px/1.5 var(--mono);
  color: var(--ice);
  background: rgba(0, 0, 0, .38);
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
  -webkit-user-select: text;
}
.perm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.perm-actions .btn { min-height: 46px; font-size: 15px; }
.perm.is-done { opacity: .75; }
.perm-done { margin-top: 12px; font: italic 800 14px var(--display); color: var(--cyan); }
.perm-mode { display: block; width: 100%; margin-top: 11px; padding: 0; text-align: left; font: 500 12px/1.4 var(--body); color: var(--ink2); }
.grp-bot { margin-top: 10px; font: italic 800 21px/1.1 var(--display); color: #fff; overflow-wrap: anywhere; }
.grp-sub { margin-top: 5px; font: 500 12.5px/1.35 var(--body); color: var(--ink2); }
.perm-mode b { font-weight: 800; color: var(--cyan); white-space: nowrap; }

/* баннер над полем ввода: перезапуск, бот выключен, подсказка про микрофон */
.chat-banner { flex: none; padding: 0 12px; }
.chat-banner:empty { display: none; }
.cb {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0 6px;
  padding: 11px 14px;
  background: linear-gradient(110deg, rgba(70, 76, 200, .58), rgba(16, 24, 80, .74));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  animation: msgIn .5s var(--ease-out) both;
}
.cb > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cb b { font: italic 800 15px/1.1 var(--display); color: #fff; }
.cb span { font: 500 12px/1.35 var(--body); color: var(--ink2); }
.cb .cb-hint { font-size: 11px; color: var(--ink3); }
.cb > svg { flex: none; width: 20px; height: 20px; color: var(--ice); }
.cb-time { flex: none; font: italic 800 19px/1 var(--display); color: #fff; font-variant-numeric: tabular-nums; }
.cb-moon {
  position: relative;
  flex: none;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff 0 12%, #dbe9ff 45%, #93b2ea 100%);
  box-shadow: 0 0 16px rgba(170, 215, 255, .7);
}
.cb-moon i { position: absolute; inset: -2px; border-radius: 50%; background: #060d2c; transform: translateX(110%); animation: eclipse 3.2s ease-in-out infinite; }
.cb--off { background: linear-gradient(110deg, rgba(170, 26, 70, .6), rgba(48, 6, 28, .75)); }
.cb--off > svg { color: var(--danger2); }
.cb--srv { background: linear-gradient(110deg, rgba(40, 70, 170, .6), rgba(8, 16, 52, .78)); }
.cb--srv > svg { color: var(--violet); }
.cb--err { background: linear-gradient(110deg, rgba(120, 60, 30, .55), rgba(40, 16, 10, .7)); }
.cb--err > svg { color: #ffc861; }
.cb-go, .cb-x {
  flex: none;
  display: grid;
  place-items: center;
  padding: 8px 12px;
  font: italic 800 12px/1 var(--display);
  letter-spacing: .08em;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.cb-x { width: 34px; height: 34px; padding: 0; }
.cb-x svg { width: 14px; height: 14px; }

/* поле ввода */
.composer { position: relative; flex: none; padding: 4px 10px 10px; }
.tray { display: flex; gap: 8px; padding: 2px 2px 8px; overflow-x: auto; scrollbar-width: none; }
.tray:empty { display: none; }
.tray::-webkit-scrollbar { display: none; }
.tr-item {
  position: relative;
  flex: none;
  width: 78px;
  height: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px;
  background: rgba(12, 34, 90, .78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  animation: msgIn .4s var(--ease-out) both;
}
.tr-img { padding: 0; }
.tr-img img { width: 100%; height: 100%; object-fit: cover; }
.tr-item .f-ic { width: 30px; height: 36px; padding-top: 6px; }
.tr-name { max-width: 100%; font: 600 10px/1.2 var(--body); color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-size { position: absolute; left: 5px; bottom: 4px; font: 800 9px/1 var(--body); color: #fff; text-shadow: 0 1px 3px #000, 0 0 6px #000; }
.tr-item:not(.tr-img) .tr-size { display: none; }
.tr-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: rgba(2, 8, 24, .82); }
.tr-x svg { width: 12px; height: 12px; }
.tr-count { flex: none; align-self: center; padding: 0 6px; font: italic 800 12px var(--display); color: var(--ink3); }

.comp-row, .rec-row { display: flex; align-items: flex-end; gap: 7px; }
.rec-row { display: none; align-items: center; }
.composer.is-rec .comp-row, .composer.is-rec .tray { display: none; }
.composer.is-rec .rec-row { display: flex; animation: msgIn .35s var(--ease-out) both; }
.c-btn {
  flex: none;
  width: 44px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--ice);
  background: rgba(46, 96, 210, .32);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.c-btn svg { width: 22px; height: 22px; }
.c-btn--danger { color: var(--danger2); background: rgba(170, 26, 70, .35); }
.c-field {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 0 14px;
  background: rgba(8, 24, 66, .82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 1px rgba(150, 205, 255, .18);
  clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
  transition: box-shadow .3s;
}
.c-field:focus-within { box-shadow: inset 0 0 0 1px rgba(150, 215, 255, .55), inset 0 0 18px rgba(110, 190, 255, .18); }
.c-field textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  max-height: 140px;
  margin: 0;
  padding: 12px 0;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 500 16px/1.4 var(--body);
  user-select: text;
  -webkit-user-select: text;
}
.c-field textarea::placeholder { color: var(--ink4); }
.c-send {
  position: relative;
  flex: none;
  width: 50px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #04122e;
  background: linear-gradient(120deg, #f4fbff, #9ad9ff 55%, #5f9cff);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.c-send > span { grid-area: 1 / 1; display: grid; place-items: center; transition: transform .35s var(--spring), opacity .2s; }
.c-send svg { width: 22px; height: 22px; }
.c-send .i-send { opacity: 0; transform: scale(.4) rotate(-45deg); }
.composer.has-content .c-send .i-send, .c-send.is-send .i-send { opacity: 1; transform: none; }
.composer.has-content .c-send .i-mic { opacity: 0; transform: scale(.4) rotate(45deg); }
.composer.is-locked .c-field { opacity: .55; }
.c-btn:disabled, .c-send:disabled { opacity: .45; }
.rec-mid {
  flex: 1;
  min-width: 0;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: linear-gradient(100deg, rgba(180, 26, 72, .5), rgba(20, 30, 84, .8));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
}
.rec-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #ff4f6e; box-shadow: 0 0 12px #ff4f6e; animation: blink 1s ease-in-out infinite; }
.rec-time { flex: none; min-width: 38px; font: italic 800 17px/1 var(--display); color: #fff; font-variant-numeric: tabular-nums; }
.rec-wave { flex: 1; min-width: 0; height: 28px; display: flex; align-items: center; gap: 2px; overflow: hidden; }
.rec-wave i { flex: 1; height: 100%; background: linear-gradient(180deg, #fff, var(--ice)); border-radius: 1px; transform: scaleY(.08); transition: transform .09s linear; }

/* выбор из чипов */
.sheet--picker { display: flex; flex-direction: column; max-height: 84vh; padding-bottom: calc(12px + var(--safe-b)); }
.pk-warn {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 8px;
  padding: 10px 12px;
  font: 600 12.5px/1.35 var(--body);
  color: #ffe2a8;
  background: rgba(255, 190, 90, .12);
  border-left: 2px solid #ffc861;
}
.pk-warn svg { flex: none; width: 16px; height: 16px; }
.pk-list { flex: 1; min-height: 0; margin: 0 -6px; padding: 0 6px 4px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.pk-sec { margin: 12px 2px 7px; font: 800 10px/1 var(--body); letter-spacing: .18em; text-transform: uppercase; color: var(--cyan); }
.pk-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 6px;
  padding: 10px 14px 10px 12px;
  background: rgba(46, 90, 200, .24);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.pk-row.is-on { background: linear-gradient(110deg, rgba(130, 195, 255, .38), rgba(40, 90, 200, .38)); }
.pk-ic { flex: none; width: 30px; display: grid; place-items: center; }
.pk-ic svg { width: 28px; height: 28px; }
.pk-mono {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font: italic 900 14px/1 var(--display);
  color: #04122e;
  background: linear-gradient(140deg, #f2fbff, #8fd6ff);
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
}
.pk-b { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pk-b b { font: italic 800 16px/1.15 var(--display); color: #fff; }
.pk-b span { margin-top: 3px; font: 500 11.5px/1.3 var(--body); color: var(--ink3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-go { flex: none; width: 20px; height: 20px; color: #fff; }
.pk-go svg { width: 100%; height: 100%; filter: drop-shadow(0 0 6px var(--cyan)); }
.pk-foot { padding-top: 6px; text-align: center; }
.pk-foot button { padding: 8px 12px; font: 700 12.5px var(--body); color: var(--cyan); text-align: center; }
.ph-dark { fill: rgba(40, 70, 140, .55); stroke: rgba(160, 210, 255, .35); stroke-width: 1; }
.ph-lit { fill: #e8f4ff; }

/* просмотр картинки */
.lightbox { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .3s ease; }
.lightbox[hidden] { display: none; }
.lightbox.in { opacity: 1; }
.lb-bg { position: absolute; inset: 0; background: rgba(1, 4, 14, .92); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lb-fig { position: relative; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; transform: scale(.94); transition: transform .45s var(--ease-out); pointer-events: none; }
.lightbox.in .lb-fig { transform: none; }
.lb-fig img { display: block; max-width: 94vw; max-height: 76vh; object-fit: contain; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.lb-fig figcaption { font: 600 12px var(--body); color: var(--ink2); }
.lb-x {
  position: absolute;
  top: calc(12px + var(--safe-t));
  right: 12px;
  width: 46px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(40, 80, 170, .45);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.lb-x svg { width: 20px; height: 20px; }
.lb-dl {
  position: absolute;
  left: 50%;
  bottom: calc(18px + var(--safe-b));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  font: italic 800 14px/1 var(--display);
  color: #04122e;
  background: linear-gradient(100deg, #f2fbff, #8fd6ff);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  transform: translateX(-50%);
}
.lb-dl svg { width: 16px; height: 16px; }

/* тосты в чате — сверху, чтобы не закрывать поле ввода */
/* тосты приложения — внизу, над вкладками и полем ввода; сверху — уведомления бота */
body.has-tabs .toasts { bottom: calc(76px + var(--safe-b)); }
body[data-screen="chat"].has-tabs .toasts { bottom: calc(136px + var(--safe-b)); }
body[data-screen="chat"].typing .toasts, body[data-screen="chat"].is-recording .toasts { bottom: calc(76px + var(--safe-b)); }

/* ======================= УВЕДОМЛЕНИЯ БОТА ======================= */

.notices {
  position: fixed;
  top: calc(8px + var(--safe-t));
  left: 0;
  right: 0;
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  pointer-events: none;
}
.ntc {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  pointer-events: auto;
  color: #fff;
  background: linear-gradient(110deg, rgba(30, 72, 176, .95), rgba(8, 22, 64, .96) 70%);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  opacity: 0;
  transform: translateY(-130%) skewX(-7deg);
  transition: transform .65s var(--ease-out), opacity .4s ease;
}
.ntc.in { opacity: 1; transform: none; }
.ntc.out { opacity: 0; transform: translate(46px, -8px) skewX(-7deg); transition-duration: .38s; }
.ntc::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  right: 0;
  height: 1.5px;
  background: linear-gradient(90deg, rgba(210, 240, 255, .95), transparent 75%);
}
.ntc::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  background: linear-gradient(to bottom right, transparent 44%, var(--ntc-acc, #8fdcff) 50%, transparent 56%);
}
.ntc-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 10px 15px 22px;
  cursor: pointer;
}
.ntc-ic {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  margin-top: 1px;
  border-radius: 50%;
  color: var(--ntc-acc, #8fdcff);
  background: rgba(255, 255, 255, .1);
  box-shadow: 0 0 14px rgba(140, 210, 255, .25);
}
.ntc-ic svg { width: 18px; height: 18px; }
.ntc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ntc-k { font: 800 9.5px/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--ntc-acc, #8fdcff); }
.ntc-t {
  font: 600 14px/1.38 var(--body);
  color: #fff;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ntc-t code { padding: 1px 5px; font: 500 12.5px var(--mono); background: rgba(0, 0, 0, .3); border-radius: 3px; }
.ntc-t .m-link { color: var(--ntc-acc, #8fdcff); }
.ntc-more { font: 600 11px/1.2 var(--body); color: rgba(255, 255, 255, .6); }
.ntc-open {
  flex: none;
  align-self: center;
  margin-right: 20px;
  padding: 11px 16px;
  font: italic 800 13.5px/1 var(--display);
  letter-spacing: .03em;
  color: #2a1700;
  background: linear-gradient(100deg, #fff3d6, #ffc861);
  clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
}
.ntc-bar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2px;
  background: var(--ntc-acc, #8fdcff);
  box-shadow: 0 0 8px var(--ntc-acc, #8fdcff);
  transform-origin: 0 50%;
  opacity: .8;
  animation-name: ntcBar;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  animation-play-state: paused;
}
.ntc.in .ntc-bar { animation-play-state: running; }
@keyframes ntcBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.ntc--error {
  --ntc-acc: #ffb3c2;
  background: linear-gradient(110deg, rgba(214, 36, 78, .96), rgba(96, 8, 36, .97) 72%);
}
.ntc--error.in { animation: ntcJolt .55s var(--ease-out) .1s; }
@keyframes ntcJolt { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.ntc--error .ntc-ic { color: #fff; background: rgba(255, 255, 255, .18); box-shadow: 0 0 16px rgba(255, 120, 150, .6); }
.ntc--error .ntc-t { font-weight: 700; }
.ntc--permission {
  --ntc-acc: #ffd98a;
  background: linear-gradient(110deg, rgba(150, 100, 22, .94), rgba(28, 44, 110, .96) 55%, rgba(8, 22, 64, .97));
}
.ntc--permission .ntc-ic { box-shadow: 0 0 16px rgba(255, 200, 100, .5); }

/* подсветка карточки разрешения после «Открыть» */
.perm.is-flash { animation: permFlash 1.8s ease; }
@keyframes permFlash { 0%, 100% { filter: none; } 15%, 55% { filter: brightness(1.55) saturate(1.2); } 35%, 75% { filter: brightness(1); } }

/* переключатель «тёмного часа» на пульте */
.dh-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-top: 22px;
  padding: 14px 16px;
  background: linear-gradient(112deg, rgba(40, 70, 40, .45), rgba(8, 20, 40, .6));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.dh-orb {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, #f6ffd0 0 10%, #c9e66a 50%, #6f8f2a 100%);
  box-shadow: 0 0 18px rgba(190, 240, 90, .55);
}
.dh-txt { display: flex; flex-direction: column; gap: 3px; }
.dh-txt b { font: italic 800 16px/1.1 var(--display); color: #fff; }
.dh-txt small { font: 500 11.5px/1.3 var(--body); color: var(--ink3); }

/* ======================= ТЁМНЫЙ ЧАС ======================= */
/* Своя трактовка: в первый час суток всё замирает. Зеленовато-чёрная палитра, огромная
   больная луна, вода темнеет, движения замедляются, по экрану идут зерно и помехи. */

body.dark-hour { --tempo: 3.4; }
body.dark-hour[data-screen="home"]:not(.is-scrolled) { --mx: calc(var(--side) + var(--col) * .62 - 110px); --my: 66px; --ms: 1.72; --hz: 336px; }
body.dark-hour[data-screen="chat"] { --mx: calc(var(--side) + var(--col) * .66 - 110px); --my: 46px; --ms: 1.4; --hz: 268px; }
body.dark-hour[data-screen="sub"] { --ms: .5; }
body.dh-shift .rig, body.dh-shift .sea, body.dh-shift .path, body.dh-shift .ripples { transition-duration: 3s; }

.dh-veil {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 3s ease;
  background:
    radial-gradient(70% 45% at 62% 22%, rgba(130, 170, 40, .2), transparent 70%),
    linear-gradient(180deg, #010302 0%, #020a05 38%, #04140b 66%, #072012 100%);
}
body.dark-hour .dh-veil { opacity: 1; }
.stars { transition: opacity 3s ease, filter 3s ease; }
body.dark-hour .stars { opacity: .3; filter: hue-rotate(-100deg) saturate(.6); }
body.dark-hour .meteor { display: none; }

.sea::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(34, 58, 14, .88) 0%, rgba(4, 16, 8, .95) 8%, #010603 50%, #000201 100%);
  opacity: 0;
  transition: opacity 3s ease;
  pointer-events: none;
}
body.dark-hour .sea::after { opacity: 1; }
.path, .ripples, .horizon { z-index: 1; }
.path, .horizon { transition: transform 1.1s var(--ease-out), opacity 1s, filter 3s ease; }
body.dark-hour .path { opacity: .5; filter: hue-rotate(-110deg) saturate(1.5) brightness(.85); }
body.dark-hour .horizon { opacity: .6; filter: hue-rotate(-110deg) saturate(1.4); }
body.dark-hour .ripples { opacity: .55; filter: hue-rotate(-110deg); }
body.dark-hour .ripples i { animation: ripple calc(3s * var(--tempo, 1)) ease-out infinite; }

.moon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, rgba(245, 255, 200, .45), rgba(196, 222, 96, .8) 55%, rgba(104, 132, 36, .95));
  mix-blend-mode: multiply;
  opacity: 0;
  transition: opacity 3s ease;
  pointer-events: none;
}
body.dark-hour .moon::after { opacity: 1; }
body.dark-hour .dial { opacity: .45; }

.app { transition: opacity .55s ease, transform .7s var(--ease-out), filter 3s ease; }
body.dark-hour .app { filter: hue-rotate(-98deg) saturate(.72) brightness(.9) contrast(1.06); }
.dh-cap { color: #c9f27a !important; font-style: normal; }
body.dark-hour .clock b, body.dark-hour .ch-clock b { color: #e6ffc0; text-shadow: 0 0 18px rgba(190, 240, 100, .55); animation: dhClock 4s steps(1) infinite; }
@keyframes dhClock { 0%, 100% { opacity: 1; } 47% { opacity: .55; } 49% { opacity: 1; } 83% { opacity: .75; } 84% { opacity: 1; } }
body.dark-hour .dh-toggle .dh-orb { animation: breathe calc(1.6s * var(--tempo, 1)) ease-in-out infinite; }

.dh-fx { position: fixed; inset: 0; z-index: 7; pointer-events: none; opacity: 0; transition: opacity 3s ease; overflow: hidden; }
body.dark-hour .dh-fx { opacity: 1; }
.dh-grain {
  position: absolute;
  inset: -80px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .62  0 0 0 0 1  0 0 0 0 .5  0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
  opacity: .12;
  mix-blend-mode: screen;
}
body.dark-hour .dh-grain { animation: grain .8s steps(5) infinite; }
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-24px, 16px); }
  40% { transform: translate(20px, -28px); }
  60% { transform: translate(-32px, -10px); }
  80% { transform: translate(14px, 30px); }
}
.dh-scan { position: absolute; inset: 0; background: repeating-linear-gradient(180deg, rgba(170, 255, 150, .035) 0 1px, transparent 1px 3px); }
.dh-band {
  position: absolute;
  left: 0;
  right: 0;
  top: -140px;
  height: 110px;
  background: linear-gradient(180deg, transparent, rgba(170, 255, 120, .06) 35%, rgba(225, 255, 190, .13) 50%, rgba(170, 255, 120, .06) 65%, transparent);
  mix-blend-mode: screen;
}
body.dark-hour .dh-band { animation: band 11s linear infinite; }
@keyframes band { to { transform: translateY(calc(100vh + 280px)); } }
.dh-vig { position: absolute; inset: 0; background: radial-gradient(125% 95% at 50% 42%, transparent 52%, rgba(0, 10, 2, .7) 100%); }
body.dark-hour .dh-vig { animation: dhFlick 7s steps(1) infinite; }
@keyframes dhFlick { 0%, 100% { opacity: 1; } 61% { opacity: .7; } 62% { opacity: 1; } 63% { opacity: .82; } 64% { opacity: 1; } }

/* тёмный час: всплывающее */
body.dark-hour .ntc { --ntc-acc: #c9f27a; background: linear-gradient(110deg, rgba(40, 70, 18, .96), rgba(4, 14, 8, .97) 72%); }
body.dark-hour .ntc::before { background: linear-gradient(90deg, rgba(220, 255, 170, .9), transparent 75%); }
body.dark-hour .ntc-ic { box-shadow: 0 0 16px rgba(190, 240, 100, .35); }
body.dark-hour .ntc--error { --ntc-acc: #ffb08a; background: linear-gradient(110deg, rgba(160, 58, 14, .96), rgba(34, 10, 4, .97) 72%); }
body.dark-hour .ntc--error .ntc-ic { box-shadow: 0 0 16px rgba(255, 140, 80, .55); }
body.dark-hour .ntc--permission { --ntc-acc: #e8f27a; background: linear-gradient(110deg, rgba(110, 110, 18, .94), rgba(10, 22, 8, .97) 60%); }
body.dark-hour .ntc-open { color: #102000; background: linear-gradient(100deg, #f4ffd6, #b8e35c); }
body.dark-hour .ntc-t { color: #f0ffe0; }
body.dark-hour .toasts, body.dark-hour .sheet-layer, body.dark-hour .overlay, body.dark-hour .netbar { filter: hue-rotate(-98deg) saturate(.72) brightness(.92) contrast(1.05); }

/* ======================= РАЗМЕРЫ ======================= */

@media (max-width: 380px) {
  body { --mx: calc(var(--side) + var(--col) - 218px); --my: 42px; --ms: .88; }
}
@media (max-width: 370px) {
  .ai-name { font-size: 46px; }
  .title { font-size: 39px; }
  .title--long { font-size: 32px; }
  .tile .v { font-size: 17.5px; }
  .act { grid-template-columns: 24px 1fr; padding-left: 13px; column-gap: 9px; }
  .act svg { width: 24px; height: 24px; }
  .act b { font-size: 15.5px; }
}
@media (min-width: 440px) {
  .hero { min-height: 220px; }
}
@media (max-height: 560px) {
  .hero { min-height: 170px; }
}

/* ======================= МЕНЬШЕ ДВИЖЕНИЯ ======================= */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
  .sweep, .meteor { display: none; }
  .path i { opacity: .7; }
  .stars i { opacity: var(--o, .7); }
}
