:root {
  color-scheme: dark;
  --bg: #010407;
  --glass: rgba(6, 13, 21, .66);
  --line: rgba(154, 204, 239, .28);
  --text: #f2f7fb;
  --muted: #8794a1;
  --cyan: #55dbff;
  --blue: #528dff;
  --violet: #a87cff;
  --danger: #ff7193;
  --orb-level: 0;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: radial-gradient(ellipse at 50% 42%, rgba(12, 50, 78, .16), transparent 45%), linear-gradient(135deg, #000204 0%, #02080d 55%, #000205 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#space { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .9; }
.dashboard { position: relative; z-index: 1; min-height: 100svh; width: min(1920px, 100%); margin: 0 auto; padding: 42px clamp(24px, 4vw, 74px) 34px; }
.topbar { height: 96px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; position: relative; z-index: 5; }
.clock time { display: block; font-size: clamp(2.35rem, 3.55vw, 4.15rem); line-height: .85; font-weight: 200; letter-spacing: -.055em; }
.clock p { margin: 12px 0 0; color: #86919d; font-size: .8rem; text-transform: capitalize; }
.wordmark { justify-self: center; padding-top: 6px; font-family: "Helvetica Neue", Inter, sans-serif; font-size: clamp(1.55rem, 2.4vw, 2.45rem); font-weight: 150; letter-spacing: .73em; margin-right: -.73em; color: #f1f4f8; text-shadow: 0 0 24px rgba(166, 223, 255, .16); }
.weather-offline { justify-self: end; display: flex; gap: 13px; align-items: center; color: var(--muted); text-align: left; }
.weather-offline svg { width: 42px; height: 42px; fill: #d8ecff; filter: drop-shadow(0 0 9px rgba(119, 188, 255, .56)); }
.weather-offline strong, .weather-offline span { display: block; }
.weather-offline strong { color: #dfe8f0; font-size: 1rem; font-weight: 400; }
.weather-offline span { margin-top: 3px; font-size: .72rem; }

.experience { min-height: calc(100svh - 172px); display: grid; grid-template-columns: minmax(240px, 340px) minmax(560px, 1fr) minmax(240px, 340px); gap: clamp(18px, 2.5vw, 48px); align-items: center; }
.glass-card { background: linear-gradient(150deg, rgba(9, 18, 28, .72), rgba(3, 8, 14, .46)); border: 1px solid var(--line); box-shadow: 0 24px 64px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.025); backdrop-filter: blur(20px); }
.schedule-card { align-self: end; margin-bottom: 68px; border-radius: 18px; padding: 20px 22px 22px; min-height: 176px; }
.card-title { display: flex; justify-content: space-between; align-items: center; }
.card-title h2 { margin: 0; font-size: 1.05rem; font-weight: 400; }
.card-title > span { font-size: 1.85rem; line-height: 1; color: #d9e7f3; font-weight: 200; }
.offline-empty { display: flex; gap: 13px; align-items: flex-start; margin-top: 29px; }
.offline-empty i { width: 11px; height: 11px; margin-top: 4px; flex: 0 0 auto; border-radius: 50%; background: #526473; box-shadow: 0 0 10px rgba(93, 220, 255, .16); }
.offline-empty strong, .offline-empty span { display: block; }
.offline-empty strong { color: #dbe5ed; font-size: .82rem; font-weight: 460; }
.offline-empty span { margin-top: 6px; color: #7f8c99; font-size: .69rem; line-height: 1.5; }

.voice-core { align-self: stretch; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: 10px; }
.orb-wrap { position: relative; width: min(56vw, 660px); aspect-ratio: 1.48 / 1; display: grid; place-items: center; transform: scale(calc(1 + var(--orb-level) * .045)); transition: transform 80ms linear; }
.orb-image { position: relative; z-index: 2; width: 66%; max-width: 470px; filter: drop-shadow(0 0 26px rgba(75, 198, 255, .72)) drop-shadow(0 0 70px rgba(59, 105, 255, .32)); animation: orbFloat 6s ease-in-out infinite; }
.particle-aura { position: absolute; z-index: 1; width: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(101, 211, 255, .18), transparent 66%); filter: blur(18px); animation: halo 4s ease-in-out infinite; }
.particle-aura::after { content: ""; position: absolute; inset: -18%; opacity: .52; background-image: radial-gradient(circle, #a7eaff 0 1px, transparent 1.7px); background-size: 17px 19px; mask-image: radial-gradient(circle, #000 0 48%, transparent 72%); animation: dust 18s linear infinite; }
.orbit { position: absolute; z-index: 3; width: 100%; height: 44%; border: 1px solid rgba(101, 178, 255, .48); border-radius: 50%; transform: rotate(-8deg); box-shadow: 0 0 11px rgba(90, 193, 255, .08); }
.orbit-cross { width: 69%; height: 74%; transform: rotate(62deg); border-color: rgba(167, 132, 255, .22); animation: crossOrbit 16s ease-in-out infinite alternate; }
.orbit-main { animation: mainOrbit 12s ease-in-out infinite alternate; }
.orbit i { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #d4f6ff; box-shadow: 0 0 13px 4px rgba(86, 210, 255, .68); }
.orbit i:nth-child(1) { left: 3%; top: 48%; }
.orbit i:nth-child(2) { right: 2%; top: 31%; background: #d6c6ff; box-shadow: 0 0 13px 4px rgba(155, 122, 255, .58); }
.orbit i:nth-child(3) { left: 22%; bottom: 2%; width: 8px; height: 8px; background: #6da9ff; }
.orbit-cross i:first-child { left: 13%; top: 14%; width: 6px; height: 6px; }
.orbit-cross i:last-child { right: 9%; bottom: 17%; width: 7px; height: 7px; }
.orb-wrap[data-state="listening"] .orb-image, .orb-wrap[data-state="speaking"] .orb-image { filter: brightness(1.12) saturate(1.08) drop-shadow(0 0 35px rgba(91, 218, 255, .92)) drop-shadow(0 0 88px rgba(85, 86, 255, .42)); }
.orb-wrap[data-state="thinking"] .orb-image { animation-duration: 2.2s; }
.orb-wrap[data-state="thinking"] .orbit { animation-duration: 3.4s; }
.orb-wrap[data-state="error"] .orb-image { filter: hue-rotate(105deg) saturate(.72) drop-shadow(0 0 28px rgba(255, 87, 130, .48)); }

.status-copy { text-align: center; margin-top: -13px; position: relative; z-index: 4; max-width: 680px; }
.status-copy h1 { margin: 5px 0; font-size: clamp(1.6rem, 2.25vw, 2.5rem); font-weight: 310; letter-spacing: -.035em; }
.status-copy p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
#state-kicker { color: var(--cyan); font-size: .56rem; letter-spacing: .22em; text-transform: uppercase; }
.live-caption { margin-top: 10px; max-width: 630px; min-height: 20px; color: #d8f7ff; font-size: .85rem; text-align: center; }
.waveform { height: 66px; width: min(440px, 70vw); display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 10px; }
.waveform span { display: block; width: 2px; min-height: 3px; border-radius: 99px; background: linear-gradient(to bottom, var(--cyan), #f6fbff 48%, var(--violet)); box-shadow: 0 0 8px rgba(91, 203, 255, .72); transform: scaleY(.26); transition: transform 70ms linear; opacity: .94; }
.controls { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 4px; }
.control { position: relative; min-width: 85px; height: 45px; padding: 0 13px; border: 1px solid rgba(142, 194, 230, .17); border-radius: 99px; background: rgba(8, 16, 24, .64); color: #8b99a6; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px; backdrop-filter: blur(16px); transition: .2s ease; }
.control svg { width: 15px; height: 15px; fill: currentColor; }
.control span { font-size: .63rem; }
.control:hover:not(:disabled) { color: white; border-color: rgba(95, 213, 255, .5); transform: translateY(-1px); }
.control:disabled { opacity: .35; cursor: not-allowed; }
.control.primary { min-width: 112px; color: white; border-color: rgba(143, 225, 255, .55); background: linear-gradient(135deg, rgba(68, 203, 255, .86), rgba(75, 88, 215, .84)); box-shadow: 0 0 22px rgba(76, 166, 255, .28); }
.control.primary .pulse { position: absolute; inset: -5px; border: 1px solid rgba(96, 218, 255, .26); border-radius: inherit; animation: controlPulse 2.8s ease-out infinite; }
.end-session { border: 0; background: transparent; color: #6f7e8b; font-size: .63rem; margin-top: 11px; cursor: pointer; }
.end-session:hover { color: #d3e4f1; }

.right-rail { align-self: stretch; display: flex; flex-direction: column; justify-content: center; gap: 20px; padding: 82px 0 48px; }
.transcript-panel { min-height: 300px; max-height: 390px; border-radius: 20px; padding: 19px 10px 12px 19px; display: flex; flex-direction: column; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding-right: 9px; margin-bottom: 14px; }
.panel-head > div > span { display: block; color: #748494; font-size: .53rem; letter-spacing: .17em; text-transform: uppercase; }
.panel-head h2 { margin: 4px 0 0; font-size: 1rem; font-weight: 420; }
.pill { padding: 6px 8px; border: 1px solid rgba(139, 188, 223, .16); border-radius: 99px; color: #748390; font-size: .53rem; white-space: nowrap; }
.pill i { display: inline-block; width: 5px; height: 5px; margin-right: 4px; border-radius: 50%; background: #687783; }
.pill.connected i { background: #54dfbd; box-shadow: 0 0 8px #54dfbd; }
.pill.error i { background: var(--danger); }
.messages { overflow-y: auto; padding-right: 9px; scrollbar-color: rgba(107, 166, 207, .22) transparent; }
.empty-message { min-height: 190px; display: grid; place-content: center; text-align: center; color: #657685; }
.empty-message b { color: var(--cyan); font-size: 1.1rem; }
.empty-message p { max-width: 190px; font-size: .68rem; line-height: 1.55; }
.message { margin: 0 0 13px; animation: rise .3s ease-out both; }
.message .meta { display: flex; justify-content: space-between; margin-bottom: 5px; color: #617283; font-size: .49rem; letter-spacing: .1em; text-transform: uppercase; }
.message p { margin: 0; padding: 9px 11px; border-radius: 12px 12px 12px 3px; background: rgba(255,255,255,.045); color: #d1dde6; font-size: .72rem; line-height: 1.48; }
.message.assistant p { border-radius: 12px 12px 3px 12px; background: linear-gradient(135deg, rgba(72, 164, 225, .13), rgba(126, 101, 218, .1)); }
.message.assistant .meta { color: #6dccf4; }
.telegram-card { align-self: end; min-width: 244px; border-radius: 18px; padding: 14px 17px; display: flex; gap: 12px; align-items: center; }
.telegram-icon { width: 39px; height: 39px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, #56c8ff, #2384e5); box-shadow: 0 0 18px rgba(54, 155, 255, .28); }
.telegram-icon svg { width: 22px; fill: white; }
.telegram-card strong, .telegram-card span { display: block; }
.telegram-card strong { font-size: .84rem; font-weight: 440; }
.telegram-card span { margin-top: 3px; color: #788693; font-size: .62rem; }

@keyframes orbFloat { 50% { transform: translateY(-6px) scale(1.012); } }
@keyframes halo { 50% { transform: scale(1.14); opacity: .72; } }
@keyframes dust { to { transform: rotate(360deg); } }
@keyframes mainOrbit { to { transform: rotate(-12deg) scaleX(1.025); } }
@keyframes crossOrbit { to { transform: rotate(68deg) scaleY(.97); } }
@keyframes controlPulse { 0% { transform: scale(.94); opacity: 0; } 35% { opacity: .7; } 100% { transform: scale(1.13); opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } }

@media (max-width: 1120px) {
  .dashboard { padding-inline: 26px; }
  .experience { grid-template-columns: 230px minmax(440px, 1fr) 230px; gap: 15px; }
  .orb-wrap { width: min(59vw, 590px); }
  .transcript-panel { min-height: 260px; }
}

@media (max-width: 900px) {
  .dashboard { padding: 24px 18px 30px; }
  .topbar { height: auto; grid-template-columns: 1fr auto; }
  .wordmark { justify-self: end; font-size: 1.2rem; }
  .weather-offline { grid-column: 1 / -1; justify-self: end; margin-top: 18px; }
  .experience { min-height: auto; grid-template-columns: 1fr; }
  .voice-core { grid-row: 1; min-height: 690px; }
  .orb-wrap { width: min(100vw, 610px); }
  .schedule-card { grid-row: 2; width: min(620px, 100%); justify-self: center; margin: 0; }
  .right-rail { grid-row: 3; width: min(620px, 100%); justify-self: center; padding: 0; }
  .telegram-card { align-self: stretch; }
}

@media (max-width: 560px) {
  .clock time { font-size: 2.25rem; }
  .clock p { font-size: .64rem; }
  .wordmark { font-size: .92rem; letter-spacing: .52em; margin-right: -.52em; }
  .weather-offline svg { width: 32px; height: 32px; }
  .voice-core { min-height: 600px; }
  .orb-wrap { width: 104vw; margin-inline: -4vw; }
  .orb-image { width: 62%; }
  .status-copy { margin-top: -2px; }
  .waveform { width: 88vw; gap: 3px; }
  .control { min-width: 74px; padding: 0 9px; }
  .control.primary { min-width: 96px; }
}

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