.iphone-page { overscroll-behavior-y: none; }
.iphone-shell {
  --phone-bg: #0b1422;
  --phone-panel: #132237;
  --phone-edge: #2a4059;
  --phone-text: #f1f6ff;
  --phone-muted: #adc0d8;
  --phone-accent: #80d9ff;
  --phone-bar: #0e1b2df5;
  --phone-width: 640px;
  --bottom-inset: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--phone-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}
.iphone-shell .shell { display: block; min-height: 100dvh; }
.iphone-shell .sidebar, .iphone-shell .mobilebrand, .iphone-shell .topbar [data-s21-clock] { display: none; }
.iphone-shell .main {
  max-width: var(--phone-width);
  margin-inline: auto;
  padding: 0 max(16px, env(safe-area-inset-right)) calc(92px + var(--bottom-inset)) max(16px, env(safe-area-inset-left));
}
.iphone-shell .topbar {
  position: sticky;
  top: 0;
  z-index: 1010;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0 -3px 16px;
  padding: calc(11px + env(safe-area-inset-top, 0px)) 3px 12px;
  border-bottom: 1px solid var(--phone-edge);
  background: var(--phone-bar);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.iphone-shell .topbar .eyebrow { color: var(--phone-muted); font-size: 11px; letter-spacing: .045em; }
.iphone-shell .topbar h1 { margin: 4px 0 0; color: var(--phone-text); font-size: clamp(24px, 7vw, 32px); letter-spacing: -.035em; }
.iphone-header-actions { display: flex; align-items: center; gap: 6px; }
.iphone-shell #duty { min-height: 44px; padding: 8px; font-size: 12px; white-space: nowrap; }
.iphone-shell button.iphone-icon-button {
  display: grid; place-items: center; width: 44px; height: 44px; min-width: 44px;
  margin: 0; padding: 0; color: var(--phone-accent); background: var(--phone-panel);
  border: 1px solid var(--phone-edge); border-radius: 12px;
}
.iphone-icon-button svg { width: 21px; height: 21px; }
.iphone-icon-button[aria-busy="true"] svg { animation: iphone-spin .85s linear infinite; }
.iphone-shell .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.iphone-shell .stats .stat { min-width: 0; padding: 11px 12px; border-radius: 13px; background: var(--phone-panel); }
.iphone-shell .stats .stat:nth-child(4) { display: none; }
.iphone-shell .stats .stat small:first-child { display: block; min-height: 2.3em; color: var(--phone-muted); font-size: 10px; line-height: 1.15; letter-spacing: .01em; }
.iphone-shell .stats .stat small:last-child { display: none; }
.iphone-shell .stats strong { margin: 4px 0 0; font-size: 24px; }
.iphone-shell .workspace { display: block; min-width: 0; }
.iphone-shell .workspace > :first-child > .row h2 { font-size: 17px; }
.iphone-shell .workspace > :first-child > .row small { color: var(--phone-muted); }
.iphone-shell .workspace #detail { display: none; }
.iphone-shell.iphone-detail-open .workspace > :first-child { display: none; }
.iphone-shell.iphone-detail-open .workspace #detail { display: block; }
.iphone-shell.iphone-detail-open .main > .stats { display: none; }
.iphone-shell .orders { display: grid; max-height: none; overflow: visible; gap: 10px; padding: 0; }
.iphone-shell .orders .order { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--phone-edge); border-radius: 15px; }
.iphone-shell .orders .order.selected { border-color: var(--phone-edge); box-shadow: none; }
.iphone-shell .orders .order:active { border-color: var(--phone-accent); }
.iphone-shell .order .address, .iphone-shell .detail p { overflow-wrap: anywhere; }
.iphone-shell .detail { padding: 16px; border-radius: 16px; }
.iphone-shell .detail .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.iphone-shell .detail .actions > * { min-width: 0; min-height: 44px; padding: 9px; }
.iphone-shell .detail .timeline { flex-wrap: wrap; row-gap: 7px; overflow: visible; }
.iphone-shell button.iphone-back { display: inline-flex; align-items: center; min-height: 44px; margin: 0 0 10px; padding: 0 12px; }
.iphone-shell .mobilebar {
  position: fixed; inset: auto 0 0; z-index: 1020;
  display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 5px;
  width: 100%; max-width: var(--phone-width); margin-inline: auto;
  padding: 6px max(9px, env(safe-area-inset-right)) calc(7px + var(--bottom-inset)) max(9px, env(safe-area-inset-left));
  border-top: 1px solid var(--phone-edge); background: var(--phone-bar);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.iphone-shell .mobilebar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 49px; width: 100%; padding: 4px 2px; border-radius: 11px; color: var(--phone-muted); font-size: 10px; line-height: 1.15; }
.iphone-shell .mobilebar button.active { color: var(--phone-accent); background: #1b3048; }
.iphone-shell .mobilebar button.iphone-hidden-tab { display: none; }
.iphone-shell .mobilebar svg { width: 22px; height: 22px; }
.iphone-shell .filter { gap: 5px; margin-top: 6px; }
.iphone-shell .filter button { min-height: 42px; }
.iphone-shell input:not([type="checkbox"]):not([type="radio"]), .iphone-shell select, .iphone-shell textarea { font-size: 16px; }
.iphone-shell #search { min-height: 45px; }
.iphone-shell .dedicated-map { height: 59vh; height: 59dvh; min-height: 330px; border-radius: 17px; }
.iphone-shell .dedicated-map #map { height: 100%; min-height: 330px; }
.iphone-shell .main > .sync { color: var(--phone-muted); font-size: 12px; }
.iphone-shell #toast { bottom: calc(82px + var(--bottom-inset)); white-space: normal; width: max-content; max-width: calc(100% - 40px); }
#iphone-refresh-status { display: none; }
.iphone-shell #iphone-refresh-status:not(:empty) {
  display: block;
  position: fixed; z-index: 3020; top: calc(env(safe-area-inset-top, 0px) + 92px); left: 50%;
  transform: translateX(-50%); max-width: calc(100% - 24px); width: max-content; padding: 8px 12px;
  border: 1px solid var(--phone-edge); border-radius: 20px; background: var(--phone-panel);
  color: var(--phone-text); font-size: 12px; pointer-events: none;
}
.iphone-shell #iphone-menu {
  position: fixed; inset: auto 0 0; max-width: var(--phone-width); width: 100%; margin: 0 auto;
  border-radius: 20px 20px 0 0; padding: 14px 16px calc(16px + var(--bottom-inset));
}
.iphone-menu-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.iphone-shell .iphone-menu-heading button { width: 44px; height: 44px; margin: 0; padding: 0; }
.iphone-shell #iphone-menu-items button { display: flex; align-items: center; gap: 10px; min-height: 48px; margin: 5px 0; text-align: left; }
#iphone-menu-items svg { width: 21px; height: 21px; }
.iphone-shell .login, .iphone-start {
  width: min(440px, calc(100% - 32px)); max-width: none;
  margin: calc(env(safe-area-inset-top, 0px) + clamp(35px, 10vh, 120px)) auto 30px;
  padding: 24px; border: 1px solid var(--phone-edge); border-radius: 23px; background: var(--phone-panel);
  box-shadow: 0 24px 70px #020a1450;
}
.iphone-shell .login .brand { margin-bottom: 24px; }
.iphone-shell .login .brand img, .iphone-start img { width: 155px; height: auto; }
.iphone-shell .login h1 { margin: 0 0 6px; font-size: 29px; letter-spacing: -.04em; }
.iphone-shell .login p { color: var(--phone-muted); }
.iphone-shell .login .kicker, .iphone-shell .login .note + .note { display: none; }
.iphone-shell .login input { min-height: 48px; }
.iphone-shell .login button { min-height: 48px; font-size: 16px; }
.iphone-shell .login #loginError:not(:empty) { color: #ffacb0; }
.iphone-install { margin-top: 18px; font-size: 13px; }
.iphone-install summary { display: list-item; min-height: 44px; padding: 12px 0; color: var(--phone-accent); cursor: pointer; }
@keyframes iphone-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .iphone-shell *, .iphone-shell *::before, .iphone-shell *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; } }
