/* AFIYA appearance layer: light and dark tokens, the approved backdrops, glass on navigation chrome only, and the first-launch introduction.
   Ported from design/mocks (afiya-glass.css, afiya-dark.css, onboarding rules). Load after afiya.css and app.css. No inline styles anywhere (strict CSP).
   Information surfaces (cards, lists, banners, forms, evidence) stay opaque; glass is used only on the app bar, navigation, sheets, segmented control and toast. */
:root {
  color-scheme: light;
  --backdrop: url("assets/backdrop-light.jpg");
  --brand-solid: #1F6B66; --conflict-line: #D9B9D0; --plan-bg: #FFF3D6; --plan-fg: #5c3a07; --plan-line: #E0B55A;
  --lg-fill: rgba(255,255,255,.58); --lg-fill-strong: rgba(255,255,255,.86); --lg-fill-lite: rgba(255,255,255,.74);
  --lg-blur: 18px; --lg-sat: 1.55;
  --lg-rim: inset 1.5px 1.5px 0 rgba(255,255,255,.85), inset -1px -1px 0 rgba(255,255,255,.28), 0 0 0 .5px rgba(30,42,45,.09);
  --lg-lift: 0 10px 30px rgba(24,70,66,.16), 0 2px 6px rgba(24,70,66,.08);
  --bar-fill: linear-gradient(180deg, rgba(250,247,242,.82), rgba(250,247,242,.46));
  --ob-fill: #FAF3EB; --ob-v: 250,243,235; --ob-ink: #1E2A2D; --ob-ink2: #44545A; --ob-eb: #0F3F3C; --ob-chip: rgba(250,243,235,.94);
}
[data-theme=dark] {
  color-scheme: dark;
  --backdrop: url("assets/backdrop-dark.jpg");
  --bg: #0C1C19; --surface: #152A26; --surface-2: #1C3631; --surface-3: #264540;
  --ink: #EDF4F0; --ink-2: #C9D8D2; --ink-3: #9FB5AD; --line: #2A423C; --line-2: #3B5A52;
  --brand: #6FD0BF; --brand-solid: #1F7A6F; --brand-ink: #CFF3EA; --brand-soft: #1B3F3A; --brand-line: #2F6A60;
  --verified: #8EDBA6; --verified-bg: #1E3B2B; --extracted: #9CC3EE; --extracted-bg: #1D3148;
  --reported: #EBC17A; --reported-bg: #3A2F18; --unknown: #B1C0BB; --unknown-bg: #22322F;
  --conflict: #E0A6D2; --conflict-bg: #3B2437; --conflict-line: #6B4A63;
  --danger: #F4968A; --danger-bg: #3D211D; --success: #8EDBA6; --success-bg: #1E3B2B; --warn: #EBC17A; --warn-bg: #3A2F18;
  --plan-bg: #3A2F18; --plan-fg: #F0D9A6; --plan-line: #7A6230;
  --shadow-1: 0 1px 2px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.25); --shadow-2: 0 8px 28px rgba(0,0,0,.55);
  --lg-fill: rgba(16,38,34,.58); --lg-fill-strong: rgba(18,40,36,.9); --lg-fill-lite: rgba(18,40,36,.8);
  --lg-rim: inset 1.5px 1.5px 0 rgba(255,255,255,.2), inset -1px -1px 0 rgba(255,255,255,.06), 0 0 0 .5px rgba(255,255,255,.1);
  --lg-lift: 0 10px 30px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.35);
  --bar-fill: linear-gradient(180deg, rgba(12,28,25,.86), rgba(12,28,25,.5));
  --ob-fill: #091A17; --ob-v: 9,26,23; --ob-ink: #EDF4F0; --ob-ink2: #C9D8D2; --ob-eb: #CFF3EA; --ob-chip: rgba(9,26,23,.86);
}
[data-theme=dark] .banner.info { color: #CFE2F7; }
[data-theme=dark] .banner.warn { color: #F3DDB0; }
[data-theme=dark] .banner.danger { color: #F9C9C2; }
[data-theme=dark] .banner.ok { color: #BDEBCB; }
[data-theme=dark] .banner.conflict { color: #F0CDE6; }
[data-theme=dark] .input.err { background: #2A1A18; }
[data-theme=dark] .input::placeholder { color: var(--ink-3); }
[data-theme=dark] .toast { background: rgba(237,244,240,.94); color: #0C1C19; }
[data-theme=dark] .tog { background: #3B5A52; }
[data-theme=dark] .tog::after { background: #EDF4F0; }
[data-theme=dark] .card, [data-theme=dark] .list, [data-theme=dark] .banner { box-shadow: inset 1px 1px 0 rgba(255,255,255,.06), var(--shadow-1); }
.mark { display: block; line-height: 0; }
.mark img { display: block; margin: 0 auto; }
.mark-dark { display: none !important; border-radius: 22%; }
[data-theme=dark] .mark-light { display: none !important; }
[data-theme=dark] .mark-dark { display: block !important; }

/* ---- backdrop: a quiet colour field behind every screen (static image, no animation) ---- */
.app::before { content: ""; position: fixed; top: 0; bottom: 0; left: 50%; width: min(100%, 480px); transform: translateX(-50%); z-index: 0; pointer-events: none; background: var(--backdrop) center / cover no-repeat; }
.app > div { position: relative; z-index: 1; }

/* ---- glass: chrome only ---- */
.appbar { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
.nav { margin: 0 12px 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 32px; padding: 6px; isolation: isolate; background: var(--lg-fill);
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat)); backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat)); box-shadow: var(--lg-rim), var(--lg-lift); }
.nav button { position: relative; }
.nav button[aria-current=page]::after { content: ""; position: absolute; bottom: 3px; width: 18px; height: 3px; border-radius: 2px; background: var(--brand); }
.seg { background: rgba(235,228,216,.62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: inset 0 1px 2px rgba(30,42,45,.08); }
[data-theme=dark] .seg { background: rgba(255,255,255,.08); box-shadow: inset 0 1px 2px rgba(0,0,0,.4); }
.seg button[aria-selected=true] { background: var(--lg-fill-strong); box-shadow: var(--lg-rim), 0 2px 8px rgba(24,70,66,.14); }
.scrim { background: rgba(18,40,40,.34); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
[data-theme=dark] .scrim { background: rgba(0,6,5,.55); }
.sheet { background: var(--lg-fill-strong); -webkit-backdrop-filter: blur(26px) saturate(1.5); backdrop-filter: blur(26px) saturate(1.5); box-shadow: var(--lg-rim), 0 -12px 40px rgba(18,40,40,.2); }
[data-theme=dark] .toast { -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .nav, .sheet, .seg { background: var(--surface); } }
@media (prefers-reduced-transparency: reduce) {
  .nav, .sheet, .appbar, .seg, .scrim, .toast { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .nav, .sheet, .appbar, .seg { background: var(--surface) !important; }
  .app::before { opacity: .55; }
}
@media (prefers-contrast: more) {
  :root, [data-theme=dark] { --lg-fill: var(--surface); --lg-fill-strong: var(--surface); --lg-fill-lite: var(--surface); }
  .app::before { display: none; }
  .nav, .sheet { border: 1.5px solid var(--ink); }
}
@media (forced-colors: active) { .nav, .sheet, .appbar { border: 1px solid CanvasText; background: Canvas !important; } .app::before { display: none; } }

/* ---- Settings > Appearance ---- */
.radio { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; background: var(--surface); }
[aria-checked=true] > .radio { border-color: var(--brand-solid); }
[aria-checked=true] > .radio::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--brand-solid); }

/* ---- first-launch introduction (LA-02): text-free portrait images; all words are live text on solid colour, never on the picture ---- */
.ob { flex: 1; display: flex; flex-direction: column; position: relative; background: var(--ob-fill); color: var(--ob-ink); }
.ob-img { order: 0; flex: 1 1 0; position: relative; min-height: calc(min(100vw, 480px) * var(--ob-h) * .72); background-size: cover; background-repeat: no-repeat; background-position: var(--ob-px) 0; }
.ob-img::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 18%; background: linear-gradient(to bottom, rgba(var(--ob-v),0), rgba(var(--ob-v),1)); }
.ob-top .ob-img { order: 1; background-position: var(--ob-px) 100%; }
.ob-top .ob-img::after { bottom: auto; top: 0; background: linear-gradient(to top, rgba(var(--ob-v),0), rgba(var(--ob-v),1)); }
.ob-s1 .ob-img { background-image: url("assets/onboarding/ob-1.jpg"); --ob-px: 80%; --ob-h: 1.03; }
.ob-s2 .ob-img { background-image: url("assets/onboarding/ob-2.jpg"); --ob-px: 50%; --ob-h: .89; }
.ob-s3 .ob-img { background-image: url("assets/onboarding/ob-3.jpg"); --ob-px: 60%; --ob-h: 1.1; background-position: 60% 62%; }
.ob-s4 .ob-img { background-image: url("assets/onboarding/ob-4.jpg"); --ob-px: 70%; --ob-h: .89; }
.ob-text { order: 1; padding: 6px 20px 14px; }
.ob-top .ob-text { order: 0; padding-top: calc(64px + env(safe-area-inset-top, 0px)); padding-bottom: 6px; }
.ob-foot { order: 3; display: flex; flex-direction: column; gap: 6px; padding: 4px 20px calc(max(env(safe-area-inset-bottom, 0px), 12px) + 6px); }
.ob-skip { position: absolute; z-index: 3; top: calc(10px + env(safe-area-inset-top, 0px)); right: 14px; min-height: 44px; min-width: 64px; padding: 0 18px; border-radius: 999px; background: var(--ob-chip); color: var(--ob-ink); font-weight: 650; font-size: var(--fs-sm); box-shadow: 0 1px 6px rgba(0,0,0,.12); }
.ob-eyebrow { display: inline-flex; align-items: center; gap: 6px; font: 700 11px/1.2 var(--font-body); letter-spacing: .14em; color: var(--ob-eb); margin-bottom: 8px; }
.ob-eyebrow.ob-soon { font-weight: 600; font-size: 10.5px; letter-spacing: .1em; padding: 5px 10px; border-radius: 999px; border: 1px dashed var(--plan-line); background: var(--plan-bg); color: var(--plan-fg); }
.ob-h { font-family: var(--font-display); font-weight: 600; font-size: 28px; line-height: 1.15; letter-spacing: -.005em; color: var(--ob-ink); }
.ob-sub { margin-top: 6px; font-weight: 650; font-size: var(--fs-lg); color: var(--ob-ink); }
.ob-p { margin-top: 8px; font-size: 15px; line-height: 1.42; color: var(--ob-ink2); }
.ob-safe { display: flex; gap: 7px; align-items: flex-start; margin-top: 10px; font-size: 12.5px; line-height: 1.35; color: var(--ob-ink2); }
.ob-safe .ico { margin-top: 1px; }
.ob-dots { display: flex; justify-content: center; }
.ob-dot { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.ob-dot::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: var(--line-2); }
@media (prefers-reduced-motion: no-preference) { .ob-dot::before { transition: all var(--dur); } }
.ob-dot.on::before { width: 24px; background: var(--brand-solid); }
.ob-dot.soon::before { background: transparent; border: 1.5px dashed var(--plan-line); width: 9px; height: 9px; }
.ob-dot.soon.on::before { width: 24px; background: var(--plan-bg); }
.ob-signin { min-height: 48px; font-size: var(--fs-sm); color: var(--ob-ink2); text-align: center; }
.ob-signin b { color: var(--ob-ink); text-decoration: underline; text-underline-offset: 3px; }
.ob-spacer { min-height: 48px; }
@media (prefers-reduced-motion: no-preference) { .ob-text { animation: obin .45s var(--ease); } @keyframes obin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } } }
@media (max-width: 240px) { .ob-h { font-size: 22px; } }

[data-theme=dark] .btn.danger { background: #B3382C; color: #fff; }
/* Very narrow screens (200 percent zoom, 188 px): the navigation fills the width so each item stays 44 px wide, and the introduction dots keep their 44 px targets. */
@media (max-width: 240px) {
  .nav { margin: 0 0 6px; padding: 4px 0; border-radius: 22px; }
  .ob-foot { padding-left: 6px; padding-right: 6px; }
  .ob-text { padding-left: 12px; padding-right: 12px; }
}

/* The introduction is full-bleed: the picture and colour run behind the Android status bar and system bar; its own paddings keep text and buttons clear of them. */
body:has(.ob) { padding: 0; }
body:has(.ob)::before { display: none; }
body:has(.ob) .app { min-height: 100dvh; }
