/* Shared styles for every skin: hook (/t/{slug}), detail (/lip/{slug}) and the LIP home card.
   Mobile-first, system fonts only (Indic scripts render natively on Android/iOS, zero font download). */

:root {
  --bg: #fff8f0;
  --ink: #23123f;
  --muted: #6d6380;
  --card: #ffffff;
  --line: #efe4d6;
  --primary: #e2462f;
  --primary-ink: #ffffff;
  --night: #2b1055;
  --gold: #f5b83d;
  --wa: #25d366;
  --good: #1f9d55;
  --warn: #d98b00;
  --neutral: #8a8299;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(43, 16, 85, 0.08);
  --font: system-ui, -apple-system, "Segoe UI", "Noto Sans", "Noto Sans Devanagari", "Noto Sans Tamil", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
}

body { min-height: 100vh; }

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px calc(32px + env(safe-area-inset-bottom));
}

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.brand { font-weight: 800; color: var(--night); text-decoration: none; font-size: 17px; }
.lang-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font: 600 14px var(--font);
  cursor: pointer;
}

/* ---------- language sheet ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 8, 40, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}
.sheet {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  animation: up 0.2s ease-out;
}
.sheet-handle { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 4px auto 14px; }
.lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lang-opt {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  font: 600 16px var(--font);
  color: var(--ink);
  cursor: pointer;
}
.lang-opt.is-on { border-color: var(--primary); background: #fff1ec; color: var(--primary); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: 92vw;
  background: var(--night);
  color: #fff;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  z-index: 60;
  display: flex;
  gap: 10px;
  align-items: center;
  box-shadow: var(--shadow);
  transition: opacity 0.3s, transform 0.3s;
}
.toast.is-out { opacity: 0; transform: translate(-50%, 10px); }
.toast-btn { background: none; border: 0; color: var(--gold); font: 700 14px var(--font); cursor: pointer; }

/* ---------- generic ---------- */
.screen { display: flex; flex-direction: column; gap: 14px; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 22px; }
h3 { font-size: 16px; color: var(--muted); font-weight: 700; margin-bottom: 10px; }
p { margin: 0; line-height: 1.5; }
.muted { color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.micro { font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; }
.center { text-align: center; align-items: center; }
.row-center { display: flex; justify-content: center; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 14px;
  padding: 13px 18px;
  font: 700 15px var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s;
}
.btn:active { transform: scale(0.98); }
.btn-lg { width: 100%; padding: 17px 20px; font-size: 17px; }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 8px 20px rgba(226, 70, 47, 0.3); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-ig { background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-match { background: linear-gradient(100deg, #2b1055, #7c3aed 58%, #db2777); color: #fff; box-shadow: 0 8px 20px rgba(43, 16, 85, 0.28); }
.btn-retake { background: #fff; color: var(--night); border: 2px solid #eadcf8; box-shadow: var(--shadow); }
.result-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.btn-mitra { background: var(--night); color: #fff; }

/* ---------- hero (intro) ---------- */
.hero {
  text-align: center;
  padding: 28px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.hero h1 { font-size: 30px; letter-spacing: -0.3px; }
.hero .sub { color: var(--muted); font-size: 16px; }
.kicker { color: var(--primary); font-weight: 700; font-size: 13px; letter-spacing: 0.3px; text-transform: none; }
.orbit {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  font-size: 30px;
  margin-bottom: 4px;
}
.orbit span { animation: float 3s ease-in-out infinite; }
.orbit span:nth-child(odd) { animation-delay: 0.6s; }
@keyframes float { 50% { transform: translateY(-5px); } }

/* ---------- night-sky theme (skin.json "art": "sky"; art from public-domain star positions, see sky.js) ---------- */
html[data-art="sky"] .result-hero { background: url("../img/starfield.svg") repeat, linear-gradient(160deg, var(--night) 0%, #6a1b4d 60%, var(--primary) 100%); }
html[data-art="sky"] .locked { background: url("../img/starfield.svg") repeat, var(--night); }
html[data-art="sky"] .dcard-back { background: url("../img/starfield.svg") center / 220px repeat, radial-gradient(circle at 50% 45%, #4a2283 0%, var(--night) 75%); box-shadow: inset 0 0 0 1px rgba(245, 184, 61, 0.4); }
.sky-disc {
  position: relative;
  width: 232px;
  height: 232px;
  border-radius: 50%;
  background: url("../img/starfield.svg") center / 200px repeat, radial-gradient(circle at 50% 45%, #4a2283 0%, var(--night) 62%, #170733 100%);
  box-shadow: 0 10px 30px rgba(43, 16, 85, 0.28), inset 0 0 0 1px rgba(245, 184, 61, 0.35);
  margin-bottom: 2px;
}
.ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring-guides { fill: none; stroke: rgba(245, 184, 61, 0.28); stroke-width: 1; }
.ring-spin { transform-box: view-box; transform-origin: 50% 50%; animation: spin 140s linear infinite; }
.ring .cst-lines { stroke: rgba(255, 214, 140, 0.6); stroke-width: 1; stroke-linecap: round; }
.ring .cst-stars { fill: #fff6dc; }
.sky-core {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 54px;
  filter: drop-shadow(0 0 14px rgba(245, 184, 61, 0.6));
  animation: float 3s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.cst .cst-lines { stroke: rgba(255, 214, 140, 0.55); stroke-width: 0.6; stroke-linecap: round; }
.cst .cst-stars { fill: #fff6dc; filter: drop-shadow(0 0 1.2px #ffe7a8); }
.cst .cst-stars circle { animation: twinkle 2.4s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: 0.35; } }
/* Backdrop across the whole hero card; kept faint so the name and title stay readable. */
.result-hero > .hero-cst {
  position: absolute;
  inset: 6px;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  opacity: 0.42;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .ring-spin, .cst .cst-stars circle, .sky-core { animation: none; }
}

.invite {
  background: #fff1d6;
  border: 1px solid #f5d38f;
  color: #6b4a00;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
}
.badge {
  align-self: center;
  background: #efe7ff;
  color: var(--night);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
}

/* ---------- input ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.field input {
  font: 500 17px var(--font);
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fffdfa;
  color: var(--ink);
  width: 100%;
}
.field input:focus { outline: 2px solid var(--primary); border-color: transparent; }
.sel-row { display: grid; gap: 8px; }
.sel-3 { grid-template-columns: 0.8fr 1fr 1.1fr; }
.sel-2 { grid-template-columns: 1fr 1fr; }
.sel-row select {
  appearance: none;
  -webkit-appearance: none;
  font: 500 17px var(--font);
  padding: 13px 30px 13px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fffdfa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236d6380' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--ink);
  width: 100%;
  min-width: 0;
}
.sel-row select:focus { outline: 2px solid var(--primary); border-color: transparent; }
.q { font-weight: 700; margin-top: 6px; }
.hint { font-size: 13px; color: var(--muted); }
.err { color: #c0392b; font-weight: 600; font-size: 14px; }
.dob { display: flex; flex-direction: column; gap: 10px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg button {
  padding: 12px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font: 600 14px var(--font);
  color: var(--ink);
  cursor: pointer;
}
.seg button.is-on { border-color: var(--primary); background: #fff1ec; color: var(--primary); }

.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 4px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font: 600 13px var(--font);
  color: var(--ink);
}
.pick span { font-size: 26px; }
.pick b { line-height: 1.2; }
.pick small { font-size: 12px; font-weight: 600; color: var(--muted); }
.pick.is-on { border-color: var(--primary); background: #fff1ec; }

/* ---------- quiz ---------- */
.progress { height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--primary); transition: width 0.3s; }
.opts { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.opt {
  text-align: left;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fffdfa;
  font: 600 16px var(--font);
  color: var(--ink);
  cursor: pointer;
}
.opt:active { background: #fff1ec; border-color: var(--primary); }

/* ---------- result ---------- */
.result-hero {
  --accent: var(--gold);
  position: relative;
  overflow: hidden;
  text-align: center;
  color: #fff;
  background: linear-gradient(160deg, var(--night) 0%, #6a1b4d 60%, var(--primary) 100%);
  border-radius: 24px;
  padding: 26px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.result-hero::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.22;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
}
.result-hero > * { position: relative; }
.result-hero .kicker { color: #ffd9a0; }
.big-emoji { font-size: 84px; line-height: 1.1; }
.result-hero h1 { font-size: 34px; }
.r-alias { font-size: 15px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: #ffd9a0; margin-top: -4px; }
.r-title { color: var(--gold); font-weight: 800; font-size: 20px; }
.r-line { font-size: 16px; opacity: 0.95; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.chips span { background: rgba(255, 255, 255, 0.14); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }

.share { display: flex; flex-direction: column; gap: 8px; }
.share-title { font-weight: 700; text-align: center; color: var(--muted); font-size: 14px; }
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-row .btn-wa { grid-column: 1 / -1; }
.share-row .btn { padding: 12px 6px; font-size: 13px; }

.traits { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.traits li { padding-left: 26px; position: relative; font-size: 16px; font-weight: 500; }
.traits li::before { content: "✦"; position: absolute; left: 4px; color: var(--primary); }
.big-line { font-size: 18px; font-weight: 700; }

.style-card { background: linear-gradient(135deg, #fff6e0, #ffffff); }
.style-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 22px; font-weight: 800; color: var(--night); }
.style-name .sign-art { width: 36px; height: 36px; padding: 3px; }

.lucky { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; align-items: stretch; }
.lucky > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 112px;
  padding: 14px 6px 12px;
  border-radius: 14px;
  background: #fffaf2;
}
.lucky-face {
  flex: 1;
  width: 100%;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.lucky small { color: var(--muted); font-size: 12px; line-height: 1.2; }
.lucky-face b { font-size: 14px; font-weight: 800; line-height: 1.2; max-width: 100%; overflow-wrap: break-word; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); flex: none; }
.num { font-size: 28px; font-weight: 800; color: var(--primary); line-height: 1; }
.day { font-size: 13px; font-weight: 800; line-height: 1.2; max-width: 100%; overflow-wrap: break-word; }

.matches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.match { display: flex; flex-direction: column; gap: 2px; align-items: center; padding: 10px 4px; border-radius: 14px; background: #fffaf2; }
.match span { font-size: 30px; }
.match small { color: var(--good); font-weight: 800; }
.match i { font-style: normal; font-size: 12px; color: var(--muted); font-weight: 600; }

.compat { border: 2px solid var(--gold); }
.compat-row { display: flex; align-items: center; justify-content: center; gap: 18px; font-size: 44px; }
.pct { font-size: 36px; font-weight: 900; color: var(--primary); }
.compat-names { text-align: center; color: var(--muted); font-weight: 600; }
.compat-level { font-size: 20px; font-weight: 800; text-align: center; }
.compat p:not(.compat-level):not(.compat-names) { text-align: center; }

/* ---------- gang board ---------- */
.gang-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 2px;
  border-radius: 12px;
  border: 1px dashed #d9cbb8;
  text-align: center;
  min-height: 82px;
  opacity: 0.7;
}
.slot span { font-size: 22px; filter: grayscale(1); }
.slot b { font-size: 11px; }
.slot i { font-style: normal; font-size: 10px; color: var(--muted); }
.slot small { font-size: 10px; color: var(--muted); word-break: break-word; }
.slot.is-filled { border: 1px solid var(--gold); background: #fff6e0; opacity: 1; }
.slot.is-filled span { filter: none; }
.slot.is-filled small { color: var(--ink); font-weight: 700; }
.gang-missing { font-weight: 700; color: var(--primary); text-align: center; }

/* ---------- gate ---------- */
.gate { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.locked {
  background: var(--night);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  position: relative;
  width: 100%;
}
.locked:active { transform: scale(0.99); }
.lock-title { font-weight: 800; font-size: 18px; color: var(--gold); }
.lock-sub { line-height: 1.5; }
.locked-rows { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.locked-row { display: flex; align-items: center; gap: 10px; }
.blur-bar { flex: 1; height: 12px; border-radius: 6px; background: rgba(255, 255, 255, 0.35); filter: blur(3px); }
.locked-row:nth-child(2) .blur-bar { flex: 0.8; }
.locked-row:nth-child(3) .blur-bar { flex: 0.6; }
.unlock-pill {
  align-self: center;
  margin-top: 8px;
  background: var(--gold);
  color: var(--night);
  font-weight: 800;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 999px;
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.06); } }

/* unlock sheet */
.gate-sheet { display: flex; flex-direction: column; gap: 12px; text-align: center; }
.gate-emoji { font-size: 56px; position: relative; display: inline-block; align-self: center; }
.gate-emoji span { position: absolute; right: -16px; bottom: -4px; font-size: 26px; }
.gate-sub { color: var(--muted); }
.gate-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.gate-points li { background: #fff6e0; border-radius: 12px; padding: 12px 12px 12px 38px; position: relative; font-weight: 600; }
.gate-points li::before { content: "✓"; position: absolute; left: 14px; color: var(--good); font-weight: 900; }
.gate-safe { font-size: 12px; color: var(--muted); }
.transition { font-size: 14px; color: var(--muted); text-align: center; padding: 0 6px; }

/* Shared landing: sender's card + the visitor's "?" card, filled with the match after the input. */
.duo-match { display: flex; flex-direction: column; gap: 12px; text-align: center; }
.duo-match h2 { font-size: 21px; }
.duo-cards { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.duo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-height: 236px;
  padding: 16px 10px 18px;
  border: 0;
  border-radius: 20px;
  color: #fff;
  font: inherit;
  text-align: center;
  background: linear-gradient(160deg, var(--night) 0%, #6a1b4d 100%);
  box-shadow: var(--shadow);
}
html[data-art="sky"] .duo-card:not(.is-empty) { background: url("../img/starfield.svg") repeat, linear-gradient(160deg, var(--night) 0%, #6a1b4d 100%); }
.duo-art { display: block; width: 96px; height: 96px; margin-bottom: 4px; border-radius: 50%; background: radial-gradient(circle, rgba(74, 34, 131, 0.9) 0%, rgba(43, 16, 85, 0) 70%); }
.duo-art .cst { display: block; width: 100%; height: 100%; }
.duo-art .cst .cst-lines { stroke: rgba(255, 214, 140, 0.85); stroke-width: 1.4; }
.duo-emoji { font-size: 56px; line-height: 1.2; }
.duo-card small { font-size: 12px; font-weight: 800; color: var(--gold); word-break: break-word; }
.duo-card b { font-size: 17px; line-height: 1.2; }
.duo-card i { font-style: normal; font-size: 12px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: #ffd88a; }
.duo-title { font-size: 13px; font-weight: 700; color: #f5d38f; line-height: 1.3; }
.duo-card.is-empty {
  justify-content: center;
  color: var(--ink);
  background: #fffaf2;
  border: 2px dashed var(--primary);
  box-shadow: none;
  cursor: pointer;
}
.duo-card.is-empty:active { transform: scale(0.98); }
.duo-card.is-empty small { color: var(--muted); }
.duo-q {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: #fff1ec;
  color: var(--primary);
  font-size: 46px;
  font-weight: 900;
  animation: pulse 1.8s ease-in-out infinite;
}
.duo-tap { margin-top: 8px; padding: 7px 12px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 13px; font-weight: 800; }
.duo-vs {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  min-width: 58px;
  height: 58px;
  padding: 0 6px;
  border-radius: 999px;
  border: 3px solid var(--bg);
  background: var(--gold);
  color: var(--night);
  font-size: 17px;
  font-weight: 900;
  box-shadow: var(--shadow);
}
.duo-vs.is-empty { background: var(--line); color: var(--muted); font-size: 22px; }
.duo-hint { font-size: 14px; color: var(--muted); }
.duo-result { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.duo-about { margin-top: 10px; font-size: 13px; font-weight: 800; color: var(--muted); text-align: center; letter-spacing: 0.3px; }
.duo-match.is-new .is-me { animation: duo-flip 0.7s ease-out; }
.duo-match.is-new .duo-vs { animation: duo-pop 0.5s 0.5s ease-out both; }
.duo-match.is-new .duo-result { animation: up 0.4s 0.8s ease-out both; }
@keyframes duo-flip { from { transform: rotateY(90deg); opacity: 0.3; } to { transform: none; opacity: 1; } }
@keyframes duo-pop { from { transform: translate(-50%, -50%) scale(0.3); } 70% { transform: translate(-50%, -50%) scale(1.15); } to { transform: translate(-50%, -50%) scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .duo-q, .duo-match.is-new .is-me, .duo-match.is-new .duo-vs, .duo-match.is-new .duo-result { animation: none; }
}

/* Shared landing: the recipient's test entry stays on screen from the first paint.
   Sticky-in-flow sat below the friend's profile, so a phone never saw it. */
.sticky-cta {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 0;
  width: min(480px, 100%);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  padding: 28px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 72%, rgba(255, 248, 240, 0));
  pointer-events: none;
}
.sticky-cta .btn,
.sticky-cta .micro { pointer-events: auto; }
.app:has(.sticky-cta) {
  padding-bottom: calc(128px + env(safe-area-inset-bottom));
}

/* ---------- detail ---------- */
.record-badge {
  background: rgba(255, 255, 255, 0.95);
  color: var(--good);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 999px;
}
.detail-hero h1 { font-size: 26px; }
.signals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sig { border-left: 4px solid var(--neutral); padding: 8px 0 8px 12px; }
.sig-good { border-color: var(--good); }
.sig-warn { border-color: var(--warn); }
.sig-label { display: block; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 2px; }
.focus { border: 2px solid var(--primary); }
.detail-actions { display: flex; flex-direction: column; gap: 10px; }
.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 4px solid var(--line);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* detail: signal cards */
.sig-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.sig-ic { font-size: 18px; }
.sig-head .sig-label { margin: 0; flex: 1; }
.sig-no { display: none; }
.chip { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.chip-good { background: #e3f6ea; color: var(--good); }
.chip-warn { background: #fff1d6; color: #9a6200; }
.chip-neutral { background: #eeebf3; color: var(--neutral); }
.sig details { margin-top: 6px; }
.sig summary { font-size: 13px; font-weight: 700; color: var(--primary); cursor: pointer; }
.sig details p { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* hook: intro preview + Rashi wheel (wheel is reused by the match checker) */
.preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preview { background: #fffaf2; border: 1px solid var(--line); border-radius: 12px; padding: 12px 10px; font-weight: 700; font-size: 14px; }
.wheel { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.wheel-btn {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffaf2;
  font-size: 24px;
  cursor: pointer;
  transition: transform 0.15s;
}
.wheel-btn:active { transform: scale(0.92); }
.wheel-btn.is-on { background: var(--night); border-color: var(--night); transform: scale(1.06); }
/* Constellation badge on word tiles (sky skins): light stars need the night background. */
.sign-art { display: block; width: 52px; height: 52px; padding: 5px; border-radius: 12px; background: var(--night); flex: none; }
.sign-art .cst { display: block; width: 100%; height: 100%; }
.sign-art .cst .cst-lines { stroke: rgba(255, 214, 140, 0.85); stroke-width: 3.4; }
.wheel .sign-art { width: 38px; height: 38px; padding: 3px; margin-bottom: 2px; }
.slot .sign-art { width: 30px; height: 30px; padding: 2px; border-radius: 8px; }
.slot:not(.is-filled) .sign-art { opacity: 0.55; }
.wheel-btn.is-on .sign-art { box-shadow: 0 0 0 2px var(--gold); }

/* Word tiles (skin.json emojiIcons: false): sign name + English name instead of an emoji. */
.wheel.is-text { grid-template-columns: repeat(4, 1fr); }
.wheel.is-text .wheel-btn { aspect-ratio: auto; min-height: 56px; padding: 8px 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink); font-family: var(--font); }
.wheel.is-text .wheel-btn b { font-size: 13px; line-height: 1.15; word-break: break-word; }
.wheel.is-text .wheel-btn small { font-size: 11px; color: var(--muted); font-weight: 600; }
.wheel.is-text .wheel-btn.is-on, .wheel.is-text .wheel-btn.is-on small { color: #fff; }
.peek, .check-result { margin-top: 12px; padding: 14px; border-radius: 14px; background: #fff6e0; display: flex; flex-direction: column; gap: 6px; text-align: center; }
.peek p, .check-result p { margin: 0; }

/* hook: vibe meter */
.vibe-row { display: grid; grid-template-columns: 104px 1fr 30px; align-items: center; gap: 10px; margin: 8px 0; }
.vibe-label { font-size: 14px; font-weight: 700; }
.vibe-row b { text-align: right; font-size: 14px; }
.vibe-bar { height: 12px; border-radius: 12px; background: var(--line); overflow: hidden; }
.vibe-bar span { display: block; height: 100%; border-radius: 12px; animation: grow 0.9s ease-out; }
.vibe-drama { background: linear-gradient(90deg, #ff8a65, var(--primary)); }
.vibe-loyalty { background: linear-gradient(90deg, #81c784, var(--good)); }
.vibe-overthink { background: linear-gradient(90deg, #b39ddb, #6a3dc4); }
.vibe-spend { background: linear-gradient(90deg, #ffe082, var(--gold)); }
@keyframes grow { from { width: 0; } }

/* hook: green / red flags */
.flag-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.flag-col { border-radius: 14px; padding: 12px; }
.flag-col.is-green { background: #e3f6ea; }
.flag-col.is-red { background: #fde3df; }
.flag-col ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; font-weight: 600; display: flex; flex-direction: column; gap: 4px; }

/* hook: today line + locked weekly teaser */
.today-lock {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed #d9cbb8;
  border-radius: 12px;
  background: #fffaf2;
  font: 700 14px var(--font);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.today-lock .blur-bar { flex: 1; background: #d9cbb8; }

/* detail: tabs (5 tabs scroll sideways on narrow phones) */
.tabs {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--bg);
  padding: 6px 0;
  margin: 0 -2px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font: 700 14px var(--font);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.tab.is-on { background: var(--night); color: #fff; border-color: var(--night); }
.tab-body { display: flex; flex-direction: column; gap: 14px; }

/* detail: festival banner + sheet */
.fest-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #ffcf5c, #ff8a3d);
  color: var(--night);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.fest-ic { font-size: 30px; }
.fest-text { flex: 1; display: flex; flex-direction: column; }
.fest-text b { font-size: 16px; }
.fest-text small { font-size: 13px; font-weight: 600; opacity: 0.85; }
.fest-sheet { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.fest-sheet h2 { text-align: center; }
.fest-sheet h4 { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.fest-list { margin: 0; padding-left: 20px; font-weight: 600; }
.fest-skip, .fest-tip { margin: 0; font-weight: 600; }
.fest-tip { background: #fff6e0; border-radius: 12px; padding: 10px 12px; }

/* detail: money profile */
.pro-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.pro-list li { display: flex; gap: 12px; align-items: flex-start; }
.pro-ic { font-size: 24px; line-height: 1; }
.pro-list b { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.pro-list p { margin: 2px 0 0; font-weight: 600; }
.twin-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 4px 0 8px; }
.twin-emoji { font-size: 44px; }
/* Word badges (skin.json emojiIcons: false) in place of the type emoji. */
.twin-emoji.is-word, .role-emoji.is-word, .hc-emoji.is-word {
  font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.1;
  min-width: 64px; padding: 8px 6px; border-radius: 10px; text-align: center;
  background: var(--night); color: var(--gold);
}
.twin-emoji.is-word, .role-emoji.is-word {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.twin-emoji.is-word .sign-art, .role-emoji.is-word .sign-art {
  width: 44px; height: 44px; padding: 3px; background: transparent;
}
.role-emoji.is-word .sign-art { width: 36px; height: 36px; }
.twin-emoji.is-word b, .role-emoji.is-word b { font-weight: 800; }
.twin-emoji.is-word { font-size: 15px; min-width: 96px; padding: 10px 12px 8px; }
.twin-score { font-size: 28px; font-weight: 900; color: var(--primary); }
.twin .big-line { text-align: center; }

/* detail: daily flip card */
.dcard { display: block; width: 100%; height: 210px; padding: 0; border: 0; background: none; perspective: 900px; cursor: pointer; font: inherit; }
.dcard-inner { position: relative; display: block; width: 100%; height: 100%; transition: transform 0.6s; transform-style: preserve-3d; }
.dcard.is-flipped .dcard-inner { transform: rotateY(180deg); }
.dcard-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  border-radius: var(--radius);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  text-align: center;
}
.dcard-back { background: repeating-linear-gradient(45deg, #2b1055 0 14px, #3a1870 14px 28px); color: #ffe8c2; }
.dcard-om { font-size: 46px; }
.dcard-front { transform: rotateY(180deg); background: linear-gradient(160deg, #fff4d6, #ffe0b8); color: var(--ink); }
.dcard-front b { font-size: 20px; }
.dcard-emoji { font-size: 44px; }
.lucky-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 12px; transition: filter 0.3s; }
.lucky-row.is-veiled { filter: blur(5px); }
.lchip { background: #fffaf2; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.streak { text-align: center; font-weight: 700; color: var(--primary); min-height: 1.4em; margin: 8px 0 0; }

/* detail: weekly outlook */
.week-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.week { padding: 10px 12px; border-radius: 12px; background: #fffaf2; }
.week.is-now { background: #fff1d6; outline: 2px solid var(--gold); }
.week-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.week p { margin: 2px 0 0; font-size: 14px; }
.stars { color: var(--gold); letter-spacing: 1px; }

/* detail: gang roles */
.role-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.role { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: #fffaf2; }
.role.is-me { background: #fff1d6; }
.role-emoji { font-size: 30px; }
.role small { display: block; color: var(--muted); font-weight: 700; }
.role b { display: block; }
.role p { margin: 0; font-size: 14px; }
.open-title { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.open-roles { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ochip { display: inline-flex; align-items: center; gap: 6px; border: 1px dashed #d9cbb8; border-radius: 999px; padding: 4px 10px 4px 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ochip .sign-art { width: 26px; height: 26px; padding: 2px; border-radius: 8px; }

/* detail: myth or fact */
.myth-top { display: flex; justify-content: space-between; align-items: baseline; }
.myth-bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin: 4px 0 14px; }
.myth-bar span { display: block; height: 100%; background: var(--primary); transition: width 0.3s; }
.myth-q { font-size: 19px; font-weight: 800; line-height: 1.35; margin: 0 0 14px; }
.myth-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-good { background: var(--good); color: #fff; border-color: var(--good); }
.btn.is-wrong { background: #fde3df; border-color: var(--primary); color: var(--primary); }
.myth-btns .btn:disabled { opacity: 1; cursor: default; }
.myth-a { margin: 14px 0 10px; padding: 12px; border-radius: 12px; }
.myth-a.is-right { background: #e3f6ea; }
.myth-a.is-wrong { background: #fff1d6; }
.myth-a p { margin: 4px 0 0; }
.myth.center .btn { width: 100%; margin-top: 8px; }

/* detail: Saathi AI chips */
.mitra-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mchip { background: #efe7ff; color: var(--night); text-decoration: none; font-weight: 700; font-size: 14px; padding: 10px 14px; border-radius: 999px; }

.foot { margin-top: 28px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.5; }

.boot { text-align: center; padding: 80px 0; color: var(--muted); }

/* ---------- skin engine blocks ---------- */
.grade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.grade-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: 12px; background: #fffaf2; }
.grade { font-size: 18px; font-weight: 900; min-width: 28px; text-align: center; border-radius: 8px; padding: 2px 6px; }
.grade-a { background: #e3f6ea; color: var(--good); }
.grade-b { background: #fff1d6; color: #9a6200; }
.grade-c { background: #eeebf3; color: var(--neutral); }
.duo-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.duo-col { padding: 10px 12px; border-radius: 14px; background: #fffaf2; }
.duo-col small { display: block; font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 4px; }
.duo-col p { margin: 0; font-weight: 600; }
.pair-axes { margin: 8px 0 12px; padding-left: 18px; text-align: left; }
.pair-axes li { margin: 4px 0; }
.caution { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.gang-grid.is-seats { grid-template-columns: repeat(4, 1fr); }

/* ---------- LIP home content card (lip/home-card/home-card.js) ---------- */
.home-card {
  background: linear-gradient(160deg, #fff 0%, #fff7ec 100%);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent, var(--gold));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin: 0 0 14px;
}
.hc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.hc-badge { font-size: 11px; font-weight: 800; color: var(--good); background: #e3f6ea; padding: 3px 9px; border-radius: 999px; }
.hc-kicker { font-size: 12px; color: var(--muted); }
.hc-head { display: flex; gap: 12px; align-items: center; }
.hc-emoji { font-size: 38px; line-height: 1; }
.hc-art {
  width: 128px; height: 148px; margin: 0; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 16px;
  background: #f4f0fb;
}
.hc-art .hc-cst { width: 108px; height: 108px; }
.hc-art .cst-lines { stroke: rgba(74, 34, 131, 0.55); stroke-width: 1.5; }
.hc-art .cst-stars { fill: #4a2283; filter: none; }
.hc-art figcaption {
  font-size: 11px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--night);
}
.hc-title { display: block; font-size: 17px; color: var(--night); }
/* Sky skins sit on the dashboard like the other LIP cards: plain white, the sign tile carries the art. */
.home-card.is-sky {
  background: #fff; border: 0; border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}
.home-card.is-sky .hc-head { margin: 4px 0 14px; }
.hc-headline { margin: 4px 0 0; font-size: 14px; }
.hc-rows { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 6px; }
.hc-row { display: flex; gap: 8px; align-items: center; font-size: 13px; border-left: 3px solid var(--neutral); padding: 2px 0 2px 8px; }
.hc-row.sig-good { border-color: var(--good); }
.hc-row.sig-warn { border-color: var(--warn); }
.hc-actions { display: grid; gap: 8px; }
.hc-actions .btn { padding: 11px 12px; font-size: 14px; }
.hc-note { font-size: 11px; color: var(--muted); margin: 10px 0 0; }

/* ---------- LIP dashboard mock (lip/home-card, review only) ---------- */
.lip-phone { background: #f4f5f9; border-radius: 22px; padding: 0 12px 16px; margin-top: 12px; }
.lip-top { display: flex; align-items: center; gap: 12px; padding: 14px 4px; font-size: 18px; }
.lip-top b { flex: 1; }
.lip-refresh { font-size: 13px; color: var(--muted); border: 1px solid #ddd; border-radius: 999px; padding: 4px 10px; }
.lip-card { background: #fff; border-radius: 16px; padding: 14px 16px; margin: 0 0 14px; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.lip-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.lip-brand { color: #0b8ac9; }
.lip-band { display: block; font-size: 26px; color: var(--good); }
.lip-gauge { font-size: 22px; font-weight: 900; border: 6px solid var(--good); border-bottom-color: #e5e5e5; border-radius: 50%; width: 76px; height: 76px; display: grid; place-items: center; }
.lip-btn { background: #fde9df; color: #e8762d; font-weight: 800; text-align: center; border-radius: 12px; padding: 12px; }
.lip-btn.is-solid { background: #f58a3c; color: #fff; margin-top: 8px; }
.lip-ai { background: #7b4dff; color: #fff; font-size: 11px; border-radius: 6px; padding: 1px 6px; }
.hp-controls { background: #fff; border: 1px dashed #c9b; border-radius: 12px; padding: 8px 12px; font-size: 13px; margin-top: 12px; }
.hp-controls label { display: inline-flex; gap: 4px; align-items: center; margin: 4px 8px 4px 0; }
