:root {
  color-scheme: dark;
  --bg: #05070a;
  --panel: rgba(18, 21, 27, 0.72);
  --panel-strong: rgba(22, 25, 32, 0.92);
  --line: rgba(255,255,255,.105);
  --line-strong: rgba(255,255,255,.18);
  --text: #f7f7f5;
  --muted: #9ba1ac;
  --soft: #737986;
  --gold: #f2c86f;
  --gold-2: #fff0bd;
  --blue: #77bfff;
  --green: #7ef0b7;
  --violet: #c5a6ff;
  --danger: #ff7c7c;
  --shadow: 0 28px 90px rgba(0,0,0,.42);
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(225,181,89,.12), transparent 30%),
    radial-gradient(circle at 10% 30%, rgba(42,116,173,.12), transparent 27%),
    linear-gradient(180deg, #080b10 0%, #05070a 52%, #030406 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

.ambient { position: fixed; width: 42vw; height: 42vw; border-radius: 50%; filter: blur(110px); pointer-events: none; opacity: .13; z-index: 0; }
.ambient-a { background: #d8ab4e; top: -26vw; right: 4vw; }
.ambient-b { background: #2f86c9; left: -25vw; top: 32vh; }
.noise { position: fixed; inset: 0; opacity: .028; pointer-events: none; z-index: 1; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E"); }
.shell { position: relative; z-index: 2; width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 54px; }
.glass { background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.025)); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(28px) saturate(120%); -webkit-backdrop-filter: blur(28px) saturate(120%); }
.kicker { color: var(--gold); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; font-weight: 800; }

.login-view { min-height: calc(100vh - 48px); display: grid; place-items: center; align-content: center; gap: 20px; }
.login-mark { width: 74px; height: 74px; border-radius: 22px; display: grid; place-items: center; background: linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.035)); border: 1px solid var(--line); box-shadow: 0 26px 80px rgba(0,0,0,.45); }
.login-mark svg { width: 42px; fill: #f3d58d; }
.login-mark .beam { fill: #f9c75c; }
.login-mark rect { fill: #08101b; }
.login-card { width: min(470px, 100%); padding: 38px; border-radius: var(--radius-xl); }
.login-card h1 { margin: 10px 0 10px; font-size: clamp(38px, 7vw, 56px); letter-spacing: -.055em; line-height: .98; }
.lede { margin: 0 0 28px; color: var(--muted); line-height: 1.55; font-size: 16px; }
.login-form { display: grid; gap: 14px; }
.login-form label { display: grid; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.login-form input { width: 100%; border: 1px solid var(--line); background: rgba(0,0,0,.22); color: var(--text); border-radius: 16px; padding: 15px 16px; outline: none; transition: border .2s, box-shadow .2s, background .2s; }
.login-form input:focus { border-color: rgba(242,200,111,.56); box-shadow: 0 0 0 4px rgba(242,200,111,.08); background: rgba(0,0,0,.32); }
.form-error { min-height: 18px; margin: 0; color: #ff9a9a; font-size: 13px; text-align: center; }
.login-foot { color: #707682; font-size: 12px; margin: 0; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--text); font-weight: 760; font-size: 13px; cursor: pointer; transition: transform .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease; }
.button:hover { background: rgba(255,255,255,.1); border-color: var(--line-strong); }
.button:active { transform: scale(.975); }
.button:disabled { opacity: .4; cursor: not-allowed; }
.button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button-primary { color: #17130b; border-color: transparent; background: linear-gradient(135deg, var(--gold-2), var(--gold)); box-shadow: 0 10px 28px rgba(210,158,55,.2); }
.button-primary:hover { background: linear-gradient(135deg, #fff6d4, #f4ce79); }
.button-large { min-height: 52px; margin-top: 3px; font-size: 14px; }
.button-large svg { margin-left: auto; }
.button-quiet { background: rgba(255,255,255,.045); }
.button-danger { color: #ffd5d5; border-color: rgba(255,124,124,.24); background: rgba(255,124,124,.08); }

.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-symbol { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.055); }
.brand-symbol svg { width: 26px; fill: #ead08c; }
.brand-symbol .beam { fill: #f4c75f; }
.brand-symbol rect { fill: #0b111a; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; letter-spacing: -.01em; }
.brand small { color: var(--soft); margin-top: 2px; font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.connection-pill { display: flex; align-items: center; gap: 8px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.04); padding: 9px 13px; font-size: 11px; color: var(--muted); }
.connection-pill span { width: 7px; height: 7px; border-radius: 50%; background: #767d87; box-shadow: 0 0 0 4px rgba(118,125,135,.1); }
.connection-pill.online span { background: var(--green); box-shadow: 0 0 0 4px rgba(126,240,183,.1), 0 0 18px rgba(126,240,183,.42); }
.connection-pill.offline span { background: var(--danger); }
.icon-button { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: rgba(255,255,255,.04); cursor: pointer; }
.icon-button svg { width: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.hero { min-height: 470px; border-radius: 38px; padding: clamp(30px, 5vw, 62px); display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 28%, rgba(255,255,255,.026) 48%, transparent 66%); transform: translateX(-100%); animation: sheen 9s ease-in-out infinite; pointer-events: none; }
@keyframes sheen { 0%, 18% { transform: translateX(-110%); } 52%, 100% { transform: translateX(110%); } }
.hero h1 { margin: 12px 0 18px; font-size: clamp(46px, 7vw, 82px); line-height: .92; letter-spacing: -.065em; max-width: 760px; }
.hero h1 span { color: #aaaeb6; }
.hero p { color: var(--muted); max-width: 620px; line-height: 1.65; font-size: 16px; margin: 0; }
.hero-orbit { width: min(380px, 100%); aspect-ratio: 1; justify-self: end; position: relative; display: grid; place-items: center; }
.orbit-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.09); }
.ring-one { inset: 8%; animation: rotate 22s linear infinite; border-top-color: rgba(242,200,111,.55); }
.ring-two { inset: 21%; animation: rotate 14s linear infinite reverse; border-right-color: rgba(119,191,255,.5); }
@keyframes rotate { to { transform: rotate(360deg); } }
.hero-lighthouse { width: 150px; filter: drop-shadow(0 30px 28px rgba(0,0,0,.35)); }
.hero-lighthouse svg { width: 100%; overflow: visible; }
.hero-lighthouse .tower { fill: url(#none); fill: #e5e0d5; }
.hero-lighthouse .cap { fill: #242a34; }
.hero-lighthouse .roof { fill: #f1ca74; }
.hero-lighthouse .window { fill: #162230; }
.hero-lighthouse .light { fill: rgba(244,199,95,.76); filter: drop-shadow(0 0 18px rgba(244,199,95,.55)); animation: pulseBeam 2.8s ease-in-out infinite; transform-origin: center; }
@keyframes pulseBeam { 50% { opacity: .52; transform: scaleX(.92); } }
.hero-metrics { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); margin-top: 34px; padding-top: 24px; }
.hero-metrics div { padding-right: 20px; }
.hero-metrics div + div { border-left: 1px solid var(--line); padding-left: 28px; }
.hero-metrics span, .mini-label { display: block; color: var(--soft); font-size: 10px; text-transform: uppercase; letter-spacing: .14em; font-weight: 800; }
.hero-metrics strong { display: block; margin-top: 7px; font-size: 18px; letter-spacing: -.025em; }

.section-heading { margin: 62px 4px 20px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-heading h2 { margin: 7px 0 0; font-size: clamp(32px, 5vw, 52px); letter-spacing: -.055em; line-height: 1; }
.control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.control-card { min-height: 340px; border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; gap: 18px; position: relative; overflow: hidden; }
.control-card::before { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; right: -100px; top: -110px; background: radial-gradient(circle, rgba(255,255,255,.055), transparent 70%); pointer-events: none; }
.wide-card { grid-column: 1 / -1; min-height: 290px; }
.card-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.icon-wrap { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.11); }
.icon-wrap svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-wrap.gold { color: var(--gold); background: rgba(242,200,111,.09); }
.icon-wrap.blue { color: var(--blue); background: rgba(119,191,255,.08); }
.icon-wrap.violet { color: var(--violet); background: rgba(197,166,255,.08); }
.icon-wrap.green { color: var(--green); background: rgba(126,240,183,.08); }
.icon-wrap.silver { color: #d8dbe0; background: rgba(216,219,224,.07); }
.state-label { border: 1px solid var(--line); background: rgba(0,0,0,.15); color: var(--muted); border-radius: 999px; padding: 8px 11px; font-size: 11px; font-weight: 750; }
.control-card h3 { margin: 0 0 7px; font-size: 28px; letter-spacing: -.045em; }
.control-card p { margin: 0; color: var(--muted); line-height: 1.52; font-size: 14px; }

.power-control { margin: auto auto 4px; width: 150px; height: 150px; border-radius: 50%; border: 1px solid var(--line-strong); background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.11), rgba(255,255,255,.025) 52%, rgba(0,0,0,.22)); display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); cursor: pointer; box-shadow: inset 0 0 34px rgba(0,0,0,.24), 0 20px 50px rgba(0,0,0,.28); transition: all .25s ease; }
.power-control:hover { transform: translateY(-2px); border-color: rgba(242,200,111,.38); }
.power-control.on { color: #fff4ce; border-color: rgba(242,200,111,.58); background: radial-gradient(circle at 35% 30%, rgba(255,244,206,.25), rgba(242,200,111,.12) 52%, rgba(0,0,0,.18)); box-shadow: inset 0 0 34px rgba(242,200,111,.09), 0 0 55px rgba(242,200,111,.16); }
.power-core svg { width: 38px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.power-control > span:last-child { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

.toggle-list { display: grid; gap: 10px; margin-top: auto; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; padding: 14px 15px; border-radius: 17px; border: 1px solid var(--line); background: rgba(0,0,0,.15); cursor: pointer; text-align: left; }
.toggle-row span b, .toggle-row span small { display: block; }
.toggle-row b { font-size: 13px; }
.toggle-row small { color: var(--soft); margin-top: 4px; font-size: 10px; }
.toggle-row i { width: 42px; height: 24px; border-radius: 999px; background: rgba(255,255,255,.12); position: relative; transition: background .2s; }
.toggle-row i::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #dfe2e6; left: 3px; top: 3px; transition: transform .2s; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.toggle-row.on i { background: rgba(126,240,183,.42); }
.toggle-row.on i::after { transform: translateX(18px); background: #effff7; }
.split-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.spectrum-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 34px; align-items: end; }
.color-row { display: flex; align-items: center; gap: 13px; margin: 26px 0 18px; }
.color-row input { width: 58px; height: 58px; border: 0; border-radius: 16px; padding: 0; background: transparent; overflow: hidden; cursor: pointer; }
.color-row input::-webkit-color-swatch-wrapper { padding: 0; }
.color-row input::-webkit-color-swatch { border: 1px solid var(--line-strong); border-radius: 15px; }
.color-row span, .color-row strong { display: block; }
.color-row span { color: var(--soft); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.color-row strong { margin-top: 5px; font-size: 15px; }
.range-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.range { width: 100%; accent-color: var(--gold); }
.mode-panel { border: 1px solid var(--line); background: rgba(0,0,0,.13); border-radius: 22px; padding: 18px; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 14px; }
.mode-grid button, .stepper-grid button { border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--muted); border-radius: 13px; padding: 12px 10px; font-weight: 760; font-size: 12px; cursor: pointer; transition: .16s; }
.mode-grid button.active, .stepper-grid button.active { color: #15120b; background: linear-gradient(135deg, var(--gold-2), var(--gold)); border-color: transparent; }
.mode-panel > .button { width: 100%; }

.motion-control { margin-top: auto; }
.direction-label { display: flex; justify-content: space-between; color: var(--soft); font-size: 10px; text-transform: uppercase; letter-spacing: .14em; margin: 0 2px 9px; }
.stepper-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.stepper-grid .stop { color: #ffd4d4; background: rgba(255,124,124,.08); }

.touch-card { min-height: 290px; }
.rod-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: auto; }
.rod { border: 1px solid var(--line); border-radius: 20px; background: rgba(0,0,0,.14); padding: 18px; display: flex; align-items: center; gap: 14px; }
.rod-visual { width: 28px; height: 82px; border-radius: 999px; border: 1px solid rgba(255,255,255,.16); padding: 4px; background: rgba(255,255,255,.035); }
.rod-visual span { display: block; width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(180deg, #aeb4bc, #353b44); transition: .2s; }
.rod.active .rod-visual span { background: linear-gradient(180deg, #fff2bd, #e6b64f); box-shadow: 0 0 28px rgba(242,200,111,.42); }
.rod b, .rod small { display: block; }
.rod b { font-size: 13px; }
.rod small { color: var(--soft); margin-top: 5px; font-size: 11px; }

.message-heading { margin-top: 70px; }
.countdown { border: 1px solid rgba(242,200,111,.2); background: rgba(242,200,111,.065); padding: 10px 14px; border-radius: 16px; text-align: right; }
.countdown span, .countdown strong { display: block; }
.countdown span { color: var(--soft); font-size: 9px; text-transform: uppercase; letter-spacing: .13em; }
.countdown strong { color: var(--gold-2); font-size: 16px; margin-top: 3px; }
.message-shell { min-height: 520px; border-radius: var(--radius-xl); overflow: hidden; }
.conversation-empty { min-height: 520px; padding: 45px; display: grid; place-items: center; align-content: center; text-align: center; }
.empty-orb { width: 90px; height: 90px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; background: radial-gradient(circle, rgba(242,200,111,.18), rgba(255,255,255,.025)); margin-bottom: 20px; }
.empty-orb span { width: 20px; height: 20px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 30px rgba(242,200,111,.52); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.7); opacity: .6; } }
.conversation-empty h3 { margin: 8px 0 10px; font-size: 32px; letter-spacing: -.045em; }
.conversation-empty p { color: var(--muted); max-width: 520px; line-height: 1.55; margin: 0 auto; }
.duration-form { margin-top: 26px; display: flex; align-items: end; gap: 10px; }
.duration-form label { display: grid; gap: 7px; text-align: left; }
.duration-form label span { color: var(--soft); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.duration-form select { min-width: 180px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: #11151b; color: var(--text); padding: 0 13px; outline: none; }
.conversation-active { min-height: 520px; display: grid; grid-template-rows: auto 1fr auto auto; }
.message-toolbar { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.message-toolbar strong { display: block; margin-top: 5px; font-size: 14px; }
.message-actions { display: flex; gap: 8px; }
.message-list { padding: 28px; overflow-y: auto; min-height: 320px; max-height: 560px; display: flex; flex-direction: column; gap: 14px; }
.message { max-width: min(72%, 620px); padding: 13px 15px; border-radius: 19px; border: 1px solid var(--line); background: rgba(255,255,255,.05); align-self: flex-start; }
.message.own { align-self: flex-end; background: linear-gradient(135deg, rgba(242,200,111,.2), rgba(242,200,111,.08)); border-color: rgba(242,200,111,.2); }
.message-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 7px; }
.message-head b { font-size: 11px; }
.message-head span { color: var(--soft); font-size: 9px; }
.message p { margin: 0; white-space: pre-wrap; word-break: break-word; line-height: 1.48; font-size: 14px; }
.message-status { margin-top: 8px; color: var(--soft); font-size: 9px; text-align: right; }
.message-status.unread { color: var(--gold); }
.message-form { border-top: 1px solid var(--line); padding: 16px 18px; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.message-form textarea { width: 100%; max-height: 150px; resize: none; border: 1px solid var(--line); background: rgba(0,0,0,.18); color: var(--text); border-radius: 18px; padding: 14px 15px; outline: none; line-height: 1.45; }
.message-form textarea:focus { border-color: rgba(242,200,111,.42); }
.send-button { width: 48px; height: 48px; border: 0; border-radius: 16px; background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #17130b; display: grid; place-items: center; cursor: pointer; }
.send-button svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.message-note { color: var(--soft); font-size: 10px; text-align: center; margin: 0; padding: 0 18px 14px; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px 4px 0; color: #626873; font-size: 10px; }
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: grid; gap: 10px; width: min(360px, calc(100% - 40px)); }
.toast { padding: 13px 15px; border-radius: 16px; border: 1px solid var(--line); background: rgba(17,20,26,.94); box-shadow: 0 20px 60px rgba(0,0,0,.4); color: var(--text); font-size: 12px; animation: toastIn .25s ease; }
.toast.error { border-color: rgba(255,124,124,.25); color: #ffd7d7; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
  .hero-orbit { justify-self: center; width: 280px; margin-top: 14px; }
  .hero-metrics { margin-top: 8px; }
  .spectrum-layout { grid-template-columns: 1fr; }
  .stepper-grid { grid-template-columns: repeat(4, 1fr); }
  .stepper-grid button:nth-child(5) { grid-column-start: 1; }
}

@media (max-width: 700px) {
  .shell { width: min(100% - 22px, 1240px); padding-top: 12px; }
  .topbar { height: 64px; }
  .connection-pill b { display: none; }
  .hero { min-height: 0; padding: 28px 22px; border-radius: 28px; }
  .hero h1 { font-size: 48px; }
  .hero-orbit { width: 225px; }
  .hero-lighthouse { width: 105px; }
  .hero-metrics { grid-template-columns: 1fr; gap: 14px; }
  .hero-metrics div + div { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 14px; }
  .section-heading { margin-top: 48px; align-items: center; }
  .section-heading h2 { font-size: 36px; }
  .control-grid { grid-template-columns: 1fr; }
  .wide-card { grid-column: auto; }
  .control-card { min-height: 320px; }
  .stepper-grid { grid-template-columns: repeat(2, 1fr); }
  .stepper-grid .stop { grid-column: 1 / -1; order: -1; }
  .rod-pair { grid-template-columns: 1fr; }
  .message-toolbar { align-items: flex-start; flex-direction: column; }
  .message-actions { width: 100%; }
  .message-actions .button { flex: 1; }
  .message { max-width: 88%; }
  .duration-form { flex-direction: column; align-items: stretch; width: 100%; max-width: 300px; }
  .duration-form select { width: 100%; }
  .conversation-empty { padding: 34px 20px; }
  footer { flex-direction: column; gap: 6px; }
}

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