/* Approved iPhone visual replacement. Chart dimensions and market/indicator colors
   deliberately inherit style.css; this layer owns the surrounding interface. */
/* WKWebView's system-family fallback can miss installed CJK/symbol fonts.
   Limit explicit local faces to those characters; Latin keeps its system face. */
@font-face { font-family: "Ludi CJK"; src: local("PingFangSC-Regular"); font-display: swap; unicode-range: U+2E80-9FFF, U+F900-FAFF, U+FF00-FFEF; }
@font-face { font-family: "Ludi Symbols"; src: local("AppleSymbols"); font-display: swap; unicode-range: U+2190-27FF; }
:root {
  color-scheme: dark;
  --ui-ground: #0b0b0d;
  --ui-surface: #19191d;
  --ui-raised: #242429;
  --ui-line: #34343b;
  --ui-control-line: #74747f;
  --ui-text: #f3f3f6;
  --ui-muted: #adaeb9;
  --ui-action: #8654d9;
  --ui-link: #c7a5fa;
  --ui-danger: #ff9c9c;
  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-3: 16px;
  --ui-space-4: 24px;
  --ui-space-5: 32px;
  --ui-radius: 24px;
  --nav-clearance: calc(100px + env(safe-area-inset-bottom, 0px));
  --header-clearance: calc(118px + env(safe-area-inset-top, 0px));
  --ui-press: 140ms;
}
/* A local reader preserves the account/pricing view underneath it. */
#privacy-dialog { width: min(720px, 100%); max-width: 100%; height: 100%; height: 100dvh; max-height: 100%; margin: auto; padding: calc(8px + env(safe-area-inset-top, 0px)) 8px calc(8px + env(safe-area-inset-bottom, 0px)); border: 1px solid var(--ui-line); background: var(--ui-ground); color: var(--ui-text); }
#privacy-dialog[open] { display: flex; flex-direction: column; gap: 8px; }
#privacy-dialog:not([open]) { display: none; }
#privacy-dialog[data-fallback] { position: fixed; inset: 0; z-index: 2000; box-shadow: 0 0 0 100vmax rgba(11, 11, 13, .85); }
[data-privacy-background] { pointer-events: none; }
#privacy-dialog::backdrop { background: var(--ui-ground); opacity: .85; }
#privacy-close { align-self: flex-end; flex-shrink: 0; }
#privacy-frame { width: 100%; min-height: 0; flex: 1; border: 0; background: var(--ui-ground); }
html { font-size: 16px; background: var(--ui-ground); }
body { height: 100vh; height: 100dvh; overflow: hidden; background: var(--ui-ground); color: var(--ui-text); font-family: "Ludi CJK", "Ludi Symbols", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 1rem; line-height: 1.5; -webkit-text-size-adjust: 100%; }
button, input { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, a, summary, input { transition: background-color var(--ui-press) ease-out, color var(--ui-press) ease-out; }
button:active, a:active, summary:active { opacity: .7; }
/* Pressing acknowledges the action without moving list/swipe geometry. */
:is(button:not(:disabled), #app-tabs a, summary):active { opacity: 1; background-color: color-mix(in srgb, var(--ui-raised) 80%, var(--ui-link)); }
#login-google:not(:disabled):active { background-color: var(--ui-text); }
:is(.btn, .back-btn, .p-mini-btn, .p-btn, .tf-tab, #app-tabs a) { transition: background-color var(--ui-press) ease-out, color var(--ui-press) ease-out, transform var(--ui-press) cubic-bezier(.16, 1, .3, 1); }
:is(.btn, .back-btn, .p-mini-btn, .p-btn, .tf-tab, #app-tabs a):not(:disabled):active { transform: scale(.97); }
button:disabled { opacity: .5; }
:focus-visible { outline: 2px solid var(--ui-link); outline-offset: 3px; }
:is(#top-search, #wl-search, #market-search, #earnings-search):focus-visible { outline: none; border-color: var(--ui-control-line); box-shadow: inset 0 -1px 0 var(--ui-muted); }
::selection { background: var(--ui-action); color: #fff; }
input { caret-color: var(--ui-link); }
input::placeholder { color: var(--ui-muted); opacity: 1; }
.view { scrollbar-color: var(--ui-line) transparent; scroll-padding-block: calc(var(--header-clearance) + 16px) var(--nav-clearance); padding-top: var(--header-clearance); padding-bottom: var(--nav-clearance); }
#views { min-width: 0; }
.view.active { overflow-x: hidden; }
[hidden] { display: none !important; }
.btn, .back-btn, .link-btn, .p-mini-btn, .p-btn { min-width: 44px; min-height: 44px; border-radius: var(--ui-radius); padding: 8px 12px; font-size: .9375rem; }
.btn, .back-btn { background: var(--ui-raised); border-color: var(--ui-control-line); color: var(--ui-text); }
.btn-primary, .p-btn { background: var(--ui-action); border-color: var(--ui-action); color: #fff; }
.btn:hover, .back-btn:hover { border-color: var(--ui-link); }
.link, .link-btn, .guide-data-source { color: var(--ui-link); font-size: .9375rem; }

/* Brand + compact actions above an independent, full-width search row. */
body > header { position: absolute; inset: 0 0 auto; z-index: 90; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: calc(8px + env(safe-area-inset-top, 0px)) 20px 6px; background: transparent; border: 0; pointer-events: none; }
body > header > * { pointer-events: auto; }
.logo { padding: 3px 8px; min-height: 44px; border: 1px solid transparent; border-radius: 28px; width: fit-content; max-width: 100%; }
.logo { min-width: 0; gap: 10px; color: var(--ui-text); font-size: 1.125rem; letter-spacing: -.02em; white-space: normal; }
.logo-img { width: 36px; height: 36px; flex-shrink: 0; border-radius: 12px; }
.logo > span { min-width: 0; overflow-wrap: anywhere; }
.logo small { display: none; }
.header-right { order: 1; gap: 8px; margin-left: 0; justify-self: end; }
#pay-btn { background: var(--ui-raised); color: var(--ui-link); border: 1px solid var(--ui-control-line); font-size: .8125rem; padding-inline: 12px; }
#trial-status { display: none; }
.search-box { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; grid-column: 1 / -1; order: 2; gap: 0 6px; max-width: none; min-width: 0; padding: 4px 4px 4px 14px; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: 28px; }
.search-icon { width: 20px; height: 20px; color: var(--ui-muted); }
.search-label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; color: var(--ui-muted); font-size: .8125rem; line-height: 1.5; }
.search-box input, .wl-search-row input, .market-edit-row input, :is(#earnings-search, .earnings-search-bar input) { width: 100%; min-width: 0; min-height: 48px; padding: 12px; border: 1px solid var(--ui-control-line); border-radius: var(--ui-radius); background: var(--ui-surface); color: var(--ui-text); font-size: 1rem; }
#top-search { min-height: 44px; padding: 8px 0; background: transparent; border: 0; border-radius: 0; }
#top-search-btn { min-height: 44px; color: var(--ui-link); background: var(--ui-raised); border: 0; padding-inline: 16px; }
.search-suggest { background: var(--ui-raised); border-color: var(--ui-control-line); }
.sug-item { min-height: 48px; color: var(--ui-text); padding: 12px; }
.sug-item:hover, .sug-item:focus { background: var(--ui-surface); }
.sug-name { color: var(--ui-muted); font-size: .8125rem; }

/* Market context leads; saved identities retain their full-width band below. */
.home-inner { max-width: 760px; padding: 8px 0 24px; }
.home-band { padding-inline: 20px; }
.home-band + .home-band { margin-top: 48px; }
.home-market, .home-reference { padding-block: 16px; background: var(--ui-surface); }
.home-band.home-reference { margin-top: 24px; background: var(--ui-ground); border-block: 1px solid var(--ui-line); }
.home-reference > .band-title { margin-bottom: 12px; }
.band-title { font-size: 1.5rem; line-height: 1.25; font-weight: 650; letter-spacing: -.025em; margin: 0 0 20px; }
.home-market > .home-disclosure > summary { font-size: 1.5rem; padding: 0 0 12px; }
.home-inner > .logo-credit { margin: 24px 20px 0; }
.home-disclosure { border-color: var(--ui-line); }
.home-disclosure > summary { min-height: 48px; padding: 12px 0; color: var(--ui-text); font-size: .9375rem; font-weight: 600; }
.home-disclosure > summary:hover { color: var(--ui-link); }
.home-disclosure > summary svg { color: var(--ui-muted); transition: transform 200ms cubic-bezier(.16, 1, .3, 1); }
#treasury-strip, #bitcoin-strip { padding: 0 0 16px; }
.treasury-groups { gap: 16px; margin: 4px 0 8px; }
.treasury-group h3, .treasury-group dt, .treasury-group .treasury-move, .treasury-status, .treasury-change-note { color: var(--ui-muted); font-size: .8125rem; }
.treasury-group dl { grid-template-columns: repeat(auto-fit, minmax(min(100%, 4.25rem), 1fr)); gap: 8px; }
.treasury-group dd { font-size: 1.375rem; letter-spacing: -.02em; font-weight: 600; }
.treasury-group .treasury-move { font-weight: 400; letter-spacing: 0; }
.bitcoin-head { gap: 4px 12px; }
.bitcoin-price { font-size: 1.5rem; letter-spacing: -.02em; }
.bitcoin-price small, .bitcoin-change, .bitcoin-status { font-size: .8125rem; }
.bitcoin-price small, .bitcoin-status, .bitcoin-change.flat { color: var(--ui-muted); }
.market-tools { right: 24px; }
.market-tools .market-manage { min-width: 44px; min-height: 48px; }
#market-strip { grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.25rem), 1fr)); gap: 0 12px; }
.mkt-card { border: 0; border-bottom: 1px solid var(--ui-line); background: transparent; border-radius: 0; }
.mkt-main { min-height: 96px; padding: 10px 0; gap: 2px; }
.mkt-card .sym { font-size: .9375rem; font-weight: 600; }
.mkt-card .mkt-name { font-size: .8125rem; color: var(--ui-muted); white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.mkt-card .px { font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.mkt-card .chg { font-size: .8125rem; }
.mkt-card.empty { border: 1px dashed var(--ui-control-line); }
.mkt-remove { min-width: 44px; min-height: 44px; top: 4px; right: 4px; background: var(--ui-raised); color: var(--ui-text); }
#market-edit-label, #market-message { font-size: .8125rem; color: var(--ui-muted); }
.market-result { min-height: 48px; background: var(--ui-surface); border-color: var(--ui-line); }
.market-result span { color: var(--ui-muted); }
.section-head { margin: 0 0 24px; font-size: 2.125rem; font-weight: 700; display: block; }
.section-head h1 { font: inherit; letter-spacing: -.035em; line-height: 1.2; margin: 0 0 12px; }
.section-actions { display: flex; align-items: center; gap: 8px; }
.section-actions .link, #watchlist-new-group { background: var(--ui-raised); border-radius: 24px; padding: 10px 16px; font-size: .875rem; }
.section-head .link { display: inline-flex; align-items: center; justify-content: flex-end; min-width: 44px; min-height: 44px; }
#view-home #watchlist-rows { gap: 0; overflow: visible; }
.section-head > span { margin-right: auto; }
#view-home .section-head { display: block; }
#watchlist-new-group { width: auto; flex-shrink: 0; border: 0; margin: 0; }
.wl-group { position: relative; margin-block: 24px; padding-inline: 0; background: transparent; border-radius: 0; }
.wl-group .home-disclosure { border: 0; }
.wl-group .home-disclosure > summary { gap: 12px; padding: 8px 48px 8px 0; min-height: 56px; font-size: 1.125rem; border-bottom: 1px solid var(--ui-line); }
.wl-group-title { display: flex; flex: 1; align-items: baseline; gap: 12px; min-width: 0; overflow-wrap: anywhere; }
.wl-group-count { color: var(--ui-muted); font-size: .8125rem; font-weight: 400; font-variant-numeric: tabular-nums; }
.wl-group-edit { position: absolute; right: 8px; top: 6px; display: grid; place-items: center; width: 44px; height: 44px; color: var(--ui-muted); background: transparent; border: 0; border-radius: 8px; }
.wl-group-edit svg { width: 20px; height: 20px; }
#view-home .wl-group .wl-row { background: transparent; }
.wl-group-empty { padding: 8px 0 16px; font-size: .9375rem; color: var(--ui-muted); }
#watchlist-sheet { box-sizing: border-box; width: min(520px, calc(100% - 24px)); max-width: none; max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px)); margin: auto auto max(12px, env(safe-area-inset-bottom, 0px)); padding: 12px 20px 24px; border: 1px solid var(--ui-control-line); border-radius: 24px; background: var(--ui-surface); color: var(--ui-text); overflow-y: auto; overscroll-behavior: contain; }
@supports (backdrop-filter: blur(20px)) {
  #watchlist-sheet { background: color-mix(in srgb, var(--ui-surface) 97%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
}
#watchlist-sheet::backdrop { background: rgba(0, 0, 0, .65); }
#watchlist-sheet[open] { animation: wl-sheet-enter 220ms cubic-bezier(.16, 1, .3, 1); }
.wl-sheet-grip { width: 36px; height: 4px; margin: 0 auto 12px; background: var(--ui-control-line); border-radius: 4px; }
.wl-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wl-sheet-head h2 { margin: 0; font-size: 1.25rem; line-height: 1.5; overflow-wrap: anywhere; }
#watchlist-sheet button { min-width: 44px; min-height: 44px; font: inherit; cursor: pointer; }
.wl-sheet-head button { padding: 8px; background: transparent; border: 0; color: var(--ui-link); border-radius: 8px; flex-shrink: 0; }
.wl-sheet-note { color: var(--ui-muted); font-size: .9375rem; line-height: 1.5; margin: 8px 0 20px; }
.wl-sheet-choices { display: grid; gap: 0; }
.wl-sheet-choices button { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px; background: transparent; color: var(--ui-text); border: 0; border-bottom: 1px solid var(--ui-line); text-align: left; overflow-wrap: anywhere; }
.wl-sheet-choices button[aria-pressed="true"] { color: var(--ui-link); }
.wl-sheet-choices svg { width: 24px; height: 24px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; }
.wl-sheet-form { margin-top: 24px; }
.wl-sheet-form label { display: block; margin-bottom: 8px; font-size: .9375rem; }
.wl-sheet-form > div { display: flex; gap: 8px; }
.wl-sheet-form input { min-width: 0; flex: 1; min-height: 48px; padding: 8px 12px; border: 1px solid var(--ui-control-line); background: var(--ui-raised); color: var(--ui-text); border-radius: var(--ui-radius); }
.wl-sheet-form .btn { flex-shrink: 0; }
.wl-sheet-error { margin: 8px 0 0; color: var(--ui-danger); font-size: .9375rem; }
@keyframes wl-sheet-enter { from { opacity: .6; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { #watchlist-sheet[open] { animation: none; } }
.wl-swipe { border-radius: 0; }
.wl-group .wl-swipe-actions { width: 210px; }
.wl-group .wl-swipe.open .wl-row { transform: translateX(-210px); }
.wl-group .wl-swipe-actions button { min-width: 64px; min-height: 44px; background: var(--ui-raised); }
.wl-group .wl-swipe-actions [data-remove] { background: #873e46; }
#view-home .wl-row { min-height: 92px; padding: 16px 0; border: 0; border-bottom: 1px solid var(--ui-line); border-radius: 0; background: var(--ui-ground); gap: 12px; }
#view-home .wl-row:hover { background: var(--ui-surface); }
#view-home .wl-row:active { background: color-mix(in srgb, var(--ui-raised) 80%, var(--ui-link)); }
.wl-avatar { width: 44px; height: 44px; font-size: 1rem; }
.logo-credit { margin: 12px 0; font-size: .8125rem; color: var(--ui-muted); }
.logo-credit a { color: inherit; }
.wl-sym { font-size: 1.125rem; font-weight: 650; }
#view-home .wl-coname { max-width: none; font-size: .8125rem; color: var(--ui-muted); }
.wl-right { max-width: 48%; }
.wl-price { font-size: 1.25rem; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.wl-chg { font-size: .8125rem; font-variant-numeric: tabular-nums; }
.wl-badge { font-size: .8125rem; }

/* Detail controls inherit the same shell; no chart or series rules are changed. */
.detail-topbar { padding: 12px 20px; background: var(--ui-ground); border-color: var(--ui-line); gap: 12px; flex-wrap: wrap; }
#detail-back { min-width: 44px; min-height: 44px; font-size: 1.5rem; }
.detail-title { flex: 1; align-items: flex-start; flex-direction: column; gap: 0; }
#detail-symbol { font-size: 1.75rem; font-weight: 700; letter-spacing: -.025em; }
#detail-name { font-size: .8125rem; color: var(--ui-muted); max-width: 100%; }
#detail-save { border-color: var(--ui-control-line); background: var(--ui-surface); color: var(--ui-link); }
.fresh { font-size: .8125rem; margin-left: 0; }
.detail-hero { padding: 0 20px 24px; gap: 20px; flex-wrap: wrap; }
#detail-price { font-size: 3.25rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.04em; line-height: 1.1; overflow-wrap: anywhere; }
#detail-change { font-size: .9375rem; font-variant-numeric: tabular-nums; }
.hero-meta { font-size: .8125rem; color: var(--ui-muted); }
.tf-tabs { padding: 8px 16px 12px; gap: 4px; }
.tf-tab { min-width: 44px; min-height: 44px; padding: 8px 16px; border: 0; border-radius: 24px; background: var(--ui-surface); color: var(--ui-muted); font-size: .8125rem; }
.tf-tab.active { background: var(--ui-raised); color: var(--ui-link); box-shadow: inset 0 0 0 1px var(--ui-control-line); }
.exp-toggle { min-height: 44px; padding: 8px; font-size: .8125rem; color: var(--ui-muted); }
.exp-toggle input { accent-color: var(--ui-action); }
.chart-lock-content .btn-primary { background: var(--ui-action); border-color: var(--ui-action); }
.chart-lock-content h2 { font-size: 1.375rem; }
.chart-lock-content p { color: var(--ui-muted); font-size: 1rem; }
.chart-lock-content small { color: var(--ui-muted); font-size: .875rem; }
.chart-lock-content .btn { font-size: 1rem; }
.news-item-title { font-size: .9375rem; }
.news-item-meta { font-size: .8125rem; }

/* Reports are reading surfaces, with date separate from the company identity. */
.earnings-wrap { padding: 28px 20px 32px; }
.earnings-wrap h1, .manage-head h2, .account-page-heading, #view-options h1 { font-size: 2.125rem; font-weight: 700; line-height: 1.2; letter-spacing: -.035em; }
#view-options .options-wrap { padding: 28px 20px 32px; }
#view-options .options-coverage { padding: 24px 0; border-block: 1px solid var(--ui-line); margin-block: 24px; }
#view-options .options-result { padding-block: 28px; }
#view-options .options-actions a, #view-options button { border-radius: 24px; }
.earnings-intro { color: var(--ui-muted); font-size: 1rem; line-height: 1.5; margin-top: 8px; }
.earnings-edition { margin-top: 16px; font-size: .8125rem; color: var(--ui-muted); }
.earnings-coverage, .earnings-search-label, .earnings-period, .earnings-evidence, .earnings-reading .earnings-evidence, .earnings-method { font-size: .8125rem; color: var(--ui-muted); }
.earnings-search-label { margin-top: 24px; }
.earnings-item { padding: 28px 0; border-color: var(--ui-line); }
.earnings-item summary { min-height: 44px; }
.earnings-company { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 8px; align-items: baseline; font-size: .9375rem; }
.earnings-company b { font-size: 1rem; }
.earnings-company span { font-size: .9375rem; color: var(--ui-muted); overflow-wrap: anywhere; }
.earnings-company time { margin: 0; grid-column: 1 / -1; font-size: .8125rem; }
.earnings-item h2 { font-size: 1.25rem; font-weight: 600; line-height: 1.5; margin-top: 12px; text-wrap: balance; }
.earnings-reading { margin-top: 24px; }
.earnings-metrics dt, .earnings-reading h3 { font-size: .875rem; }
.earnings-metrics dd { font-size: 1.125rem; }
.earnings-reading p { color: var(--ui-text); font-size: 1rem; line-height: 1.75; }
.earnings-links a, .earnings-links button { min-height: 44px; color: var(--ui-link); font-size: .9375rem; }
.earnings-links a { display: inline-flex; align-items: center; }
.earnings-empty { color: var(--ui-muted); font-size: 1rem; }

/* Account identity and actions use the same grouped system, including sign-in. */
#view-login { min-height: 0; background: var(--ui-ground); }
.login-wrap { padding: 32px 16px; }
.login-logo { width: 72px; height: 72px; border-radius: 16px; box-shadow: none; }
.login-title { color: var(--ui-text); font-size: 1.75rem; letter-spacing: -.02em; }
.login-sub { color: var(--ui-muted); font-size: .9375rem; margin-bottom: 24px; }
body.on-account .login-wrap { padding: 28px 20px 32px; max-width: 760px; }
.account-page-heading { margin-bottom: 28px; }
.account-identity { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; text-align: left; }
.account-identity > div { min-width: 0; }
body.on-account .account-identity .login-logo { display: block; width: 64px; height: 64px; flex-shrink: 0; margin: 0; border-radius: 20px; }
body.on-account .account-identity .login-title { display: block; font-size: 1.375rem; margin: 0 0 4px; overflow-wrap: anywhere; }
body.on-account .account-identity .login-sub { display: block; margin: 0; font-size: .8125rem; }
.login-card, body.on-account .login-card { padding: 24px 0; border-block: 1px solid var(--ui-line); border-inline: 0; border-radius: 0; background: transparent; }
.login-card { display: flex; flex-direction: column; }
.account-language { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 0 0 20px; margin-bottom: 20px; border-bottom: 1px solid var(--ui-line); }
.account-language > span { color: var(--ui-muted); font-size: .9375rem; }
#login-account:not([hidden]) { display: contents; }
#login-message, #login-retry { order: 1; }
#login-buy, .login-card > .account-subscriptions { order: 2; }
.account-actions { order: 3; margin-top: 24px; }
.account-name { color: var(--ui-text); font-size: 1.125rem; font-weight: 600; margin-bottom: 4px; }
.auth-hint, .login-msg { font-size: .9375rem; line-height: 1.6; color: var(--ui-muted); }
.login-msg:empty { min-height: 0; margin: 0; }
.login-msg:not(:empty) { color: var(--ui-danger); }
.login-card .btn-block { min-height: 48px; padding: 12px; font-size: 1rem; }
.link-btn { display: block; margin: 0; text-align: left; width: 100%; border-top: 1px solid var(--ui-line); border-radius: 0; padding: 12px 0; line-height: 1.5; }
.account-delete-link { color: var(--ui-danger); }
#login-buy { color: var(--ui-link); }
.account-subscriptions { color: var(--ui-link); font-size: .9375rem; }
.oauth-btn { border-radius: var(--ui-radius); min-height: 48px; font-size: 1rem; }
#chart-guide, body.on-account #chart-guide { margin-top: 48px; }
#chart-guide h2 { font-size: 1.375rem; }
.guide-intro, .guide-disclaimer { color: var(--ui-muted); font-size: .9375rem; }
#chart-guide summary { min-height: 48px; padding: 16px 0; font-size: 1rem; }
.guide-content, .guide-content h3 { font-size: .9375rem; }
.guide-content p { color: var(--ui-text); }
#account-delete-dialog { background: var(--ui-surface); border-color: var(--ui-line); color: var(--ui-text); }
#account-delete-dialog .account-subscriptions { display: flex; align-items: center; min-height: 44px; padding-block: 12px; }

/* Management keeps reorder/delete targets together on their own generous row. */
.manage-wrap { padding: 24px 16px 32px; }
.manage-head { gap: 12px; margin-bottom: 24px; }
.back-btn { width: 44px; height: 44px; padding: 8px; flex-shrink: 0; }
.back-btn svg { width: 24px; height: 24px; display: block; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.wl-search-row .search-label { margin-bottom: 4px; }
.wl-sec-title { margin: 24px 0 8px; color: var(--ui-muted); font-size: .9375rem; }
.wl-manage-list, .wl-results { gap: 0; }
.wl-mrow { flex-wrap: wrap; padding: 12px 0; gap: 8px; background: transparent; border: 0; border-bottom: 1px solid var(--ui-line); border-radius: 0; }
.wl-goto { display: grid; grid-template-columns: 36px auto minmax(0, 1fr); min-width: 0; min-height: 44px; flex: 1 1 100%; gap: 12px; color: var(--ui-text); }
.wl-msym { min-width: 0; font-size: 1rem; }
.wl-mname { min-width: 0; color: var(--ui-muted); font-size: .8125rem; }
.wl-mops { display: flex; gap: 8px; margin-left: auto; }
.wl-mops button { min-width: 44px; min-height: 44px; height: auto; border-color: var(--ui-control-line); background: var(--ui-surface); color: var(--ui-text); font-size: .9375rem; }
.wl-mops button.danger { color: var(--ui-danger); }
.wl-empty { color: var(--ui-muted); font-size: 1rem; }

/* Content passes behind the floating bar; its measured height reserves the end. */
#app-tabs { position: fixed; z-index: 90; inset-inline: max(16px, calc((100vw - 728px) / 2)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); border: 1px solid var(--ui-line); border-radius: 28px; padding: 8px; gap: 4px; flex-wrap: wrap; }
#app-tabs a { min-width: 44px; min-height: 52px; padding: 6px 2px; border-radius: 22px; gap: 4px; font-size: .8125rem; line-height: 1.25; color: var(--ui-muted); }
#app-tabs a[aria-current="page"] { color: var(--ui-link); background: color-mix(in srgb, var(--ui-link) 12%, transparent); }
#app-tabs a:focus-visible { outline-color: var(--ui-link); }
.pay-card { background: var(--ui-surface); border-color: var(--ui-line); border-radius: 20px; padding: 24px; }
#pay-close { min-width: 44px; min-height: 44px; color: var(--ui-text); font-size: 1.5rem; }
.pay-title { font-size: 1.25rem; }
#pay-benefits { margin-bottom: 20px; font-size: .9375rem; line-height: 1.55; color: var(--ui-text); }
#pay-benefits h2 { margin: 0 0 8px; font-size: 1rem; font-weight: 650; }
#pay-benefits ul { padding-inline-start: 20px; }
#pay-benefits li + li { margin-top: 8px; }
#pay-benefits p { margin-top: 12px; color: var(--ui-muted); }
.vip-plan { min-height: 64px; flex-wrap: wrap; background: var(--ui-raised); border-color: var(--ui-control-line); }
.vip-plan > span:first-child { flex: 1 1 8rem; min-width: 0; }
.vip-plan b, .vip-plan small { font-size: .9375rem; }
#pay-restore { width: auto; min-width: 44px; color: var(--ui-link); }

/* Native text enlargement reflows identity/control groups instead of shrinking. */
@media (min-width: 641px) {
  body > header { padding-inline: max(24px, calc((100vw - 720px) / 2)); }
}
@media (max-width: 440px) {
  .wl-symline { flex-wrap: wrap; }
  #view-home .wl-coname, .wl-mname { white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
  #view-home .wl-id { min-width: 0; }
}
/* Short viewports scroll the chrome away; every control remains in document flow. */
@media (max-height: 500px) and (orientation: landscape) {
  html { scroll-padding-block: 16px var(--nav-clearance); }
  body { height: auto; min-height: 100dvh; overflow: visible; }
  body > header { position: relative; }
  #views { flex: none; overflow: visible; }
  .view.active { overflow: visible; padding-top: 0; }
  .detail-topbar { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  :is(.btn, .back-btn, .p-mini-btn, .p-btn, .tf-tab, #app-tabs a):not(:disabled):active { transform: none; }
}
