/* Native iPhone visual system. The desktop and Android surfaces keep their own layout. */
@media (max-width: 760px) {
  html.ios-shell {
    --ink: #162b28;
    --ink-soft: #30433e;
    --muted: #687a74;
    --muted-2: #8c9b94;
    --paper: #f6f7f3;
    --surface: #fff;
    --surface-soft: #eff3ef;
    --line: #e1e8e1;
    --line-strong: #c6d2c8;
    --accent: #126b58;
    --accent-dark: #0a5142;
    --dark: #143b33;
    --warning: #99620d;
    --warning-soft: #fff5df;
    --info: #355f85;
    --info-soft: #eaf2f8;
    --danger: #ac433e;
    --success: #126b58;
    background: var(--paper);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  }
  html.ios-shell body { background: var(--paper); color: var(--ink); }
  html.ios-shell button:focus-visible,
  html.ios-shell input:focus-visible,
  html.ios-shell select:focus-visible,
  html.ios-shell textarea:focus-visible,
  html.ios-shell summary:focus-visible,
  html.ios-shell a:focus-visible { outline-color: var(--accent); }

  /* Navigation sits above the home indicator and keeps Apple-sized targets. */
  html.ios-shell .sidebar {
    inset: auto 0 0;
    padding: 7px max(9px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(9px, env(safe-area-inset-left));
    border: 0;
    border-top: 1px solid rgba(28, 65, 53, .1);
    border-radius: 22px 22px 0 0;
    background: rgba(251, 253, 249, .94);
    box-shadow: 0 -8px 28px rgba(20, 59, 51, .07);
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
  }
  html.ios-shell .main-nav { gap: 0; }
  html.ios-shell .nav-item {
    min-height: 53px;
    gap: 4px;
    border-radius: 13px;
    color: #71817a;
    font-size: 10px;
    font-weight: 580;
  }
  html.ios-shell .nav-item .ph { color: inherit; font-size: 23px; }
  html.ios-shell .nav-item:hover { background: var(--surface-soft); }
  html.ios-shell .nav-item.active { background: transparent; color: var(--accent); font-weight: 760; }
  html.ios-shell .nav-item.active::before { display: none; }
  html.ios-shell .nav-item.active .ph {
    width: 42px;
    height: 29px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #dcece4;
    color: var(--accent);
  }

  html.ios-shell .app-content { padding: 18px 20px calc(108px + env(safe-area-inset-bottom) + var(--subcal-ad-banner-height, 0px)); }
  html.ios-shell.native-shell .app-content { padding-top: max(20px, calc(env(safe-area-inset-top) + 12px)); }
  html.ios-shell .page-header { align-items: end; margin-bottom: 24px; gap: 14px; }
  html.ios-shell .page-header-leading { gap: 3px; }
  html.ios-shell body[data-view="today"] .back-button { display: none; }
  html.ios-shell .page-header h1 {
    color: var(--ink);
    font-size: clamp(34px, 9vw, 39px);
    font-weight: 790;
    letter-spacing: -.055em;
    line-height: 1.04;
  }
  html.ios-shell .page-subtitle { color: var(--muted); font-size: 13px; line-height: 1.35; }
  html.ios-shell .back-button { color: var(--accent); font-size: 13px; }
  html.ios-shell #addButton {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 5px 13px rgba(18, 107, 88, .22);
  }
  html.ios-shell .primary-button,
  html.ios-shell .row-action.primary-inline { background: var(--accent); border-color: var(--accent); color: white; box-shadow: none; }
  html.ios-shell .primary-button:hover,
  html.ios-shell .row-action.primary-inline:hover { background: var(--accent-dark); }
  html.ios-shell .primary-button:disabled,
  html.ios-shell .primary-button:disabled:hover {
    border: 1px solid #dce5dc;
    background: #dce5dc;
    color: #697c70;
    box-shadow: none;
    cursor: not-allowed;
  }
  html.ios-shell .secondary-button { border-color: var(--line); background: #fff; }
  html.ios-shell .text-button { color: var(--accent); }
  html.ios-shell .icon-control { min-width: 44px; min-height: 44px; color: var(--ink-soft); }

  html.ios-shell .demo-banner {
    min-height: 50px;
    margin: 0 0 20px;
    padding: 7px 9px 7px 13px;
    border: 1px solid #dcebe2;
    border-radius: 14px;
    background: #eaf4ed;
    box-shadow: none;
  }
  html.ios-shell .demo-banner > div > .ph,
  html.ios-shell .demo-banner strong,
  html.ios-shell .demo-banner .quiet-button { color: var(--accent); }
  html.ios-shell .demo-banner .quiet-button { min-height: 44px; }
  html.ios-shell .demo-banner strong { font-size: 11px; }

  /* The financial answer comes first; tasks and records follow in grouped lists. */
  html.ios-shell .today-layout { gap: 20px; }
  html.ios-shell .outlook-hero {
    margin: 0;
    padding: 24px 23px 21px;
    border: 0;
    border-radius: 26px;
    background: linear-gradient(145deg, #123d34 0%, #24594a 100%);
    box-shadow: 0 13px 22px rgba(20, 59, 51, .15);
  }
  html.ios-shell .outlook-label { margin-bottom: 11px; color: #b7d5c7; font-size: 11px; font-weight: 700; letter-spacing: .09em; }
  html.ios-shell .outlook-total { font-size: clamp(33px, 9vw, 41px); font-weight: 750; letter-spacing: -.055em; }
  html.ios-shell .outlook-total.has-range { font-size: clamp(27px, 7.5vw, 35px); }
  html.ios-shell .outlook-total.multi-currency { font-size: 26px; }
  html.ios-shell .outlook-note { color: #c4dbd0; font-size: 12px; }
  html.ios-shell .hero-insight { margin-top: 18px; padding-top: 17px; border-top: 1px solid rgba(255, 255, 255, .2); gap: 11px; }
  html.ios-shell .hero-insight-icon { width: 36px; height: 36px; border-radius: 12px; background: rgba(255, 255, 255, .12); color: #dbefdf; font-size: 20px; }
  html.ios-shell .hero-insight strong { font-size: 13px; font-weight: 720; }
  html.ios-shell .hero-insight p { margin-top: 3px; color: #c4dbd0; font-size: 11px; line-height: 1.42; }

  html.ios-shell .attention-panel { margin: 19px 0 0; border: 1px solid #f0e3d2; border-radius: 18px; background: #fffcf6; box-shadow: none; }
  html.ios-shell .attention-panel > header { min-height: 52px; padding: 10px 15px; border-bottom: 1px solid #f0e3d2; }
  html.ios-shell .attention-panel > header .eyebrow { display: none; }
  html.ios-shell .attention-panel > header h2 { font-size: 15px; }
  html.ios-shell .attention-panel > header > span { background: #f5e8cf; color: #815510; }
  html.ios-shell .attention-item { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; padding: 12px 14px; border-color: #f0e9da; }
  html.ios-shell .attention-item > .ph { width: 32px; height: 32px; background: #f8efe0; color: #9b6a22; font-size: 18px; }
  html.ios-shell .attention-item > div { min-width: 0; }
  html.ios-shell .attention-item strong { font-size: 13px; }
  html.ios-shell .attention-item small { font-size: 11px; }
  html.ios-shell .attention-item .row-action { grid-column: 2; width: max-content; min-height: 36px; padding: 0 12px; }

  html.ios-shell .agenda { margin-top: 20px; }
  html.ios-shell .agenda-group + .agenda-group { margin-top: 18px; }
  html.ios-shell .agenda-group-title { padding: 0 3px 9px; color: var(--ink-soft); font-size: 13px; font-weight: 760; letter-spacing: 0; text-transform: none; }
  html.ios-shell .payment-row {
    min-height: 88px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 8px;
    margin: 0;
    padding: 12px 13px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: white;
    box-shadow: none;
  }
  html.ios-shell .agenda-group > .payment-row:first-of-type { border-radius: 17px 17px 0 0; }
  html.ios-shell .agenda-group > .payment-row:last-child { border-bottom: 0; border-radius: 0 0 17px 17px; }
  html.ios-shell .agenda-group > .payment-row:first-of-type:last-child { border-radius: 17px; }
  html.ios-shell .payment-main { gap: 10px; }
  html.ios-shell .payment-icon { width: 39px; height: 39px; border-radius: 12px; background: #eaf3ed; color: var(--accent); font-size: 20px; }
  html.ios-shell .payment-icon.bill { background: #ecf1f8; color: var(--info); }
  html.ios-shell .payment-title strong { color: var(--ink); font-size: 14px; font-weight: 690; }
  html.ios-shell .payment-title small { color: var(--muted); font-size: 10px; }
  html.ios-shell .amount-cell { grid-column: 2; grid-row: 1; align-self: center; padding: 0; text-align: right; }
  html.ios-shell .amount-cell strong { color: var(--ink); font-size: 13px; font-weight: 720; }
  html.ios-shell .amount-cell small { color: var(--muted); font-size: 10px; }
  html.ios-shell .amount-cell.pending strong { color: var(--warning); }
  html.ios-shell .amount-cell.estimated strong { color: var(--info); }
  html.ios-shell .row-actions { grid-column: 1 / -1; justify-content: flex-end; gap: 5px; padding: 2px 0 0; }
  html.ios-shell .payment-row .row-action { min-height: 35px; padding: 0 11px; border-radius: 10px; background: var(--surface-soft); border-color: transparent; color: var(--accent); font-size: 11px; }
  html.ios-shell .payment-row .row-action.primary-inline { background: var(--accent); color: white; }
  html.ios-shell .payment-row .overflow > .icon-control { width: 36px; min-width: 36px; height: 36px; min-height: 36px; }
  html.ios-shell .payment-row.is-overdue { border-left: 3px solid var(--danger); padding-left: 10px; background: #fffafa; }
  html.ios-shell .overflow-menu { border-color: var(--line); border-radius: 14px; }
  html.ios-shell .lifecycle-badge.pending { color: var(--warning); background: #fff3db; }
  html.ios-shell .lifecycle-badge.estimated { color: var(--info); background: var(--info-soft); }
  html.ios-shell .lifecycle-badge.exact { color: var(--accent); background: #e4f3eb; }
  html.ios-shell .lifecycle-guide { margin: 20px 0 0; padding: 18px 42px 16px 17px; border: 1px solid var(--line); border-radius: 17px; background: white; box-shadow: none; }
  html.ios-shell .lifecycle-guide-copy h2 { font-size: 15px; }
  html.ios-shell .lifecycle-guide-steps { margin-right: -26px; }
  html.ios-shell .lifecycle-guide-steps li { background: var(--surface-soft); }
  html.ios-shell .lifecycle-guide-steps .estimated .ph { color: var(--info); }
  html.ios-shell .lifecycle-guide-steps .exact .ph { color: var(--accent); }
  html.ios-shell .calm-note { padding: 15px; border: 0; border-radius: 16px; background: #eaf3ed; }
  html.ios-shell .calm-note .ph { background: #d3e9db; color: var(--accent); }
  html.ios-shell .calm-note button { color: var(--accent); }
  html.ios-shell .side-column { margin-top: 1px; }
  html.ios-shell .side-panel { border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: none; }
  html.ios-shell .mini-calendar { padding: 16px; }
  html.ios-shell .week-day.today b { background: var(--accent); box-shadow: none; }
  html.ios-shell .event-dot.fixed, html.ios-shell .legend i { background: var(--accent); }
  html.ios-shell .event-dot.bill, html.ios-shell .legend .variable { background: var(--info); }
  html.ios-shell .privacy-note { color: var(--muted); }

  /* Month cells use accessible event counts, with dots on screen. */
  html.ios-shell .calendar-layout { gap: 16px; }
  html.ios-shell .calendar-panel { border: 1px solid var(--line); border-radius: 20px; box-shadow: none; }
  html.ios-shell .calendar-toolbar { flex-direction: row-reverse; padding: 14px 13px; border-color: var(--line); }
  html.ios-shell .calendar-toolbar h2 { font-size: 17px; font-weight: 730; }
  html.ios-shell .toolbar-actions { gap: 1px; }
  html.ios-shell .toolbar-actions .icon-control { width: 38px; min-width: 38px; height: 38px; min-height: 38px; }
  html.ios-shell .toolbar-actions .text-button { font-size: 11px; }
  html.ios-shell .calendar-weekday { padding: 11px 0 8px; border: 0; color: var(--muted); font-size: 10px; }
  html.ios-shell .calendar-day { min-height: 48px; display: grid; justify-items: center; align-content: start; gap: 1px; padding: 3px 0 1px; border: 0; background: white; text-align: center; }
  html.ios-shell .calendar-day.outside { color: #b7c3ba; background: white; }
  html.ios-shell .calendar-day.selected { background: #e7f2e9; box-shadow: none; border-radius: 12px; }
  html.ios-shell .calendar-day .day-number { width: 29px; height: 29px; font-size: 12px; font-weight: 650; }
  html.ios-shell .calendar-day.today .day-number { background: var(--accent); color: white; box-shadow: none; }
  html.ios-shell .calendar-day .day-events { display: flex; justify-content: center; gap: 2px; max-width: 36px; margin: 0; }
  html.ios-shell .calendar-day .day-event { width: 5px; height: 5px; min-width: 5px; padding: 0; border-radius: 50%; background: var(--accent); color: transparent; font-size: 0; }
  html.ios-shell .calendar-day .day-event.bill { background: var(--info); }
  html.ios-shell .calendar-day .day-event-more { display: none; }
  html.ios-shell .selected-day { padding: 19px 17px 17px; }
  html.ios-shell .selected-day .eyebrow { color: var(--accent); }
  html.ios-shell .selected-day h2 { font-size: 19px; }
  html.ios-shell .selected-day-list { margin: 13px 0 17px; }
  html.ios-shell .selected-day-item { padding: 12px 0; border-color: var(--line); }
  html.ios-shell .selected-day .primary-button { min-height: 48px; border-radius: 13px; }

  /* Plan reads as one forecast, then optional details. */
  html.ios-shell .cashflow-hero { margin-bottom: 19px; border-radius: 22px; background: var(--dark); box-shadow: 0 12px 22px rgba(20, 59, 51, .13); }
  html.ios-shell .cashflow-hero > div { min-height: 125px; padding: 22px; background: transparent; }
  html.ios-shell .cashflow-hero .eyebrow { color: #bad5c9; }
  html.ios-shell .cashflow-hero strong { font-size: 31px; font-weight: 750; }
  html.ios-shell .cashflow-hero strong.down { color: #bce5c8; }
  html.ios-shell .cashflow-hero span { color: #c4dbd0; }
  html.ios-shell .bill-intelligence { margin: 22px 0; }
  html.ios-shell .section-heading h2 { color: var(--ink); font-size: 21px; line-height: 1.16; }
  html.ios-shell .bill-card-grid { gap: 12px; }
  html.ios-shell .bill-intelligence-card,
  html.ios-shell .plan-panel,
  html.ios-shell .plan-outlook { border: 1px solid var(--line); border-radius: 19px; background: white; box-shadow: none; }
  html.ios-shell .plan-panel { padding: 19px 17px; }
  html.ios-shell .bill-intelligence-card { padding: 17px; }
  html.ios-shell .trend-column span { background: var(--accent); }
  html.ios-shell .forecast-source .ph { color: var(--accent); }
  html.ios-shell .scenario-button.active { border-color: var(--accent); background: #e4f3eb; color: var(--accent-dark); }
  html.ios-shell .provenance-counts > div { background: var(--surface-soft); }
  html.ios-shell .comparison-status { background: #eaf3ed; }
  html.ios-shell .comparison-status > .ph { color: var(--accent); }
  html.ios-shell .plan-outlook { padding: 0; }
  html.ios-shell .plan-outlook > summary { padding: 16px 17px; }
  html.ios-shell .plan-outlook > summary > .ph { background: #e4f3eb; color: var(--accent); }
  html.ios-shell .plan-outlook-body { padding: 2px 17px 18px; }
  html.ios-shell .plan-bar span { background: var(--accent); }

  /* All task flows share the same native-feeling sheet and grouped controls. */
  html.ios-shell dialog.sheet-dialog {
    width: 100%;
    max-height: calc(100dvh - max(14px, env(safe-area-inset-top)));
    margin: auto 0 0;
    border: 0;
    border-radius: 27px 27px 0 0;
    background: var(--paper);
    box-shadow: 0 -14px 42px rgba(16, 43, 36, .2);
  }
  html.ios-shell dialog::backdrop { background: rgba(11, 29, 24, .48); }
  html.ios-shell .payment-form,
  html.ios-shell .settings-sheet,
  html.ios-shell .import-form { padding: 30px 20px calc(22px + env(safe-area-inset-bottom)); }
  html.ios-shell .dialog-head { position: relative; margin-bottom: 21px; padding-top: 8px; }
  html.ios-shell .dialog-head::before { content: ""; position: absolute; top: -19px; left: calc(50% - 18px); width: 36px; height: 5px; border-radius: 9px; background: #cad5cb; }
  html.ios-shell .dialog-head .eyebrow { color: var(--accent); }
  html.ios-shell .dialog-head h2 { color: var(--ink); font-size: 26px; font-weight: 770; }
  html.ios-shell .dialog-head .icon-control { border-radius: 50%; background: #e7ece7; }
  html.ios-shell .field { color: var(--ink-soft); font-size: 13px; }
  html.ios-shell .field input,
  html.ios-shell .field select,
  html.ios-shell .field textarea,
  html.ios-shell .password-field input { min-height: 50px; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--ink); }
  html.ios-shell .money-field { min-height: 50px; border-color: var(--line); border-radius: 13px; background: white; }
  html.ios-shell .money-field input { border: 0; }
  html.ios-shell .type-selector { grid-template-columns: 1fr 1fr; }
  html.ios-shell .type-selector label > span { min-height: 79px; border: 1px solid var(--line); border-radius: 15px; background: white; }
  html.ios-shell .type-selector input:checked + span { border-color: var(--accent); background: #eaf3ed; box-shadow: inset 0 0 0 1px var(--accent); }
  html.ios-shell .type-selector input:focus-visible + span,
  html.ios-shell .amount-mode input:focus-visible + span { outline-color: var(--accent); }
  html.ios-shell .amount-mode { display: flex; flex-wrap: wrap; gap: 5px; padding: 0; background: transparent; }
  html.ios-shell .amount-mode legend { width: 100%; margin-bottom: 8px; }
  html.ios-shell .amount-mode label { flex: 1 1 0; min-width: 0; }
  html.ios-shell .amount-mode label > span { min-height: 43px; display: grid; place-items: center; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: #edf1ed; color: var(--muted); text-align: center; font-size: 11px; }
  html.ios-shell .amount-mode input:checked + span { border-color: var(--accent); background: #e4f3eb; color: var(--accent); box-shadow: none; }
  html.ios-shell .lifecycle-steps > span.active { border-color: var(--accent); background: #eaf3ed; color: var(--accent); }
  html.ios-shell .lifecycle-steps > span { border-color: var(--line); }
  html.ios-shell .form-row,
  html.ios-shell .advanced-grid { gap: 16px; }
  html.ios-shell .advanced-fields { border-color: var(--line); }
  html.ios-shell .advanced-fields summary { min-height: 48px; color: var(--accent); }
  html.ios-shell .dialog-actions { bottom: 0; gap: 8px; margin: 16px -20px 0; padding: 12px 20px calc(10px + env(safe-area-inset-bottom)); border-color: var(--line); background: rgba(246, 247, 243, .97); }
  html.ios-shell .dialog-actions .primary-button { flex: 1; border-radius: 13px; }
  html.ios-shell .dialog-actions .primary-button { padding-inline: 10px; font-size: 14px; white-space: nowrap; }
  html.ios-shell .dialog-actions .quiet-button { color: var(--accent); }

  html.ios-shell .settings-list { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: white; }
  html.ios-shell .settings-row { min-height: 68px; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 9px; padding: 10px 13px; border-color: var(--line); background: white; }
  html.ios-shell .settings-row:last-child { border-bottom: 0; }
  html.ios-shell .settings-row > .ph:first-child { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #e8f2eb; color: var(--accent); font-size: 19px; }
  html.ios-shell .settings-row strong { color: var(--ink); font-size: 14px; }
  html.ios-shell .settings-row small { color: var(--muted); font-size: 11px; line-height: 1.3; }
  html.ios-shell .settings-row > b { color: var(--muted); font-size: 11px; }
  html.ios-shell .settings-row:hover { background: #f8faf7; }
  html.ios-shell .account-sync-heading { padding: 10px 13px; }
  html.ios-shell .account-sync-heading strong { color: var(--ink); font-size: 14px; }
  html.ios-shell .account-sync-heading small { color: var(--muted); font-size: 11px; line-height: 1.3; }
  html.ios-shell .manage-payment { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; padding: 15px 2px; border-color: var(--line); }
  html.ios-shell .manage-payment strong { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; color: var(--ink); font-size: 15px; }
  html.ios-shell .manage-payment small { color: var(--muted); font-size: 12px; line-height: 1.35; }
  html.ios-shell .manage-payment > div:last-child { justify-content: flex-end; }
  html.ios-shell .manage-payment .quiet-button { min-height: 40px; color: var(--accent); }
  html.ios-shell .manage-payment .danger-control { color: var(--danger); }
  html.ios-shell .connection-details { margin-top: 20px; }
  html.ios-shell .file-picker { border-color: var(--line-strong); border-radius: 13px; background: white; }
  html.ios-shell .import-file input[type="file"] { min-height: 54px; padding: 8px; border: 1px dashed var(--line-strong); color: var(--muted); font-size: 12px; }
  html.ios-shell .import-file input[type="file"]::file-selector-button { min-height: 36px; margin-right: 8px; padding: 0 10px; border: 0; border-radius: 9px; background: #e4f3eb; color: var(--accent); font: inherit; font-weight: 700; }
  html.ios-shell .candidate-actions button[aria-pressed="true"] { border-color: var(--accent); background: #eaf3ed; }
  html.ios-shell .toast { bottom: calc(88px + env(safe-area-inset-bottom)); border-radius: 13px; background: var(--dark); }

  html.ios-shell .auth-screen { min-height: 100dvh; padding: max(52px, env(safe-area-inset-top)) 22px calc(52px + env(safe-area-inset-bottom)); background: var(--paper); color: var(--ink); }
  html.ios-shell .auth-kicker { color: var(--accent); }
  html.ios-shell .auth-copy h1 { color: var(--ink); font-size: 43px; }
  html.ios-shell .auth-copy > p { color: var(--muted); }
  html.ios-shell .auth-card { border: 1px solid var(--line); border-radius: 21px; background: white; box-shadow: 0 8px 22px rgba(20, 59, 51, .07); }
  html.ios-shell .empty-icon { background: #e7f2e9; color: var(--accent); }
}

@media (max-width: 360px) {
  html.ios-shell .app-content { padding-left: 15px; padding-right: 15px; }
  html.ios-shell .page-header h1 { font-size: 33px; }
  html.ios-shell .type-selector { grid-template-columns: 1fr; }
  html.ios-shell .calendar-toolbar h2 { font-size: 15px; }
}

/* Handoff parity: the supplied Turkish screens use a lavender canvas, coral actions,
   indigo accents, and compact white payment cards. Keep this block last so it is
   the native and preview source of truth. */
@media (max-width: 760px) {
  html.ios-shell {
    --ink: #171b2d;
    --ink-soft: #32364a;
    --muted: #74798b;
    --muted-2: #9a9eae;
    --paper: #f4f3f9;
    --surface: #ffffff;
    --surface-soft: #f0efff;
    --line: #e5e5ee;
    --line-strong: #c9c9d9;
    --accent: #6d6ee8;
    --accent-dark: #5758c8;
    --dark: #191d31;
    --warning: #bf6a20;
    --warning-soft: #fff1e8;
    --info: #6466d8;
    --info-soft: #efedff;
    --danger: #e35f54;
    --success: #6d6ee8;
    --coral: #f27461;
    background: var(--paper);
  }
  html.ios-shell body { background: var(--paper); color: var(--ink); }
  html.ios-shell .app-content { padding: 12px 7px calc(96px + env(safe-area-inset-bottom)); }
  html.ios-shell.native-shell .app-content { padding-top: max(12px, calc(env(safe-area-inset-top) + 4px)); }
  html.ios-shell .demo-banner {
    min-height: 48px;
    margin: 0 0 8px;
    padding: 6px 8px 6px 11px;
    border: 1px solid #e4e1fb;
    border-radius: 9px;
    background: #ecebff;
  }
  html.ios-shell .demo-banner > div > .ph,
  html.ios-shell .demo-banner strong,
  html.ios-shell .demo-banner .quiet-button { color: #3d3e8f; }
  html.ios-shell .demo-banner strong { font-size: 10px; line-height: 1.1; }
  html.ios-shell .demo-banner .quiet-button { min-height: 35px; font-size: 9px; }
  html.ios-shell .page-header { align-items: end; gap: 8px; margin: 0 2px 10px; }
  html.ios-shell .page-header-leading { gap: 1px; }
  html.ios-shell .back-button { display: inline-flex; color: var(--muted); font-size: 10px; min-height: 24px; }
  html.ios-shell body[data-view="today"] .back-button,
  html.ios-shell body[data-view="calendar"] .back-button,
  html.ios-shell body[data-view="forecast"] .back-button { display: none; }
  html.ios-shell .page-header h1 { font-size: 30px; letter-spacing: -.045em; }
  html.ios-shell .page-subtitle { font-size: 10px; line-height: 1.25; }
  html.ios-shell .empty-state-forecast { max-width: 620px; margin: 0 auto; padding: 26px 12px 18px; }
  html.ios-shell body.sample-preview #viewRoot button:disabled { cursor: not-allowed; opacity: .56; }
  html.ios-shell #addButton { width: 38px; height: 38px; padding: 0; gap: 0; display: grid; place-items: center; line-height: 1; background: var(--coral); box-shadow: 0 5px 13px rgba(242, 116, 97, .24); }
  html.ios-shell .primary-button,
  html.ios-shell .row-action.primary-inline { background: var(--coral); border-color: var(--coral); }
  html.ios-shell .primary-button:hover,
  html.ios-shell .row-action.primary-inline:hover { background: #df6253; }
  html.ios-shell .text-button { color: var(--accent); }
  html.ios-shell .today-layout { display: block; }
  html.ios-shell .today-primary { min-width: 0; }
  html.ios-shell .lifecycle-guide { margin: 0 0 8px; padding: 11px 27px 10px 10px; border: 1px solid #e3e2f1; border-radius: 9px; background: #fff; }
  html.ios-shell .lifecycle-guide-copy .eyebrow { margin-bottom: 3px; color: var(--muted); font-size: 8px; }
  html.ios-shell .lifecycle-guide-copy h2 { font-size: 13px; }
  html.ios-shell .lifecycle-guide-copy > p:last-child { display: none; }
  html.ios-shell .lifecycle-guide-steps { gap: 4px; margin: 7px 0 0; }
  html.ios-shell .lifecycle-guide-steps li { min-height: 28px; padding: 4px 5px; border: 1px solid #e6e6ef; border-radius: 6px; background: #f7f7fc; }
  html.ios-shell .lifecycle-guide-steps li .ph { font-size: 11px; }
  html.ios-shell .lifecycle-guide-steps li strong { font-size: 9px; }
  html.ios-shell .lifecycle-guide-steps li small { font-size: 8px; }
  html.ios-shell .attention-panel { margin: 0 0 8px; border: 1px solid #e5e4ee; border-radius: 9px; background: #fff; }
  html.ios-shell .attention-panel > header { min-height: 31px; padding: 6px 9px; border-bottom: 1px solid #eeeeF4; }
  html.ios-shell .attention-panel > header h2 { font-size: 11px; }
  html.ios-shell .attention-panel > header > span { min-width: 19px; height: 19px; background: #fff0ea; color: var(--coral); font-size: 10px; }
  html.ios-shell .attention-item { grid-template-columns: 22px minmax(0, 1fr); gap: 6px; padding: 7px 9px; border-color: #eeeeF4; }
  html.ios-shell .attention-item > .ph { width: 22px; height: 22px; background: #f2f0ff; color: var(--accent); font-size: 12px; }
  html.ios-shell .attention-item strong { font-size: 10px; }
  html.ios-shell .attention-item small { font-size: 8px; }
  html.ios-shell .attention-item .row-action { min-height: 24px; padding: 0 7px; border-radius: 6px; font-size: 8px; }
  html.ios-shell .outlook-hero { margin: 0 0 9px; padding: 12px 13px; border-radius: 10px; background: var(--dark); box-shadow: 0 7px 14px rgba(25, 29, 49, .15); }
  html.ios-shell .outlook-label { margin-bottom: 4px; color: #bfc0dc; font-size: 8px; }
  html.ios-shell .outlook-total,
  html.ios-shell .outlook-total.has-range { font-size: 21px; letter-spacing: -.04em; }
  html.ios-shell .outlook-note { font-size: 8px; color: #d2d3e4; }
  html.ios-shell .outlook-hero .hero-divider,
  html.ios-shell .outlook-hero .hero-insight { display: none; }
  html.ios-shell .agenda { margin-top: 0; }
  html.ios-shell .agenda-group { margin: 0 0 9px; }
  html.ios-shell .agenda-group + .agenda-group { margin-top: 0; }
  html.ios-shell .agenda-group-title { padding: 0 3px 4px; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .06em; }
  html.ios-shell .agenda-group > .payment-row,
  html.ios-shell .agenda-group > .payment-row:first-of-type,
  html.ios-shell .agenda-group > .payment-row:last-child { min-height: 70px; margin: 0 0 6px; padding: 8px 8px 7px; border: 1px solid var(--line); border-left: 3px solid #bfc1f4; border-radius: 9px; background: #fff; box-shadow: 0 2px 6px rgba(39, 41, 70, .04); }
  html.ios-shell .agenda-group > .payment-row.is-overdue { border-left-color: var(--coral); background: #fffaf8; }
  html.ios-shell .payment-main { gap: 6px; }
  html.ios-shell .payment-icon { width: 24px; height: 24px; border-radius: 7px; background: #f0efff; color: var(--accent); font-size: 12px; }
  html.ios-shell .payment-icon.bill { background: #fff0ed; color: var(--coral); }
  html.ios-shell .payment-title strong { font-size: 10px; }
  html.ios-shell .payment-title small { font-size: 8px; }
  html.ios-shell .amount-cell strong { font-size: 9px; }
  html.ios-shell .amount-cell small { font-size: 8px; }
  html.ios-shell .row-actions { gap: 4px; padding-top: 0; }
  html.ios-shell .payment-row .row-action { min-height: 23px; padding: 0 7px; border-radius: 6px; color: var(--accent); font-size: 8px; }
  html.ios-shell .payment-row .row-action.primary-inline { color: #fff; }
  html.ios-shell .payment-row .overflow > .icon-control { width: 25px; min-width: 25px; height: 25px; min-height: 25px; }
  html.ios-shell .lifecycle-badge { margin-left: 3px; padding: 2px 4px; border-radius: 4px; font-size: 7px; }
  html.ios-shell .calm-note { margin: 10px 0 8px; padding: 9px; border: 0; border-radius: 9px; background: #ecebff; }
  html.ios-shell .calm-note .ph { width: 23px; height: 23px; background: #dad9ff; color: var(--accent); }
  html.ios-shell .calm-note strong { font-size: 10px; }
  html.ios-shell .calm-note p { font-size: 8px; }
  html.ios-shell .calm-note button { font-size: 8px; }
  html.ios-shell .side-column { margin-top: 0; }
  html.ios-shell .side-panel { border: 1px solid #e3e2ee; border-radius: 9px; background: #fff; }
  html.ios-shell .mini-calendar { padding: 8px; }
  html.ios-shell .mini-calendar .side-head h2 { font-size: 10px; }
  html.ios-shell .mini-calendar .side-head .text-button { font-size: 8px; }
  html.ios-shell .week-day { min-height: 31px; }
  html.ios-shell .week-day span, html.ios-shell .week-day b { font-size: 8px; }
  html.ios-shell .week-day.today b { background: var(--coral); }
  html.ios-shell .privacy-note { margin: 6px 0 0; font-size: 8px; }
  html.ios-shell .sidebar { padding: 4px max(7px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left)); border-top: 1px solid #e3e2ed; border-radius: 14px 14px 0 0; background: rgba(255,255,255,.96); box-shadow: 0 -4px 16px rgba(39, 41, 70, .08); }
  html.ios-shell .nav-item { min-height: 45px; gap: 2px; color: #8b8fa0; font-size: 8px; }
  html.ios-shell .nav-item .ph { font-size: 17px; }
  html.ios-shell .nav-item.active { color: var(--coral); }
  html.ios-shell .nav-item.active .ph { width: 29px; height: 22px; background: #fff0ec; color: var(--coral); }
  html.ios-shell .calendar-layout { gap: 8px; }
  html.ios-shell .calendar-panel { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
  html.ios-shell .calendar-toolbar { padding: 7px 8px; }
  html.ios-shell .calendar-toolbar h2 { font-size: 12px; }
  html.ios-shell .toolbar-actions .icon-control { width: 25px; min-width: 25px; height: 25px; min-height: 25px; }
  html.ios-shell .toolbar-actions .text-button { font-size: 8px; }
  html.ios-shell .calendar-weekday { padding: 6px 0 4px; font-size: 7px; }
  html.ios-shell .calendar-day { min-height: 34px; }
  html.ios-shell .calendar-day .day-number { width: 20px; height: 20px; font-size: 8px; }
  html.ios-shell .calendar-day.today .day-number { background: var(--coral); }
  html.ios-shell .calendar-day.selected { background: #efefff; border-radius: 6px; }
  html.ios-shell .calendar-day .day-event { width: 3px; height: 3px; min-width: 3px; }
  html.ios-shell .selected-day { padding: 10px; }
  html.ios-shell .selected-day .eyebrow { font-size: 8px; }
  html.ios-shell .selected-day h2 { font-size: 13px; }
  html.ios-shell .selected-day-item { padding: 6px 0; font-size: 9px; }
  html.ios-shell .selected-day .primary-button { min-height: 36px; border-radius: 8px; font-size: 9px; }
  html.ios-shell .cashflow-hero { margin-bottom: 9px; border-radius: 10px; background: var(--dark); box-shadow: 0 7px 14px rgba(25, 29, 49, .15); }
  html.ios-shell .cashflow-hero > div { min-height: 78px; padding: 12px; }
  html.ios-shell .cashflow-hero strong { font-size: 20px; }
  html.ios-shell .cashflow-hero .eyebrow { color: #bfc0dc; font-size: 8px; }
  html.ios-shell .section-heading h2 { font-size: 16px; }
  html.ios-shell .bill-intelligence-card,
  html.ios-shell .plan-panel,
  html.ios-shell .plan-outlook { border-radius: 9px; background: #fff; box-shadow: 0 2px 6px rgba(39, 41, 70, .04); }
  html.ios-shell .bill-intelligence-card { padding: 10px; }
  html.ios-shell .trend-column span,
  html.ios-shell .plan-bar span { background: var(--coral); }
  html.ios-shell .plan-panel { padding: 11px 10px; }
  html.ios-shell .scenario-button.active { border-color: var(--accent); background: #efefff; color: var(--accent-dark); }
  html.ios-shell dialog.sheet-dialog { border-radius: 24px 24px 0 0; background: #fff; box-shadow: 0 -12px 32px rgba(30, 32, 57, .2); }
  html.ios-shell dialog::backdrop { background: rgba(22, 24, 43, .48); }
  html.ios-shell .payment-form,
  html.ios-shell .settings-sheet,
  html.ios-shell .import-form { padding: 22px 19px calc(14px + env(safe-area-inset-bottom)); }
  html.ios-shell .dialog-head { margin-bottom: 14px; padding-top: 5px; }
  html.ios-shell .dialog-head::before { top: -14px; width: 30px; height: 4px; left: calc(50% - 15px); background: #d0d0dd; }
  html.ios-shell .dialog-head .eyebrow { color: var(--muted); font-size: 9px; }
  html.ios-shell .dialog-head h2 { font-size: 24px; }
  html.ios-shell .dialog-head .icon-control { background: #f0f0f5; }
  html.ios-shell .type-selector { grid-template-columns: 1fr; gap: 7px; }
  html.ios-shell .type-selector label > span { min-height: 63px; border-radius: 12px; }
  html.ios-shell .type-selector input:checked + span { border-color: var(--accent); background: #f0efff; box-shadow: inset 0 0 0 1px var(--accent); }
  html.ios-shell .field input,
  html.ios-shell .field select,
  html.ios-shell .field textarea,
  html.ios-shell .password-field input,
  html.ios-shell .money-field { min-height: 46px; border-radius: 10px; }
  html.ios-shell .dialog-actions { margin: 12px -19px 0; padding: 10px 19px calc(8px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.97); }
  html.ios-shell .dialog-actions .primary-button { background: var(--coral); border-color: var(--coral); }
  html.ios-shell .settings-list { border-radius: 12px; }
  html.ios-shell .settings-row { min-height: 60px; padding: 8px 10px; }
  html.ios-shell .settings-row > .ph:first-child { width: 28px; height: 28px; border-radius: 6px; background: #fff0ec; color: var(--coral); font-size: 16px; }
  html.ios-shell .settings-dialog .dialog-head .icon-control:focus-visible { outline-color: var(--coral); }
  html.ios-shell .settings-row strong { font-size: 13px; }
  html.ios-shell .settings-row small { font-size: 10px; }
  html.ios-shell .settings-row > b { font-size: 10px; }
  html.ios-shell .settings-row:hover { background: #fff8f6; }
  html.ios-shell .cancellation-library-note { border-radius: 9px; background: #efefff; color: var(--ink-soft); font-size: 10px; }
  html.ios-shell .cancellation-library-entry { grid-template-columns: minmax(0, 1fr); gap: 7px; padding: 10px; border-color: var(--line); border-radius: 9px; }
  html.ios-shell .cancellation-library-entry h3 { font-size: 12px; }
  html.ios-shell .cancellation-library-actions { display: flex; align-items: center; justify-content: space-between; }
  html.ios-shell .cancellation-open-link { min-height: 36px; border-radius: 8px; background: var(--coral); font-size: 10px; }
  html.ios-shell .cancellation-open-link:hover { background: #df6253; }

  /* Keep the exit control reachable while a short screen scrolls. */
  html.ios-shell dialog.sheet-dialog .dialog-head {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #fff;
  }
  html.ios-shell .candidate-head {
    position: sticky;
    top: 0;
    z-index: 5;
    gap: 8px;
    background: #fff;
  }
  html.ios-shell .candidate-head h3 { flex: 1; min-width: 0; }
  html.ios-shell .candidate-head .icon-control { flex: 0 0 auto; }
}
