/* Page chrome around the device: controls, guide, frame. Not part of the app design. */
:root {
  --pg-bg: #ececec; --pg-fg: #151515; --pg-mut: #6b6b6b; --pg-line: rgba(0, 0, 0, .1); --pg-card: #ffffff; --pg-btn: #151515; --pg-btn-fg: #ffffff; --pg-fill: rgba(0, 0, 0, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --pg-bg: #0e0e0e; --pg-fg: #ececec; --pg-mut: #9b9b9b; --pg-line: rgba(255, 255, 255, .12); --pg-card: #1a1a1a; --pg-btn: #ececec; --pg-btn-fg: #111111; --pg-fill: rgba(255, 255, 255, .08); color-scheme: dark; }
}
:root[data-theme="dark"] { --pg-bg: #0e0e0e; --pg-fg: #ececec; --pg-mut: #9b9b9b; --pg-line: rgba(255, 255, 255, .12); --pg-card: #1a1a1a; --pg-btn: #ececec; --pg-btn-fg: #111111; --pg-fill: rgba(255, 255, 255, .08); color-scheme: dark; }
:root { box-sizing: border-box; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html, body { height: 100%; }
body { margin: 0; background: var(--pg-bg); color: var(--pg-fg); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
#root { height: 100%; }
.pgstage { height: 100%; display: flex; flex-direction: column; min-height: 0; }
:where(.ctl, .guide, .guide-pop) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.ctl { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--pg-line); flex: none; }
.ctl-title { font-weight: 650; font-size: 14px; letter-spacing: -.01em; margin-right: auto; white-space: nowrap; }
.ctl-title small { display: block; font-weight: 400; font-size: 11.5px; color: var(--pg-mut); }
.pseg { display: inline-flex; padding: 2px; border-radius: 999px; background: var(--pg-fill); }
.pseg button { padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--pg-mut); transition: background-color .2s, color .2s; white-space: nowrap; }
.pseg button.on { background: var(--pg-card); color: var(--pg-fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.pgstage .ptog { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--pg-fill); color: var(--pg-mut); white-space: nowrap; }
.pgstage .ptog.on { background: var(--pg-btn); color: var(--pg-btn-fg); }
.stage-main { flex: 1; min-height: 0; display: flex; }
.guide { width: 330px; flex: none; overflow-y: auto; padding: 16px 12px 24px 16px; border-right: 1px solid var(--pg-line); scrollbar-width: thin; }
.guide h3 { margin: 0 0 4px; font-size: 13px; letter-spacing: -.01em; }
.guide p.hint { margin: 0 0 14px; font-size: 12px; line-height: 1.45; color: var(--pg-mut); }
.guide h4 { margin: 18px 0 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--pg-mut); }
.guide .tips { margin: 0 0 6px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; line-height: 1.4; color: var(--pg-fg); }
.guide .tips li { padding-left: 14px; position: relative; }
.guide .tips li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 4px; height: 4px; border-radius: 50%; background: var(--pg-mut); }
.jgrid { display: flex; flex-wrap: wrap; gap: 6px; }
.pgstage .jbtn { padding: 6px 11px; border-radius: 999px; font-size: 12.5px; background: var(--pg-fill); transition: background-color .15s, transform .12s; text-align: left; }
.pgstage .jbtn:hover { background: var(--pg-line); }
.pgstage .jbtn:active { transform: scale(.96); }
.device-slot { flex: 1; min-width: 0; min-height: 0; display: flex; align-items: flex-start; justify-content: center; padding: 12px 0; overflow: hidden; }
.frame-box { position: relative; }
.frame { position: absolute; left: 0; top: 0; padding: 12px; border-radius: 64px; background: #0a0a0a; box-shadow: 0 0 0 1.5px #303030 inset, 0 0 0 1px rgba(255, 255, 255, .06), 0 34px 90px rgba(0, 0, 0, .28); transform-origin: 0 0; }
.frame::before { content: ""; position: absolute; top: 24px; left: 50%; width: 118px; height: 33px; margin-left: -59px; border-radius: 20px; background: #000; z-index: 200; pointer-events: none; }
.frame { overflow: hidden; }
.frame .device { border-radius: 0; --dev-r: 52px; }
.frame::after { content: ""; position: absolute; left: 12px; top: 12px; right: 12px; bottom: 12px; border-radius: 52px; box-shadow: 0 0 0 40px #0a0a0a; pointer-events: none; z-index: 190; }
.pgstage[data-full="1"] .device-slot { padding: 0; align-items: stretch; }
.pgstage[data-full="1"] .frame-box { width: 100% !important; height: 100% !important; }
.pgstage[data-full="1"] .frame { position: static; padding: 0; border-radius: 0; box-shadow: none; background: transparent; transform: none !important; width: 100%; height: 100%; }
.pgstage[data-full="1"] .frame::before, .pgstage[data-full="1"] .frame::after { display: none; }
.pgstage[data-full="1"] .device { border-radius: 0; width: 100% !important; height: 100% !important; --dev-r: 0px; }
.guide-pop { position: absolute; inset: 0; z-index: 500; background: var(--pg-bg); overflow-y: auto; padding: 14px 16px 30px; }
.guide-pop .x { position: sticky; top: 0; float: right; padding: 6px 12px; border-radius: 999px; background: var(--pg-fill); font-size: 12.5px; font-weight: 600; }
@media (max-width: 559px) {
  .ctl { flex-wrap: nowrap; overflow-x: auto; padding: 6px 10px; gap: 6px; scrollbar-width: none; }
  .ctl::-webkit-scrollbar { display: none; }
  .ctl-title { display: none; }
  .pseg { flex: none; }
  .pseg button { padding: 5px 10px; }
  .pgstage .ptog { flex: none; padding: 5px 10px; }
}
@media (max-width: 979px) { .guide { display: none; } }
.ctl-title { display: flex; align-items: center; gap: 12px; color: var(--pg-fg); font-weight: 400; }
.ctl-title small { display: block; margin: 0; padding-left: 12px; border-left: 1px solid var(--pg-line); max-width: 260px; line-height: 1.3; }
@media (max-width: 559px) { .ctl-title { display: none; } }
.pgstage .plink { text-decoration: none; }
@media (min-width: 560px) { .pgstage .plink:first-of-type { margin-left: auto; } }

/* ---- embedded phone: screen only, drawn inside a host page's bezel ---- */
.embed, .embed body { background: transparent; overflow: hidden; }
.embed-stage { position: fixed; inset: 0; }
.embed-stage .device { border-radius: 0; }
/* the host page's bezel clips the screen to its rounded corners, so the app fills the frame edge to edge */
.embed .sbar { position: absolute; z-index: 900; top: 11px; left: 0; right: 0; height: 37px; display: flex; align-items: center; justify-content: space-between; padding: 0 33px 0 45px; pointer-events: none; color: var(--ink); font: 600 16.5px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; letter-spacing: -.01em; }
.embed .sbar-time { font-variant-numeric: tabular-nums; }
.embed .sbar-r { display: inline-flex; align-items: center; gap: 6px; }
.embed .sbar svg { display: block; fill: currentColor; }
.embed .home-bar { position: absolute; z-index: 899; left: 50%; bottom: 8px; width: 134px; height: 5px; margin-left: -67px; border-radius: 3px; background: var(--ink); opacity: .9; pointer-events: none; }
