:root {
  --bg: #07111f;
  --bg-soft: #102239;
  --panel: rgba(11, 24, 42, 0.88);
  --panel-border: rgba(160, 194, 255, 0.18);
  --text: #eff6ff;
  --muted: #9db1cc;
  --accent: #8ce0cb;
  --accent-strong: #4bc7a8;
  --signal: #f5b971;
  --alert: #ff8f88;
  --sleep: #8ea9ff;
  --kaleidoscope-cyan: #8ce0cb;
  --kaleidoscope-blue: #8ea9ff;
  --kaleidoscope-amber: #f5b971;
  --shadow: 0 24px 80px rgba(1, 7, 17, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  overflow-x: hidden;
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei UI", "PingFang SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(52, 102, 188, 0.28), transparent 28%),
    radial-gradient(circle at bottom right, rgba(76, 184, 145, 0.22), transparent 24%),
    linear-gradient(135deg, #050c16 0%, #0a1728 52%, #0d2137 100%);
}

body::before,
body::after {
  position: fixed;
  z-index: 0;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      from 11.25deg,
      rgba(140, 224, 203, 0.22) 0deg 5deg,
      transparent 5deg 22.5deg,
      rgba(142, 169, 255, 0.16) 22.5deg 27.5deg,
      transparent 27.5deg 45deg
    );
  content: "";
  mask-image: radial-gradient(circle, transparent 0 20%, #000 21% 54%, transparent 72%);
  pointer-events: none;
  opacity: 0.46;
}

body::before {
  top: -225px;
  right: -105px;
  animation: kaleidoscope-drift 64s linear infinite;
}

body::after {
  bottom: -350px;
  left: 12%;
  width: 620px;
  height: 620px;
  opacity: 0.24;
  animation: kaleidoscope-drift-reverse 78s linear infinite;
}

button,
input {
  font: inherit;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 28px;
  background: rgba(4, 12, 22, 0.8);
  border-right: 1px solid var(--panel-border);
  backdrop-filter: blur(20px);
}

.eyebrow,
.card-label,
.progress-label {
  margin: 0 0 8px;
  font-family: "Bahnschrift", "Segoe UI Variable Display", sans-serif;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.sidebar h1,
.topbar h2,
.hero-card h3,
.metrics-card h3 {
  margin: 0;
  font-family: "Bahnschrift", "Segoe UI Variable Display", sans-serif;
  letter-spacing: -0.03em;
}

.sidebar h1 {
  font-size: 38px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
}

.kaleidoscope-mark {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(140, 224, 203, 0.42);
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      from 22.5deg,
      rgba(140, 224, 203, 0.9) 0deg 8deg,
      transparent 8deg 22.5deg,
      rgba(142, 169, 255, 0.72) 22.5deg 30.5deg,
      transparent 30.5deg 45deg
    ),
    radial-gradient(circle, rgba(10, 26, 43, 0.92) 0 29%, transparent 31%);
  box-shadow: inset 0 0 18px rgba(142, 169, 255, 0.1), 0 0 24px rgba(140, 224, 203, 0.08);
}

.kaleidoscope-mark::before,
.kaleidoscope-mark::after,
.kaleidoscope-mark i {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.kaleidoscope-mark::before {
  inset: 9px;
  border: 1px solid rgba(245, 185, 113, 0.78);
}

.kaleidoscope-mark::after {
  inset: 15px;
  background: var(--accent);
  box-shadow: 0 0 9px rgba(140, 224, 203, 0.45);
}

.kaleidoscope-mark i {
  inset: 4px;
  border: 1px dashed rgba(239, 246, 255, 0.12);
}

.sidebar-copy,
.card-copy,
.hero-description,
.metric-copy,
.insight-text,
.summary-list,
.stage-list,
.scenario-copy,
.chart-note {
  color: var(--muted);
  line-height: 1.7;
}

.progress-panel,
.source-card,
.hero-card,
.metrics-card,
.chart-card,
.insight-card,
.sub-card,
.wake-window,
.scenario-card,
.companion-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.sleep-analysis-card,
.decision-evidence {
  padding: 18px;
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(142, 169, 255, 0.12), transparent 35%),
    rgba(10, 22, 39, 0.9);
  box-shadow: var(--shadow);
}

.analysis-heading,
.decision-evidence > div:first-child {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.analysis-heading h4,
.decision-evidence h4 {
  margin: 0;
  font-size: 20px;
}

.analysis-heading > span {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--sleep);
  background: rgba(142, 169, 255, 0.12);
  font-size: 12px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.analysis-grid > div {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.analysis-grid small {
  color: var(--muted);
}

.analysis-grid strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-summary {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-left: 2px solid var(--sleep);
  color: #c5d5e9;
  background: rgba(142, 169, 255, 0.055);
  line-height: 1.65;
}

.evidence-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.15fr);
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.evidence-flow span,
.evidence-flow strong {
  padding: 12px;
  border-radius: 16px;
  text-align: center;
  font-size: 13px;
}

.evidence-flow span {
  color: #c4d3e6;
  background: rgba(255, 255, 255, 0.05);
}

.evidence-flow strong {
  color: #08161b;
  background: linear-gradient(135deg, var(--accent), #c2f6ea);
}

.evidence-flow i {
  color: var(--accent);
  font-style: normal;
}

.plan-composer {
  padding: 20px;
  border: 1px solid rgba(140, 224, 203, 0.2);
  border-radius: 26px;
  background:
    radial-gradient(circle at 0% 0%, rgba(140, 224, 203, 0.1), transparent 30%),
    rgba(7, 18, 32, 0.96);
  box-shadow: var(--shadow);
}

.composer-heading,
.control-label-row,
.routine-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.composer-heading h4 {
  margin: 0;
  font-size: 26px;
}

.composer-heading > span,
.control-label-row > span {
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(140, 224, 203, 0.11);
  font-size: 14px;
  white-space: nowrap;
}

.plan-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.plan-control {
  min-width: 0;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
}

.plan-control > strong,
.control-label-row strong,
.routine-heading strong {
  display: block;
  color: var(--text);
  font-size: 17px;
}

.control-label-row small,
.plan-toggle small,
.routine-heading span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.plan-control input[type="range"] {
  width: 100%;
  margin-top: 20px;
  accent-color: var(--accent);
}

.choice-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.choice-buttons button {
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  text-align: left;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.choice-buttons button:hover {
  transform: translateY(-1px);
}

.choice-buttons button.is-selected {
  border-color: rgba(140, 224, 203, 0.42);
  color: var(--text);
  background: rgba(140, 224, 203, 0.11);
}

.choice-buttons span,
.choice-buttons small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.choice-buttons span {
  font-size: 15px;
  white-space: nowrap;
}

.choice-buttons small {
  margin-top: 5px;
  color: #7187a1;
  font-size: 12px;
  line-height: 1.45;
}

.device-control {
  display: grid;
  align-content: start;
  gap: 9px;
}

.plan-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}

.plan-toggle b {
  color: var(--text);
  font-size: 15px;
}

.plan-toggle i {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 19px;
  border-radius: 999px;
  background: #26364a;
  transition: background 180ms ease;
}

.plan-toggle i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #8191a5;
  content: "";
  transition: transform 180ms ease, background 180ms ease;
}

.plan-toggle.is-on i {
  background: rgba(75, 199, 168, 0.35);
}

.plan-toggle.is-on i::after {
  background: var(--accent);
  transform: translateX(15px);
}

.routine-preview {
  margin-top: 14px;
  padding: 15px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
}

.routine-track {
  display: flex;
  gap: 4px;
  min-height: 60px;
  margin-top: 12px;
}

.routine-segment {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 74px;
  padding: 10px;
  border-radius: 12px;
  transition: flex-grow 220ms ease;
}

.routine-segment span {
  font-size: 14px;
}

.routine-segment small {
  margin-top: 4px;
  color: rgba(239, 246, 255, 0.6);
  font-size: 12px;
}

.routine-segment.emotion { background: rgba(142, 169, 255, 0.18); color: var(--sleep); }
.routine-segment.breathing { background: rgba(140, 224, 203, 0.18); color: var(--accent); }
.routine-segment.sleep { background: rgba(245, 185, 113, 0.15); color: var(--signal); }

.breathing-preview {
  display: grid;
  grid-template-columns: 210px 1fr;
  align-items: center;
  gap: 24px;
  margin-top: 14px;
  padding: 22px;
  border: 1px solid rgba(142, 169, 255, 0.14);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(19, 35, 59, 0.86), rgba(7, 18, 31, 0.9));
}

.breath-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 180px;
}

.breath-orb,
.breath-ring {
  position: absolute;
  width: 126px;
  height: 126px;
  border-radius: 50%;
}

.breath-orb {
  display: grid;
  place-content: center;
  z-index: 2;
  color: #07151d;
  background: radial-gradient(circle at 35% 30%, #d7fff4, var(--accent));
  box-shadow: 0 0 50px rgba(140, 224, 203, 0.24);
  text-align: center;
  transform: scale(0.72);
  transition: transform 120ms linear, background 300ms ease;
}

.breath-orb span {
  max-width: 105px;
  font-size: 20px;
  line-height: 1.15;
  font-weight: 700;
}

.breath-orb small {
  margin-top: 4px;
  font-size: 13px;
}

.breath-ring {
  border: 1px solid rgba(140, 224, 203, 0.18);
  opacity: 0;
}

.breathing-preview.is-active .breath-ring {
  animation: breath-ripple 3s ease-out infinite;
}

.breathing-preview.is-active .breath-ring.two {
  animation-delay: 1.5s;
}

.breathing-preview.is-exhale .breath-orb {
  background: radial-gradient(circle at 35% 30%, #e4eaff, var(--sleep));
}

.breathing-preview.is-meditating .breath-orb {
  color: #0b1b27;
  background: radial-gradient(circle at 35% 30%, #e8f1ff, #9bbbe7);
  box-shadow: 0 0 62px rgba(142, 169, 255, 0.32);
}

.breathing-preview.is-complete .breath-orb {
  background: radial-gradient(circle at 35% 30%, #fff4cf, var(--signal));
  transform: scale(0.8) !important;
}

.breath-preview-copy h4 {
  margin: 0 0 8px;
  font-size: 25px;
}

.breath-preview-copy > p:not(.card-label) {
  min-height: 42px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.preview-progress {
  height: 5px;
  overflow: hidden;
  margin: 15px 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.preview-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sleep), var(--accent));
  transition: width 100ms linear;
}

.breath-preview-copy button {
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #06131a;
  background: var(--accent);
  font-size: 15px;
  font-weight: 700;
}

@keyframes breath-ripple {
  0% { opacity: 0.35; transform: scale(0.75); }
  100% { opacity: 0; transform: scale(1.55); }
}

.sleep-clock-card {
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(142, 169, 255, 0.22);
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 30%, rgba(142, 169, 255, 0.16), transparent 28%),
    radial-gradient(circle at 85% 100%, rgba(140, 224, 203, 0.09), transparent 30%),
    rgba(5, 14, 27, 0.96);
  box-shadow: var(--shadow);
}

.sleep-clock-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  align-items: center;
  gap: 30px;
}

.analog-clock {
  display: grid;
  place-items: center;
  min-height: 238px;
}

.clock-face {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: repeating-conic-gradient(from -0.5deg, rgba(197, 215, 240, 0.5) 0 1deg, transparent 1deg 6deg);
  box-shadow:
    0 0 0 1px rgba(142, 169, 255, 0.22),
    0 0 45px rgba(142, 169, 255, var(--clock-glow));
}

.clock-face::before {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(142, 169, 255, 0.12);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 58%, rgba(140, 224, 203, 0.08), transparent 45%),
    #0a1728;
  content: "";
}

.clock-number {
  position: absolute;
  z-index: 2;
  color: #94a9c5;
  font-family: "Bahnschrift", "Segoe UI Variable Display", sans-serif;
  font-size: 14px;
}

.clock-number.n12 { top: 18px; left: 50%; transform: translateX(-50%); }
.clock-number.n3 { top: 50%; right: 21px; transform: translateY(-50%); }
.clock-number.n6 { bottom: 17px; left: 50%; transform: translateX(-50%); }
.clock-number.n9 { top: 50%; left: 21px; transform: translateY(-50%); }

.clock-hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  z-index: 3;
  display: block;
  border-radius: 999px 999px 3px 3px;
  transform-origin: 50% 100%;
}

.hour-hand {
  width: 5px;
  height: 52px;
  margin-left: -2.5px;
  background: #d4e0ef;
  transform: rotate(308deg);
}

.minute-hand {
  width: 3px;
  height: 72px;
  margin-left: -1.5px;
  background: #9db3ce;
  transform: rotate(72deg);
}

.second-hand {
  width: 2px;
  height: 86px;
  margin-left: -1px;
  background: linear-gradient(180deg, var(--signal), #ff8f88);
  box-shadow: 0 0 10px rgba(245, 185, 113, 0.45);
  transition: transform 100ms linear;
}

.clock-center {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  width: 13px;
  height: 13px;
  border: 3px solid #0a1728;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 14px rgba(245, 185, 113, 0.42);
  transform: translate(-50%, -50%);
}

.sleep-clock-info {
  min-width: 0;
}

.sleep-stopwatch {
  margin: 6px 0 10px;
  color: var(--text);
  font-family: "Bahnschrift", "Segoe UI Variable Display", sans-serif;
  font-size: clamp(40px, 5vw, 64px);
  letter-spacing: 0.04em;
  line-height: 1;
  text-shadow: 0 0 28px rgba(142, 169, 255, 0.24);
}

.simulated-time-row,
.sleep-loading-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.simulated-time-row {
  max-width: 360px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 12px;
}

.simulated-time-row strong {
  color: var(--accent);
  font-size: 15px;
}

.sleep-clock-info h4 {
  margin: 18px 0 5px;
  font-size: 22px;
}

.sleep-clock-info .scenario-copy {
  margin: 0;
}

.sleep-replay-button {
  margin-top: 15px;
  padding: 9px 14px;
  border: 1px solid rgba(142, 169, 255, 0.22);
  border-radius: 999px;
  cursor: pointer;
  color: var(--sleep);
  background: rgba(142, 169, 255, 0.08);
}

.sleep-loading {
  margin-top: 18px;
  padding: 17px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
}

.sleep-loading-heading {
  color: var(--muted);
  font-size: 13px;
}

.sleep-loading-heading strong {
  color: var(--accent);
  font-family: "Bahnschrift", "Segoe UI Variable Display", sans-serif;
  font-size: 18px;
}

.sleep-progress-track {
  height: 9px;
  overflow: hidden;
  margin: 12px 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.sleep-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sleep), var(--accent) 55%, var(--signal));
  box-shadow: 0 0 16px rgba(140, 224, 203, 0.25);
  transition: width 100ms linear;
}

.sleep-stage-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.sleep-stage-step {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #647994;
  font-size: 11px;
  transition: color 220ms ease;
}

.sleep-stage-step i {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #152337;
  font-style: normal;
  transition: background 220ms ease, box-shadow 220ms ease;
}

.sleep-stage-step span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sleep-stage-step.is-current {
  color: var(--signal);
}

.sleep-stage-step.is-current i {
  color: #171109;
  background: var(--signal);
  box-shadow: 0 0 17px rgba(245, 185, 113, 0.3);
}

.sleep-stage-step.is-complete {
  color: var(--accent);
}

.sleep-stage-step.is-complete i {
  color: #06151a;
  background: var(--accent);
}

.sleep-clock-card.is-complete .sleep-progress-track span {
  box-shadow: 0 0 24px rgba(245, 185, 113, 0.38);
}

.learning-pipeline,
.learning-dashboard-card,
.tomorrow-prediction-card {
  padding: 20px;
  border: 1px solid var(--panel-border);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.learning-pipeline {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 0% 0%, rgba(142, 169, 255, 0.16), transparent 34%),
    radial-gradient(circle at 100% 100%, rgba(140, 224, 203, 0.1), transparent 32%),
    rgba(6, 16, 30, 0.96);
}

.learning-pipeline::after {
  position: absolute;
  top: -70px;
  left: calc(var(--learning-progress) * 100% - 80px);
  width: 160px;
  height: 250px;
  border-radius: 50%;
  background: rgba(140, 224, 203, 0.07);
  filter: blur(24px);
  content: "";
  pointer-events: none;
  transition: left 100ms linear;
}

.learning-dashboard-card {
  background: rgba(8, 19, 34, 0.94);
}

.learning-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.learning-section-heading h4 {
  margin: 0;
  font-size: 22px;
}

.learning-model-status,
.explainability-badge,
.intervention-period {
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--sleep);
  background: rgba(142, 169, 255, 0.12);
  font-size: 12px;
  white-space: nowrap;
}

.learning-model-status strong {
  color: var(--accent);
}

.learning-flow-line {
  height: 4px;
  overflow: hidden;
  margin: 24px 28px -15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.learning-flow-line span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sleep), var(--accent));
  box-shadow: 0 0 14px rgba(140, 224, 203, 0.45);
  transition: width 80ms linear;
}

.learning-steps {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.learning-step {
  display: grid;
  justify-items: center;
  gap: 9px;
  min-width: 0;
  color: #667b95;
  text-align: center;
  transition: color 220ms ease, transform 220ms ease;
}

.learning-step > i {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: #101f33;
  font-style: normal;
  transition: background 220ms ease, box-shadow 220ms ease;
}

.learning-step strong,
.learning-step small {
  display: block;
}

.learning-step strong {
  font-size: 13px;
}

.learning-step small {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.4;
}

.learning-step.is-active {
  color: var(--signal);
  transform: translateY(-2px);
}

.learning-step.is-active > i {
  color: #1d160b;
  background: var(--signal);
  box-shadow: 0 0 22px rgba(245, 185, 113, 0.35);
  animation: learning-node-pulse 1s ease-in-out infinite;
}

.learning-step.is-complete {
  color: var(--accent);
}

.learning-step.is-complete > i {
  color: #07151b;
  background: var(--accent);
}

.replay-learning-button {
  display: block;
  margin: 20px auto 0;
  padding: 9px 14px;
  border: 1px solid rgba(140, 224, 203, 0.22);
  border-radius: 999px;
  cursor: pointer;
  color: var(--accent);
  background: rgba(140, 224, 203, 0.07);
}

.learning-metric-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.learning-metric-tabs button {
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
}

.learning-metric-tabs button.is-selected {
  border-color: rgba(140, 224, 203, 0.3);
  color: var(--accent);
  background: rgba(140, 224, 203, 0.1);
}

.learning-chart-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.learning-chart-summary > div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.learning-chart-summary small {
  color: var(--muted);
  font-size: 10px;
}

.learning-chart-summary strong {
  font-size: 15px;
}

.learning-chart-wrap {
  position: relative;
  margin-top: 12px;
}

.learning-trend-chart {
  width: 100%;
  height: 230px;
  overflow: visible;
}

.learning-chart-grid line {
  stroke: rgba(157, 177, 204, 0.1);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.learning-area {
  fill: url(#learning-area-gradient);
}

.learning-line {
  fill: none;
  stroke: var(--learning-line-color);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  animation: learning-line-reveal 900ms ease-out both;
}

.intervention-marker {
  stroke: rgba(245, 185, 113, 0.62);
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
  vector-effect: non-scaling-stroke;
}

.learning-latest-point {
  fill: var(--learning-line-color);
  stroke: rgba(255, 255, 255, 0.24);
  stroke-width: 7;
  vector-effect: non-scaling-stroke;
  animation: point-pulse 1.4s ease-out infinite;
}

.intervention-label {
  position: absolute;
  top: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--signal);
  background: rgba(7, 17, 31, 0.88);
  font-size: 10px;
  transform: translateX(-50%);
}

.learning-chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: -4px;
  color: #6f849f;
  font-size: 10px;
}

.influence-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.influence-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
}

.influence-row strong,
.influence-row small {
  display: block;
}

.influence-row strong {
  font-size: 13px;
}

.influence-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.influence-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.influence-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  transform-origin: left;
  animation: influence-grow 700ms ease-out both;
}

.influence-row.negative .influence-bar span {
  background: linear-gradient(90deg, #d98579, var(--signal));
}

.influence-row.positive .influence-bar span {
  background: linear-gradient(90deg, #5f96d1, var(--accent));
}

.influence-row b {
  color: var(--text);
  text-align: right;
  font-size: 13px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.comparison-card {
  padding: 15px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.comparison-card > p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.comparison-values {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 7px;
}

.comparison-values span,
.comparison-values strong {
  display: grid;
  gap: 4px;
  font-size: 14px;
}

.comparison-values small {
  color: #71849c;
  font-size: 9px;
  font-weight: 400;
}

.comparison-values i {
  color: var(--accent);
  font-style: normal;
}

.comparison-values strong {
  color: var(--accent);
}

.comparison-card em {
  display: inline-block;
  margin-top: 11px;
  color: var(--signal);
  font-size: 11px;
  font-style: normal;
}

.tomorrow-prediction-card {
  position: relative;
  display: grid;
  grid-template-columns: 0.7fr 1.6fr;
  align-items: center;
  gap: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 0% 100%, rgba(140, 224, 203, 0.19), transparent 35%),
    linear-gradient(135deg, rgba(13, 39, 58, 0.98), rgba(11, 24, 42, 0.98));
}

.prediction-score {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  align-content: center;
}

.prediction-score .card-label,
.prediction-score small {
  grid-column: 1 / -1;
}

.prediction-score > strong {
  color: var(--accent);
  font-family: "Bahnschrift", "Segoe UI Variable Display", sans-serif;
  font-size: 64px;
  line-height: 1;
}

.prediction-score > span {
  color: var(--muted);
}

.prediction-score small {
  margin-top: 8px;
  color: var(--muted);
}

.prediction-plan h4 {
  margin: 0 0 10px;
  font-size: 20px;
}

.prediction-plan ul {
  margin: 0;
  padding-left: 19px;
  color: #bfd2e5;
  line-height: 1.75;
}

.prediction-arrow {
  position: absolute;
  right: 20px;
  bottom: -28px;
  color: rgba(140, 224, 203, 0.08);
  font-size: 120px;
  line-height: 1;
}

.learning-disclaimer {
  margin: 0;
  color: #6f849f;
  font-size: 11px;
  text-align: center;
}

@keyframes learning-node-pulse {
  0%, 100% { transform: scale(0.9); }
  50% { transform: scale(1.08); }
}

@keyframes learning-line-reveal {
  from { stroke-dasharray: 1; stroke-dashoffset: 1; }
  to { stroke-dasharray: 1; stroke-dashoffset: 0; }
}

@keyframes influence-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.progress-panel,
.source-card {
  padding: 20px;
}

.progress-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.progress-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.progress-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  font-family: "Bahnschrift", "Segoe UI Variable Display", sans-serif;
  font-size: 13px;
}

.progress-steps li.is-active,
.progress-steps li.is-complete {
  color: var(--text);
}

.progress-steps li.is-active .progress-index {
  background: rgba(140, 224, 203, 0.18);
  border-color: rgba(140, 224, 203, 0.45);
}

.progress-steps li.is-complete .progress-index {
  background: rgba(75, 199, 168, 0.2);
  color: var(--accent);
}

.main-panel {
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid rgba(142, 169, 255, 0.3);
  border-radius: 999px;
  color: #b9c8dd;
  background: linear-gradient(135deg, rgba(140, 224, 203, 0.09), rgba(142, 169, 255, 0.08));
  box-shadow: inset 0 0 18px rgba(142, 169, 255, 0.06);
  font-family: "Bahnschrift", "Segoe UI Variable Display", sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.theme-chip i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      from 22.5deg,
      var(--kaleidoscope-cyan) 0deg 9deg,
      transparent 9deg 22.5deg,
      var(--kaleidoscope-blue) 22.5deg 31.5deg,
      transparent 31.5deg 45deg
    );
  opacity: 0.78;
}

.ghost-button,
.primary-button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.ghost-button {
  padding: 12px 18px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.primary-button {
  padding: 14px 24px;
  color: #041018;
  background: linear-gradient(120deg, var(--accent) 0%, #b7efe7 48%, #afc4ff 100%);
  font-weight: 700;
}

.ghost-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 24px;
}

.hero-card,
.metrics-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
}

.hero-card {
  border-color: rgba(140, 224, 203, 0.26);
  background:
    radial-gradient(circle at 100% 0%, rgba(142, 169, 255, 0.08), transparent 31%),
    var(--panel);
}

.metrics-card {
  border-color: rgba(142, 169, 255, 0.24);
}

.hero-card::before,
.metrics-card::before {
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      from 0deg,
      rgba(140, 224, 203, 0.2) 0deg 7deg,
      transparent 7deg 30deg,
      rgba(142, 169, 255, 0.16) 30deg 37deg,
      transparent 37deg 60deg
    );
  content: "";
  mask-image: radial-gradient(circle, transparent 0 28%, #000 30% 62%, transparent 76%);
  pointer-events: none;
}

.hero-card::before {
  top: -118px;
  right: -62px;
  opacity: 0.82;
}

.metrics-card::before {
  right: -110px;
  bottom: -126px;
  opacity: 0.56;
  transform: rotate(15deg);
}

.hero-card > *,
.metrics-card > * {
  position: relative;
  z-index: 1;
}

.hero-card__header,
.metrics-card__header,
.chart-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.stage-badge,
.sensor-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  background: rgba(142, 169, 255, 0.16);
  color: var(--sleep);
}

.sensor-pill i,
.live-indicator,
.metric-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(140, 224, 203, 0.75);
  animation: live-pulse 1.8s ease-in-out infinite;
}

.hero-description {
  margin: 16px 0 28px;
  max-width: 58ch;
}

.screen-body {
  display: grid;
  gap: 18px;
}

.hero-actions {
  margin-top: 28px;
}

.scenario-card,
.sub-card,
.wake-window,
.companion-card {
  padding: 18px;
}

.scenario-card h4,
.sub-card h4,
.wake-window h4 {
  margin: 0 0 12px;
  font-size: 20px;
}

.stage-list,
.summary-list {
  margin: 0;
  padding-left: 20px;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.signal-tags,
.plan-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.signal-tag,
.plan-tag {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 14px;
}

.signal-tag.alert {
  background: rgba(255, 143, 136, 0.16);
  color: var(--alert);
}

.signal-tag.good {
  background: rgba(140, 224, 203, 0.16);
  color: var(--accent);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 260ms ease, background 260ms ease;
  border: 1px solid transparent;
}

.metric.is-improving {
  border-color: rgba(140, 224, 203, 0.13);
  background: linear-gradient(145deg, rgba(140, 224, 203, 0.075), rgba(255, 255, 255, 0.025));
}

.metric.is-alerting {
  border-color: rgba(245, 185, 113, 0.12);
}

.metric-heading,
.metric-reading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.metric-heading .card-label {
  margin-bottom: 0;
}

.metric-live-dot {
  width: 5px;
  height: 5px;
}

.metric-value {
  margin: 8px 0 6px;
  font-family: "Bahnschrift", "Segoe UI Variable Display", sans-serif;
  font-size: 28px;
}

.metric-unit {
  color: var(--muted);
  font-size: 12px;
}

.metric-sparkline {
  width: 46%;
  height: 32px;
  overflow: visible;
}

.metric-sparkline polyline {
  fill: none;
  stroke: var(--sleep);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.metric.is-improving .metric-sparkline polyline {
  stroke: var(--accent);
}

.metric.is-alerting .metric-sparkline polyline {
  stroke: var(--signal);
}

.metric-trend {
  margin: -2px 0 7px;
  color: var(--muted);
  font-size: 11px;
}

.metric.is-improving .metric-trend {
  color: var(--accent);
}

.metric.is-alerting .metric-trend {
  color: var(--signal);
}

.metric-copy {
  margin: 0;
  font-size: 13px;
}

.chart-card,
.insight-card {
  padding: 18px;
}

.timeline-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}

.timeline-bars {
  min-height: 228px;
  margin-top: 18px;
}

.chart-legend,
.chart-time-axis {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 16px;
  height: 2px;
  border-radius: 999px;
}

.chart-legend .heart-line {
  background: var(--signal);
}

.chart-legend .hrv-line {
  background: var(--accent);
}

.chart-legend .simulation-rate {
  margin-left: auto;
  color: #7287a1;
}

.sensor-chart {
  width: 100%;
  height: 178px;
  margin-top: 8px;
  overflow: visible;
}

.chart-grid line {
  stroke: rgba(157, 177, 204, 0.1);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.heart-area {
  fill: url(#heart-area);
}

.chart-line {
  fill: none;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  animation: chart-reveal 500ms ease-out both;
}

.chart-line-heart {
  stroke: var(--signal);
}

.chart-line-hrv {
  stroke: var(--accent);
}

.chart-cursor {
  stroke: rgba(239, 246, 255, 0.2);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  vector-effect: non-scaling-stroke;
}

.chart-point {
  vector-effect: non-scaling-stroke;
  stroke-width: 6;
  animation: point-pulse 1.4s ease-out infinite;
}

.chart-point-heart {
  fill: var(--signal);
  stroke: rgba(245, 185, 113, 0.18);
}

.chart-point-hrv {
  fill: var(--accent);
  stroke: rgba(140, 224, 203, 0.18);
}

.chart-time-axis {
  justify-content: space-between;
  padding: 0 3px;
}

@keyframes live-pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes chart-reveal {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

@keyframes point-pulse {
  0%, 100% { stroke-width: 4; }
  50% { stroke-width: 9; }
}

@keyframes kaleidoscope-drift {
  from { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.035); }
  to { transform: rotate(360deg) scale(1); }
}

@keyframes kaleidoscope-drift-reverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

.insight-text {
  margin: 0;
}

.wake-slider {
  display: grid;
  gap: 12px;
}

.time-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.time-row input[type="range"] {
  width: 100%;
}

.time-row span {
  min-width: 62px;
  font-family: "Bahnschrift", "Segoe UI Variable Display", sans-serif;
}

.companion-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(140, 224, 203, 0.13), transparent 34%),
    rgba(8, 19, 34, 0.95);
}

.companion-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.companion-header h4 {
  margin: 0;
  font-size: 20px;
}

.companion-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 12px;
  white-space: nowrap;
}

.companion-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}

.context-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.context-strip span {
  padding: 7px 10px;
  border: 1px solid rgba(140, 224, 203, 0.16);
  border-radius: 999px;
  color: #b9cce1;
  background: rgba(140, 224, 203, 0.06);
  font-size: 12px;
}

.chat-messages {
  display: grid;
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
  padding: 16px;
  border-radius: 20px;
  background: rgba(2, 9, 17, 0.55);
}

.chat-message {
  max-width: 82%;
}

.chat-message.is-user {
  justify-self: end;
}

.chat-message p {
  margin: 4px 0 0;
  padding: 11px 13px;
  border-radius: 6px 18px 18px 18px;
  color: #dce9f8;
  background: rgba(255, 255, 255, 0.07);
  line-height: 1.6;
}

.chat-message.is-user p {
  border-radius: 18px 6px 18px 18px;
  color: #06131b;
  background: var(--accent);
}

.chat-role {
  color: var(--muted);
  font-size: 11px;
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.quick-replies button,
.chat-form button {
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  cursor: pointer;
}

.quick-replies button {
  padding: 8px 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 10px;
}

.chat-form input {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.chat-form input:focus {
  border-color: rgba(140, 224, 203, 0.55);
}

.chat-form button {
  padding: 0 18px;
  color: #06131b;
  background: var(--accent);
  font-weight: 700;
}

.chat-footnote {
  margin: 10px 2px 0;
  color: #7287a1;
  font-size: 11px;
}

.wake-demo {
  overflow: hidden;
  border: 1px solid rgba(245, 185, 113, 0.22);
  border-radius: 26px;
  background: rgba(6, 15, 29, 0.96);
  box-shadow: var(--shadow);
}

.wake-sky {
  position: relative;
  min-height: 230px;
  overflow: hidden;
  background: linear-gradient(180deg, #07101f 0%, #14223a 66%, #3b3b4f 100%);
}

.wake-morning {
  position: absolute;
  inset: 0;
  opacity: var(--wake-progress);
  background:
    radial-gradient(circle at 50% 100%, rgba(255, 231, 164, 0.9), transparent 32%),
    linear-gradient(180deg, #4779aa 0%, #df9b87 64%, #ffd793 100%);
  transition: opacity 300ms linear;
}

.wake-stars {
  position: absolute;
  inset: 0;
  opacity: calc(1 - var(--wake-progress));
  transition: opacity 300ms linear;
}

.wake-stars i {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #dceaff;
  box-shadow: 0 0 8px #b9d7ff;
}

.wake-stars i:nth-child(1) { left: 12%; top: 24%; }
.wake-stars i:nth-child(2) { left: 29%; top: 38%; }
.wake-stars i:nth-child(3) { left: 66%; top: 20%; }
.wake-stars i:nth-child(4) { left: 82%; top: 42%; }
.wake-stars i:nth-child(5) { left: 51%; top: 13%; }

.wake-sun {
  position: absolute;
  left: calc(50% - 37px);
  bottom: 34px;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  opacity: calc(0.18 + var(--wake-progress));
  background: #fff1b5;
  box-shadow: 0 0 28px rgba(255, 218, 128, 0.7), 0 0 80px rgba(255, 188, 105, 0.55);
  transform: translateY(var(--sun-y));
  transition: transform 300ms linear, opacity 300ms linear;
}

.wake-horizon {
  position: absolute;
  right: -6%;
  bottom: -48px;
  left: -6%;
  height: 100px;
  border-radius: 50% 50% 0 0;
  background: #111b2b;
  box-shadow: 0 -10px 40px rgba(255, 181, 112, var(--horizon-glow));
}

.wake-clock {
  position: absolute;
  top: 22px;
  left: 24px;
  display: grid;
  z-index: 2;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

.wake-clock span {
  font-family: "Bahnschrift", "Segoe UI Variable Display", sans-serif;
  font-size: 42px;
  letter-spacing: -0.04em;
}

.wake-clock small {
  color: rgba(239, 246, 255, 0.74);
}

.wake-demo-content {
  padding: 20px;
}

.wake-demo-heading,
.wake-demo-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wake-demo-heading h4 {
  margin: 0;
  font-size: 21px;
}

.wake-demo-heading > span {
  color: var(--signal);
  font-family: "Bahnschrift", "Segoe UI Variable Display", sans-serif;
  font-size: 28px;
}

.wake-progress-track {
  height: 6px;
  overflow: hidden;
  margin: 16px 0 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.wake-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6d9dcc 0%, #f5b971 70%, #fff0b4 100%);
  transition: width 200ms linear;
}

.wake-phases {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.wake-phase {
  display: grid;
  justify-items: center;
  gap: 7px;
  color: #667b96;
  text-align: center;
  font-size: 11px;
  transition: color 240ms ease;
}

.wake-phase i {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  font-style: normal;
  background: #101d2e;
  transition: background 240ms ease, box-shadow 240ms ease;
}

.wake-phase.is-current {
  color: var(--signal);
}

.wake-phase.is-current i {
  color: #16202a;
  background: var(--signal);
  box-shadow: 0 0 20px rgba(245, 185, 113, 0.32);
}

.wake-phase.is-complete {
  color: var(--accent);
}

.wake-phase.is-complete i {
  color: #07151b;
  background: var(--accent);
}

.wake-demo-actions {
  margin-top: 20px;
}

.wake-demo-button {
  padding: 11px 16px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #1d160d;
  background: linear-gradient(135deg, var(--signal), #ffdea8);
  font-weight: 700;
}

.wake-demo-actions span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.wake-demo.is-complete .wake-sky {
  box-shadow: inset 0 -36px 80px rgba(255, 220, 157, 0.16);
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    gap: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--panel-border);
  }

  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main-panel,
  .sidebar {
    padding: 20px;
  }

  .grid-two,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .hero-card__header,
  .metrics-card__header,
  .chart-card__header,
  .companion-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .theme-chip {
    padding: 8px 11px;
  }

  body::before {
    top: -310px;
    right: -285px;
    opacity: 0.34;
  }

  body::after {
    display: none;
  }

  .chat-message {
    max-width: 92%;
  }

  .wake-demo-actions,
  .wake-demo-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .wake-demo-actions span {
    text-align: left;
  }

  .wake-phases {
    gap: 4px;
  }

  .wake-phase span {
    font-size: 10px;
  }

  .analysis-heading {
    flex-direction: column;
  }

  .analysis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .evidence-flow {
    grid-template-columns: 1fr;
  }

  .evidence-flow i {
    justify-self: center;
    transform: rotate(90deg);
  }

  .composer-heading,
  .control-label-row,
  .routine-heading {
    flex-direction: column;
  }

  .plan-control-grid,
  .breathing-preview {
    grid-template-columns: 1fr;
  }

  .choice-buttons {
    grid-template-columns: 1fr;
  }

  .breath-visual {
    min-height: 165px;
  }

  .routine-track {
    overflow-x: auto;
  }

  .sleep-clock-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .sleep-clock-info {
    text-align: center;
  }

  .simulated-time-row {
    margin: 0 auto;
  }

  .sleep-stage-steps {
    grid-template-columns: 1fr;
  }

  .sleep-stage-step span {
    white-space: normal;
  }

  .learning-section-heading {
    flex-direction: column;
  }

  .learning-model-status,
  .explainability-badge,
  .intervention-period {
    white-space: normal;
  }

  .learning-flow-line {
    display: none;
  }

  .learning-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 20px;
  }

  .learning-step {
    justify-items: start;
    grid-template-columns: auto 1fr;
    text-align: left;
  }

  .learning-chart-summary,
  .comparison-grid,
  .tomorrow-prediction-card {
    grid-template-columns: 1fr;
  }

  .learning-trend-chart {
    height: 195px;
  }

  .influence-row {
    grid-template-columns: 96px minmax(0, 1fr) 38px;
    gap: 8px;
  }

  .prediction-arrow {
    display: none;
  }

  .prediction-score > strong {
    font-size: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after,
  .sensor-pill i,
  .live-indicator,
  .metric-live-dot {
    animation: none;
  }
}
