/* LOWE Phone — Phase 1 prototype.
 *
 * One stylesheet for one page. The design system is at the top: colour tokens, spacing,
 * radii, type and the orb. Every screen below it is built from the same handful of
 * surfaces, so the prototype reads as one operating system rather than five mock-ups.
 *
 * Everything is CSS: no images, no icon font, no web font. The icons are a sprite in
 * phone.html (stroked with currentColor), the orb is gradients and borders, and the only
 * motion is on transform/opacity so it stays cheap on a phone.
 */

/* -- design system ------------------------------------------------------------------- */

:root {
  /* Deep navy and black, one electric blue. */
  --navy-1000: #02050A;
  --navy-950: #04070E;
  --navy-900: #070D18;
  --navy-850: #0A1220;
  --navy-800: #0D1626;
  --navy-700: #111E33;
  --blue: #00BFFF;
  --blue-soft: #74DFFF;
  --blue-deep: #056CBE;
  --ink: #F5F8FF;
  --ink-soft: #D9E3F1;
  --muted: #A3B4C9;
  --line: rgba(167, 184, 204, .16);
  --line-bright: rgba(0, 191, 255, .38);
  --surface: rgba(13, 22, 38, .62);
  --surface-2: rgba(23, 38, 60, .55);
  --surface-3: rgba(8, 15, 27, .92);
  --glow: rgba(0, 191, 255, .30);
  --warn: #FFB020;
  --danger: #FF8A6B;
  --screen: #060B14;
  --screen-glow: radial-gradient(680px 420px at 72% -10%, rgba(0, 191, 255, .16), transparent 62%),
                 radial-gradient(520px 380px at 6% 108%, rgba(31, 78, 140, .20), transparent 68%);
  --screen-lum: 1;

  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 26px;
  --s7: 34px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --fast: .18s;
  --slow: .42s;

  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --dock-h: 70px;
  color-scheme: dark;
}

/* Appearance: three dark treatments, chosen in Settings. */
[data-theme="obsidian"] {
  --screen: #010306;
  --navy-900: #010306;
  --navy-800: #070C13;
  --surface: rgba(255, 255, 255, .035);
  --surface-2: rgba(255, 255, 255, .06);
  --surface-3: rgba(2, 4, 8, .95);
  --line: rgba(255, 255, 255, .10);
  --line-bright: rgba(0, 191, 255, .34);
  --muted: #9CAEC4;
  --glow: rgba(0, 191, 255, .22);
  --screen-glow: radial-gradient(600px 380px at 50% -12%, rgba(0, 191, 255, .10), transparent 64%),
                 radial-gradient(420px 320px at 90% 110%, rgba(24, 54, 96, .18), transparent 70%);
}

[data-theme="aurora"] {
  --screen: #04101F;
  --navy-900: #061424;
  --navy-800: #0A1D33;
  --surface: rgba(0, 191, 255, .07);
  --surface-2: rgba(0, 191, 255, .11);
  --surface-3: rgba(4, 16, 31, .93);
  --line: rgba(0, 191, 255, .20);
  --line-bright: rgba(116, 223, 255, .50);
  --muted: #A9C2D8;
  --glow: rgba(0, 191, 255, .38);
  --screen-glow: radial-gradient(720px 460px at 78% -8%, rgba(0, 191, 255, .22), transparent 60%),
                 radial-gradient(560px 420px at 0% 104%, rgba(35, 108, 168, .28), transparent 66%);
}

* { box-sizing: border-box; }

/* The screens and the sheet are flex/grid containers, so the browser's own rule for the
 * `hidden` attribute would lose to their display rule. `hidden` must always mean hidden. */
[hidden] { display: none !important; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  padding: clamp(14px, 2.6vw, 34px);
  display: grid;
  place-items: center;
  background:
    radial-gradient(1100px 620px at 74% -12%, rgba(0, 191, 255, .10), transparent 62%),
    radial-gradient(820px 520px at 4% 28%, rgba(30, 72, 126, .14), transparent 66%),
    var(--navy-1000);
  color: var(--ink);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* -- stage: the page around the device ----------------------------------------------- */

.stage {
  width: 100%;
  max-width: 1180px;
  display: grid;
  justify-items: center;
  gap: clamp(12px, 2vw, 22px);
}

.stage-head {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}

.stage-brand {
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-size: 15px;
}

.stage-mark { width: 26px; height: 26px; color: var(--blue); stroke-width: 1.4; }

.stage-brand-text { display: grid; line-height: 1.35; }
.stage-brand-text strong { font-weight: 600; letter-spacing: -.01em; }
.stage-brand-text span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.stage-links { display: flex; align-items: center; gap: var(--s4); font-size: 13.5px; }
.stage-links a { color: var(--muted); text-decoration: none; padding: 6px 2px; }
.stage-links a:hover { color: var(--ink); }
.stage-links a[aria-current="page"] { color: var(--ink); }

.stage-foot {
  margin: 0;
  max-width: 72ch;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

/* -- the device ---------------------------------------------------------------------- */

.device {
  width: clamp(340px, calc((100dvh - 208px) * .469), 424px);
  max-width: 100%;
  aspect-ratio: 9 / 19.2;
}

.device-shell {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 9px;
  border-radius: 54px;
  background:
    linear-gradient(160deg, rgba(167, 184, 204, .30), rgba(6, 11, 20, .92) 32%,
      rgba(6, 11, 20, .96) 68%, rgba(167, 184, 204, .18));
  border: 1px solid rgba(167, 184, 204, .18);
  box-shadow:
    0 40px 90px rgba(0, 0, 0, .55),
    0 0 0 1px rgba(0, 0, 0, .6),
    inset 0 1px 0 rgba(255, 255, 255, .08);
}

.device-screen {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 46px;
  background: var(--screen);
  background-image: var(--screen-glow);
  isolation: isolate;
  filter: brightness(var(--screen-lum));
  transition: filter var(--fast) linear, background-color var(--slow) var(--ease);
}

.device-island {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 84px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(167, 184, 204, .10);
  z-index: 6;
}

.status-bar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  height: 48px;
  padding: 0 20px 0 24px;
  font-size: 12px;
  letter-spacing: .01em;
  color: var(--ink-soft);
}

.status-clock { font-variant-numeric: tabular-nums; font-weight: 600; }

.status-brand {
  font-size: 10px;
  letter-spacing: .32em;
  text-indent: .32em;
  color: var(--muted);
  text-transform: uppercase;
}

.status-icons { display: flex; align-items: center; gap: 6px; }
.status-icon { width: 15px; height: 15px; stroke-width: 1.7; color: var(--ink-soft); }
.status-battery { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* The scrollable screen, with a dock that never moves. */
.screen-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(167, 184, 204, .28) transparent;
}
.screen-body::-webkit-scrollbar { width: 4px; }
.screen-body::-webkit-scrollbar-thumb {
  background: rgba(167, 184, 204, .24);
  border-radius: 4px;
}

.view {
  padding: 4px 22px 26px;
  min-height: 100%;
  animation: view-in var(--slow) var(--ease) both;
}

/* A screen is focused when navigation lands on it so a screen-reader user hears where
 * they are; the screen itself needs no ring around it. */
.view:focus { outline: none; }

@keyframes view-in {
  from { opacity: .55; transform: translateY(9px) scale(.996); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  margin: 0 0 var(--s2);
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: .24em;
  text-transform: uppercase;
}

.muted { color: var(--muted); }

.fineprint {
  margin: var(--s3) 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.fineprint a { color: var(--blue-soft); text-decoration: none; }
.fineprint a:hover { text-decoration: underline; }

/* -- home ---------------------------------------------------------------------------- */

.view-home {
  display: flex;
  flex-direction: column;
  padding-top: 10px;
  text-align: center;
}

.home-head { display: grid; justify-items: center; gap: 2px; }

.home-clock {
  margin: 0;
  font-size: clamp(52px, 15vw, 68px);
  font-weight: 250;
  line-height: 1;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  text-shadow: 0 0 40px rgba(0, 191, 255, .18);
}

.home-date {
  margin: var(--s2) 0 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .02em;
}

.home-orb {
  display: grid;
  justify-items: center;
  gap: var(--s3);
  padding: clamp(12px, 3.4vh, 30px) 0 var(--s3);
}

.home-orb .orb { --orb: 168px; }

.home-mode {
  margin: 0;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.home-foot { margin-top: auto; display: grid; gap: var(--s2); }
.home-greeting { margin: 0; font-size: 17px; font-weight: 550; letter-spacing: -.01em; }
.home-note { margin: 0; font-size: 11.5px; line-height: 1.65; }

/* Two small widgets under the orb: the page's own state, and this browser's. Both open the
 * screen they belong to, and neither invents a number. */
.home-widgets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s2);
  margin: var(--s2) 0 var(--s4);
}

.home-widget {
  display: grid;
  gap: 3px;
  padding: var(--s3);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}

.home-widget:hover { border-color: var(--line-bright); background: var(--surface-2); }

.home-widget-label {
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.home-widget-value { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }

/* -- the LOWE orb -------------------------------------------------------------------- */

.orb-button {
  display: grid;
  justify-items: center;
  gap: var(--s4);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.orb {
  --orb: 186px;
  position: relative;
  display: grid;
  place-items: center;
  width: var(--orb);
  aspect-ratio: 1;
  isolation: isolate;
}

.orb-halo {
  position: absolute;
  inset: -16%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow), transparent 68%);
  filter: blur(7px);
  z-index: 0;
  transition: opacity var(--slow) var(--ease);
}

.orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0, 191, 255, .26);
  transition: border-color var(--slow) var(--ease), opacity var(--slow) var(--ease);
}

.orb-ring-1 { inset: 4%; }
.orb-ring-2 { inset: -7%; border-color: rgba(167, 184, 204, .16); }
.orb-ring-3 { inset: 12%; border-color: rgba(0, 191, 255, .34); }

.orb-core {
  position: relative;
  width: 63%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 27%, rgba(255, 255, 255, .55), transparent 13%),
    radial-gradient(circle at 38% 33%, #4FDFFF 0%, #00BFFF 28%, #056CBE 64%, #06254E 100%);
  box-shadow:
    inset -14px -16px 38px rgba(2, 11, 28, .55),
    inset 10px 12px 26px rgba(255, 255, 255, .14),
    0 0 58px var(--glow),
    0 22px 60px rgba(0, 0, 0, .45);
  animation: orb-breathe 7s ease-in-out infinite;
  transition: box-shadow var(--slow) var(--ease);
}

.orb-core::after {
  content: "";
  position: absolute;
  inset: 11%;
  border-radius: 50%;
  border: 1px solid rgba(245, 248, 255, .20);
}

.orb-wave {
  width: 56%;
  height: 38%;
  color: #EAFBFF;
  opacity: .94;
  overflow: visible;
}
.orb-wave path {
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.orb-hint {
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--ink-soft);
}

.orb-button:hover .orb-core,
.orb-button:focus-visible .orb-core { transform: scale(1.015); }
.orb-button:hover .orb-halo { opacity: 1; }

@keyframes orb-breathe {
  0%, 100% { transform: scale(.985); }
  50% { transform: scale(1.025); }
}

@keyframes orb-pulse {
  0% { transform: scale(.86); opacity: .95; }
  70% { transform: scale(1.14); opacity: .16; }
  100% { transform: scale(1.14); opacity: 0; }
}

@keyframes orb-spin { to { transform: rotate(360deg); } }

@keyframes orb-band {
  0%, 100% { transform: scaleY(.55); opacity: .75; }
  50% { transform: scaleY(1.08); opacity: 1; }
}

/* Voice states. Colour and motion carry the state; the words under the orb say it
 * plainly as well, so the state is never motion-only. */
[data-voice="listening"] .orb-halo { animation: orb-pulse 1.9s ease-out infinite; }
[data-voice="listening"] .orb-ring-1 { border-color: rgba(0, 191, 255, .5); }
[data-voice="listening"] .orb-wave { animation: orb-band 1.05s ease-in-out infinite; }
[data-voice="listening"] .orb-core { animation-duration: 2.2s; }

[data-voice="thinking"] .orb-ring-2 {
  border-style: dashed;
  border-color: rgba(0, 191, 255, .46);
  animation: orb-spin 7s linear infinite;
}
[data-voice="thinking"] .orb-ring-3 { animation: orb-spin 11s linear infinite reverse; }
[data-voice="thinking"] .orb-core { animation-duration: 3.4s; }
[data-voice="thinking"] .orb-wave { opacity: .5; }

[data-voice="speaking"] .orb-halo { animation: orb-pulse 1.3s ease-out infinite; }
[data-voice="speaking"] .orb-wave { animation: orb-band .72s ease-in-out infinite; }
[data-voice="speaking"] .orb-core { animation-duration: 1.8s; }

[data-voice="error"] .orb-core {
  background:
    radial-gradient(circle at 35% 27%, rgba(255, 255, 255, .5), transparent 13%),
    radial-gradient(circle at 38% 33%, #FFD9A8 0%, #FFA24B 30%, #B85A16 66%, #3A1B08 100%);
  box-shadow:
    inset -14px -16px 38px rgba(28, 8, 2, .5),
    inset 10px 12px 26px rgba(255, 255, 255, .12),
    0 0 48px rgba(255, 138, 107, .32),
    0 22px 60px rgba(0, 0, 0, .45);
  animation: none;
}
[data-voice="error"] .orb-halo { background: radial-gradient(circle, rgba(255, 138, 107, .26), transparent 68%); }
[data-voice="error"] .orb-ring-1,
[data-voice="error"] .orb-ring-3 { border-style: dashed; border-color: rgba(255, 138, 107, .42); }
[data-voice="error"] .orb-wave { opacity: .35; }

/* -- voice screen -------------------------------------------------------------------- */

.view-head {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: var(--s2);
  min-height: 46px;
}

.view-title { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.icon-button:hover { color: var(--ink); background: var(--surface); border-color: var(--line); }
.icon-button-small { width: 34px; height: 34px; }
.icon-button .icon { width: 18px; height: 18px; }

.badge {
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-bright);
  background: rgba(0, 191, 255, .12);
  color: var(--blue-soft);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-quiet { border-color: var(--line); background: var(--surface); color: var(--muted); }
.badge-warn { border-color: rgba(255, 176, 32, .4); background: rgba(255, 176, 32, .12); color: #FFCF80; }
.badge-live { border-color: rgba(116, 223, 255, .55); background: rgba(0, 191, 255, .2); color: #DFF8FF; }

.voice-stage {
  display: grid;
  justify-items: center;
  gap: var(--s2);
  padding: var(--s4) 0 var(--s3);
}

.orb-button-voice { --orb: 144px; }
.orb-button-voice .orb { --orb: 144px; }

.voice-state {
  margin: var(--s3) 0 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--ink);
}

[data-voice="error"] .voice-state { color: #FFB59E; }

.voice-help {
  margin: 0;
  max-width: 34ch;
  text-align: center;
  text-wrap: pretty;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.voice-actions { display: grid; gap: var(--s2); margin-top: var(--s2); }
.voice-actions .btn { width: 100%; }
.voice-row { display: flex; flex-wrap: wrap; gap: var(--s2); }
.voice-row .btn { flex: 1 1 130px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 550;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease),
              transform var(--fast) var(--ease);
}

.btn:hover { border-color: var(--line-bright); background: var(--surface-2); }
.btn:active { transform: scale(.985); }

.btn-primary {
  border-color: transparent;
  background: linear-gradient(180deg, #3AD4FF, var(--blue) 46%, var(--blue-deep));
  color: #001220;
  box-shadow: 0 10px 30px rgba(0, 191, 255, .24);
}
.btn-primary:hover { background: linear-gradient(180deg, #58DCFF, #17C6FF 46%, #0A7AD1); }

.btn-quiet { background: transparent; color: var(--muted); }
.btn-quiet:hover { color: var(--ink); }

.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.panels { display: grid; gap: var(--s2); margin-top: var(--s4); }

.panel {
  padding: var(--s3) var(--s4);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
}

.panel-title {
  margin: 0 0 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-body { margin: 0; font-size: 13.5px; line-height: 1.6; }
.panel-body:not(.muted) { color: var(--ink-soft); }

.panel-tag {
  margin: var(--s2) 0 0;
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 176, 32, .12);
  border: 1px solid rgba(255, 176, 32, .32);
  color: #FFD79A;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.panel-tag[data-kind="real"] {
  background: rgba(0, 191, 255, .14);
  border-color: rgba(0, 191, 255, .38);
  color: var(--blue-soft);
}

.voice-handoff {
  margin-top: var(--s3);
  padding: var(--s4);
  border-radius: var(--radius-md);
  border: 1px solid var(--line-bright);
  background: linear-gradient(180deg, rgba(0, 191, 255, .12), rgba(0, 191, 255, .04));
}

.handoff-title { margin: 0 0 6px; font-size: 13.5px; font-weight: 600; }
.handoff-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }

.voice-fine { margin-top: var(--s4); }

.voice-mic-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }

.link-button {
  margin: 0;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--blue-soft);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-button:hover { color: var(--ink); }

/* -- app launcher -------------------------------------------------------------------- */

.view-intro { margin: var(--s3) 0 var(--s5); font-size: 12.5px; line-height: 1.65; }

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s4) var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-tile {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 7px;
  width: 100%;
  min-height: 112px;
  padding: var(--s2) 2px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: inherit;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: transform var(--fast) var(--ease);
}

.app-tile:hover { transform: translateY(-2px); }

.app-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 17px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 120% at 30% 15%, rgba(255, 255, 255, .10), transparent 60%),
    var(--surface-2);
  color: var(--ink-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.app-tile:hover .app-icon { border-color: var(--line-bright); color: var(--blue-soft); }

.app-icon-live {
  border-color: rgba(0, 191, 255, .45);
  background:
    radial-gradient(120% 120% at 30% 15%, rgba(255, 255, 255, .16), transparent 60%),
    linear-gradient(160deg, rgba(0, 191, 255, .32), rgba(5, 108, 190, .28));
  color: #DFF8FF;
}

.app-name {
  font-size: 11.5px;
  line-height: 1.3;
  font-weight: 550;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.app-sub {
  font-size: 9.5px;
  line-height: 1.3;
  color: var(--muted);
  letter-spacing: .02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.app-sub-live { color: var(--blue-soft); }
.app-tile-off .app-icon { color: var(--muted); opacity: .72; }
.app-tile-off .app-name { color: var(--muted); }

/* -- Control Center ------------------------------------------------------------------ */

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s2);
}

.control-toggle {
  display: grid;
  grid-template-columns: 32px 1fr;
  grid-template-areas: "icon name" "icon state";
  align-items: center;
  gap: 1px var(--s2);
  padding: var(--s3);
  min-height: 78px;
  text-align: left;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}

.control-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease),
              border-color var(--fast) var(--ease);
}

.control-toggle .icon { width: 17px; height: 17px; }
.control-name { grid-area: name; font-size: 12.5px; font-weight: 550; }
.control-state { grid-area: state; font-size: 10px; color: var(--muted); letter-spacing: .03em; }

.control-toggle[aria-checked="true"] {
  border-color: var(--line-bright);
  background: linear-gradient(180deg, rgba(0, 191, 255, .16), rgba(0, 191, 255, .05));
}

.control-toggle[aria-checked="true"] .control-icon {
  color: #001220;
  border-color: transparent;
  background: linear-gradient(180deg, #67E0FF, var(--blue));
}

.slider-card {
  margin-top: var(--s2);
  padding: var(--s4);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
}

.slider-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }

.slider-label {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: 12.5px;
  font-weight: 550;
}
.slider-label .icon { width: 17px; height: 17px; color: var(--muted); }

.slider-value {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 32px;
  margin: 6px 0 0;
  background: transparent;
  cursor: pointer;
}

.slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--blue) 0 var(--pct, 90%),
              rgba(167, 184, 204, .22) var(--pct, 90%) 100%);
}
.slider::-moz-range-track {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--blue) 0 var(--pct, 90%),
              rgba(167, 184, 204, .22) var(--pct, 90%) 100%);
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border-radius: 50%;
  background: #F2FBFF;
  border: 1px solid rgba(4, 12, 24, .35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .45);
}
.slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #F2FBFF;
  border: 1px solid rgba(4, 12, 24, .35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .45);
}
.slider:focus-visible { outline-offset: 6px; }

.info-card {
  margin-top: var(--s2);
  padding: var(--s4);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
}

.info-card-live { border-color: rgba(0, 191, 255, .22); }
.info-title { margin: 0 0 var(--s2); font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }

.info-list { margin: 0; display: grid; gap: 7px; }
.info-list > div { display: flex; justify-content: space-between; gap: var(--s3); }
.info-list dt { color: var(--muted); font-size: 11.5px; }
.info-list dd {
  margin: 0;
  font-size: 11.5px;
  color: var(--ink-soft);
  text-align: right;
  overflow-wrap: anywhere;
}

/* -- Settings ------------------------------------------------------------------------ */

.view-settings { display: grid; gap: var(--s2); align-content: start; }
.view-settings .view-head { margin-bottom: var(--s2); }

.settings-card {
  padding: var(--s4);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
}

.settings-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }

.settings-title {
  margin: 0 0 var(--s3);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .02em;
}
.settings-head .settings-title { margin-bottom: 0; }

.fieldset { margin: 0; padding: 0; border: 0; }

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(4, 9, 17, .45);
}

.segment { position: relative; display: block; }
.segment input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.segment-face {
  display: block;
  padding: 10px 6px;
  border-radius: 9px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}

.segment input:checked + .segment-face {
  background: linear-gradient(180deg, rgba(0, 191, 255, .3), rgba(0, 191, 255, .14));
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(0, 191, 255, .42);
}

.segment input:focus-visible + .segment-face { outline: 2px solid var(--blue); outline-offset: 2px; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: 9px 0;
}
.row + .row { border-top: 1px solid var(--line); }
.row-label { font-size: 12.5px; }

.switch {
  position: relative;
  flex: none;
  width: 48px;
  height: 28px;
  padding: 0;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgba(167, 184, 204, .16);
  cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #E7F1FA;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
  transition: transform var(--fast) var(--ease);
}

.switch[aria-checked="true"] {
  border-color: transparent;
  background: linear-gradient(180deg, #4FDCFF, var(--blue));
}

.switch[aria-checked="true"]::after { transform: translateX(20px); background: #05121D; }

.provider-body { display: grid; gap: var(--s2); margin-top: var(--s3); font-size: 12px; }

.provider-status {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}
.provider-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 10px var(--blue);
}
.provider-status.is-off .dot {
  background: var(--warn);
  box-shadow: 0 0 10px rgba(255, 176, 32, .55);
}

.provider-line { display: flex; justify-content: space-between; gap: var(--s3); }
.provider-line dt, .provider-line span:first-child { color: var(--muted); }
.provider-line dd, .provider-line span:last-child { margin: 0; text-align: right; color: var(--ink-soft); }

.provider-note { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.provider-note a { color: var(--blue-soft); }

.provider-models {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}
.provider-models li {
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgba(4, 9, 17, .4);
  color: var(--ink-soft);
  font-size: 10.5px;
}

.privacy-list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s3); }
.privacy-list li { display: grid; grid-template-columns: 20px 1fr; gap: var(--s2); }
.privacy-list .icon { width: 18px; height: 18px; color: var(--blue-soft); margin-top: 2px; }
.privacy-list span { font-size: 11.5px; line-height: 1.65; color: var(--ink-soft); }

.version-line { text-align: center; margin-top: var(--s3); }

/* -- dock and home indicator --------------------------------------------------------- */

.dock {
  position: relative;
  z-index: 4;
  flex: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  margin: 0 12px;
  padding: 5px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 30, 51, .82), rgba(7, 13, 24, .92));
  backdrop-filter: blur(14px);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .35);
}

.dock-item {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 3px;
  min-height: 52px;
  padding: 7px 2px 6px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}

.dock-item .icon { width: 21px; height: 21px; }
.dock-label { font-size: 9.5px; letter-spacing: .04em; }

.dock-item:hover { color: var(--ink); background: rgba(167, 184, 204, .08); }

.dock-item[aria-current="page"] { color: var(--blue-soft); }
.dock-item[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--blue);
  box-shadow: 0 0 10px rgba(0, 191, 255, .8);
}
.dock-item[aria-current="page"] .dock-label { color: var(--ink); }

.home-indicator {
  position: relative;
  flex: none;
  height: 22px;
  display: grid;
  place-items: center;
}
.home-indicator::after {
  content: "";
  width: 118px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: rgba(245, 248, 255, .32);
}

/* -- the sheet inside the phone ------------------------------------------------------ */

.sheet-layer { position: absolute; inset: 0; z-index: 8; display: flex; align-items: flex-end; }
.sheet-layer[hidden] { display: none; }

.sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 10, .62);
  backdrop-filter: blur(3px);
  animation: fade-in var(--fast) var(--ease) both;
}

.sheet {
  position: relative;
  width: 100%;
  margin: 0 8px 8px;
  padding: var(--s5) var(--s4) var(--s4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(23, 38, 60, .98), rgba(9, 17, 30, .99));
  box-shadow: 0 -20px 50px rgba(0, 0, 0, .5);
  animation: sheet-up var(--slow) var(--ease) both;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s2); }

.sheet-title { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }

.sheet-body { margin: var(--s2) 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.7; }

.sheet-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s4) 0 0; }
.sheet-actions:empty { display: none; }

.noscript {
  margin: 0;
  padding: var(--s4);
  max-width: 44ch;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* -- a phone screen: the prototype fills the window ---------------------------------- */

@media (max-width: 560px) {
  html, body { height: 100%; }
  body { padding: 0; display: block; background: var(--screen); }
  .stage { max-width: none; min-height: 100dvh; gap: 0; }
  .stage-head, .stage-foot { display: none; }

  .device {
    width: 100%;
    max-width: none;
    height: 100dvh;
    aspect-ratio: auto;
  }

  .device-shell {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .device-screen {
    border-radius: 0;
    background-image: var(--screen-glow);
  }

  .status-bar {
    height: auto;
    min-height: 48px;
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 20px 4px 22px;
  }

  .view { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); }

  .dock { margin: 0 10px 0; }
  .home-indicator { height: calc(env(safe-area-inset-bottom, 0px) + 16px); }
}

/* A small phone in a browser (or a phone held sideways): the same home screen, tightened so
 * the orb, the widgets and the honesty note all fit without hiding anything. */
@media (max-width: 560px) and (max-height: 700px) {
  .home-clock { font-size: clamp(42px, 12vw, 56px); }
  .home-orb { gap: 8px; padding: 2px 0 8px; }
  .home-orb .orb { --orb: min(150px, 22dvh); }
  .home-widgets { margin: 0 0 var(--s3); }
  .home-widget { padding: 10px 12px; }
  .home-foot { gap: 5px; }
  .home-greeting { font-size: 15px; }
  .home-note { font-size: 11px; }
  .view-home { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); }
  .view-home .eyebrow { display: none; }
}

/* A short window (a laptop with a low dock, or a browser with a lot of toolbars): keep the
 * whole phone above the fold and let the device shrink, rather than cutting its bottom off. */
@media (max-height: 760px) and (min-width: 561px) {
  body { padding: 10px; }
  .stage-head, .stage-foot { display: none; }
  .device {
    width: clamp(270px, calc((100dvh - 24px) * .469), 424px);
    max-height: calc(100dvh - 20px);
  }
  /* The device is shorter, so its content is too: keep the honesty note above the dock. */
  .home-clock { font-size: 52px; }
  .home-orb { padding: 6px 0 10px; }
  .home-orb .orb { --orb: 136px; }
  .orb-button-voice, .orb-button-voice .orb { --orb: 124px; }
  .home-widgets { margin-bottom: var(--s3); }
}

/* -- installed: the prototype is the app --------------------------------------------- */

/* Added to a home screen, the page has no browser around it, so it fills the window and the
 * device frame goes away. The real phone already draws its own status bar and home indicator:
 * showing a second, simulated one above them would be dishonest twice. */
@media (display-mode: standalone) {
  html, body { height: 100%; background: var(--screen); }
  body { padding: 0; display: block; }
  .stage { max-width: none; min-height: 100dvh; gap: 0; }
  .stage-head, .stage-foot { display: none; }
  .device {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    aspect-ratio: auto;
  }
  .device-shell {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }
  .device-screen { border-radius: 0; }
  .device-island { display: none; }
  .status-bar { display: none; }
  .home-indicator { display: none; }
  .screen-body { padding-top: env(safe-area-inset-top, 0px); }
  .view { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); }
  .dock { margin-bottom: max(4px, env(safe-area-inset-bottom, 0px)); }
}

/* -- motion preferences -------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  /* No looping decorative motion at all: the orb stays perfectly still and still changes
   * colour with the voice state, which is the part that carries meaning. */
  .orb-core,
  .orb-halo,
  .orb-ring,
  .orb-wave,
  .view,
  .sheet,
  .sheet-scrim {
    animation: none !important;
  }

  .orb-button:hover .orb-core,
  .orb-button:focus-visible .orb-core,
  .app-tile:hover,
  .btn:active { transform: none; }
}
