* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: #ECEDF1; color: var(--c-text-main); font-family: var(--font-latin); display: flex; flex-direction: column; min-height: 100vh; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
bdi { unicode-bidi: isolate; }
.ic { flex: none; display: block; }
[dir=rtl] .flip-rtl { transform: scaleX(-1); }

.shell-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--c-border-1); }
.shell-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--c-text-brand); }
.shell-brand img { height: 26px; }
.shell-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; background: var(--c-bg-floating); border-radius: 999px; padding: 3px; }
.seg button { padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--c-text-general); }
.seg button.on { background: var(--c-primary); color: #fff; }
.shell-reset { font-size: 13px; color: var(--c-text-secondary); padding: 6px 12px; border: 1px solid var(--c-border-1); border-radius: 999px; }

.stage { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding: 24px 16px; }
.device { position: relative; width: var(--device-w); height: min(var(--device-h), calc(100dvh - var(--shell-h) - 48px)); min-height: 560px; background: var(--c-ground); border-radius: 40px; box-shadow: 0 0 0 10px #1d1d1f, 0 20px 60px rgba(0, 0, 0, .25); overflow: hidden; display: flex; flex-direction: column; }
.device[lang=ar] { font-family: var(--font-ar); }
.device-statusbar { position: absolute; inset-inline: 0; top: 0; height: 34px; display: flex; justify-content: space-between; align-items: center; padding: 0 26px; font-size: 12px; font-weight: 600; z-index: 30; pointer-events: none; direction: ltr; }
.device[data-tone=brand] .device-statusbar { color: #fff; }
.screen-viewport { position: relative; flex: 1; min-height: 0; }
.screen { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; background: var(--c-bg-floating); display: none; flex-direction: column; padding-top: 34px; scrollbar-width: none; }
.screen::-webkit-scrollbar { display: none; }
.screen.active { display: flex; }
/* White full-page screens: the status-bar strip above them is white too. */
.screen:has(> .guide, > .auth, > .pin-wrap, > .result) { background: #fff; }
.bottom-nav { display: flex; border-top: 1px solid var(--c-border-2); background: #fff; padding: 6px 0 14px; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--c-text-secondary); }
.nav-item.on { color: var(--c-primary); }

@media (max-width: 480px) {
  .stage { padding: 0; }
  .device { width: 100%; height: calc(100vh - 96px); min-height: 0; border-radius: 0; box-shadow: none; }
  .shell-bar { padding: 8px 12px; }
  .shell-brand span { display: none; }
}
