:root {
  --paper: #f5f1e8;
  --paper-deep: #ebe4d7;
  --card: rgba(255, 253, 248, 0.88);
  --ink: #17201d;
  --muted: #68716c;
  --line: rgba(36, 52, 46, 0.12);
  --forest: #173f35;
  --forest-soft: #dce8e1;
  --gold: #c69b51;
  --up: #c34f39;
  --up-soft: #f7ddd7;
  --down: #23745a;
  --down-soft: #dcece5;
  --flat: #8b7350;
  --shadow: 0 18px 45px rgba(47, 52, 43, 0.08);
  --radius: 20px;
  --sidebar: 244px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 76% 4%, rgba(199, 162, 95, 0.13), transparent 26rem),
    var(--paper);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
[hidden] { display: none !important; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar);
  padding: 28px 20px 20px;
  flex-direction: column;
  color: #f5f1e8;
  background:
    linear-gradient(155deg, rgba(255,255,255,.05), transparent 30%),
    var(--forest);
  box-shadow: 12px 0 40px rgba(20, 44, 37, .08);
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(255,255,255,.22); border-radius: 13px; color: #e9c782; background: rgba(255,255,255,.06); }
.brand-mark svg { width: 28px; height: 28px; stroke-width: 2; }
.brand strong { display: block; font-family: "STSong", "Songti SC", serif; font-size: 23px; letter-spacing: .14em; }
.brand small { display: block; margin-top: 2px; color: rgba(255,255,255,.55); font-size: 10px; letter-spacing: .08em; }

.primary-nav { display: grid; gap: 8px; }
.nav-item { position: relative; display: flex; height: 46px; padding: 0 13px; align-items: center; gap: 12px; border-radius: 12px; color: rgba(255,255,255,.65); font-size: 14px; transition: .2s ease; }
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.active { color: #fff; background: rgba(255,255,255,.11); box-shadow: inset 3px 0 #e8c883; }
.nav-badge { margin-left: auto; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 99px; color: var(--forest); background: #e8c883; font-size: 11px; font-weight: 700; line-height: 21px; text-align: center; }
.sidebar-spacer { flex: 1; min-height: 28px; }
.service-card { padding: 15px; border: 1px solid rgba(255,255,255,.11); border-radius: 14px; background: rgba(255,255,255,.055); }
.status-row { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 650; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #85d5a7; box-shadow: 0 0 0 5px rgba(133,213,167,.11); }
.service-card dl { display: grid; gap: 8px; margin: 14px 0 0; }
.service-card dl div { display: flex; justify-content: space-between; }
.service-card dt, .service-card dd { margin: 0; color: rgba(255,255,255,.55); font-size: 11px; }
.service-card dd { color: rgba(255,255,255,.9); font-variant-numeric: tabular-nums; }
.sidebar-note { margin: 15px 4px 0; color: rgba(255,255,255,.38); font-size: 9px; text-align: center; }

.main-content { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; height: 76px; padding: 0 38px; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(36,52,46,.08); background: rgba(245,241,232,.82); backdrop-filter: blur(16px); }
.date-block span { display: block; font-size: 14px; font-weight: 650; }
.date-block small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.provider-pill { display: flex; height: 34px; padding: 0 12px; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: rgba(255,255,255,.4); font-size: 11px; }
.provider-pill span { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.provider-pill b { color: var(--ink); font-weight: 700; text-transform: uppercase; }
.icon-button { display: inline-grid; width: 38px; height: 38px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.5); cursor: pointer; transition: .2s ease; }
.icon-button:hover { border-color: rgba(23,63,53,.25); background: #fff; transform: translateY(-1px); }
.icon-button svg { width: 18px; height: 18px; }
.menu-button { display: none; }

.content-wrap { max-width: 1480px; margin: 0 auto; padding: 42px 38px 30px; }
.risk-banner { display: flex; margin: -10px 0 28px; padding: 16px 18px; align-items: center; gap: 14px; border: 1px solid rgba(165,61,43,.25); border-radius: 16px; color: #70372d; background: linear-gradient(110deg, rgba(255,240,235,.96), rgba(255,250,241,.88)); box-shadow: 0 10px 26px rgba(133,55,42,.07); }
.risk-banner-icon { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: #a94b3b; font-family: Georgia, serif; font-size: 19px; font-weight: 700; }
.risk-banner strong { display: block; font-size: 13px; }
.risk-banner p { margin: 4px 0 0; color: #81564e; font-size: 10px; line-height: 1.65; }
.hero { display: flex; padding: 4px 3px 28px; align-items: flex-end; justify-content: space-between; gap: 30px; }
.eyebrow { margin: 0 0 9px; color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.hero h1 { margin: 0; font-family: "STSong", "Songti SC", serif; font-size: clamp(30px, 3vw, 44px); font-weight: 700; letter-spacing: -.03em; }
.hero h1 .hero-signal { color: var(--forest); border-bottom: 5px solid rgba(198,155,81,.35); }
.hero-copy { max-width: 650px; margin: 13px 0 0; color: var(--muted); font-size: 13px; line-height: 1.75; }

.button { display: inline-flex; min-height: 40px; padding: 0 17px; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 11px; font-size: 12px; font-weight: 700; cursor: pointer; transition: .2s ease; }
.button svg { width: 17px; height: 17px; }
.button-primary { color: #fff; border-color: var(--forest); background: var(--forest); box-shadow: 0 8px 18px rgba(23,63,53,.16); }
.button-primary:hover { background: #215447; transform: translateY(-1px); }
.button-ghost { border-color: var(--line); background: rgba(255,255,255,.48); }
.button-ghost:hover { border-color: rgba(23,63,53,.25); background: #fff; }
.button-small { min-height: 34px; padding: 0 12px; font-size: 11px; }
.button:disabled { opacity: .58; cursor: wait; transform: none; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric-card { position: relative; min-height: 139px; padding: 19px 20px; overflow: hidden; border: 1px solid rgba(35,51,45,.09); border-radius: 17px; background: var(--card); box-shadow: 0 9px 25px rgba(47,52,43,.045); }
.metric-card::after { position: absolute; right: -25px; bottom: -45px; width: 110px; height: 110px; border: 1px solid rgba(198,155,81,.12); border-radius: 50%; content: ""; }
.metric-accent { color: #f8f4eb; border-color: transparent; background: linear-gradient(135deg, #173f35 0%, #245448 100%); }
.metric-accent::after { border-color: rgba(232,200,131,.2); }
.metric-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.metric-accent .metric-head, .metric-accent small { color: rgba(255,255,255,.62); }
.metric-icon { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 9px; color: var(--forest); background: var(--forest-soft); }
.metric-accent .metric-icon { color: #efd391; background: rgba(255,255,255,.09); }
.metric-icon svg { width: 15px; height: 15px; }
.metric-card strong { display: block; margin-top: 11px; font-family: Georgia, "Times New Roman", serif; font-size: 31px; font-weight: 600; line-height: 1; }
.metric-card small { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; }

.panel { padding: 24px; border: 1px solid rgba(35,51,45,.09); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); scroll-margin-top: 92px; }
.panel-header { display: flex; margin-bottom: 18px; align-items: flex-end; justify-content: space-between; gap: 20px; }
.panel-header.compact { align-items: center; }
.panel-header h2, .modal-header h2 { margin: 0; font-family: "STSong", "Songti SC", serif; font-size: 21px; }
.panel-header > div > p:last-child:not(.eyebrow) { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend-range { display: inline-block; width: 18px; height: 7px; border-radius: 9px; background: var(--forest-soft); }
.legend-point { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--forest); box-shadow: 0 0 0 3px rgba(23,63,53,.13); }
.etf-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.etf-search { display: flex; height: 32px; padding: 0 10px; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.55); font-size: 9px; }
.etf-search input { width: 105px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 10px; }
.etf-tabs { display: flex; width: fit-content; margin: 2px 0 14px; padding: 3px; gap: 3px; border: 1px solid var(--line); border-radius: 12px; background: rgba(236,239,235,.72); }
.etf-tab { min-width: 104px; padding: 8px 13px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; transition: color .18s ease, background .18s ease, box-shadow .18s ease; }
.etf-tab span { display: inline-flex; min-width: 20px; margin-left: 5px; padding: 2px 5px; justify-content: center; border-radius: 99px; background: rgba(23,63,53,.08); font-size: 9px; font-variant-numeric: tabular-nums; }
.etf-tab:hover { color: var(--forest); }
.etf-tab.active { color: var(--forest); background: #fff; box-shadow: 0 2px 8px rgba(35,51,45,.09); font-weight: 700; }
.etf-tab:focus-visible { outline: 2px solid rgba(23,63,53,.35); outline-offset: 2px; }

.etf-list { min-height: 140px; }
.etf-row { display: grid; grid-template-columns: minmax(170px, 1.2fr) 105px 110px minmax(190px, 1.5fr) 95px 112px; gap: 15px; padding: 17px 8px; align-items: center; border-top: 1px solid var(--line); animation: reveal .38s ease both; }
.etf-row:first-child { border-top: 0; }
.etf-row { border-radius: 12px; transition: background .2s ease, transform .2s ease; }
.etf-row:hover { background: rgba(220,232,225,.42); transform: translateX(2px); }
.etf-row:focus-visible { outline: 2px solid rgba(23,63,53,.38); outline-offset: 2px; }
.asset-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.asset-avatar { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: var(--forest); background: var(--forest-soft); font-family: Georgia, serif; font-size: 12px; font-weight: 800; }
.asset-name strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.asset-name small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.asset-name .valuation-meta { margin-top: 2px; color: #678077; font-size: 8px; }
.trend-value strong { display: block; font-family: Georgia, serif; font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.trend-value small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.forecast-value strong { display: block; font-family: Georgia, serif; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.forecast-value small, .valuation-cell small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.35; }
.valuation-cell span { display: block; font-family: Georgia, serif; font-size: 15px; font-variant-numeric: tabular-nums; }
.premium-comparison span { display: block; font-family: Georgia, serif; font-size: 16px; font-variant-numeric: tabular-nums; }
.premium-comparison small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }
.premium-comparison em { display: block; margin-top: 4px; color: #7b817d; font-size: 8px; font-style: normal; font-variant-numeric: tabular-nums; }
.is-up { color: var(--up); }
.is-down { color: var(--down); }
.is-flat { color: var(--flat); }
.range-chart { position: relative; height: 38px; }
.range-track { position: absolute; top: 17px; right: 0; left: 0; height: 3px; border-radius: 3px; background: #e6e2d9; }
.range-zero { position: absolute; top: 9px; bottom: 8px; left: 50%; width: 1px; background: rgba(23,32,29,.22); }
.range-band { position: absolute; top: 13px; height: 11px; border-radius: 8px; background: var(--forest-soft); }
.range-dot { position: absolute; top: 14px; width: 9px; height: 9px; margin-left: -4px; border: 2px solid #fff; border-radius: 50%; background: var(--forest); box-shadow: 0 0 0 2px rgba(23,63,53,.18); }
.range-min, .range-max { position: absolute; bottom: -1px; color: var(--muted); font-family: Georgia, serif; font-size: 9px; }
.range-min { left: 0; }.range-max { right: 0; }
.range-empty { display: block; padding-top: 12px; color: var(--muted); font-size: 9px; text-align: center; }
.premium-cell span { display: block; font-family: Georgia, serif; font-size: 15px; font-variant-numeric: tabular-nums; }
.premium-cell small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.confidence { justify-self: end; display: inline-flex; min-width: 50px; height: 27px; padding: 0 10px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: rgba(255,255,255,.55); font-size: 10px; }
.confidence.high { color: var(--forest); border-color: rgba(23,63,53,.16); background: var(--forest-soft); }
.confidence.low { color: #8c6032; background: #f4e9d6; }

.two-column { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(330px, .8fr); gap: 18px; margin-top: 18px; }
.soft-label { padding: 6px 10px; border-radius: 99px; color: var(--forest); background: var(--forest-soft); font-size: 10px; font-weight: 700; }
.bond-list, .alert-list { min-height: 180px; }
.bond-item { display: grid; grid-template-columns: 55px minmax(130px, 1fr) minmax(100px, .8fr) minmax(115px, .8fr); gap: 12px; padding: 16px 2px; align-items: center; border-top: 1px solid var(--line); animation: reveal .38s ease both; }
.bond-item:first-child { border-top: 0; }
.date-tile { width: 49px; padding: 7px 3px; border-radius: 11px; text-align: center; background: #f0eadf; }
.date-tile b { display: block; font-family: Georgia, serif; font-size: 17px; }
.date-tile small { display: block; margin-top: 1px; color: var(--muted); font-size: 8px; }
.bond-main strong { display: block; font-size: 12px; }
.bond-main small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.bond-name { transition: color .2s ease; }
.bond-name.bond-strength-high { color: #b52020; font-weight: 800; }
.bond-name.bond-strength-medium { color: #cf4b35; font-weight: 760; }
.bond-name.bond-strength-low { color: #a66a55; font-weight: 700; }
.bond-name.bond-strength-weak, .bond-name.bond-strength-unknown { color: var(--ink); }
.bond-account span, .bond-cost span { display: block; font-size: 11px; font-weight: 650; }
.bond-account small, .bond-cost small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.listing-panel { margin-top: 18px; }
.listing-list { min-height: 150px; }
.listing-item { display: grid; grid-template-columns: 62px minmax(150px, 1.3fr) minmax(145px, 1fr) 100px 120px; gap: 18px; padding: 15px 4px; align-items: center; border-top: 1px solid var(--line); animation: reveal .38s ease both; }
.listing-item:first-child { border-top: 0; }
.listing-date { background: var(--forest-soft); }
.listing-main strong { display: block; font-size: 13px; }
.listing-main small, .listing-stock small, .listing-exchange small, .listing-amount small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.listing-stock span, .listing-exchange span, .listing-amount span { display: block; font-size: 11px; font-weight: 650; }
.listing-amount { text-align: right; }
.recent-bond-list { min-height: 150px; }
.recent-bond-item { display: grid; grid-template-columns: minmax(170px, 1.35fr) minmax(105px, .8fr) minmax(105px, .8fr) 95px 110px; gap: 18px; padding: 15px 4px; align-items: center; border-top: 1px solid var(--line); animation: reveal .38s ease both; }
.recent-bond-item:first-child { border-top: 0; }
.recent-bond-date span, .recent-bond-price span { display: block; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.recent-bond-date small, .recent-bond-price small, .recent-bond-gain small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.recent-bond-gain { text-align: right; }
.recent-bond-gain strong { display: block; font-family: Georgia, serif; font-size: 18px; font-variant-numeric: tabular-nums; }
.recent-bond-gain em { display: block; margin-top: 3px; color: currentColor; font-size: 8px; font-style: normal; }

.alert-item { position: relative; padding: 15px 10px 15px 35px; border-top: 1px solid var(--line); animation: reveal .38s ease both; }
.alert-item:first-child { border-top: 0; }
.alert-item::before { position: absolute; top: 20px; left: 8px; width: 10px; height: 10px; border: 3px solid var(--up-soft); border-radius: 50%; background: var(--up); content: ""; }
.alert-item strong { display: block; padding-right: 66px; font-size: 11px; line-height: 1.5; }
.alert-item p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.65; }
.alert-date { position: absolute; top: 16px; right: 7px; color: var(--muted); font-size: 8px; }
.empty-state { display: grid; min-height: 150px; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.empty-state svg { width: 32px; height: 32px; color: #a4aaa6; }
.empty-state p { margin: 9px 0 0; font-size: 11px; }
.empty-state small { max-width: 250px; margin-top: 5px; font-size: 9px; line-height: 1.5; }
.loader { width: 22px; height: 22px; border: 2px solid var(--paper-deep); border-top-color: var(--forest); border-radius: 50%; animation: spin .8s linear infinite; }
.footer { display: flex; padding: 22px 4px 0; justify-content: space-between; color: #8a918d; font-size: 9px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; padding: 20px; place-items: center; visibility: hidden; opacity: 0; background: rgba(10,25,21,.48); backdrop-filter: blur(7px); transition: .2s ease; }
.modal-backdrop.open { visibility: visible; opacity: 1; }
.modal { width: min(560px, 100%); padding: 27px; border: 1px solid rgba(255,255,255,.55); border-radius: 22px; background: #faf7f0; box-shadow: 0 30px 80px rgba(12,30,25,.24); transform: translateY(12px) scale(.985); transition: .25s ease; }
.modal-backdrop.open .modal { transform: translateY(0) scale(1); }
.modal-header { display: flex; margin-bottom: 22px; align-items: flex-start; justify-content: space-between; }
.modal form { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { display: grid; gap: 7px; }
.field-wide { grid-column: 1 / -1; }
.field > span { color: #4d5954; font-size: 10px; font-weight: 650; }
.field input, .field select { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); outline: none; border-radius: 10px; color: var(--ink); background: #fffdfa; font-size: 12px; transition: .2s; }
.field input:focus, .field select:focus { border-color: rgba(23,63,53,.52); box-shadow: 0 0 0 3px rgba(23,63,53,.07); }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 32px; }
.input-suffix b { position: absolute; top: 13px; right: 12px; color: var(--muted); font-size: 11px; }
.form-hint { margin: -3px 0 0; color: var(--muted); font-size: 9px; }
.modal-actions { display: flex; margin-top: 6px; justify-content: flex-end; gap: 9px; }

.toast-stack { position: fixed; z-index: 100; right: 24px; bottom: 24px; display: grid; width: min(360px, calc(100vw - 40px)); gap: 9px; }
.toast { padding: 14px 16px; border: 1px solid rgba(255,255,255,.15); border-radius: 13px; color: #fff; background: #173f35; box-shadow: 0 15px 35px rgba(16,40,33,.22); font-size: 11px; line-height: 1.5; animation: toast-in .3s ease both; }
.toast.error { background: #7c3c30; }
.mobile-overlay { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .etf-row { grid-template-columns: minmax(145px, 1fr) 95px 105px minmax(170px, 1.4fr) 85px 100px; }
  .two-column { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  :root { --sidebar: 224px; }
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-button { display: inline-grid; }
  .mobile-overlay { position: fixed; inset: 0; z-index: 25; background: rgba(10,25,21,.32); }
  .mobile-overlay.open { display: block; }
  .topbar { height: 66px; padding: 0 18px; }
  .date-block { margin-right: auto; margin-left: 11px; }
  .provider-pill { display: none; }
  .content-wrap { padding: 28px 18px 24px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .hero .button { align-self: stretch; }
  .panel { padding: 19px; }
  .etf-tools { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .etf-row { grid-template-columns: 1fr 1fr; gap: 13px; }
  .asset-name, .range-chart { grid-column: 1 / -1; }
  .confidence { display: none; }
  .listing-item { grid-template-columns: 55px 1fr 1fr; gap: 12px; }
  .listing-exchange { grid-column: 2; }
  .listing-amount { grid-column: 3; text-align: left; }
  .recent-bond-item { grid-template-columns: 1.2fr 1fr 1fr; gap: 12px; }
  .recent-bond-gain { text-align: left; }
}

@media (max-width: 520px) {
  .topbar .button { width: 38px; padding: 0; font-size: 0; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { min-height: 124px; padding: 16px; }
  .metric-card strong { font-size: 27px; }
  .legend { display: none; }
  .panel-header { align-items: flex-start; }
  .bond-item { grid-template-columns: 52px 1fr 1fr; }
  .bond-cost { grid-column: 2 / -1; padding-top: 2px; }
  .listing-item { grid-template-columns: 52px 1fr 1fr; }
  .risk-banner { align-items: flex-start; }
  .recent-bond-item { grid-template-columns: 1fr 1fr; }
  .recent-bond-item .listing-main { grid-column: 1 / -1; }
  .modal form { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .footer { gap: 12px; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ETF holding detail */
.detail-page { min-width: 320px; }
.detail-topbar { position: sticky; top: 0; z-index: 20; display: flex; height: 78px; padding: 0 max(24px, calc((100vw - 1320px) / 2)); align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(36,52,46,.08); background: rgba(245,241,232,.9); backdrop-filter: blur(16px); }
.detail-brand { display: flex; align-items: center; gap: 11px; }
.detail-brand .brand-mark { color: var(--forest); border-color: rgba(23,63,53,.16); background: var(--forest-soft); }
.detail-brand strong { display: block; font-family: "STSong", "Songti SC", serif; font-size: 21px; letter-spacing: .12em; }
.detail-brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.detail-content { width: min(1320px, calc(100% - 48px)); margin: 0 auto; padding: 42px 0 36px; }
.detail-hero { display: flex; padding: 2px 3px 28px; align-items: flex-end; justify-content: space-between; gap: 24px; }
.detail-hero h1 { margin: 0; font-family: "STSong", "Songti SC", serif; font-size: clamp(30px, 4vw, 46px); }
.detail-hero > div > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.holding-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.holding-metrics article { min-height: 128px; padding: 20px; border: 1px solid rgba(35,51,45,.09); border-radius: 17px; background: var(--card); box-shadow: 0 9px 25px rgba(47,52,43,.045); }
.holding-metrics span { color: var(--muted); font-size: 10px; }
.holding-metrics strong { display: block; margin-top: 13px; font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 600; }
.holding-metrics small { display: block; margin-top: 7px; color: var(--muted); font-size: 9px; }
.holdings-header { align-items: flex-end; }
.holdings-search input { width: 150px; }
.holding-warnings { margin: -3px 0 14px; padding: 10px 13px; border: 1px solid rgba(198,155,81,.25); border-radius: 10px; color: #805f2e; background: #f8edd9; font-size: 10px; }
.holding-warnings p { margin: 0; line-height: 1.6; }
.holdings-table-wrap { overflow-x: auto; }
.holdings-table { width: 100%; min-width: 930px; border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
.holdings-table th { padding: 10px 11px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 650; text-align: right; white-space: nowrap; }
.holdings-table th:nth-child(1), .holdings-table th:nth-child(2) { text-align: left; }
.holdings-table td { padding: 13px 11px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.holdings-table tbody tr { transition: background .18s ease; }
.holdings-table tbody tr:hover { background: rgba(220,232,225,.32); }
.holdings-table td:nth-child(1), .holdings-table td:nth-child(2) { text-align: left; }
.holdings-table td strong { display: block; max-width: 250px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; }
.holdings-table td small { display: flex; margin-top: 4px; align-items: center; gap: 6px; color: var(--muted); font-size: 8px; }
.holding-rank { width: 42px; color: #9aa09c; font-family: Georgia, serif; }
.price-cell { font-family: Georgia, "Times New Roman", serif; font-size: 12px; }
.quote-time { color: var(--muted); font-size: 9px; }
.quote-status { display: inline-flex; padding: 2px 5px; border-radius: 99px; color: #8c6032; background: #f4e9d6; }
.quote-status.quoted { color: var(--forest); background: var(--forest-soft); }
.holdings-note { margin: 14px 0 0; color: var(--muted); font-size: 9px; line-height: 1.7; }

@media (max-width: 800px) {
  .detail-topbar { height: 66px; padding: 0 18px; }
  .detail-content { width: calc(100% - 36px); padding-top: 28px; }
  .detail-hero { align-items: flex-start; flex-direction: column; }
  .detail-hero .button { width: 100%; }
  .holding-metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .holding-metrics article { min-height: 115px; padding: 16px; }
  .holdings-header { align-items: flex-start; flex-direction: column; }
  .holdings-search { width: 100%; }
  .holdings-search input { width: 100%; }
}

@media (max-width: 520px) {
  .detail-brand small { display: none; }
  .detail-topbar .button { padding: 0 12px; }
  .holding-metrics strong { font-size: 24px; }
}
