/* Hub device simulator chrome. Tooling, not product: shared by every native-app demo version.
   The app runs in iframe#device-app, sized exactly like the device screen. */
:root {
  --s-bg: #f7f7f7; --s-ink: #222222; --s-ink2: #6a6a6a; --s-line: #ebebeb; --s-card: #ffffff; --s-chip: #f0f0f0;
  --s-brand: #ff385c; --s-shadow: 0 30px 80px rgba(0,0,0,.18), 0 6px 18px rgba(0,0,0,.10);
  color-scheme: light;
}
:root[data-sim-dark] {
  --s-bg: #0f0f10; --s-ink: #f2f2f2; --s-ink2: #a3a3a3; --s-line: #2e2e2e; --s-card: #161617; --s-chip: #242426;
  --s-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.06);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--s-bg); color: var(--s-ink); font: 14px/1.4 "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; overflow: hidden; }
button, select { font: inherit; color: inherit; }
a { color: inherit; }

.sim { display: grid; grid-template-rows: auto 1fr; height: 100dvh; }
.sim-top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--s-line); background: var(--s-card); min-width: 0; }
.sim-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-brand img { width: 26px; height: 26px; border-radius: 7px; flex: none; }
.sim-sp { flex: 1; }
.sim-ctl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sim-seg { display: inline-flex; background: var(--s-chip); border-radius: 999px; padding: 2px; }
.sim-seg button { border: 0; background: none; padding: 5px 11px; border-radius: 999px; cursor: pointer; color: var(--s-ink2); font-weight: 500; white-space: nowrap; }
.sim-seg button.on { background: var(--s-card); color: var(--s-ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.sim-btn { border: 0; background: var(--s-chip); padding: 6px 12px; border-radius: 999px; cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none; }
.sim-btn:hover, .sim-seg button:hover { color: var(--s-ink); }
select.sim-btn { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 11px) 52%; background-size: 4px 4px; background-repeat: no-repeat; }
:focus-visible { outline: 2px solid var(--s-brand); outline-offset: 2px; }

.sim-ver { position: relative; }
.sim-ver > button { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.sim-ver > button i { width: 7px; height: 7px; border-radius: 50%; background: var(--s-brand); }
.sim-ver > button i.old { background: #f5a623; }
.sim-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 320px; max-height: 70vh; overflow: auto; background: var(--s-card); border: 1px solid var(--s-line); border-radius: 16px; box-shadow: var(--s-shadow); padding: 6px; display: none; }
.sim-ver.open .sim-menu { display: block; }
.sim-menu a { display: block; padding: 8px 10px; border-radius: 10px; text-decoration: none; }
.sim-menu a:hover, .sim-menu a.on { background: var(--s-chip); }
.sim-menu a b { display: block; font-weight: 600; }
.sim-menu a span { color: var(--s-ink2); font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-menu hr { border: 0; border-top: 1px solid var(--s-line); margin: 6px 4px; }
.sim-menu .lbl { font-size: 11px; color: var(--s-ink2); padding: 6px 10px 2px; font-weight: 600; }

.sim-body { display: grid; grid-template-columns: 1fr 340px; min-height: 0; }
.sim-stage { position: relative; min-width: 0; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.sim-fit { position: relative; }
.sim-cap { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: var(--s-ink2); font-size: 12px; pointer-events: none; }

/* iPhone */
.dev { position: absolute; left: 0; top: 0; transform-origin: 0 0; border-radius: var(--dev-r-out); background: #0b0b0c; padding: var(--bezel); box-shadow: var(--s-shadow), inset 0 0 0 2px #2a2a2c, inset 0 0 0 5px #0b0b0c, inset 0 0 0 6px #3a3a3c; }
.dev-screen { position: relative; width: var(--dev-w); height: var(--dev-h); border-radius: var(--dev-r); overflow: hidden; background: #000; isolation: isolate; }
.dev-screen iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.dev-island { position: absolute; top: 11px; left: 50%; width: 126px; height: 37px; margin-left: -63px; border-radius: 20px; background: #000; z-index: 5; pointer-events: none; }
.dev-bar, .dev-home { display: none; }
.dev.se { padding: 74px 14px; border-radius: 56px; }
.dev.se .dev-island { display: none; }
.dev.se .dev-home { display: block; position: absolute; left: 50%; bottom: 12px; width: 52px; height: 52px; margin-left: -26px; border-radius: 50%; border: 2px solid #2f2f31; cursor: pointer; }
.dev.se::before { content: ''; position: absolute; top: 34px; left: 50%; width: 60px; height: 6px; margin-left: -30px; border-radius: 3px; background: #2a2a2c; }

/* Mac window */
.dev.mac { padding: 0; background: var(--s-card); border-radius: 12px; box-shadow: var(--s-shadow), 0 0 0 1px rgba(0,0,0,.12); overflow: hidden; }
.dev.mac .dev-island { display: none; }
.dev.mac .dev-bar { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; background: var(--s-chip); border-bottom: 1px solid var(--s-line); }
.dev.mac .dev-bar i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.dev.mac .dev-bar i:nth-child(2) { background: #febc2e; }
.dev.mac .dev-bar i:nth-child(3) { background: #28c840; }
.dev.mac .dev-bar span { flex: 1; text-align: center; margin-right: 52px; font-size: 13px; font-weight: 600; color: var(--s-ink2); }
.dev.mac .dev-screen { border-radius: 0 0 12px 12px; }
.dev.mac.nobar .dev-bar { display: none; }
.dev.mac.nobar .dev-screen { border-radius: 12px; }
.sim-seg[hidden], .sim-ver[hidden] { display: none !important; }

/* Panel */
.sim-panel { border-left: 1px solid var(--s-line); background: var(--s-card); display: grid; grid-template-rows: auto 1fr; min-height: 0; }
.sim-tabs { display: flex; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--s-line); }
.sim-tabs button { border: 0; background: none; padding: 6px 12px; border-radius: 999px; cursor: pointer; color: var(--s-ink2); font-weight: 600; }
.sim-tabs button.on { background: var(--s-chip); color: var(--s-ink); }
.sim-pane { overflow: auto; padding: 14px 16px 40px; }
.sc-g { margin-bottom: 16px; }
.sc-g h4 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--s-ink2); }
.sc-i { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 10px; cursor: pointer; }
.sc-i:hover { background: var(--s-chip); }
.sc-i.on { background: var(--s-ink); color: var(--s-card); }
.sc-i small { margin-left: auto; color: var(--s-ink2); font-size: 11px; }
.sc-i.on small { color: inherit; opacity: .75; }
.sp-h { font-size: 18px; font-weight: 600; margin: 0 0 2px; letter-spacing: -.01em; }
.sp-view { font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--s-brand); margin-bottom: 4px; word-break: break-word; }
.sp-route { font: 11.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--s-ink2); margin-bottom: 12px; word-break: break-all; }
.sp-p { margin: 0 0 12px; }
.sp-sec { margin: 14px 0 0; }
.sp-sec h5 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--s-ink2); }
.sp-sec ul { margin: 0; padding-left: 18px; }
.sp-sec li { margin: 3px 0; }
.sp-empty { color: var(--s-ink2); }

/* On a real phone the app fills the screen, with no frame and no panel. */
body.sim-native .sim-top, body.sim-native .sim-panel, body.sim-native .dev-island, body.sim-native .sim-cap { display: none; }
body.sim-native .sim { grid-template-rows: 1fr; }
body.sim-native .sim-body { grid-template-columns: 1fr; }
body.sim-native .sim-stage { display: block; }
body.sim-native .sim-fit { width: 100% !important; height: 100% !important; }
body.sim-native .dev { position: static; transform: none !important; padding: 0; border-radius: 0; box-shadow: none; width: 100%; height: 100%; }
body.sim-native .dev-screen { width: 100%; height: 100%; border-radius: 0; }

@media (max-width: 1000px) { .sim-body { grid-template-columns: 1fr 280px; } }
@media (max-width: 820px) { .sim-body { grid-template-columns: 1fr; } .sim-panel { display: none; } .sim-ctl .opt { display: none; } }
