:root {
  color-scheme: dark;
  --ink: #f7fbff;
  --muted: #aec4df;
  --dim: #849ebb;
  --cyan: #26baff;
  --green: #36d77a;
  --amber: #ffc072;
  --border: #124b70;
  --panel: #081a34;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: #050d1e;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, p { margin: 0; }
body {
  min-width: 280px;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 52% 73%, #08485d 0, transparent 36%),
    radial-gradient(ellipse at 48% 51%, #0c4375 0, #071831 39%, #050d1e 74%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(30deg, transparent 0 35px, #5499dc0c 35px 36px),
    repeating-linear-gradient(-30deg, transparent 0 35px, #5499dc0c 35px 36px);
  mask-image: radial-gradient(ellipse, #000 25%, transparent 76%);
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
a { color: inherit; }
:focus-visible { outline: 3px solid #8bdeff; outline-offset: 4px; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.shell { width: min(1660px, calc(100% - 88px)); margin-inline: auto; }

.header-row {
  min-height: 98px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wordmark { position: relative; display: block; width: min(100%, 154px); flex: none; }
.wordmark img { display: block; width: 100%; height: auto; }
.wordmark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/static/skysecure-logo.webp") center / contain no-repeat;
  filter: brightness(0) invert(1);
  clip-path: inset(0 0 0 15%);
  pointer-events: none;
}
.header-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.header-link, .device-label, .usb-button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #08172d;
  color: #d9e8fb;
  font-size: .84rem;
  font-weight: 650;
  padding: 8px 14px;
}
.header-link:hover, .usb-button:hover { border-color: var(--cyan); color: #fff; }
.device-label { display: inline-flex; align-items: center; gap: 8px; }
.device-dot { width: 7px; height: 7px; border-radius: 50%; background: #7296b9; }
.device-label[data-connected="true"] .device-dot { background: var(--green); box-shadow: 0 0 10px #36d77a88; }

.stage {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .78fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(15px, 2.1vw, 37px);
  padding-block: 30px;
}
.conversation { min-width: 0; }
.intro-label, .section-label, .transcript-header h2 {
  color: var(--cyan);
  font-size: .75rem;
  font-weight: 730;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.intro-label { display: inline-flex; border: 1px solid #1687b8; border-radius: 999px; padding: 2px 12px; }
.intro h1 {
  margin-top: 16px;
  font-size: clamp(2.05rem, 4.08vw, 4.85rem);
  line-height: 1.035;
  letter-spacing: -.058em;
  font-weight: 790;
  text-wrap: balance;
}
.intro h1 span { color: var(--cyan); }
.intro p { max-width: 37ch; margin-top: 18px; color: #c0d4ec; font-size: clamp(.97rem, 1.15vw, 1.14rem); line-height: 1.5; }
.topics { margin-top: 26px; }
.topics .section-label { color: var(--dim); }
.topic-list { display: grid; gap: 8px; margin-top: 10px; }
.topic {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 43px;
  padding: 8px 13px;
  text-align: left;
  font-weight: 640;
  color: #dfedff;
  background: #0a1c36e8;
  border: 1px solid var(--border);
  border-radius: 11px;
  font-size: clamp(.85rem, 1.06vw, 1rem);
}
.topic span { color: var(--cyan); font-size: 1.45rem; line-height: .85; }
.topic:hover:not(:disabled) { background: #10345c; border-color: #218ac0; }
.stage[data-view="conversation"] .intro { display: none; }
.stage[data-view="conversation"] .topic { min-height: 37px; }
.stage[data-view="conversation"] .topics { margin-top: 17px; }

.voice-card {
  --orb-image: url("/static/voice-art/idle.png");
  --signal: var(--cyan);
  position: relative;
  min-width: 0;
  align-self: center;
  display: grid;
  justify-items: center;
  text-align: center;
}
.voice-card[data-state="listening"] { --orb-image: url("/static/voice-art/listening.png"); --signal: var(--green); }
.voice-card[data-state="thinking"], .voice-card[data-state="connecting"] { --orb-image: url("/static/voice-art/thinking.png"); --signal: #c0e7ff; }
.voice-card[data-state="speaking"] { --orb-image: url("/static/voice-art/speaking.png"); }
.voice-card[data-state="offline"] { --orb-image: url("/static/voice-art/offline.png"); --signal: var(--amber); }
.voice-card[data-state="muted"] { --signal: var(--amber); }
.voice-visual { width: min(100%, 415px); aspect-ratio: 1; position: relative; }
.orb-art {
  position: absolute;
  inset: 0;
  background: var(--orb-image) 50% 47.9% / 406.55% auto no-repeat;
  mask-image: radial-gradient(circle, #000 0 60%, transparent 72%);
}
.orb-button {
  position: absolute;
  top: 65%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 41px;
  padding: 0 13px;
  border: 1px solid #59cfff85;
  border-radius: 999px;
  background: linear-gradient(120deg, #087cae, #095a9e);
  box-shadow: 0 5px 24px #051021a8;
  color: white;
  font-size: .9rem;
  font-weight: 750;
  white-space: nowrap;
}
.orb-button svg { width: 16px; height: 16px; }
.orb-button:hover { background: #097cad; }
.orb-button::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -215%;
  width: clamp(130px, 12vw, 180px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translateX(-50%);
}
.voice-details { width: 100%; }
.status { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 24px; color: #deedff; font-weight: 690; font-size: .97rem; }
.status-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 14px var(--signal); }
.controls { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.controls button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 660;
  color: #e2edfa;
  background: #0b1c35;
  border: 1px solid #23537c;
}
.controls button:hover { background: #14365b; }
.controls .end { color: #ffdee6; border-color: #885069; }
.controls .end:hover { background: #422238; }
.hint { margin-top: 8px; color: var(--muted); font-size: .83rem; }
.archive-notice { margin-top: 7px; color: var(--muted); font-size: .76rem; }
.notice { color: #ffe0b8; background: #231a21; border: 1px solid #805941; border-radius: 10px; padding: 9px 13px; margin-top: 10px; font-size: .86rem; }

.transcript-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 37px; margin-bottom: 6px; }
.text-button { background: #0b1a31; border: 1px solid var(--border); color: #c6e5ff; border-radius: 8px; padding: 5px 12px; font-size: .83rem; }
.text-button:hover { border-color: var(--cyan); }
.transcript-scroll { overflow-y: auto; max-height: min(38vh, 520px); min-height: 72px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #237098 transparent; padding-right: 8px; }
.empty { color: var(--muted); padding-block: 5px; }
.messages { display: grid; gap: 16px; list-style: none; padding: 0 0 4px; margin: 0; }
.message { overflow-wrap: anywhere; color: #f1f7ff; line-height: 1.45; }
.message strong { color: var(--cyan); display: block; margin-bottom: 5px; font-size: .71rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.message p { white-space: pre-wrap; }
.message[data-role="assistant"] p { font-weight: 650; font-size: clamp(1rem, 1.48vw, 1.36rem); letter-spacing: -.018em; }
.message[data-role="caller"] { color: #cbdcf0; }
.message[data-role="caller"] strong { color: var(--dim); }

.overview {
  padding: clamp(19px, 2vw, 32px);
  border: 1px solid #175881;
  background: #081932ee;
  border-radius: 19px;
  min-width: 0;
  box-shadow: 0 17px 46px #050d1e50;
}
.overview h2 { margin-top: 5px; font-size: clamp(1.31rem, 2.2vw, 2.34rem); line-height: 1.16; letter-spacing: -.035em; }
.overview ul { padding: 0; margin: 17px 0 20px; list-style: none; display: grid; gap: 10px; }
.overview li { display: flex; align-items: flex-start; gap: 9px; font-size: clamp(.88rem, 1.08vw, 1.06rem); color: #d6e3f6; }
.overview li svg { width: 16px; height: 16px; margin-top: 3px; color: var(--green); stroke-width: 2.7; }
.overview-link {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 43px;
  border: 1px solid #23764e;
  border-radius: 10px;
  color: #def9e9;
  background: #092d33;
  padding: 8px 11px;
  text-decoration: none;
  font-size: .91rem;
  font-weight: 700;
}
.overview-link svg { color: var(--green); }
.overview-link .chevron { margin-left: auto; }
.overview-link:hover { border-color: var(--green); }
.footer { display: flex; gap: 15px; align-items: center; justify-content: space-between; min-height: 76px; padding-block: 12px 20px; }
.footer-note { color: var(--muted); font-size: .81rem; margin-left: auto; text-align: right; }
.usb-control p { margin-top: 5px; font-size: .81rem; color: var(--muted); }

.login-page { display: grid; place-items: center; padding: 22px; }
.login-panel { width: min(100%, 436px); padding: clamp(23px, 6vw, 39px); border: 1px solid #175881; border-radius: 21px; background: #081932; box-shadow: 0 16px 54px #03091387; }
.login-logo { width: min(100%, 168px); margin-bottom: 25px; }
.login-panel h1 { font-size: clamp(1.85rem, 6vw, 2.55rem); line-height: 1.1; letter-spacing: -.045em; }
.login-panel p { color: var(--muted); margin-top: 10px; }
.login-form { display: grid; gap: 8px; margin-top: 22px; }
.login-form label { font-size: .9rem; font-weight: 650; }
.login-form input { min-width: 0; padding: 11px 13px; font: inherit; color: var(--ink); background: #050f22; border: 1px solid #24557d; border-radius: 9px; }
.login-form .primary { min-height: 45px; border-radius: 9px; border: 1px solid #349ed5; margin-top: 7px; font-weight: 700; color: white; background: #095f9f; }
.login-form .primary:hover { background: #117bb9; }
.login-panel .login-error { color: #ffbbcd; margin: 0; }

@media (min-width: 761px) and (min-height: 700px) {
  .voice-card { margin-bottom: 40px; }
  .voice-details { position: absolute; top: 100%; }
}
@media (max-width: 1060px) {
  .shell { width: calc(100% - 52px); }
  .stage { grid-template-columns: minmax(0, 1fr) minmax(0, .85fr) minmax(0, .87fr); gap: 14px; }
  .overview { padding: 16px; }
}
@media (max-width: 760px) {
  .shell { width: calc(100% - 36px); }
  .header-row { min-height: 70px; }
  .stage { display: flex; flex-direction: column; align-items: stretch; gap: 21px; padding-top: 22px; }
  .conversation { display: contents; }
  .intro { order: 0; }
  .intro h1 { font-size: clamp(2.32rem, 7.5vw, 3.7rem); text-wrap: initial; }
  .title-break { display: none; }
  .intro p { margin-top: 12px; }
  .voice-card { order: 1; width: 100%; }
  .voice-visual { width: min(78vw, 310px); }
  .transcript-card { order: 2; }
  .topics { order: 3; margin: 0; }
  .stage[data-view="conversation"] .topics { margin-top: 0; }
  .overview { order: 4; padding: 20px; }
  .footer { align-items: flex-start; flex-direction: column; }
  .footer-note { margin-left: 0; text-align: left; }
}
@media (max-width: 400px) {
  .header-row .wordmark { width: 120px; }
  .header-actions { gap: 5px; }
  .header-link, .device-label { padding: 5px 8px; font-size: .73rem; }
}
