.shell {
  --watch-size: min(90%, 380px);
  /* Dial chrome: former white → blue; gold restored for rim/tabs/tips */
  --watch-ink-blue: #4a90d9;
  --watch-ink-gold: #e8c547;
  --watch-halo-blue: rgba(74, 144, 217, 0.85);
  --watch-halo-gold: rgba(232, 197, 71, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  max-width: 36rem;
  margin-inline: auto;
}

.watch-page-intro {
  max-width: 36rem;
  margin: 0 auto 0.75rem;
  text-align: center;
}

.watch-page-intro h1 {
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
}

.watch-page-intro .muted {
  max-width: 32rem;
  margin-inline: auto;
  font-size: 0.92rem;
}

@media (min-width: 900px) {
  .shell {
    --watch-size: min(48vw, 360px);
  }

  body.has-app-sidebar .shell {
    --watch-size: min(100%, 360px);
  }
}

.shellCompact {
  --watch-size: min(96vw, 100dvh, 360px);
  gap: 0.45rem;
  min-height: 100dvh;
  /* Pin modes+bezel; overlays below must not re-center the dial. */
  justify-content: flex-start;
  padding: 0.4rem;
  padding-top: max(0.4rem, calc((100dvh - var(--watch-size) - 4.2rem) / 2));
  box-sizing: border-box;
}

body.has-app-sidebar .shellCompact {
  --watch-size: min(100%, 100dvh, 360px);
}

.modeToggle {
  display: flex;
  gap: 0.3rem;
  width: min(100%, var(--watch-size));
  padding: 0.28rem;
  border-radius: 999px;
  border: 1px solid var(--line-silver);
  background: rgba(11, 16, 38, 0.75);
  box-shadow: inset 0 1px 0 rgba(232, 234, 239, 0.12);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.modeToggle::-webkit-scrollbar {
  display: none;
}

.modeBtn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--watch-ink-blue);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.15;
  padding: 0.4rem 0.45rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.modeLabelShort {
  display: none;
}

.modeLabelFull {
  display: inline;
}

.modeBtn:active {
  transform: scale(0.98);
}

.modeBtnActive {
  background: linear-gradient(135deg, rgba(232, 197, 71, 0.28), rgba(232, 197, 71, 0.12));
  color: var(--gold-soft);
  box-shadow: inset 0 0 0 1px rgba(232, 197, 71, 0.35);
}

.bezel {
  position: relative;
  width: var(--watch-size);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 3.2%;
  /* Aged teak bezel + gold/silver chrome edge */
  background:
    radial-gradient(circle at 28% 22%, rgba(240, 216, 120, 0.2), transparent 42%),
    radial-gradient(circle at 72% 78%, rgba(200, 205, 214, 0.16), transparent 45%),
    repeating-linear-gradient(
      96deg,
      transparent 0 2px,
      rgba(26, 18, 12, 0.28) 2px 3px,
      transparent 3px 8px
    ),
    linear-gradient(160deg, #3d2918 0%, #2a1c12 40%, #141b33 78%, #0b1026 100%);
  border: 1px solid rgba(200, 205, 214, 0.4);
  box-shadow:
    0 0 0 1px rgba(232, 197, 71, 0.28) inset,
    0 0 0 2px rgba(139, 146, 158, 0.22),
    0 18px 40px rgba(0, 0, 0, 0.5),
    var(--shadow-glow);
}

.bezel--skeleton {
  pointer-events: none;
}

.face--skeleton {
  background:
    radial-gradient(circle at 50% 42%, rgba(232, 197, 71, 0.12), transparent 55%),
    radial-gradient(circle at 50% 40%, #1c2545 0%, #0b1026 70%);
  animation: watchSkeletonPulse 1.4s ease-in-out infinite;
}

.watch-ssr-loading {
  margin: 0.35rem 0 0;
  text-align: center;
  color: var(--watch-ink-blue, #4a90d9);
  font-size: 0.9rem;
}

/* SSR ships a real alert face — keep pulse subtle, not empty skeleton forever */
[data-ssr-shell="watch"][aria-busy="true"] .face {
  animation: watchSkeletonPulse 1.8s ease-in-out infinite;
}

.watch-slow-note {
  width: min(100%, var(--watch-size));
  text-align: center;
  font-size: 0.88rem;
  margin: 0;
}

@keyframes watchSkeletonPulse {
  0%,
  100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}

.face {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #1c2545 0%, #0b1026 70%);
  border: 1px solid rgba(232, 197, 71, 0.28);
  touch-action: pan-y;
  user-select: none;
}

.slideFromRight {
  animation: modeSnapIn 0.28s ease both;
}

.slideFromLeft {
  animation: modeSnapInLeft 0.28s ease both;
}

@keyframes modeSnapIn {
  from {
    opacity: 0.55;
    transform: translateX(10%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes modeSnapInLeft {
  from {
    opacity: 0.55;
    transform: translateX(-10%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.swipeHint {
  display: inline;
}

/* Life-graph center readouts */
.lifeCenterLabel {
  fill: rgba(232, 197, 71, 0.78);
  font-family: var(--font-display), "Chakra Petch", sans-serif;
  font-size: 9.8px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lifeCenterValue {
  fill: #f0d878;
  font-family: var(--font-display), "Chakra Petch", sans-serif;
  font-size: 30px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.lifeCenterMeta {
  fill: rgba(74, 144, 217, 0.85);
  font-family: var(--font-display), "Chakra Petch", sans-serif;
  font-size: 8.3px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.demoPill {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(11, 16, 38, 0.72);
  border: 1px solid rgba(232, 197, 71, 0.35);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  pointer-events: none;
}

/* —— Alert mode —— */
.alertFace {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 14% 10% 12%;
  text-align: center;
}

.alertIcon {
  width: 22%;
  max-width: 72px;
  color: var(--gold-soft);
  margin-bottom: 0.35rem;
  filter: drop-shadow(0 0 10px rgba(232, 197, 71, 0.35));
  animation: alertPulse 1.8s ease-in-out infinite;
}

.alertFace.caution .alertIcon {
  color: var(--alert);
}

.alertFace.good .alertIcon {
  color: var(--good);
}

.alertFace.neutral .alertIcon {
  color: var(--neutral);
}

.alertYam {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 4.2vw, 1.25rem);
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.25rem;
  line-height: 1.2;
}

.alertTitle {
  font-family: var(--font-display);
  font-size: clamp(0.78rem, 3.4vw, 1rem);
  font-weight: 600;
  color: var(--gold-soft);
  margin: 0 0 0.35rem;
}

.alertBody {
  font-size: clamp(0.68rem, 2.8vw, 0.82rem);
  color: var(--text-muted);
  margin: 0;
  line-height: 1.35;
  max-width: 18ch;
}

.alertClock {
  margin-top: 0.65rem;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  /* Full dd/MM/YYYY HH:mm:ss — slightly smaller than HH:mm:ss-only */
  font-size: clamp(0.72rem, 3.2vw, 0.95rem);
  color: var(--text);
  letter-spacing: 0.02em;
  line-height: 1.25;
  max-width: 22ch;
}

.alertMeta {
  margin-top: 0.25rem;
  font-size: 0.68rem;
  color: var(--text-muted);
}

@keyframes alertPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.88;
  }
}

/* —— Pro mode —— */
.proStack {
  display: grid;
  grid-template-rows: 1fr;
  height: 100%;
}

.chartOverlays {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 0.35rem 0.45rem;
  margin: 0.05rem 0 0;
  padding: 0.28rem 0.4rem;
  border: 1px solid rgba(232, 197, 71, 0.28);
  border-radius: 999px;
  background: rgba(11, 16, 38, 0.55);
  width: min(100%, var(--watch-size));
  box-sizing: border-box;
}

.chartOverlays[hidden] {
  display: none;
}

.chartOverlayOpt {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.2rem 0.45rem;
  font-family: var(--font-display), "Chakra Petch", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--watch-ink-blue);
  cursor: pointer;
  user-select: none;
  text-shadow:
    0 0 2px var(--watch-halo-blue),
    0 0 4px rgba(30, 90, 168, 0.55);
}

.chartOverlayOpt input {
  accent-color: #c62828;
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  margin: 0;
  flex-shrink: 0;
}

.chartOverlayOpt.is-soon,
.chartOverlayOpt.is-locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.chartOverlayOpt.is-locked input:disabled {
  pointer-events: none;
}

/* Compact overlay tips — lower annulus on dial face (not below bezel) */
.dialFaceTips {
  position: absolute;
  left: 50%;
  bottom: 7.5%;
  z-index: 2;
  width: 68%;
  max-width: 15.5rem;
  transform: translateX(-50%);
  pointer-events: none;
  box-sizing: border-box;
  padding: 0.28rem 0.4rem 0.32rem;
  border-radius: 0.55rem;
  background: linear-gradient(
    180deg,
    rgba(11, 16, 38, 0.12) 0%,
    rgba(11, 16, 38, 0.72) 38%,
    rgba(11, 16, 38, 0.88) 100%
  );
  text-align: center;
}

.dialFaceTipRow {
  display: block;
  margin: 0 0 0.18rem;
  line-height: 1.25;
}

.dialFaceTipRow:last-child {
  margin-bottom: 0;
}

.dialFaceTipLabel {
  display: inline;
  margin-right: 0.28rem;
  color: var(--watch-ink-gold);
  font-family: var(--font-display), "Chakra Petch", sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  -webkit-text-stroke: 0.45px var(--watch-halo-gold);
  paint-order: stroke fill;
}

.dialFaceTipText {
  color: var(--watch-ink-blue);
  font-family: var(--font-display), "Chakra Petch", sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  -webkit-text-stroke: 0.45px var(--watch-halo-blue);
  paint-order: stroke fill;
}

.rasiKasetSector {
  fill: rgba(46, 125, 50, 0.28);
  stroke: none;
  pointer-events: none;
}

.rasiKasetMark {
  fill: #1b5e20;
  font-family: var(--font-display), "Chakra Petch", sans-serif;
  font-size: 7.5px;
  font-weight: 700;
}

.rasiRueanMark {
  fill: #6a1b9a;
  font-family: var(--font-display), "Chakra Petch", sans-serif;
  font-size: 7.8px;
  font-weight: 700;
  opacity: 0.92;
}

.rasiRueanMark.is-lagna {
  fill: #c62828;
  font-size: 9px;
}

.dialWrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  height: 100%;
}

.dialWrap.is-blurred > .dial,
.dialWrap.is-blurred > .rimLive {
  filter: blur(7px);
  opacity: 0.55;
  user-select: none;
  pointer-events: none;
}

.watch-lock-overlay {
  position: absolute;
  inset: 12%;
  z-index: 4;
  display: grid;
  place-content: center;
  gap: 0.65rem;
  text-align: center;
  padding: 1rem;
  border-radius: 50%;
  background: rgba(11, 16, 38, 0.72);
  border: 1px solid rgba(232, 197, 71, 0.35);
  color: var(--text, #f3ede0);
  font-family: var(--font-display), "Chakra Petch", sans-serif;
  font-size: 0.85rem;
  line-height: 1.35;
}

.watch-lock-overlay p {
  margin: 0;
}

.dial {
  width: 100%;
  height: 100%;
  display: block;
}

/* Nested Thai rasi board (parchment mid-ring) — 60% transparent cream */
.rasiBoardFace {
  fill: rgba(242, 235, 224, 0.6);
}

.rasiBoardRim,
.rasiBoardRimInner,
.rasiBoardSquare,
.rasiBoardDiamond,
.rasiBoardCross,
.rasiBoardDiv {
  stroke: #1a1a1a;
  stroke-width: 0.7;
  fill: none;
}

.rasiBoardDiamond {
  stroke-width: 0.55;
  opacity: 0.55;
}

.rasiBoardCross {
  stroke-width: 0.85;
}

/* Thin halo — blue/gold on midnight chrome; warm gold edge on board glyphs */
.rasiBoardLabel,
.rasiGlyph,
.rasiBoardCenter,
.rasiBoardCenterMeta,
.rasiKasetMark,
.rasiRueanMark {
  paint-order: stroke fill;
  stroke: rgba(232, 197, 71, 0.55);
  stroke-width: 0.45px;
  text-shadow: none;
}

.rimReadouts text,
.lifeCenterLabel,
.lifeCenterValue {
  paint-order: stroke fill;
  stroke: var(--watch-halo-gold);
  stroke-width: 0.45px;
  text-shadow: none;
}

.lifeCenterMeta {
  paint-order: stroke fill;
  stroke: var(--watch-halo-blue);
  stroke-width: 0.45px;
  text-shadow: none;
}

.rasiBoardLabel {
  fill: #2a2a2a;
  font-family: var(--font-display), "Chakra Petch", sans-serif;
  font-size: 7.2px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.rasiGlyph {
  font-family: var(--font-display), "Chakra Petch", sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.rasiGlyph.natal {
  fill: #111;
}

.rasiGlyph.transit {
  fill: #c62828;
}

.rasiGlyph.lagnaMark {
  font-size: 10.5px;
}

.rasiBoardCenter {
  fill: #222;
  font-family: var(--font-display), "Chakra Petch", sans-serif;
  font-size: 8.4px;
  font-weight: 700;
  opacity: 0.9;
}

.rasiBoardCenterMeta {
  fill: #555;
  font-family: var(--font-display), "Chakra Petch", sans-serif;
  font-size: 6.4px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* Curved rim metrics — warm gold on midnight face */
.rimReadouts text {
  fill: #f0d878;
  font-family: var(--font-display), "Chakra Petch", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* Screen-reader / AT live region — not painted on dial */
.rimLive {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.footerNote {
  width: min(100%, var(--watch-size));
  text-align: center;
  font-size: 0.95rem;
  color: var(--watch-ink-blue);
  margin: 0;
  line-height: 1.4;
}

@media (min-width: 720px) {
  .footerNote .footerNoteExtra {
    display: none;
  }
}

.squareSafe {
  border-radius: 22%;
}

.squareSafe .face {
  border-radius: 18%;
}

/* Compact / Wear / round-ish viewports */
@media (max-width: 400px) {
  .shell:not(.shellCompact) {
    --watch-size: min(94%, 340px);
  }

  .modeBtn {
    font-size: 0.88rem;
    min-height: 52px;
  }

  .modeLabelFull {
    display: none;
  }

  .modeLabelShort {
    display: inline;
  }

  .chartOverlays {
    border-radius: 1.15rem;
  }

  .chartOverlayOpt {
    font-size: 0.88rem;
    min-height: 44px;
    padding: 0.28rem 0.4rem;
  }

  .rimReadouts text {
    font-size: 8.2px;
  }

  .footerNote {
    font-size: 0.88rem;
  }
}

@media (max-width: 280px) {
  .shell {
    --watch-size: 96%;
  }

  .modeToggle {
    gap: 0.2rem;
    padding: 0.18rem;
  }

  .modeBtn {
    font-size: 0.8rem;
    min-height: 48px;
    padding: 0.32rem 0.35rem;
  }

  .demoPill {
    font-size: 0.95rem;
  }

  .footerNote {
    display: none;
  }
}

/* Round CSS hint for Wear OS / circular displays */
@media (max-width: 400px) and (max-height: 450px) {
  .shellCompact .bezel {
    border-radius: 50%;
  }

  .shellCompact .modeToggle {
    width: min(96%, 240px);
  }
}
