/* ==========================================================================
   iOS APP SHELL
   Phone-only presentation layer for mobile templates. Sits on top of
   tokens.css + base.css and uses the same custom properties, so a rebrand is
   still a single-file change. Never loaded by the desktop business apps.
   ========================================================================== */

/* --- stage: bezel on a wide screen, full bleed on a real phone ----------- */
/* The page is a column: bar, then stage. The stage takes what is left and the
   phone is capped to it, so the bottom tab bar is always on screen. */
/* definite height, not min-height: flex:1 has nothing to distribute otherwise */
.ios-page{display:flex;flex-direction:column;height:100dvh;overflow:hidden}
.ios-page .preview-bar{flex:none}
.ios-stage{flex:1;min-height:0;display:grid;place-items:center;overflow:hidden;
  background:var(--bg-sunken);padding:24px}

.ios{position:relative;display:flex;flex-direction:column;
  width:393px;height:852px;overflow:hidden;transform-origin:top center;
  background:var(--bg-app);color:var(--text);
  border:11px solid #0a0a0c;border-radius:52px;
  box-shadow:0 0 0 2px #26262b,0 30px 70px rgba(0,0,0,.55)}

@media (max-width:520px){
  .ios-stage{padding:0;display:block;min-height:0;background:var(--bg-app)}
  .ios{width:100%;height:100dvh;border:0;border-radius:0;box-shadow:none}
}

/* --- status bar + dynamic island ---------------------------------------- */
.ios__status{flex:none;display:flex;align-items:center;justify-content:space-between;
  height:52px;padding:0 28px 0 32px;font-size:14px;font-weight:600;
  letter-spacing:.01em;color:var(--text);position:relative;z-index:2}
.ios__island{position:absolute;top:10px;left:50%;transform:translateX(-50%);
  width:112px;height:30px;border-radius:16px;background:#0a0a0c}
@media (max-width:520px){.ios__island{display:none}}
.ios__sig{display:flex;align-items:center;gap:5px}
.ios__sig i{display:block;width:3px;border-radius:1px;background:var(--text)}
.ios__sig i:nth-child(1){height:4px}.ios__sig i:nth-child(2){height:6px}
.ios__sig i:nth-child(3){height:8px}.ios__sig i:nth-child(4){height:10px}
.ios__bat{width:24px;height:12px;border:1.5px solid var(--text);border-radius:3px;
  padding:1.5px;opacity:.9}
.ios__bat span{display:block;height:100%;width:72%;border-radius:1px;background:var(--text)}

/* --- navigation bar ------------------------------------------------------ */
.ios__nav{flex:none;padding:4px 20px 10px}
.ios__eyebrow{font-size:12px;letter-spacing:.08em;text-transform:uppercase;
  color:var(--text-subtle);font-weight:600}
.ios__title{font-size:30px;line-height:1.15;font-weight:650;letter-spacing:-.02em;
  margin-top:2px}
.ios__navrow{display:flex;align-items:flex-end;justify-content:space-between;gap:12px}
.ios__avatar{flex:none;width:36px;height:36px;border-radius:50%;
  background:var(--brand-soft);color:var(--brand);
  display:grid;place-items:center;font-size:13px;font-weight:650;
  border:1px solid var(--brand-ring)}

/* --- scrolling body ------------------------------------------------------ */
.ios__body{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;
  padding:4px 20px 24px;scrollbar-width:none}
.ios__body::-webkit-scrollbar{display:none}
.ios__body>*+*{margin-top:14px}

/* --- tab bar ------------------------------------------------------------- */
.ios__tabs{flex:none;display:flex;padding:8px 8px 26px;gap:2px;
  background:var(--bg-surface);border-top:1px solid var(--border)}
@media (max-width:520px){.ios__tabs{padding-bottom:max(26px,env(safe-area-inset-bottom))}}
.ios__tab{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;
  padding:6px 2px;border:0;background:none;cursor:pointer;
  font-size:10px;font-weight:600;letter-spacing:.01em;
  color:var(--text-subtle);border-radius:12px}
.ios__tab svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.7;
  stroke-linecap:round;stroke-linejoin:round}
.ios__tab[aria-current="page"]{color:var(--brand)}
.ios__tab:hover{color:var(--text)}
.ios__tab[aria-current="page"]:hover{color:var(--brand)}

/* --- cards and rows ------------------------------------------------------ */
.ioscard{background:var(--bg-surface);border:1px solid var(--border);
  border-radius:18px;padding:16px}
.ioscard--fill{background:var(--brand);color:var(--brand-on);border-color:transparent}
.ioscard--fill .t-sub{color:var(--brand-on);opacity:.72}
.ioscard__h{display:flex;align-items:center;justify-content:space-between;gap:10px;
  margin-bottom:10px}
.ioscard__t{font-size:15px;font-weight:650;letter-spacing:-.01em}

.iosrow{display:flex;align-items:center;gap:12px;padding:12px 0;
  border-bottom:1px solid var(--border)}
.iosrow:last-child{border-bottom:0;padding-bottom:0}
.iosrow:first-child{padding-top:0}
.iosrow__main{flex:1;min-width:0}
.iosrow__t{display:block;font-size:15px;font-weight:550;letter-spacing:-.01em}
.iosrow__s{display:block;font-size:13px;color:var(--text-muted);margin-top:2px;line-height:1.35}
.iosrow__time{flex:none;width:48px;align-self:flex-start;font-size:13px;font-weight:650;
  font-variant-numeric:tabular-nums;color:var(--text)}

/* --- small parts --------------------------------------------------------- */
.t-sub{font-size:13px;color:var(--text-muted);line-height:1.45}
.iospill{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;
  border-radius:999px;font-size:11px;font-weight:650;letter-spacing:.01em;
  background:var(--neutral-bg);color:var(--text-muted)}
.iospill--on{background:var(--brand-soft);color:var(--brand)}
.iospill--warn{background:rgba(224,168,72,.14);color:var(--warning)}
.iospill--off{background:rgba(224,90,90,.13);color:var(--danger)}

.iosbtn{display:block;width:100%;padding:13px;border-radius:14px;border:0;
  background:var(--brand);color:var(--brand-on);cursor:pointer;
  font-size:15px;font-weight:650;letter-spacing:-.01em;font-family:inherit}
.iosbtn--ghost{background:var(--bg-raised);color:var(--text);
  border:1px solid var(--border)}

.iosseg{display:flex;gap:3px;padding:3px;border-radius:12px;background:var(--bg-raised)}
.iosseg button{flex:1;padding:7px;border:0;border-radius:9px;background:none;
  cursor:pointer;font-family:inherit;font-size:13px;font-weight:600;
  color:var(--text-muted)}
.iosseg button[aria-pressed="true"]{background:var(--bg-surface);color:var(--text);
  box-shadow:var(--shadow-sm)}

.iosstats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.iosstat{background:var(--bg-surface);border:1px solid var(--border);
  border-radius:16px;padding:12px}
.iosstat b{display:block;font-size:22px;font-weight:680;letter-spacing:-.02em;
  font-variant-numeric:tabular-nums}
.iosstat span{display:block;font-size:11px;color:var(--text-muted);margin-top:2px}

.iosbar{height:6px;border-radius:3px;background:var(--bg-raised);overflow:hidden}
.iosbar i{display:block;height:100%;border-radius:3px;background:var(--brand)}

.ioslabel{font-size:12px;font-weight:650;letter-spacing:.06em;text-transform:uppercase;
  color:var(--text-subtle);margin:18px 0 -4px}
.ioscard+.ioslabel,.iosstats+.ioslabel{margin-top:20px}

.iosempty{padding:28px 16px;text-align:center;color:var(--text-muted);font-size:13px}

/* --- hamburger menu ------------------------------------------------------ */
/* A phone tab bar holds about five destinations. Anything past that lives
   here: a drawer inside the phone frame, opened from the navigation bar. */
.ios__menubtn{flex:none;width:36px;height:36px;border-radius:10px;
  display:grid;place-items:center;color:var(--text);
  border:1px solid var(--border);background:var(--bg-raised)}
.ios__menubtn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.9;
  stroke-linecap:round}
.ios__navtools{display:flex;align-items:center;gap:8px;flex:none}

.ios__menu{position:absolute;inset:0 auto 0 0;z-index:6;
  width:min(78%,300px);display:flex;flex-direction:column;
  background:var(--bg-surface);border-right:1px solid var(--border);
  box-shadow:var(--shadow-lg);transform:translateX(-101%);visibility:hidden;
  transition:transform var(--dur-base) var(--ease),visibility var(--dur-base)}
.ios__menu[data-open="true"]{transform:none;visibility:visible}
.ios__menu__h{flex:none;display:flex;align-items:center;justify-content:space-between;
  gap:12px;padding:18px 18px 12px;border-bottom:1px solid var(--border)}
.ios__menu__t{font-size:16px;font-weight:650;letter-spacing:-.01em}
.ios__menu__x{width:30px;height:30px;border-radius:8px;display:grid;place-items:center;
  color:var(--text-muted);border:1px solid var(--border)}
.ios__menu__b{flex:1;overflow-y:auto;padding:12px 12px 24px;scrollbar-width:none}
.ios__menu__b::-webkit-scrollbar{display:none}
.ios__menu__g{padding:12px 8px 4px;font-size:11px;letter-spacing:.08em;
  text-transform:uppercase;color:var(--text-subtle);font-weight:650}
.ios__menu__i{display:flex;align-items:center;gap:10px;width:100%;
  padding:9px 8px;border-radius:9px;text-align:left;font-size:14px;
  color:var(--text-muted)}
.ios__menu__i svg{flex:none;width:17px;height:17px;fill:none;stroke:currentColor;
  stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;opacity:.9}
.ios__menu__i:hover{background:var(--bg-raised);color:var(--text)}
.ios__menu__i[aria-current="page"]{background:var(--brand-soft);color:var(--brand);
  font-weight:600}
.ios__scrim{position:absolute;inset:0;z-index:5;background:var(--bg-overlay);
  opacity:0;visibility:hidden;
  transition:opacity var(--dur-base) var(--ease),visibility var(--dur-base)}
.ios__scrim[data-open="true"]{opacity:1;visibility:visible}
