/* ============================================================
   native-interior.css — Phase 9.3: signed-in interior polish for the iOS / Android apps ONLY.
   Every rule is scoped to :root.is-native (set by index.html / js/native.js), so the website keeps its styling.
   Scope: shared header and bottom bar (smoked-navy glass), More sheet, Ask Ruby (deep charcoal / navy).
   Financial pages stay light; figures, warnings and behaviour are untouched.
   ============================================================ */

/* ---------- shared chrome: dark midnight-navy glass ---------- */
@media (max-width:899px){
  :root.is-native[data-theme="app"] .topbar{
    /* matching dark glass: near-black navy body, faint reflection near the top, fine cool edge below */
    background:linear-gradient(180deg, rgba(110,150,220,.07) 0%, rgba(110,150,220,0) 55%), rgba(2,18,80,.36);
    -webkit-backdrop-filter:blur(7px) saturate(80%) brightness(.44); backdrop-filter:blur(7px) saturate(80%) brightness(.44);
    border-bottom:1px solid rgba(150,190,255,.14);
    box-shadow:0 1px 0 rgba(0,0,0,.25);
  }
  :root.is-native[data-theme="app"] .appbar-biz{color:#F4F7FB; font-weight:600; letter-spacing:-.005em}
  :root.is-native[data-theme="app"] .appbar-word{color:#93A1B5}
}
/* The page keeps its bottom padding (overview.css), so the last content can always scroll fully above the bar. */
:root.is-native[data-theme="app"] .bottomnav{
  /* dark midnight-navy glass (the reference cube's body): the content behind is dimmed hard (brightness) rather than
     covered, so white cards stay dark while their shapes and text still read through softly under a light navy tint. A fine cool
     edge and a very faint reflection near the top edge give the dark material its depth. */
  background:linear-gradient(180deg, rgba(110,150,220,.09) 0%, rgba(110,150,220,0) 45%), rgba(2,18,80,.30);
  -webkit-backdrop-filter:blur(5px) saturate(80%) brightness(.42); backdrop-filter:blur(5px) saturate(80%) brightness(.42);
  border-top:1px solid rgba(150,190,255,.20);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05), 0 -12px 28px -16px rgba(0,0,0,.45);
  padding-top:5px;
}
/* one icon family (js/icons.js, Lucide-style), one weight, one size; labels and targets unchanged */
:root.is-native[data-theme="app"] .bottomnav button{position:relative; gap:3px; color:#B9C4D3; font-size:10.5px; font-weight:500; letter-spacing:.01em;
  min-height:calc(var(--bottomnav-h) - 12px); text-shadow:none; transition:color .15s ease}
:root.is-native[data-theme="app"] .bottomnav button svg{width:22px; height:22px; stroke-width:1.75; padding:3px 0; border-radius:0;
  background:transparent; color:#B3BECD; filter:none}
/* selection, the same for every tab: a small indicator line at the top edge + white, heavier label and icon */
:root.is-native[data-theme="app"] .bottomnav button::before{content:""; position:absolute; top:-5px; left:50%; width:22px; height:3px; margin-left:-11px;
  border-radius:0 0 3px 3px; background:#D6E4F5; opacity:0; transition:opacity .15s ease}
:root.is-native[data-theme="app"] .bottomnav button.on::before{opacity:1}
:root.is-native[data-theme="app"] .bottomnav button.on{color:#FFFFFF; font-weight:650}
:root.is-native[data-theme="app"] .bottomnav button.on svg{background:transparent; color:#FFFFFF; stroke-width:2.1}
:root.is-native[data-theme="app"] .bottomnav button:active svg{background:transparent; opacity:.7}
:root.is-native[data-theme="app"] .bottomnav button:focus-visible{box-shadow:inset 0 0 0 2px #9DB8DA}
/* Ruby: the chat bubble stays purple when inactive; selected, it brightens and takes the same line + label */
:root.is-native[data-theme="app"] .bottomnav button.bn-ruby::before{background:#A792FF}   /* Ruby's active line is her purple (portrait ring: app-shell.css) */

/* opaque fallback: no blur support, or the person asked for less transparency */
@supports not ((-webkit-backdrop-filter:blur(1px)) or (backdrop-filter:blur(1px))){
  :root.is-native[data-theme="app"] .topbar{background:#1A2433}
  :root.is-native[data-theme="app"] .bottomnav{background:#161E2A}
}
@media (prefers-reduced-transparency: reduce){
  :root.is-native[data-theme="app"] .topbar{background:#1A2433; -webkit-backdrop-filter:none; backdrop-filter:none}
  :root.is-native[data-theme="app"] .bottomnav{background:#161E2A; -webkit-backdrop-filter:none; backdrop-filter:none}
}
:root.is-native.ax-reduce-transparency[data-theme="app"] .topbar{background:#1A2433; -webkit-backdrop-filter:none; backdrop-filter:none}   /* iOS setting, via ReservdBridgeViewController */
:root.is-native.ax-reduce-transparency[data-theme="app"] .bottomnav{background:#161E2A; -webkit-backdrop-filter:none; backdrop-filter:none}
@media (prefers-reduced-motion: reduce){
  :root.is-native[data-theme="app"] .bottomnav button, :root.is-native[data-theme="app"] .bottomnav button::before{transition:none}
}

/* ---------- More sheet: compact identity, grouped rows, quiet icons ---------- */
:root.is-native[data-theme="app"] .more-backdrop .sheet{background:#F6F4F0}
:root.is-native[data-theme="app"] .more-backdrop .sheet-head{background:#F6F4F0}
:root.is-native[data-theme="app"] #moreBody .more-me.nm-me{display:flex; align-items:center; gap:12px; padding:12px 14px; margin:2px 0 20px; border-radius:14px;
  background:#FFFFFF; border:1px solid var(--line); box-shadow:none; -webkit-backdrop-filter:none; backdrop-filter:none}
.is-native .nm-me .av{flex-shrink:0}
.is-native .nm-me-t{flex:1; min-width:0; display:flex; flex-direction:column; gap:2px}
.is-native .nm-name{font-size:16px; font-weight:600; color:var(--ink); white-space:normal; overflow-wrap:anywhere}   /* a long real name wraps; never cut off */
.is-native .nm-name.nm-is-email{font-size:15px; white-space:normal; overflow-wrap:anywhere}
.is-native .nm-email{font-size:13px; color:var(--ink-faint); overflow-wrap:anywhere}
.is-native .nm-biz{display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; margin-top:4px; font-size:13px; color:var(--ink-muted)}
.is-native .nm-biz-n{min-width:0; overflow-wrap:anywhere}
.is-native .nm-plan{display:inline-flex; align-items:center; min-height:20px; padding:0 8px; border-radius:999px; background:rgba(44,92,134,.08); color:#2E5478; font-size:12px; font-weight:600; white-space:nowrap}
.is-native .nm-me > svg{color:var(--ink-faint); flex-shrink:0}
.is-native .more-sec-h{margin:0 4px 8px; font-size:12.5px; font-weight:650; letter-spacing:.05em; text-transform:uppercase; color:#545C68}   /* ≈6:1 on the sheet */
:root.is-native[data-theme="app"] .more-backdrop .more-group{margin-bottom:20px; border-radius:14px; border:1px solid var(--line); background:#FFFFFF; box-shadow:none}
:root.is-native[data-theme="app"] .more-backdrop .more-row{min-height:52px; padding:10px 14px; gap:12px; border-top:none;
  background:linear-gradient(var(--line), var(--line)) 56px 0 / calc(100% - 56px) 1px no-repeat}
:root.is-native[data-theme="app"] .more-backdrop .more-row:first-child{background:none}
:root.is-native[data-theme="app"] .more-backdrop .more-row:active{background-color:var(--surface-2)}
.is-native .more-backdrop .more-ic{width:30px; height:30px; border-radius:8px; background:rgba(44,92,134,.07); color:#3B5C80}
.is-native .more-backdrop .more-t b{font-size:15px; font-weight:550}
.is-native .more-backdrop .more-t small{font-size:12.5px; line-height:1.35; color:var(--ink-faint)}
.is-native .more-backdrop .nm-admin .more-ic{background:rgba(94,73,168,.09); color:#5E49A8}
/* Phase 9.3 — approved exception, native apps only: the Admin Console row (shown only to people the server already
   lists as admins) is a restrained premium card inside the Account group — deep navy → aubergine, a fine violet border
   and a faint top-edge sheen. White title, lavender shield, light chevron. No animation, no glow, same icon size. */
:root.is-native[data-theme="app"] .more-backdrop .more-row.nm-admin{position:relative; margin:6px; width:calc(100% - 12px); border-radius:11px; color:#FFFFFF;
  background:linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,0) 46%), linear-gradient(118deg, #18213B 0%, #241E42 52%, #33204A 100%);
  border:1px solid rgba(181,158,236,.30); box-shadow:inset 0 1px 0 rgba(255,255,255,.12), inset 0 0 0 1px rgba(124,98,206,.10)}
:root.is-native[data-theme="app"] .more-backdrop .more-row.nm-admin:active{background:linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.02) 46%), linear-gradient(118deg, #1D2745 0%, #2B2450 52%, #3B2656 100%)}
:root.is-native[data-theme="app"] .more-backdrop .more-row.nm-admin .more-ic{background:rgba(190,170,245,.14); color:#CDBDF6}
:root.is-native[data-theme="app"] .more-backdrop .more-row.nm-admin .more-t b{color:#FFFFFF}
:root.is-native[data-theme="app"] .more-backdrop .more-row.nm-admin .more-t small{color:rgba(222,212,252,.74)}
:root.is-native[data-theme="app"] .more-backdrop .more-row.nm-admin > svg:last-child{color:rgba(240,236,255,.72)}
:root.is-native[data-theme="app"] .more-backdrop .more-row.nm-admin + .more-row{background:none}
.is-native .more-backdrop .nm-out .more-row b{color:#B4382C}
.is-native .more-backdrop .nm-out .more-ic{background:rgba(180,56,44,.07); color:#B4382C}
.is-native .more-backdrop .sheet-head .close{display:inline-flex; align-items:center; justify-content:center}

/* ---------- Ask Ruby: deep charcoal / navy, financial pages stay light ---------- */
:root.is-native[data-theme="app"]:has(body[data-page="ask"]), :root.is-native[data-theme="app"] body[data-page="ask"]{background:#0E131B}
:root.is-native[data-theme="app"] body[data-page="ask"] :is(.app-shell, .app-main){background:transparent}
:root.is-native[data-theme="app"] #askPage{
  --ink:#F2F6FB; --ink-muted:#C3CEDC; --ink-faint:#8E9BAE; --line:rgba(214,228,245,.09); --line-strong:rgba(214,228,245,.16);
  --surface-2:rgba(255,255,255,.06); --accent:#AFC8E2; --violet:#C2B4F5; --violet-soft:rgba(194,180,245,.13);
  --info:#B8CBE4; --info-soft:rgba(143,176,214,.13); --warn:#F2C879; --danger:#FFB4AB; --risk:#FFB4AB; --risk-soft:rgba(255,138,128,.14);
  --focus-ring:0 0 0 2px #0E131B, 0 0 0 4px #9DB8DA;
  color:var(--ink);
}
:root.is-native[data-theme="app"] #askPage .pg-h h2{color:#FFFFFF}
/* compact introduction */
.is-native .ri-intro{padding:6px 2px 4px; text-align:left; color:var(--ink-muted)}
.is-native .ri-head{display:flex; align-items:center; gap:14px}
.is-native .ri-portrait{display:inline-flex; width:64px; height:64px; flex-shrink:0; border-radius:50%; overflow:hidden; box-shadow:0 0 0 1.5px rgba(255,255,255,.2), 0 10px 26px -12px rgba(0,0,0,.6)}
.is-native .ri-portrait img{width:100%; height:100%; object-fit:cover; display:block}
.is-native .ri-id{min-width:0}
.is-native .ri-h{margin:0; font-size:22px; font-weight:650; letter-spacing:-.015em; color:#FFFFFF; line-height:1.2}
.is-native .ri-sub{margin:3px 0 0; font-size:13px; color:#9AA8BB}
.is-native .ri-lead{margin:14px 0 0; max-width:none; font-size:15px; line-height:1.5; color:var(--ink-muted)}
.is-native .ri-intro .ask-starters{display:grid; grid-template-columns:minmax(0, 1fr); gap:8px; margin-top:20px; justify-content:stretch}
.is-native .ri-intro .ask-starters-h{margin:0 0 2px; text-align:left; font-size:12px; font-weight:600; letter-spacing:.06em; color:var(--ink-faint)}
.is-native .ri-intro .ask-starters-more{display:grid; gap:8px}
.is-native .ri-intro .ask-starters-more[hidden]{display:none}
.is-native .ri-intro .ask-session-note{margin:16px 0 0; text-align:left; color:#7F8B9D}
.is-native #askPage .ask-chip{min-height:48px; padding:12px 14px; border-radius:14px; text-align:left; font-size:15px; line-height:1.35;
  background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.09); color:#E8EDF3}
.is-native #askPage .ask-chip:active{background:rgba(255,255,255,.1)}
.is-native .ask-more-sugg{justify-self:start; min-height:44px; padding:0 4px; border:0; background:none; color:#9DB8DA; font:inherit; font-size:15px; font-weight:500; cursor:pointer}
.is-native .ask-more-sugg:focus-visible{outline:none; box-shadow:var(--focus-ring); border-radius:8px}
.is-native .is-native-ruby .ask-tools:not(:has(button:not([hidden]))){display:none}
.is-native #askPage .ask-clear-b{color:#9DB8DA}
/* conversation */
.is-native #askPage .ask-bubble{background:#2A4B70; color:#FFFFFF}
.is-native #askPage .ask-card{background:#161D28; border:1px solid rgba(255,255,255,.08); color:var(--ink-muted); box-shadow:none}
.is-native #askPage .ask-answer{color:#FFFFFF}
.is-native #askPage .ask-av{background:#1E2633; box-shadow:0 0 0 1.5px rgba(255,255,255,.18)}
.is-native #askPage .ask-source{border-top-color:rgba(255,255,255,.08); color:var(--ink-faint)}
.is-native #askPage .ask-act{background:rgba(157,184,218,.12); border-color:rgba(157,184,218,.26); color:#DCE8F5}
.is-native #askPage .ask-act.is-quiet{background:transparent; border-color:rgba(255,255,255,.14); color:var(--ink-muted)}
.is-native #askPage .ask-more{color:#9DB8DA}
.is-native #askPage .ask-tech code{background:rgba(255,255,255,.06); color:var(--ink-muted)}
.is-native #askPage .ask-card.is-error{border-color:rgba(255,138,128,.3)}
.is-native #askPage .ask-card.is-error .ask-answer{color:#FFB4AB}
.is-native #askPage .ask-card.is-unavailable{border-color:rgba(242,200,121,.28)}
.is-native #askPage .ask-follow .ask-chip{min-height:40px; padding:8px 12px; font-size:14px}
.is-native #askPage .ask-vb{background:var(--violet-soft); border-color:rgba(194,180,245,.28); color:#DCD3FF}
.is-native #askPage .ask-vb.is-on{background:#7663D2; border-color:transparent; color:#FFFFFF}
.is-native #askPage :is(.ask-vb.is-icon, .ask-vb.is-wait){background:rgba(255,255,255,.05); border-color:rgba(255,255,255,.12); color:var(--ink-muted)}
.is-native #askPage .ask-vb:disabled, .is-native #askPage .ask-act:disabled, .is-native #askPage .ask-chip:disabled{opacity:.5}
.is-native #askPage .ask-jump{background:#1E2733; color:#E8EDF3; border:1px solid rgba(255,255,255,.12); box-shadow:0 8px 20px -10px rgba(0,0,0,.6)}
/* composer: one surface holding dictation, voice conversation and send */
:root.is-native[data-theme="app"] #askPage .ask-composer{background:#141B26; border:1px solid rgba(255,255,255,.11); border-radius:18px; box-shadow:none}
:root.is-native[data-theme="app"] #askPage .ask-composer:focus-within{border-color:#9DB8DA; box-shadow:0 0 0 3px rgba(157,184,218,.2)}
:root.is-native[data-theme="app"] #askPage .ask-input{color:#FFFFFF; caret-color:#FFFFFF; font-size:16px}
:root.is-native[data-theme="app"] #askPage .ask-input::placeholder{color:#7F8B9D}
.is-native #askPage .ask-mic{color:#AEB9C8; width:36px}
.is-native #askPage .ask-composer{gap:4px}
:root.is-native[data-theme="app"] #askPage .ask-input::placeholder{white-space:nowrap; overflow:hidden; text-overflow:ellipsis}   /* one line on narrow phones */
.is-native #askPage .ask-mic:active{background:rgba(255,255,255,.08)}
.is-native #askPage .ask-vc{color:#C8BBF7}
.is-native #askPage .ask-send{background:#FFFFFF; color:#0A0B0D}
.is-native #askPage .ask-send.is-stop{background:#E3E7EC; color:#0A0B0D}
.is-native #askPage .ask-disclaimer{display:block; margin:-2px 4px 0; color:#8592A5; font-size:12px; line-height:1.45}   /* phones hid it (insights.css); the apps keep the AI disclosure visible */
.is-native #askPage .ask-disc-line{color:#8592A5}
.is-native .ask-info-sheet{background:#141B26; color:#F2F6FB}
.is-native .ask-info-sheet p{color:#C3CEDC}
.is-native .ask-info-done{background:#FFFFFF; color:#0A0B0D}
/* keyboard up (apps): the bottom bar is hidden, so its space and the page title's go to Ruby — the composer and the
   whole AI disclosure stay above the keyboard (js/native.js sets body[data-native-kb]; the WebView resizes) */
:root.is-native[data-theme="app"] body[data-native-kb][data-page="ask"] .app-main{padding-bottom:0}
:root.is-native[data-theme="app"] body[data-native-kb] #askPage{padding-top:8px; padding-bottom:8px}
:root.is-native[data-theme="app"] body[data-native-kb] #askPage .pg-h{display:none}
:root.is-native[data-theme="app"] body[data-native-kb] #askPage .ask-layout{height:calc(var(--app-vh, 100vh) - var(--appbar-h) - env(safe-area-inset-top) - 16px); min-height:0}
@media (prefers-reduced-motion: reduce){ .is-native #askPage .ask-chip, .is-native #askPage .ask-act{transition:none} }
