:root {
  color-scheme: dark;
  --bg: #040812;
  --panel: rgba(15, 24, 38, .88);
  --panel-strong: #101a29;
  --line: rgba(127, 174, 220, .14);
  --text: #f4f7fb;
  --muted: #8692a3;
  --cyan: #12aec2;
  --blue: #2466c3;
  --green: #29bd69;
  --red: #ff6577;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { min-height: 100dvh; overflow-x: hidden; }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; }
input, textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 14px; color: var(--text);
  background: rgba(255,255,255,.045); padding: 13px 14px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: rgba(18,174,194,.6); box-shadow: 0 0 0 3px rgba(18,174,194,.1); }
textarea { resize: none; }
label { display: grid; gap: 7px; color: #dbe3ec; font-size: 14px; font-weight: 600; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: 30px; letter-spacing: -.03em; }
h2 { margin-bottom: 0; }
.muted { color: var(--muted); font-weight: 450; }
.eyebrow { color: var(--cyan); font-weight: 750; font-size: 11px; letter-spacing: .2em; margin-bottom: 7px; }
.ambient { position: fixed; pointer-events: none; filter: blur(80px); opacity: .18; border-radius: 50%; z-index: 0; }
.ambient-one { width: 300px; height: 300px; background: #006d8b; top: 20%; left: -180px; }
.ambient-two { width: 340px; height: 340px; background: #123c89; right: -240px; bottom: 8%; }

.setup-shell { position: relative; z-index: 1; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.setup-card { width: min(100%, 430px); padding: 28px 22px; border: 1px solid var(--line); border-radius: 28px; background: rgba(10,17,28,.92); box-shadow: 0 24px 80px rgba(0,0,0,.45); }
.setup-card .brand-mark { margin-bottom: 24px; }
.setup-card label { margin-top: 24px; }
.setup-form { display: grid; }
.setup-form .error { min-height: 22px; margin: 9px 2px 8px; }
.error { min-height: 18px; color: var(--red); margin: 12px 2px 0; font-size: 13px; }

.app-shell { position: relative; z-index: 1; width: min(100%, 680px); min-height: 100dvh; margin: 0 auto; padding-bottom: calc(94px + env(safe-area-inset-bottom)); }
.app-header { display: flex; justify-content: space-between; align-items: center; padding: calc(18px + env(safe-area-inset-top)) 20px 12px; }
.brand-lockup { display: flex; gap: 12px; align-items: center; }
.brand-mark { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: var(--cyan); background: rgba(9,139,156,.15); font-size: 32px; font-weight: 300; }
.brand-mark.small { width: 44px; height: 44px; font-size: 25px; }
.brand-name { font-size: 18px; font-weight: 800; letter-spacing: .25em; }
.connection-line { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: var(--muted); font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #7b8492; box-shadow: 0 0 10px transparent; }
.status-dot.online { background: var(--green); box-shadow: 0 0 10px rgba(41,189,105,.6); }
.status-dot.problem { background: var(--red); }
.icon-button { border: 1px solid var(--line); border-radius: 50%; width: 44px; height: 44px; background: rgba(255,255,255,.035); font-weight: 700; }

.view { display: none; padding: 8px 20px 24px; animation: view-in .24s ease; }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } }
.orb-wrap { text-align: center; padding: 22px 0 16px; }
.orb-wrap h1 { font-size: 24px; margin: 12px 0 5px; }
.orb-wrap p { font-size: 14px; }
.orb { position: relative; display: grid; place-items: center; width: 226px; height: 226px; margin: 0 auto; padding: 0; border: 0; border-radius: 50%; background: transparent; }
.ring { position: absolute; border: 1px solid rgba(38,102,195,.3); border-radius: 50%; animation: breathe 3.2s ease-in-out infinite; }
.ring-one { width: 220px; height: 220px; }
.ring-two { width: 178px; height: 178px; animation-delay: -.7s; }
.orb-core { position: relative; display: grid; place-items: center; width: 116px; height: 116px; border-radius: 50%; background: linear-gradient(135deg,var(--cyan),var(--blue)); box-shadow: 0 0 42px rgba(21,146,196,.38), 0 16px 42px rgba(0,0,0,.35); }
.orb-core::before { content: ""; position: absolute; width: 36px; height: 50px; border: 5px solid white; border-top: 0; border-radius: 0 0 20px 20px; opacity: .92; }
.orb-core::after { content: ""; position: absolute; width: 5px; height: 18px; background: white; border-radius: 4px; transform: translateY(29px); box-shadow: -13px 12px 0 -1px white, 13px 12px 0 -1px white; opacity: .92; }
.mic-glyph { position: absolute; width: 23px; height: 39px; border-radius: 14px; background: white; color: transparent; transform: translateY(-7px); opacity: .92; }
.orb.listening .orb-core { animation: listening 1s ease-in-out infinite alternate; }
.orb.listening .ring { border-color: rgba(18,174,194,.7); animation-duration: 1.15s; }
.orb.listening .mic-glyph { width: 5px; height: 34px; border-radius: 4px; box-shadow: -15px 8px 0 -1px white, 15px -5px 0 -1px white, -8px -7px 0 -1px white, 8px 11px 0 -1px white; }
.orb.listening .orb-core::before, .orb.listening .orb-core::after { display: none; }
@keyframes breathe { 50% { transform: scale(1.08); opacity: .4; } }
@keyframes listening { to { transform: scale(1.07); box-shadow: 0 0 64px rgba(18,174,194,.6); } }

.command-box { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 21px; background: rgba(15,23,36,.9); box-shadow: 0 12px 36px rgba(0,0,0,.18); }
.command-box textarea { min-height: 44px; max-height: 100px; border: 0; background: transparent; padding: 11px 8px; box-shadow: none; }
.send-button { flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: linear-gradient(145deg,var(--cyan),var(--blue)); font-size: 25px; font-weight: 700; }
.content-section { margin-top: 28px; }
.section-label { color: #6f7989; font-size: 11px; letter-spacing: .16em; font-weight: 800; }
.section-heading { display: flex; justify-content: space-between; align-items: center; }
.text-button { border: 0; background: none; color: var(--cyan); font-size: 13px; font-weight: 700; }
.chips { display: flex; gap: 9px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; padding: 11px 13px; background: rgba(255,255,255,.035); font-size: 13px; }
.chip span { color: var(--cyan); margin-right: 5px; }

.list { display: grid; gap: 10px; margin-top: 12px; }
.list-card { display: flex; gap: 13px; align-items: center; min-height: 72px; padding: 14px; border: 1px solid rgba(127,174,220,.1); border-radius: 20px; background: rgba(12,20,32,.86); }
button.list-card { width: 100%; text-align: left; }
.list-icon { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; display: grid; place-items: center; color: var(--cyan); background: rgba(10,148,167,.13); }
.list-main { min-width: 0; flex: 1; }
.list-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.list-main small { display: block; color: var(--muted); margin-top: 4px; font-size: 12px; }
.list-action { border: 0; background: transparent; color: var(--red); padding: 8px; font-size: 18px; }
.empty { color: #6f7989; text-align: center; padding: 22px 12px; border: 1px dashed var(--line); border-radius: 18px; font-size: 13px; }
.page-title { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; }
.page-title h1 { margin-bottom: 0; }
.page-copy { line-height: 1.5; margin-bottom: 22px; }
.history-label { margin-top: 30px; }
.panel { border: 1px solid var(--line); border-radius: 22px; padding: 17px; background: var(--panel); }
.form-stack { display: grid; gap: 15px; }
.contacts-list { margin-top: 16px; }
.settings-panel { margin: 18px 0 14px; padding: 0 16px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row p { margin: 5px 0 0; font-size: 12px; }
.badge { padding: 6px 9px; border-radius: 999px; color: #b9c2ce; background: rgba(255,255,255,.07); font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge.success { color: #67e29a; background: rgba(41,189,105,.12); }
.privacy-note { color: #697485; text-align: center; line-height: 1.45; font-size: 12px; padding: 16px; }

.primary, .secondary, .danger-button { min-height: 48px; border-radius: 15px; border: 0; padding: 12px 16px; font-weight: 750; }
.primary { background: linear-gradient(135deg,#0d99ad,#2366bd); color: white; }
.secondary { background: rgba(255,255,255,.07); border: 1px solid var(--line); margin-top: 10px; }
.danger-button { color: #ff91a0; background: rgba(255,101,119,.08); border: 1px solid rgba(255,101,119,.16); margin-top: 10px; }
.wide { width: 100%; }
.primary:disabled { opacity: .45; }

.bottom-nav { position: fixed; z-index: 20; left: 50%; bottom: 0; transform: translateX(-50%); display: grid; grid-template-columns: repeat(4,1fr); width: min(100%,680px); padding: 9px 10px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(5,9,18,.88); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.nav-item { display: grid; justify-items: center; gap: 2px; border: 0; background: none; color: #667182; padding: 5px; }
.nav-item span { font-size: 21px; line-height: 1; }
.nav-item small { font-size: 10px; font-weight: 650; }
.nav-item.active { color: var(--cyan); }

.sheet { width: 100%; max-width: 680px; margin: auto auto 0; padding: 0; border: 0; background: transparent; color: var(--text); }
.sheet::backdrop { background: rgba(0,0,0,.62); backdrop-filter: blur(5px); }
.sheet-card { display: grid; gap: 15px; width: 100%; max-height: 91dvh; overflow-y: auto; padding: 10px 20px calc(22px + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-radius: 28px 28px 0 0; background: #0c1421; box-shadow: 0 -20px 70px rgba(0,0,0,.45); }
.sheet-handle { width: 42px; height: 5px; border-radius: 5px; background: #364255; margin: 0 auto 4px; }
.sheet-heading { display: flex; justify-content: space-between; align-items: flex-start; }
.sheet-heading h2 { font-size: 22px; }
.close-button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,.07); font-size: 24px; }
.hint { color: #d4ad68; background: rgba(194,143,54,.09); border: 1px solid rgba(194,143,54,.16); border-radius: 13px; padding: 10px 12px; font-size: 12px; line-height: 1.4; }
.steps { list-style: none; display: grid; gap: 18px; padding: 4px 0 8px; }
.steps li { display: flex; align-items: center; gap: 13px; line-height: 1.4; }
.steps li > span { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 50%; color: var(--cyan); background: rgba(18,174,194,.12); font-weight: 800; }
.toast { position: fixed; z-index: 100; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translateX(-50%); width: min(calc(100% - 32px),560px); padding: 12px 15px; border: 1px solid var(--line); border-radius: 16px; background: rgba(20,30,45,.96); box-shadow: 0 14px 50px rgba(0,0,0,.4); text-align: center; font-size: 13px; font-weight: 650; }

@media (min-width: 700px) {
  .app-shell { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .sheet { margin-bottom: 24px; }
  .sheet-card { border-radius: 28px; }
}

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