:root {
  --ink: #1f2329;
  --secondary-text: #6b7280;
  --muted: #9099a5;
  --green: #e93030;
  --primary-pressed: #cf2626;
  --soft: #fff0f0;
  --background: #f6f7f8;
  --surface: #ffffff;
  --line: #eaecf0;
  --red: #d35852;
  --up: #ff381a;
  --down: #009b67;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --font-tab: 11px;
  --font-caption: 12px;
  --font-body: 14px;
  --font-button: 15px;
  --font-name: 16px;
  --font-nav: 17px;
  --font-title: 18px;
  --font-number: 22px;
  --font-price: 24px;
  --font-total: 28px;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; background: #e9ecef; color: var(--ink); font: var(--font-body)/1.5 -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { cursor: pointer; color: inherit; border: 0; background: none; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
.phone { width: 430px; height: min(932px, calc(100dvh - 40px)); min-height: 600px; margin: 20px auto; background: var(--background); position: relative; display: flex; flex-direction: column; border-radius: 36px; overflow: hidden; box-shadow: 0 16px 48px #1f232910; }
.statusbar { height: 47px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: var(--space-1) 28px 0; background: var(--surface); font-weight: 600; font-size: var(--font-body); }
.status-icons { font-size: var(--font-caption); letter-spacing: 2px; }
.app-header { height: 52px; display: flex; align-items: center; justify-content: space-between; background: var(--surface); padding: 0 var(--space-4) var(--space-2); flex-shrink: 0; }
#nav-title { font-size: var(--font-nav); font-weight: 600; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: var(--space-3); }
#header-search { padding: var(--space-1); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
#header-search .icon { width: 20px; height: 20px; }
#header-search[aria-label="分享"] { width: 40px; height: 30px; border: 1px solid var(--line); border-radius: 16px; }
.capsule { display: flex; align-items: center; height: 30px; border: 1px solid var(--line); border-radius: 16px; }
.capsule button { width: 36px; font-size: var(--font-title); line-height: 24px; font-weight: 600; padding: 0; }
.capsule > span { height: 16px; border-left: 1px solid var(--line); }
.capsule button:last-child { width: 32px; font-size: 20px; }
.icon { width: 20px; height: 20px; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
main { flex: 1; overflow: auto; scrollbar-width: none; padding: var(--space-4) var(--space-4) var(--space-6); }
main::-webkit-scrollbar { display: none; }
.stock-stack { display: grid; gap: var(--space-3); }
.stock-card { padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stock-card.is-ready { border-color: #f4c4c4; }
.stock-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.stock-card-title { display: flex; align-items: center; gap: var(--space-2); padding: 0; text-align: left; }
.stock-avatar { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; color: var(--green); background: var(--soft); font-size: var(--font-title); font-weight: 600; flex-shrink: 0; }
.stock-card-title strong { display: block; font-size: var(--font-name); font-weight: 600; white-space: nowrap; }
.stock-card-title small { display: block; color: var(--muted); font-size: var(--font-caption); margin-top: var(--space-1); }
.add-watch { display: flex; align-items: center; gap: var(--space-1); min-height: 32px; padding: var(--space-1) 0 var(--space-1) var(--space-1); color: var(--green); font-size: var(--font-caption); font-weight: 500; white-space: nowrap; }
.add-watch .icon { height: 12px; width: 12px; }
.condition-badge { display: flex; align-items: center; gap: var(--space-1); font-size: var(--font-caption); color: var(--secondary-text); background: var(--background); padding: var(--space-1) var(--space-2); border-radius: 6px; white-space: nowrap; }
.condition-badge i { width: 4px; height: 4px; background: currentColor; border-radius: 50%; }
.condition-badge.ready { background: var(--soft); color: var(--green); }
.stock-values { display: grid; grid-template-columns: 1.1fr 1fr; width: 100%; padding: 0; text-align: left; margin: var(--space-6) 0 var(--space-4); gap: var(--space-3); }
.stock-values > span:last-child { text-align: right; }
.metric-label { display: block; color: var(--secondary-text); font-size: var(--font-caption); font-weight: 400; margin-bottom: var(--space-2); }
.stock-values strong { display: block; font-size: var(--font-price); line-height: 1.25; font-weight: 500; font-variant-numeric: tabular-nums; }
.stock-values strong small { font-size: var(--font-body); margin-left: 2px; }
.yield { color: var(--up); }
.dividend-caption { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); border-top: 1px solid var(--line); padding-top: var(--space-3); font-size: var(--font-caption); color: var(--secondary-text); }
.dividend-caption b { color: var(--secondary-text); font-weight: 400; white-space: nowrap; }
.watch-target { display: flex; align-items: center; justify-content: space-between; border-radius: 8px; background: var(--soft); padding: var(--space-3); font-size: var(--font-caption); color: var(--secondary-text); }
.watch-target b { font-size: var(--font-body); font-weight: 500; color: var(--ink); margin-left: var(--space-2); }
.watch-target button { display: flex; align-items: center; gap: var(--space-1); font-size: var(--font-caption); padding: 0; color: var(--green); }
.watch-target .icon { width: 12px; height: 12px; }
.home-tabs { display: flex; align-items: center; gap: var(--space-6); height: 44px; margin-right: auto; }
.home-tabs[hidden] { display: none; }
.home-tabs button { position: relative; height: 44px; padding: 0; color: var(--secondary-text); font-size: var(--font-nav); font-weight: 400; }
.home-tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.home-tabs button[aria-selected="true"]:after { content: ''; position: absolute; width: 16px; height: 3px; left: 50%; bottom: 0; transform: translateX(-50%); background: var(--green); border-radius: 2px; }
.unread-dot { position: absolute; top: 7px; right: -7px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.unread-dot[hidden] { display: none; }
.tabbar { display: grid; grid-template-columns: repeat(4, 1fr); padding: var(--space-2) var(--space-4) var(--space-1); background: var(--surface); border-top: 1px solid var(--line); flex-shrink: 0; }
.tabbar button { min-height: 48px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: var(--space-1); color: var(--muted); font-size: var(--font-tab); }
.tabbar button > span:last-child { position: relative; }
.tab-icon { display: flex; align-items: center; justify-content: center; }
.tabbar .icon { height: 22px; width: 22px; stroke-width: 1.65; }
.tabbar button.active { color: var(--green); font-weight: 600; }
.tabbar button.active .icon { stroke-width: 2.1; }
.home-indicator { height: 26px; background: var(--surface); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.home-indicator:after { content: ''; height: 4px; width: 126px; background: var(--ink); border-radius: 8px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: var(--space-3); padding: var(--space-4); }
.section-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-4) 0; gap: var(--space-2); }
.section-head h2 { font-size: var(--font-title); font-weight: 600; }
.section-count { font-size: var(--font-caption); color: var(--muted); }
.metric-number { font-size: var(--font-number); font-weight: 500; font-variant-numeric: tabular-nums; }
.metric-number small { font-size: var(--font-caption); }
.subtle { font-size: var(--font-caption); color: var(--muted); }
.ledger-summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.summary-number { font-size: var(--font-price); font-weight: 500; margin-bottom: var(--space-2); font-variant-numeric: tabular-nums; }
.compact-primary { line-height: 20px; background: var(--green); color: var(--surface); padding: var(--space-3); min-height: 44px; border-radius: 8px; font-size: var(--font-button); font-weight: 500; display: flex; align-items: center; justify-content: center; gap: var(--space-1); white-space: nowrap; }
.compact-primary .icon { width: 16px; height: 16px; }
.filters { display: flex; gap: var(--space-2); margin: var(--space-4) 0; flex-wrap: wrap; }
.chip { font-size: var(--font-caption); padding: var(--space-2) var(--space-3); color: var(--secondary-text); }
.chip.active { background: var(--soft); color: var(--green); font-weight: 500; border-radius: 6px; }
.record-line { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.record-line strong { font-size: var(--font-name); font-weight: 600; }
.record-line small { font-size: var(--font-caption); color: var(--muted); }
.record-grid { display: grid; grid-template-columns: 1fr 1fr 1.1fr; gap: var(--space-2); margin: var(--space-6) 0 var(--space-4); }
.record-grid .metric-number { font-size: var(--font-number); }
.record-grid > div:last-child { text-align: right; }
.record-bottom { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--line); font-size: var(--font-caption); color: var(--secondary-text); }
.record-bottom button { font-size: var(--font-caption); color: var(--muted); padding: 0; }
.asset-number { font-size: var(--font-total); font-weight: 500; font-variant-numeric: tabular-nums; margin: var(--space-3) 0 var(--space-6); }
.asset-cost { display: flex; justify-content: space-between; gap: var(--space-2); font-size: var(--font-caption); color: var(--secondary-text); border-top: 1px solid var(--line); padding-top: var(--space-4); }
.returns-panel, .holdings-panel { padding: 0 var(--space-4) var(--space-4); }
.return-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.return-grid > div + div { padding-left: var(--space-4); border-left: 1px solid var(--line); }
.return-number { font-size: var(--font-number); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.return-number small { font-size: var(--font-body); }
.holding-labels { display: flex; justify-content: space-between; gap: var(--space-2); color: var(--muted); font-size: var(--font-caption); padding-bottom: var(--space-3); }
.holding-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); padding: var(--space-4) 0; border-top: 1px solid var(--line); }
.holding-row:last-child { padding-bottom: 0; }
.holding-row strong { font-size: var(--font-body); font-weight: 500; }
.holding-row > div:last-child { text-align: right; }
.holding-row p { color: var(--secondary-text); font-size: var(--font-caption); margin-top: var(--space-2); }
.holding-empty { padding: var(--space-4) 0 var(--space-6); color: var(--muted); text-align: center; font-size: var(--font-body); }
[data-gain-colors="green-up"] { --up: #009b67; --down: #ff381a; }
.positive { color: var(--up); }
.negative { color: var(--down); }
.empty-state { padding: 64px 0; text-align: center; color: var(--secondary-text); font-size: var(--font-body); }
.empty-symbol { width: 56px; height: 56px; border-radius: var(--radius); background: var(--soft); display: flex; align-items: center; justify-content: center; margin: 0 auto var(--space-4); color: var(--green); }
.empty-symbol .icon { width: 24px; height: 24px; }
.text-btn { color: var(--green); font-size: var(--font-body); margin-top: var(--space-4); }
.primary, .secondary { border-radius: 8px; padding: var(--space-3) var(--space-4); min-height: 44px; width: 100%; font-size: var(--font-button); line-height: 20px; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: var(--space-2); }
.primary { background: var(--green); color: var(--surface); }
.primary:active, .compact-primary:active { background: var(--primary-pressed); }
.secondary { background: var(--soft); color: var(--green); margin-top: var(--space-3); }
.secondary:active, .add-btn:active, .chip:active { background: #ffe2e2; }
.add-btn { margin-left: auto; padding: var(--space-2) var(--space-3); border-radius: 6px; color: var(--green); background: var(--soft); font-size: var(--font-caption); white-space: nowrap; }
.notice { font-size: var(--font-caption); color: var(--muted); line-height: 1.6; margin: var(--space-4) 0; }
.settings-row { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) 0; border-bottom: 1px solid var(--line); font-size: var(--font-body); }
.settings-row > span:last-child { color: var(--secondary-text); text-align: right; }
.overlay { position: absolute; inset: 0; z-index: 20; background: #1f232940; display: flex; align-items: flex-end; backdrop-filter: blur(3px); }
.overlay[hidden] { display: none; }
.sheet { width: 100%; max-height: 91%; overflow: auto; background: var(--surface); border-radius: 20px 20px 0 0; padding: var(--space-3) var(--space-4) 32px; scrollbar-width: none; }
.sheet:before { content: ''; display: block; height: 4px; width: 32px; background: #dfe3e8; border-radius: 4px; margin: 0 auto var(--space-6); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-6); }
.sheet-heading { display: flex; align-items: center; gap: var(--space-2); }
.sheet-head h3 { font-size: var(--font-title); font-weight: 600; }
.sheet-back { padding: 0; color: var(--secondary-text); display: flex; align-items: center; }
.sheet-back .icon { height: 20px; width: 20px; }
.close { font-size: 20px; color: var(--secondary-text); padding: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--background); line-height: 28px; }
.sheet-sub { color: var(--secondary-text); font-size: var(--font-body); line-height: 1.6; margin-bottom: var(--space-6); }
.field { display: block; margin: var(--space-4) 0; font-size: var(--font-body); color: var(--secondary-text); }
.field input, .field select { display: block; width: 100%; min-width: 0; margin-top: var(--space-2); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: var(--space-2) var(--space-3); color: var(--ink); height: 44px; outline-color: var(--green); font-size: var(--font-body); }
.field input:focus, .field select:focus, .search-input:focus { border-color: var(--green); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.field-row .field { margin-top: 0; }
.estimate { padding: var(--space-4); background: var(--soft); border-radius: 8px; margin: var(--space-4) 0; }
.estimate .record-line { font-size: var(--font-body); line-height: 1.6; padding: var(--space-1) 0; }
.estimate b { font-size: var(--font-name); font-weight: 500; }
.estimate p { font-size: var(--font-caption); color: var(--secondary-text); line-height: 1.6; margin-top: var(--space-2); }
.error, .form-error { color: var(--red); font-size: var(--font-caption); margin: var(--space-3) 0; }
.error:empty, .form-error:empty { display: none; }
.history-table { width: 100%; font-size: var(--font-body); border-collapse: collapse; margin: 0 0 var(--space-6); }
.history-table td { padding: var(--space-3) 0; border-bottom: 1px solid var(--line); color: var(--secondary-text); }
.history-table td:last-child { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.history-table tr:last-child td { font-weight: 500; color: var(--ink); }
.search-input { width: 100%; padding: var(--space-3); border: 1px solid var(--line); background: var(--background); border-radius: 8px; margin: 0 0 var(--space-3); outline-color: var(--green); font-size: var(--font-body); min-height: 44px; }
.search-result { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
.search-stock { display: flex; gap: var(--space-2); padding: 0; text-align: left; align-items: center; }
.search-stock strong { font-weight: 500; font-size: var(--font-name); }
.search-stock small { display: block; font-size: var(--font-caption); color: var(--muted); margin-top: var(--space-1); }
.link-source { color: var(--secondary-text); font-size: var(--font-caption); display: block; text-align: center; margin-top: var(--space-4); }
.configure-stock { display: flex; align-items: center; gap: var(--space-2); padding-bottom: var(--space-6); border-bottom: 1px solid var(--line); }
.configure-stock strong { font-size: var(--font-name); font-weight: 500; display: block; }
.configure-stock small { font-size: var(--font-caption); color: var(--secondary-text); display: block; margin-top: var(--space-1); }
.form-section-label { font-size: var(--font-body); margin: var(--space-6) 0 var(--space-4); color: var(--ink); }
.target-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.target-inputs label { display: block; color: var(--secondary-text); font-size: var(--font-caption); border: 1px solid var(--line); padding: var(--space-3); border-radius: 8px; background: var(--background); }
.target-inputs input { display: block; width: 100%; min-width: 0; border: 0; outline: 0; background: none; margin-top: var(--space-3); color: var(--ink); font-size: var(--font-number); font-weight: 500; padding: 0; font-variant-numeric: tabular-nums; }
.target-inputs label:focus-within { border-color: var(--green); background: var(--surface); }
.target-inputs input::-webkit-inner-spin-button { -webkit-appearance: none; }
.field-hint { font-size: var(--font-caption); color: var(--muted); margin: var(--space-3) 0 var(--space-6); }
.condition-preview { background: var(--soft); padding: var(--space-4); border-radius: 8px; display: flex; align-items: center; gap: var(--space-2); font-size: var(--font-body); color: var(--secondary-text); margin-bottom: var(--space-6); }
.condition-preview .icon { width: 16px; height: 16px; color: var(--green); flex-shrink: 0; }
.condition-preview b { color: var(--green); font-weight: 500; }
.detail-quote { display: flex; flex-direction: column; gap: var(--space-2); padding-bottom: var(--space-6); }
.detail-quote .metric-label { margin-bottom: 0; }
.detail-quote > strong { font-size: var(--font-price); font-weight: 500; }
.detail-quote > span:last-child { font-size: var(--font-body); color: var(--secondary-text); }
.detail-quote > span:last-child b { font-weight: 500; color: var(--up); margin-left: var(--space-2); }
.detail-section-title { font-size: var(--font-name); font-weight: 500; border-top: 1px solid var(--line); padding: var(--space-6) 0 var(--space-1); }
.remove-watch { display: block; width: 100%; min-height: 44px; padding: var(--space-3) 0 0; color: var(--secondary-text); font-size: var(--font-caption); }
#toast { position: absolute; bottom: 108px; left: 50%; transform: translateX(-50%); background: #1f2329ed; color: var(--surface); padding: var(--space-3) var(--space-4); border-radius: 8px; z-index: 40; font-size: var(--font-caption); opacity: 0; pointer-events: none; width: max-content; max-width: 90%; text-align: center; }
#toast.show { opacity: 1; }
@media (max-width: 480px) {
  body { background: var(--background); }
  .phone { width: 100%; height: 100dvh; min-height: 0; margin: 0; border-radius: 0; box-shadow: none; }
  .home-indicator { height: max(26px, env(safe-area-inset-bottom)); }
}
@media (max-width: 365px) {
  .header-actions { gap: var(--space-1); }
  .stock-card-title { gap: var(--space-1); }
  .stock-avatar { width: 32px; height: 32px; }
  .record-grid { column-gap: var(--space-1); }
  .ledger-summary { flex-wrap: wrap; }
}

main { touch-action: pan-y; }
.stock-stack { -webkit-user-select: none; user-select: none; }
.popular-card .stock-card-head { align-items: flex-start; }
.popular-card .stock-card-title strong { display: flex; align-items: baseline; gap: 6px; font-size: 16px; line-height: 28px; font-weight: 600; }
.popular-card .stock-card-title small { margin-top: 4px; font-size: 12px; line-height: 20px; color: #858b95; font-variant-numeric: tabular-nums; }
.popular-price { text-align: right; white-space: nowrap; }
.popular-price strong { font-size: var(--font-title); line-height: 24px; color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.popular-price small { font-size: var(--font-caption); margin-left: 2px; font-weight: 400; }
/* The homepage follows one path: choose income, set a price, wait. */
.stock-return-summary { display: grid; grid-template-columns: 1fr 1fr; margin: var(--space-4) 0; padding: var(--space-3) 0; background: #f7f8fa; border-radius: 8px; }
.stock-return-summary .summary-dividend { border-left: 1px solid #e5e9ed; }
.stock-return-summary > div { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); padding: 0 var(--space-3); }
.stock-return-summary > div > span { font-size: 13px; line-height: 20px; color: var(--secondary-text); }
.stock-return-summary strong { font-size: var(--font-title); line-height: 24px; color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stock-return-summary strong small { font-size: var(--font-caption); font-weight: 400; margin-left: 2px; }
.popular-add.secondary { margin-top: 0; }
.popular-card .popular-add { height: 44px; padding-top: 0; padding-bottom: 0; border: 1px solid #f2d8d8; background: var(--surface); font-size: 14px; font-weight: 500; }
.popular-card { padding: 18px 16px 16px; border-color: #eceef1; border-radius: 14px; box-shadow: none; }
.waiting-card .stock-card-head { align-items: flex-start; }
.waiting-card .stock-card-title strong { line-height: 20px; }
.waiting-card .stock-card-title small { line-height: 16px; }
.waiting-goal { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin: var(--space-4) 0; }
.waiting-goal > div > span { display: block; color: var(--secondary-text); font-size: var(--font-caption); margin-bottom: var(--space-1); }
.waiting-goal strong { font-size: 20px; color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.waiting-goal strong small { font-size: var(--font-caption); font-weight: 400; margin-left: 2px; }
.waiting-status { font-size: var(--font-caption); color: var(--secondary-text); }
.waiting-status.ready { color: var(--green); }
.yield-comparison { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); font-size: var(--font-caption); background: var(--soft); padding: var(--space-3); border-radius: 8px; color: var(--secondary-text); }
.yield-comparison b { color: var(--up); font-weight: 500; }
.comparison-arrow { color: #8ca699; }
.basis-caption { color: var(--muted); font-size: var(--font-caption); line-height: 1.5; margin: var(--space-2) 0 var(--space-4); }
.waiting-adjust { margin-top: 0; }
.waiting-edit { display: block; margin: var(--space-2) auto 0; color: var(--secondary-text); font-size: var(--font-caption); padding: var(--space-1); }
.goal-stock { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding-bottom: var(--space-4); border-bottom: 1px solid var(--line); margin-bottom: var(--space-6); }
.goal-stock strong { font-size: var(--font-name); font-weight: 500; }
.goal-stock > span { color: var(--secondary-text); font-size: var(--font-caption); }
.goal-yield-label { display: block; color: var(--ink); font-size: var(--font-body); }
.goal-yield-input { display: flex; align-items: baseline; justify-content: center; gap: var(--space-2); margin-top: var(--space-3); padding: var(--space-3); border: 1px solid var(--line); border-radius: 8px; }
.goal-yield-input:focus-within { border-color: var(--green); }
.goal-yield-input input { min-width: 0; width: 100px; background: none; border: 0; outline: none; padding: 0; text-align: center; color: var(--green); font-size: var(--font-number); font-variant-numeric: tabular-nums; }
.goal-yield-input input::-webkit-inner-spin-button { -webkit-appearance: none; }
.goal-yield-input > span { font-size: var(--font-body); color: var(--secondary-text); }
.yield-presets { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--space-2); margin: var(--space-3) 0 var(--space-6); }
.yield-presets button { border: 1px solid var(--line); border-radius: 6px; padding: var(--space-2); font-size: var(--font-body); color: var(--secondary-text); }
.yield-presets .selected { border-color: #efaaaa; color: var(--green); background: var(--soft); }
.goal-preview { padding: var(--space-4); border-radius: var(--radius); background: var(--soft); }
.goal-preview > span:first-child { font-size: var(--font-caption); color: var(--secondary-text); }
.goal-preview > strong { display: block; margin: var(--space-1) 0 var(--space-2); font-size: var(--font-number); color: var(--green); font-weight: 500; font-variant-numeric: tabular-nums; }
.goal-preview strong small { font-size: var(--font-body); margin-left: var(--space-1); }
.goal-preview p, .goal-distance { font-size: var(--font-caption); color: var(--secondary-text); }
.goal-distance { display: block; margin-top: var(--space-2); color: var(--green); }
.direct-price { margin: var(--space-4) 0; font-size: var(--font-caption); color: var(--secondary-text); }
.direct-price summary { cursor: pointer; padding: var(--space-1) 0; }
.popular-note { margin-top: var(--space-4); color: var(--muted); font-size: var(--font-caption); }
#main[data-slide="left"] .screen-enter { animation: slide-left .18s ease-out; }
#main[data-slide="right"] .screen-enter { animation: slide-right .18s ease-out; }
@keyframes slide-left { from { transform: translateX(16px); opacity: .4; } to { transform: translateX(0); opacity: 1; } }
@keyframes slide-right { from { transform: translateX(-16px); opacity: .4; } to { transform: translateX(0); opacity: 1; } }
@media(prefers-reduced-motion: reduce) { #main .screen-enter { animation: none; } }

.quote-timestamp { margin-top: var(--space-4); color: var(--muted); font-size: var(--font-caption); text-align: center; }

.latest-dividend-yield { padding: 0; min-height: 44px; text-align: right; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; color: var(--up); }
.latest-dividend-yield > strong { font-size: var(--font-title); line-height: 24px; font-weight: 500; font-variant-numeric: tabular-nums; }
.latest-dividend-yield small { font-size: var(--font-caption); margin-left: 1px; font-weight: 400; }
.yield-info { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 6px; color: var(--muted); }
.yield-info > svg, .yield-rule-link > svg { display: block; width: 14px; height: 14px; flex-shrink: 0; }
.dividend-rule-values { margin: 0; }
.dividend-rule-values > div { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); font-size: var(--font-body); }
.dividend-rule-values dt { color: var(--ink); }
.dividend-rule-values dd { margin: 0; font-size: var(--font-name); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; color: var(--ink); }
.dividend-rule-values dd small { font-size: var(--font-caption); font-weight: 400; }
.dividend-rule-values .rule-income { padding-top: var(--space-3); }
.rule-income dt, .rule-cost dt { font-weight: 500; }
.dividend-rule-values .rule-income dd, .dividend-rule-values .rule-cost dd { font-size: 20px; font-weight: 600; }
.dividend-rule-note { margin-top: var(--space-4); font-size: var(--font-caption); line-height: 1.6; color: var(--secondary-text); }

.dividend-rule-values .rule-result { border-bottom: 0; }
.rule-result dt { font-weight: 500; }
.dividend-rule-values .rule-result dd { font-size: 20px; font-weight: 600; color: var(--up); }

.latest-dividend-yield.labeled-yield { flex-direction: column; align-items: flex-end; gap: var(--space-1); }
.labeled-yield > strong { font-size: var(--font-total); line-height: 32px; font-weight: 600; }
.labeled-yield > strong small { font-size: var(--font-body); }
.yield-label { display: inline-flex; align-items: center; gap: var(--space-1); color: #7e8792; font-size: var(--font-caption); line-height: 20px; }
.yield-rule-link { position: relative; padding: 0; min-height: 24px; gap: 3px; }

.yield-rule-link > svg { color: #7e8792; }
.yield-rule-link:active { color: var(--green); }
.popular-card .yield-label { font-size: 12px; line-height: 20px; min-height: 20px; color: #858b95; }
.popular-card .yield-rule-link > svg { color: var(--secondary-text); }
.popular-card .labeled-yield > strong { height: 28px; font-size: 26px; line-height: 28px; font-weight: 600; letter-spacing: -.5px; }
.popular-card .labeled-yield > strong small { line-height: 1; }

.watch-price-card .stock-card-head { align-items: flex-start; }
.watch-price-card .stock-card-title strong { line-height: 28px; }
.watch-price-card .stock-card-title small { font-size: 13px; line-height: 24px; color: var(--secondary-text); }
.watch-current { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.watch-current > strong { height: 28px; line-height: 28px; font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.watch-current small { margin-left: 2px; font-size: 12px; font-weight: 400; }
.watch-current > span { font-size: 13px; line-height: 24px; color: var(--secondary-text); }
.watch-trigger { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; padding: 16px 12px; border-radius: 8px; background: var(--soft); }
.watch-trigger > div { display: flex; flex-direction: column; gap: 8px; }
.watch-trigger > div:last-child { align-items: flex-end; }
.watch-trigger span { font-size: 13px; line-height: 20px; color: var(--secondary-text); }
.watch-trigger strong { font-size: 24px; line-height: 32px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.watch-trigger strong small { font-size: 12px; line-height: 1; margin-left: 2px; font-weight: 400; }
.watch-price-card .stock-return-summary { margin: 12px 0 16px; }
.watch-price-action { height: 46px; margin-top: 0; padding-top: 0; padding-bottom: 0; }
.watch-price-input { margin-bottom: 20px; }
.watch-price-input input { width: 160px; }
.watch-preview-rate { display: flex; align-items: center; justify-content: space-between; }
.watch-preview-rate > span { font-size: 13px; color: var(--secondary-text); }
.watch-preview-rate strong { color: var(--up); font-size: 22px; line-height: 32px; font-weight: 600; font-variant-numeric: tabular-nums; }
.watch-preview-rate small { font-size: 12px; margin-left: 2px; font-weight: 400; }
.watch-price-preview .stock-return-summary { margin-bottom: 0; }

.watch-unset { margin-top: 16px; padding: 12px; border-radius: 8px; background: #f7f8fa; color: var(--secondary-text); font-size: 13px; line-height: 20px; }

.watch-price-card .stock-card-title strong { line-height: 32px; }
.watch-price-card .labeled-yield > strong { height: 32px; line-height: 32px; }
.watch-price-card .labeled-yield > strong small { line-height: 1; }
.watch-price-card .yield-label { font-size: 13px; color: var(--secondary-text); }
.watch-price-card .yield-rule-link > svg { color: var(--secondary-text); }
.watch-buyers { display: flex; align-items: baseline; gap: 4px; margin-top: 12px; color: var(--secondary-text); font-size: 12px; line-height: 20px; }
.watch-buyers strong { color: var(--ink); font-weight: 500; }
.watch-price-card .watch-trigger { margin: 0 0 16px; padding: 12px; background: #f7f8fa; }
.watch-price-card .watch-trigger strong { color: var(--ink); font-size: 20px; line-height: 28px; font-weight: 500; }
.watch-price-card .watch-unset { margin: 0 0 16px; }
.watch-setting-stock { margin-bottom: 16px; }
.watch-setting-stock b { color: var(--green); font-size: 16px; font-weight: 600; margin-left: 4px; }
.watch-price-reference { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 24px; padding: 12px 0; background: #f7f8fa; border-radius: 8px; }
.watch-price-reference > div { display: flex; flex-direction: column; gap: 8px; padding: 0 12px; }
.watch-price-reference > div:last-child { border-left: 1px solid var(--line); }
.watch-price-reference span { color: var(--secondary-text); font-size: 13px; line-height: 20px; }
.watch-price-reference strong { color: var(--ink); font-size: 18px; line-height: 24px; font-weight: 500; font-variant-numeric: tabular-nums; }
.watch-price-reference small { margin-left: 2px; font-size: 12px; font-weight: 400; }

.watch-price-card .watch-trigger { grid-template-columns: minmax(0,1fr) minmax(0,1.35fr); align-items: center; }
.watch-trigger .watch-price-context { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.watch-price-context > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.watch-price-card .watch-price-context strong { font-size: 14px; line-height: 20px; white-space: nowrap; }

.watch-price-card .watch-trigger, .watch-price-card .watch-unset { margin-top: 16px; margin-bottom: 12px; }
.watch-annual-income { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.watch-annual-income > div { display: flex; flex-direction: column; gap: 8px; }
.watch-annual-income > div:last-child { align-items: flex-end; }
.watch-annual-income span { font-size: 13px; line-height: 20px; color: var(--secondary-text); }
.watch-annual-income strong { color: var(--ink); font-size: 18px; line-height: 24px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }

.watch-annual-income small { margin-left: 2px; font-size: 12px; font-weight: 400; }
 .watch-plan { margin-top: 16px; padding: 12px; background: #f7f8fa; border-radius: 8px; }
.watch-plan .watch-trigger { margin: 0; padding: 0; background: none; border-radius: 0; }
.watch-plan .watch-unset { margin: 0; padding: 0; background: none; border-radius: 0; }
.watch-activity-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px; color: var(--secondary-text); font-size: 12px; line-height: 20px; }
.watch-activity-line span { white-space: nowrap; }
.watch-activity-line i { font-style: normal; color: var(--muted); }

.watch-live-icon { width: 16px; height: 16px; flex: 0 0 16px; color: var(--secondary-text); align-self: center; }
.watch-plan-unset .watch-annual-income { margin-top: 0; padding-top: 0; border-top: 0; }
.watch-price-context > div > span { white-space: nowrap; }



.stock-return-summary .dividend-history { gap: 6px; min-width: 0; display: block; }
main { touch-action: pan-x pan-y; }
.dividend-year-scroller { display: flex; width: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-x pan-y; cursor: grab; }
.dividend-year-scroller::-webkit-scrollbar { display: none; }
.dividend-year-scroller.is-dragging { scroll-snap-type: none; cursor: grabbing; }
.dividend-year-slide { flex: 0 0 100%; min-width: 0; display: flex; flex-direction: column; gap: 8px; scroll-snap-align: start; scroll-snap-stop: always; }
.dividend-year-slide > span { color: var(--secondary-text); font-size: 13px; line-height: 20px; white-space: nowrap; }
.dividend-rule-years { display: flex; overflow-x: auto; scrollbar-width: none; touch-action: pan-x; gap: 2px; padding: 4px; margin: 0 0 16px; background: #f7f8fa; border-radius: 8px; }
.dividend-rule-years > button { flex: 0 0 calc((100% - 8px) / 4.5); min-height: 36px; border-radius: 6px; font-size: 13px; padding: 0 4px; color: var(--secondary-text); }
.dividend-rule-years > button[aria-pressed="true"] { background: var(--surface); color: var(--green); font-weight: 500; box-shadow: 0 1px 3px #1f23290a; }

.stock-card-title .stock-inline-price { font: inherit; color: inherit; }

.stock-return-summary.dividend-panel-history { display: block; padding: 12px 0; }
.dividend-panel-history > .dividend-year-scroller { display: flex; flex-direction: row; align-items: stretch; gap: 0; padding: 0; }
.dividend-panel-slide { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.dividend-panel-slide > div { display: flex; flex-direction: column; gap: 8px; padding: 0 12px; }
.dividend-panel-slide > div + div { border-left: 1px solid #e5e9ed; }
.dividend-panel-slide span { font-size: 13px; line-height: 20px; color: var(--secondary-text); white-space: nowrap; }

.stock-stack > .popular-card { min-width: 0; }
.stock-return-summary.dividend-panel-history { min-width: 0; overflow: hidden; }
.dividend-panel-history > .dividend-year-scroller { min-width: 0; }

.dividend-panel-history .dividend-year-cell { flex: 0 0 50%; padding: 0 12px; }
.dividend-year-cell + .dividend-year-cell { border-left: 1px solid #e5e9ed; }

.watch-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.watch-card-actions > button { width: 100%; }
#record-form input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
#record-form input[type="number"]::-webkit-inner-spin-button,
#record-form input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.watch-setting-rate { margin: -12px 0 20px; font-size: 13px; line-height: 20px; color: var(--secondary-text); }
.watch-setting-rate span { color: var(--up); margin-left: 4px; }
#watch-form .watch-price-input { margin-top: 0; }
#watch-price { appearance: textfield; -moz-appearance: textfield; }
#watch-price::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.overlay:has(.watch-confirmation) { align-items: center; justify-content: center; }
.sheet:has(.watch-confirmation) { width: calc(100% - 48px); border-radius: 16px; padding: 24px; }
.sheet:has(.watch-confirmation)::before { display: none; }
.sheet:has(.watch-confirmation) .sheet-head { margin-bottom: 16px; }
.watch-confirmation p { margin: 0 0 24px; color: var(--secondary-text); font-size: 14px; line-height: 24px; }
.watch-confirmation strong { color: var(--ink); font-weight: 500; }

/* My account: compact totals and account services. */
.mine-summary .asset-number { margin: 0; font-size: 28px; line-height: 1.3; }
.mine-summary-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.mine-summary-grid .metric-label { margin-bottom: 4px; }
.mine-summary-grid strong { font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mine-summary-grid small { margin-left: 2px; font-size: 12px; }
.mine-membership { position: relative; isolation: isolate; overflow: hidden; padding: 20px; margin: 0 0 16px; border-radius: var(--radius); background: linear-gradient(115deg, #292625, #35302c); color: #f0ddb8; border: 1px solid #e8c58e26; box-shadow: inset 0 1px 0 #ffffff08, 0 4px 12px #2926250d; }
.mine-membership::before { content: ""; position: absolute; right: -100px; top: 36px; width: 340px; height: 230px; border: 1px solid #f0ddb81c; border-radius: 50%; transform: rotate(-30deg); z-index: 0; pointer-events: none; }

.mine-membership > * { position: relative; z-index: 1; }
.mine-member-label { display: flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: 1px; }
.mine-member-label .icon { width: 22px; height: 22px; }
.mine-membership h2 { width: max-content; max-width: 100%; font-size: 18px; line-height: 1.5; font-weight: 500; margin: 16px 0 10px; white-space: nowrap; color: #f0ddb8; }

.sleep-income-highlight { font-size: 20px; font-weight: 600; color: inherit; }
.mine-member-description { font-size: 12px; line-height: 1.7; color: #c8c1b7; margin-bottom: 16px; }
.mine-member-bottom { display: flex; justify-content: flex-end; align-items: center; }
.mine-member-bottom button { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 38px; padding: 8px 14px; border-radius: 7px; background: #e8c58e; color: #292625; font-size: 14px; font-weight: 500; white-space: nowrap; }
.mine-member-bottom .icon { width: 14px; height: 14px; }
.mine-invite { width: 100%; min-height: 56px; display: flex; align-items: center; gap: 12px; text-align: left; padding: 16px; }
.mine-invite-icon { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex-shrink: 0; color: var(--green); }
.mine-invite-copy { flex: 1; font-size: 15px; line-height: 22px; }
.mine-invite-copy strong { font-size: 16px; font-weight: 500; }
.mine-invite-copy > span { color: var(--secondary-text); font-size: 12px; }
#mine-invite .mine-invite-copy { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.friend-invite-page { padding: 4px 0 88px; }
.friend-invite-rules { padding: 4px 4px 24px; }
.friend-invite-rules ol { margin: 10px 0 0; padding-left: 20px; font-size: 14px; line-height: 24px; }
.friend-invite-rules li + li { margin-top: 8px; }
.friend-invite-page h2 { font-size: 16px; line-height: 26px; font-weight: 600; }
.friend-invite-rules p { margin-top: 10px; font-size: 14px; line-height: 24px; }
.friend-invite-rules p + p { color: var(--secondary-text); font-size: 12px; line-height: 20px; }
.friend-invite-records { background: var(--surface); border-radius: 12px; padding: 16px; }
.friend-invite-records h2 { margin-bottom: 4px; }
.friend-invite-row { display: flex; align-items: center; gap: 12px; padding: 18px 0; }
.friend-invite-row + .friend-invite-row { border-top: 1px solid var(--line); }
.friend-invite-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: #f0ebe3; color: #89704e; font-size: 16px; }
.friend-invite-name { flex: 1; font-size: 15px; }
.friend-invite-status { text-align: right; }
.friend-invite-status strong { display: block; font-size: 13px; font-weight: 400; }
.friend-invite-status small { display: block; margin-top: 4px; font-size: 11px; color: var(--secondary-text); }
.friend-invite-status.is-rewarded strong { color: #977143; }
#friend-invite-dock { position: absolute; z-index: 8; left: 0; right: 0; bottom: max(26px, env(safe-area-inset-bottom)); padding: 16px; background: var(--background); }
#friend-invite-dock[hidden] { display: none; }
#friend-invite-button { width: 100%; min-height: 48px; border-radius: 10px; font-size: 16px; }
.mine-invite > .icon { width: 16px; height: 16px; color: var(--secondary-text); flex-shrink: 0; }

.records-filters { position: sticky; top: -16px; z-index: 5; align-items: center; gap: 24px; margin: -16px -16px 0; padding: 0 16px; min-height: 52px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.records-filters > .chip { position: relative; flex-shrink: 0; min-height: 52px; padding: 0; background: none; border-radius: 0; color: var(--secondary-text); font-size: 16px; line-height: 24px; white-space: nowrap; }
.records-filters > .chip.active { color: var(--ink); font-weight: 600; background: none; border-radius: 0; }
.records-filters > .chip.active::after { content: ''; position: absolute; width: 20px; height: 3px; border-radius: 2px; left: 50%; bottom: 4px; transform: translateX(-50%); background: var(--green); }
.holding-record-card { padding: 16px; }
.holding-record-card .record-line > small { color: var(--secondary-text); font-size: 13px; }
.holding-price-grid { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; margin: 20px 0; }
.holding-price-grid > div { display: flex; flex-direction: column; gap: 8px; }
.holding-price-grid > div:last-child { align-items: flex-end; }
.holding-price-grid span, .holding-dividend-paid span, .holding-dividend-upcoming span { color: var(--secondary-text); font-size: 13px; line-height: 20px; }
.holding-price-grid strong { font-size: 18px; font-weight: 500; line-height: 24px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.holding-price-grid strong small, .holding-dividend-paid strong small { margin-left: 2px; font-size: 12px; font-weight: 400; }
.holding-price-grid > div > small { font-size: 12px; line-height: 16px; }
.holding-dividend-paid, .holding-dividend-upcoming, .holding-dividend-empty { padding-top: 16px; border-top: 1px solid var(--line); }
.holding-dividend-paid { display: flex; justify-content: space-between; gap: 12px; }
.holding-dividend-paid > div { display: flex; flex-direction: column; gap: 6px; }
.holding-dividend-paid > div:last-child { align-items: flex-end; }
.holding-dividend-paid strong { color: var(--green); font-size: 18px; line-height: 24px; font-weight: 500; font-variant-numeric: tabular-nums; }
.holding-dividend-paid > div > small, .holding-dividend-upcoming > small { color: var(--secondary-text); font-size: 12px; line-height: 20px; }
.holding-dividend-upcoming > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.holding-dividend-upcoming strong { color: var(--green); font-size: 14px; font-weight: 400; }
.holding-dividend-upcoming b { font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.holding-dividend-empty { color: var(--secondary-text); font-size: 13px; }
.holding-trades { margin-top: 16px; border-top: 1px solid var(--line); }
.holding-trades > summary { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; color: var(--secondary-text); font-size: 13px; cursor: pointer; list-style: none; }
.holding-trades > summary::-webkit-details-marker { display: none; }
.holding-trades > summary > span { font-size: 12px; }
.holding-trade { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 16px; }
.holding-trade > div { display: flex; flex-direction: column; gap: 6px; }
.holding-trade strong { font-size: 13px; font-weight: 400; color: var(--ink); }
.holding-trade span, .holding-trade > button { color: var(--secondary-text); font-size: 12px; }
.holding-trade > button { padding: 8px 0 8px 12px; }

.mine-summary-head { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; gap: 12px; margin-bottom: 20px; }
.mine-summary-head .metric-label { margin-bottom: 8px; }
.mine-summary-head .asset-number { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.mine-total-return { text-align: right; }
.mine-total-return strong { display: block; font-size: 24px; line-height: 1.52; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mine-total-return small { font-size: 14px; margin-left: 2px; }
.mine-dividend-estimate { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.mine-dividend-estimate strong { font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mine-dividend-estimate > span { color: var(--secondary-text); font-size: 12px; text-align: right; }
.mine-calculation-note { margin-top: 12px; color: var(--secondary-text); font-size: 12px; line-height: 1.6; }

.holding-dividend-total { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; color: var(--secondary-text); font-size: 12px; line-height: 20px; }
.holding-dividend-total span { text-align: right; }

.buy-record-bottom { margin-top: 16px; }
.holding-record-card .record-line { flex-wrap: wrap; }

/* Continuous buy ledger with dividends as the primary figures. */
.trade-list { margin: 0 -16px -24px; padding: 0 20px 20px; background: var(--surface); }
.trade-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 0 16px; }
.trade-list-heading h2 { font-size: 22px; font-weight: 600; line-height: 30px; }
.trade-list-heading p { margin-top: 6px; color: var(--secondary-text); font-size: 14px; line-height: 22px; }
.trade-current-price { text-align: right; }
.trade-current-price > span { display: block; color: var(--secondary-text); font-size: 14px; }
.trade-current-price > strong { display: block; font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.trade-current-price small { font-size: 14px; font-weight: 400; margin-left: 3px; }
.trade-list-note { padding: 0 0 20px; color: var(--secondary-text); font-size: 13px; line-height: 22px; border-bottom: 1px solid var(--line); }
.trade-list-row { padding: 24px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.trade-list-row:last-child { border-bottom: 0; }
.trade-row-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.trade-row-heading > div:first-child { display: flex; flex-direction: column; gap: 4px; }
.trade-row-heading > div:first-child > strong { font-size: 16px; line-height: 26px; font-weight: 500; }
.trade-row-heading > div:first-child > small { font-size: 13px; line-height: 22px; color: var(--secondary-text); }
.trade-quantity { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.trade-quantity > strong { font-size: 18px; line-height: 26px; font-weight: 500; }
.trade-quantity small { margin-left: 3px; font-size: 14px; font-weight: 400; }
.trade-quantity > span { color: var(--secondary-text); font-size: 14px; line-height: 22px; }
.trade-income-line { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; margin-top: 20px; }
.trade-income-line > span { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; color: var(--secondary-text); font-size: 14px; line-height: 24px; }
.trade-income-line > span:last-child { align-items: flex-end; text-align: right; }
.trade-income-line strong { font-size: 26px; line-height: 36px; font-weight: 500; overflow-wrap: anywhere; }
.trade-income-line strong small { margin-left: 3px; font-size: 14px; font-weight: 400; }
.trade-amount-line { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; margin-top: 20px; color: var(--secondary-text); font-size: 14px; line-height: 24px; }
.trade-amount-line > span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.trade-amount-line > span:last-child { justify-content: flex-end; text-align: right; }
.trade-amount-line b { font-size: 15px; font-weight: 400; overflow-wrap: anywhere; }
.trade-amount-line > span:first-child b { color: var(--ink); }
.trade-amount-line b small { font-size: 13px; margin-left: 2px; }
.trade-amount-line > span > small { font-size: 13px; }
.trade-row-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 12px; color: var(--secondary-text); font-size: 13px; line-height: 24px; }
.trade-row-foot button { min-height: 40px; min-width: 44px; padding: 8px 0 8px 12px; color: var(--secondary-text); font-size: 14px; }
@media (max-width: 390px) {
 .trade-list { padding-left: 16px; padding-right: 16px; }
}

.mine-summary-head { grid-template-columns: minmax(0,1fr) minmax(0,1.25fr); margin-bottom: 0; }
.mine-total-return > strong { font-size: 22px; line-height: 32px; }
.mine-total-rate { display: block; margin-top: 4px; font-size: 12px; line-height: 20px; }
.mine-total-rate small { font-size: 12px; margin-left: 1px; }
.mine-return-row { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: 8px 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.mine-return-row > div { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.mine-return-row > div:nth-child(2) { align-items: flex-end; text-align: right; }
.mine-return-row strong { font-size: 20px; line-height: 28px; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mine-return-row strong small { font-size: 12px; margin-left: 2px; font-weight: 400; }
.mine-remaining-note { grid-column: 1 / -1; font-size: 12px; line-height: 20px; color: var(--secondary-text); margin: 0; }

.trade-current-line { display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; padding: 16px 0 0; color: var(--secondary-text); font-size: 14px; }
.trade-current-line strong { color: var(--ink); font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.trade-current-line small { font-size: 14px; margin-left: 3px; font-weight: 400; }

.holdings-list { padding: 0 0 20px; background: var(--background); }
.holdings-row { padding: 16px; background: var(--surface); font-variant-numeric: tabular-nums; }
.holdings-row + .holdings-row { margin-top: 10px; }
.holding-heading { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.holding-heading strong { font-size: 16px; font-weight: 600; }
.holding-heading > span { color: var(--secondary-text); font-size: 12px; }
.holding-pairs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 16px; }
.holding-pairs > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.holding-pairs > div:nth-child(even) { text-align: right; }
.holding-pairs > div > span { color: var(--secondary-text); font-size: 13px; line-height: 22px; }
.holding-pairs strong { font-size: 17px; line-height: 26px; font-weight: 500; overflow-wrap: anywhere; }
.holding-pairs strong small { margin-left: 3px; font-size: 12px; font-weight: 400; }
.holding-price-compare { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; font-size: 13px; line-height: 24px; color: var(--secondary-text); }
.holding-price-compare > span { white-space: nowrap; }
.holding-price-compare strong { margin-left: 4px; font-size: 15px; font-weight: 400; color: var(--ink); }
.holding-price-compare > small { font-size: 12px; margin-left: -10px; }
.holding-returns { display: grid; grid-template-columns: minmax(0,1fr) max-content max-content; gap: 2px 8px; margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); line-height: 26px; align-items: baseline; }
.holding-returns > div { display: contents; }
.holding-returns > div > span:first-child { color: var(--secondary-text); font-size: 13px; }
.holding-returns strong { text-align: right; font-size: 16px; font-weight: 500; overflow-wrap: anywhere; }
.holding-returns strong small { margin-left: 3px; font-size: 12px; font-weight: 400; }
.holding-returns > div > span:last-child { text-align: right; font-size: 13px; white-space: nowrap; }
.holding-amounts, .holding-details { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.holding-amounts > div, .holding-details > div { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.holding-amounts > div:last-child, .holding-details > div:last-child { align-items: flex-end; text-align: right; }
.holding-amounts > div:nth-child(2), .holding-details > div:nth-child(2) { align-items: center; text-align: center; }
.holding-amounts > div > span, .holding-details > div > span { color: var(--secondary-text); font-size: 12px; line-height: 20px; }
.holding-amounts strong { margin-top: 6px; font-size: 18px; line-height: 26px; font-weight: 500; overflow-wrap: anywhere; }
.holding-amounts > div > small { font-size: 12px; line-height: 20px; }
.holding-details { margin-top: 16px; }
.holding-details strong { margin-top: 4px; font-size: 14px; line-height: 22px; font-weight: 400; }
.holding-details small { margin-left: 3px; font-size: 12px; font-weight: 400; }
:is(.holdings-row, .trade-list-row) .trade-income-line { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); gap: 8px; }
:is(.holdings-row, .trade-list-row) .trade-income-line > span { flex-direction: row; align-items: baseline; gap: 6px; font-size: 12px; line-height: 22px; }
:is(.holdings-row, .trade-list-row) .trade-income-line > span:last-child { justify-content: flex-end; }
:is(.holdings-row, .trade-list-row) .trade-income-line strong { color: var(--ink); font-size: 13px; line-height: 22px; font-weight: 400; }
:is(.holdings-row, .trade-list-row) .trade-income-line strong small { font-size: 12px; }

.watch-adjust-action { display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--secondary-text); font-size: var(--font-button); font-weight: 400; }
.watch-adjust-action:active { background: #f7f8fa; }


.trade-buy-amounts { margin-top: 20px; }

#gain-colors { border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; background: var(--surface); color: var(--ink); font-size: 14px; }


.page-heading { display: flex; align-items: center; gap: 8px; }
#page-back { display: flex; align-items: center; justify-content: center; width: 32px; height: 36px; margin-left: -8px; padding: 0; }
#page-back[hidden], #header-search[hidden], .tabbar[hidden] { display: none; }
.settings-menu { padding: 0 16px; }
.settings-menu .settings-row:last-child { border-bottom: 0; align-items: center; }

.dividend-panel-history .dividend-year-pair { flex: 0 0 100%; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 0; }
.dividend-year-pair > .dividend-year-cell { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dividend-year-pair > .dividend-year-cell > span { color: var(--secondary-text); font-size: 13px; line-height: 20px; white-space: nowrap; }

.phone .money-return { color: var(--ink); }
.phone .money-return.positive { color: var(--up); }
.phone .money-return.negative { color: var(--down); }

.mine-summary-section + .mine-summary-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }

.guide-page { background: var(--surface); margin: -16px -16px -24px; padding: 20px 20px 28px; }
.guide-intro { color: var(--secondary-text); font-size: 14px; line-height: 24px; margin-bottom: 24px; }
.guide-sections { margin: 0; padding: 0 0 0 24px; }
.guide-sections > li { padding-left: 4px; margin-bottom: 28px; }
.guide-sections > li::marker { color: var(--green); font-size: 16px; font-weight: 600; }
.guide-sections h2 { font-size: 16px; line-height: 26px; font-weight: 600; margin-bottom: 10px; }
.guide-sections p { font-size: 14px; line-height: 26px; overflow-wrap: anywhere; }
.guide-sections p + p { margin-top: 8px; }
.guide-sections b { font-weight: 500; }
.guide-example { color: var(--secondary-text); }
.guide-sources { border-top: 1px solid var(--line); padding-top: 16px; font-size: 12px; line-height: 22px; color: var(--secondary-text); }
.guide-sources a { color: var(--green); text-decoration: none; }

.record-market { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.record-market > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.record-market > div:nth-child(2) { text-align: center; }
.record-market > div:last-child { text-align: right; }
.record-market > div > span, .record-profit > span:first-child { color: var(--secondary-text); font-size: 12px; line-height: 20px; }
.record-market strong { font-size: 16px; line-height: 24px; font-weight: 500; overflow-wrap: anywhere; }
.record-market > div:nth-child(2) strong { font-size: 16px; font-weight: 500; }
.record-market small, .record-profit small { margin-left: 3px; font-size: 12px; font-weight: 400; }
.record-market i { margin: 0 3px; font-style: normal; color: var(--secondary-text); }
.record-profit { display: flex; align-items: baseline; gap: 8px; margin-top: 12px; line-height: 24px; }
.record-profit > span:first-child { margin-right: auto; }
.record-profit strong { font-size: 16px; font-weight: 500; }
.record-profit > span:last-child { font-size: 12px; white-space: nowrap; }
.holding-pairs .record-return-rate, .holding-pairs .record-shares { font-size: 12px; line-height: 20px; }
.holding-pairs .record-return-rate.positive { color: var(--up); }
.holding-pairs .record-return-rate.negative { color: var(--down); }
.trade-list-row .record-capital { margin-top: 16px; }

.record-capital { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.record-capital > div { gap: 4px; }
.record-capital > div:nth-child(2) { text-align: center; }
.record-capital > div:nth-child(3) { text-align: right; }
.record-capital > div > span { font-size: 12px; line-height: 20px; }
.record-capital strong { font-size: 16px; line-height: 24px; }

.record-market .record-price-rate.positive { color: var(--up); }
.record-market .record-price-rate.negative { color: var(--down); }

.record-details-list { padding: 0 0 20px; background: var(--background); }
.record-details-list .trade-list-row { padding: 16px; border-bottom: 0; background: var(--surface); }
.trade-month-group + .trade-month-group { margin-top: 0; }
.trade-month-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 16px 12px; font-size: 14px; line-height: 22px; font-weight: 500; }
.trade-month-title small { display: inline-flex; align-items: center; gap: 4px; color: var(--secondary-text); font-size: 12px; font-weight: 400; white-space: nowrap; }
.trade-month-title small .icon { width: 13px; height: 13px; stroke-width: 1.5; }
.trade-month-group > .trade-list-row + .trade-list-row { margin-top: 10px; }
.record-details-list .trade-row-heading { align-items: center; gap: 12px; padding: 0 16px; }
.record-details-list .trade-row-heading > div:first-child { flex-direction: row; align-items: baseline; gap: 8px; }
.record-details-list .trade-row-heading > button { min-width: 44px; min-height: 40px; padding: 8px 0 8px 8px; color: var(--secondary-text); font-size: 12px; text-align: right; }
.record-details-list .record-capital { margin-top: 0; }
.trade-record-meta { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 12px; font-size: 12px; line-height: 22px; color: var(--secondary-text); }
.trade-record-meta > span { white-space: nowrap; }
.trade-record-meta strong { font-size: 13px; font-weight: 400; }
.trade-record-meta small { font-size: 12px; margin-left: 3px; }

.trade-buy-time { color: var(--secondary-text); font-size: 12px; line-height: 22px; }

.record-capital .record-expected { line-height: 20px; }
.record-expected b { font-weight: 400; }
.record-expected small { font-size: inherit; margin-left: 2px; }




.transaction-directions { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; border-radius: 9px; background: var(--background); margin: 4px 0 20px; }
.transaction-directions button { min-height: 40px; border-radius: 6px; font-size: 15px; color: var(--secondary-text); }
.transaction-directions button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: 0 1px 3px #1f23290a; }
.transaction-position { font-size: 13px; color: var(--secondary-text); line-height: 22px; margin-bottom: 16px; }
.transaction-receipt-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.transaction-receipt-heading strong { font-size: 16px; font-weight: 500; }
.transaction-receipt-heading > span { color: var(--secondary-text); font-size: 13px; }
.transaction-receipt .record-profit { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 20px; }

/* Multiple watch prices in one compact editor. */
.watch-price-values { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.watch-price-card .watch-price-values strong { font-size: 18px; white-space: nowrap; }
.watch-price-row { display: flex; align-items: center; gap: 8px; min-height: 48px; border-bottom: 1px solid #f0f1f3; }
.watch-price-row input { width: 100px; max-width: calc(100% - 20px); min-width: 0; padding: 10px 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 20px; font-variant-numeric: tabular-nums; appearance: textfield; -moz-appearance: textfield; }
.watch-price-row input::-webkit-inner-spin-button, .watch-price-row input::-webkit-outer-spin-button { -webkit-appearance: none; }
.watch-price-row:focus-within { border-bottom-color: var(--green); }
.watch-price-entry { flex: 0 1 112px; min-width: 0; display: flex; align-items: baseline; gap: 4px; }
.watch-price-entry > span { color: var(--secondary-text); font-size: 12px; }
.watch-price-discount { color: var(--secondary-text); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.watch-price-row > button { display: flex; align-items: center; justify-content: center; flex: 0 0 44px; height: 44px; padding: 12px; color: var(--green); }
.watch-price-row > button svg { width: 20px; height: 20px; }
.watch-editor-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.watch-add-price { min-height: 44px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; color: var(--secondary-text); font-size: var(--font-button); line-height: 20px; font-weight: 500; }
#watch-price-list { max-height: 336px; overflow-y: auto; }

.transaction-recent { display: flex; align-items: center; gap: 8px; margin: -6px 0 16px; }
.transaction-recent[hidden] { display: none; }
.transaction-recent button { min-height: 36px; padding: 6px 10px; border-radius: 6px; background: var(--background); color: var(--secondary-text); font-size: 13px; white-space: nowrap; }
.transaction-recent button:active { background: var(--soft); color: var(--green); }

#transaction-add, #watch-add { position: absolute; right: 20px; bottom: 104px; z-index: 10; display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 50%; background: var(--green); color: var(--surface); box-shadow: 0 4px 14px #e9303029; }
#transaction-add[hidden], #watch-add[hidden] { display: none; }
#transaction-add .icon, #watch-add .icon { width: 28px; height: 28px; stroke-width: 2; }
main.has-transaction-add { padding-bottom: 88px; }


.sheet:has(#watch-form) .sheet-head { margin-bottom: 8px; }
.watch-low-references { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 20px; color: var(--secondary-text); font-size: 12px; line-height: 20px; }
.watch-low-references > span { white-space: nowrap; }
.watch-low-references small { margin-left: 2px; font-size: inherit; }
.watch-custom-price { display: block; min-height: 44px; padding: 8px 0 8px 52px; color: var(--secondary-text); font-size: 13px; }


.popular-card .stock-card-title .stock-inline-price { color: var(--secondary-text); font-size: 13px; font-weight: 400; }
.popular-card .latest-dividend-yield { flex-shrink: 0; gap: 4px; }
.popular-card .labeled-yield > strong small { font-size: 13px; letter-spacing: 0; margin-left: 2px; }
.popular-card .stock-return-summary { margin: 18px 0 14px; padding: 14px 0; background: #f7f8fa; border-radius: 9px; }
.popular-card .dividend-year-cell { padding: 0 14px; gap: 6px; }
.popular-card .dividend-year-cell + .dividend-year-cell { border-left: 0; }
.popular-card .dividend-year-cell > span { font-size: 12px; line-height: 18px; color: var(--secondary-text); }
.popular-card .stock-return-summary strong { font-size: 20px; line-height: 26px; font-weight: 500; }
.popular-card .stock-return-summary strong small { font-size: 12px; margin-left: 3px; }

.watch-price-card .stock-card-title strong { display: flex; align-items: baseline; gap: 6px; font-size: 16px; line-height: 28px; font-weight: 600; }
.watch-price-card .stock-card-title .stock-inline-price { color: var(--secondary-text); font-size: 13px; font-weight: 400; }
.watch-price-card .stock-card-title small { margin-top: 4px; font-size: 12px; line-height: 20px; color: #858b95; font-variant-numeric: tabular-nums; }

.stock-detail-meta { margin: 2px 0 0; color: var(--secondary-text); font-size: 13px; line-height: 22px; }
.stock-detail-meta p + p { margin-top: 4px; }
.stock-detail-dividends h4 { margin: 0 0 8px; font-size: 16px; line-height: 24px; font-weight: 500; }
.stock-detail-dividend-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.stock-detail-dividend-heading h4 { margin-bottom: 0; }
.sheet:has(.stock-detail-dividends) { height: 94%; max-height: 94%; display: block; overflow-y: auto; overscroll-behavior-y: contain; }
.stock-detail-dividends .stock-detail-history { max-height: none; overflow: visible; }
.stock-detail-section { margin: 0; }
.stock-detail-head .stock-detail-name h3 { font-size: 20px; line-height: 30px; }
.stock-detail-head { margin-bottom: 8px; }
.stock-detail-section:first-child, .stock-detail-cycle { display: grid; grid-template-columns: 78px minmax(0,1fr); align-items: baseline; gap: 12px; }
.stock-detail-section:first-child h4 { margin: 0; }
.stock-detail-section h4 { font-size: 14px; font-weight: 500; margin: 0 0 10px; }
.stock-detail-section p { margin: 0; font-size: 14px; line-height: 24px; }

.stock-detail-cycle { margin-top: 10px; }
.stock-detail-cycle h4 { margin: 0; }
.stock-monthly, .stock-detail-history-section { margin-top: 32px; }
.stock-monthly-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.stock-monthly-heading h4 { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 16px; font-weight: 600; }
.stock-monthly-heading > span, .stock-monthly-range { color: #747d8a; font-size: 12px; line-height: 20px; }
.stock-monthly-plot { position: relative; }
.stock-monthly-tooltip { position: absolute; z-index: 1; padding: 5px 8px; border-radius: 5px; background: #27313d; color: white; font-size: 12px; line-height: 20px; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.stock-monthly-chart { cursor: crosshair; touch-action: pan-y; display: block; width: 100%; height: auto; overflow: visible; }
.stock-monthly-chart text { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; fill: #747d8a; font-size: 11px; font-variant-numeric: tabular-nums; }
.stock-monthly-range { font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stock-detail-section .stock-monthly-status { color: #747d8a; font-size: 13px; padding: 48px 0; text-align: center; }
.stock-detail-history-section > h4 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.stock-dividend-year, .stock-dividend-columns { display: grid; grid-template-columns: minmax(0,1fr) 76px 88px; column-gap: 12px; }
.stock-dividend-year { padding: 8px 0; border-bottom: 1px solid #edf0f3; align-items: center; font-variant-numeric: tabular-nums; }
.stock-dividend-year:last-child { border-bottom: 0; }
.stock-dividend-date { display: grid; grid-template-columns: 5ch minmax(0,1fr); column-gap: 6px; grid-column: 1; padding: 8px 0; color: var(--ink); font-size: 12px; line-height: 22px; white-space: nowrap; }
.stock-dividend-date-year { color: var(--ink); }
button.stock-dividend-date { text-align: left; }
button.stock-dividend-date:not(:disabled) > span:last-child { text-decoration: underline; text-decoration-color: #c4cad2; text-underline-offset: 3px; }
.stock-dividend-cash { grid-column: 3; padding: 8px 0; color: var(--ink); font-size: 16px; line-height: 22px; font-weight: 500; text-align: right; white-space: nowrap; }
.stock-dividend-cash small { font-size: 12px; font-weight: 400; color: #747d8a; }
.stock-dividend-yield { grid-column: 2; color: #e5484d; font-size: 14px; text-align: center; white-space: nowrap; }
.stock-dividend-yield small { display: block; font-size: 11px; line-height: 18px; }
.stock-dividend-columns { padding: 0 0 8px; color: #747d8a; font-size: 12px; }
.stock-dividend-columns > span:nth-child(2) { text-align: center; }
.stock-dividend-columns > span:last-child { text-align: right; }
.stock-detail-section .stock-detail-no-payment { color: #747d8a; font-size: 12px; line-height: 22px; }
.stock-detail-section:first-child h4, .stock-detail-cycle h4 { color: #747d8a; font-size: 13px; font-weight: 400; }
.stock-market-code { padding: 0; min-height: 28px; color: var(--secondary-text); font-size: 12px; font-weight: 400; }
.stock-detail-identity:has(.stock-market-type) { display: block; }
.stock-market-type { margin: 10px 0 0; font-size: 13px; color: var(--secondary-text); }
.stock-detail-actions { position: sticky; bottom: 0; z-index: 2; display: flex; gap: 12px; flex-shrink: 0; padding-top: 16px; background: var(--surface); }
.stock-detail-actions > button { flex: 1; }
.sheet:has(.stock-detail-dividends) { padding-bottom: 0; }
.stock-detail-actions { padding-bottom: 34px; padding-bottom: max(34px, calc(16px + env(safe-area-inset-bottom, 0px))); }
.stock-detail-dividends .history-table { margin-bottom: 0; font-size: 12px; }
.stock-detail-dividends .history-table tr:last-child td { font-weight: 400; }
.stock-detail-dividends .history-table td small { font-size: 12px; }
.stock-detail-dividends .dividend-amount { font-size: 16px; font-weight: 500; }
.stock-detail-dividends .dividend-forecast-row td { vertical-align: top; white-space: nowrap; }
.stock-detail-dividends .history-table .dividend-forecast-amount, .stock-detail-dividends .history-table td { color: var(--ink); }

/* Homepage polish: retain the original card and action layout. */
.popular-card, .watch-price-card { padding: 18px 16px 16px; border-color: #e9ecf0; border-radius: 12px; }
.popular-card .stock-card-title strong, .watch-price-card .stock-card-title strong { font-size: 16px; font-weight: 600; line-height: 26px; }
.popular-card .stock-card-title .stock-inline-price, .watch-price-card .stock-card-title .stock-inline-price { color: #717987; font-size: 12px; font-weight: 400; }
.popular-card .stock-card-title small, .watch-price-card .stock-card-title small { margin-top: 4px; color: #7d8591; font-size: 12px; line-height: 20px; }
.popular-card .labeled-yield > strong, .watch-price-card .labeled-yield > strong { height: 26px; font-size: 24px; line-height: 26px; font-weight: 600; letter-spacing: -.3px; }
.popular-card .labeled-yield > strong small, .watch-price-card .labeled-yield > strong small { font-size: 12px; margin-left: 3px; font-weight: 400; }
.popular-card .yield-label, .watch-price-card .yield-label { color: #7d8591; font-size: 12px; line-height: 20px; }
.watch-price-card .watch-plan { margin-top: 18px; padding: 14px; background: #f7f8fa; border-radius: 8px; }
.watch-price-card .watch-trigger { grid-template-columns: minmax(0,1fr) minmax(0,1.25fr); gap: 16px; }
.watch-price-card .watch-trigger > div:first-child { gap: 6px; }
.watch-price-card .watch-trigger span, .watch-price-card .watch-annual-income span { color: #747d8a; font-size: 12px; line-height: 20px; }
.watch-price-card .watch-price-values strong { font-size: 20px; line-height: 28px; font-weight: 500; letter-spacing: -.25px; }
.watch-price-card .watch-price-context { gap: 5px; }
.watch-price-card .watch-price-context strong { font-size: 14px; line-height: 20px; font-weight: 500; }
.watch-price-card .watch-annual-income { margin-top: 14px; padding-top: 12px; border-color: #e8ebef; }
.watch-price-card .watch-annual-income > div { gap: 5px; }
.watch-price-card .watch-annual-income strong { font-size: 20px; line-height: 26px; font-weight: 500; }
.watch-price-card .watch-activity-line { margin: 12px 0 14px; color: #7d8591; font-size: 11px; gap: 5px; }
.watch-price-card .watch-live-icon { width: 14px; height: 14px; flex-basis: 14px; }
.popular-card .stock-return-summary { margin: 14px 0 10px; padding: 14px 0; background: #f7f8fa; border-radius: 8px; }
.popular-card .dividend-year-cell { gap: 6px; }
.popular-card .dividend-year-cell > span { color: #747d8a; font-size: 12px; line-height: 20px; }
.popular-card .stock-return-summary strong { font-size: 20px; line-height: 26px; font-weight: 500; }
.popular-card .stock-return-summary strong small, .watch-price-card .watch-annual-income small { font-size: 12px; font-weight: 400; margin-left: 3px; }
.watch-price-card .watch-plan-unset .watch-annual-income { margin-top: 0; padding-top: 0; border-top: 0; }

.popular-buy-amount { display: flex; align-items: center; gap: 4px; padding: 0; margin: 12px 0; color: var(--secondary-text); font-size: 12px; line-height: 24px; }
.popular-buy-amount .icon { width: 14px; height: 14px; }
.holding-heading > button { display: inline-flex; align-items: center; gap: 4px; padding: 0; }
.holding-heading > button .icon { width: 14px; height: 14px; color: var(--secondary-text); }

.sheet:has(.stock-detail-dividends)::before { margin-bottom: 8px; }
.stock-detail-head { position: sticky; top: -12px; z-index: 3; background: var(--surface); align-items: flex-start; gap: 12px; margin: 0 -16px 8px; padding: 12px 16px; }
.stock-detail-head .sheet-heading { flex: 1; min-width: 0; }
.stock-detail-head h3, .stock-detail-actions > button { font-size: 16px; }
.stock-detail-identity { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; }
.stock-detail-identity .stock-detail-meta { margin: 0; font-size: 12px; white-space: nowrap; }
.stock-detail-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.stock-detail-code { color: var(--secondary-text); font-size: 12px; font-weight: 400; }
.stock-detail-price { display: flex; align-items: baseline; gap: 6px; text-align: right; white-space: nowrap; }
.stock-detail-price > span { display: block; color: var(--secondary-text); font-size: 12px; line-height: 18px; }
.stock-detail-price > strong { display: block; font-size: 16px; font-weight: 500; line-height: 26px; font-variant-numeric: tabular-nums; }
.stock-detail-price small { margin-left: 3px; font-size: 12px; font-weight: 400; }

.stock-card-title .stock-detail-link { display: flex; align-items: center; gap: 4px; }
.stock-detail-link .icon { width: 14px; height: 14px; color: var(--secondary-text); }

.dividend-rule-head { align-items: flex-start; margin-bottom: 16px; }
.dividend-rule-head .sheet-heading { display: block; min-width: 0; }
.sheet:has(.dividend-rule-values) { height: 94%; max-height: 96%; display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
.sheet:has(.dividend-rule-values)::before, .dividend-rule-head { flex-shrink: 0; }
.dividend-rule-content { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: none; }
.dividend-rule-actions { flex-shrink: 0; display: flex; gap: 12px; padding: 14px 0 max(16px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--surface); }
.dividend-rule-actions > button { flex: 1; min-width: 0; min-height: 46px; }
.dividend-rule-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dividend-rule-tags > span { padding: 2px 7px; border-radius: 4px; background: #f4f5f6; color: #6b7280; font-size: 12px; line-height: 20px; }
.dividend-rule-values > .rule-price-section { display: block; padding: 14px 0 12px; }
.rule-price-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.dividend-rule-values [data-rule-range] { display: flex; gap: 12px; color: var(--secondary-text); font-size: 12px; font-weight: 400; }
[data-rule-range] strong { margin-left: 3px; color: var(--ink); font-size: 14px; font-weight: 500; }
.dividend-rule-values .rule-price-chart { margin: 12px 0 0; min-height: 170px; text-align: center; font-size: 13px; font-weight: 400; color: var(--secondary-text); }
.rule-price-chart svg { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.rule-chart-plot { position: relative; }
.rule-chart-tooltip { position: absolute; z-index: 1; padding: 6px 9px; border-radius: 6px; background: #27313d; color: #fff; font-size: 12px; line-height: 20px; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.rule-chart-tooltip strong { margin-left: 4px; color: #fff; font-size: 14px; font-weight: 600; }
.rule-chart-dates { display: flex; justify-content: space-between; font-size: 11px; line-height: 20px; color: #858c96; }
.dividend-rule-years::-webkit-scrollbar { display: none; }




.dividend-rule-values .rule-dates dt { flex-shrink: 0; white-space: nowrap; }
.dividend-rule-values .rule-dates dd { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 12px; min-width: 0; }
.dividend-rule-values .rule-dates dd > span { white-space: nowrap; }

.settings-menu .settings-row { align-items: center; }
.settings-switch { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; flex-shrink: 0; margin: 0; padding: 3px; border: 0; border-radius: 20px; background: #c9ced5; cursor: pointer; }
.settings-switch::before { content: ''; display: block; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px #0002; transition: transform .15s; }
.settings-switch:checked { background: var(--green); }
.settings-switch:checked::before { transform: translateX(18px); }

.popular-card .dividend-year-pair { grid-template-columns: repeat(3,minmax(0,1fr)); column-gap: 10px; padding: 0 8px; }
.popular-card .dividend-year-cell { padding: 0; align-items: center; text-align: center; }
.popular-card .stock-return-summary strong { font-size: 17px; white-space: nowrap; }
.popular-card .popular-price-range strong { font-size: 14px; }

.popular-card > .popular-year-dots { position: relative; width: 36px; height: 4px; padding: 0; margin: 14px auto 0; border-radius: 3px; background: #e6e8ec; overflow: hidden; }
.popular-year-dots::after { content: ''; position: absolute; top: 0; left: 0; width: 12px; height: 4px; border-radius: 3px; background: var(--green); transform: translateX(calc(var(--year-progress, 0) * 24px)); }

.popular-card .stock-card-head > .popular-add { width: auto; flex-shrink: 0; height: 32px; min-height: 32px; padding: 0 12px; border-radius: 16px; font-size: 12px; }
.popular-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.popular-card-footer .popular-buy-amount { margin: 0; }
.popular-card-footer .latest-dividend-yield { margin-left: auto; flex-direction: row-reverse; align-items: center; gap: 8px; min-height: 32px; }
.popular-card-footer .labeled-yield > strong { height: auto; font-size: 18px; line-height: 26px; }
.popular-card > .popular-year-dots { margin-top: 10px; }

.popular-card .stock-card-title .popular-inline-year { display: inline; margin: 0; font: inherit; color: inherit; white-space: nowrap; }
.popular-card .stock-card-title .popular-reason { display: block; margin-top: 5px; font-size: 12px; line-height: 19px; color: var(--secondary-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.popular-card .stock-card-head { align-items: flex-start; }
.popular-card .stock-card-title { min-width: 0; }

.popular-card .stock-card-title > span { display: block; min-width: 0; width: 100%; }
.stock-detail-recommendation { margin: 0 0 24px; }
.stock-detail-recommendation p { margin: 0; color: var(--ink); font-size: 16px; line-height: 26px; overflow-wrap: anywhere; }

.popular-card { touch-action: pan-y; user-select: none; cursor: grab; }
.popular-card .dividend-year-scroller { touch-action: pan-y; }

.popular-card .stock-card-title strong.stock-detail-link, .watch-price-card .stock-card-title strong.stock-detail-link { align-items: center; gap: 4px; }

.popular-card .stock-card-title .popular-tags { display: flex; align-items: center; gap: 4px; }
.popular-tags .popular-tag-divider { color: #c6cbd2; font-weight: 400; }

.phone:has(.hot-filter-toolbar) .app-header { padding-bottom: 0; }
main:has(.hot-filter-toolbar) { padding: 0 0 24px; }
main:has(.hot-filter-toolbar) .stock-stack, main:has(.hot-filter-toolbar) .quote-timestamp { margin-left: 16px; margin-right: 16px; }
.hot-filter-toolbar { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 16px; background: var(--surface); }
.hot-filters { display: flex; flex: 1; min-width: 0; gap: 8px; overflow-x: auto; scrollbar-width: none; touch-action: pan-x; }
.hot-filters::-webkit-scrollbar { display: none; }
.hot-filters button { flex: 0 0 auto; padding: 7px 13px; border-radius: 6px; background: #f3f4f6; color: var(--ink); font-size: 13px; line-height: 20px; white-space: nowrap; }
.hot-filters button.active { background: #fff0ee; color: var(--green); font-weight: 600; }
.hot-filter-more { flex: 0 0 32px; height: 34px; display: grid; place-items: center; background: var(--surface); color: var(--ink); }
.hot-filter-more svg { width: 22px; height: 22px; }
.hot-filter-toolbar.expanded .hot-filter-more { display: none; }
.hot-filter-toolbar.expanded { align-items: flex-start; padding-bottom: 16px; border-radius: 0 0 14px 14px; }
.hot-filter-toolbar.expanded .hot-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; overflow: visible; }
.hot-filter-toolbar.expanded .hot-filters button { min-width: 0; padding-left: 4px; padding-right: 4px; }
.hot-filter-shade { position: absolute; top: 100%; left: 0; right: 0; width: 100%; height: 100dvh; background: #1f232940; }
.hot-filter-shade[hidden] { display: none; }
.hot-filters button { min-width: 64px; }
.hot-filter-toolbar.expanded { flex-wrap: wrap; }
.hot-filter-advanced { display: none; }
.expanded .hot-filter-advanced { display: block; flex: 0 0 100%; padding-top: 16px; }
.hot-filter-section { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.hot-filter-section label { font-size: 14px; font-weight: 500; }
.hot-filter-section output { color: var(--green); font-size: 14px; }
.hot-filter-section input[type="range"] { grid-column: 1 / -1; width: 100%; margin: 4px 0 0; height: 28px; accent-color: var(--green); touch-action: pan-x; }
.hot-range-labels { grid-column: 1 / -1; display: flex; justify-content: space-between; color: var(--secondary-text); font-size: 12px; margin-top: -8px; }
.hot-filter-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.hot-filter-actions button { height: 42px; border-radius: 8px; font-size: 15px; }
.hot-filter-actions button:first-child { background: #f3f4f6; color: var(--ink); }
.hot-sort { flex: 0 0 64px; width: 64px; appearance: none; -webkit-appearance: none; text-align: center; border: 0; border-radius: 6px; padding: 7px 8px; background-color: #f3f4f6; color: var(--ink); font: inherit; font-size: 13px; line-height: 20px; }
.hot-sort.active { background-color: #fff0ee; color: var(--green); }
.hot-filter-toolbar.expanded .hot-sort { display: none; }

.buy-amount-description { font-size: 14px; line-height: 1.8; color: var(--ink); margin: 0 0 16px; }
.popular-buy-amount { background: transparent; }

.popular-yield-cell .latest-dividend-yield { flex-direction: column-reverse; align-items: center; gap: 6px; width: 100%; padding: 0; }
.popular-yield-cell .labeled-yield > strong { color: var(--up); height: auto; font-size: 17px; line-height: 26px; letter-spacing: 0; }
.popular-card-footer .popular-price-range { display: block; white-space: nowrap; color: var(--ink); font-size: 12px; line-height: 20px; min-height: 20px; padding: 0; }
.popular-card-footer .popular-price-range strong { font-size: 12px; font-weight: 400; }

.popular-current-price { white-space: nowrap; }
.popular-price-range .popular-current-price strong { font-weight: 600; }


.mine-member-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.mine-member-status { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #d8c6a8; }
.mine-membership-active { padding: 20px; }
.mine-membership-active h2 { margin: 22px 0 8px; font-size: 26px; line-height: 1.3; font-weight: 600; letter-spacing: 1px; }
.mine-member-validity { font-size: 12px; line-height: 20px; color: #c8c1b7; }
.mine-membership-active.is-lifetime { background: linear-gradient(115deg, #292625, #44392c); }

.mine-membership-active { background: radial-gradient(ellipse at 90% 90%, #6b53342b, transparent 65%), linear-gradient(115deg, #292625, #35302c); }
.mine-membership-active::before { display: none; }
.mine-membership-active .mine-member-emblem { position: absolute; z-index: 0; right: 18px; bottom: 8px; width: 132px; height: 132px; object-fit: contain; opacity: 1; pointer-events: none; }
.mine-membership-active.is-lifetime { background: radial-gradient(ellipse at 90% 85%, #a07a3c30, transparent 68%), linear-gradient(115deg, #292625, #3b3127); }
.mine-membership-active.is-lifetime .mine-member-emblem { opacity: 1; }
.mine-membership-active.is-lifetime {
  background: linear-gradient(118deg, #24211d 6%, #342b20 52%, #554128 100%);
  border-color: #d9b67a66;
  box-shadow: inset 0 1px 0 #f9dfaa33, inset 0 -1px 0 #100e0b40, 0 5px 14px #35281714;
}
.mine-membership-active.is-lifetime::before {
  display: block; inset: 0; width: auto; height: auto; border: 0; border-radius: inherit; transform: none; z-index: -1;
  background: linear-gradient(115deg, transparent 28%, #edcb8d0a 44%, #ffe6b512 49%, transparent 62%);
}
.mine-membership-active.is-lifetime::after { display: none; }



/* Account pages. */
.mine-account { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 16px; }
.account-selector { min-width: 0; min-height: 44px; text-align: left; padding: 0; }
.account-selector strong { display: flex; align-items: center; gap: 8px; font-size: 19px; line-height: 28px; font-weight: 600; overflow-wrap: anywhere; }
.account-selector .icon { width: 14px; height: 14px; transform: rotate(90deg); flex-shrink: 0; color: var(--secondary-text); }
.account-manage { flex-shrink: 0; min-height: 44px; padding: 0 0 0 12px; font-size: 14px; color: var(--secondary-text); }
main.account-screen { padding: 0; background: var(--surface); }
.account-page { padding: 8px 20px 32px; }
.account-list { margin: 0 -20px; }
.account-list-row { display: flex; align-items: center; gap: 12px; padding: 0 20px; }
.account-list-row + .account-list-row { border-top: 1px solid var(--line); }
.account-choice { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; min-height: 88px; padding: 16px 0; text-align: left; }
.account-choice-copy { display: flex; flex-direction: column; min-width: 0; gap: 5px; }
.account-choice-copy strong { font-size: 17px; line-height: 25px; font-weight: 500; overflow-wrap: anywhere; }
.account-choice-copy small { font-size: 13px; line-height: 20px; color: var(--secondary-text); }
.account-check { color: var(--green); margin-left: auto; font-size: 20px; padding-left: 8px; }
.account-edit-link { display: flex; align-items: center; gap: 4px; min-height: 44px; flex-shrink: 0; padding: 8px 0 8px 12px; font-size: 14px; color: var(--secondary-text); }
.account-edit-link .icon { width: 14px; height: 14px; }
.account-list-actions { border-top: 1px solid var(--line); margin-top: 20px; }
.account-list-actions > button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 12px 0; text-align: left; font-size: 16px; }
.account-list-actions > button > span { flex: 1; }
.account-list-actions > button > .icon { width: 19px; height: 19px; color: var(--secondary-text); }
.account-list-actions > button > .icon:last-child { width: 15px; height: 15px; }
.account-vip-badge { flex-shrink: 0; font-size: 10px; font-weight: 500; line-height: 18px; letter-spacing: .5px; color: #967345; background: #f7f2e9; padding: 0 5px; border-radius: 3px; }
.account-name-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 104px; border-bottom: 1px solid var(--line); padding: 12px 0 24px; }
.account-name-heading > div { min-width: 0; }
.account-name-heading > div > span, .account-rename-form > label, .account-name-form > label { display: block; font-size: 13px; line-height: 20px; color: var(--secondary-text); }
.account-name-heading h2 { font-size: 23px; line-height: 34px; font-weight: 600; margin-top: 8px; overflow-wrap: anywhere; }
.account-name-heading > button { min-height: 44px; padding: 8px 0 8px 12px; font-size: 14px; flex-shrink: 0; color: var(--secondary-text); }
.account-name-heading[hidden], .account-rename-form[hidden] { display: none; }
.account-rename-form { padding: 12px 0 24px; border-bottom: 1px solid var(--line); }
.account-rename-form > div { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.account-rename-form input { flex: 1; min-width: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; outline-color: var(--green); padding: 8px 0; background: var(--surface); color: var(--ink); font-size: 20px; line-height: 28px; }
.account-rename-form button { flex-shrink: 0; min-height: 44px; padding: 8px 0 8px 8px; color: var(--green); font-size: 15px; }
.account-members-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 24px 0 4px; }
.account-members-heading h2 { font-size: 16px; line-height: 24px; font-weight: 500; }
.account-members-heading h2 small { font-size: 13px; color: var(--secondary-text); font-weight: 400; margin-left: 6px; }
.account-members-heading > button { display: flex; align-items: center; gap: 5px; min-height: 44px; padding: 8px 0 8px 8px; font-size: 14px; color: var(--green); }
.account-members-heading .icon { width: 16px; height: 16px; }
.account-member-row { display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 16px 0; }
.account-member-row + .account-member-row { border-top: 1px solid var(--line); }
.member-avatar { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; background: var(--background); color: var(--secondary-text); font-size: 16px; }
.account-member-row strong { min-width: 0; font-size: 16px; font-weight: 400; overflow-wrap: anywhere; }
.account-member-row > span:last-child { margin-left: auto; color: var(--secondary-text); font-size: 13px; flex-shrink: 0; }
.account-name-form { padding-top: 24px; }
.account-name-form > input { display: block; width: 100%; min-width: 0; height: 52px; margin: 8px 0 28px; padding: 10px 0; font-size: 18px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--ink); outline-color: var(--green); }
.account-name-form > input::placeholder { font-size: 15px; }
.account-invitation { text-align: center; padding: 48px 0 40px; }
.account-invitation-icon { display: flex; align-items: center; justify-content: center; margin: 0 auto 24px; width: 60px; height: 60px; border-radius: 50%; color: var(--secondary-text); background: var(--background); }
.account-invitation-icon .icon { width: 28px; height: 28px; }
.account-invitation h2, .account-join-heading h2 { font-size: 23px; line-height: 34px; font-weight: 600; overflow-wrap: anywhere; }
.account-invitation p, .account-join-heading p { margin: 10px 0 0; font-size: 13px; line-height: 22px; color: var(--secondary-text); }
.account-invite-code { display: flex; flex-direction: column; gap: 12px; margin-top: 40px; }
.account-invite-code > span { font-size: 13px; line-height: 20px; color: var(--secondary-text); }
.account-invite-code > strong { font-size: 30px; line-height: 40px; letter-spacing: 4px; font-weight: 500; font-variant-numeric: tabular-nums; }
.account-text-button { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 44px; margin-top: 16px; padding: 8px 0; color: var(--secondary-text); font-size: 14px; }
.account-text-button .icon { width: 14px; height: 14px; }
.account-join-heading { padding: 32px 0 8px; }
.account-join-heading > span { display: block; color: var(--secondary-text); font-size: 13px; margin-bottom: 12px; }
.account-page-message { padding-top: 32px; font-size: 15px; line-height: 24px; color: var(--secondary-text); }
.account-vip-gate { padding-top: 48px; }
.account-vip-label { display: inline-block; font-size: 13px; color: #967345; letter-spacing: 1px; margin-bottom: 20px; }
.account-vip-gate h2 { font-size: 24px; line-height: 36px; font-weight: 600; }
.account-vip-gate > p { margin-top: 10px; font-size: 14px; line-height: 24px; color: var(--secondary-text); }
.account-vip-gate ul { padding: 0; margin: 32px 0; list-style: none; font-size: 15px; line-height: 28px; }
.account-vip-gate li + li { margin-top: 12px; }
.account-neutral-button { width: 100%; min-height: 44px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); font-size: 15px; }

/* Account detail navigation and membership purchase. */
.mine-account { margin-bottom: 16px; }
.account-selector { width: 100%; }
.account-selector strong { justify-content: space-between; }
.account-selector .icon { transform: none; }
#account-nav-switch { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 240px; min-height: 40px; padding: 0; color: var(--ink); font-size: 17px; font-weight: 600; text-align: left; }
#account-nav-switch .icon { width: 14px; height: 14px; flex-shrink: 0; transform: rotate(90deg); }
#account-nav-switch[aria-expanded="true"] .icon { transform: rotate(-90deg); }
#account-nav-switch[hidden], #account-menu[hidden], #account-menu-scrim[hidden] { display: none; }
#account-menu-scrim { position: absolute; z-index: 14; inset: 99px 0 0; width: 100%; background: #1f232930; padding: 0; }
#account-menu { position: absolute; z-index: 15; top: 99px; left: 0; right: 0; max-height: 55%; overflow-y: auto; padding: 8px 20px; background: var(--surface); box-shadow: 0 10px 20px #1f23290d; border-radius: 0 0 14px 14px; }
#account-menu > button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 54px; padding: 12px 0; text-align: left; font-size: 16px; line-height: 24px; }
#account-menu > button > span:first-child { overflow-wrap: anywhere; }
#account-menu #nav-create-account { justify-content: flex-start; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 16px; color: var(--secondary-text); }
#nav-create-account .icon { width: 18px; height: 18px; }
.account-name-heading { width: 100%; min-height: 68px; padding: 16px 0; gap: 12px; font-size: 15px; text-align: left; }
.account-name-heading > span { flex-shrink: 0; }
.account-name-heading > strong { min-width: 0; margin-left: auto; font-size: 15px; line-height: 24px; font-weight: 400; text-align: right; overflow-wrap: anywhere; }
.account-name-heading > .icon { width: 14px; height: 14px; color: var(--secondary-text); flex-shrink: 0; }
main.account-screen:has(.vip-purchase-page) { background: #fcfbf8; }
.vip-purchase-page { display: flex; flex-direction: column; padding: 24px 20px 100px; }
.vip-wordmark { display: flex; align-items: center; gap: 8px; color: #8e6e42; font-size: 15px; letter-spacing: 1px; }
.vip-wordmark .icon { width: 24px; height: 24px; }
.vip-purchase-intro h2 { margin-top: 0; color: #302b25; font-size: 22px; line-height: 32px; font-weight: 600; }
.vip-purchase-intro p { margin-top: 6px; color: var(--secondary-text); font-size: 13px; line-height: 20px; }
.vip-plan-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 28px; }
.vip-plan { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-width: 0; min-height: 184px; padding: 22px 16px 18px; border: 1px solid #e5e1da; border-radius: 12px; background: #fff; color: #302b25; text-align: left; }
.vip-plan[aria-pressed="true"] { border-color: #b18b52; background: #faf2e4; box-shadow: inset 0 0 0 1px #b18b52; }
.vip-plan > strong { font-size: 17px; line-height: 24px; font-weight: 500; }
.vip-price { display: flex; align-items: baseline; gap: 3px; margin-top: 18px; font-size: 36px; line-height: 42px; font-weight: 600; font-variant-numeric: tabular-nums; }
.vip-price > small { font-size: 17px; font-weight: 500; }
.vip-price > span { margin-left: 2px; color: var(--secondary-text); font-size: 12px; font-weight: 400; }
.vip-original { margin-top: 4px; color: #8b8274; font-size: 12px; line-height: 18px; }
.vip-plan-duration { margin-top: auto; padding-top: 14px; color: #7b7060; font-size: 12px; line-height: 18px; }
.vip-limited { position: absolute; top: -11px; right: 12px; padding: 3px 8px; border-radius: 5px; color: #fff; background: #9c7742; font-size: 11px; line-height: 16px; font-weight: 400; white-space: nowrap; }
.vip-benefits { margin: 28px 0 0; }
.vip-benefits h3 { margin-bottom: 12px; color: #302b25; font-size: 15px; line-height: 22px; font-weight: 500; }
.vip-benefits > div { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.vip-benefits > div > .icon { width: 22px; height: 22px; color: #957447; flex-shrink: 0; }
.vip-benefits > div > span { display: flex; flex-direction: column; gap: 4px; }
.vip-benefits strong { color: #423b32; font-size: 15px; line-height: 22px; font-weight: 400; }
.vip-benefits small { color: var(--secondary-text); font-size: 12px; line-height: 20px; }
.vip-purchase-bottom { position: absolute; z-index: 8; left: 0; right: 0; bottom: max(26px, env(safe-area-inset-bottom)); padding: 16px 20px; background: #fcfbf8; }
#vip-buy { width: 100%; min-height: 48px; padding: 12px 16px; border-radius: 9px; background: #e8c58e; color: #342a1f; font-size: 16px; line-height: 24px; font-weight: 500; }
#vip-buy:active { background: #dcba83; }
.vip-order-summary { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.vip-order-summary > strong { font-size: 18px; font-weight: 500; }
.vip-order-summary > span { color: var(--secondary-text); font-size: 14px; }
.vip-order-summary > div { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 12px; font-size: 14px; }
.vip-order-summary > div > strong { font-size: 26px; font-weight: 500; }

#account-nav-switch > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mine-summary .mine-account { margin: -4px 0 12px; }
.mine-summary .account-selector strong { font-size: 16px; line-height: 24px; font-weight: 500; }

/* Account details: a single, compact settings group. */
main.account-screen:has(.account-detail-page) { background: var(--background); }
.account-detail-page { padding: 16px; }
.account-detail-group { overflow: hidden; border-radius: 12px; background: var(--surface); }
.account-detail-group .account-name-heading { min-height: 64px; width: calc(100% - 32px); margin: 0 16px; padding: 18px 0; gap: 8px; border-bottom: 1px solid var(--line); font-size: 15px; }
.account-detail-group .account-name-heading > strong { font-size: 15px; color: var(--secondary-text); }
.account-detail-group .account-name-heading > .icon { width: 14px; height: 14px; }
.account-detail-group .account-members-heading { margin: 0; padding: 20px 16px 4px; }
.account-detail-group .account-members-heading h2 { font-size: 13px; line-height: 20px; font-weight: 400; color: var(--secondary-text); }
.account-detail-group .account-members-heading > span { color: var(--secondary-text); font-size: 13px; line-height: 20px; }
.account-detail-group .account-member-list { padding: 0 16px; }
.account-detail-group .account-member-row { min-height: 68px; padding: 14px 0; gap: 12px; }
.account-detail-group .account-member-row strong { font-size: 16px; font-weight: 500; }
.account-detail-group .member-avatar { width: 36px; height: 36px; border-radius: 50%; }
.account-detail-group .member-avatar .icon { width: 20px; height: 20px; }
.account-invite-entry { display: flex; align-items: center; gap: 12px; width: calc(100% - 32px); margin: 0 16px; padding: 14px 0; min-height: 64px; border-top: 1px solid var(--line); color: var(--green); font-size: 15px; line-height: 24px; text-align: left; }
.account-invite-plus { display: flex; align-items: center; justify-content: center; width: 36px; flex-shrink: 0; }
.account-invite-plus .icon { width: 22px; height: 22px; }
.account-invite-entry > .icon { margin-left: auto; width: 14px; height: 14px; color: var(--secondary-text); }
.account-detail-group .account-rename-form { margin: 0 16px; padding: 16px 0; }
.account-detail-group .account-rename-form input { font-size: 16px; }
.account-detail-group .account-rename-form input { outline: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.account-detail-group .account-rename-form input:focus { border-bottom-color: var(--ink); }

/* Separate account naming from member management. */
.account-detail-page { padding-bottom: 112px; }
.account-detail-group .account-name-heading { border-bottom: 0; }
.account-members-section { margin-top: 28px; }
.account-members-section .account-members-heading { margin: 0; padding: 0 4px 12px; }
.account-members-section .account-members-heading h2 { font-size: 15px; line-height: 22px; font-weight: 500; color: var(--ink); }
.account-members-section .account-members-heading > span { color: var(--secondary-text); font-size: 13px; line-height: 22px; }
.account-members-section .account-member-list { padding: 0 16px; background: var(--surface); border-radius: 12px; }
.account-members-section .account-member-row { min-height: 76px; gap: 12px; }
.account-members-section .account-member-row strong { font-size: 16px; font-weight: 500; }
.account-members-section .member-avatar .icon { width: 20px; height: 20px; }
.account-member-row .member-role { margin-left: auto; flex-shrink: 0; font-size: 13px; color: var(--secondary-text); }
#account-invite-dock { position: absolute; z-index: 8; left: 0; right: 0; bottom: max(26px, env(safe-area-inset-bottom)); padding: 16px; background: linear-gradient(to bottom, #f6f7f800, var(--background) 18px); }
#account-invite-dock[hidden] { display: none; }
#account-invite-dock .primary { min-height: 48px; border-radius: 10px; font-size: 16px; box-shadow: 0 4px 12px #e9303017; }
.member-remove-message { font-size: 15px; line-height: 26px; color: var(--secondary-text); margin-bottom: 24px; }
.member-remove-message strong { color: var(--ink); font-weight: 500; margin: 0 4px; }
.member-remove-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.member-remove-actions > button { min-height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 15px; }
#confirm-remove-member { color: var(--surface); background: var(--green); border-color: var(--green); }

.member-delete { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; margin: 0 -8px 0 auto; padding: 12px; color: var(--muted); }
.member-delete .icon { width: 18px; height: 18px; stroke-width: 1.6; }
.member-delete:active { color: var(--secondary-text); }
.account-detail-group .account-name-heading > .icon { width: 17px; height: 17px; }

.vip-benefit-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; line-height: 22px; }
.vip-benefit-table th, .vip-benefit-table td { padding: 12px 4px; text-align: center; border-bottom: 1px solid #ebe7df; font-weight: 400; }
.vip-benefit-table th:first-child { width: 42%; text-align: left; padding-left: 0; color: #423b32; }
.vip-benefit-table thead th { padding-top: 4px; padding-bottom: 10px; font-size: 12px; color: #858078; }
.vip-benefit-table td:nth-child(2) { color: #858078; }
.vip-benefit-table td:last-child, .vip-benefit-table thead th:last-child { color: #8b6839; background: #f7f0e4; }
.vip-benefit-table td:last-child { font-weight: 600; }
.vip-benefit-table tbody tr:last-child th, .vip-benefit-table tbody tr:last-child td { border-bottom: 0; }
.vip-expiry-note { margin: 14px 0 0; font-size: 12px; line-height: 20px; color: #858078; }

/* Usage guide: steps first, definitions on demand. */
.guide-overview { margin-bottom: 28px; }
.guide-overview h2 { font-size: 21px; line-height: 31px; font-weight: 600; margin-bottom: 10px; }
.guide-overview p { font-size: 15px; line-height: 26px; color: var(--secondary-text); }
.guide-sections p { font-size: 15px; line-height: 28px; }
.guide-term { display: inline; padding: 0 1px; color: var(--green); font: inherit; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 4px; }
.guide-footnote { border-top: 1px solid var(--line); padding-top: 18px; font-size: 13px; line-height: 23px; color: var(--secondary-text); }
.guide-concept-body { font-size: 16px; line-height: 29px; padding: 4px 0 16px; }
.guide-concept-example { margin-top: 18px; color: var(--secondary-text); }

.guide-chapter + .guide-chapter { margin-top: 32px; }
.guide-chapter > h2 { margin: 0 0 10px; font-size: 18px; line-height: 28px; font-weight: 600; }
.guide-entry { border-bottom: 1px solid var(--line); }
.guide-entry > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; list-style: none; cursor: pointer; font-size: 16px; line-height: 25px; }
.guide-entry > summary::-webkit-details-marker { display: none; }
.guide-entry > summary .icon { flex: 0 0 16px; width: 16px; height: 16px; color: var(--secondary-text); transform: rotate(90deg); }
.guide-entry[open] > summary .icon { transform: rotate(-90deg); }
.guide-entry-content { padding: 0 0 20px; font-size: 15px; line-height: 28px; color: var(--secondary-text); }

.guide-entry-title { display: flex; align-items: baseline; gap: 10px; }
.guide-step-number { flex: 0 0 18px; font-variant-numeric: tabular-nums; color: var(--secondary-text); }
.guide-glossary-example { margin-top: 12px; }

/* Pull-to-refresh inside the prototype phone, below its navigation bar. */
#main { overscroll-behavior-y: contain; }
#main > .screen-enter { translate: 0 var(--pull-distance, 0px); }
.pull-refresh { position: absolute; z-index: 4; top: var(--pull-top, 0px); left: 0; right: 0; height: var(--pull-distance, 0px); display: flex; align-items: center; justify-content: center; gap: 8px; overflow: hidden; color: var(--muted); font-size: 12px; pointer-events: none; }
.pull-refresh[hidden] { display: none; }
.pull-refresh.is-refreshing::before { content: ''; width: 12px; height: 12px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: pull-refresh-spin .7s linear infinite; }
@keyframes pull-refresh-spin { to { rotate: 360deg; } }
