/* RAABIH PA — One UI 9 layer (2026-10-23, "tune the pa app to one ui 9").
   Loaded AFTER app.css: it re-shapes the shared components the One UI way and every room inherits it.
   Colours come from tokens.css; this file holds shape, type and motion only.
     • a plain canvas — no aurora, stars or grain; the frosted top bar blurs what slides under it
     • rooms open with a large title low in the screen (the "viewing area"); it fades and shrinks as you scroll
     • opaque cards with big radii (26–28px), rows inside them with thin INSET dividers
     • pill buttons, pill segmented controls, One UI switches (Samsung blue + white knob)
     • a floating, labelled bottom tab bar with a pill behind the current tab
     • presses settle on a soft spring (--ease-oui); everything still honours Calm mode and reduced motion */

/* ── Canvas + type ───────────────────────────────────────────────────── */
body { background: var(--void); font-feature-settings: normal; letter-spacing: 0; }
.fx { background: var(--void); }
.fx-aurora, .fx-stars, .fx-grain, .fx-cursor { display: none !important; }
.display, h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: var(--track-display); }
h1, .h1 { font-weight: 700; letter-spacing: -0.02em; }
.hero { font-weight: 700; letter-spacing: -0.03em; }
/* One UI sub-headers: small, semibold, sentence case — not mono capitals */
.label, .nc-group { font: 600 var(--fs-sm)/1.25 var(--font-body); letter-spacing: .01em; text-transform: none; color: var(--text-3); }
/* figures line up in columns (the old mono slot is now the UI face) */
.mono, .num, .r-time, .row-time, .tl-time, .r-end, .kpi-value, .big-num, .ring-label, .hb-v, .toast-n, .nc-when { font-variant-numeric: tabular-nums; }
/* real code keeps a code face */
pre.code, code, .st-mono, .st-cmd, .st-li .f { font-family: var(--font-code); }
.kbd { font-family: var(--font-body); }
a { color: var(--accent-ink); }
:focus-visible { outline-color: var(--focus); }
.prism-text { background-size: 100% .09em; }

/* ── The frosted top bar ─────────────────────────────────────────────── */
.statebar::before { inset: 0; background: var(--frost); -webkit-mask-image: none; mask-image: none;
  -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid transparent; transition: border-color var(--d-base); }
.stateline { font-family: var(--font-body); font-weight: 500; }
.stateline .dot { box-shadow: none; }
.command input { border: 0; background: var(--glass-2); height: 44px; }
.command input:focus { border: 0; background: var(--glass-2); box-shadow: 0 0 0 2px var(--accent); }

/* ── The large title (viewing area) ──────────────────────────────────── */
.v-head h1, .room-head h1, .st-head h1 { font-size: var(--fs-title); line-height: var(--lh-tight); }
@media (max-width: 759.98px) {
  /* the empty top of the screen is for reading; what you touch sits lower, under the thumb */
  body[data-chrome="on"] .stage { padding-top: calc(var(--s-2) + var(--head-area)); }
  body[data-chrome="on"] .stage:has(.now-room), body[data-chrome="on"] .stage:has(.st-page:not([hidden])) { padding-top: var(--s-2); }
  body[data-chrome="on"] .room :is(.v-head, .room-head, .pl-head, .nt-head, .sk-head, .vt-head, .st-head, .rc-head, .sh-title) h1 {
    font: 700 var(--fs-title)/var(--lh-tight) var(--font-display); letter-spacing: -0.025em; transform-origin: left bottom; }
  /* a room with no heading of its own (Tasks…) still opens on its name: app.js puts it in #room[data-title] */
  body[data-chrome="on"] .room[data-title]:not(:has(h1:not(.sr-only), .now-room))::before {
    content: attr(data-title); display: block; margin: 0 2px var(--s-5); color: var(--text);
    font: 700 var(--fs-title)/var(--lh-tight) var(--font-display); letter-spacing: -0.025em; transform-origin: left bottom; }
}
/* the title folds away as the room scrolls under the bar (scroll-driven: compositor only, no script) */
@keyframes oui-title { to { opacity: 0; transform: translateY(-10px) scale(.84); } }
@supports (animation-timeline: scroll()) {
  @media (max-width: 759.98px) and (prefers-reduced-motion: no-preference) {
    :root:not([data-calm="true"]) body[data-chrome="on"] .room :is(.v-head, .room-head, .pl-head, .nt-head, .sk-head, .vt-head, .st-head, .rc-head, .sh-title) h1,
    :root:not([data-calm="true"]) body[data-chrome="on"] .room[data-title]::before {
      animation: oui-title linear both; animation-timeline: scroll(root block); animation-range: 0 calc(var(--head-area) + 48px); }
  }
}

/* ── Cards ───────────────────────────────────────────────────────────── */
.panel { border: 0; border-radius: var(--r-card); background: var(--glass); box-shadow: var(--shadow-1); padding: var(--s-5) var(--card-pad); }
.panel::before { display: none; }
.panel.pad-sm { border-radius: var(--r-md); padding: var(--s-4); }
.panel.risk { border: 1px solid color-mix(in srgb, var(--coral) 55%, transparent); box-shadow: none; background: color-mix(in srgb, var(--coral) 7%, var(--glass)); }
.panel.warn { border: 1px solid color-mix(in srgb, var(--amber) 55%, transparent); }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .panel, .toast { background: var(--glass); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .sheet, .modal { background: var(--raise); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.tilt::after { display: none; }
.context { background: var(--glass); border-left-color: var(--edge); -webkit-backdrop-filter: none; backdrop-filter: none; }

/* a list of rows that is not already inside a card becomes one: One UI groups rows in rounded cards */
.rows:not(:is(.panel, .nw-card, .st-card, .st-sec, .st-menu, .sheet, .modal, .context, .more-grid) .rows):not(:empty) {
  background: var(--glass); border-radius: var(--r-card); padding: 2px var(--card-pad); }
/* thin dividers, inset from the left edge (they start where the text starts) */
.rows > .r { border-bottom: 0; }
.rows > .r + .r::before, .list > .row + .row::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--edge); pointer-events: none; }
.rows > .r + .r:has(> .tick, > .row-ico, > .st-ico)::before { left: 42px; }
.list > .row { border-bottom: 0; border-radius: 0; }
.list > .row:hover, .tl-item:hover { background: transparent; }
@media (hover: hover) { .rows > a.r:hover, .rows > button.r:hover { background: color-mix(in srgb, var(--text) 4%, transparent); } }
.row-ico { border-radius: 50%; }
.r .r-dot { box-shadow: none; }
.sec { margin-top: var(--s-6); }
.sec-head { padding: 0 6px; margin-bottom: var(--s-2); }
.sec-head h2 { font: 700 var(--fs-h3)/1.25 var(--font-display); letter-spacing: -0.01em; }
.sec-head a, .sec-head .link { color: var(--accent-ink); font-weight: 600; }
.panel-head h3 { font-weight: 700; }

/* ── Buttons: pills ──────────────────────────────────────────────────── */
.btn { border: 0; border-radius: var(--r-pill); background: var(--bg); font: 600 var(--fs-body)/1 var(--font-body); padding: 0 var(--s-5);
  transition: background var(--d-fast), color var(--d-fast), transform var(--d-press) var(--ease-oui), filter var(--d-fast); }
.btn:active { filter: none; transform: scale(.96); }
.btn.primary { color: var(--on-accent); background: var(--accent-fill); box-shadow: none; transition: background var(--d-fast), transform var(--d-press) var(--ease-oui); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent-fill) 88%, #000); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--accent-ink); }
.btn.ghost:hover { background: var(--accent-soft); color: var(--accent-ink); }
.btn.danger { border: 0; color: var(--risk-ink); background: var(--risk-soft); }
.btn.danger:hover { box-shadow: none; background: color-mix(in srgb, var(--coral) 20%, transparent); }
.btn.sm { border-radius: var(--r-pill); padding: 0 var(--s-4); }
.btn.icon { border-radius: 50%; padding: 0; }
.btn .dotbadge { box-shadow: 0 0 0 2px var(--glass); }
.badge { box-shadow: 0 0 0 2px var(--void); font-family: var(--font-body); }

/* ── Chips ───────────────────────────────────────────────────────────── */
.chip { border: 0; background: var(--glass-2); font: 600 var(--fs-xs)/1.2 var(--font-body); letter-spacing: .01em; padding: 4px 11px; }
.chip.risk { border: 0; }
.chip.live::before { box-shadow: none; }
button.chip { transition: background var(--d-fast), transform var(--d-press) var(--ease-oui); }
button.chip:active { transform: scale(.95); }
button.chip[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent-soft); border: 0; }
.badge-venture { font-family: var(--font-body); letter-spacing: .02em; }
.badge-venture::before { border-radius: 50%; rotate: none; box-shadow: none; }

/* ── Fields, checks, switches ────────────────────────────────────────── */
.field > label, .field > .field-label { font: 600 var(--fs-sm)/1.25 var(--font-body); letter-spacing: .01em; text-transform: none; color: var(--text-2); padding-left: 4px; }
.field input, .field select, .field textarea, .input { border: 1.5px solid transparent; border-radius: var(--r-sm); background: var(--glass-2); }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--accent); background: var(--glass-2); box-shadow: none; }
.field.error input, .field.error textarea, .field.error select { border-color: var(--coral); box-shadow: none; }
.check input { border-radius: 50%; border-width: 2px; background: transparent; }
.check input:checked { background: var(--accent-fill); border-color: var(--accent-fill); }
.check input::after { border-color: #fff; }
/* the One UI switch: a grey track and a white knob; on = Samsung blue */
.switch { border: 0; background: var(--track-off); }
.switch::after { background: var(--knob); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform var(--d-base) var(--ease-oui); }
.switch[aria-checked="true"] { background: var(--accent-fill); border: 0; }
.switch[aria-checked="true"]::after { background: var(--knob); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
input[type="range"] { accent-color: var(--accent); }

/* ── Segmented control + tabs: pills ─────────────────────────────────── */
.seg { border: 0; border-radius: var(--r-pill); background: var(--glass-2); padding: 3px; }
.seg button, .seg a { border-radius: var(--r-pill); font-family: var(--font-body); }
.seg .seg-thumb { top: 3px; height: calc(100% - 6px); border: 0; border-radius: var(--r-pill); background: var(--raise); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
:root[data-theme="dark"] .seg .seg-thumb { background: #3A3A3F; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .seg .seg-thumb { background: #3A3A3F; } }
.seg [aria-selected="true"], .seg [aria-current="page"] { font-weight: 700; }

/* ── KPI / ring / timeline: flat, no glow ────────────────────────────── */
.kpi-value { font-weight: 700; letter-spacing: -0.03em; }
.kpi[data-v] .kpi-value { text-shadow: none; }
.big-num { font-weight: 700; letter-spacing: -0.03em; }
.ring .ring-bar { filter: none; }
.tl-item::before { box-shadow: none; background: var(--glass); }
.empty-ico { border: 0; border-radius: 50%; }
.notice { border: 0; border-radius: var(--r-md); background: var(--glass-2); }
.notice.warn { background: var(--warn-soft); }
.notice.risk { background: var(--risk-soft); }
.divider { background: var(--edge); }
code { border-radius: 8px; }
pre.code { border: 0; border-radius: var(--r-md); background: var(--glass-2); }
.hbar .hb-track { background: var(--glass-2); }

/* ── Overlays: One UI sheets + dialogs ───────────────────────────────── */
.sheet { border-left: 0; box-shadow: var(--shadow-3); }
.modal { border: 0; border-radius: var(--r-xl); box-shadow: var(--shadow-3); }
.modal.risk { border: 1px solid color-mix(in srgb, var(--coral) 55%, transparent); }
.toast { border: 0; border-radius: 22px; background: var(--raise) !important; box-shadow: var(--shadow-2); }
.toast.risk { border: 1px solid color-mix(in srgb, var(--coral) 55%, transparent); }
.toast-x { border-radius: 50%; }

/* ── The More sheet + notification centre ────────────────────────────── */
.more-grid { gap: 10px; }
.more-tile { border: 0; border-radius: 22px; background: var(--glass-2); transition: background var(--d-fast), transform var(--d-press) var(--ease-oui); }
.more-tile:active { transform: scale(.95); }
.more-tile[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.nc-item.is-unread .nc-t::after { background: var(--accent); box-shadow: none; }

/* ── Desktop rail: a One UI navigation rail ──────────────────────────── */
.rail { background: var(--glass); -webkit-backdrop-filter: none; backdrop-filter: none; }
.rail-item { border: 0; border-radius: var(--r-pill); }
.rail-item .txt { font: 600 .9375rem/1 var(--font-body); }
.rail-item[aria-current="page"] { color: var(--accent-ink); background: var(--accent-soft); }
.rail-item[aria-current="page"]::before { display: none; }

/* ── Mic FAB: Noor keeps her prism, without the halo ──────────────────── */
.mic-fab { box-shadow: 0 6px 20px rgba(0, 0, 0, .28); transition: transform var(--d-press) var(--ease-oui), box-shadow var(--d-base); }

/* ── Phone ───────────────────────────────────────────────────────────── */
@media (max-width: 759.98px) {
  .statebar { height: 56px; }
  /* the floating tab bar: a rounded, solid One UI bar (solid on phones — see the WebView note in app.css) */
  .dock { left: 12px; right: 12px; border: 0; border-radius: 30px; box-shadow: 0 4px 24px rgba(0, 0, 0, .14), 0 0 0 1px var(--edge); }
  :root[data-theme="light"] .dock { box-shadow: 0 4px 24px rgba(0, 0, 0, .10), 0 0 0 1px var(--edge); }
  .dock-item { font: 600 11px/1 var(--font-body); color: var(--text-2); gap: 4px; }
  .dock-item svg { position: relative; z-index: 1; }
  .dock-item .txt { position: relative; z-index: 1; }
  .dock-item[aria-current="page"] { color: var(--text); font-weight: 700; }
  .dock-item[aria-current="page"] svg { color: var(--accent-ink); }
  .dock-item[aria-current="page"]::after { display: none; }
  /* the current tab: a soft pill behind its icon */
  .dock-item::before { content: ''; position: absolute; left: 50%; top: 7px; width: 54px; height: 30px; margin-left: -27px; border-radius: var(--r-pill);
    background: var(--accent-soft); opacity: 0; transform: scale(.6); transition: opacity var(--d-fast), transform var(--d-base) var(--ease-oui); pointer-events: none; }
  .dock-item[aria-current="page"]::before { opacity: 1; transform: none; }
  .dock-mic::before { display: none; }
  .dock-item .badge { z-index: 2; }
  .sec-head { padding: 0 8px; }
  .panel { padding: var(--s-4) var(--s-4); border-radius: var(--r-card); }
  .rows:not(:is(.panel, .nw-card, .st-card, .st-sec, .st-menu, .sheet, .modal, .context, .more-grid) .rows):not(:empty) { padding: 2px var(--s-4); }
  .sheet { border-top: 0; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .sheet::before { width: 36px; background: var(--text-3); opacity: .4; }
  /* dialogs rise from the bottom, inside the thumb's reach, with a margin all round */
  .overlay.for-modal { place-items: end center; padding: var(--s-3) var(--s-3) calc(var(--s-3) + env(safe-area-inset-bottom, 0px)); }
  .modal { border-radius: var(--r-xl); padding: var(--s-6) var(--s-5) var(--s-5); }
  .context { border-top: 0; border-radius: var(--r-xl) var(--r-xl) 0 0; background: var(--raise) !important; }
  .tabstrip { margin-bottom: var(--s-4); }
  .md-tabs { border-radius: var(--r-pill); }
}

/* ── Calm + reduced motion: presses do not move ──────────────────────── */
:root[data-calm="true"] :is(.btn, button.chip, .more-tile):active { transform: none; }
@media (prefers-reduced-motion: reduce) {
  :is(.btn, button.chip, .more-tile):active { transform: none; }
  .dock-item::before, .switch::after { transition: none; }
}

/* ── Print: keep the ink-on-paper rules ──────────────────────────────── */
@media print { .rows { background: none !important; } .toast { display: none; } }
