@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap");

:root {
  --ink: #0f172a;
  --ink-soft: #475569;
  --blue: #2f80ed;
  --blue-soft: #60a5fa;
  --teal: #1e3a8a;
  --teal-hover: #1d4ed8;
  --leaf: #38b35a;
  --cream: #f8fafc;
  --cream-deep: #f1f5f9;
  --sand: #eff6ff;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --shadow: 0 12px 32px -12px rgba(15, 23, 42, 0.12);
  --radius: 1.25rem;
  --pill: 999px;
  --header-h: 70px;
  --edge: 0.85rem;
  color-scheme: light;
}

html[data-theme="dark"] {
  --ink: #f1f5f9;
  --ink-soft: #cbd5e1;
  --blue: #60a5fa;
  --blue-soft: #93c5fd;
  --teal: #60a5fa;
  --teal-hover: #93c5fd;
  --leaf: #4ade80;
  --cream: #0b1220;
  --cream-deep: #0f1a33;
  --sand: #111d3a;
  --surface: #111b33;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --line: #1f2d4d;
  --danger: #f87171;
  --danger-bg: #3a1618;
  --shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}


/* Hide page until branded splash finishes */
html.ht-waiting body>*:not(#ht-loader) {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

html.ht-waiting,
html.ht-waiting body {
  overflow: hidden !important;
  background: #f8fafc;
}

/* Branded logo splash loader */
.ht-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 22%, rgba(47, 128, 237, 0.14), transparent 44%),
    radial-gradient(circle at 72% 70%, rgba(56, 179, 90, 0.12), transparent 42%),
    linear-gradient(165deg, #ffffff 0%, #f8fafc 48%, #eff6ff 100%);
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.75s ease, visibility 0.75s ease, transform 0.75s ease;
}

.ht-loader.is-done {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.03);
  pointer-events: none;
}

.ht-loader-glow {
  position: absolute;
  width: min(70vw, 440px);
  height: min(70vw, 440px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 128, 237, 0.16), transparent 68%);
  filter: blur(10px);
  animation: ht-glow-breathe 2.6s ease-in-out infinite;
}

.ht-loader-orbits {
  position: absolute;
  width: min(78vw, 420px);
  height: min(78vw, 420px);
}

.ht-loader-orbits span {
  position: absolute;
  inset: 0;
  border: 1.5px solid rgba(11, 30, 63, 0.12);
  border-radius: 50%;
  animation: ht-orbit-spin 7.5s linear infinite;
}

.ht-loader-orbits span:nth-child(2) {
  inset: 12%;
  border-color: rgba(56, 179, 90, 0.28);
  animation-duration: 5.2s;
  animation-direction: reverse;
}

.ht-loader-orbits span:nth-child(3) {
  inset: 24%;
  border-color: rgba(47, 128, 237, 0.3);
  animation-duration: 3.6s;
}

.ht-loader-orbits span::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2f80ed;
  box-shadow: 0 0 16px rgba(47, 128, 237, 0.85);
  transform: translateX(-50%);
}

.ht-loader-orbits span:nth-child(2)::after {
  background: #38b35a;
  box-shadow: 0 0 16px rgba(56, 179, 90, 0.85);
}

.ht-loader-orbits span:nth-child(3)::after {
  background: #7ddff0;
  width: 6px;
  height: 6px;
}

.ht-loader-core {
  position: relative;
  z-index: 2;
  width: min(88vw, 320px);
  text-align: center;
}

.ht-logo-stage {
  position: relative;
  width: min(72vw, 240px);
  margin: 0 auto;
}

.ht-loader-logo {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0;
  transform: scale(0.88) translateY(10px);
  animation: ht-logo-in 1s cubic-bezier(0.22, 1, 0.36, 1) 0.12s forwards;
  filter: drop-shadow(0 18px 40px rgba(47, 128, 237, 0.25));
}

.ht-logo-pulse {
  position: absolute;
  inset: 10% 16% 38% 16%;
  border-radius: 50%;
  border: 2px solid rgba(56, 179, 90, 0.45);
  opacity: 0;
  animation: ht-heart-pulse 1.5s ease-out 1s 2;
  pointer-events: none;
}

.ht-loader-bar {
  width: min(180px, 58%);
  height: 3px;
  margin: 1.45rem auto 0;
  border-radius: 999px;
  background: rgba(11, 30, 63, 0.1);
  overflow: hidden;
}

.ht-loader-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f80ed, #38b35a, #7ddff0, #2f80ed);
  background-size: 220% 100%;
  animation: ht-bar-fill 2.1s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards,
    ht-bar-sheen 1.25s linear 0.2s infinite;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-logo img {
  display: block;
  height: 52px;
  width: auto;
  max-width: min(220px, 58vw);
  object-fit: contain;
  background: transparent;
}

.site-logo:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.site-logo.logo-lg img {
  height: 88px;
  max-width: min(280px, 70vw);
}

.site-logo.logo-sm img {
  height: 48px;
}

.site-logo.logo-auth img {
  height: 112px;
  max-width: min(320px, 82vw);
}

.site-logo.logo-footer img {
  height: 72px;
}

@keyframes ht-logo-in {
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes ht-heart-pulse {
  0% {
    opacity: 0.55;
    transform: scale(0.92);
  }

  70% {
    opacity: 0;
    transform: scale(1.18);
  }

  100% {
    opacity: 0;
    transform: scale(1.22);
  }
}

@keyframes ht-bar-fill {
  to {
    width: 100%;
  }
}

@keyframes ht-bar-sheen {
  0% {
    background-position: 0% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

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

@keyframes ht-glow-breathe {

  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.65;
  }

  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {

  .ht-loader-glow,
  .ht-loader-orbits span,
  .ht-loader-logo,
  .ht-logo-pulse,
  .ht-loader-bar i {
    animation: none !important;
  }

  .ht-loader-logo {
    opacity: 1;
    transform: none;
  }

  .ht-loader-bar i {
    width: 100%;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Outfit", "Helvetica Neue", sans-serif;
  font-size: 16.5px;
  line-height: 1.6;
  background:
    radial-gradient(900px 420px at 90% -5%, rgba(47, 128, 237, 0.08), transparent 55%),
    radial-gradient(700px 380px at 0% 20%, rgba(30, 58, 138, 0.06), transparent 50%),
    linear-gradient(180deg, var(--cream) 0%, var(--cream-deep) 55%, var(--sand) 100%);
  background-attachment: fixed;
  transition: background 0.35s ease, color 0.25s ease;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(900px 420px at 90% -5%, rgba(47, 128, 237, 0.14), transparent 55%),
    radial-gradient(700px 380px at 0% 20%, rgba(96, 165, 250, 0.1), transparent 50%),
    linear-gradient(180deg, var(--cream) 0%, #0f1816 55%, var(--sand) 100%);
}

h1,
h2,
h3,
.brand-mark,
.display,
.hero-brand {
  font-family: "Outfit", system-ui, sans-serif;
  letter-spacing: -0.025em;
  color: var(--blue);
  font-weight: 600;
}

a {
  color: inherit;
  text-decoration: none;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100vw;
  height: 100vh;
  opacity: 0.16;
  pointer-events: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
}

html[data-theme="dark"] #bg-canvas {
  opacity: 0.28;
}

.site-nav {
  max-width: none;
  margin: 0;
  padding: 0.9rem var(--edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-mark {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}

.brand-mark span {
  display: block;
  font-family: "Outfit", sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--leaf);
  margin-top: 0.2rem;
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem 1rem;
}

.nav-link {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--teal);
}

.page-shell {
  max-width: none;
  margin: 0;
  padding: 2rem var(--edge) 3rem;
}

.page-shell.narrow {
  max-width: 40rem;
}

.page-shell.mid {
  max-width: none;
}

.glass-card,
.care-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.inset-panel {
  background: linear-gradient(160deg, var(--surface), var(--sand));
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.2rem 1.3rem;
}

.gradient-btn,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--teal);
  color: #fff !important;
  border: none;
  border-radius: var(--pill);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  padding: 0.85rem 1.4rem;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 8px 20px rgba(30, 58, 138, 0.2);
}

.gradient-btn:hover,
.btn-primary:hover {
  background: var(--teal-hover);
  transform: translateY(-1px);
}

.btn-secondary,
.toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--teal);
  border: 1.5px solid rgba(30, 58, 138, 0.28);
  border-radius: var(--pill);
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-secondary:hover,
.toolbar-btn:hover {
  background: var(--cream-deep);
  border-color: var(--teal);
}

.theme-toggle {
  gap: 0.35rem;
  min-width: 7.5rem;
}

html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .toolbar-btn {
  border-color: rgba(62, 181, 168, 0.35);
  color: var(--teal);
}

[data-logout] {
  color: var(--danger);
  font-weight: 700;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
}

.gradient-text {
  color: var(--blue);
  background: none;
  -webkit-text-fill-color: initial;
}

.input-base {
  background: var(--surface);
  border: 1.5px solid var(--line);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  border-radius: 0.9rem;
}

.input-base:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.16);
}

.page-fade {
  opacity: 1;
}

.eyebrow {
  color: var(--leaf);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lede {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 38rem;
}

.status-text {
  color: var(--teal);
  font-weight: 650;
}

/* One Medical–style split hero */
.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3.25rem 1.5rem 3.5rem clamp(1.5rem, 6vw, 5rem);
}

.hero {
  position: relative;
  min-height: auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: stretch;
  overflow: hidden;
  background: var(--cream);
}

.hero-visual {
  position: relative;
  min-height: 560px;
  display: grid;
  place-items: center;
  padding: 2.5rem 1.5rem 2.5rem 0.5rem;
  background:
    radial-gradient(circle at 62% 48%, rgba(47, 128, 237, 0.14), transparent 46%),
    linear-gradient(145deg, color-mix(in srgb, var(--blue) 12%, var(--cream)) 0%, color-mix(in srgb, var(--teal) 10%, var(--sand)) 52%, var(--cream-deep) 100%);
  overflow: hidden;
}

.hero-photo-frame {
  position: relative;
  z-index: 1;
  margin: 0;
  width: min(78%, 380px);
  aspect-ratio: 3 / 4;
  border-radius: 1.6rem;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-ring {
  position: absolute;
  width: min(82vw, 540px);
  height: min(82vw, 540px);
  border: 3px solid var(--blue);
  border-radius: 50%;
  right: -14%;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.9;
  pointer-events: none;
}

.hero-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hero-brand {
  color: var(--ink);
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin: 0;
  line-height: 0;
}

.hero-brand .site-logo {
  display: inline-flex;
}

.hero-content h1 {
  color: var(--blue);
  font-size: clamp(2.5rem, 5.5vw, 4.2rem);
  line-height: 1.05;
  max-width: 11ch;
  margin: 0.7rem 0 0;
}

.hero-content .lede {
  color: var(--ink-soft);
  margin-top: 1.15rem;
  font-size: 1.12rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.8rem;
}

.hero .btn-primary {
  font-size: 1.02rem;
  padding: 0.95rem 1.55rem;
}

.hero .btn-secondary {
  font-size: 1.02rem;
  padding: 0.9rem 1.4rem;
  background: transparent;
}

.feature-strip {
  max-width: none;
  margin: 0;
  padding: 2.5rem var(--edge) 3.25rem;
}

.section-intro {
  max-width: 40rem;
  margin-bottom: 1.75rem;
}

.section-intro h2 {
  margin: 0.45rem 0 0;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  color: var(--ink);
  line-height: 1.15;
}

.section-intro .lede {
  margin-top: 0.75rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  padding: 1rem 1rem 1.35rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.feature-card .thumb {
  height: 168px;
  border-radius: 1rem;
  margin: 0 0 1rem;
  overflow: hidden;
  background: linear-gradient(135deg, #d9ecff, #d7efe8);
}

.feature-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.feature-card h3 {
  margin: 0.35rem 0 0;
  font-size: 1.25rem;
  color: var(--ink);
}

.feature-card>p:last-child {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.home-section {
  max-width: none;
  margin: 0;
  padding: 1rem var(--edge) 3.25rem;
}

.home-section.alt {
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  border-block: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  max-width: none;
  padding-inline: 0;
}

.home-section.alt>* {
  max-width: none;
  margin-inline: 0;
  padding-inline: var(--edge);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
}

.step-card h3 {
  margin: 0.85rem 0 0.4rem;
  color: var(--ink);
  font-size: 1.2rem;
}

.step-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.condition-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.condition-chip {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.split-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 1.5rem;
  align-items: start;
}

.split-panel h2 {
  margin: 0.45rem 0 1rem;
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  color: var(--ink);
}

.benefit-list,
.toolkit-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.benefit-list li {
  margin-bottom: 0.85rem;
  color: var(--muted);
  padding-left: 1.1rem;
  position: relative;
}

.benefit-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--blue);
}

.benefit-list strong {
  color: var(--ink);
}

.highlight-panel h3 {
  margin: 0.4rem 0 0.85rem;
  color: var(--ink);
  font-size: 1.35rem;
}

.toolkit-list li {
  color: var(--ink-soft);
  font-weight: 600;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}

.toolkit-list li:last-child {
  border-bottom: none;
}

.faq-grid {
  display: grid;
  gap: 0.75rem;
  max-width: 52rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.85rem 1.1rem;
  box-shadow: var(--shadow);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 750;
  color: var(--ink);
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item p {
  margin: 0.65rem 0 0.2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.home-cta {
  max-width: none;
  margin: 0 0 2rem;
  padding: 0 var(--edge);
}

.home-cta-inner {
  border-radius: 1.6rem;
  padding: 2.4rem 1.8rem;
  background: linear-gradient(135deg, #1e3a8a 0%, #0a6a65 55%, #2f80ed 150%);
  color: #fff;
  box-shadow: 0 18px 40px rgba(30, 58, 138, 0.22);
}

.home-cta-inner h2 {
  margin: 0.4rem 0 0;
  color: #fff;
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
}

.home-cta-inner>p {
  margin: 0.85rem 0 0;
  max-width: 36rem;
  color: rgba(255, 255, 255, 0.9);
}

.chat-shell {
  border: 1px solid var(--line);
  background: var(--cream-deep);
  border-radius: 1.1rem;
}

.chat-messages {
  height: 460px;
  overflow: auto;
  padding: 0.85rem;
}

.msg {
  padding: 0.8rem 0.95rem;
  border-radius: 1rem;
  margin-bottom: 0.75rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.msg-user {
  background: color-mix(in srgb, var(--blue) 16%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--blue) 35%, var(--line));
  margin-left: 1.5rem;
  color: var(--text);
}

.msg-ai {
  background: var(--surface);
  border: 1px solid var(--line);
  margin-right: 1.5rem;
  color: var(--ink);
}

.msg-ai details {
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.45rem 0.6rem;
  margin: 0.35rem 0;
  background: var(--cream);
}

.msg-ai summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 700;
}

.ai-output {
  display: grid;
  gap: 0.75rem;
}

.ai-output-item {
  background: var(--cream-deep);
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  padding: 0.85rem 1rem;
  line-height: 1.6;
  color: var(--ink);
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: var(--pill);
  border: 1px solid var(--line);
  background: var(--sand);
  color: var(--teal);
  font-size: 0.74rem;
  font-weight: 750;
  padding: 0.3rem 0.75rem;
}

.quick-chat,
.chip-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--teal);
  border-radius: var(--pill);
  padding: 0.38rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.quick-chat:hover,
.chip-btn:hover {
  border-color: var(--teal);
  background: var(--cream-deep);
}

.alert-card {
  background: var(--danger-bg);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line));
  border-radius: var(--radius);
  box-shadow: none;
}

.alert-card h3 {
  color: var(--danger);
}

.site-footer {
  max-width: none;
  margin: 0;
  padding: 0 var(--edge) 2rem;
}

.site-footer p {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer-rich {
  margin-top: 1rem;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.footer-shell {
  max-width: none;
  margin: 0;
  padding: 2.75rem var(--edge) 1.75rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.1fr 1.6fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.footer-brand p {
  margin: 0.9rem 0 0;
  color: var(--muted);
  max-width: 28rem;
  font-size: 0.95rem;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.footer-cols h4 {
  margin: 0 0 0.75rem;
  font-family: "Outfit", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--leaf);
  font-weight: 800;
}

.footer-cols a {
  display: block;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.55rem;
}

.footer-cols a:hover {
  color: var(--teal);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
  padding-top: 1.15rem;
}

.footer-bottom p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  max-width: 40rem;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.1rem;
}

.footer-legal a {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 650;
}

.footer-legal a:hover {
  color: var(--teal);
}

.video-section-head {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.video-section-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.9rem;
  color: #fff;
  background: linear-gradient(135deg, #ff3b30, #c4001a);
  box-shadow: 0 8px 20px rgba(220, 20, 40, 0.28);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.1rem;
}

.video-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(30, 58, 138, 0.06);
  animation: video-in 0.45s ease both;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.video-card:not(.is-loading):hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--teal) 45%, var(--line));
  box-shadow: 0 18px 36px rgba(30, 58, 138, 0.14);
}

.video-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: #0b1220;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease, filter 0.3s ease;
}

.video-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.video-card:hover .video-thumb img {
  transform: scale(1.06);
  filter: brightness(0.82);
}

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  padding-left: 3px;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 0, 0, 0.88);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%) scale(0.85);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.video-card:hover .video-play,
.video-thumb:focus-visible .video-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.video-duration {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  z-index: 2;
  padding: 0.18rem 0.45rem;
  border-radius: 0.4rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: rgba(0, 0, 0, 0.78);
}

.video-thumb-topic {
  display: flex;
  align-items: center;
  padding: 1.1rem 1.25rem;
  text-decoration: none;
}

.video-thumb-topic .video-play {
  opacity: 0.95;
  transform: translate(-50%, -50%) scale(0.8);
  top: auto;
  bottom: -0.2rem;
  left: auto;
  right: 0.4rem;
}

.video-thumb-text {
  position: relative;
  z-index: 2;
  max-width: 78%;
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 1.12rem;
  line-height: 1.3;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-thumb-topic.tone-0 {
  background: linear-gradient(135deg, #1e3a8a, #2f80ed);
}

.video-thumb-topic.tone-1 {
  background: linear-gradient(135deg, #059669, #60a5fa);
}

.video-thumb-topic.tone-2 {
  background: linear-gradient(135deg, #6d3ae0, #2f80ed);
}

.video-thumb-topic.tone-3 {
  background: linear-gradient(135deg, #b45309, #d92d20);
}

.video-thumb-topic.tone-4 {
  background: linear-gradient(135deg, #1e3a8a, #1e3a8a);
}

.video-thumb-topic.tone-5 {
  background: linear-gradient(135deg, #c4001a, #6d3ae0);
}

.video-body {
  display: flex;
  gap: 0.7rem;
  padding: 0.9rem 1rem 0.4rem;
  flex: 1;
}

.video-avatar {
  position: relative;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  overflow: hidden;
  border-radius: 50%;
  font-size: 0.9rem;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--blue));
}

.video-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-title {
  margin: 0;
  font-family: inherit;
  font-size: 0.97rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-channel {
  margin: 0.3rem 0 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
}

.video-verified {
  display: inline-grid;
  place-items: center;
  width: 0.95rem;
  height: 0.95rem;
  margin-left: 0.15rem;
  border-radius: 50%;
  font-size: 0.6rem;
  color: #fff;
  background: var(--muted);
  vertical-align: 1px;
}

.video-meta {
  margin: 0.1rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.video-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0.5rem 1rem 0.9rem;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--line);
}

.video-topic {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--teal);
  background: color-mix(in srgb, var(--teal) 10%, transparent);
}

.video-foot a {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #e0202c;
  text-decoration: none;
}

.video-foot a:hover {
  text-decoration: underline;
}

.video-card.is-loading .video-thumb {
  cursor: default;
  background: var(--cream-deep);
}

.video-shimmer {
  display: block;
  background: linear-gradient(90deg, var(--cream-deep) 0%, var(--cream) 50%, var(--cream-deep) 100%);
  background-size: 200% 100%;
  animation: video-shimmer 1.2s linear infinite;
}

.video-thumb .video-shimmer {
  position: absolute;
  inset: 0;
}

.video-line {
  height: 0.8rem;
  margin: 0.2rem 0 0.55rem;
  border-radius: 0.4rem;
}

.video-line.short {
  width: 60%;
}

.video-card.is-loading .video-body {
  padding-bottom: 1.2rem;
}

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.video-modal.open {
  opacity: 1;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 12, 11, 0.78);
  backdrop-filter: blur(6px);
}

.video-modal-card {
  position: relative;
  width: min(960px, 100%);
  overflow: hidden;
  border-radius: 1.25rem;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.25s ease;
}

.video-modal.open .video-modal-card {
  transform: none;
}

.video-modal-frame {
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-modal-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.video-modal-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
}

.video-modal-info h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink);
}

.video-modal-info p {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.video-modal-actions {
  display: flex;
  gap: 0.5rem;
}

body.video-modal-open {
  overflow: hidden;
}

@keyframes video-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes video-shimmer {
  to {
    background-position: -200% 0;
  }
}

.print-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.15rem 1.25rem;
  margin-bottom: 0.9rem;
  box-shadow: var(--shadow);
  color: var(--ink);
}

.scanner {
  position: relative;
  overflow: hidden;
}

.scanner::after {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to bottom, rgba(47, 128, 237, 0), rgba(47, 128, 237, 0.22), rgba(47, 128, 237, 0));
  animation: scan 2s linear infinite;
}

@keyframes scan {
  to {
    top: 130%;
  }
}

.text-slate-100,
.text-slate-200,
.text-slate-300,
.text-cyan-300,
.text-teal-300,
.text-emerald-300,
.text-sky-300,
.text-gray-500,
.text-gray-600,
.text-gray-700,
.text-gray-800,
.text-gray-900,
.text-black {
  color: var(--muted) !important;
}

html[data-theme="dark"] .text-gray-800,
html[data-theme="dark"] .text-gray-900,
html[data-theme="dark"] .text-black {
  color: var(--text) !important;
}

.text-rose-200,
.text-rose-100,
.text-rose-300 {
  color: var(--danger) !important;
}

/* One Medical–style signup / auth */
body.auth-page {
  background: var(--surface);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.auth-page #bg-canvas {
  display: none;
}

.auth-topbar {
  padding: 1.15rem 1.25rem 0;
}

.auth-topbar .site-logo {
  display: flex;
  justify-content: center;
  margin: 0 auto 1rem;
}

.auth-progress {
  height: 4px;
  width: 100%;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.auth-progress-fill {
  display: block;
  height: 100%;
  width: 28%;
  background: var(--teal);
}

.auth-shell {
  width: min(560px, calc(100% - 2rem));
  margin: 1.75rem auto 2rem;
  flex: 1;
}

.auth-panel {
  background: transparent;
}

.auth-title {
  margin: 0;
  font-family: "Outfit", system-ui, sans-serif;
  font-size: clamp(2rem, 5vw, 2.6rem);
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.auth-form {
  margin-top: 1.75rem;
}

.auth-field {
  margin-bottom: 1.15rem;
}

.auth-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--text);
}

.auth-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.auth-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  padding: 0.85rem 0.95rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
}

.auth-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.14);
}

.auth-password-wrap {
  position: relative;
}

.auth-password-wrap .auth-input {
  padding-right: 4.5rem;
}

.auth-show-btn {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--teal);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
}

.auth-req-list {
  margin: 0.7rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.auth-req-list li {
  margin-bottom: 0.25rem;
}

.auth-error {
  min-height: 1.25rem;
  margin: 0.35rem 0 0;
  color: var(--danger);
  font-size: 0.9rem;
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.35rem;
  flex-wrap: wrap;
}

.auth-side-link {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-side-link a {
  color: var(--teal);
  font-weight: 700;
  text-decoration: underline;
}

.auth-next-btn {
  border: none;
  background: var(--teal);
  color: #fff;
  font-weight: 750;
  font-size: 1rem;
  font-family: inherit;
  border-radius: 0.45rem;
  padding: 0.8rem 1.6rem;
  min-width: 7rem;
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.auth-next-btn:hover {
  background: var(--teal-hover);
}

.auth-help {
  margin-top: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-help a {
  display: inline-block;
  margin-top: 0.25rem;
  color: var(--teal);
  font-weight: 700;
  text-decoration: underline;
}

.auth-faq {
  margin-top: 2.5rem;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

.auth-faq h2 {
  margin: 0 0 0.85rem;
  font-family: "Outfit", sans-serif;
  font-size: 1.15rem;
  color: var(--text);
  font-weight: 800;
}

.auth-faq details {
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0;
}

.auth-faq summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--text);
  list-style: none;
}

.auth-faq summary::-webkit-details-marker {
  display: none;
}

.auth-faq details p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-footer {
  width: min(560px, calc(100% - 2rem));
  margin: 0 auto 1.5rem;
  text-align: center;
}

.auth-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.auth-footer a {
  color: var(--teal);
  font-weight: 650;
}

/* One Medical–style member login */
body.login-page {
  background: var(--cream);
  min-height: 100vh;
}

body.login-page #bg-canvas {
  display: none;
}

.login-shell {
  width: min(440px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 2rem;
}

.login-brand.site-logo {
  display: flex;
  justify-content: center;
  margin: 0 auto 1.35rem;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  box-shadow: var(--shadow);
  padding: 1.75rem 1.5rem 1.6rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.login-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--teal);
}

.login-card h1 {
  margin: 0;
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 2rem;
  color: var(--text);
  text-align: center;
}

.login-lede {
  margin: 0.55rem 0 1.35rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.login-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.login-forgot {
  font-size: 0.82rem;
  color: var(--teal);
  font-weight: 700;
  text-decoration: none;
}

.login-forgot:hover {
  text-decoration: underline;
}

.login-info {
  min-height: 1.1rem;
  margin: 0.2rem 0 0;
  color: var(--teal);
  font-size: 0.88rem;
}

.login-reset-title {
  margin: 0;
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 1.45rem;
  text-align: center;
  color: var(--text);
}

.login-back {
  display: block;
  width: 100%;
  margin-top: 0.7rem;
  border: none;
  background: transparent;
  color: var(--teal);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.login-back:hover {
  text-decoration: underline;
}

.login-submit {
  width: 100%;
  margin-top: 0.85rem;
  border: none;
  background: var(--teal);
  color: #fff;
  font-weight: 750;
  font-size: 1rem;
  font-family: inherit;
  border-radius: 0.45rem;
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.login-submit:hover {
  background: var(--teal-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(47, 128, 237, 0.25);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.15rem 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.social-auth {
  display: grid;
  gap: 0.7rem;
  margin: 1.25rem 0 0;
}

.social-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 2.85rem;
  border-radius: 0.55rem;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.18s ease, background 0.18s ease;
}

.social-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--glow-soft, 0 8px 20px rgba(30, 58, 138, 0.1));
  border-color: color-mix(in srgb, var(--teal) 45%, var(--line));
}

.social-icon {
  display: inline-flex;
  line-height: 0;
}

.social-btn-google {
  background: var(--surface);
  color: var(--text);
}

.social-note {
  margin: 0.15rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

#socialAuthStatus {
  min-height: 1.2rem;
  margin: 0.35rem 0 0;
  text-align: center;
  font-size: 0.86rem;
}

.login-secondary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 1.5px solid var(--teal);
  color: var(--teal);
  background: var(--surface);
  border-radius: 0.45rem;
  padding: 0.85rem 1rem;
  font-weight: 750;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.25s ease;
}

.login-secondary-btn:hover {
  background: var(--cream-deep);
  border-color: var(--teal-hover);
  transform: translateY(-1px);
}

.login-signup {
  margin: 1.1rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.login-signup a {
  color: var(--teal);
  font-weight: 750;
  text-decoration: underline;
}

.login-tips {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.login-tip-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.95rem 1rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.login-tip-card h3 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: 0.95rem;
  color: var(--ink);
  font-weight: 800;
}

.login-tip-card p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.login-footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.9rem 1.2rem;
  margin-top: 1.5rem;
}

.login-footer a {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.login-footer a:hover {
  color: var(--teal);
}

/* Shared hover polish */
.hover-lift,
.feature-card,
.step-card,
.condition-chip,
.faq-item,
.care-card,
.video-link,
.auth-faq details {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.feature-card:hover,
.step-card:hover,
.care-card:hover,
.hover-lift:hover,
.login-tip-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(30, 58, 138, 0.12);
  border-color: #cbd5e1;
}

.condition-chip:hover {
  transform: translateY(-2px);
  border-color: #1d4ed8;
  color: #1d4ed8;
  background: #f1faf9;
}

.faq-item:hover,
.auth-faq details:hover {
  border-color: #cbd5e1;
  box-shadow: 0 10px 24px rgba(30, 58, 138, 0.08);
}

.video-link:hover {
  transform: translateY(-2px);
}

.feature-card .thumb img,
.hero-photo {
  transition: transform 0.35s ease;
}

.feature-card:hover .thumb img {
  transform: scale(1.04);
}

.nav-link {
  transition: color 0.2s ease, opacity 0.2s ease;
}

.btn-primary,
.gradient-btn,
.auth-next-btn {
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-secondary:hover,
.toolbar-btn:hover {
  transform: translateY(-1px);
}

.auth-input:hover {
  border-color: #9bb8b5;
}

@media (max-width: 640px) {
  .auth-name-row {
    grid-template-columns: 1fr;
  }

  .auth-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .auth-next-btn {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-visual {
    min-height: 420px;
    order: -1;
    padding: 1.75rem 1.25rem;
  }

  .hero-photo-frame {
    width: min(70%, 300px);
  }

  .feature-grid,
  .steps-grid,
  .split-panel {
    grid-template-columns: 1fr;
  }

  .hero-content {
    padding: 2.5rem 1.5rem 3rem;
  }

  .footer-top,
  .footer-cols {
    grid-template-columns: 1fr;
  }
}

/* Hover glow on interactive targets */
html[data-theme="dark"] {
  --glow: 0 0 0 1px rgba(90, 173, 255, 0.35), 0 0 28px rgba(96, 165, 250, 0.45), 0 0 48px rgba(90, 173, 255, 0.22);
  --glow-soft: 0 0 0 1px rgba(96, 165, 250, 0.28), 0 0 22px rgba(90, 173, 255, 0.28);
}

html[data-theme="light"] {
  --glow: 0 0 0 1px rgba(47, 128, 237, 0.22), 0 0 22px rgba(47, 128, 237, 0.2), 0 8px 24px rgba(30, 58, 138, 0.1);
  --glow-soft: 0 0 0 1px rgba(47, 128, 237, 0.16), 0 0 16px rgba(47, 128, 237, 0.14);
}

html[data-theme="dark"] .ht-loader {
  background:
    radial-gradient(circle at 30% 22%, rgba(47, 128, 237, 0.18), transparent 44%),
    radial-gradient(circle at 72% 70%, rgba(56, 179, 90, 0.14), transparent 42%),
    linear-gradient(165deg, #0b1211 0%, #0b1220 48%, #0b1220 100%);
}

html[data-theme="dark"] .muted,
html[data-theme="dark"] .status-text {
  color: var(--muted) !important;
}

html[data-theme="dark"] .feature-card .thumb {
  background: linear-gradient(135deg, #1a2d3d, #1a3330);
}

html[data-theme="dark"] .print-card,
html[data-theme="dark"] .scan-box,
html[data-theme="dark"] .video-card,
html[data-theme="dark"] .emergency-card,
html[data-theme="dark"] .chart-wrap,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

html[data-theme="dark"] .site-footer,
html[data-theme="dark"] .site-footer-rich {
  background: var(--cream-deep);
  border-color: var(--line);
  color: var(--muted);
}

html[data-theme="dark"] .site-footer a,
html[data-theme="dark"] .site-footer-rich a {
  color: var(--teal);
}

html[data-theme="dark"] .login-footer a {
  color: var(--muted);
}

html[data-theme="dark"] .login-footer a:hover {
  color: var(--teal);
}

/* Pointer glow on interactive targets */
a,
button,
.nav-link,
.toolbar-btn,
.btn-primary,
.btn-secondary,
.gradient-btn,
.care-card,
.feature-card,
.step-card,
.condition-chip,
.faq-item,
.login-tip-card,
.login-card,
.login-submit,
.login-secondary-btn,
.auth-next-btn,
.auth-show-btn,
.input-base,
.auth-input,
.site-logo,
.quick-chat,
summary {
  transition:
    box-shadow 0.25s ease,
    border-color 0.25s ease,
    transform 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    filter 0.25s ease;
}

a:hover,
button:hover,
.nav-link:hover,
.toolbar-btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.gradient-btn:hover,
.care-card:hover,
.feature-card:hover,
.step-card:hover,
.condition-chip:hover,
.faq-item:hover,
.login-tip-card:hover,
.login-card:hover,
.login-submit:hover,
.login-secondary-btn:hover,
.auth-next-btn:hover,
.site-logo:hover,
.quick-chat:hover,
summary:hover,
.input-base:focus,
.auth-input:focus,
a:focus-visible,
button:focus-visible {
  box-shadow: var(--glow);
  border-color: color-mix(in srgb, var(--teal) 55%, var(--line));
  outline: none;
}

.nav-link:hover,
.nav-link.active,
.auth-show-btn:hover,
.login-forgot:hover,
.auth-side-link a:hover,
.login-signup a:hover,
.auth-help a:hover,
.auth-footer a:hover {
  text-shadow: 0 0 18px rgba(96, 165, 250, 0.55), 0 0 8px rgba(90, 173, 255, 0.35);
  color: var(--teal);
}

.feature-card:hover,
.step-card:hover,
.care-card:hover,
.condition-chip:hover,
.faq-item:hover,
.login-tip-card:hover {
  transform: translateY(-3px);
}

.btn-primary:hover,
.gradient-btn:hover,
.auth-next-btn:hover,
.login-submit:hover {
  filter: brightness(1.06);
}

html[data-theme="dark"] a:hover,
html[data-theme="dark"] button:hover,
html[data-theme="dark"] .toolbar-btn:hover,
html[data-theme="dark"] .btn-secondary:hover,
html[data-theme="dark"] .care-card:hover,
html[data-theme="dark"] .feature-card:hover,
html[data-theme="dark"] .step-card:hover,
html[data-theme="dark"] .faq-item:hover,
html[data-theme="dark"] .input-base:focus,
html[data-theme="dark"] .auth-input:focus {
  box-shadow: var(--glow);
}

.auth-topbar {
  position: relative;
}

.auth-theme-slot,
.login-theme-slot {
  display: flex;
  justify-content: flex-end;
  margin: 0.35rem 0 0.75rem;
}

.login-theme-slot {
  justify-content: center;
  margin-bottom: 1rem;
}

@media (prefers-reduced-motion: reduce) {

  a:hover,
  button:hover,
  .feature-card:hover,
  .step-card:hover,
  .care-card:hover {
    transform: none;
  }
}

/* ==================================================================== */
/* Safety, language, Health Score, offline app and PIN lock             */
/* ==================================================================== */

:root {
  --violet: #6d3ae0;
  --violet-soft: #f1ebff;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --ok: #059669;
  --ok-bg: #ecfdf5;
  --sos: #dc2626;
  --sos-deep: #912018;
}

html[data-theme="dark"] {
  --violet: #b69cff;
  --violet-soft: #251d3d;
  --amber: #f5b454;
  --amber-bg: #33260f;
  --ok: #4ade9a;
  --ok-bg: #12291f;
  --sos: #ff6b5e;
  --sos-deep: #ff8a80;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Language selector in the header */
.lang-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 2.35rem;
  padding: 0 0.35rem 0 0.7rem;
  border: 1.5px solid color-mix(in srgb, var(--teal) 28%, var(--line));
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--teal);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lang-select:hover,
.lang-select:focus-within {
  border-color: var(--teal);
  box-shadow: var(--glow-soft, 0 0 0 3px rgba(30, 58, 138, 0.12));
}

.lang-select-icon svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
  display: block;
}

.lang-select select {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--teal);
  font: 700 0.86rem/1 inherit;
  font-family: inherit;
  padding: 0.35rem 1.35rem 0.35rem 0.1rem;
  cursor: pointer;
  outline: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 9px) 55%, calc(100% - 5px) 55%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

.lang-select select option {
  color: #0f2e2b;
}

/* Toasts */
.ht-toasts {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 100010;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: min(92vw, 380px);
  pointer-events: none;
}

.ht-toast {
  padding: 0.85rem 1.05rem;
  border-radius: 1rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  box-shadow: 0 16px 40px rgba(0, 40, 38, 0.18);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.ht-toast.show {
  opacity: 1;
  transform: none;
}

.ht-toast-success {
  border-left-color: var(--ok);
}

.ht-toast-error {
  border-left-color: var(--sos);
}

/* Offline pill */
.ht-offline-pill {
  position: fixed;
  top: calc(var(--header-h) + 0.6rem);
  left: 50%;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 92vw;
  padding: 0.5rem 1rem;
  border-radius: var(--pill);
  background: #1f2937;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -140%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.ht-offline-pill.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.ht-offline-pill svg {
  width: 1rem;
  height: 1rem;
  fill: #fbbf24;
  flex: none;
}

/* Modal */
.ht-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100005;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(4, 22, 21, 0.55);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.ht-modal-backdrop.open {
  opacity: 1;
}

.ht-modal {
  position: relative;
  width: min(100%, 460px);
  max-height: 90vh;
  overflow: auto;
  padding: 1.6rem;
  border-radius: 1.5rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
  transform: translateY(18px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.ht-modal-backdrop.open .ht-modal {
  transform: none;
}

.ht-modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--sand);
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.ht-modal-close:hover {
  color: var(--text);
}

/* SOS banner */
.sos-banner {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem 1.5rem;
  padding: 1.6rem 1.7rem;
  border-radius: 1.5rem;
  color: #fff;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.18), transparent 45%),
    linear-gradient(135deg, #b42318 0%, #d92d20 55%, #f04438 100%);
  box-shadow: 0 22px 50px rgba(180, 35, 24, 0.35);
  overflow: hidden;
  animation: sos-enter 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.sos-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid rgba(255, 255, 255, 0.35);
  animation: sos-border 1.8s ease-in-out infinite;
  pointer-events: none;
}

.sos-banner.leaving {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.sos-pulse {
  position: relative;
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: #fff;
  color: var(--sos);
  flex: none;
}

.sos-pulse::before,
.sos-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.7);
  animation: sos-ring 1.6s ease-out infinite;
}

.sos-pulse::after {
  animation-delay: 0.8s;
}

.sos-pulse svg {
  width: 2rem;
  height: 2rem;
  fill: currentColor;
}

.sos-pulse.sm {
  width: 3rem;
  height: 3rem;
  background: var(--sos);
  color: #fff;
}

.sos-pulse.sm::before,
.sos-pulse.sm::after {
  border-color: color-mix(in srgb, var(--sos) 60%, transparent);
}

.sos-pulse.sm svg {
  width: 1.5rem;
  height: 1.5rem;
}

.sos-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.9;
}

.sos-banner h2 {
  margin-top: 0.15rem;
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
  color: #fff;
}

.sos-readings {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.sos-readings li {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.9rem;
}

.sos-value {
  font-size: 1.15rem;
  font-weight: 800;
}

.sos-limit {
  font-size: 0.76rem;
  opacity: 0.85;
}

.sos-note {
  margin-top: 0.85rem;
  font-size: 0.8rem;
  opacity: 0.92;
}

.sos-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.sos-actions.stacked {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 1rem;
}

.sos-actions.stacked .sos-btn-primary,
.sos-actions.stacked .sos-btn-dark {
  grid-column: 1 / -1;
}

.sos-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.7rem 1.2rem;
  border-radius: var(--pill);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.sos-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
  flex: none;
}

.sos-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.22);
}

.sos-btn-primary {
  background: #fff;
  color: var(--sos) !important;
  border-color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.sos-btn-primary:hover {
  background: #fff5f4;
}

.sos-btn-dark {
  background: #1a0b09;
  border-color: #1a0b09;
  color: #fff !important;
}

.sos-btn-dark:hover {
  background: #2c1310;
}

.sos-btn-ghost {
  background: transparent;
  margin-left: auto;
}

.sos-btn.sm {
  min-height: 2.4rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}

/* SOS buttons on light surfaces */
.ht-modal .sos-btn,
.safety-card .sos-btn,
.ec-summary .sos-btn {
  border-color: color-mix(in srgb, var(--sos) 35%, var(--line));
  background: var(--surface);
  color: var(--sos);
}

.ht-modal .sos-btn-primary,
.safety-card .sos-btn-primary,
.ec-summary .sos-btn-primary {
  background: var(--sos);
  border-color: var(--sos);
  color: #fff !important;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--sos) 30%, transparent);
}

.ht-modal .sos-btn-dark,
.safety-card .sos-btn-dark,
.ec-summary .sos-btn-dark,
.ht-lock .sos-btn-dark {
  background: #1a0b09;
  border-color: #1a0b09;
  color: #fff !important;
}

html[data-theme="dark"] .ht-modal .sos-btn-dark,
html[data-theme="dark"] .safety-card .sos-btn-dark,
html[data-theme="dark"] .ec-summary .sos-btn-dark {
  background: #fff;
  border-color: #fff;
  color: #1a0b09 !important;
}

.ht-modal .sos-readings li {
  background: var(--danger-bg);
  border-color: color-mix(in srgb, var(--sos) 30%, var(--line));
  color: var(--sos);
}

.ht-modal .sos-note {
  color: var(--muted);
}

/* Floating SOS button */
.sos-fab {
  position: fixed;
  left: 1.25rem;
  bottom: 1.25rem;
  z-index: 70;
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  border: 0;
  background: radial-gradient(circle at 30% 25%, #ff6b5e, #d92d20 60%, #912018);
  color: #fff;
  font: 900 0.95rem/1 inherit;
  font-family: inherit;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(217, 45, 32, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sos-fab:hover {
  transform: scale(1.07);
  box-shadow: 0 18px 38px rgba(217, 45, 32, 0.55);
}

.sos-fab span:last-child {
  position: relative;
  z-index: 1;
}

.sos-fab-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(217, 45, 32, 0.5);
  animation: sos-ring 2.2s ease-out infinite;
}

/* SOS sheet */
.sos-sheet-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.1rem;
}

.sos-sheet-head .sos-kicker {
  color: var(--sos);
}

.sos-sheet-head h2 {
  font-size: 1.5rem;
}

.sos-sheet-label {
  margin-top: 1rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.sos-sheet-link {
  display: inline-block;
  margin-top: 0.8rem;
  color: var(--teal);
  font-weight: 700;
  font-size: 0.88rem;
}

.sos-contact-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
  border-radius: 1.1rem;
  background: linear-gradient(160deg, var(--surface), var(--sand));
  border: 1px solid var(--line);
}

.sos-contact-card strong {
  color: var(--ink);
  font-size: 1.02rem;
}

.sos-contact-card p {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.sos-contact-card.empty {
  border-style: dashed;
}

.sos-avatar {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
  flex: none;
}

.sos-avatar.sm {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1rem;
}

.ec-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--danger) 25%, var(--line));
}

.ec-summary>div {
  flex: 1 1 12rem;
}

.ec-summary strong {
  color: var(--ink);
}

.ec-summary p {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Health Score */
.score-card {
  padding: clamp(1.25rem, 3vw, 2rem);
  overflow: hidden;
  position: relative;
}

.score-card::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--violet) 12%, transparent), transparent 70%);
  pointer-events: none;
}

.score-layout {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 18rem);
  gap: 1.75rem;
  align-items: start;
}

.score-gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.score-gauge {
  position: relative;
  width: 11rem;
  height: 11rem;
  --band: var(--teal);
}

.score-gauge.band-excellent {
  --band: var(--ok);
}

.score-gauge.band-good {
  --band: var(--teal);
}

.score-gauge.band-fair {
  --band: var(--amber);
}

.score-gauge.band-attention {
  --band: var(--sos);
}

.score-gauge svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-track {
  fill: none;
  stroke: color-mix(in srgb, var(--line) 80%, transparent);
  stroke-width: 10;
}

.score-fill {
  fill: none;
  stroke: var(--band);
  stroke-width: 10;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--band) 45%, transparent));
  transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.score-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  padding-top: 3.6rem;
}

.score-num {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}

.score-of {
  margin-left: 0.15rem;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
}

.score-band {
  padding: 0.3rem 0.85rem;
  border-radius: var(--pill);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.score-band.band-excellent {
  background: var(--ok-bg);
  color: var(--ok);
}

.score-band.band-good {
  background: color-mix(in srgb, var(--teal) 12%, var(--surface));
  color: var(--teal);
}

.score-band.band-fair {
  background: var(--amber-bg);
  color: var(--amber);
}

.score-band.band-attention {
  background: var(--danger-bg);
  color: var(--sos);
}

.score-delta {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.score-delta.up {
  color: var(--ok);
}

.score-delta.down {
  color: var(--sos);
}

.score-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.score-head h2 {
  font-size: 1.75rem;
  margin-top: 0.1rem;
}

.score-sub {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.score-factors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.55rem;
  margin-top: 1rem;
}

.factor {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "dot label val" "dot note note";
  column-gap: 0.6rem;
  align-items: center;
  padding: 0.65rem 0.8rem;
  border-radius: 0.9rem;
  background: var(--sand);
  border: 1px solid var(--line);
  --f: var(--ok);
}

.factor-ok {
  --f: var(--ok);
}

.factor-mild {
  --f: var(--blue);
}

.factor-warn {
  --f: var(--amber);
}

.factor-bad {
  --f: var(--sos);
}

.factor-dot {
  grid-area: dot;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--f);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--f) 18%, transparent);
}

.factor-label {
  grid-area: label;
  font-weight: 700;
  color: var(--ink);
  font-size: 0.9rem;
}

.factor-val {
  grid-area: val;
  font-weight: 800;
  color: var(--f);
  font-size: 0.9rem;
  white-space: nowrap;
}

.factor-note {
  grid-area: note;
  color: var(--muted);
  font-size: 0.78rem;
}

.score-ai {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: var(--violet-soft);
  border: 1px solid color-mix(in srgb, var(--violet) 25%, var(--line));
}

.score-ai .ai-output-item {
  background: transparent;
  border: 0;
  padding: 0.2rem 0;
  color: var(--text);
}

.score-ai-loading {
  animation: score-blink 1.2s ease-in-out infinite;
}

.number-source {
  margin: .2rem 0 0;
  color: var(--muted);
  font-size: .78rem;
}

.lab-confirm {
  margin: .35rem 0 0;
  padding-left: 1rem;
  font-size: .85rem;
}

.score-count {
  margin: .35rem 0;
  font-size: 1.05rem;
}

.score-how {
  margin-top: 0.9rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.legal-doc {
  max-width: 46rem;
}

.legal-doc h1 {
  margin: 0.2rem 0 0.6rem;
}

.legal-doc h2 {
  margin: 1.7rem 0 0.45rem;
  font-size: 1.15rem;
}

.legal-doc p,
.legal-doc li {
  color: var(--ink-soft);
}

.legal-doc ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.4rem;
}

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

.legal-links {
  margin-top: 2rem;
  font-weight: 700;
}

.consent-row {
  margin: 0.2rem 0 0.8rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.consent-row a {
  color: var(--teal);
  text-decoration: underline;
}

.privacy-form {
  margin-top: 1.2rem;
  display: grid;
  gap: 0.7rem;
}

.privacy-form h3 {
  margin: 0;
  font-size: 1rem;
}

.privacy-erase {
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.score-how summary {
  cursor: pointer;
  color: var(--teal);
  font-weight: 700;
  width: fit-content;
  border-radius: 0.5rem;
}

.score-how p {
  margin-top: 0.5rem;
  line-height: 1.55;
}

.score-trends {
  padding: 1.1rem;
  border-radius: 1.1rem;
  background: linear-gradient(170deg, var(--surface), var(--sand));
  border: 1px solid var(--line);
}

.score-trends h3 {
  font-size: 1.05rem;
  margin-bottom: 0.7rem;
}

.score-trends ul {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trend {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.7rem;
  border-radius: 0.85rem;
  font-size: 0.85rem;
}

.trend strong {
  display: block;
  color: var(--ink);
  line-height: 1.35;
}

.trend span:not(.trend-icon) {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-weight: 700;
}

.trend-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.6rem;
  flex: none;
}

.trend-icon svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

.trend-warn {
  background: var(--amber-bg);
}

.trend-warn .trend-icon {
  background: color-mix(in srgb, var(--amber) 18%, transparent);
  color: var(--amber);
}

.trend-good {
  background: var(--ok-bg);
}

.trend-good .trend-icon {
  background: color-mix(in srgb, var(--ok) 18%, transparent);
  color: var(--ok);
}

.trend-more {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.trend-empty {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  color: var(--muted);
  font-size: 0.86rem;
}

.trend-empty svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: var(--ok);
  flex: none;
}

.score-disclaimer {
  position: relative;
  margin-top: 1.2rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

/* Lock screen */
.ht-lock {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 20% 15%, rgba(47, 128, 237, 0.16), transparent 45%),
    radial-gradient(circle at 80% 85%, rgba(56, 179, 90, 0.16), transparent 45%),
    color-mix(in srgb, var(--cream) 94%, transparent);
  backdrop-filter: blur(18px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.ht-lock.unlocking {
  opacity: 0;
  transform: scale(1.04);
}

.ht-lock-card {
  width: min(100%, 360px);
  padding: 1.8rem 1.6rem 1.4rem;
  border-radius: 1.75rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 30px 70px rgba(0, 40, 38, 0.18);
}

.ht-lock-card.shake {
  animation: pin-shake 0.42s ease;
}

.ht-lock-card.checking .pin-dots span.on {
  animation: score-blink 0.8s ease-in-out infinite;
}

.ht-lock-logo {
  height: 64px;
  width: auto;
  margin: 0 auto 0.4rem;
}

.ht-lock-badge {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin: 0.2rem auto 0.6rem;
  border-radius: 1rem;
  background: color-mix(in srgb, var(--teal) 12%, var(--surface));
  color: var(--teal);
}

.ht-lock-badge svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
}

.ht-lock-card h2 {
  font-size: 1.55rem;
}

.ht-lock-lead {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.3rem 0 0.4rem;
  min-height: 1rem;
}

.pin-dots span {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--teal) 45%, var(--line));
  transition: background 0.15s ease, transform 0.15s ease;
}

.pin-dots span.on {
  background: var(--teal);
  border-color: var(--teal);
  transform: scale(1.1);
}

.ht-lock-error {
  min-height: 1.2rem;
  color: var(--sos);
  font-size: 0.84rem;
  font-weight: 700;
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 0.4rem 0 1rem;
}

.pin-pad button {
  height: 3.4rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: var(--sand);
  color: var(--ink);
  font: 700 1.35rem/1 inherit;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.pin-pad button:hover {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 8%, var(--surface));
}

.pin-pad button:active {
  transform: scale(0.95);
}

.pin-pad .pin-pad-muted {
  font-size: 1rem;
  color: var(--muted);
  background: transparent;
}

.ht-lock-submit {
  width: 100%;
  padding: 0.85rem 1rem;
}

.ht-lock-forgot {
  margin-top: 0.8rem;
  border: 0;
  background: none;
  color: var(--teal);
  font: 700 0.86rem inherit;
  font-family: inherit;
  cursor: pointer;
}

.ht-lock-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.ht-lock-foot .ht-lock-forgot {
  margin-top: 0;
}

.ht-lock-emergency {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--pill);
  background: var(--danger-bg);
  color: var(--sos);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.ht-lock-emergency svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: currentColor;
}

.ht-lock-reset {
  margin-top: 0.9rem;
  padding: 0.9rem;
  border-radius: 1rem;
  background: var(--danger-bg);
  color: var(--text);
  text-align: left;
  font-size: 0.82rem;
  line-height: 1.5;
}

.ht-lock-reset-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

/* Safety page */
.safety-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: end;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.overview-tile {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.55rem;
  align-items: center;
  padding: 0.85rem 0.95rem;
  border-radius: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.overview-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-soft, var(--shadow));
}

.overview-dot {
  grid-row: span 2;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 18%, transparent);
}

.overview-tile.is-ok .overview-dot {
  background: var(--ok);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent);
}

.overview-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.overview-tile strong {
  color: var(--ink);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.safety-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

#contact,
#pin {
  grid-column: 1 / -1;
}

.safety-card {
  padding: clamp(1.25rem, 3vw, 1.9rem);
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.safety-card-head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.3rem;
}

.safety-card-head h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.55rem;
  margin-top: 0.1rem;
}

.safety-lead {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.93rem;
  max-width: 44rem;
}

.safety-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  flex: none;
  --ic: var(--teal);
  background: color-mix(in srgb, var(--ic) 12%, var(--surface));
  color: var(--ic);
}

.safety-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
}

.icon-danger {
  --ic: var(--sos);
}

.icon-warn {
  --ic: var(--amber);
}

.icon-blue {
  --ic: var(--blue);
}

.icon-teal {
  --ic: var(--teal);
}

.icon-leaf {
  --ic: var(--ok);
}

.safety-split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 1.5rem;
}

.safety-form {
  display: grid;
  gap: 0.9rem;
}

.safety-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
}

.safety-form small {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.78rem;
}

.safety-form .input-base,
.pin-manage-top .input-base {
  padding: 0.75rem 0.9rem;
}

.safety-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.6rem;
}

.status-text.is-error {
  color: var(--danger);
}

.contact-preview-wrap {
  padding: 1.1rem;
  border-radius: 1.2rem;
  background: linear-gradient(160deg, var(--danger-bg), var(--surface));
  border: 1px solid color-mix(in srgb, var(--danger) 20%, var(--line));
}

.contact-preview-wrap .sos-actions {
  margin-top: 0.9rem;
}

.contact-preview-wrap .sos-btn:not(.sos-btn-primary):not(.sos-btn-dark) {
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
}

.preview-label {
  margin-bottom: 0.7rem;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sos);
}

.threshold-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.threshold-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.threshold-table th,
.threshold-table td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.threshold-table thead th {
  background: var(--sand);
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.threshold-table tbody tr:last-child th,
.threshold-table tbody tr:last-child td {
  border-bottom: 0;
}

.threshold-table tbody th {
  color: var(--ink);
  font-weight: 700;
}

.threshold-table tbody th span {
  display: block;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.76rem;
}

.threshold-table .input-base {
  width: 100%;
  max-width: 8rem;
  padding: 0.5rem 0.7rem;
}

.safety-caution {
  margin-top: 0.8rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.85rem;
  background: var(--amber-bg);
  color: var(--amber);
  font-size: 0.8rem;
  font-weight: 600;
}

.lang-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.65rem;
}

.lang-tile {
  position: relative;
  cursor: pointer;
}

.lang-tile input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.lang-tile-body {
  display: grid;
  gap: 0.1rem;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  border: 1.5px solid var(--line);
  background: var(--surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.lang-tile:hover .lang-tile-body {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--teal) 50%, var(--line));
}

.lang-tile input:checked+.lang-tile-body {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 8%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 18%, transparent);
}

.lang-tile input:focus-visible+.lang-tile-body {
  box-shadow: var(--glow);
}

.lang-tile-greet {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--teal);
}

.lang-tile strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.lang-tile-name {
  color: var(--muted);
  font-size: 0.76rem;
}

.pin-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: var(--pill);
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.pin-badge.on {
  background: var(--ok-bg);
  color: var(--ok);
}

.pin-badge.off {
  background: var(--sand);
  color: var(--muted);
  border: 1px solid var(--line);
}

.pin-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.pin-input {
  letter-spacing: 0.35em;
  font-weight: 800;
}

.pin-warning {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: var(--danger-bg);
  border: 1px solid color-mix(in srgb, var(--danger) 25%, var(--line));
  color: var(--text);
  font-size: 0.86rem;
}

.check-row {
  display: flex !important;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 0.6rem !important;
  font-weight: 600 !important;
  color: var(--text) !important;
}

.check-row input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  accent-color: var(--teal);
}

.pin-manage-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-radius: 1rem;
  background: var(--ok-bg);
  border: 1px solid color-mix(in srgb, var(--ok) 25%, var(--line));
}

.pin-manage-top label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
}

.pin-manage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.sub-panel {
  padding: 1.1rem;
  border-radius: 1.1rem;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--surface), var(--sand));
  align-content: start;
}

.sub-panel h3 {
  font-size: 1.1rem;
}

.danger-outline {
  color: var(--danger) !important;
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line)) !important;
}

.file-btn {
  position: relative;
  overflow: hidden;
}

.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.install-points {
  display: grid;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  color: var(--text);
}

.install-points span {
  display: inline-grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--ok-bg);
  color: var(--ok);
  font-weight: 800;
  font-size: 0.8rem;
}

[data-install-app].is-installed {
  opacity: 0.8;
}

.install-help {
  text-align: center;
}

.install-help-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 0.6rem;
  border-radius: 1.2rem;
  box-shadow: var(--shadow);
}

.install-help h2 {
  font-size: 1.45rem;
}

.install-help p {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.install-help ol {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
  text-align: left;
  font-size: 0.88rem;
}

.install-help li {
  padding: 0.7rem 0.85rem;
  border-radius: 0.9rem;
  background: var(--sand);
  border: 1px solid var(--line);
}

.install-help-note {
  margin-top: 1rem !important;
  font-size: 0.8rem !important;
}

/* Homepage: new features */
.install-hero-btn {
  gap: 0.45rem;
}

.install-hero-btn svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
}

.nf-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1.1rem;
  margin-top: 2rem;
}

.nf-card {
  grid-column: span 2;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.5rem;
  border-radius: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  --accent: var(--teal);
}

.nf-card:nth-child(4),
.nf-card:nth-child(5) {
  grid-column: span 3;
}

.nf-card::after {
  content: "";
  position: absolute;
  top: -3rem;
  right: -3rem;
  width: 9rem;
  height: 9rem;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
  pointer-events: none;
}

.nf-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent), 0 18px 40px color-mix(in srgb, var(--accent) 18%, transparent);
}

.nf-sos {
  --accent: var(--sos);
}

.nf-lang {
  --accent: var(--blue);
}

.nf-score {
  --accent: var(--violet);
}

.nf-offline {
  --accent: var(--teal);
}

.nf-lock {
  --accent: var(--ok);
}

.nf-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.5rem;
  border-radius: 1rem;
  background: color-mix(in srgb, var(--accent) 13%, var(--surface));
  color: var(--accent);
}

.nf-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
}

.nf-card .eyebrow {
  color: var(--accent);
}

.nf-card h3 {
  font-size: 1.35rem;
  color: var(--ink);
}

.nf-card p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

.nf-demo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 1rem;
}

.nf-pill {
  padding: 0.35rem 0.75rem;
  border-radius: var(--pill);
  background: var(--sand);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.nf-pill.danger {
  background: var(--sos);
  border-color: var(--sos);
  color: #fff;
}

.nf-pill.dark {
  background: #1a0b09;
  border-color: #1a0b09;
  color: #fff;
}

.nf-pill.good {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: transparent;
}

.nf-score-ring {
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 50%;
  background: conic-gradient(var(--violet) 0 84%, color-mix(in srgb, var(--line) 80%, transparent) 84% 100%);
}

.nf-score-ring b {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9rem;
}

.nf-dots {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--pill);
  background: var(--sand);
  border: 1px solid var(--line);
}

.nf-dots i {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--ok);
}

.nf-install {
  align-self: flex-start;
  margin-top: auto;
  padding: 0.65rem 1.2rem;
  border: 0;
  border-radius: var(--pill);
  background: var(--teal);
  color: #fff;
  font: 700 0.9rem inherit;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.nf-install:hover {
  background: var(--teal-hover);
  transform: translateY(-1px);
}

/* ==================================================================== */
/* Premium AI chat                                                      */
/* ==================================================================== */

.chat-body .site-nav.chat-nav {
  max-width: none;
}

.chat-page {
  max-width: none;
  margin: 0;
  padding: 1.25rem var(--edge) 1.25rem;
}

.chat-app {
  --chat-grad: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 45%, #2f80ed 100%);
  display: grid;
  grid-template-columns: 19.5rem minmax(0, 1fr);
  gap: 1.25rem;
  height: calc(100dvh - 78px - 2.5rem);
  min-height: 560px;
}

html[data-theme="dark"] .chat-app {
  --chat-grad: linear-gradient(135deg, #1e40af 0%, #2563eb 45%, #3b82f6 100%);
}

/* Sidebar */
.chat-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  overflow-y: auto;
  padding: 0 0.15rem 5.5rem;
  scrollbar-width: thin;
}

.side-card {
  flex-shrink: 0;
  padding: 1.1rem 1.15rem;
  border-radius: 1.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.side-card h2 {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.side-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.side-brand {
  position: relative;
  overflow: hidden;
  color: #fff;
  border: 0;
  background:
    radial-gradient(circle at 85% 10%, rgba(125, 223, 240, 0.35), transparent 45%),
    radial-gradient(circle at 10% 100%, rgba(56, 179, 90, 0.3), transparent 50%),
    linear-gradient(160deg, #06302e 0%, #0f172a 55%, #0b3a78 100%);
  box-shadow: 0 20px 44px rgba(0, 60, 56, 0.28);
}

.side-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 14px);
  pointer-events: none;
}

.side-brand-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.side-kicker {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9fe7d8;
}

.side-brand h1 {
  color: #fff;
  font-size: 1.4rem;
  line-height: 1.15;
}

.side-brand-text {
  position: relative;
  z-index: 1;
  margin-top: 0.75rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.88rem;
  line-height: 1.5;
}

.side-new {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: 700 0.9rem inherit;
  font-family: inherit;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.side-new:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.side-new.armed {
  background: rgba(217, 45, 32, 0.85);
  border-color: transparent;
}

.side-new svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

.chat-context {
  margin-top: 0.8rem;
}

.ctx-condition {
  display: inline-flex;
  margin-bottom: 0.6rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--pill);
  background: color-mix(in srgb, var(--teal) 12%, var(--surface));
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 800;
}

.ctx-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.ctx-chip {
  display: grid;
  padding: 0.5rem 0.65rem;
  border-radius: 0.8rem;
  background: var(--sand);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.ctx-chip small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.ctx-date,
.side-note,
.side-empty {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.side-empty a {
  color: var(--teal);
  font-weight: 700;
}

.switch {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch-track {
  width: 2.6rem;
  height: 1.5rem;
  padding: 0.18rem;
  border-radius: var(--pill);
  background: var(--line);
  transition: background 0.2s ease;
}

.switch-thumb {
  display: block;
  width: 1.14rem;
  height: 1.14rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.switch input:checked+.switch-track {
  background: var(--chat-grad);
}

.switch input:checked+.switch-track .switch-thumb {
  transform: translateX(1.1rem);
}

.switch input:focus-visible+.switch-track {
  box-shadow: var(--glow);
}

.side-prompts {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.side-prompt {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.62rem 0.75rem;
  border-radius: 0.85rem;
  border: 1px solid transparent;
  background: var(--sand);
  color: var(--ink);
  font: 600 0.86rem inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.side-prompt span {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 0.6rem;
  background: var(--surface);
  flex: none;
}

.side-prompt:hover {
  border-color: color-mix(in srgb, var(--teal) 40%, var(--line));
  background: color-mix(in srgb, var(--teal) 7%, var(--surface));
  transform: translateX(3px);
}

.side-drop {
  text-align: center;
  border: 1.5px dashed color-mix(in srgb, var(--blue) 40%, var(--line));
  background: linear-gradient(170deg, color-mix(in srgb, var(--blue) 5%, var(--surface)), var(--surface));
  box-shadow: none;
}

.side-drop-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.6rem;
  border-radius: 1rem;
  background: color-mix(in srgb, var(--blue) 12%, var(--surface));
  color: var(--blue);
}

.side-drop-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
}

.side-drop h2 {
  color: var(--ink);
  letter-spacing: 0.06em;
}

.side-drop p {
  margin: 0.4rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

/* Main panel */
.chat-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 1.75rem;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--blue) 7%, transparent), transparent 40%),
    radial-gradient(circle at 0% 100%, color-mix(in srgb, var(--leaf) 7%, transparent), transparent 40%),
    var(--surface);
  box-shadow: 0 24px 60px rgba(0, 60, 56, 0.12);
  overflow: hidden;
}

html[data-theme="dark"] .chat-panel {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: blur(12px);
}

.chat-head-id {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-head-id strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
}

.chat-head-id span:not(.chat-avatar) {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.chat-app.is-busy #chatHeadStatus {
  color: var(--teal);
}

.chat-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  color: #fff;
  flex: none;
  box-shadow: none;
}

.ai-mark {
  display: block;
  height: 2rem;
  width: auto;
}

.chat-avatar.lg {
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  border: 0;
  box-shadow: none;
}

.chat-avatar.lg .ai-mark {
  height: 2.45rem;
}

.chat-online {
  position: absolute;
  left: -2px;
  right: auto;
  bottom: -2px;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--surface);
}

.chat-online::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(34, 197, 94, 0.5);
  animation: sos-ring 2s ease-out infinite;
}

.chat-head-actions {
  display: flex;
  gap: 0.4rem;
}

.head-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.8rem;
  border-radius: 0.8rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font: 700 0.8rem inherit;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.head-btn svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.head-btn:hover {
  color: var(--teal);
  border-color: color-mix(in srgb, var(--teal) 40%, var(--line));
}

.head-btn.armed {
  color: #fff;
  background: var(--sos);
  border-color: var(--sos);
}

.head-toggle .ico-on,
.head-toggle.is-on .ico-off {
  display: none;
}

.head-toggle.is-on .ico-on {
  display: inline;
}

.head-toggle.is-on {
  color: var(--teal);
  border-color: color-mix(in srgb, var(--teal) 45%, var(--line));
  background: color-mix(in srgb, var(--teal) 10%, var(--surface));
}

/* "Preparing voice…" state on any speak button while cloud audio is generated. */
.head-btn.is-loading svg,
.chat-actions button.is-loading svg {
  display: none;
}

.head-btn.is-loading::before,
.chat-actions button.is-loading::before {
  content: "";
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: ht-voice-spin 0.8s linear infinite;
  flex: none;
}

.chat-actions button.is-speaking {
  color: #b42318;
}

.composer-icon.is-transcribing {
  color: var(--teal);
  animation: mic-pulse 1.2s ease-in-out infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .head-btn.is-loading::before,
  .chat-actions button.is-loading::before,
  .composer-icon.is-transcribing {
    animation: none;
  }
}

/* Messages */
.chat-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.5rem clamp(1rem, 3vw, 2.25rem) 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.chat-stream.is-empty {
  justify-content: center;
}

.chat-row {
  display: flex;
  gap: 0.75rem;
  max-width: 100%;
  animation: chat-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-row-user {
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.chat-bubble {
  font-size: 0.96rem;
  line-height: 1.6;
  word-wrap: break-word;
}

.chat-bubble-user {
  max-width: min(78%, 40rem);
  padding: 0.8rem 1.05rem;
  border-radius: 1.25rem 1.25rem 0.35rem 1.25rem;
  background: var(--chat-grad);
  color: #fff;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--teal) 25%, transparent);
}

.chat-bubble-user p {
  margin: 0;
}

.chat-time {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0 0.3rem;
}

.chat-attachment {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.chat-attachment-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
  display: block;
}

.chat-attachment strong {
  display: block;
  font-size: 0.85rem;
}

.chat-attachment span {
  font-size: 0.74rem;
  opacity: 0.85;
}

.chat-row-ai .chat-avatar {
  margin-top: 1.15rem;
  width: auto;
  height: auto;
  border-radius: 0;
}

.chat-row-ai .ai-mark {
  height: 1.7rem;
}

.chat-ai-body {
  min-width: 0;
  max-width: min(88%, 48rem);
}

.chat-meta {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0 0 0.3rem 0.2rem;
}

.chat-meta strong {
  color: var(--ink);
  font-size: 0.8rem;
}

.chat-meta span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.chat-bubble-ai {
  padding: 0.95rem 1.15rem;
  border-radius: 0.35rem 1.25rem 1.25rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: 0 6px 18px rgba(0, 60, 56, 0.06);
}

.chat-row-ai.is-error .chat-bubble-ai {
  background: var(--danger-bg);
  border-color: color-mix(in srgb, var(--danger) 30%, var(--line));
}

.md> :first-child {
  margin-top: 0;
}

.md> :last-child {
  margin-bottom: 0;
}

.md p {
  margin: 0.55rem 0;
}

.md h3,
.md h4,
.md h5 {
  margin: 1rem 0 0.4rem;
  font-family: "Outfit", system-ui, sans-serif;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
}

.md h3 {
  font-size: 1.08rem;
}

.md h4 {
  font-size: 1rem;
}

.md h5 {
  font-size: 0.94rem;
}

.md strong {
  color: var(--ink);
  font-weight: 800;
}

.md ul,
.md ol {
  margin: 0.45rem 0;
  padding-left: 1.3rem;
}

:root {
  --chat-grad: linear-gradient(135deg, #1d4ed8, #2f80ed);
}

.ai-output.md {
  display: block;
}

.md ul {
  list-style: none;
  padding-left: 0.2rem;
}

.md ol {
  list-style: decimal;
}

.md li {
  margin: 0.3rem 0;
}

.md ul li {
  position: relative;
  padding-left: 1.2rem;
}

.md ul li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.62em;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--chat-grad);
}

.md ol li::marker {
  color: var(--teal);
  font-weight: 800;
}

.md code {
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
  background: var(--sand);
  font-size: 0.85em;
}

.md blockquote {
  margin: 0.7rem 0;
  padding: 0.7rem 0.9rem;
  border-radius: 0.85rem;
  border-left: 4px solid var(--teal);
  background: color-mix(in srgb, var(--teal) 8%, var(--surface));
  color: var(--text);
}

.md hr {
  margin: 0.9rem 0;
  border: 0;
  border-top: 1px dashed var(--line);
}

.md-table {
  margin: 0.7rem 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
}

.md table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.md th,
.md td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.md th {
  background: var(--sand);
  color: var(--ink);
  font-weight: 800;
}

.md tr:last-child td {
  border-bottom: 0;
}

.chat-sources {
  margin: 0.5rem 0 0 0.2rem;
  font-size: 0.78rem;
}

.chat-sources-label {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chat-sources ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: src;
}

.chat-sources li {
  counter-increment: src;
  max-width: 100%;
}

.chat-sources a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-sources a::before {
  content: counter(src);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.chat-sources a:hover,
.chat-sources a:focus-visible {
  border-color: currentColor;
  text-decoration: underline;
}

.chat-search-chips {
  display: block;
  width: 100%;
  height: 64px;
  margin-top: 0.45rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
}

.chat-actions {
  display: flex;
  gap: 0.25rem;
  margin: 0.35rem 0 0 0.1rem;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.chat-row-ai:hover .chat-actions,
.chat-row-ai:last-child .chat-actions,
.chat-row-ai:focus-within .chat-actions {
  opacity: 1;
  transform: none;
}

.chat-actions button {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  border-radius: 0.6rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: 700 0.74rem inherit;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.chat-actions button svg {
  width: 0.9rem;
  height: 0.9rem;
  fill: currentColor;
}

.chat-actions button:hover {
  background: var(--sand);
  color: var(--teal);
}

.chat-actions button.done {
  color: var(--ok);
}

.chat-typing .chat-bubble-ai {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.typing-dots {
  display: inline-flex;
  gap: 0.28rem;
}

.typing-dots i {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--chat-grad);
  animation: typing-bounce 1.2s ease-in-out infinite;
}

.typing-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

.typing-label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

/* Welcome */
.chat-welcome {
  max-width: 44rem;
  margin: 0 auto;
  text-align: center;
  animation: chat-in 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: auto;
  height: auto;
  margin: 0 auto 1.25rem;
  border-radius: 0;
  background: none;
  color: #fff;
  box-shadow: none;
  animation: orb-float 4s ease-in-out infinite;
}

.chat-orb .ai-mark {
  position: relative;
  z-index: 1;
  height: 4.6rem;
}

.chat-orb-ring {
  position: absolute;
  inset: -10px;
  border-radius: 2.1rem;
  border: 1.5px solid color-mix(in srgb, var(--teal) 35%, transparent);
  animation: orb-ring 3s ease-out infinite;
}

.chat-orb-ring.r2 {
  animation-delay: 1.5s;
}

.chat-welcome h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  background: var(--chat-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.chat-welcome>p {
  max-width: 34rem;
  margin: 0.6rem auto 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.chat-suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.75rem;
  text-align: left;
}

.chat-suggestion {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.75rem;
  align-items: center;
  padding: 0.95rem 1rem;
  border-radius: 1.15rem;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.chat-suggestion:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--teal) 45%, var(--line));
  box-shadow: var(--glow-soft, 0 14px 30px rgba(0, 60, 56, 0.12));
}

.chat-suggestion-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.85rem;
  background: var(--sand);
  font-size: 1.25rem;
}

.chat-suggestion strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.chat-suggestion span:last-child {
  color: var(--muted);
  font-size: 0.8rem;
}

/* Composer */
.chat-composer-wrap {
  padding: 0.75rem clamp(0.75rem, 2.5vw, 1.75rem) 0.9rem;
  background: linear-gradient(to top, var(--surface) 65%, transparent);
}

.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
  padding: 0.45rem 0.45rem 0.45rem 0.55rem;
  border-radius: 1.5rem;
  border: 1.5px solid var(--line);
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(0, 60, 56, 0.1);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-composer:focus-within {
  border-color: color-mix(in srgb, var(--teal) 55%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 12%, transparent), 0 12px 30px rgba(0, 60, 56, 0.12);
}

.chat-composer textarea {
  flex: 1;
  min-height: 2.6rem;
  max-height: 180px;
  padding: 0.62rem 0.35rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 500 16px/1.45 inherit;
  font-family: inherit;
  resize: none;
  outline: none;
}

.chat-composer textarea::placeholder {
  color: var(--muted);
}

.composer-icon,
.composer-send {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 0;
  flex: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.composer-icon {
  background: transparent;
  color: var(--muted);
}

.composer-icon:hover {
  background: var(--sand);
  color: var(--teal);
}

.composer-icon svg,
.composer-send svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.composer-icon.recording,
.composer-icon.talk-live {
  background: var(--sos);
  color: #fff;
  animation: mic-pulse 1.2s ease-in-out infinite;
}

.composer-send {
  background: var(--chat-grad);
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--teal) 35%, transparent);
}

.composer-send:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.04);
}

.composer-send:disabled {
  background: var(--line);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}

.chat-app.is-busy .composer-send {
  animation: score-blink 1s ease-in-out infinite;
}

.composer-hint {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.3rem 1rem;
  margin-top: 0.5rem;
  padding: 0 0.5rem;
  color: var(--muted);
  font-size: 0.74rem;
}

#chatStatus {
  color: var(--teal);
  font-weight: 700;
}

/* Attachment tray */
.chat-composer-wrap {
  flex: none;
}

/* The chat panel is locked to the screen height, so a tall report preview scrolls inside itself instead of pushing the composer off-screen. */
.attach-tray {
  max-height: min(40vh, 20rem);
  max-height: min(40dvh, 20rem);
  margin-bottom: 0.6rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  border-radius: 1.1rem;
  animation: chat-in 0.3s ease;
}

.attach-tray .lab-confirm {
  columns: 2 13rem;
  column-gap: 1.5rem;
}

.attach-tray .lab-confirm li {
  break-inside: avoid;
}

.attach-tray .attach-card {
  align-items: flex-start;
}

.attach-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.7rem;
  border-radius: 1.1rem;
  border: 1px solid var(--line);
  background: var(--sand);
}

.attach-card.is-error {
  background: var(--danger-bg);
  border-color: color-mix(in srgb, var(--danger) 30%, var(--line));
}

.attach-thumb {
  position: relative;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 0.8rem;
  overflow: hidden;
  flex: none;
  background: var(--surface);
  border: 1px solid var(--line);
}

.attach-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attach-thumb.scanning::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 35%;
  background: linear-gradient(to bottom, transparent, rgba(47, 128, 237, 0.55), transparent);
  animation: scan-sweep 1.4s ease-in-out infinite;
}

.attach-info {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.15rem;
}

.attach-info strong {
  color: var(--ink);
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attach-info span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.attach-card.is-ready .attach-info span {
  color: var(--ok);
}

.attach-card.is-error .attach-info span {
  color: var(--danger);
}

.attach-progress {
  height: 4px;
  margin-top: 0.25rem;
  border-radius: var(--pill);
  background: var(--line);
  overflow: hidden;
}

.attach-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--chat-grad);
  transition: width 0.25s ease;
}

.attach-link {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--teal);
  font: 700 0.78rem inherit;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.attach-remove {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  flex: none;
}

.attach-remove:hover {
  color: var(--danger);
}

.attach-text {
  width: 100%;
  height: 9rem;
  margin-top: 0.5rem;
  padding: 0.75rem;
  border-radius: 0.9rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: 0.84rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  resize: vertical;
}

/* Drag and drop */
.chat-drop-overlay {
  position: absolute;
  inset: 0.75rem;
  z-index: 5;
  display: grid;
  place-items: center;
  border-radius: 1.4rem;
  border: 2px dashed var(--blue);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.chat-drop-overlay div {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  color: var(--blue);
}

.chat-drop-overlay svg {
  width: 2.6rem;
  height: 2.6rem;
  fill: currentColor;
}

.chat-app.is-dragging .chat-drop-overlay {
  opacity: 1;
}

.chat-app.is-dragging .side-drop {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 15%, transparent);
}

@keyframes chat-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes typing-bounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.55;
  }

  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

@keyframes orb-float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

@keyframes orb-ring {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }

  100% {
    transform: scale(1.25);
    opacity: 0;
  }
}

@keyframes mic-pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(217, 45, 32, 0.45);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(217, 45, 32, 0);
  }
}

@keyframes scan-sweep {
  0% {
    top: -35%;
  }

  100% {
    top: 100%;
  }
}

@media (min-width: 1025px) {

  html:has(body.chat-body),
  body.chat-body {
    overflow: hidden;
  }
}

@media (max-width: 1024px) {
  .chat-app {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .chat-side {
    display: none;
  }

  .chat-panel {
    height: calc(100dvh - var(--chat-head-h, 78px) - 2rem);
    min-height: 420px;
  }
}

@media (max-width: 768px) {
  .chat-stream.is-empty {
    justify-content: flex-start;
  }

  .chat-orb {
    margin-top: 0.35rem;
  }

  .chat-orb .ai-mark {
    height: 3.2rem;
  }

  html:has(body.chat-body),
  body.chat-body {
    overflow: hidden;
  }

  body.chat-body .site-footer {
    display: none;
  }

  .chat-page {
    padding: 0;
  }

  .composer-hint:has(#chatStatus:empty) {
    display: none;
  }

  .chat-panel {
    height: calc(100dvh - var(--chat-head-h, 78px) - 5.2rem - env(safe-area-inset-bottom));
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (max-width: 640px) {

  .chat-suggestions {
    grid-template-columns: 1fr;
  }

  .chat-bubble-user {
    max-width: 88%;
  }

  .chat-ai-body {
    max-width: 100%;
  }

  .chat-row-ai .chat-avatar {
    display: none;
  }

  .head-btn span,
  .composer-disclaimer {
    display: none;
  }
}

@keyframes sos-enter {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sos-ring {
  0% {
    transform: scale(1);
    opacity: 0.85;
  }

  100% {
    transform: scale(1.65);
    opacity: 0;
  }
}

@keyframes sos-border {

  0%,
  100% {
    opacity: 0.25;
  }

  50% {
    opacity: 0.9;
  }
}

@keyframes pin-shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-10px);
  }

  40% {
    transform: translateX(9px);
  }

  60% {
    transform: translateX(-6px);
  }

  80% {
    transform: translateX(4px);
  }
}

@keyframes score-blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.45;
  }
}

@media (max-width: 1024px) {
  .score-layout {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .score-trends {
    grid-column: 1 / -1;
  }

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

  .nf-card,
  .nf-card:nth-child(4),
  .nf-card:nth-child(5) {
    grid-column: span 1;
  }

  .nf-card:nth-child(5) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {

  .safety-hero,
  .safety-split,
  .safety-grid,
  .pin-manage-grid,
  .pin-fields {
    grid-template-columns: 1fr;
  }

  .score-layout {
    grid-template-columns: 1fr;
  }

  .sos-banner {
    grid-template-columns: 1fr;
    padding: 1.35rem;
  }

  .sos-btn {
    flex: 1 1 calc(50% - 0.65rem);
  }

  .sos-btn-ghost {
    margin-left: 0;
  }

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

  .nf-card:nth-child(5) {
    grid-column: auto;
  }

  .sos-fab {
    width: 3.5rem;
    height: 3.5rem;
    left: 1rem;
    bottom: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {

  .sos-banner,
  .sos-banner::after,
  .sos-pulse::before,
  .sos-pulse::after,
  .sos-fab-ring {
    animation: none !important;
  }
}

@media print {
  body {
    background: #fff !important;
    color: #111827 !important;
  }

  #bg-canvas,
  .no-print,
  .site-header,
  .sos-fab,
  .ht-toasts,
  .ht-offline-pill {
    display: none !important;
  }

  .print-card {
    box-shadow: none;
  }
}

/* ==================================================================== */
/* Simple app shell                                                     */
/* ==================================================================== */

.nav-actions[data-shell] {
  flex-wrap: nowrap;
  gap: 0.75rem;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cream-deep) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.nav-tab svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
  flex-shrink: 0;
}

.nav-tab:hover {
  color: var(--teal);
}

.nav-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--teal), #1d4ed8);
  box-shadow: 0 6px 16px rgba(30, 58, 138, 0.25);
}

html[data-theme="dark"] .nav-tab.active {
  color: #0b1530;
  background: linear-gradient(135deg, #60a5fa, #60a5fa);
}

.me-menu {
  position: relative;
}

.me-btn {
  display: grid;
  place-items: center;
  padding: 0.15rem;
  border: 2px solid transparent;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.me-btn:hover,
.me-btn[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--teal) 50%, transparent);
}

.me-avatar {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--blue));
}

.me-avatar.lg {
  width: 2.9rem;
  height: 2.9rem;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.me-avatar {
  overflow: hidden;
}

.me-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

a.me-head {
  text-decoration: none;
  border-radius: 0.85rem;
}

a.me-head:hover {
  background: var(--cream-deep);
}

.me-panel {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  z-index: 60;
  width: 17rem;
  padding: 0.5rem;
  border-radius: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.18);
  animation: me-pop 0.18s ease;
}

.me-panel[hidden] {
  display: none;
}

.me-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.6rem 0.8rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

.me-head strong {
  display: block;
  color: var(--ink);
  font-size: 0.98rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-head span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-panel .lang-select {
  display: flex;
  width: 100%;
  height: 2.7rem;
  margin: 0.2rem 0;
  padding: 0 0.6rem 0 0.8rem;
  border-radius: 0.8rem;
}

.me-panel .lang-select select {
  flex: 1;
  font-size: 0.93rem;
}

.me-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 0;
  border-radius: 0.8rem;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.93rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none !important;
}

.me-item svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: var(--muted);
  flex-shrink: 0;
}

.me-item:hover {
  background: var(--cream-deep);
}

.me-item.me-danger {
  color: var(--danger);
}

.me-item.me-danger svg {
  fill: var(--danger);
}

@keyframes me-pop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
}

.tabbar {
  display: none;
}

body.has-tabbar .sos-fab {
  display: none !important;
}

.sos-head {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 2.5rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(135deg, #f04438, #b42318);
  box-shadow: 0 6px 16px rgba(217, 45, 32, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sos-head:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(217, 45, 32, 0.45);
}

.sos-head svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

@media (max-width: 1100px) {
  .nav-tabs {
    display: none;
  }

  .chat-panel {
    height: calc(100dvh - var(--chat-head-h, 78px) - 5.2rem - env(safe-area-inset-bottom));
    min-height: 0;
  }

  html:has(body.chat-body),
  body.chat-body {
    overflow: hidden;
  }

  body.chat-body .site-footer {
    display: none;
  }

  .chat-page {
    padding-bottom: 0;
  }

  .sos-head {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: 2.4rem;
    padding: 0 0.85rem;
    border: 0;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #fff;
    background: linear-gradient(135deg, #f04438, #b42318);
    box-shadow: 0 6px 16px rgba(217, 45, 32, 0.35);
  }

  .sos-head svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
  }

  body.has-tabbar {
    padding-bottom: calc(5.2rem + env(safe-area-inset-bottom));
  }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    padding: 0.4rem 0.4rem calc(0.45rem + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.06);
  }

  .tab-item,
  .tab-plus {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.35rem 0.2rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  .tab-item svg {
    width: 1.45rem;
    height: 1.45rem;
    fill: currentColor;
  }

  .tab-item.active {
    color: var(--teal);
  }

  .tab-item.active svg {
    transform: scale(1.08);
  }

  .tab-plus-btn {
    display: grid;
    place-items: center;
    width: 3.3rem;
    height: 2.5rem;
    margin-top: -0.4rem;
    border-radius: 0.95rem;
    color: #fff;
    background: linear-gradient(135deg, #1d4ed8, #2f80ed);
    box-shadow: 0 8px 18px rgba(47, 128, 237, 0.35);
    transition: transform 0.15s ease;
  }

  .tab-plus:active .tab-plus-btn {
    transform: scale(0.92);
  }

  .tab-plus-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: currentColor;
  }

  body.has-tabbar .ht-toasts {
    bottom: calc(6rem + env(safe-area-inset-bottom));
  }

  body.has-tabbar .site-footer {
    display: none;
  }
}

/* ==================================================================== */
/* Simple home                                                          */
/* ==================================================================== */

.home-shell {
  padding-top: 1.75rem;
}

.home-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
}

.home-date {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.home-hero h1 {
  margin: 0.25rem 0 0;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.15;
  color: var(--ink);
}

.home-status {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  max-width: 38rem;
  margin: 0.6rem 0 0;
  font-size: 1.02rem;
  color: var(--text);
}

.status-dot {
  flex-shrink: 0;
  width: 0.7rem;
  height: 0.7rem;
  margin-top: 0.45rem;
  border-radius: 50%;
  background: var(--ok, #059669);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok, #059669) 20%, transparent);
}

.status-dot.level-watch {
  background: var(--amber, #b45309);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber, #b45309) 20%, transparent);
}

.home-log-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.95rem 1.5rem 0.95rem 1rem;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 45%, #2f80ed 100%);
  box-shadow: 0 14px 30px rgba(30, 58, 138, 0.28);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.home-log-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(30, 58, 138, 0.34);
}

.home-log-btn:active {
  transform: scale(0.97);
}

.home-log-plus {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.home-log-plus svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1.6rem;
}

.quick-tile {
  --tone: var(--teal);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 1.1rem 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.quick-tile:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--tone) 45%, var(--line));
}

.quick-tile:active {
  transform: scale(0.97);
}

.quick-tile.tone-teal {
  --tone: #2563eb;
}

.quick-tile.tone-blue {
  --tone: #2f80ed;
}

.quick-tile.tone-violet {
  --tone: #7c3aed;
}

.quick-tile.tone-leaf {
  --tone: #38b35a;
}

.quick-icon {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  margin-bottom: 0.55rem;
  border-radius: 0.95rem;
  color: #fff;
  background: var(--tone);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--tone) 35%, transparent);
}

.quick-icon svg {
  width: 1.45rem;
  height: 1.45rem;
  fill: currentColor;
}

.quick-tile strong {
  font-size: 1.02rem;
  font-weight: 800;
}

.quick-tile small {
  font-size: 0.82rem;
  color: var(--muted);
}

.empty-hero {
  margin-top: 1.75rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  border-radius: 1.6rem;
  border: 1.5px dashed color-mix(in srgb, var(--teal) 35%, var(--line));
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.empty-hero h2 {
  margin: 1.1rem 0 0.4rem;
  font-size: 1.7rem;
  color: var(--ink);
}

.empty-hero p {
  max-width: 30rem;
  margin: 0 auto 1.4rem;
  color: var(--muted);
}

.empty-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 5rem;
  height: 5rem;
  margin: 0 auto;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #e0474c, #f97066);
}

.empty-art svg {
  width: 2.4rem;
  height: 2.4rem;
  fill: currentColor;
  animation: heart-beat 1.4s ease-in-out infinite;
}

.empty-ring {
  position: absolute;
  inset: -0.5rem;
  border-radius: 50%;
  border: 2px solid rgba(224, 71, 76, 0.3);
  animation: ring-pulse 2s ease-out infinite;
}

@keyframes heart-beat {

  0%,
  100% {
    transform: scale(1);
  }

  15% {
    transform: scale(1.15);
  }

  30% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.1);
  }
}

@keyframes ring-pulse {
  from {
    transform: scale(0.9);
    opacity: 1;
  }

  to {
    transform: scale(1.35);
    opacity: 0;
  }
}

.dash-section {
  margin-top: 1.9rem;
}

.dash-section.care-card {
  padding: 1.4rem 1.4rem 1.5rem;
}

.dash-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.dash-section-head h2 {
  margin: 0;
  font-size: 1.4rem;
  color: var(--ink);
}

.dash-section-meta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr));
  gap: 0.9rem;
}

.number-card {
  position: relative;
  padding: 1.1rem 1.15rem 1.15rem;
  border-radius: 1.25rem;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.number-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--ok, #059669);
}

.number-card.level-watch::before {
  background: var(--amber, #b45309);
}

.number-card.level-high::before,
.number-card.level-low::before {
  background: var(--sos, #d92d20);
}

.number-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.number-icon {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.8rem;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 13%, transparent);
}

.number-icon svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: currentColor;
}

.tone-red {
  --tone: #e0474c;
}

.tone-rose {
  --tone: #db2777;
}

.tone-leaf {
  --tone: #38b35a;
}

.tone-blue {
  --tone: #2f80ed;
}

.tone-amber {
  --tone: #d97706;
}

.tone-violet {
  --tone: #7c3aed;
}

.tone-teal {
  --tone: #2563eb;
}

.status-pill {
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--ok, #059669);
  background: var(--ok-bg, #ecf8f1);
}

.status-pill.level-watch {
  color: var(--amber, #b45309);
  background: var(--amber-bg, #fff7e8);
}

.status-pill.level-high,
.status-pill.level-low {
  color: var(--sos, #d92d20);
  background: var(--danger-bg, #fef3f2);
}

.number-label {
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
}

.number-value {
  margin: 0.1rem 0 0;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.number-value small {
  margin-left: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.number-note {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  color: var(--text);
}

.number-change {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.chart-chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.3rem;
  margin-bottom: 0.9rem;
  scrollbar-width: none;
}

.chart-chips::-webkit-scrollbar {
  display: none;
}

.chart-chip {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.chart-chip:hover {
  border-color: var(--teal);
}

.chart-chip.on {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--teal), #1d4ed8);
}

html[data-theme="dark"] .chart-chip.on {
  color: #0b1530;
  background: linear-gradient(135deg, #60a5fa, #60a5fa);
}

.chart-box {
  height: 300px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--teal);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.pill-btn svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.pill-btn:hover {
  border-color: var(--teal);
}

.pill-btn.is-speaking,
.head-btn.is-speaking {
  color: #fff;
  border-color: transparent;
  background: #b42318;
}

.pill-btn.pill-strong {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--teal), #1d4ed8);
}

.pill-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.advice-body {
  position: relative;
  font-size: 1rem;
}

.advice-body.is-clamped {
  max-height: 13rem;
  overflow: hidden;
}

.advice-body.is-clamped::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 5rem;
  background: linear-gradient(transparent, var(--surface));
  pointer-events: none;
}

.advice-toggle {
  margin-top: 0.7rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.advice-empty {
  margin: 0;
  color: var(--muted);
}

.help-card {
  margin-top: 1.9rem;
  border-radius: 1.25rem;
  border: 1px solid color-mix(in srgb, var(--sos, #d92d20) 30%, var(--line));
  background: color-mix(in srgb, var(--danger-bg, #fef3f2) 70%, var(--surface));
  overflow: hidden;
}

.help-card summary {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.2rem;
  list-style: none;
  cursor: pointer;
  box-shadow: none !important;
}

.help-card summary::-webkit-details-marker {
  display: none;
}

.help-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.85rem;
  color: #fff;
  background: var(--sos, #d92d20);
}

.help-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.help-title {
  flex: 1;
}

.help-title strong {
  display: block;
  color: var(--ink);
  font-size: 1.02rem;
}

.help-title small {
  color: var(--muted);
  font-size: 0.84rem;
}

.help-chevron {
  width: 0.65rem;
  height: 0.65rem;
  border-right: 2.5px solid var(--muted);
  border-bottom: 2.5px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.help-card[open] .help-chevron {
  transform: rotate(-135deg);
}

.help-body {
  padding: 0 1.2rem 1.2rem 4.55rem;
}

.help-body ul {
  margin: 0;
  padding-left: 1.1rem;
  list-style: disc;
  color: var(--text);
}

.help-body li+li {
  margin-top: 0.3rem;
}

.help-warn {
  margin: 0.8rem 0 0;
  font-weight: 700;
  color: var(--sos, #d92d20);
}

.score-card .score-layout {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.score-verdict {
  margin: 0.35rem 0 0;
  font-size: 1.05rem;
  color: var(--text);
}

.score-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.score-more {
  margin-top: 1rem;
}

.score-more .score-trends {
  margin-top: 1rem;
}

@media (max-width: 700px) {
  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .home-shell {
    padding-top: 1.2rem;
  }

  .home-hero>.home-log-btn {
    width: 100%;
    justify-content: center;
  }

  .quick-grid {
    gap: 0.65rem;
    margin-top: 1.2rem;
  }

  .quick-tile {
    padding: 0.9rem;
  }

  .quick-tile small {
    display: none;
  }

  .number-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .number-card {
    padding: 0.9rem;
  }

  .number-value {
    font-size: 1.55rem;
  }

  .number-value small {
    display: block;
    margin: 0;
  }

  .number-note {
    font-size: 0.8rem;
  }

  .chart-box {
    height: 240px;
  }

  .help-body {
    padding-left: 1.2rem;
  }

  .score-card .score-layout {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .score-cta {
    justify-content: center;
  }

  .score-more {
    text-align: left;
  }
}

/* ==================================================================== */
/* Check-in sheet                                                       */
/* ==================================================================== */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.sheet[hidden] {
  display: none;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 16, 15, 0.55);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sheet-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(92dvh, 760px);
  border-radius: 1.6rem;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  transform: translateY(24px) scale(0.98);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1), opacity 0.2s ease;
}

.sheet.open .sheet-backdrop {
  opacity: 1;
}

.sheet.open .sheet-card {
  transform: none;
  opacity: 1;
}

body.sheet-open {
  overflow: hidden;
}

.sheet-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1rem 0.4rem;
}

.sheet-round {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 50%;
  background: var(--cream-deep);
  color: var(--text);
  cursor: pointer;
}

.sheet-round svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
}

.sheet-progress {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
}

.sheet-progress i {
  height: 0.35rem;
  border-radius: 999px;
  background: var(--line);
  transition: background 0.3s ease;
}

.sheet-progress i.on {
  background: linear-gradient(90deg, #1d4ed8, #2f80ed);
}

.sheet.is-done .sheet-progress i {
  background: var(--ok, #059669);
}

.sheet-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.step {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.6rem 0.5rem;
  animation: step-in 0.28s ease;
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
}

.step-icon {
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 1rem;
  color: #fff;
  background: var(--tone);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--tone) 35%, transparent);
}

.step-icon svg {
  width: 1.6rem;
  height: 1.6rem;
  fill: currentColor;
}

.step-count {
  margin: 1rem 0 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.step h2 {
  margin: 0.2rem 0 0;
  font-size: 1.65rem;
  line-height: 1.2;
  color: var(--ink);
}

.step-hint {
  margin: 0.45rem 0 1.25rem;
  color: var(--muted);
}

.bp-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 0.6rem;
}

.bp-slash {
  padding-bottom: 0.7rem;
  font-size: 2.4rem;
  font-weight: 300;
  color: var(--muted);
}

.big-field {
  display: block;
  position: relative;
}

.big-field span,
.line-field span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
}

.big-field input {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 2px solid var(--line);
  border-radius: 1.1rem;
  background: var(--cream);
  color: var(--ink);
  font: inherit;
  font-size: 2.2rem;
  font-weight: 800;
  text-align: center;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  -moz-appearance: textfield;
}

.big-field.solo {
  max-width: 17rem;
}

.big-field.solo input {
  padding-right: 4.8rem;
}

.big-field b {
  position: absolute;
  right: 1rem;
  bottom: 1.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.big-field input:focus,
.line-field input:focus,
.soft-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 15%, transparent);
}

.sheet input[type="number"]::-webkit-outer-spin-button,
.sheet input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.line-field {
  display: block;
  position: relative;
  margin-top: 1rem;
}

.line-field em,
.more-readings em {
  margin-left: 0.3rem;
  font-style: normal;
  font-weight: 600;
  color: var(--muted);
}

.line-field input {
  width: 100%;
  padding: 0.75rem 5.4rem 0.75rem 0.95rem;
  border: 2px solid var(--line);
  border-radius: 0.95rem;
  background: var(--cream);
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  outline: none;
  -moz-appearance: textfield;
}

.line-field b {
  position: absolute;
  right: 0.95rem;
  bottom: 0.85rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.two-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.two-fields .line-field {
  margin-top: 0;
}

.field-label {
  margin: 1.3rem 0 0.55rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--ink);
}

.checkin-entry {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.1rem;
}

.checkin-entry-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 1.1rem;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 40, 80, 0.05);
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.checkin-entry-btn:hover {
  border-color: color-mix(in srgb, var(--teal) 45%, var(--line));
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 40, 80, 0.08);
}

.checkin-entry-btn:active {
  transform: translateY(0);
}

.checkin-entry-btn.is-active,
.checkin-entry-btn:focus-visible {
  border-color: transparent;
  outline: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--teal) 12%, var(--surface)), var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 18%, transparent);
}

.checkin-entry-muted {
  background: color-mix(in srgb, var(--sand) 70%, var(--surface));
}

.checkin-entry-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 0.9rem;
  color: #fff;
  background: linear-gradient(135deg, #1e3a8a, #2f80ed);
}

.checkin-entry-muted .checkin-entry-icon {
  background: linear-gradient(135deg, #64748b, #94a3b8);
}

.checkin-entry-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.checkin-entry-copy {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.checkin-entry-copy strong {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--ink);
}

.checkin-entry-copy small {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.chip-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip-pick button {
  padding: 0.55rem 0.95rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-pick button:hover {
  border-color: var(--teal);
}

.chip-pick button.on {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--teal), #1d4ed8);
}

html[data-theme="dark"] .chip-pick button.on {
  color: #0b1530;
  background: linear-gradient(135deg, #60a5fa, #60a5fa);
}

.soft-input {
  width: 100%;
  margin-top: 0.7rem;
  padding: 0.8rem 0.95rem;
  border: 2px solid var(--line) !important;
  border-radius: 0.95rem;
  background: var(--cream) !important;
  font-size: 1rem;
  outline: none;
  resize: vertical;
}

.more-readings {
  margin-top: 1.1rem;
  border-top: 1px dashed var(--line);
  padding-top: 0.9rem;
}

.more-readings summary {
  font-weight: 800;
  color: var(--blue);
  cursor: pointer;
  box-shadow: none !important;
}

.more-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.more-grid .line-field input {
  padding-right: 3rem;
}

.step-done {
  text-align: center;
}

.done-badge {
  display: grid;
  place-items: center;
  width: 4.2rem;
  height: 4.2rem;
  margin: 0.4rem auto 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #38b35a, #3dd68c);
  box-shadow: 0 14px 30px rgba(31, 157, 107, 0.35);
  animation: done-pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

.done-badge svg {
  width: 2.2rem;
  height: 2.2rem;
  fill: currentColor;
}

@keyframes done-pop {
  from {
    transform: scale(0.3);
    opacity: 0;
  }
}

.step-done h2 {
  margin-top: 0.8rem;
}

.done-output {
  --chat-grad: linear-gradient(135deg, #1d4ed8, #2f80ed);
  margin-top: 0.2rem;
  padding: 1rem 1.1rem;
  text-align: left;
  border-radius: 1rem;
  background: var(--cream);
  border: 1px solid var(--line);
}

.done-output .typing-dots {
  display: flex;
  justify-content: center;
  padding: 0.6rem 0;
}

.step-error {
  min-height: 0;
  margin: 0 1.6rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--sos, #d92d20);
}

.step-error:empty {
  display: none;
}

.sheet-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 1rem 1.6rem 1.4rem;
}

.sheet-skip {
  padding: 0.9rem 1.2rem;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.sheet-skip[hidden] {
  display: none;
}

.sheet-next {
  flex: 1;
  max-width: 16rem;
  padding: 0.95rem 1.4rem;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 45%, #2f80ed 100%);
  font: inherit;
  font-size: 1.02rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(30, 58, 138, 0.28);
  transition: transform 0.15s ease;
}

.sheet-next:active {
  transform: scale(0.97);
}

@media (max-width: 640px) {
  .sheet {
    place-items: end stretch;
    padding: 0;
  }

  .sheet-card {
    width: 100%;
    max-height: 94dvh;
    border-radius: 1.6rem 1.6rem 0 0;
    transform: translateY(100%);
  }

  .step {
    padding: 0.8rem 1.25rem 0.5rem;
  }

  .step h2 {
    font-size: 1.45rem;
  }

  .big-field input {
    font-size: 1.9rem;
  }

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

  .sheet-foot {
    padding: 0.8rem 1.25rem calc(1rem + env(safe-area-inset-bottom));
  }

  .sheet-next {
    max-width: none;
  }

  .step-error {
    margin: 0 1.25rem;
  }
}

/* ==================================================================== */
/* Welcome tour                                                         */
/* ==================================================================== */

.onboard {
  position: fixed;
  inset: 0;
  z-index: 9800;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(4, 16, 15, 0.6);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.onboard.open {
  opacity: 1;
}

.onboard-card {
  position: relative;
  width: min(420px, 100%);
  padding: 2.4rem 0 1.6rem;
  overflow: hidden;
  border-radius: 1.8rem;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.onboard-skip {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  padding: 0.4rem 0.8rem;
  border: 0;
  border-radius: 999px;
  background: var(--cream-deep);
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.onboard-track {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
  touch-action: pan-y;
  user-select: none;
}

.onboard-slide {
  flex: 0 0 100%;
  padding: 0 2rem;
}

.onboard-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 7rem;
  height: 7rem;
  margin: 0.5rem auto 0;
  border-radius: 2rem;
  color: #fff;
  background: var(--tone);
  box-shadow: 0 18px 40px color-mix(in srgb, var(--tone) 40%, transparent);
}

.onboard-art svg {
  position: relative;
  width: 3.2rem;
  height: 3.2rem;
  fill: currentColor;
}

.onboard-glow {
  position: absolute;
  inset: -1.2rem;
  border-radius: 2.6rem;
  background: radial-gradient(circle, color-mix(in srgb, var(--tone) 30%, transparent), transparent 70%);
}

.onboard-slide h2 {
  margin: 1.6rem 0 0.5rem;
  font-size: 1.6rem;
  color: var(--ink);
}

.onboard-slide p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.onboard-dots {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin: 1.6rem 0 1.2rem;
}

.onboard-dots i {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

.onboard-dots i.on {
  width: 1.6rem;
  background: linear-gradient(90deg, #1d4ed8, #2f80ed);
}

.onboard-next {
  width: calc(100% - 3.2rem);
  padding: 1rem;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 45%, #2f80ed 100%);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(30, 58, 138, 0.28);
}

/* ==================================================================== */
/* Simple tips page                                                     */
/* ==================================================================== */

.tips-shell {
  padding-top: 1.75rem;
}

.tips-hero h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.15;
  color: var(--ink);
}

.tips-hero>p {
  margin: 0.4rem 0 0;
  font-size: 1.05rem;
  color: var(--muted);
}

.seg-tabs {
  display: inline-flex;
  gap: 0.3rem;
  margin-top: 1.3rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: var(--cream-deep);
  border: 1px solid var(--line);
}

.seg-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.3rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.seg-tab svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
}

.seg-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8 50%, #2f80ed);
  box-shadow: 0 8px 18px rgba(30, 58, 138, 0.25);
}

.tips-panel {
  margin-top: 1.4rem;
  padding: 1.4rem 1.4rem 1.5rem;
}

.tips-panel[hidden] {
  display: none;
}

.tips-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.video-search {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.35rem 0.35rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.video-search:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 14%, transparent);
}

.video-search>svg {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  fill: var(--muted);
}

.video-search input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0;
  border: 0 !important;
  outline: none;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.video-search button {
  flex-shrink: 0;
  padding: 0.7rem 1.3rem;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #1e3a8a, #2f80ed);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.video-search button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.video-empty {
  grid-column: 1 / -1;
  padding: 1.4rem 1.2rem;
  border: 1px dashed var(--line);
  border-radius: 1rem;
  background: var(--surface);
}

.video-empty strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--ink);
}

.video-empty p {
  margin: 0;
  color: var(--muted);
}

.video-chips {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.9rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  scrollbar-width: none;
}

.video-chips::-webkit-scrollbar {
  display: none;
}

.video-chips button {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.video-chips button:hover {
  border-color: var(--teal);
}

.video-chips button.active {
  color: #fff;
  border-color: transparent;
  background: var(--ink);
}

html[data-theme="dark"] .video-chips button.active {
  color: #0b1530;
  background: linear-gradient(135deg, #60a5fa, #60a5fa);
}

@media (max-width: 640px) {
  .seg-tabs {
    display: flex;
    width: 100%;
  }

  .seg-tab {
    flex: 1;
    justify-content: center;
    padding: 0.7rem 0.8rem;
  }

  .tips-panel {
    padding: 1.15rem;
  }

  .video-search button {
    padding: 0.65rem 1rem;
  }
}

/* ==================================================================== */
/* Simple settings list (Safety page)                                   */
/* ==================================================================== */

.settings-shell {
  max-width: none;
  padding-top: 1.75rem;
}

.set-list {
  margin-top: 1.4rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.set-group-label {
  margin: 1.8rem 0 0;
  padding-left: 0.4rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.set-group-label+.set-list {
  margin-top: 0.6rem;
}

.set-row+.set-row {
  border-top: 1px solid var(--line);
}

.set-row>summary {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  padding: 1rem 1.15rem;
  list-style: none;
  cursor: pointer;
  transition: background 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.set-row>summary::-webkit-details-marker {
  display: none;
}

.set-row>summary:hover {
  background: color-mix(in srgb, var(--teal) 5%, transparent);
}

.set-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.85rem;
  color: #fff;
}

.set-icon svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: currentColor;
}

.set-icon.tone-red {
  background: linear-gradient(135deg, #f04438, #b42318);
}

.set-icon.tone-blue {
  background: linear-gradient(135deg, #60a5fa, #0558d6);
}

.set-icon.tone-teal {
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
}

.set-icon.tone-violet {
  background: linear-gradient(135deg, #8b5cf6, #5b21b6);
}

.set-icon.tone-amber {
  background: linear-gradient(135deg, #f59e0b, #b45309);
}

.set-icon.tone-leaf {
  background: linear-gradient(135deg, #22a06b, #059669);
}

.set-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.set-text strong {
  font-size: 1.02rem;
  color: var(--ink);
}

.set-text small {
  margin-top: 0.1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.set-status {
  flex-shrink: 0;
  max-width: 9rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
  background: var(--cream-deep);
}

.set-status:empty {
  display: none;
}

.set-status.is-ok {
  color: var(--ok, #059669);
  background: var(--ok-bg, #ecf8f1);
}

.set-status.is-off {
  color: var(--sos, #d92d20);
  background: color-mix(in srgb, var(--sos, #d92d20) 12%, transparent);
}

.set-chevron {
  flex-shrink: 0;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.2rem;
  border-right: 2.5px solid var(--muted);
  border-bottom: 2.5px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.set-row[open] .set-chevron {
  transform: rotate(45deg);
}

.set-body {
  padding: 0.3rem 1.15rem 1.35rem;
  animation: set-open 0.25s ease;
}

.set-body>.safety-lead {
  margin-top: 0;
}

@keyframes set-open {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@media (max-width: 640px) {
  .set-row>summary {
    gap: 0.75rem;
    padding: 0.9rem 0.95rem;
  }

  .set-text small {
    display: none;
  }

  .set-status {
    max-width: 6.5rem;
  }

  .set-body {
    padding: 0.2rem 0.95rem 1.2rem;
  }
}

.composer-icon.attach-hint {
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #2f80ed);
  animation: attach-pulse 1.4s ease-in-out infinite;
}

@keyframes attach-pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.45);
  }

  50% {
    box-shadow: 0 0 0 9px rgba(124, 58, 237, 0);
  }
}

/* ---------- Gmingo brand ---------- */
.site-logo.logo-sm img {
  height: 54px;
}

.site-logo.logo-lg img {
  height: 110px;
  max-width: min(300px, 78vw);
}

.site-logo.logo-auth img {
  height: 130px;
  max-width: min(320px, 82vw);
}

.site-logo.logo-footer img {
  height: 80px;
}

/* ---------- Gmingo Tech style home ---------- */
body.gm-home {
  background: #f8fafc;
  color: #0f172a;
}

body.gm-home #bg-canvas {
  display: none;
}

body.gm-home .site-header {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 0;
  box-shadow: 0 1px 0 #e2e8f0;
}

body.gm-home .gm-nav {
  max-width: none;
  padding: 0.65rem var(--edge);
}

body.gm-home .site-logo.logo-sm img {
  height: 46px;
}

body.gm-home .site-logo.logo-footer img {
  height: 58px;
}

.gm-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.45rem var(--edge);
  background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 58%, #1d4ed8 100%);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
}

.gm-top a {
  color: #fff;
}

.gm-top-left,
.gm-top-right {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.gm-header .gm-links {
  gap: 0.35rem;
}

.gm-header .nav-link {
  color: #334155;
  font-size: 0.92rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
}

.gm-header .nav-link.is-current,
.gm-header .nav-link:hover {
  background: #eff6ff;
  color: #1e3a8a;
}

.gm-nav-end {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.4rem;
  padding: 0.45rem 0.7rem 0.45rem 1.35rem;
  background: linear-gradient(90deg, #3b82f6, #1e40af);
  clip-path: polygon(16px 0, 100% 0, 100% 100%, 0 100%);
  border-radius: 0 14px 14px 0;
}

.gm-login,
.gm-start,
.gm-theme {
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.86rem;
  padding: 0.42rem 0.85rem;
  line-height: 1;
}

.gm-login {
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, .85);
}

.gm-start {
  background: #fff;
  color: #1e3a8a;
}

.gm-theme {
  background: #eff6ff;
  color: #1e3a8a;
  border: 0;
  cursor: pointer;
}

.gm-hero {
  position: relative;
  min-height: 78vh;
  display: grid;
  align-items: end;
  color: #fff;
  background: #0f172a center/cover no-repeat;
  padding: 4.5rem var(--edge) 5.5rem;
}

.gm-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8, 18, 40, .88) 0%, rgba(30, 58, 138, .62) 52%, rgba(8, 18, 40, .28) 100%);
}

.gm-hero-copy,
.gm-hero-nav {
  position: relative;
  z-index: 1;
}

.gm-hero-copy {
  max-width: 740px;
}

.gm-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

.gm-hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2.3rem, 5vw, 4.3rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.gm-hero h1 span {
  color: #60a5fa;
}

.gm-hero-copy>p,
.gm-hero article>p:last-child {
  max-width: 38rem;
  margin: 1rem 0 0;
  color: #e2e8f0;
  font-size: 1.05rem;
}

.gm-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.4rem;
}

.gm-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.8rem 1.2rem;
  font-weight: 700;
  border: 1.5px solid transparent;
  cursor: pointer;
}

.gm-btn.solid {
  background: #2f80ed;
  color: #fff;
}

.gm-btn.ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, .7);
}

.gm-btn.outline {
  background: #fff;
  color: #1e3a8a;
  border-color: #bfdbfe;
}

.gm-btn.light {
  background: #fff;
  color: #1e3a8a;
}

.gm-hero-nav {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 2.2rem;
}

.gm-hero-nav button {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, .55);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.3rem;
}

.gm-hero-nav [data-dot] {
  width: 34px;
  height: 4px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, .4);
  padding: 0;
}

.gm-hero-nav [data-dot].is-on {
  background: #60a5fa;
  width: 48px;
}

.gm-trust {
  background: #fff;
  padding: 1.3rem 0 0.4rem;
  overflow: hidden;
}

.gm-trust>p {
  margin: 0 1.4rem 0.8rem;
  color: #1d4ed8;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.gm-trust>p::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 3px;
  margin-right: 0.6rem;
  background: #2563eb;
  vertical-align: middle;
}

.gm-marquee {
  overflow: hidden;
}

.gm-marquee div {
  display: flex;
  gap: 2.5rem;
  width: max-content;
  animation: gm-slide 28s linear infinite;
  padding: 0.6rem 0 1.2rem;
}

.gm-marquee span {
  color: #94a3b8;
  font-size: 1.35rem;
  font-weight: 700;
}

@keyframes gm-slide {
  to {
    transform: translateX(-50%);
  }
}

.gm-about,
.gm-caps,
.gm-steps,
.gm-conditions,
.gm-faq {
  max-width: none;
  margin: 0;
  padding: 4.2rem var(--edge);
}

.gm-about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.gm-about img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  border-radius: 1.4rem;
}

.gm-kicker {
  margin: 0 0 0.55rem;
  color: #2563eb;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.gm-kicker::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 3px;
  margin-right: 0.5rem;
  background: #2563eb;
  vertical-align: middle;
}

.gm-about h2,
.gm-section-head h2,
.gm-cta h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #0f172a;
}

.gm-about h2 span {
  color: #2f80ed;
}

.gm-lead {
  color: #475569;
  font-size: 1.05rem;
}

.gm-points {
  display: grid;
  gap: 0.8rem;
  margin: 1.2rem 0;
}

.gm-points article {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 0.85rem 1rem;
}

.gm-points span {
  width: 42px;
  height: 42px;
  border-radius: 0.8rem;
  background: #2563eb;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: none;
}

.gm-points h3 {
  margin: 0 0 0.15rem;
  font-size: 1rem;
}

.gm-points p {
  margin: 0;
  color: #64748b;
}

.gm-section-head {
  margin-bottom: 1.6rem;
  max-width: 40rem;
}

.gm-cap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.gm-cap-grid article {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1.2rem;
  padding: 1.2rem 1.15rem 1.3rem;
  min-height: 190px;
}

.gm-cap-grid b {
  display: block;
  color: #2563eb;
  font-size: 1.4rem;
}

.gm-cap-grid small {
  color: #94a3b8;
  font-weight: 700;
}

.gm-cap-grid h3 {
  margin: 0.7rem 0 0.35rem;
}

.gm-cap-grid p {
  margin: 0;
  color: #475569;
}

.gm-steps {
  background: transparent;
}

.gm-steps ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.8rem;
}

.gm-steps li {
  background: #fff;
  border-radius: 1.1rem;
  padding: 1rem;
  border-top: 4px solid #2563eb;
}

.gm-steps b {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  margin-bottom: 0.6rem;
}

.gm-steps h3 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.gm-steps p {
  margin: 0;
  color: #64748b;
  font-size: 0.92rem;
}

.gm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.gm-chips span {
  background: #fff;
  border: 1px solid #dbeafe;
  color: #1e3a8a;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font-weight: 700;
}

.gm-faq-list {
  display: grid;
  gap: 0.7rem;
}

.gm-faq-list details {
  background: #fff;
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid #e2e8f0;
}

.gm-faq-list summary {
  font-weight: 750;
  cursor: pointer;
}

.gm-faq-list p {
  color: #475569;
  margin: 0.55rem 0 0;
}

.gm-cta {
  margin: 0 0 2rem;
  border-radius: 0;
  padding: 3rem var(--edge);
  text-align: center;
  color: #fff;
  background: linear-gradient(100deg, #1e3a8a, #2563eb 60%, #3b82f6);
}

.gm-cta .gm-kicker,
.gm-cta h2 {
  color: #fff;
}

.gm-cta .gm-kicker::before {
  background: #fff;
}

.gm-cta p {
  color: #dbeafe;
}

.gm-cta .gm-hero-actions {
  justify-content: center;
}

.gm-cta .gm-btn.ghost {
  border-color: rgba(255, 255, 255, .7);
}

.gm-footer {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.5rem;
  padding: 2.2rem var(--edge) 2.6rem;
  background: #0f172a;
  color: #cbd5e1;
}

.gm-footer h4 {
  margin: 0 0 0.6rem;
  color: #fff;
}

.gm-footer a {
  display: block;
  color: #cbd5e1;
  margin: 0.3rem 0;
}

html[data-theme="dark"] body.gm-home {
  background: #0b1220;
  color: #e2e8f0;
}

html[data-theme="dark"] body.gm-home .site-header,
html[data-theme="dark"] .gm-trust,
html[data-theme="dark"] .gm-cap-grid article,
html[data-theme="dark"] .gm-steps li,
html[data-theme="dark"] .gm-points article,
html[data-theme="dark"] .gm-faq-list details,
html[data-theme="dark"] .gm-chips span {
  background: #111b33;
  color: #e2e8f0;
  border-color: #1f2d4d;
}

html[data-theme="dark"] .gm-header .nav-link {
  color: #cbd5e1;
}

html[data-theme="dark"] .gm-header .nav-link.is-current {
  background: #1e3a8a;
  color: #fff;
}

html[data-theme="dark"] .gm-about h2,
html[data-theme="dark"] .gm-section-head h2,
html[data-theme="dark"] .gm-points h3,
html[data-theme="dark"] .gm-cap-grid h3,
html[data-theme="dark"] .gm-steps h3 {
  color: #f8fafc;
}

html[data-theme="dark"] .gm-lead,
html[data-theme="dark"] .gm-points p,
html[data-theme="dark"] .gm-cap-grid p,
html[data-theme="dark"] .gm-steps p,
html[data-theme="dark"] .gm-faq-list p {
  color: #94a3b8;
}

@media (max-width: 980px) {

  .gm-about,
  .gm-cap-grid,
  .gm-steps ol,
  .gm-footer {
    grid-template-columns: 1fr 1fr;
  }

  .gm-steps ol {
    grid-template-columns: 1fr 1fr;
  }

  .gm-links {
    display: none;
  }

  .gm-top-left span {
    display: none;
  }
}

@media (max-width: 680px) {

  .gm-about,
  .gm-cap-grid,
  .gm-footer {
    grid-template-columns: 1fr;
  }

  .gm-about img {
    height: 240px;
  }

  .gm-hero {
    min-height: 88vh;
    padding: 3rem var(--edge) 4.5rem;
  }

  .gm-nav-end {
    clip-path: none;
    border-radius: 999px;
    padding: 0.3rem;
  }

  .gm-login {
    display: none;
  }
}

/* How it works: photo steps */
.gm-steps {
  max-width: none;
  margin: 0;
  padding: 0;
  background:
    radial-gradient(900px 280px at 10% 0%, rgba(96, 165, 250, 0.35), transparent 70%),
    linear-gradient(180deg, #eff6ff 0%, #dbeafe 42%, #f8fafc 100%);
}

.gm-steps-inner {
  max-width: none;
  margin: 0;
  padding: 4.6rem var(--edge) 4.2rem;
}

.gm-steps .gm-section-head p:last-child {
  color: #475569;
  margin: 0.55rem 0 0;
  max-width: 36rem;
}

.gm-steps ol {
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.gm-steps li {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 0;
  border-radius: 1.25rem;
  box-shadow: 0 18px 40px -28px rgba(30, 58, 138, 0.7);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gm-steps li:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 44px -24px rgba(30, 58, 138, 0.55);
}

.gm-steps figure {
  position: relative;
  margin: 0;
  height: 150px;
}

.gm-steps img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gm-steps figure b {
  position: absolute;
  left: 0.75rem;
  bottom: -16px;
  width: 34px;
  height: 34px;
  margin: 0;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 0.95rem;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.35);
}

.gm-steps li>div {
  padding: 1.45rem 0.95rem 1.15rem;
}

.gm-steps h3 {
  font-size: 1.02rem;
}

html[data-theme="dark"] .gm-steps {
  background:
    radial-gradient(900px 280px at 10% 0%, rgba(37, 99, 235, 0.35), transparent 70%),
    linear-gradient(180deg, #0f1a33 0%, #0b1220 100%);
}

html[data-theme="dark"] .gm-steps li {
  background: #111b33;
  box-shadow: none;
  border: 1px solid #1f2d4d;
}

html[data-theme="dark"] .gm-steps .gm-section-head p:last-child {
  color: #94a3b8;
}

@media (max-width: 1100px) {
  .gm-steps ol {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 720px) {
  .gm-steps ol {
    grid-template-columns: 1fr !important;
  }

  .gm-steps figure {
    height: 190px;
  }
}

/* How it works: photo steps */
.gm-steps {
  max-width: none;
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #e8f1ff 0%, #f8fafc 72%);
}

.gm-steps-inner {
  max-width: none;
  margin: 0;
  padding: 4.4rem var(--edge) 4.6rem;
}

.gm-steps .gm-section-head p:last-child {
  color: #475569;
  margin: 0.55rem 0 0;
  font-size: 1.05rem;
}

.gm-steps ol {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.gm-steps li {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 0;
  border-radius: 1.25rem;
  box-shadow: 0 18px 40px -28px rgba(30, 58, 138, 0.55);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gm-steps li:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 44px -24px rgba(30, 58, 138, 0.45);
}

.gm-steps figure {
  position: relative;
  margin: 0;
  height: 148px;
}

.gm-steps img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gm-steps figure b {
  position: absolute;
  left: 0.75rem;
  bottom: -14px;
  width: 34px;
  height: 34px;
  margin: 0;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.35);
}

.gm-steps li>div {
  padding: 1.35rem 0.95rem 1.15rem;
}

.gm-steps h3 {
  font-size: 1.02rem;
}

html[data-theme="dark"] .gm-steps {
  background: linear-gradient(180deg, #0f1c36 0%, #0b1220 70%);
}

html[data-theme="dark"] .gm-steps li {
  background: #111b33;
  box-shadow: none;
}

html[data-theme="dark"] .gm-steps .gm-section-head p:last-child {
  color: #94a3b8;
}

@media (max-width: 1100px) {
  .gm-steps ol {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .gm-steps ol {
    grid-template-columns: 1fr;
  }

  .gm-steps figure {
    height: 190px;
  }
}

html[data-text="small"] {
  font-size: 15px;
}

html[data-text="large"] {
  font-size: 18px;
}

html[data-text="xlarge"] {
  font-size: 20px;
}

.set-card {
  margin-top: 1.15rem;
  padding: 1.2rem 1.15rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.set-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  color: var(--ink);
}

.set-card>p,
.set-note {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.pfp-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.8rem 0 1.1rem;
}

.pfp-btn {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.pfp-btn .me-avatar {
  width: 6.4rem;
  height: 6.4rem;
  font-size: 2rem;
}

.pfp-badge {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: #1e3a8a;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.pfp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.choice-row button {
  flex: 1 1 6rem;
  min-height: 2.7rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.choice-row button[aria-pressed="true"] {
  border-color: transparent;
  background: #1e3a8a;
  color: #fff;
}

html[data-theme="dark"] .choice-row button[aria-pressed="true"] {
  background: #60a5fa;
  color: #0b1530;
}

.set-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  font-weight: 700;
  color: var(--ink);
}

.set-field span {
  font-size: 0.92rem;
}

.track-list {
  display: grid;
  gap: 0.45rem;
}

.track-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
}

.track-row span {
  font-weight: 700;
  color: var(--ink);
}

.track-row small {
  display: block;
  font-weight: 500;
  color: var(--muted);
}

.track-row input {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: #1e3a8a;
}

#settingsPage .chip-pick button[aria-pressed="true"] {
  background: #1e3a8a;
  color: #fff;
  border-color: transparent;
}

html[data-theme="dark"] #settingsPage .chip-pick button[aria-pressed="true"] {
  background: #60a5fa;
  color: #0b1530;
}

/* Phone and tablet */
@media (max-width: 1100px) {
  body.gm-home .gm-nav {
    flex-wrap: wrap;
    row-gap: 0.4rem;
  }

  body.gm-home .gm-links {
    display: flex;
    order: 5;
    flex: 1 0 100%;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 0.15rem;
    padding-bottom: 0.1rem;
  }

  body.gm-home .gm-links .nav-link {
    flex: none;
    white-space: nowrap;
  }

  body.gm-home .gm-nav-end {
    margin-left: auto;
    clip-path: none;
    border-radius: 999px;
    padding: 0.25rem;
    flex: none;
  }

  body.gm-home .site-logo.logo-sm img {
    height: 40px;
  }

  .gm-hero {
    min-height: 64vh;
    padding: 2.6rem var(--edge) 2.8rem;
  }

  .gm-about,
  .gm-caps,
  .gm-conditions,
  .gm-faq {
    padding: 2.8rem var(--edge);
  }

  .gm-about img {
    height: 280px;
  }

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

  .gm-footer {
    grid-template-columns: 1fr 1fr;
  }

  .gm-steps-inner {
    padding: 2.8rem var(--edge);
  }

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

  .login-shell,
  .auth-shell {
    width: min(560px, calc(100% - 1.5rem));
  }
}

@media (max-width: 700px) {
  .gm-top {
    font-size: 0.72rem;
    gap: 0.35rem 0.8rem;
  }

  .gm-top-right span {
    display: none;
  }

  body.gm-home .site-logo.logo-sm img {
    height: 34px;
  }

  body.gm-home .gm-nav {
    gap: 0.35rem;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
  }

  body.gm-home .lang-select {
    height: 2.05rem;
    padding-left: 0.4rem;
  }

  body.gm-home .lang-select select {
    max-width: 4.4rem;
    font-size: 0.78rem;
    padding-right: 0.8rem;
  }

  body.gm-home .gm-theme {
    padding: 0.42rem 0.55rem;
    font-size: 0.75rem;
  }

  body.gm-home .gm-start,
  body.gm-home .gm-login {
    padding: 0.42rem 0.7rem;
    font-size: 0.8rem;
  }

  .gm-hero {
    min-height: 0;
    padding: 1.6rem var(--edge) 1.8rem;
  }

  .gm-hero h1 {
    font-size: 1.85rem;
  }

  .gm-hero-copy>p,
  .gm-hero article>p:last-child {
    font-size: 0.98rem;
  }

  .gm-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .gm-hero-actions .gm-btn {
    justify-content: center;
  }

  .gm-about,
  .gm-cap-grid,
  .gm-footer {
    grid-template-columns: 1fr;
  }

  .gm-about img {
    height: 200px;
  }

  .gm-cap-grid article {
    min-height: 0;
  }

  .gm-cta {
    padding: 1.8rem var(--edge);
  }

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

  .site-nav {
    gap: 0.45rem;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }

  .site-logo.logo-sm img {
    height: 38px;
  }

  .login-shell {
    padding-top: 1rem;
  }

  .login-card,
  .auth-form {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .login-card h1,
  .auth-title {
    font-size: 1.7rem;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .sheet-card,
  .onboard-card,
  .me-panel {
    max-width: 100%;
  }
}

/* Phone and tablet chat: keep the composer on screen, above the tab bar and the keyboard. */
@media (max-width: 1100px) {

  html:has(body.chat-body),
  body.chat-body {
    height: var(--vvh, 100svh);
    max-height: var(--vvh, 100svh);
    overflow: hidden;
  }

  body.chat-body {
    display: flex;
    flex-direction: column;
    padding-bottom: calc(4.8rem + env(safe-area-inset-bottom));
  }

  body.chat-body.kb-open {
    padding-bottom: env(safe-area-inset-bottom);
  }

  body.chat-body .site-header {
    flex: none;
  }

  body.chat-body .chat-page {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: auto;
    padding: 0;
  }

  body.chat-body .chat-app {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }

  body.chat-body .chat-panel {
    height: 100%;
    max-height: 100%;
    min-height: 0;
  }

  body.chat-body .chat-stream {
    -webkit-overflow-scrolling: touch;
  }

  body.chat-body.kb-open .tabbar {
    transform: translateY(110%);
    pointer-events: none;
  }

  .composer-icon,
  .composer-send {
    width: 2.75rem;
    height: 2.75rem;
  }
}

/* ==================================================================== */
/* Breadcrumbs (signed-in pages)                                        */
/* ==================================================================== */

body.has-crumbs {
  --crumbs-h: 3.5rem;
}

.crumbs-bar {
  position: relative;
  z-index: 5;
  padding: 0.85rem var(--edge) 0;
}

.crumbs-list {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: -0.45rem -0.35rem;
  padding: 0.45rem 0.35rem;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.crumbs-list::-webkit-scrollbar {
  display: none;
}

.crumbs-list>li {
  flex: none;
  display: flex;
  align-items: center;
}

.crumb {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  height: 2.65rem;
  padding: 0 1.15rem 0 1rem;
  border-radius: 999px;
  border: 1px solid #dbe5f5;
  background: #fff;
  color: #1e2a4a;
  font-size: 0.93rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 16px -10px rgba(30, 58, 138, 0.22);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, border-color 0.25s ease,
    background 0.25s ease, color 0.2s ease;
}

.crumb svg {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
  fill: none;
  stroke: #2f80ed;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), stroke 0.2s ease;
}

.crumb.is-root {
  color: #1e3a8a;
}

.crumb::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 30%, rgba(47, 128, 237, 0.14) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
}

body .crumbs a.crumb:hover,
body .crumbs a.crumb:focus-visible {
  transform: translateY(-2px);
  border-color: #9cbcf0;
  background: #f7faff;
  color: #1e3a8a;
  box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.1), 0 12px 24px -12px rgba(30, 58, 138, 0.45);
  outline: none;
}

.crumbs a.crumb:hover::after {
  transform: translateX(120%);
}

.crumbs a.crumb:hover svg {
  transform: scale(1.15) rotate(-6deg);
}

.crumbs a.crumb:active {
  transform: translateY(0) scale(0.97);
}

.crumb.is-current {
  border-color: #b7cdf3;
  background: linear-gradient(135deg, #f1f6ff 0%, #dfeaff 100%);
  color: #1e3a8a;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 0 4px rgba(47, 128, 237, 0.08),
    0 10px 22px -12px rgba(47, 128, 237, 0.55);
}

.crumb.is-current svg {
  stroke: #1e3a8a;
}

.crumb-sep svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: #2f80ed;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}

.crumbs-list.fade-l.fade-r {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 1.5rem, #000 calc(100% - 1.5rem), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 1.5rem, #000 calc(100% - 1.5rem), transparent);
}

.crumbs-list.fade-l:not(.fade-r) {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 1.5rem);
  mask-image: linear-gradient(90deg, transparent, #000 1.5rem);
}

.crumbs-list.fade-r:not(.fade-l) {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 1.5rem), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 1.5rem), transparent);
}

html[data-theme="dark"] .crumb {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(17, 27, 51, 0.88);
  color: #dbe7ff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 20px -12px rgba(0, 0, 0, 0.7);
}

html[data-theme="dark"] .crumb svg,
html[data-theme="dark"] .crumb-sep svg {
  stroke: #60a5fa;
}

html[data-theme="dark"] .crumb.is-root {
  color: #bfdbfe;
}

html[data-theme="dark"] body .crumbs a.crumb:hover,
html[data-theme="dark"] body .crumbs a.crumb:focus-visible {
  border-color: rgba(96, 165, 250, 0.55);
  background: rgba(25, 40, 74, 0.95);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.12), 0 0 24px rgba(96, 165, 250, 0.25);
}

html[data-theme="dark"] .crumb.is-current {
  border-color: rgba(96, 165, 250, 0.45);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.32), rgba(30, 58, 138, 0.42));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 4px rgba(96, 165, 250, 0.1),
    0 10px 26px -12px rgba(59, 130, 246, 0.7);
}

html[data-theme="dark"] .crumb.is-current svg {
  stroke: #93c5fd;
}

body.has-crumbs .page-shell {
  padding-top: 1.35rem;
}

body.chat-body .crumbs-bar {
  flex: none;
}

/* Desktop chat fills whatever height is left under the header and breadcrumbs. */
@media (min-width: 1101px) {

  html:has(body.chat-body),
  body.chat-body {
    height: 100dvh;
  }

  body.chat-body {
    display: flex;
    flex-direction: column;
  }

  body.chat-body .site-header {
    flex: none;
  }

  body.chat-body .chat-page {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  body.chat-body .chat-app {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
  }
}

/* Very short desktop windows: let the page scroll instead of squeezing the chat. */
@media (min-width: 1101px) and (max-height: 560px) {

  html:has(body.chat-body),
  body.chat-body {
    height: auto;
    overflow: auto;
  }

  body.chat-body .chat-page {
    flex: none;
  }

  body.chat-body .chat-app {
    flex: none;
    height: 460px;
  }
}

@media (max-width: 1100px) {
  body.chat-body .crumbs-bar {
    padding-bottom: 0.6rem;
  }

  body.chat-body.kb-open .crumbs-bar {
    display: none;
  }
}

@media (max-width: 700px) {
  body.has-crumbs {
    --crumbs-h: 3.1rem;
  }

  .crumbs-bar {
    padding-top: 0.7rem;
  }

  .crumbs-list {
    gap: 0.35rem;
  }

  .crumb {
    height: 2.35rem;
    padding: 0 0.85rem 0 0.75rem;
    gap: 0.4rem;
    font-size: 0.84rem;
  }

  .crumb svg {
    width: 1rem;
    height: 1rem;
  }

  .crumb-sep svg {
    width: 0.85rem;
    height: 0.85rem;
  }
}

@media print {
  .crumbs-bar {
    display: none !important;
  }
}

/* ==================================================================== */
/* Sign-up page (auth.html)                                             */
/* ==================================================================== */

body.ax-page {
  --ax-ink: #0b1430;
  --ax-muted: #64748b;
  --ax-line: #e2e8f0;
  --ax-field: #e8f0fe;
  --ax-field-line: #c9d8f4;
  --ax-card: rgba(255, 255, 255, 0.86);
  --ax-accent: #2563eb;
  min-height: 100dvh;
  margin: 0;
  background: #f3f6fc;
  color: var(--ax-ink);
  font-family: "Plus Jakarta Sans", "Outfit", system-ui, sans-serif;
  overflow-x: hidden;
}

html[data-theme="dark"] body.ax-page {
  --ax-ink: #f1f5ff;
  --ax-muted: #94a3b8;
  --ax-line: rgba(148, 163, 184, 0.16);
  --ax-field: rgba(30, 41, 70, 0.72);
  --ax-field-line: rgba(148, 163, 184, 0.2);
  --ax-card: rgba(12, 20, 40, 0.78);
  --ax-accent: #60a5fa;
  background: #060c1a;
}

.ax-page h1,
.ax-page h2 {
  font-family: inherit;
}

/* Ambient backdrop */
.ax-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ax-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(30, 58, 138, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 58, 138, 0.055) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 60% 40%, #000 30%, transparent 85%);
  mask-image: radial-gradient(ellipse 75% 70% at 60% 40%, #000 30%, transparent 85%);
}

html[data-theme="dark"] .ax-grid {
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
}

.ax-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: ax-drift 18s ease-in-out infinite alternate;
}

.ax-blob-a {
  width: 34rem;
  height: 34rem;
  top: -10rem;
  right: -8rem;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.45), transparent 65%);
}

.ax-blob-b {
  width: 26rem;
  height: 26rem;
  bottom: -9rem;
  right: 18%;
  background: radial-gradient(circle, rgba(56, 179, 90, 0.32), transparent 65%);
  animation-duration: 22s;
  animation-delay: -6s;
}

.ax-blob-c {
  width: 22rem;
  height: 22rem;
  top: 30%;
  left: -8rem;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.26), transparent 65%);
  animation-duration: 26s;
  animation-delay: -12s;
}

html[data-theme="dark"] .ax-blob {
  opacity: 0.7;
}

/* Layout */
.ax-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100dvh;
}

.ax-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  padding: 1.25rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
}

.ax-topline {
  width: min(100%, 31rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ax-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 2.6rem;
  padding: 0 1rem 0 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--ax-line);
  background: color-mix(in srgb, var(--ax-card) 90%, transparent);
  backdrop-filter: blur(12px);
  color: var(--ax-ink);
  font-size: 0.88rem;
  font-weight: 700;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.ax-back svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
  transition: transform 0.25s ease;
}

.ax-page .ax-back:hover {
  transform: translateY(-1px);
  border-color: #9cbcf0;
  box-shadow: 0 10px 24px -14px rgba(37, 99, 235, 0.6);
}

.ax-page .ax-back:hover svg {
  transform: translateX(-3px);
}

.ax-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ax-tools .lang-select {
  height: 2.75rem;
  padding: 0 0.45rem 0 0.9rem;
  border: 1px solid var(--ax-line);
  background: color-mix(in srgb, var(--ax-card) 90%, transparent);
  backdrop-filter: blur(12px);
  color: #1e3a8a;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.ax-page .ax-tools .lang-select:hover,
.ax-page .ax-tools .lang-select:focus-within {
  transform: translateY(-1px);
  border-color: #9cbcf0;
  box-shadow: 0 0 0 5px rgba(47, 128, 237, 0.1), 0 12px 24px -12px rgba(37, 99, 235, 0.55);
}

html[data-theme="dark"] .ax-tools .lang-select {
  color: #bfdbfe;
}

.ax-page .ax-tools .lang-select select {
  color: inherit;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  background-color: transparent;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 9px) 55%, calc(100% - 5px) 55%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

.ax-theme {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--ax-line);
  background: color-mix(in srgb, var(--ax-card) 90%, transparent);
  backdrop-filter: blur(12px);
  color: #1e3a8a;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.ax-theme svg {
  grid-area: 1 / 1;
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.ax-icon-sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

html[data-theme="dark"] .ax-theme {
  color: #fcd34d;
}

html[data-theme="dark"] .ax-icon-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

html[data-theme="dark"] .ax-icon-sun {
  opacity: 1;
  transform: none;
}

.ax-page .ax-theme:hover {
  transform: rotate(14deg) scale(1.06);
  border-color: #9cbcf0;
  box-shadow: 0 0 0 5px rgba(47, 128, 237, 0.1), 0 12px 24px -12px rgba(37, 99, 235, 0.55);
}

/* Card */
.ax-card {
  --mx: 50%;
  --my: 0%;
  position: relative;
  width: min(100%, 31rem);
  padding: 2.4rem 2.5rem 2rem;
  border-radius: 1.9rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: var(--ax-card);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 2px 6px rgba(15, 23, 42, 0.04),
    0 40px 80px -40px rgba(30, 58, 138, 0.45);
  text-align: center;
  isolation: isolate;
}

html[data-theme="dark"] .ax-card {
  border-color: rgba(148, 163, 184, 0.14);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 40px 90px -40px rgba(0, 0, 0, 0.9);
}

.ax-card::before,
.ax-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.ax-card::before {
  z-index: -1;
  background: radial-gradient(28rem circle at var(--mx) var(--my), rgba(59, 130, 246, 0.09), transparent 45%);
}

.ax-card::after {
  padding: 1px;
  background: radial-gradient(18rem circle at var(--mx) var(--my), rgba(59, 130, 246, 0.75), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

.ax-card:hover::before,
.ax-card:hover::after {
  opacity: 1;
}

.ax-logo-tile {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 13rem;
  height: 5.6rem;
  margin: 0 auto 1.4rem;
  border-radius: 1.4rem;
  border: 1px solid #e6eaf2;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 45%, #fff7e8 100%);
  box-shadow: 0 1px 0 #fff inset, 0 22px 40px -22px rgba(30, 58, 138, 0.45);
  animation: ax-rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) backwards, ax-bob 6s ease-in-out 1s infinite;
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

.ax-logo-tile::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.85) 50%, transparent 65%);
  background-size: 250% 100%;
  background-position: 120% 0;
  pointer-events: none;
  transition: background-position 0.9s ease;
}

.ax-page .ax-logo-tile:hover {
  border-color: #bcd2f6;
  box-shadow: 0 0 0 6px rgba(47, 128, 237, 0.08), 0 26px 48px -22px rgba(37, 99, 235, 0.6);
}

.ax-logo-tile:hover::after {
  background-position: -20% 0;
}

.ax-logo-tile img {
  width: 76%;
  height: auto;
  object-fit: contain;
}

.ax-logo-dark {
  display: none;
}

html[data-theme="dark"] .ax-logo-tile {
  border-color: rgba(148, 163, 184, 0.18);
  background: linear-gradient(135deg, #0f1a33 0%, #13213f 55%, #1d2238 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 22px 44px -22px rgba(0, 0, 0, 0.9);
}

html[data-theme="dark"] .ax-logo-tile::after {
  background-image: linear-gradient(115deg, transparent 35%, rgba(147, 197, 253, 0.25) 50%, transparent 65%);
}

html[data-theme="dark"] .ax-logo-light {
  display: none;
}

html[data-theme="dark"] .ax-logo-dark {
  display: block;
}

.ax-title {
  margin: 0;
  color: var(--ax-ink);
  font-size: clamp(1.85rem, 4.6vw, 2.3rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.035em;
  animation: ax-rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.06s backwards;
}

.ax-subtitle {
  margin: 0.7rem auto 0;
  max-width: 24rem;
  color: var(--ax-muted);
  font-size: 0.98rem;
  line-height: 1.55;
  animation: ax-rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.12s backwards;
}

/* Form */
.ax-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
  margin-top: 1.7rem;
  text-align: left;
}

.ax-form>* {
  animation: ax-rise 0.75s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.ax-form>*:nth-child(1) { animation-delay: 0.16s; }
.ax-form>*:nth-child(3) { animation-delay: 0.21s; }
.ax-form>*:nth-child(4) { animation-delay: 0.26s; }
.ax-form>*:nth-child(5) { animation-delay: 0.31s; }
.ax-form>*:nth-child(6) { animation-delay: 0.36s; }
.ax-form>*:nth-child(n+7) { animation-delay: 0.41s; }

.ax-name-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.ax-control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 3.6rem;
  padding: 0 0.55rem 0 1.15rem;
  border-radius: 1rem;
  border: 1px solid var(--ax-field-line);
  background: var(--ax-field);
  cursor: text;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.ax-control-icon {
  width: 1.3rem;
  height: 1.3rem;
  flex: none;
  fill: none;
  stroke: #64748b;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ax-page .ax-control .ax-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent !important;
  color: var(--ax-ink) !important;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: none;
}

.ax-input::placeholder {
  color: #7b8aa3;
  font-weight: 500;
}

.ax-input:-webkit-autofill,
.ax-input:-webkit-autofill:hover,
.ax-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ax-ink);
  transition: background-color 9999s ease-out 0s;
}

.ax-control:hover {
  border-color: #9fbcee;
  background: color-mix(in srgb, var(--ax-field) 70%, #fff);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -16px rgba(37, 99, 235, 0.55);
}

.ax-control:hover .ax-control-icon {
  stroke: #3b6fd8;
}

.ax-control:focus-within {
  border-color: #3b82f6;
  background: #fff;
  transform: none;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.16), 0 12px 26px -18px rgba(37, 99, 235, 0.7);
}

.ax-control:focus-within .ax-control-icon {
  stroke: #2563eb;
  transform: scale(1.1);
}

html[data-theme="dark"] .ax-control:hover {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(36, 50, 84, 0.8);
}

html[data-theme="dark"] .ax-control:focus-within {
  border-color: #60a5fa;
  background: rgba(15, 25, 50, 0.95);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18), 0 0 28px rgba(96, 165, 250, 0.18);
}

html[data-theme="dark"] .ax-control-icon {
  stroke: #94a3b8;
}

html[data-theme="dark"] .ax-control:hover .ax-control-icon,
html[data-theme="dark"] .ax-control:focus-within .ax-control-icon {
  stroke: #93c5fd;
}

.ax-eye {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.8rem;
  border: 0;
  background: rgba(255, 255, 255, 0.7);
  color: #64748b;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.ax-eye svg {
  grid-area: 1 / 1;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.2s ease, transform 0.3s ease;
}

.ax-eye-shut,
.ax-eye.is-on .ax-eye-open {
  opacity: 0;
  transform: scale(0.6);
}

.ax-eye.is-on .ax-eye-shut {
  opacity: 1;
  transform: none;
}

.ax-page .ax-eye:hover {
  background: #fff;
  color: #2563eb;
  transform: scale(1.06);
  box-shadow: 0 6px 16px -8px rgba(37, 99, 235, 0.55);
}

html[data-theme="dark"] .ax-eye {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
}

html[data-theme="dark"] .ax-page .ax-eye:hover,
html[data-theme="dark"] body.ax-page .ax-eye:hover {
  background: rgba(96, 165, 250, 0.16);
  color: #bfdbfe;
}

/* Password strength */
.ax-meter {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: -0.2rem;
  padding: 0 0.2rem;
}

.ax-meter-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
}

.ax-meter-bars i {
  height: 0.3rem;
  border-radius: 999px;
  background: #e2e8f0;
  transition: background 0.35s ease, transform 0.35s ease;
}

html[data-theme="dark"] .ax-meter-bars i {
  background: rgba(148, 163, 184, 0.18);
}

.ax-meter[data-level="1"] i:nth-child(-n+1) { background: #ef4444; }
.ax-meter[data-level="2"] i:nth-child(-n+2) { background: #f59e0b; }
.ax-meter[data-level="3"] i:nth-child(-n+3) { background: #3b82f6; }
.ax-meter[data-level="4"] i { background: linear-gradient(90deg, #22c55e, #10b981); }

.ax-meter-label {
  color: var(--ax-muted);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.ax-meter[data-level="1"] .ax-meter-label { color: #dc2626; }
.ax-meter[data-level="2"] .ax-meter-label { color: #d97706; }
.ax-meter[data-level="3"] .ax-meter-label { color: #2563eb; }
.ax-meter[data-level="4"] .ax-meter-label { color: #059669; }

.ax-rules {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ax-rules li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.6rem 0.22rem 0.45rem;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.08);
  color: var(--ax-muted);
  font-size: 0.74rem;
  font-weight: 600;
  transition: background 0.3s ease, color 0.3s ease;
}

.ax-rules li::before {
  content: "";
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  opacity: 0.6;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ax-rules li.is-met {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.ax-rules li.is-met::before {
  opacity: 1;
  border-color: #10b981;
  background: #10b981 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 70% no-repeat;
}

html[data-theme="dark"] .ax-rules li.is-met {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
}

/* Consent */
.ax-consent {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 0.15rem;
  padding: 0.85rem 0.95rem;
  border-radius: 1rem;
  border: 1px dashed var(--ax-field-line);
  color: var(--ax-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.ax-consent:hover {
  border-color: #9fbcee;
  background: rgba(59, 130, 246, 0.04);
}

.ax-consent input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.ax-check {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.05rem;
  border-radius: 0.45rem;
  border: 1.5px solid #a9bcda;
  background: #fff;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s ease;
}

.ax-check svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  transition: stroke-dashoffset 0.3s ease 0.05s;
}

.ax-consent:hover .ax-check {
  border-color: #3b82f6;
}

.ax-consent input:focus-visible+.ax-check {
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25);
}

.ax-consent input:checked+.ax-check {
  border-color: transparent;
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  transform: scale(1.06);
}

.ax-consent input:checked+.ax-check svg {
  stroke-dashoffset: 0;
}

html[data-theme="dark"] .ax-check {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.6);
}

.ax-consent a,
.ax-switch a {
  position: relative;
  color: var(--ax-accent);
  font-weight: 700;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.3s ease, color 0.2s ease;
}

.ax-page .ax-consent a:hover,
.ax-page .ax-switch a:hover,
.ax-page .ax-footer a:hover {
  background-size: 100% 1.5px;
  box-shadow: none;
  text-shadow: none;
}

.ax-alert {
  min-height: 0;
  margin: 0;
  color: #dc2626;
  font-size: 0.86rem;
  font-weight: 600;
}

.ax-alert:not(:empty) {
  padding: 0.65rem 0.85rem;
  border-radius: 0.8rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.22);
  animation: ax-shake 0.4s ease;
}

html[data-theme="dark"] .ax-alert {
  color: #fca5a5;
}

/* Primary button */
.ax-submit {
  --bx: 50%;
  --by: 50%;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  height: 3.65rem;
  margin-top: 0.2rem;
  border: 0;
  border-radius: 1rem;
  background: linear-gradient(100deg, #1e3a8a 0%, #2152c9 50%, #3b82f6 100%);
  background-size: 160% 100%;
  background-position: 0% 0;
  color: #fff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 18px 32px -16px rgba(37, 99, 235, 0.75);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, background-position 0.5s ease;
}

.ax-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(9rem circle at var(--bx) var(--by), rgba(255, 255, 255, 0.28), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ax-submit::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  transform: skewX(-20deg);
  transition: left 0.75s ease;
}

.ax-submit svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ax-page .ax-submit:hover,
.ax-page .ax-submit:focus-visible {
  transform: translateY(-2px);
  background-position: 100% 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 0 0 5px rgba(59, 130, 246, 0.16),
    0 24px 40px -16px rgba(37, 99, 235, 0.85);
  outline: none;
}

.ax-submit:hover::before {
  opacity: 1;
}

.ax-submit:hover::after {
  left: 130%;
}

.ax-submit:hover svg {
  transform: translateX(5px);
}

.ax-page .ax-submit:active {
  transform: translateY(0) scale(0.985);
}

/* Divider + social */
.ax-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0 0.9rem;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.ax-divider::before,
.ax-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ax-line), transparent);
}

.ax-continue {
  margin: 0 0 0.75rem;
  color: var(--ax-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.ax-social {
  --bx: 50%;
  --by: 50%;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: 100%;
  height: 3.4rem;
  border-radius: 1rem;
  border: 1px solid var(--ax-line);
  background: #fff;
  color: var(--ax-ink);
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.ax-social::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(10rem circle at var(--bx) var(--by), rgba(59, 130, 246, 0.1), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ax-social svg {
  width: 1.35rem;
  height: 1.35rem;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ax-page .ax-social:hover {
  transform: translateY(-2px);
  border-color: #b7cdf3;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08), 0 16px 30px -18px rgba(30, 58, 138, 0.55);
}

.ax-social:hover::before {
  opacity: 1;
}

.ax-social:hover svg {
  transform: rotate(-12deg) scale(1.12);
}

.ax-social:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

html[data-theme="dark"] .ax-social {
  background: rgba(15, 23, 42, 0.7);
}

html[data-theme="dark"] body.ax-page .ax-social:hover {
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.1), 0 0 26px rgba(96, 165, 250, 0.2);
}

.ax-status {
  min-height: 0;
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
}

.ax-status.auth-error {
  color: #dc2626;
}

.ax-status.login-info {
  color: var(--ax-accent);
}

.ax-switch {
  margin: 1.2rem 0 0;
  color: var(--ax-muted);
  font-size: 0.92rem;
}

.ax-footer {
  width: min(100%, 31rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  color: var(--ax-muted);
  font-size: 0.78rem;
}

.ax-footer p {
  margin: 0;
}

.ax-footer nav {
  display: flex;
  gap: 1rem;
}

.ax-footer a {
  color: var(--ax-muted);
  font-weight: 700;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.3s ease, color 0.2s ease;
}

.ax-page .ax-footer a:hover {
  color: var(--ax-accent);
}

/* Showcase panel (wide screens) */
.ax-showcase {
  display: none;
}

@media (min-width: 1080px) {
  .ax-shell {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  }

  .ax-stage {
    justify-content: center;
    padding: 2rem 2.5rem;
  }

  .ax-showcase {
    position: sticky;
    top: 1rem;
    display: block;
    height: calc(100dvh - 2rem);
    min-height: 40rem;
    margin: 1rem 0 1rem 1rem;
    border-radius: 2rem;
    overflow: hidden;
    color: #e6eeff;
    background:
      radial-gradient(40rem 26rem at 85% 5%, rgba(59, 130, 246, 0.45), transparent 60%),
      radial-gradient(30rem 22rem at 0% 100%, rgba(56, 179, 90, 0.28), transparent 60%),
      linear-gradient(155deg, #07122e 0%, #0d1f4d 48%, #1a3a8f 100%);
    box-shadow: 0 40px 80px -40px rgba(7, 18, 46, 0.8);
    isolation: isolate;
  }

  html[data-theme="dark"] .ax-showcase {
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.14), 0 40px 80px -40px rgba(0, 0, 0, 0.9);
  }

  .ax-showcase::before {
    content: "";
    position: absolute;
    inset: -40%;
    z-index: -1;
    background: conic-gradient(from 0deg, transparent 0 70%, rgba(96, 165, 250, 0.25) 80%, rgba(134, 239, 172, 0.2) 88%, transparent 100%);
    filter: blur(50px);
    animation: ax-spin 22s linear infinite;
  }

  .ax-showcase::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
      linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    -webkit-mask-image: linear-gradient(180deg, #000, transparent 75%);
    mask-image: linear-gradient(180deg, #000, transparent 75%);
  }
}

.ax-showcase-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 2.4rem 2.8rem;
}

.ax-showcase-logo {
  align-self: flex-start;
  line-height: 0;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.ax-showcase-logo img {
  height: 3rem;
  width: auto;
}

.ax-page .ax-showcase-logo:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 8px 20px rgba(96, 165, 250, 0.5));
  box-shadow: none;
}

.ax-kicker {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: auto;
  padding: 0.45rem 0.9rem 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.ax-kicker i {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: ax-ping 2s ease-out infinite;
}

.ax-showcase-title {
  margin: 1.1rem 0 0;
  max-width: 30rem;
  color: #fff;
  font-size: clamp(2.1rem, 3.1vw, 3rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.ax-showcase-title em {
  font-style: normal;
  background: linear-gradient(90deg, #93c5fd, #86efac);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ax-showcase-text {
  margin: 1rem 0 0;
  max-width: 28rem;
  color: rgba(226, 236, 255, 0.72);
  font-size: 1rem;
  line-height: 1.6;
}

.ax-float-stack {
  position: relative;
  height: 15.5rem;
  margin: 2rem 0 1.8rem;
}

.ax-glass {
  --px: 0px;
  --py: 0px;
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1.1rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 24px 40px -20px rgba(0, 0, 0, 0.6);
  translate: var(--px) var(--py);
  transition: translate 0.4s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease, background 0.3s ease,
    box-shadow 0.3s ease;
  animation: ax-bob 7s ease-in-out infinite;
}

.ax-glass:hover {
  border-color: rgba(147, 197, 253, 0.5);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.16) inset, 0 0 0 6px rgba(96, 165, 250, 0.1),
    0 30px 50px -20px rgba(0, 0, 0, 0.7);
}

.ax-glass small {
  display: block;
  color: rgba(226, 236, 255, 0.65);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ax-glass strong {
  display: block;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.ax-glass strong b {
  color: rgba(226, 236, 255, 0.6);
  font-size: 0.75rem;
  font-weight: 600;
}

.ax-glass-main {
  top: 0;
  left: 0;
  width: min(100%, 22rem);
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
  padding: 1.1rem 1.2rem 0.9rem;
}

.ax-glass-main header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ax-glass-main strong {
  font-size: 1.7rem;
  line-height: 1.1;
}

.ax-glass-main strong span {
  color: rgba(226, 236, 255, 0.7);
  font-size: 1.15rem;
}

.ax-badge {
  margin-left: auto;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(74, 222, 128, 0.16);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: #86efac;
  font-size: 0.72rem;
  font-weight: 800;
}

.ax-glass-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.85rem;
}

.ax-glass-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.ax-glass-icon.tone-rose {
  background: rgba(251, 113, 133, 0.18);
  color: #fda4af;
}

.ax-glass-icon.tone-violet {
  background: rgba(167, 139, 250, 0.2);
  color: #c4b5fd;
}

.ax-pulse {
  width: 100%;
  height: 3rem;
}

.ax-pulse path {
  fill: none;
  stroke: #60a5fa;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 520;
  stroke-dashoffset: 520;
  filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.8));
  animation: ax-draw 3.2s ease-in-out infinite;
}

.ax-chip-a {
  top: 6.4rem;
  right: 0;
  animation-delay: -2s;
}

.ax-chip-b {
  bottom: 0;
  left: 18%;
  animation-delay: -4s;
}

.ax-ring {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: conic-gradient(#86efac calc(var(--p) * 1%), rgba(255, 255, 255, 0.14) 0);
  -webkit-mask: radial-gradient(circle, transparent 54%, #000 56%);
  mask: radial-gradient(circle, transparent 54%, #000 56%);
}

.ax-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ax-trust li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(226, 236, 255, 0.85);
  font-size: 0.8rem;
  font-weight: 700;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.ax-trust li:hover {
  transform: translateY(-2px);
  border-color: rgba(147, 197, 253, 0.45);
  background: rgba(255, 255, 255, 0.1);
}

.ax-trust svg {
  width: 1rem;
  height: 1rem;
  fill: #93c5fd;
}

/* Small screens */
@media (max-width: 560px) {
  .ax-stage {
    padding: 0.85rem 0.85rem calc(1.25rem + env(safe-area-inset-bottom));
  }

  .ax-card {
    padding: 1.9rem 1.25rem 1.6rem;
    border-radius: 1.6rem;
  }

  .ax-logo-tile {
    width: 11rem;
    height: 4.8rem;
    margin-bottom: 1.15rem;
  }

  .ax-control {
    height: 3.4rem;
    padding-left: 0.95rem;
  }

  .ax-footer {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 380px) {
  .ax-name-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

html.ht-waiting .ax-page *,
html.ht-waiting .ax-page *::before,
html.ht-waiting .ax-page *::after {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {

  .ax-page *,
  .ax-page *::before,
  .ax-page *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }

  .ax-pulse path {
    stroke-dashoffset: 0;
  }
}

@keyframes ax-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes ax-bob {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes ax-drift {
  from {
    transform: translate(0, 0) scale(1);
  }

  to {
    transform: translate(-3rem, 2.5rem) scale(1.12);
  }
}

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

@keyframes ax-draw {
  0% {
    stroke-dashoffset: 520;
  }

  55%,
  75% {
    stroke-dashoffset: 0;
  }

  100% {
    stroke-dashoffset: -520;
  }
}

@keyframes ax-ping {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  }

  100% {
    box-shadow: 0 0 0 10px rgba(74, 222, 128, 0);
  }
}

@keyframes ax-shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

/* ==================================================================== */
/* Premium dashboard (dashboard.html)                                   */
/* ==================================================================== */

.home-body {
  --dx-line: #e4ebf5;
  --dx-track: #edf2f9;
  --dx-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 36px -22px rgba(15, 23, 42, 0.22);
  --dx-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dx-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html[data-theme="dark"] .home-body {
  --dx-line: #1f2d4d;
  --dx-track: #1a2747;
  --dx-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 22px 44px -24px rgba(0, 0, 0, 0.85);
}

.home-body .tone-red {
  --tone: #e5484d;
  --tone-hi: #ff9a8b;
  --tone-deep: #b4232a;
}

.home-body .tone-rose {
  --tone: #e0367f;
  --tone-hi: #ff8cc0;
  --tone-deep: #9d174d;
}

.home-body .tone-leaf {
  --tone: #22a55a;
  --tone-hi: #74e7a3;
  --tone-deep: #13753c;
}

.home-body .tone-blue {
  --tone: #2f7bf0;
  --tone-hi: #82c4ff;
  --tone-deep: #1a47c4;
}

.home-body .tone-amber {
  --tone: #ef8a0c;
  --tone-hi: #ffd166;
  --tone-deep: #b45309;
}

.home-body .tone-violet {
  --tone: #7c4dff;
  --tone-hi: #c4a8ff;
  --tone-deep: #5222c9;
}

.home-body .tone-teal {
  --tone: #0ea597;
  --tone-hi: #6ff0dc;
  --tone-deep: #0b7369;
}

/* Glossy "3D" icon chip */
.home-body .dx-ico {
  --s: 3rem;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: var(--s);
  height: var(--s);
  margin: 0;
  border-radius: calc(var(--s) * 0.34);
  color: #fff;
  background:
    radial-gradient(120% 85% at 28% 8%, rgba(255, 255, 255, 0.55), transparent 48%),
    linear-gradient(150deg, var(--tone-hi) 0%, var(--tone) 52%, var(--tone-deep) 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.65),
    inset 0 -5px 10px color-mix(in srgb, var(--tone-deep) 50%, transparent),
    0 12px 22px -10px color-mix(in srgb, var(--tone) 85%, transparent),
    0 2px 5px color-mix(in srgb, var(--tone-deep) 22%, transparent);
  overflow: hidden;
  transition: transform 0.5s var(--dx-spring), box-shadow 0.35s ease;
}

.home-body .dx-ico::after {
  content: "";
  position: absolute;
  inset: -40%;
  z-index: 2;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.6) 50%, transparent 62%);
  transform: translateX(-120%);
  transition: transform 0.8s ease;
  pointer-events: none;
}

.home-body .dx-ico svg {
  position: relative;
  z-index: 1;
  width: 56%;
  height: 56%;
  fill: currentColor;
  overflow: visible;
  filter: drop-shadow(0 2px 2px color-mix(in srgb, var(--tone-deep) 50%, transparent));
}

.home-body .dx-ico .ico-back {
  opacity: 0.5;
}

.home-body .dx-ico .ico-cut {
  fill: var(--tone-deep);
}

.home-body .dx-ico .ico-cut-line,
.home-body .dx-ico .ico-line,
.home-body .dx-ico .ico-vein,
.home-body .dx-ico .ico-tick {
  fill: none;
  stroke: var(--tone-deep);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-body .dx-ico .ico-tick {
  stroke-width: 2.4;
}

.home-body .dx-ico .ico-stroke,
.home-body .dx-ico .ico-frame {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-body .dx-ico .ico-back.ico-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.home-body .dx-ico .ico-scan {
  fill: #fff;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.9));
}

.home-body .dx-ico .ico-ecg,
.home-body .dx-ico .ico-tick {
  stroke-dasharray: 60;
  stroke-dashoffset: 0;
}

.home-body .dx-ico-sm {
  --s: 2.45rem;
}

[data-dx-glow]:hover .dx-ico,
.home-body .help-card summary:hover .dx-ico {
  transform: translateY(-2px) rotate(-8deg) scale(1.08);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.65),
    inset 0 -5px 10px color-mix(in srgb, var(--tone-deep) 50%, transparent),
    0 18px 28px -10px color-mix(in srgb, var(--tone) 95%, transparent),
    0 0 0 5px color-mix(in srgb, var(--tone) 14%, transparent);
}

[data-dx-glow]:hover .dx-ico::after,
.home-body .help-card summary:hover .dx-ico::after {
  transform: translateX(120%);
}

[data-dx-glow]:hover .dx-ico .ico-ecg,
[data-dx-glow]:hover .dx-ico .ico-tick {
  animation: dx-trace 0.9s ease forwards;
}

[data-dx-glow]:hover .dx-ico .ico-scan {
  animation: dx-scan 1.1s ease-in-out infinite alternate;
}

.home-body .tone-red .dx-ico svg,
[data-dx-glow].tone-red:hover .dx-ico svg {
  transform-origin: 50% 60%;
}

[data-dx-glow].tone-red:hover .dx-ico svg {
  animation: heart-beat 1.2s ease-in-out infinite;
}

[data-dx-glow].tone-leaf:hover .number-icon svg,
[data-dx-glow].tone-blue:hover .number-icon svg {
  animation: dx-bob 1.1s ease-in-out infinite;
}

/* Hero banner */
.home-body .dx-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  padding: clamp(1.5rem, 3.2vw, 2.4rem) clamp(1.3rem, 3.4vw, 2.6rem);
  border-radius: 1.9rem;
  color: #fff;
  background:
    radial-gradient(85% 120% at 0% 0%, rgba(96, 165, 250, 0.55), transparent 55%),
    radial-gradient(60% 90% at 100% 100%, rgba(56, 179, 90, 0.3), transparent 62%),
    linear-gradient(118deg, #1e3a8a 0%, #1d4ed8 46%, #2f80ed 100%);
  box-shadow: 0 34px 70px -34px rgba(30, 58, 138, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.home-body .dx-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1.3px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(100deg, transparent 25%, #000 75%);
  mask-image: linear-gradient(100deg, transparent 25%, #000 75%);
  pointer-events: none;
}

html[data-theme="dark"] .home-body .dx-hero {
  background:
    radial-gradient(85% 120% at 0% 0%, rgba(59, 130, 246, 0.45), transparent 55%),
    radial-gradient(60% 90% at 100% 100%, rgba(34, 197, 94, 0.18), transparent 62%),
    linear-gradient(118deg, #0f1f52 0%, #1a3aa8 50%, #2563eb 100%);
  box-shadow: 0 34px 70px -34px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.dx-hero-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.dx-orb {
  position: absolute;
  border-radius: 50%;
}

.dx-orb-a {
  top: -9rem;
  right: -6rem;
  width: 22rem;
  height: 22rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.03) 62%);
  animation: dx-float 9s ease-in-out infinite alternate;
}

.dx-orb-b {
  right: 18%;
  bottom: -7rem;
  width: 12rem;
  height: 12rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  animation: dx-float 11s ease-in-out -3s infinite alternate-reverse;
}

.dx-orb-c {
  top: -1.8rem;
  right: 36%;
  width: 5rem;
  height: 5rem;
  background: rgba(255, 255, 255, 0.09);
  animation: dx-float 7s ease-in-out -2s infinite alternate;
}

.dx-hero-ecg {
  position: absolute;
  left: 0;
  bottom: 8%;
  width: 100%;
  height: 5.5rem;
  opacity: 0.2;
}

.dx-hero-ecg path {
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 900;
  animation: ax-draw 7s ease-in-out infinite;
}

.dx-hero-main {
  position: relative;
  flex: 1 1 26rem;
  min-width: 0;
}

.dx-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.86);
}

.dx-live {
  display: inline-block;
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: ax-ping 1.8s ease-out infinite;
}

.dx-id {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.95rem;
}

.dx-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 3.7rem;
  height: 3.7rem;
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.08));
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 12px 26px -12px rgba(5, 15, 50, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.dx-id-text {
  min-width: 0;
}

.dx-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
}

.home-body .dx-hero h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3.2vw, 2.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff;
  overflow-wrap: anywhere;
}

.dx-role {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
}

.dx-role.level-normal {
  color: #052e16;
  border-color: transparent;
  background: linear-gradient(140deg, #bbf7d0, #4ade80);
  box-shadow: 0 6px 14px -8px rgba(34, 197, 94, 0.9);
}

.dx-role.level-watch {
  color: #451a03;
  border-color: transparent;
  background: linear-gradient(140deg, #fde68a, #f59e0b);
  box-shadow: 0 6px 14px -8px rgba(245, 158, 11, 0.9);
}

.home-body .dx-hero .home-status {
  margin: 0.4rem 0 0;
  max-width: 40rem;
  font-size: 0.98rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
}

.home-body .dx-hero .status-dot {
  margin-top: 0.4rem;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.25);
}

.home-body .dx-hero .status-dot.level-watch {
  background: #fbbf24;
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.28);
}

.dx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.15rem;
}

.dx-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.dx-chip svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.home-body .dx-chip .home-date {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: 0;
  text-transform: none;
  color: inherit;
}

.dx-hero-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
}

.dx-action {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1.15rem 0.55rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: transform 0.35s var(--dx-spring), box-shadow 0.3s ease, background 0.25s ease;
}

.dx-action.is-main {
  border-color: transparent;
  color: #1e3a8a;
  background: #fff;
  box-shadow: 0 14px 28px -12px rgba(5, 15, 50, 0.6);
}

.dx-action-ico {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  transition: transform 0.45s var(--dx-spring);
}

.dx-action.is-main .dx-action-ico {
  color: #fff;
  background: linear-gradient(140deg, #3b82f6, #1e3a8a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 6px 12px -4px rgba(29, 78, 216, 0.6);
}

.dx-action-ico svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.home-body .dx-hero .dx-action:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 18px 32px -14px rgba(5, 15, 50, 0.7), 0 0 0 4px rgba(255, 255, 255, 0.14);
}

body.home-body .dx-hero .dx-action.is-main:hover {
  background: #fff;
}

.dx-action:hover .dx-action-ico {
  transform: rotate(-12deg) scale(1.08);
}

.dx-action.is-main:hover .dx-action-ico {
  transform: rotate(90deg) scale(1.08);
}

.dx-action:active {
  transform: scale(0.97);
}

/* Quick action tiles */
.home-body .dx-quick {
  gap: 1rem;
  margin-top: 1.4rem;
}

.home-body .dx-quick .quick-tile {
  position: relative;
  isolation: isolate;
  flex-direction: row;
  align-items: center;
  gap: 0.95rem;
  padding: 1.05rem 1.1rem;
  border: 1px solid var(--dx-line);
  border-radius: 1.4rem;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--tone) 9%, transparent), transparent 60%),
    var(--surface);
  box-shadow: var(--dx-shadow);
  overflow: hidden;
  transition: transform 0.4s var(--dx-ease), box-shadow 0.35s ease, border-color 0.3s ease;
}

.home-body .dx-quick .quick-tile::before,
.home-body .dx-stat::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--tone) 16%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.home-body .dx-quick .quick-tile::after {
  content: "";
  position: absolute;
  left: 1.1rem;
  right: 1.1rem;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--tone-hi), var(--tone));
  transform: scaleX(0.18);
  transform-origin: left;
  opacity: 0.7;
  transition: transform 0.45s var(--dx-ease), opacity 0.3s ease;
}

body.home-body .dx-quick .quick-tile:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--tone) 38%, var(--dx-line));
  box-shadow: 0 26px 46px -24px color-mix(in srgb, var(--tone) 60%, transparent), 0 2px 6px rgba(15, 23, 42, 0.05);
}

body.home-body .dx-quick .quick-tile:hover::before,
body.home-body .dx-stat:hover::after {
  opacity: 1;
}

body.home-body .dx-quick .quick-tile:hover::after {
  transform: scaleX(1);
  opacity: 1;
}

body.home-body .dx-quick .quick-tile:active {
  transform: translateY(-2px) scale(0.98);
}

.dx-tile-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  gap: 0.1rem;
}

.home-body .dx-quick .quick-tile strong {
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.home-body .dx-quick .quick-tile small {
  font-size: 0.8rem;
  line-height: 1.35;
}

.dx-tile-go {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  align-self: flex-start;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  color: var(--muted);
  border: 1px solid var(--dx-line);
  background: var(--surface);
  transition: transform 0.45s var(--dx-spring), background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.dx-tile-go svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-tile:hover .dx-tile-go {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(140deg, var(--tone-hi), var(--tone));
  transform: rotate(45deg) scale(1.08);
}

/* Overview header */
.home-body .dx-overview {
  position: relative;
  overflow: hidden;
  align-items: flex-end;
  gap: 0.8rem 1rem;
  margin-bottom: 1.1rem;
  padding: 1.15rem 1.35rem 1.15rem 1.55rem;
  border: 1px solid var(--dx-line);
  border-radius: 1.4rem;
  background:
    radial-gradient(70% 160% at 100% 0%, color-mix(in srgb, var(--blue) 10%, transparent), transparent 70%),
    linear-gradient(135deg, color-mix(in srgb, var(--blue) 5%, var(--surface)), var(--surface));
}

.home-body .dx-overview::before {
  content: "";
  position: absolute;
  inset: 0.9rem auto 0.9rem 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #60a5fa, #1d4ed8);
}

.dx-eyebrow {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue);
}

.home-body .dx-overview h2 {
  margin: 0.15rem 0 0;
  font-size: 1.45rem;
  letter-spacing: -0.015em;
}

.dx-overview-sub {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.dx-meta-chip:not(:empty) {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--dx-line);
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
  box-shadow: 0 6px 14px -10px rgba(15, 23, 42, 0.3);
}

.dx-meta-chip:not(:empty)::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--leaf);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--leaf) 22%, transparent);
}

/* Stat cards */
.home-body .number-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
}

.home-body .dx-stat {
  isolation: isolate;
  display: flex;
  flex-direction: column;
  padding: 1.2rem 1.25rem 1.05rem 1.5rem;
  border: 1px solid var(--dx-line);
  border-radius: 1.4rem;
  background:
    radial-gradient(130% 100% at 100% 0%, color-mix(in srgb, var(--tone) 8%, transparent), transparent 55%),
    var(--surface);
  box-shadow: var(--dx-shadow);
  transition: transform 0.4s var(--dx-ease), box-shadow 0.35s ease, border-color 0.3s ease;
  animation: dx-rise 0.6s var(--dx-ease) backwards;
}

.home-body .dx-stat:nth-child(2) {
  animation-delay: 0.06s;
}

.home-body .dx-stat:nth-child(3) {
  animation-delay: 0.12s;
}

.home-body .dx-stat:nth-child(4) {
  animation-delay: 0.18s;
}

.home-body .dx-stat:nth-child(5) {
  animation-delay: 0.24s;
}

.home-body .dx-stat:nth-child(6) {
  animation-delay: 0.3s;
}

.home-body .dx-stat::before,
.home-body .dx-stat.level-watch::before,
.home-body .dx-stat.level-high::before,
.home-body .dx-stat.level-low::before {
  inset: 0 auto 0 0;
  width: 5px;
  height: auto;
  background: linear-gradient(180deg, var(--tone-hi), var(--tone) 55%, var(--tone-deep));
}

.home-body .dx-stat.level-watch {
  border-color: color-mix(in srgb, var(--amber) 32%, var(--dx-line));
  background:
    radial-gradient(130% 100% at 100% 0%, color-mix(in srgb, var(--amber) 13%, transparent), transparent 60%),
    linear-gradient(160deg, color-mix(in srgb, var(--amber-bg) 75%, var(--surface)), var(--surface) 70%);
}

body.home-body .dx-stat:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--tone) 38%, var(--dx-line));
  box-shadow: 0 30px 50px -26px color-mix(in srgb, var(--tone) 65%, transparent), 0 2px 6px rgba(15, 23, 42, 0.05);
}

.home-body .dx-stat .number-top {
  align-items: flex-start;
}

.home-body .dx-stat .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.3rem 0.68rem 0.3rem 0.55rem;
  font-size: 0.72rem;
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
}

.home-body .dx-stat .status-pill::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: currentColor;
}

.home-body .dx-stat .status-pill.level-watch::before,
.home-body .dx-stat .status-pill.level-high::before,
.home-body .dx-stat .status-pill.level-low::before {
  animation: dx-blink 1.6s ease-in-out infinite;
}

.home-body .dx-stat .number-label {
  margin-top: 1rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tone-deep);
}

html[data-theme="dark"] .home-body .dx-stat .number-label {
  color: var(--tone-hi);
}

.home-body .dx-stat .number-value {
  margin-top: 0.2rem;
  font-size: 2.15rem;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.home-body .dx-stat .number-value small {
  margin-left: 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0;
}

.home-body .dx-stat .number-note {
  margin-top: 0.3rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
}

.dx-stat-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.85rem;
}

.dx-stat-meta {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  min-width: 0;
}

.home-body .dx-stat .number-source {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.home-body .dx-stat .number-change {
  margin: 0;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  white-space: nowrap;
  background: var(--dx-track);
}

.dx-spark {
  flex: 1 1 4rem;
  min-width: 4rem;
  max-width: 6.6rem;
  height: auto;
  aspect-ratio: 120 / 34;
  overflow: visible;
}

.dx-spark stop {
  stop-color: var(--tone);
  stop-opacity: 0.32;
}

.dx-spark stop + stop {
  stop-opacity: 0;
}

.dx-spark-line {
  fill: none;
  stroke: var(--tone);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dx-spark 1.2s 0.35s var(--dx-ease) backwards;
}

.dx-spark-dot {
  fill: var(--surface);
  stroke: var(--tone);
  stroke-width: 2;
  transition: r 0.3s var(--dx-spring);
}

.dx-stat:hover .dx-spark-dot {
  r: 3.6;
  fill: var(--tone);
}

/* Health score */
.home-body .score-card {
  border-radius: 1.6rem;
  border-color: var(--dx-line);
  background:
    radial-gradient(60% 120% at 0% 0%, color-mix(in srgb, var(--leaf) 9%, transparent), transparent 60%),
    var(--surface);
  box-shadow: var(--dx-shadow);
}

body.home-body .score-card:hover {
  box-shadow: 0 30px 56px -30px rgba(30, 58, 138, 0.35);
}

.dx-score {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1.4rem 2rem;
}

@property --dx-pv {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.dx-ring {
  --dx-pv: var(--dx-p);
  position: relative;
  display: grid;
  place-items: center;
  width: 9rem;
  height: 9rem;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, var(--surface) 76%, transparent 77%),
    conic-gradient(from -90deg, #2f80ed, #38b35a calc(var(--dx-pv) * 1%), var(--dx-track) 0);
  box-shadow: 0 18px 36px -20px rgba(30, 58, 138, 0.45);
  animation: dx-ring 1.4s 0.2s var(--dx-ease) backwards;
}

.dx-ring::after {
  content: "";
  position: absolute;
  inset: 13%;
  border-radius: 50%;
  box-shadow: inset 0 3px 10px rgba(15, 23, 42, 0.08);
  pointer-events: none;
}

.dx-ring-val {
  display: grid;
  justify-items: center;
  line-height: 1.05;
}

.dx-ring-val strong {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.dx-ring-val em {
  font-size: 1.05rem;
  font-style: normal;
  font-weight: 700;
  color: var(--muted);
}

.dx-ring-val small {
  margin-top: 0.2rem;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.dx-score-body h2 {
  margin: 0.15rem 0 0;
  font-size: 1.45rem;
  letter-spacing: -0.015em;
}

.dx-score-body .score-count {
  margin: 0.25rem 0 0;
  font-size: 0.98rem;
  color: var(--muted);
}

.dx-week {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.1rem;
  margin: 0.95rem 0 0.2rem;
}

.dx-days {
  display: flex;
  gap: 0.42rem;
}

.dx-day {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  font-size: 0.66rem;
  font-weight: 800;
  color: var(--muted);
}

.dx-day i {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 0.6rem;
  background: var(--dx-track);
  transition: transform 0.4s var(--dx-spring);
}

.dx-day.is-on i {
  background:
    radial-gradient(120% 90% at 30% 10%, rgba(255, 255, 255, 0.5), transparent 50%),
    linear-gradient(150deg, #74e7a3, #22a55a 60%, #13753c);
  box-shadow: inset 0 -3px 6px rgba(19, 117, 60, 0.4), 0 8px 14px -8px rgba(34, 165, 90, 0.9);
}

.dx-day.is-on {
  color: var(--ink);
}

.dx-day:hover i {
  transform: translateY(-3px) scale(1.08);
}

.dx-week-label {
  font-size: 0.86rem;
  color: var(--muted);
}

.dx-week-label b {
  color: var(--ink);
}

.home-body .dx-score-body .score-trends {
  display: grid;
  gap: 0.5rem;
  margin: 0.9rem 0 0;
  padding: 0;
  border: 0;
  background: none;
  list-style: none;
}

.home-body .dx-score-body .score-trends li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.8rem;
  border-radius: 0.9rem;
  font-size: 0.9rem;
  border: 1px solid var(--dx-line);
  background: color-mix(in srgb, var(--dx-track) 55%, var(--surface));
}

.home-body .dx-score-body .score-trends li::before {
  content: "↘";
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(140deg, #60a5fa, #1d4ed8);
}

.home-body .dx-score-body .score-trends li.is-up::before {
  content: "↗";
  background: linear-gradient(140deg, #fbbf24, #d97706);
}

.home-body .dx-score-body [data-score-explain] {
  margin-top: 1rem;
}

/* Section cards: chart, advice, help */
.home-body .dash-section.care-card {
  border-radius: 1.6rem;
  border-color: var(--dx-line);
  box-shadow: var(--dx-shadow);
}

body.home-body .dash-section.care-card:hover {
  border-color: color-mix(in srgb, var(--blue) 26%, var(--dx-line));
  box-shadow: 0 30px 56px -30px rgba(30, 58, 138, 0.32);
}

.home-body #charts-container,
.home-body #setupState {
  scroll-margin-top: calc(var(--header-h) + 1.25rem);
}

.dx-card-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.home-body .dash-section-head h2,
.home-body .dx-score-body h2 {
  font-weight: 700;
  letter-spacing: -0.015em;
}

.home-body .chart-chips {
  gap: 0.45rem;
  padding: 0.3rem;
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
  background: var(--dx-track);
}

.home-body .chart-chip {
  border: 0;
  background: transparent;
  color: var(--muted);
}

body.home-body .chart-chip:hover {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 6px 14px -10px rgba(15, 23, 42, 0.4);
}

.home-body .chart-chip.on,
body.home-body .chart-chip.on:hover {
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #1e3a8a);
  box-shadow: 0 10px 20px -10px rgba(29, 78, 216, 0.8);
}

html[data-theme="dark"] .home-body .chart-chip.on,
html[data-theme="dark"] body.home-body .chart-chip.on:hover {
  color: #0b1530;
  background: linear-gradient(135deg, #93c5fd, #60a5fa);
}

.home-body .chart-box {
  padding: 0.6rem 0.4rem 0;
  border-radius: 1.1rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--blue) 4%, var(--surface)), var(--surface));
}

.home-body .pill-btn {
  border-color: var(--dx-line);
  transition: transform 0.35s var(--dx-spring), box-shadow 0.3s ease, border-color 0.25s ease, background 0.25s ease;
}

body.home-body .pill-btn:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--blue) 45%, var(--dx-line));
  box-shadow: 0 12px 22px -14px rgba(29, 78, 216, 0.7);
}

.home-body .pill-btn.pill-strong {
  padding: 0.62rem 1.15rem;
  background: linear-gradient(135deg, #3b82f6, #1e3a8a);
  box-shadow: 0 12px 22px -12px rgba(29, 78, 216, 0.8);
}

.home-body .help-card {
  border-radius: 1.4rem;
  border-color: color-mix(in srgb, var(--sos) 22%, var(--dx-line));
  background:
    radial-gradient(80% 140% at 0% 0%, color-mix(in srgb, var(--sos) 9%, transparent), transparent 60%),
    var(--surface);
  box-shadow: var(--dx-shadow);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.home-body .help-card:hover {
  border-color: color-mix(in srgb, var(--sos) 38%, var(--dx-line));
  box-shadow: 0 26px 48px -28px color-mix(in srgb, var(--sos) 60%, transparent);
}

.home-body .help-card summary {
  padding: 1.05rem 1.25rem;
}

.home-body .help-chevron {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--dx-line);
  border-radius: 50%;
  transform: none;
  background: var(--surface);
}

.home-body .help-chevron::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  margin-top: -0.2rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
}

.home-body .help-card .help-chevron {
  transition: transform 0.4s var(--dx-spring);
}

.home-body .help-card[open] .help-chevron {
  transform: rotate(180deg);
}

.home-body .help-body {
  padding-left: 5rem;
}

/* First check-in */
.home-body .empty-hero {
  border: 1px solid var(--dx-line);
  background:
    radial-gradient(60% 90% at 50% 0%, color-mix(in srgb, var(--blue) 9%, transparent), transparent 70%),
    var(--surface);
  box-shadow: var(--dx-shadow);
}

.home-body .empty-art {
  border-radius: 1.6rem;
  background:
    radial-gradient(120% 85% at 28% 8%, rgba(255, 255, 255, 0.55), transparent 48%),
    linear-gradient(150deg, #ff9a8b, #e5484d 52%, #b4232a);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.65), inset 0 -6px 12px rgba(180, 35, 42, 0.5), 0 18px 32px -14px rgba(229, 72, 77, 0.8);
}

.home-body .empty-ring {
  border-radius: 1.9rem;
}

@keyframes dx-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes dx-float {
  from {
    transform: translate(0, 0);
  }

  to {
    transform: translate(-1.2rem, 1rem);
  }
}

@keyframes dx-trace {
  from {
    stroke-dashoffset: 60;
  }

  to {
    stroke-dashoffset: 0;
  }
}

@keyframes dx-scan {
  from {
    transform: translateY(-6px);
  }

  to {
    transform: translateY(6px);
  }
}

@keyframes dx-bob {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-2px);
  }
}

@keyframes dx-blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

@keyframes dx-spark {
  from {
    stroke-dashoffset: 1;
  }
}

@keyframes dx-ring {
  from {
    --dx-pv: 0;
  }
}

html.ht-waiting .home-body *,
html.ht-waiting .home-body *::before,
html.ht-waiting .home-body *::after {
  animation-play-state: paused !important;
}

@media (max-width: 860px) {
  .home-body .dx-hero-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .home-body .dx-hero {
    border-radius: 1.5rem;
    padding: 1.35rem 1.15rem 1.2rem;
  }

  .dx-avatar {
    width: 3.1rem;
    height: 3.1rem;
    font-size: 1.25rem;
  }

  .home-body .dx-hero .home-status {
    font-size: 0.92rem;
  }

  .dx-hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .dx-action {
    justify-content: center;
    padding-right: 0.9rem;
    font-size: 0.86rem;
  }

  .dx-action.is-main {
    grid-column: 1 / -1;
  }

  .home-body .dx-quick {
    gap: 0.7rem;
  }

  .home-body .dx-quick .quick-tile {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.95rem;
  }

  .dx-tile-go {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    width: 1.7rem;
    height: 1.7rem;
  }

  .home-body .dx-ico {
    --s: 2.65rem;
  }

  .home-body .dx-ico-sm {
    --s: 2.2rem;
  }

  .home-body .dx-overview {
    padding: 1rem 1rem 1rem 1.25rem;
  }

  .dx-overview-sub {
    font-size: 0.84rem;
  }

  .home-body .number-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
  }

  .home-body .dx-stat {
    padding: 0.95rem 0.9rem 0.9rem 1.1rem;
    border-radius: 1.2rem;
  }

  .home-body .dx-stat .number-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .home-body .dx-stat .status-pill {
    max-width: 100%;
    padding: 0.22rem 0.5rem 0.22rem 0.42rem;
    font-size: 0.62rem;
    white-space: nowrap;
  }

  .home-body .dx-stat .number-label {
    margin-top: 0.8rem;
    font-size: 0.64rem;
    letter-spacing: 0.08em;
  }

  .home-body .dx-stat .number-value {
    font-size: 1.6rem;
  }

  .home-body .dx-stat .number-value small {
    display: block;
    margin: 0.1rem 0 0;
  }

  .home-body .dx-stat .number-note {
    font-size: 0.78rem;
  }

  .dx-stat-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .dx-spark {
    flex-basis: auto;
    width: 100%;
    max-width: none;
  }

  .dx-score {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .dx-ring {
    width: 8rem;
    height: 8rem;
  }

  .dx-week {
    justify-content: center;
  }

  .home-body .dx-score-body .score-trends li {
    text-align: left;
  }

  .home-body .chart-chips {
    width: auto;
  }

  .home-body .help-body {
    padding-left: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {

  .home-body .dx-hero *,
  .home-body .dx-ico,
  .home-body .dx-ico *,
  .home-body .dx-stat,
  .home-body .dx-spark-line,
  .home-body .dx-ring {
    animation: none !important;
  }

  body.home-body .dx-quick .quick-tile:hover,
  body.home-body .dx-stat:hover,
  [data-dx-glow]:hover .dx-ico {
    transform: none;
  }
}