/* One visual grammar from opening to continuity. Content scrolls; actions stay
   inside the app, outside the home-indicator region. */
.is-flow { overflow: hidden; display: flex; flex-direction: column; }
.flow-page { height: 100%; min-height: 0; display: flex; flex-direction: column; color: var(--text); }
.flow-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 27px 23px 20px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--app-line) transparent; }
.flow-page h1 { font-size: 27px; line-height: 1.2; letter-spacing: -.035em; font-weight: 750; margin: 0 0 14px; outline: none; text-wrap: pretty; }
.flow-page h2 { font-size: 16px; line-height: 1.4; font-weight: 650; margin: 0 0 8px; }
.flow-lead { margin: 0 0 26px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.flow-kicker { font-size: 11px; line-height: 1.5; font-weight: 650; letter-spacing: .11em; text-transform: uppercase; color: var(--gold); margin: 0 0 16px; }
.flow-note { font-size: 12px; line-height: 1.65; color: var(--muted); padding: 14px 0; border-top: 1px solid var(--app-line); margin: 16px 0 0; }
.flow-fine { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 10px 0; }
.flow-actions { padding: 12px 23px 15px; border-top: 1px solid var(--app-line); background: var(--app-bg); flex: none; display: flex; flex-direction: column; gap: 10px; }
.flow-actions .primary-button, .flow-actions .secondary-button { min-height: 48px; }
.flow-actions .flow-note { text-align: center; margin: 0; padding: 0; border: 0; font-size: 11px; }
.flow-text-button { padding: 9px 0; min-height: 42px; color: var(--gold); border: 0; background: transparent; font-size: 12px; line-height: 1.5; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.flow-text-button svg { width: 15px; height: 15px; }
.flow-actions .flow-text-button { min-height: 30px; padding: 4px; }
.primary-button:disabled { background: #6e6a54; color: #c6c8bc; box-shadow: 0 3px 0 #4d5149; opacity: .75; transform: none; }
.flow-dual-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.flow-sheet-actions { display: grid; gap: 12px; margin-top: 20px; }
.flow-danger { color: #f0b1bf; }
.flow-source-title { font-size: 17px; line-height: 1.5; margin: 8px 0 15px; }

/* The entire approved logo remains visible: no duplicate tagline or cover. */
.flow-splash { position: relative; height: 100%; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 25px; overflow: hidden; }
.flow-splash > img { position: relative; width: 100%; max-width: 310px; height: auto; filter: brightness(var(--art-brightness, 1)); animation: brand-reveal 900ms var(--ease-out) both; }
@keyframes brand-reveal { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.flow-logo-orbit { position: absolute; top: calc(50% - 203px); left: calc(50% - 103px); width: 206px; height: 206px; border: 1px solid #d9bb7820; border-top-color: var(--gold); border-radius: 50%; animation: splash-orbit 5s var(--ease-out) both; opacity: .35; }
.flow-loading { width: 92px; height: 3px; margin-top: 20px; background: var(--app-surface-hover); border-radius: 3px; overflow: hidden; }
.flow-loading i { display: block; height: 100%; width: 100%; background: var(--gold); transform-origin: left; transform: scaleX(0); }
.flow-splash > p { position: relative; color: var(--muted); font-size: 12px; margin: 15px 0 0; }
@keyframes splash-orbit { from { transform: rotate(-90deg); opacity: 0; } 20% { opacity: .35; } to { transform: rotate(90deg); opacity: .35; } }
.flow-language-options { display: grid; gap: 12px; margin: 35px 0 26px; }
.flow-language-options button { display: flex; align-items: center; gap: 15px; text-align: left; min-height: 84px; padding: 18px; background: var(--app-surface); color: var(--text); border: 1px solid #55717f; border-radius: 14px; }
.flow-language-options button > span:first-child { font-size: 17px; font-weight: 700; color: var(--gold); }
.flow-language-options button strong { font-size: 17px; display: block; margin-bottom: 4px; }
.flow-language-options button small { color: var(--muted); font-size: 12px; }
.flow-language-options button svg { margin-left: auto; color: var(--gold); }
.flow-language-options button:active { background: var(--app-surface-hover); }

/* The guide is an articulated approved asset, not a new photorealistic portrait. */
.flow-intro .flow-scroll { padding-bottom: 0; display: flex; flex-direction: column; }
.flow-greeting { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 420px; flex: 1; }
.flow-greeting > .flow-kicker { text-align: center; font-size: 10px; letter-spacing: .15em; }
.flow-speech { position: relative; background: #f2eee2; color: #263b46; border-radius: 18px; padding: 20px; z-index: 1; margin-bottom: 8px; }
.flow-speech::after { content: ""; position: absolute; bottom: -11px; left: 44%; width: 24px; height: 24px; border-radius: 3px; background: #f2eee2; transform: rotate(45deg); }
.flow-speech h1 { font-size: 23px; line-height: 1.25; margin-bottom: 9px; }
.flow-speech p { font-size: 13px; line-height: 1.65; color: #425762; margin: 0; }
.flow-character { position: relative; width: 162px; height: 243px; margin: 28px auto 0; z-index: 1; flex-shrink: 0; filter: brightness(var(--art-brightness, 1)); }
.flow-character > img, .flow-character > canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.flow-character[data-rig="articulated"] > img { visibility: hidden; }
.flow-character-ground { width: 140px; height: 13px; border-radius: 50%; background: #0c192266; filter: blur(5px); position: relative; margin: -5px auto 9px; }
.flow-intro .flow-actions { border-top: 0; }
.flow-welcome-mark, .flow-completion-mark, .flow-map-emblem { width: 65px; height: 65px; display: grid; place-items: center; background: var(--app-surface); border-radius: 19px; color: var(--gold); margin: 3px 0 24px; }
.flow-welcome-mark svg, .flow-completion-mark svg, .flow-map-emblem svg { width: 30px; height: 30px; }
.flow-map-emblem, .flow-next-icon { background: var(--map-face, var(--app-surface)); color: var(--map-ink, var(--gold)); }
.flow-completion-mark { color: var(--success); background: #224638; }
.flow-overview { margin: 30px 0; }
.flow-overview p { display: flex; align-items: center; gap: 14px; font-size: 14px; padding: 10px 0; color: var(--text); }
.flow-overview svg { color: var(--gold); width: 22px; height: 22px; }

.flow-access-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: #10212b; border-radius: 13px; margin-bottom: 28px; }
.flow-access-tabs button { color: var(--muted); background: transparent; border: 0; border-radius: 9px; padding: 11px; font-size: 13px; }
.flow-access-tabs button[aria-pressed="true"] { background: var(--app-surface-hover); color: var(--text); font-weight: 650; }
.flow-google-button { width:100%;min-height:48px;display:flex;align-items:center;justify-content:center;gap:12px;background:#fff;color:#1f1f1f;border:1px solid #dadce0;font-size:14px;font-weight:600; }
.flow-google-button svg { width:20px;height:20px;flex:none;stroke:none; }
.flow-google-note { color:var(--muted);font-size:11px;line-height:1.5;text-align:center;margin:8px 0 0; }
.flow-access-divider { display:flex;align-items:center;gap:12px;color:var(--muted);font-size:12px;margin:18px 0; }
.flow-access-divider::before,.flow-access-divider::after { content:"";height:1px;background:var(--app-line);flex:1; }
.flow-field { display: flex; flex-direction: column; gap: 9px; font-size: 13px; color: var(--muted); margin: 0 0 19px; }
.flow-field input:not([type="range"]), .flow-field select, .flow-field textarea { font: inherit; font-size: 16px; color: var(--text); background: #10212b; border: 1px solid #688492; border-radius: 12px; padding: 14px; width: 100%; min-width: 0; -webkit-appearance:none; appearance:none; box-shadow:none; background-clip:padding-box; }
.flow-field input[readonly] { color: var(--muted); }
.flow-field textarea { line-height: 1.6; resize: vertical; min-height: 150px; max-height: 260px; }
.flow-field textarea:focus-visible, .flow-field select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.flow-field input[type="range"] { accent-color: var(--gold); width: 100%; }
.flow-consent-list { margin: 24px 0; }
.flow-consent-list p { display: flex; gap: 13px; padding: 10px 0; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.flow-consent-list svg { color: #8de4d8; width: 21px; height: 21px; margin-top: 2px; }
.flow-consent { display: flex; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid #688394; border-radius: 12px; font-size: 14px; line-height: 1.5; margin: 26px 0 8px; }
.flow-consent input { accent-color: var(--gold); width: 20px; height: 20px; flex-shrink: 0; margin: 1px 0; }

.flow-stages { display: flex; align-items: center; padding: 14px 23px; gap: 22px; margin: 0; list-style: none; border-bottom: 1px solid var(--app-line); flex: none; }
.flow-stages li { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.flow-stages i { display: grid; place-items: center; width: 12px; height: 12px; border: 1px solid var(--app-line); border-radius: 50%; }
.flow-stages svg { width: 11px; height: 11px; color: var(--success); }
.flow-stages [aria-current="step"] { color: var(--gold); font-weight: 650; }
.flow-stages [aria-current="step"] i { background: var(--gold); border-color: var(--gold); }
.flow-question-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 7px 23px 2px; flex: none; gap: 8px; }
.flow-question-toolbar > span { font-size: 11px; color: #8de4d8; font-weight: 600; }
.flow-question-toolbar button { color: var(--muted); font-size: 11px; min-width: 48px; }
.flow-question-body { padding: 12px 23px 22px; min-height: 0; flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--app-line) transparent; }
.flow-question-body h1 { font-size: 23px; line-height: 1.3; margin-bottom: 12px; }
.flow-question-hint { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 0 0 18px; }
.flow-answer-hint { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--gold); margin: 0 0 12px; }
.flow-answer-hint svg { width: 14px; height: 14px; }
.flow-choices { display: grid; grid-template-columns: 1fr; gap: 10px; }
.flow-choices.tiles { grid-template-columns: 1fr 1fr; }
.flow-choice { position: relative; min-height: 54px; padding: 14px 42px 14px 14px; background: var(--app-surface); color: var(--text); border: 1px solid #688492; border-radius: 12px; text-align: left; font-size: 14px; line-height: 1.45; box-shadow:none; -webkit-appearance:none; appearance:none; transition: background-color 150ms ease, border-color 150ms ease; }
.flow-choices.tiles .flow-choice { min-height: 103px; padding: 33px 13px 14px; }
.flow-choice-check { position: absolute; top: 13px; right: 12px; width: 18px; height: 18px; border: 1px solid #7e9aa8; border-radius: 50%; display: grid; place-items: center; }
.flow-choice-check svg { width: 13px; height: 13px; stroke-width: 2.5; }
.flow-choice.is-selected { background: #234f53; border-color: #61cec0; color: #f3fffc; box-shadow:inset 0 0 0 1px #61cec0; }
.flow-choice.is-selected .flow-choice-check { background: #8de4d8; border-color: #8de4d8; color: #16483f; }
.flow-choice.compact { min-height: 56px; padding-top: 12px; padding-bottom: 12px; background: #14232c; }
.flow-choice.compact.is-selected { background: #234f53; }
.flow-more { margin: 10px 0 20px; }
.flow-more summary { font-size: 12px; font-weight: 600; color: var(--gold); cursor: pointer; padding: 10px 0; display: flex; justify-content: space-between; min-height: 42px; align-items: center; }
.flow-more[open] summary { margin-bottom: 4px; }
.flow-protected { border-top: 1px solid var(--app-line); padding-top: 13px; margin-top: 20px; }
.flow-protected > p { color: var(--muted); font-size: 11px; margin: 0 0 10px; }
.flow-save-state { color: var(--muted); font-size: 11px; line-height: 1.5; margin: 0 0 1px; }
.flow-source-link { color: var(--muted); border: 0; background: transparent; display: flex; align-items: center; gap: 8px; font-size: 11px; min-height: 44px; padding: 12px 0 0; margin-top: 8px; }
.flow-source-link svg { width: 14px; height: 14px; }
.flow-writing-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: -10px; }
.flow-writing-tools output { color: var(--muted); font-size: 11px; }
.flow-response { padding: 19px 0; border-bottom: 1px solid var(--app-line); }
.flow-response h2 { font-size: 14px; margin: 0 0 9px; }
.flow-response p { font-size: 13px; line-height: 1.65; color: var(--muted); margin: 0 0 5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.flow-response button { justify-content: flex-start; }
.flow-report-tabs { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 16px 0; border-bottom: 1px solid var(--app-line); }
.flow-report-tabs button { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: 13px 0; font-size: 11px; }
.flow-report-tabs button[aria-selected="true"] { color: var(--gold); border-bottom-color: var(--gold); font-weight: 650; }
.flow-version { border: 1px solid var(--app-line); border-radius: 12px; padding: 15px; font-size: 12px; margin-bottom: 16px; }
.flow-version summary { cursor: pointer; color: var(--gold); line-height: 1.8; }
.flow-version summary span { color: var(--muted); display: block; font-size: 11px; }
.flow-version h3 { font-size: 13px; margin: 15px 0 7px; }
.flow-version p { color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.flow-next-map { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 90px; padding: 15px 0; background: transparent; border: 0; border-bottom: 1px solid var(--app-line); color: var(--text); text-align: left; }
.flow-next-icon { width: 42px; height: 42px; flex: none; border-radius: 13px; display: grid; place-items: center; }
.flow-next-map strong { display: block; font-size: 14px; line-height: 1.5; }
.flow-next-map small { color: var(--muted); display: block; font-size: 11px; margin-top: 5px; }
.flow-next-map > svg { margin-left: auto; flex: none; width: 16px; height: 16px; }
.flow-processing { width: 75px; height: 75px; margin: 38px 0; color: var(--gold); }
.flow-processing svg { width: 100%; height: 100%; animation: flow-organize 4s var(--ease-out) both; }
@keyframes flow-organize { from { transform: rotate(-45deg); opacity: .3; } to { transform: rotate(45deg); opacity: 1; } }
.flow-settings { margin: 20px 0; padding-top: 12px; border-top: 1px solid var(--app-line); }
.flow-settings h3 { font-size: 14px; margin: 22px 0 16px; }
.flow-settings .flow-field output { float: right; color: var(--gold); }
.flow-settings > .flow-text-button { display: flex; }
.app-shell[data-large-text="true"] .flow-choice, .app-shell[data-large-text="true"] .flow-lead, .app-shell[data-large-text="true"] .flow-response p { font-size: 16px; }
.app-shell[data-large-text="true"] .flow-question-body h1 { font-size: 26px; }
.flow-tour { position: absolute; inset: 0; z-index: 30; overflow: hidden; }
.flow-tour-highlight { position: absolute; border: 2px solid var(--gold); border-radius: 14px; box-shadow: 0 0 0 1500px #050c13c7; pointer-events: none; }
.flow-tour-card { position: absolute; left: 16px; right: 16px; max-height: calc(100% - 24px); overflow: auto; background: var(--app-surface); color: var(--text); border: 1px solid #65808f; border-radius: 18px; padding: 23px 20px 18px; }
.flow-tour-card > .icon-button { position: absolute; right: 2px; top: 2px; }
.flow-tour-card h2 { font-size: 18px; line-height: 1.35; margin: 0 0 10px; }
.flow-tour-card > p:not(.flow-kicker) { font-size: 13px; line-height: 1.65; color: var(--muted); }
.flow-tour-card > div { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.flow-tour-card .primary-button { min-height: 42px; font-size: 12px; padding: 10px; }
body[data-page-hidden="true"] .flow-logo-orbit, body[data-page-hidden="true"] .flow-processing svg { animation-play-state: paused; }
body[data-flow="splash"] .home-area { display: none; }
body[data-flow="boot"] #appMain { visibility: hidden; }
@media (hover: hover) and (pointer: fine) {
  .flow-google-button:hover { background:#f2f4f7;color:#1f1f1f; }
  .flow-choice:hover { background: var(--app-surface-hover); }
  .flow-choice.is-selected:hover { background: #285a5c; }
  .flow-language-options button:hover { border-color: var(--gold); }
  .flow-next-map:hover { color: var(--gold); }
}
@media (max-width: 767px), (max-width: 1024px) and (max-height: 600px) and (pointer: coarse) {
  /* The OS owns the top status area. Reserve it once, then give the brand air. */
  .app-shell { padding-top: env(safe-area-inset-top, 0px); padding-bottom: 0; }
  .app-header { height: 66px; padding-top: 8px; padding-bottom: 4px; }
  .app-brand > span:last-child { font-size: 11px; font-weight: 650; }
  .app-brand b { color: #d6e2e7; font-weight: 450; }
  .brand-mark { width: 32px; height: 34px; }
  /* All bottom safety belongs to the bottommost visible region, never twice. */
  /* A compact dock: OS clearance sits outside the visible bar, once only. */
  .bottom-nav { height: 54px; min-height: 54px; grid-template-rows: 44px; padding: 4px 6px; margin: 0 12px max(8px, env(safe-area-inset-bottom, 0px)); align-items: stretch; border: 1px solid var(--app-line); border-radius: 18px; background: #20343f; }
  .bottom-nav button { min-height: 44px; gap: 2px; padding: 2px 0; border-radius: 12px; line-height: 14px; }
  .bottom-nav button > span:first-child { width: 28px; height: 24px; display: flex; align-items: center; justify-content: center; flex: none; }
  .bottom-nav button > span:last-child { font-size: 11px; line-height: 14px; }
  .flow-actions { padding-bottom: calc(13px + env(safe-area-inset-bottom, 0px)); }
  body[data-keyboard="true"] .flow-actions { padding-bottom: 10px; }
  body[data-keyboard="true"] .app-header { display: none; }
  body[data-keyboard="true"] .flow-question .flow-actions { padding: 8px 16px 6px; gap: 6px; }
  body[data-keyboard="true"] .flow-question .flow-save-state { display: none; }
  .flow-page:not(:has(.flow-actions)) > .flow-scroll { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  body[data-flow="splash"] .app-shell { padding-bottom: env(safe-area-inset-bottom, 0px); }
  body[data-flow="splash"] .flow-splash { padding-top: 0; }
  .flow-tour-card { max-height: calc(100% - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px); }
}
@media (max-height: 650px) and (max-width: 767px), (max-width: 1024px) and (max-height: 600px) and (pointer: coarse) {
  .flow-scroll { padding-top: 16px; }
  .flow-greeting { min-height: 350px; }
  .flow-character { width: 126px; height: 189px; }
  .flow-speech { padding: 16px; }
  .flow-speech h1 { font-size: 21px; }
  .flow-stages { padding-top: 8px; padding-bottom: 8px; }
  .flow-question-toolbar { padding-top: 1px; }
}
