:root {
  color-scheme: light;
  --canvas: #f4f5f9;
  --ink: #192138;
  --muted: #5b647a;
  --line: #e6e8f0;
  --blue: #4138a2;
  --navy: #222046;
  --white: #fff;
  --green: #176247;
  --warn: #8a461f;
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
.shell { width: min(100%, 35rem); padding-inline: 16px; margin-inline: auto; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding-top: env(safe-area-inset-top); }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 750; text-decoration: none; color: var(--ink); }
.mark { width: 28px; height: 28px; display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding: 7px; background: var(--navy); border-radius: 8px; }
.mark i { width: 3px; border-radius: 2px; background: #e9e1ff; height: 5px; }
.mark i:nth-child(2) { height: 9px; }
.mark i:nth-child(3) { height: 13px; }
.settings-link { min-height: 44px; display: inline-flex; align-items: center; gap: 5px; text-decoration: none; font-size: 13px; font-weight: 650; color: var(--blue); }
h1, h2, p { margin: 0; }
.intro { margin-top: 4px; }
h1 { font-size: clamp(30px, 7.4vw, 38px); letter-spacing: -.055em; line-height: 1.2; }
.intro p, .quick-rule { margin-top: 6px; color: var(--muted); font-size: 12px; }
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); gap: 5px; margin: 15px 0 11px; padding: 4px; border: 1px solid #e3e5ef; background: #e9eaf3; border-radius: 13px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { color: #71798b; cursor: default; }
:focus-visible { outline: 2px solid #5f4ced; outline-offset: 2px; }
.tabs button { border: 0; min-height: 46px; background: transparent; border-radius: 9px; display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 2px 7px; padding: 10px 5px; color: #454c64; }
.tabs button[aria-selected="true"] { color: var(--blue); background: var(--white); box-shadow: 0 1px 5px #2724511a; }
.tabs strong { font-size: 15px; }
.tabs small { font-size: 11px; white-space: nowrap; }
.quote { border-radius: 15px; padding: 13px 15px 11px; background: linear-gradient(113deg,#262246,#403572); color: #fff; }
.quote-top { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.quote-top div:nth-child(2) { padding-left: 12px; border-left: 1px solid #ffffff30; }
.quote-top span { display: block; font-size: 11px; color: #e0ddf0; }
.quote-top strong { display: block; font-size: clamp(22px,6.5vw,33px); font-weight: 760; letter-spacing: -.045em; overflow-wrap: anywhere; }
.quote-bottom { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-top: 8px; padding-top: 7px; border-top: 1px solid #ffffff26; font-size: 11px; color: #e0ddf0; }
.quote-bottom strong { white-space: nowrap; }
strong, td { font-variant-numeric: tabular-nums; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.prices { margin-top: 11px; overflow: hidden; }
.table-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 13px 5px; gap: 8px; }
.table-head h2 { font-size: 16px; }
.table-head > span { font-size: 11px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
thead th { color: var(--muted); font-size: 12px; text-align: right; font-weight: 650; padding: 5px 13px 7px 4px; }
thead th:first-child { text-align: left; padding-left: 13px; width: 26%; }
thead th span { font-size: 12px; }
tbody th, tbody td { border-top: 1px solid #edf0f5; }
tbody th { text-align: left; padding: 0; }
tbody th button { width: 100%; min-height: 46px; padding: 5px 0 5px 13px; text-align: left; border: 0; background: transparent; }
tbody th button:focus-visible { outline-offset: -2px; }
tbody th strong { font-size: 14px; }
tbody th small { display: block; font-size: 10px; color: var(--muted); font-weight: 650; line-height: 1.25; }
tbody td { text-align: right; padding: 4px 13px 4px 2px; font-size: clamp(16px,4.7vw,22px); font-weight: 740; line-height: 1.13; letter-spacing: -.04em; overflow-wrap: anywhere; }
tbody .buy { color: var(--blue); }
tbody .sell { color: var(--green); }
.reached { background: #f0efff; }
.reached th small { color: #483ca7; }
.at-sell { background: #eef9f2; }
.at-sell th small { color: var(--green); }
.due { background: #fff3e9; }
.due th small { color: var(--warn); }
.table-note { border-top: 1px solid #edf0f5; padding: 8px 13px; color: var(--muted); font-size: 11px; }
.quick-rule { padding-inline: 2px; margin: 9px 0 15px; }
.banner { margin-top: 9px; padding: 9px 12px; color: #8b3425; background: #fff0ea; border-radius: 8px; font-size: 13px; font-weight: 700; }
.disclosure { margin-top: 8px; scroll-margin-top: 12px; }
summary { display: flex; min-height: 55px; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 13px; list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--blue); font-size: 18px; }
details[open] summary::after { content: "−"; }
summary strong, summary small { display: block; }
summary strong { font-size: 14px; }
summary small { font-size: 11px; color: var(--muted); }
.detail-content { border-top: 1px solid var(--line); padding: 12px 13px 15px; }
.detail-content p, .dialog-inner p { color: var(--muted); font-size: 13px; }
.detail-content p + p { margin-top: 8px; }
.field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-block: 11px; }
label { display: block; min-width: 0; font-size: 12px; font-weight: 650; }
input:not([type="checkbox"]), select { display: block; width: 100%; min-width: 0; min-height: 44px; border: 1px solid #dfe2ed; background: #f8f9fc; border-radius: 8px; padding: 7px 8px; margin-top: 4px; font-size: 16px; }
input[type="date"] { appearance: none; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--blue); }
.funding-result { display: grid; align-content: end; justify-items: start; border-radius: 8px; padding: 5px 9px; background: #eeedff; color: var(--blue); font-size: 12px; }
.funding-result strong { font-size: 19px; overflow-wrap: anywhere; }
#reference-form { display: grid; align-items: end; grid-template-columns: minmax(0,1fr) auto; gap: 8px; margin-top: 10px; }
.primary, .text-button { min-height: 44px; border: 0; border-radius: 8px; padding: 7px 11px; font-size: 13px; font-weight: 700; }
.primary { background: var(--navy); color: var(--white); }
.text-button { background: transparent; color: var(--blue); }
.settings-actions, .sources { display: flex; flex-wrap: wrap; gap: 3px 9px; }
.sources a { color: var(--blue); }
footer { display: flex; justify-content: space-between; gap: 7px; padding: 14px 0 calc(17px + env(safe-area-inset-bottom)); font-size: 11px; color: var(--muted); }
dialog { width: min(calc(100% - 28px), 28rem); padding: 0; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); box-shadow: 0 18px 50px #17163036; }
dialog::backdrop { background: #1e1b3a65; }
.dialog-inner { padding: 14px; }
.dialog-head, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dialog-head h2 { font-size: 19px; }
.icon-button { border: 0; border-radius: 8px; width: 44px; height: 44px; background: #f0eff7; font-size: 26px; line-height: 1; }
#dialog-error { margin-top: 5px; color: #8b3425; }
.dialog-actions { justify-content: end; }
@media (min-width: 600px) {
  .masthead { min-height: 72px; }
  .prices td { padding-right: 17px; }
  .table-head { padding-top: 12px; }
}
@media (max-width: 350px) {
  .shell { padding-inline: 12px; }
  thead th, tbody td { padding-right: 9px; }
  tbody th button, thead th:first-child { padding-left: 9px; }
}
tbody td small { display: block; color: var(--muted); font-size: 10px; letter-spacing: 0; }
.plan-note { display: block; margin-top: 3px; color: var(--blue); }
.table-note p + p { margin-top: 3px; }
tbody td .tier-allocation { margin-top: 3px; font-size: 11px; font-weight: 650; }

.sale-target { display: block; }
.sale-target + .sale-target { margin-top: 5px; padding-top: 5px; border-top: 1px solid #e7eaf2; }
.sale-target.is-sold, .hold-label { color: var(--muted); }
.sale-target.is-sold .limit { text-decoration: line-through; text-decoration-thickness: 1px; }
.hold-label { font-size: 14px; letter-spacing: 0; }
.exit-preview { display: flex; flex-wrap: wrap; gap: 8px 15px; padding: 8px 10px; margin-top: 8px; border-radius: 8px; background: #eff8f3; color: var(--green); font-size: 13px; }
.exit-preview small { display: block; font-size: 11px; }
.exit-preview strong { font-size: 17px; }
.trade-exit { margin: 9px 0; }
.sell .cash-kept { margin-top: 3px; }

.table-note a { color: var(--blue); }
tbody td .share-count { margin-top: 2px; font-weight: 700; color: var(--blue); }
