/* Page around the tablet: navy brand background, side panel, device bezel, tour overlay. */
:root {
  --page-bg: #0B3D5C;
  --page-bg2: #072A40;
  --page-ink: #FFFFFF;
  --page-muted: #B9D3E3;
  --page-line: rgba(147, 210, 241, 0.25);
  --accent: #FFC93C;
  --bezel: #15191D;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 700px at 30% 40%, #124A6C 0%, var(--page-bg) 55%, var(--page-bg2) 100%);
  color: var(--page-ink);
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
}
.page-wrap { display: flex; height: 100%; }
.stage-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#stage { flex: 1; position: relative; min-height: 0; margin: 16px; }

#device {
  position: absolute; left: 50%; top: 50%;
  transform-origin: center center;
  background: var(--bezel);
  border-radius: 38px;
  padding: 26px;
  box-shadow: 0 0 0 2px #2B3138, 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 0 0 2px #000;
}
#device .cam {
  position: absolute; left: 50%; top: 10px; width: 8px; height: 8px; margin-left: -4px;
  border-radius: 50%; background: #2A3440; box-shadow: inset 0 0 2px #000;
}
body.portrait #device .cam { left: 10px; top: 50%; margin: -4px 0 0; }
#viewport {
  position: relative; overflow: hidden; border-radius: 6px;
  background: #F5F5F5; display: flex; flex-direction: column;
}
.statusbar {
  height: 24px; flex: none; background: #0B3D5C; color: #fff; font-size: 12px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 12px;
}
.sb-icons { display: inline-flex; gap: 4px; }
.navbar { height: 22px; flex: none; background: #F7F8FA; display: flex; align-items: center; justify-content: center; }
.navbar span { width: 110px; height: 4px; border-radius: 2px; background: #222; opacity: .55; }

/* Side panel */
.side {
  width: 340px; flex: none; overflow-y: auto; padding: 28px 26px 24px;
  background: rgba(7, 42, 64, 0.55); border-left: 1px solid var(--page-line);
}
.side-logo { width: 170px; display: block; margin-bottom: 18px; }
.side h1 { font-size: 22px; line-height: 1.25; margin: 0 0 10px; font-weight: 700; text-wrap: balance; }
.side h2 { font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--page-muted); margin: 26px 0 8px; font-weight: 500; }
.side .lead { color: var(--page-muted); font-size: 14px; line-height: 1.5; margin: 0 0 18px; }
.cta {
  width: 100%; background: var(--accent); color: #0B3D5C; border: 0; border-radius: 8px;
  font: 700 16px Roboto, sans-serif; padding: 13px 16px; cursor: pointer;
}
.cta:hover { filter: brightness(1.06); }
.chapters { margin: 0; padding: 0; list-style: none; counter-reset: ch; }
.chapters li { counter-increment: ch; }
.chapters button {
  width: 100%; text-align: left; background: none; border: 0; color: var(--page-ink);
  font: 400 14px Roboto, sans-serif; padding: 7px 8px; border-radius: 6px; cursor: pointer; display: flex; gap: 10px;
}
.chapters button::before { content: counter(ch); color: var(--page-muted); width: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.chapters button:hover { background: rgba(255, 255, 255, 0.08); }
.chapters button.current { background: rgba(255, 201, 60, 0.18); color: var(--accent); }
.controls { display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.ctl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--page-muted); }
.ctl-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.seg-ctl { display: inline-flex; border: 1px solid var(--page-line); border-radius: 6px; overflow: hidden; }
.seg-ctl button { background: none; border: 0; color: var(--page-muted); padding: 6px 10px; font: 500 13px Roboto, sans-serif; cursor: pointer; }
.seg-ctl button.on { background: rgba(255, 255, 255, 0.14); color: #fff; }
.ghost {
  background: none; border: 1px solid var(--page-line); color: #fff; border-radius: 6px;
  padding: 9px; font: 500 14px Roboto, sans-serif; cursor: pointer;
}
.ghost:hover { background: rgba(255, 255, 255, 0.08); }
.fine { font-size: 11px; color: var(--page-muted); opacity: .8; margin-top: 22px; line-height: 1.5; }

/* Embed mode: tablet + small bar only */
.embed-bar { display: none; justify-content: center; gap: 8px; padding: 0 12px 12px; }
.pill {
  background: rgba(255, 255, 255, 0.1); color: #fff; border: 1px solid var(--page-line);
  border-radius: 999px; padding: 7px 14px; font: 500 13px Roboto, sans-serif; cursor: pointer;
}
.pill.primary { background: var(--accent); color: #0B3D5C; border-color: var(--accent); font-weight: 700; }
html.embed .side { display: none; }
html.embed .embed-bar { display: flex; }
html.embed #stage { margin: 10px; }

/* Narrow page (phones): side panel goes below, page scrolls */
@media (max-width: 900px) {
  body { overflow: auto; }
  .page-wrap { flex-direction: column; height: auto; min-height: 100%; }
  .stage-area { height: auto; }
  #stage { flex: none; margin: 10px 8px; aspect-ratio: 1190 / 763; max-height: 85vh; }
  body.portrait #stage { aspect-ratio: 763 / 1190; }
  .side { width: auto; border-left: 0; border-top: 1px solid var(--page-line); padding: 22px 16px; }
  .embed-bar { display: flex; }
  .side .cta { display: none; }
}
html.embed body { overflow: hidden; }
html.embed .page-wrap { height: 100%; }
html.bare .embed-bar { display: none; }
html.bare #stage { flex: 1; aspect-ratio: auto; max-height: none; }
html.embed .stage-area { height: 100%; }

/* Tour */
#tour-spot {
  display: none; position: fixed; z-index: 50; pointer-events: none; border-radius: 10px;
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 9999px rgba(3, 18, 28, 0.55);
  transition: left .25s, top .25s, width .25s, height .25s;
}
#tour-bubble {
  display: none; position: fixed; z-index: 51; width: 330px; max-width: calc(100vw - 16px);
  background: #fff; color: #222; border-radius: 12px; padding: 16px 18px 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35); transition: left .25s, top .25s;
}
#tour-bubble h3 { margin: 2px 0 6px; font-size: 17px; color: #0B3D5C; }
#tour-bubble p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: #333; }
.tb-step { font-size: 11px; letter-spacing: 1px; color: #52646F; font-weight: 500; }
.tb-btns { display: flex; align-items: center; gap: 6px; }
.tb-btns .grow { flex: 1; }
.tb-btns button { border: 0; border-radius: 6px; padding: 8px 12px; font: 500 14px Roboto, sans-serif; cursor: pointer; background: none; color: #0066CC; }
.tb-btns .tb-next { background: #0B3D5C; color: #fff; }
.tb-btns .tb-exit { color: #52646F; padding-left: 0; }
