/* =============================================================
   Phone Assistant Link — styles
   Dark, high-tech, friendly. Blue→cyan gradient accent.
   ============================================================= */

:root {
  --bg: #08080a;
  --bg-soft: #0e0e12;
  --card: #121218;
  --card-border: rgba(255, 255, 255, 0.07);
  --card-border-hover: rgba(10, 132, 255, 0.35);
  --text: #f3f3f5;
  --text-dim: #a6a6b0;
  --text-faint: #6e6e78;

  --pink: #0a84ff;
  --red: #00c8ff;
  --grad: linear-gradient(120deg, #0a84ff 0%, #2f9bff 55%, #00c8ff 100%);

  --radius: 18px;
  --radius-lg: 26px;
  --maxw: 1080px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
    Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient glow + faint circuit grid behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(560px 420px at 78% -8%, rgba(10, 132, 255, 0.16), transparent 60%),
    radial-gradient(620px 520px at 8% 4%, rgba(0, 200, 255, 0.12), transparent 60%);
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 75%);
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), box-shadow 0.3s var(--ease),
    border-color 0.2s var(--ease), background 0.2s var(--ease);
  cursor: pointer;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 30px rgba(10, 132, 255, 0.28);
}
.btn-primary:hover { box-shadow: 0 12px 40px rgba(10, 132, 255, 0.42); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--card-border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--card-border-hover); background: rgba(255, 255, 255, 0.07); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(8, 8, 10, 0.6);
  border-bottom: 1px solid var(--card-border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: -0.01em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, 0.12); }
.nav { display: flex; align-items: center; gap: 20px; }
.nav a { color: var(--text-dim); font-size: 0.95rem; white-space: nowrap; transition: color 0.2s; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); }
.nav .btn { padding: 9px 18px; font-size: 0.9rem; }
.nav .btn-primary,
.nav .btn-primary:visited,
.nav .btn-primary:hover,
.nav .btn-primary:active { color: #fff; }
.header-actions { display: none; align-items: center; gap: 8px; }
.mobile-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border-radius: 10px;
  background: var(--grad);
  color: #fff !important;
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.4;
  box-shadow: 0 6px 20px rgba(10, 132, 255, 0.22);
}
.mobile-download:visited,
.mobile-download:hover,
.mobile-download:active { color: #fff !important; }
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.nav-toggle-icon { display: grid; gap: 3px; width: 17px; }
.nav-toggle-icon i { display: block; height: 1.5px; border-radius: 2px; background: currentColor; }
@media (max-width: 1040px) {
  .header-actions { display: flex; }
  .nav-toggle { display: inline-flex; }
  .site-header .wrap { position: relative; }
  .nav {
    display: none;
    position: absolute;
    top: 58px;
    left: 16px;
    right: 16px;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    padding: 8px;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    background: rgba(14, 14, 18, 0.98);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 11px 12px; border-radius: 9px; }
  .nav a:hover { background: rgba(255, 255, 255, 0.05); }
  .nav .btn { justify-content: center; margin-top: 5px; padding: 11px 16px; }
}
@media (max-width: 520px) {
  .brand span { display: none; }
}

/* ---------- Section scaffolding ---------- */
section { padding: 96px 0; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--pink);
  margin: 0 0 14px;
}
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
.section-title { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 14px; }
.section-sub { color: var(--text-dim); font-size: 1.05rem; max-width: 620px; }

/* ---------- Hero ---------- */
.hero { padding: 58px 0 50px; text-align: center; }
.hero-icon {
  width: 88px; height: 88px; margin: 0 auto 24px;
  border-radius: 21px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 60px rgba(10, 132, 255, 0.3);
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 800; }
.hero .sub {
  color: var(--text-dim);
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  max-width: 660px;
  margin: 22px auto 36px;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
/* trust chips */
.chips { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  font-size: 0.9rem; color: var(--text-dim);
}
.chip b { color: var(--text); font-weight: 600; }

/* ---------- Setup steps (screenshot-led) ---------- */
#setup { padding-top: 72px; }
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-top: 56px;
  align-items: start;
}
@media (max-width: 980px) { .steps { grid-template-columns: repeat(2, 1fr); gap: 36px 28px; } }
@media (max-width: 540px) { .steps { grid-template-columns: 1fr; gap: 44px; } }

.step { position: relative; text-align: left; }

/* number chip above the title */
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px;
  font-weight: 700; font-size: 0.85rem; margin-bottom: 14px;
  background: rgba(10, 132, 255, 0.12);
  border: 1px solid rgba(10, 132, 255, 0.3);
  color: var(--pink);
}

/* screenshot area — fixed height so titles align across columns */
.step-shot {
  height: 230px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 20px;
}
.step-shot img {
  max-height: 230px;
  max-width: 100%;
  width: auto;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
  transition: transform 0.3s var(--ease);
}
.step:hover .step-shot img { transform: translateY(-5px); }
.step-shot--empty { align-items: center; opacity: 0.85; }

.step h3 { font-size: 1.22rem; margin-bottom: 10px; line-height: 1.25; }
.step p { color: var(--text-dim); margin: 0; }
.step p a {
  color: var(--pink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s;
}
.step p a:hover { color: #5aa9ff; }
.setup-recommendation { margin: 18px 0 0; }
.setup-recommendation a { color: var(--pink); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Best results guide ---------- */
.guide-wrap { width: 100%; max-width: 820px; margin: 0 auto; padding: 0 24px; }
.setup-guide-hero { padding: 72px 0 42px; }
.setup-guide-hero h1 { max-width: 760px; font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 18px; }
.setup-guide-section { padding: 48px 0; }
.setup-guide-section h2 { font-size: clamp(1.55rem, 3vw, 2rem); margin-bottom: 24px; }
.setup-checklist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--card-border); }
.setup-checklist li {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 18px;
  padding: 24px 0;
  border-bottom: 1px solid var(--card-border);
}
.check-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(10, 132, 255, 0.12);
  border: 1px solid rgba(10, 132, 255, 0.3);
  color: var(--pink);
  font-weight: 700;
}
.setup-checklist h3 { font-size: 1.1rem; margin: 3px 0 6px; }
.setup-checklist p { margin: 0; color: var(--text-dim); }
.setup-guide-habits { padding-top: 36px; }
.habit-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--card-border); }
.habit-list li {
  display: grid;
  grid-template-columns: minmax(230px, 0.9fr) 1.2fr;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--card-border);
}
.habit-list b { color: var(--text); }
.habit-list span { color: var(--text-dim); }
.guide-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

/* ---------- Integration reference ---------- */
.reference-wrap { width: 100%; max-width: 900px; margin: 0 auto; padding: 0 24px; }
.reference-hero { padding: 72px 0 46px; }
.reference-hero h1 { max-width: 760px; font-size: clamp(2.3rem, 5vw, 3.8rem); margin-bottom: 18px; }
.reference-hero .section-sub { max-width: 760px; }
.reference-jump { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.reference-jump a {
  padding: 8px 13px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: rgba(255,255,255,0.035);
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 600;
}
.reference-jump a:hover { color: var(--text); border-color: var(--card-border-hover); }
.reference-section { padding: 62px 0; scroll-margin-top: 65px; }
.reference-section-alt { background: rgba(255,255,255,0.018); border-block: 1px solid var(--card-border); }
.reference-section h2 { max-width: 760px; font-size: clamp(1.75rem, 3.5vw, 2.45rem); line-height: 1.16; margin: 0 0 18px; }
.reference-section h3 { font-size: 1.2rem; margin: 34px 0 10px; }
.reference-section > .reference-wrap > p:not(.eyebrow) { color: var(--text-dim); max-width: 780px; }
.reference-example-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 28px 0; }
.reference-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card);
}
.reference-card code { display: block; overflow-wrap: anywhere; color: var(--text-dim); font-size: 0.84rem; }
.reference-card strong { display: block; margin: 14px 0 6px; font-size: 1.05rem; line-height: 1.4; }
.reference-card p { margin: 0; color: var(--text-dim); font-size: 0.94rem; }
.reference-label { color: var(--pink); display: block; font-size: 0.72rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }
.reference-note {
  margin: 28px 0;
  padding: 18px 20px;
  border-left: 3px solid var(--pink);
  border-radius: 0 12px 12px 0;
  background: rgba(10,132,255,0.07);
}
.reference-note h3 { margin: 0 0 4px; font-size: 1.05rem; }
.reference-note p { margin: 0; color: var(--text-dim); }
.reference-page code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.reference-section p code, .reference-table code, .metric-groups code {
  padding: 0.12em 0.34em;
  border-radius: 5px;
  background: rgba(255,255,255,0.065);
  color: #f0cad8;
  font-size: 0.88em;
}
.reference-code {
  overflow-x: auto;
  margin: 14px 0 28px;
  padding: 18px 20px;
  border: 1px solid var(--card-border);
  border-radius: 13px;
  background: #0b0b0e;
  color: #cfe4ff;
  font-size: 0.88rem;
  line-height: 1.65;
  white-space: pre;
}
.state-preview { margin: 24px 0 14px; padding: 20px; border: 1px solid var(--card-border); border-radius: 14px; background: var(--card); }
.state-preview span { display: block; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; font-weight: 750; }
.state-preview strong { display: block; margin-top: 7px; font-size: 1.12rem; }
.reference-table-wrap { overflow-x: auto; margin: 26px 0 32px; border: 1px solid var(--card-border); border-radius: 14px; }
.reference-table { width: 100%; border-collapse: collapse; min-width: 590px; background: rgba(12,12,16,0.72); }
.reference-table th, .reference-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--card-border); vertical-align: top; }
.reference-table th { color: var(--text); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; background: rgba(255,255,255,0.035); }
.reference-table td { color: var(--text-dim); font-size: 0.93rem; }
.reference-table td:first-child { width: 36%; color: var(--text); }
.reference-table tr:last-child td { border-bottom: 0; }
.stage-key { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 16px 0 20px; }
.stage-key span { padding: 12px 8px; text-align: center; border: 1px solid var(--card-border); border-radius: 10px; color: var(--text-dim); font-size: 0.83rem; background: var(--card); }
.stage-key b { display: block; color: var(--pink); font-size: 1rem; }
.reference-inline-link { display: inline-block; margin-top: 4px; color: var(--pink); font-weight: 650; text-decoration: underline; text-underline-offset: 4px; }
.direction-flow { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 26px 0 34px; }
.direction-flow span { padding: 12px 15px; border: 1px solid var(--card-border); border-radius: 12px; background: var(--card); color: var(--text); font-weight: 650; text-align: center; }
.direction-flow i { color: var(--pink); font-size: 1.3rem; font-style: normal; }
.reference-steps { list-style: none; margin: 18px 0 30px; padding: 0; border-top: 1px solid var(--card-border); }
.reference-steps li { display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding: 17px 0; border-bottom: 1px solid var(--card-border); }
.reference-steps li > span { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(10,132,255,0.11); border: 1px solid rgba(10,132,255,0.28); color: var(--pink); font-weight: 750; font-size: 0.82rem; }
.reference-steps b { color: var(--text); }
.reference-steps p { margin: 3px 0 0; color: var(--text-dim); }
.medication-states { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0 28px; }
.medication-states span { padding: 15px; border: 1px solid var(--card-border); border-radius: 12px; color: var(--text-dim); font-size: 0.88rem; background: var(--card); }
.medication-states b { display: block; margin-bottom: 3px; color: var(--pink); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.reference-callouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 28px 0; }
.reference-callouts article { padding: 20px; border: 1px solid var(--card-border); border-radius: 14px; background: var(--card); }
.reference-callouts h3 { margin: 0 0 7px; font-size: 1.04rem; }
.reference-callouts p { margin: 0; color: var(--text-dim); font-size: 0.9rem; }
.metric-groups { margin-top: 14px; border-top: 1px solid var(--card-border); }
.metric-groups details { border-bottom: 1px solid var(--card-border); padding: 0 4px; }
.metric-groups summary { cursor: pointer; padding: 16px 0; font-weight: 650; }
.metric-groups details p { margin: -3px 0 18px; color: var(--text-dim); }

@media (max-width: 720px) {
  .reference-hero { padding: 52px 0 34px; }
  .reference-section { padding: 48px 0; }
  .reference-example-grid, .reference-callouts { grid-template-columns: 1fr; }
  .direction-flow { align-items: stretch; flex-direction: column; }
  .direction-flow i { align-self: center; transform: rotate(90deg); }
  .stage-key { grid-template-columns: repeat(3, 1fr); }
  .medication-states { grid-template-columns: 1fr; }
  .reference-table th, .reference-table td { padding: 11px 13px; }
}
@media (max-width: 620px) {
  .setup-guide-hero { padding-top: 52px; }
  .habit-list li { grid-template-columns: 1fr; gap: 5px; }
}

/* ---------- Recommendations / quick guide ---------- */
.tips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin-top: 48px; }
@media (max-width: 760px) { .tips { grid-template-columns: 1fr; } }
.tip {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 30px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.tip:hover { transform: translateY(-4px); border-color: var(--card-border-hover); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45); }
.tip-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 14px; margin-bottom: 18px;
  background: rgba(10, 132, 255, 0.12);
  border: 1px solid rgba(10, 132, 255, 0.3);
  color: var(--pink);
}
.tip h3 { font-size: 1.2rem; margin-bottom: 10px; }
.tip p { color: var(--text-dim); margin: 0; }
.tip p strong { color: var(--text); font-weight: 600; }
.tips-note { color: var(--text-faint); font-size: 0.98rem; margin-top: 24px; max-width: 640px; }

/* ---------- Reviews slider ---------- */
.reviews { text-align: center; }
.reviews-slider { display: grid; }
.review {
  grid-area: 1 / 1;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), visibility 0.5s;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.review.is-active { opacity: 1; visibility: visible; transform: none; }

.review::before {
  content: "\201C";
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.4rem; line-height: 0.7;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 14px;
}
.review-title {
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.25;
  margin: 0 0 16px;
  color: var(--text);
}
.quote {
  max-width: 780px; margin: 0 auto;
  font-size: clamp(1.1rem, 1.8vw, 1.3rem);
  font-weight: 500; line-height: 1.6; letter-spacing: -0.01em;
  color: var(--text);
}
.review-copy p { margin: 0 0 14px; }
.review-copy p:last-child { margin-bottom: 0; }
.review-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 24px; color: var(--text-faint); font-size: 0.9rem; }
.review-meta b { color: var(--text-dim); }
.review-meta span::before { content: "·"; margin-right: 8px; color: var(--text-faint); }

.reviews-nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 34px; }
.rev-arrow {
  appearance: none; cursor: pointer;
  width: 42px; height: 42px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.rev-arrow:hover { color: var(--text); border-color: var(--card-border-hover); background: rgba(255, 255, 255, 0.07); transform: translateY(-2px); }
.rev-dots { display: inline-flex; align-items: center; gap: 9px; }
.rev-dot {
  appearance: none; cursor: pointer; padding: 0;
  width: 9px; height: 9px; border-radius: 999px; border: none;
  background: rgba(255, 255, 255, 0.2);
  transition: background 0.2s, width 0.2s var(--ease);
}
.rev-dot:hover { background: rgba(255, 255, 255, 0.4); }
.rev-dot.is-active { background: var(--grad); width: 22px; }

@media (prefers-reduced-motion: reduce) {
  .review { transition: opacity 0.2s; transform: none; }
}

/* ---------- Stories ---------- */
.stories-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 48px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 30px; flex-wrap: wrap;
}
.stories-card .copy { max-width: 560px; }

/* ---------- Helpful links ---------- */
.links-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
@media (max-width: 760px) { .links-grid { grid-template-columns: 1fr; } }
.link-card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px 22px;
  font-weight: 600;
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s;
}
.link-card:hover { transform: translateY(-3px); border-color: var(--card-border-hover); background: var(--bg-soft); }
.link-card .arrow { color: var(--text-faint); transition: transform 0.2s var(--ease), color 0.2s; }
.link-card:hover .arrow { transform: translateX(3px); color: var(--pink); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--card-border); padding: 64px 0 40px; background: var(--bg-soft); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; gap: 32px; } }
.footer-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; margin-bottom: 14px; }
.footer-brand img { width: 32px; height: 32px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.12); }
.site-footer p { color: var(--text-dim); margin: 0 0 6px; max-width: 320px; }
.footer-col h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-faint); margin: 0 0 16px; }
.footer-col a { display: block; color: var(--text-dim); padding: 5px 0; transition: color 0.2s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--card-border); color: var(--text-faint); font-size: 0.9rem; }

/* ---------- Stories page ---------- */
.stories-hero { padding: 80px 0 40px; }
.stories-hero .section-title { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 16px; }
.stories-section { padding-top: 24px; }
.stories-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 760px) { .stories-list { grid-template-columns: 1fr; } }
.stories-list:empty { display: none; }

/* A story card (use when articles are added) */
.story-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.story-card:hover { transform: translateY(-4px); border-color: var(--card-border-hover); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45); }
.story-card h3 { font-size: 1.35rem; margin-bottom: 12px; line-height: 1.25; }
.story-card p { color: var(--text-dim); margin: 0 0 18px; }
.story-tag {
  display: inline-block;
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; font-weight: 700;
  color: var(--pink);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 14px !important;
  background: rgba(10, 132, 255, 0.1);
  border: 1px solid rgba(10, 132, 255, 0.28);
}
.story-card .read-more { color: var(--pink); font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.story-card .read-more .arrow { transition: transform 0.2s var(--ease); }
.story-card:hover .read-more .arrow { transform: translateX(4px); }

/* ---------- Next steps: direct navigation after setup ---------- */
.next-steps { padding-top: 48px; }
.next-step-links { margin-top: 34px; border-top: 1px solid var(--card-border); }
.next-step-links a {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) 1.6fr auto;
  align-items: center;
  gap: 24px;
  padding: 21px 4px;
  border-bottom: 1px solid var(--card-border);
  transition: color 0.2s, padding 0.2s var(--ease);
}
.next-step-links a:hover { padding-left: 10px; }
.next-step-links b { color: var(--text); font-size: 1.02rem; }
.next-step-links span { color: var(--text-dim); }
.next-step-links i { color: var(--pink); font-style: normal; font-size: 1.35rem; }
@media (max-width: 620px) {
  .next-step-links a { grid-template-columns: 1fr auto; gap: 4px 16px; }
  .next-step-links span { grid-column: 1; font-size: 0.92rem; }
  .next-step-links i { grid-column: 2; grid-row: 1 / 3; }
}

/* ---------- Article (single story) ---------- */
.article { padding: 56px 0 96px; }
.article-wrap { max-width: 720px; margin: 0 auto; padding: 0 24px; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-dim); font-size: 0.95rem; font-weight: 500;
  transition: color 0.2s;
}
.back-link:hover { color: var(--text); }
.article .eyebrow { margin-top: 28px; }
.article-title { font-size: clamp(1.9rem, 4.5vw, 3rem); margin-bottom: 22px; line-height: 1.12; }
.article-lead {
  font-size: 1.2rem; line-height: 1.6; color: var(--text);
  margin: 0 0 12px; padding-bottom: 32px;
  border-bottom: 1px solid var(--card-border);
}
.article-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  color: var(--text-faint); font-size: 0.95rem; margin: -8px 0 26px;
}
.article-meta .dot { opacity: 0.6; }
.article-meta time { color: var(--text-dim); }

.takeaways {
  margin: 32px 0 8px;
  padding: 26px 28px;
  background: rgba(10, 132, 255, 0.06);
  border: 1px solid rgba(10, 132, 255, 0.22);
  border-radius: var(--radius-lg);
}
.takeaways h2 {
  font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--pink); margin: 0 0 14px;
}
.takeaways ul { margin: 0; padding-left: 4px; list-style: none; }
.takeaways li {
  position: relative; padding-left: 26px; margin-bottom: 10px;
  color: var(--text); font-size: 1rem; line-height: 1.6;
}
.takeaways li:last-child { margin-bottom: 0; }
.takeaways li::before {
  content: ""; position: absolute; left: 4px; top: 0.55em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--grad);
}

.article-body { margin-top: 32px; }
.article-body p { color: var(--text-dim); font-size: 1.08rem; line-height: 1.75; margin: 0 0 22px; }
.article-body h2 { font-size: 1.5rem; margin: 44px 0 16px; }
.article-body ul { color: var(--text-dim); font-size: 1.08rem; line-height: 1.7; margin: 0 0 22px; padding-left: 4px; list-style: none; }
.article-body ul li { position: relative; padding-left: 26px; margin-bottom: 8px; }
.article-body ul li::before {
  content: ""; position: absolute; left: 4px; top: 0.62em;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--grad);
}

.faq { margin-top: 52px; padding-top: 36px; border-top: 1px solid var(--card-border); }
.faq > h2 { font-size: 1.6rem; margin-bottom: 24px; }
.faq-item { margin-bottom: 24px; }
.faq-item h3 { font-size: 1.12rem; margin-bottom: 8px; }
.faq-item p { color: var(--text-dim); font-size: 1.04rem; line-height: 1.7; margin: 0; }

.article-cta {
  margin-top: 52px; padding: 32px;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); text-align: center;
}
.article-cta p { color: var(--text); font-size: 1.1rem; font-weight: 500; margin: 0 0 20px; }
.article-cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.article .back-link:last-child { margin-top: 40px; }

/* Empty state */
.stories-empty {
  text-align: center;
  max-width: 520px;
  margin: 20px auto 0;
  padding: 56px 32px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
}
.stories-empty svg { margin: 0 auto 22px; }
.stories-empty h2 { font-size: 1.5rem; margin-bottom: 10px; }
.stories-empty p { color: var(--text-dim); margin: 0 auto 26px; max-width: 360px; }
.empty-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* =============================================================
   Dashboard Tiles page (/tiles/)
   ============================================================= */

.tiles-top { padding: 72px 0 80px; }
.tiles-top .section-sub { max-width: 640px; }

/* Callout box */
.callout {
  margin-top: 32px;
  padding: 20px 24px;
  background: rgba(10, 132, 255, 0.06);
  border: 1px solid rgba(10, 132, 255, 0.22);
  border-radius: var(--radius-lg);
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.6;
}
.callout strong { color: var(--text); font-weight: 600; }
.callout--sm { margin-top: 22px; padding: 15px 20px; font-size: 0.92rem; }

/* code chips inline */
code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--text);
}

/* Tabs */
.tabs {
  display: inline-flex;
  gap: 4px;
  margin-top: 34px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
}
.tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 9px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.tab:hover { color: var(--text); }
.tab.is-active {
  color: #fff;
  background: var(--grad);
  box-shadow: 0 8px 24px rgba(10, 132, 255, 0.28);
}
@media (max-width: 620px) {
  .tabs { display: flex; width: 100%; overflow-x: auto; box-sizing: border-box; }
  .tab { flex: none; padding-inline: 17px; }
}

/* Studio layout: preview + actions */
.studio {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 26px;
  margin-top: 22px;
  align-items: stretch;
}
@media (max-width: 860px) { .studio { grid-template-columns: 1fr; } }

.studio-preview { display: flex; flex-direction: column; align-items: center; }
.pv-wrap { width: 100%; display: flex; justify-content: center; }
.pv-wrap[hidden] { display: none; }
.pv-note { color: var(--text-faint); font-size: 0.82rem; margin: 14px 0 0; text-align: center; }

/* ---- Tile mockup (faithful-ish static replica of the button-card) ---- */
.hct {
  width: 100%;
  max-width: 340px;
  padding: 16px;
  border-radius: 28px;
  background: #1c1c1c;
  box-shadow: 10px 10px 24px rgba(0, 0, 0, 0.72), -6px -6px 18px rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}
.hct-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hct-lead { min-width: 0; }
.hct-eyebrow { display: block; font-size: 9px; font-weight: 700; letter-spacing: 1.8px; color: #888; margin-bottom: 6px; }
.hct-value { display: flex; align-items: baseline; gap: 9px; }
.hct-value b { font-size: 38px; font-weight: 300; letter-spacing: -2px; line-height: 0.9; color: #fff; white-space: nowrap; }
.hct-value span { font-size: 10px; font-weight: 800; letter-spacing: 1.3px; color: #00a9b7; white-space: nowrap; }
.hct-icon { flex: none; color: #ff8c00; filter: drop-shadow(0 0 8px rgba(255, 140, 0, 0.32)); }
.hct-msg { margin: 12px 0 0; font-size: 11px; line-height: 1.45; color: #888; }

/* window row */
.hct-window {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  background: #141415;
  box-shadow: inset 4px 4px 9px rgba(0, 0, 0, 0.75), inset -3px -3px 7px rgba(255, 255, 255, 0.035);
}
.hct-tb { display: grid; grid-template-columns: 20px auto; grid-template-rows: auto auto; column-gap: 8px; text-align: left; }
.hct-tb .hct-dot { grid-row: 1 / 3; align-self: center; font-size: 11px; line-height: 1; color: transparent; -webkit-text-fill-color: transparent; border-radius: 50%; width: 12px; height: 12px; }
.hct-tb small { font-size: 7px; letter-spacing: 1.1px; color: #666; }
.hct-tb b { font-size: 14px; color: #fff; font-weight: 600; }
.hct-tb b i { font-size: 8px; font-style: normal; font-weight: 700; color: #666; margin-left: 2px; }
.hct-tb--r { grid-template-columns: auto 20px; text-align: right; }
.hct-tb--r .hct-dot { grid-column: 2; }
.hct-line { display: flex; align-items: center; flex: 1; margin: 0 12px; }
.hct-line i { height: 1px; flex: 1; background: linear-gradient(90deg, #323232, #487495); }
.hct-line i:last-of-type { background: linear-gradient(90deg, #487495, #323232); }
.hct-line--red i { background: linear-gradient(90deg, #323232, #e5484d); }
.hct-line--red i:last-of-type { background: linear-gradient(90deg, #e5484d, #323232); }
.hct-line--orange i { background: linear-gradient(90deg, #323232, #ff8c00); }
.hct-line--orange i:last-of-type { background: linear-gradient(90deg, #ff8c00, #323232); }
.hct-star { margin: 0 6px; font-size: 12px; }

/* sleep stages */
.hct-stages { margin-top: 8px; }
.hct-stages-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 6px; }
.hct-stages-head b { font-size: 10px; letter-spacing: 1.4px; color: #fff; }
.hct-stages-head small { font-size: 7px; letter-spacing: 1.1px; color: #666; }
.hct-bar {
  display: flex; height: 9px; gap: 3px; padding: 3px; border-radius: 14px; overflow: hidden;
  background: #141415;
  box-shadow: inset 3px 3px 7px rgba(0, 0, 0, 0.8), inset -2px -2px 5px rgba(255, 255, 255, 0.035);
}
.hct-bar i { display: block; height: 100%; border-radius: 8px; }
.hct-legend { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 9px; }
.hct-legend div { display: grid; grid-template-columns: 10px 1fr; text-align: left; }
.hct-legend span { grid-row: 1 / 3; font-size: 9px; line-height: 1; }
.hct-legend small { font-size: 6px; letter-spacing: 0.7px; color: #666; }
.hct-legend b { font-size: 10px; color: #fff; white-space: nowrap; }

/* Sleep Details hypnogram — mirrors the built-in Health Bridge card. */
.hct-hypno {
  display: grid;
  grid-template-columns: 1fr 54px;
  grid-template-rows: min-content auto min-content;
  grid-template-areas: "eyebrow icon" "graph graph" "foot foot";
  column-gap: 12px;
  row-gap: 8px;
}
.hct-hypno > .hct-eyebrow { grid-area: eyebrow; align-self: center; margin: 0; }
.hct-hypno-icon { grid-area: icon; align-self: center; justify-self: end; }
.hct-hypno-graph { grid-area: graph; width: 100%; }
.hct-hypno-graph svg { display: block; width: 100%; height: auto; }
.hct-hypno-graph .hbh-axis { fill: #666; font-size: 10px; }
.hct-hypno-graph .hbh-axis-strong { fill: #888; font-size: 11px; font-weight: 600; }
.hct-hypno-graph .hbh-grid { stroke: #666; opacity: .2; stroke-width: 1; }
.hct-hypno-graph .hbh-vgrid { stroke-dasharray: 3 4; }
.hct-hypno-graph .hbh-connector { stroke-width: 3; stroke-linecap: round; opacity: .5; }
.hct-hypno-graph .hbh-stage { filter: drop-shadow(0 0 5px rgba(83, 199, 236, .25)); }
.hct-hypno-foot { grid-area: foot; width: 100%; padding-top: 4px; color: #666; font-size: 10px; letter-spacing: .3px; }

/* stat grid (daily / workouts) */
.hct-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.hct-stat {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 4px; border-radius: 14px; background: #141415;
  box-shadow: inset 3px 3px 7px rgba(0, 0, 0, 0.8), inset -2px -2px 5px rgba(255, 255, 255, 0.035);
}
.hct-stat span { font-size: 13px; line-height: 1; }
.hct-stat b { font-size: 15px; font-weight: 700; color: #fff; white-space: nowrap; }
.hct-stat b i { font-size: 8px; font-weight: 700; font-style: normal; letter-spacing: 0.5px; color: #666; margin-left: 2px; }
.hct-stat small { font-size: 6px; letter-spacing: 1px; color: #666; }

/* ---- Actions panel ---- */
.tile-actions {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.field-label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 8px; }
.tile-actions input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  padding: 12px 14px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.tile-actions input:focus { outline: none; border-color: var(--card-border-hover); box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.15); }
.field-hint { color: var(--text-faint); font-size: 0.86rem; margin: 10px 0 0; line-height: 1.55; }

.copy-btn { width: 100%; justify-content: center; margin-top: 18px; }
.copy-btn svg { flex: none; }
.copy-btn.copied { background: rgba(74, 222, 128, 0.16); box-shadow: none; }

/* Collapsible YAML */
.code-toggle { margin-top: 16px; border-top: 1px solid var(--card-border); padding-top: 14px; }
.code-toggle summary {
  cursor: pointer; list-style: none;
  color: var(--text-dim); font-size: 0.86rem; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  transition: color 0.2s;
}
.code-toggle summary::-webkit-details-marker { display: none; }
.code-toggle summary::before { content: "\25B8"; color: var(--text-faint); transition: transform 0.2s var(--ease); }
.code-toggle[open] summary::before { transform: rotate(90deg); }
.code-toggle summary:hover { color: var(--text); }
pre.code {
  margin: 14px 0 0;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 16px;
  max-height: 360px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
pre.code code {
  display: block;
  background: none;
  border: none;
  padding: 0;
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre;
  tab-size: 2;
}

/* ---- Required HACS add-ons ---- */
.prereqs { margin-top: 34px; }
.prereqs-title { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-faint); font-weight: 700; margin: 0 0 14px; }
.prereq-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 560px) { .prereq-row { grid-template-columns: 1fr; } }
.prereq-chip {
  display: flex; flex-direction: column; gap: 3px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s, box-shadow 0.2s var(--ease);
}
.prereq-chip:hover { transform: translateY(-3px); border-color: var(--card-border-hover); background: var(--bg-soft); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4); }
.prereq-chip b { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: 0.98rem; color: var(--text); }
.prereq-desc { color: var(--text-dim); font-size: 0.88rem; }
.prereq-go {
  margin-top: 14px;
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px;
  background: rgba(10, 132, 255, 0.12);
  border: 1px solid rgba(10, 132, 255, 0.35);
  color: var(--pink); font-weight: 600; font-size: 0.86rem;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.prereq-go .arrow { transition: transform 0.2s var(--ease); display: inline-block; }
.prereq-chip:hover .prereq-go {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 26px rgba(10, 132, 255, 0.32);
}
.prereq-chip:hover .prereq-go .arrow { transform: translateX(3px); }
.prereqs-note { color: var(--text-faint); font-size: 0.85rem; margin: 12px 0 0; line-height: 1.55; }

/* ---- Compact steps ---- */
.howto { list-style: none; margin: 34px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 760px) { .howto { grid-template-columns: 1fr 1fr; } }
@media (max-width: 440px) { .howto { grid-template-columns: 1fr; } }
.howto li {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex; gap: 12px; align-items: flex-start;
}
.howto-num {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px;
  font-weight: 700; font-size: 0.8rem;
  background: rgba(10, 132, 255, 0.12);
  border: 1px solid rgba(10, 132, 255, 0.3);
  color: var(--pink);
}
.howto li p { margin: 0; color: var(--text-dim); font-size: 0.92rem; line-height: 1.4; }
.howto li p strong { color: var(--text); font-weight: 600; }

/* ---------- Reveal animation ---------- */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .hero-icon { animation: none; }
  * { scroll-behavior: auto; }
}
