
    
    
    
    .app { min-height: 0; }
    .etf-page-intro {
      display: flex;
      flex-wrap: wrap;
      align-items: flex-start;
      justify-content: space-between;
      gap: 0.75rem 1.25rem;
      margin-bottom: 1rem;
    }
    .etf-page-intro h1 {
      font-size: 1.35rem;
      font-weight: 700;
      letter-spacing: -0.02em;
      margin: 0;
      line-height: 1.25;
    }
    .etf-result-meta {
      color: var(--muted);
      font-size: 0.84rem;
      margin: 0.25rem 0 0;
    }
    .etf-page-intro-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 0.45rem;
      align-items: center;
    }
    .etf-guest-hint {
      font-size: 0.82rem;
      color: var(--muted);
    }
    .etf-guest-hint a { color: var(--accent); }
    .etf-subhead {
      display: flex;
      flex-wrap: wrap;
      gap: 0.75rem;
      align-items: center;
      margin-bottom: 0.85rem;
    }
    .etf-subhead .search-wrap {
      flex: 1 1 280px;
      max-width: 480px;
    }
    .site-header {
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      padding: 1rem 1.5rem;
      position: sticky;
      top: 0;
      z-index: 25;
    }
    .site-header-inner {
      max-width: 1400px;
      margin: 0 auto;
      display: flex;
      flex-wrap: wrap;
      gap: 1rem;
      align-items: center;
      justify-content: space-between;
    }
    .brand-block { flex: 0 1 auto; min-width: 0; }
    .logo { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
    .logo span { color: var(--accent); }
    .logo .domain { color: var(--muted); font-weight: 500; font-size: .95rem; }
    .subtitle { color: var(--muted); font-size: .78rem; margin-top: .15rem; }
    .search-wrap { flex: 1 1 280px; max-width: 420px; min-width: 0; }
    .search {
      width: 100%;
      padding: .65rem .85rem;
      border-radius: var(--radius);
      border: 1px solid var(--border);
      background: var(--surface2);
      color: var(--text);
      font-size: .9rem;
    }
    .search:focus { outline: 2px solid var(--accent); border-color: transparent; }
    .header-actions {
      display: flex;
      flex-wrap: wrap;
      gap: .5rem;
      align-items: center;
    }
    .auth-btn, .user-pill {
      background: var(--surface2);
      border: 1px solid var(--border);
      color: var(--text);
      padding: .45rem .75rem;
      border-radius: 8px;
      font-size: .82rem;
      cursor: pointer;
      text-decoration: none;
    }
    .auth-btn:hover { border-color: var(--accent); color: var(--accent); }
    .auth-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
    .auth-btn.primary:hover { filter: brightness(1.1); color: #fff; }
    .user-pill { cursor: default; color: var(--muted); }
    .row-actions {
      width: 72px;
      padding: .4rem .5rem !important;
      white-space: nowrap;
    }
    .icon-btn {
      background: transparent;
      border: none;
      color: var(--muted);
      cursor: pointer;
      font-size: 1rem;
      padding: .15rem .25rem;
      line-height: 1;
    }
    .icon-btn:hover { color: var(--accent); }
    .icon-btn.active-fav { color: var(--aus); }
    .icon-btn.active-compare { color: var(--accent2); }
    .auth-modal, .compare-panel {
      position: fixed;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%) scale(.96);
      width: min(420px, calc(100vw - 2rem));
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      z-index: 110;
      opacity: 0;
      pointer-events: none;
      transition: opacity .2s, transform .2s;
      padding: 1.25rem;
    }
    .compare-panel {
      width: min(1100px, calc(100vw - 2rem));
      max-height: calc(100vh - 3rem);
      overflow: auto;
      top: 1.5rem;
      transform: translate(-50%, 0) scale(.98);
    }
    .auth-modal.open, .compare-panel.open {
      opacity: 1;
      pointer-events: auto;
      transform: translate(-50%, -50%) scale(1);
    }
    .compare-panel.open { transform: translate(-50%, 0) scale(1); }
    .auth-tabs { display: flex; gap: .5rem; margin-bottom: 1rem; }
    .auth-tab {
      flex: 1;
      background: var(--surface2);
      border: 1px solid var(--border);
      color: var(--muted);
      padding: .5rem;
      border-radius: 8px;
      cursor: pointer;
      font-size: .85rem;
    }
    .auth-tab.active { color: var(--text); border-color: var(--accent); }
    .auth-form label { display: block; font-size: .78rem; color: var(--muted); margin: .65rem 0 .3rem; }
    .auth-form input {
      width: 100%;
      padding: .6rem .75rem;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--surface2);
      color: var(--text);
      font-size: .9rem;
    }
    .auth-error {
      color: #ef4444;
      font-size: .82rem;
      margin-top: .75rem;
      min-height: 1.2rem;
    }
    .auth-submit {
      width: 100%;
      margin-top: 1rem;
      padding: .65rem;
      border: none;
      border-radius: 8px;
      background: var(--accent);
      color: #fff;
      font-weight: 600;
      cursor: pointer;
    }
    .compare-bar {
      position: fixed;
      left: 50%;
      bottom: 1rem;
      transform: translateX(-50%);
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 999px;
      box-shadow: var(--shadow);
      padding: .55rem .85rem;
      display: none;
      align-items: center;
      gap: .65rem;
      z-index: 90;
      max-width: calc(100vw - 1.5rem);
      flex-wrap: wrap;
    }
    .compare-bar.visible { display: flex; }
    .compare-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
    .compare-chip {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 999px;
      padding: .2rem .55rem;
      font-size: .78rem;
      display: flex;
      align-items: center;
      gap: .35rem;
    }
    .compare-chip button {
      background: transparent;
      border: none;
      color: var(--muted);
      cursor: pointer;
      font-size: .9rem;
      line-height: 1;
    }
    .compare-table { width: 100%; font-size: .84rem; margin-top: 1rem; }
    .compare-table th, .compare-table td {
      padding: .55rem .65rem;
      border-bottom: 1px solid var(--border);
      text-align: left;
      vertical-align: top;
    }
    .compare-table th { color: var(--muted); width: 140px; background: var(--surface2); }
    .compare-table .code { font-weight: 700; color: var(--accent); }
    .overlap-badge {
      display: inline-block; padding: .2rem .55rem; border-radius: 999px;
      font-size: .78rem; font-weight: 700;
    }
    .overlap-high { background: rgba(239,68,68,.15); color: #f87171; }
    .overlap-medium { background: rgba(249,115,22,.15); color: var(--warn); }
    .overlap-low { background: rgba(34,197,94,.15); color: var(--accent2); }
    .fee-grid {
      display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
      gap: .5rem; margin-top: .75rem;
    }
    .fee-cell {
      background: var(--surface2); border-radius: 8px; padding: .55rem .65rem; font-size: .82rem;
    }
    .fee-cell strong { display: block; color: var(--muted); font-size: .7rem; font-weight: 600; }
    .portfolio-panel {
      position: fixed; right: 0; top: 0; width: min(480px, 100vw); height: 100vh;
      background: var(--surface); border-left: 1px solid var(--border);
      box-shadow: -12px 0 40px rgba(0,0,0,.4); z-index: 105;
      transform: translateX(100%); transition: transform .25s ease;
      overflow-y: auto; padding: 1.25rem;
    }
    .portfolio-panel.open { transform: translateX(0); }
    .portfolio-row {
      display: grid; grid-template-columns: 1fr 72px 32px; gap: .5rem;
      align-items: center; margin-bottom: .5rem;
    }
    .portfolio-row input, .portfolio-row select {
      background: var(--surface2); border: 1px solid var(--border); color: var(--text);
      padding: .45rem .55rem; border-radius: 8px; font-size: .84rem; width: 100%;
    }
    .section-block { margin-top: 1.25rem; }
    .section-block h3 {
      font-size: .78rem; text-transform: uppercase; letter-spacing: .06em;
      color: var(--muted); margin-bottom: .6rem;
    }
    .modal-close {
      position: absolute;
      top: .85rem;
      right: .85rem;
      background: var(--surface2);
      border: 1px solid var(--border);
      color: var(--text);
      border-radius: 8px;
      width: 32px;
      height: 32px;
      cursor: pointer;
    }
    .main {
      max-width: none;
      margin: 0;
      padding: 0 0 1.5rem;
      overflow-x: hidden;
    }
    .header {
      display: flex;
      flex-wrap: wrap;
      gap: 1rem;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 1.25rem;
    }
    .meta { color: var(--muted); font-size: .82rem; }
    .toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: .75rem;
      margin-bottom: 1rem;
      align-items: center;
    }
    .toolbar select, .toolbar label {
      background: var(--surface);
      border: 1px solid var(--border);
      color: var(--text);
      padding: .5rem .75rem;
      border-radius: 8px;
      font-size: .85rem;
    }
    .table-wrap {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      overflow: auto;
      box-shadow: var(--shadow);
    }
    table { border-collapse: collapse; font-size: .84rem; table-layout: fixed; min-width: 100%; }
    th, td {
      padding: .65rem .75rem;
      text-align: left;
      border-bottom: 1px solid var(--border);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    th {
      background: var(--surface2);
      color: var(--muted);
      font-weight: 600;
      font-size: .75rem;
      text-transform: uppercase;
      letter-spacing: .03em;
      cursor: pointer;
      user-select: none;
      position: sticky;
      top: 0;
      z-index: 2;
    }
    th:hover { color: var(--text); }
    th.sortable.sorted-asc .th-label::after { content: " ▲"; color: var(--accent); }
    th.sortable.sorted-desc .th-label::after { content: " ▼"; color: var(--accent); }
    th .col-resize {
      position: absolute;
      right: 0;
      top: 0;
      width: 6px;
      height: 100%;
      cursor: col-resize;
      z-index: 3;
    }
    th .col-resize:hover, th .col-resize.active { background: var(--accent); opacity: .45; }
    .toolbar-btn {
      background: var(--surface);
      border: 1px solid var(--border);
      color: var(--text);
      padding: .5rem .85rem;
      border-radius: 8px;
      font-size: .85rem;
      cursor: pointer;
    }
    .toolbar-btn:hover { border-color: var(--accent); color: var(--accent); }
    .col-picker-wrap { position: relative; }
    .col-picker {
      display: none;
      position: absolute;
      top: calc(100% + 6px);
      left: 0;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: .75rem;
      min-width: 260px;
      max-height: 420px;
      overflow-y: auto;
      z-index: 30;
      box-shadow: var(--shadow);
    }
    .col-picker.open { display: block; }
    .col-picker h4 {
      font-size: .72rem;
      text-transform: uppercase;
      letter-spacing: .05em;
      color: var(--muted);
      margin-bottom: .5rem;
    }
    .col-picker label {
      display: flex;
      align-items: center;
      gap: .5rem;
      padding: .35rem .2rem;
      font-size: .84rem;
      cursor: pointer;
      border-radius: 6px;
    }
    .col-picker label:hover { background: var(--surface2); }
    .col-picker-actions {
      display: flex;
      gap: .5rem;
      margin-top: .65rem;
      padding-top: .65rem;
      border-top: 1px solid var(--border);
    }
    .col-picker-actions button {
      flex: 1;
      background: var(--surface2);
      border: 1px solid var(--border);
      color: var(--text);
      padding: .4rem;
      border-radius: 6px;
      font-size: .78rem;
      cursor: pointer;
    }
    .search-hint {
      background: rgba(249,115,22,.12);
      border: 1px solid rgba(249,115,22,.35);
      color: var(--warn);
      padding: .65rem .85rem;
      border-radius: 8px;
      font-size: .84rem;
      margin-bottom: .75rem;
      display: none;
    }
    .search-hint.visible { display: block; }
    tr.fund-row { cursor: pointer; transition: background .15s; }
    tr.fund-row:hover { background: rgba(61,156,245,.08); }
    tr.fund-row.selected { background: rgba(61,156,245,.15); }
    .code { font-weight: 700; color: var(--accent); }
    .pill {
      display: inline-block;
      padding: .15rem .45rem;
      border-radius: 999px;
      font-size: .72rem;
      font-weight: 600;
    }
    .pill-etf { background: rgba(61,156,245,.2); color: var(--accent); }
    .pill-active { background: rgba(34,197,94,.2); color: var(--accent2); }
    .pill-complex { background: rgba(168,85,247,.2); color: #c084fc; }
    .pill-sp { background: rgba(245,158,11,.2); color: var(--aus); }
    .pill-index { background: rgba(148,163,184,.2); color: #94a3b8; }
    .pill-lic { background: rgba(139,144,168,.22); color: #8b90a8; }
    .pill-lit { background: rgba(154,149,144,.2); color: #9a9590; }
    .geo-bar {
      display: flex;
      height: 8px;
      border-radius: 4px;
      overflow: hidden;
      width: 90px;
      background: var(--bg);
    }
    .geo-aus { background: var(--aus); }
    .geo-os { background: var(--os); }
    .num-pos { color: var(--accent2); }
    .num-neg { color: #ef4444; }
    .detail-panel {
      position: fixed;
      right: 0;
      top: 0;
      width: min(520px, 100vw);
      height: 100vh;
      background: var(--surface);
      border-left: 1px solid var(--border);
      box-shadow: -12px 0 40px rgba(0,0,0,.4);
      z-index: 100;
      transform: translateX(100%);
      transition: transform .25s ease;
      overflow-y: auto;
      padding: 1.25rem;
    }
    .detail-panel.open { transform: translateX(0); }
    .overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,.5);
      z-index: 99;
      opacity: 0;
      pointer-events: none;
      transition: opacity .25s;
    }
    .overlay.open { opacity: 1; pointer-events: auto; }
    .detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
    .close-btn {
      background: var(--surface2);
      border: 1px solid var(--border);
      color: var(--text);
      border-radius: 8px;
      width: 36px;
      height: 36px;
      cursor: pointer;
      font-size: 1.2rem;
    }
    .section { margin-bottom: 1.25rem; }
    .section h3 {
      font-size: .78rem;
      text-transform: uppercase;
      letter-spacing: .06em;
      color: var(--muted);
      margin-bottom: .6rem;
      padding-bottom: .35rem;
      border-bottom: 1px solid var(--border);
    }
    .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
    .metric {
      background: var(--surface2);
      border-radius: 8px;
      padding: .6rem .75rem;
    }
    .metric .m-label { color: var(--muted); font-size: .72rem; }
    .metric .m-value { font-weight: 700; font-size: .95rem; }
    .holdings-table { width: 100%; font-size: .8rem; }
    .holdings-table td { padding: .4rem .3rem; border-bottom: 1px solid var(--border); }
    .holdings-table .weight { text-align: right; font-variant-numeric: tabular-nums; }
    .geo-legend { display: flex; gap: 1rem; font-size: .8rem; margin-top: .5rem; }
    .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .3rem; }
    .year-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
      gap: .4rem;
    }
    .year-cell {
      background: var(--surface2);
      border-radius: 6px;
      padding: .4rem;
      text-align: center;
      font-size: .75rem;
    }
    .year-cell .yr { color: var(--muted); }
    .loading {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      min-height: 60vh;
      color: var(--muted);
      gap: 1rem;
    }
    .spinner {
      width: 40px; height: 40px;
      border: 3px solid var(--border);
      border-top-color: var(--accent);
      border-radius: 50%;
      animation: spin .8s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
    .empty { text-align: center; padding: 3rem; color: var(--muted); }
    .note { font-size: .75rem; color: var(--muted); margin-top: .35rem; }
    .tag { font-size: .7rem; color: var(--warn); }
    @media (max-width: 768px) {
      .site-header { padding: .85rem 1rem; }
      .main { padding: 1rem; }
      .site-header-inner { gap: .75rem; }
      .search-wrap { flex: 1 1 100%; max-width: none; order: 3; }
      .header h1 { font-size: 1.2rem; }
      .stats { width: 100%; }
      .stat { flex: 1 1 calc(33% - .5rem); min-width: 90px; padding: .5rem .65rem; }
      .stat .value { font-size: 1rem; }
      .toolbar { gap: .5rem; }
      .toolbar select, .toolbar label, .toolbar-btn {
        font-size: .8rem;
        padding: .45rem .6rem;
      }
      .detail-panel { width: 100vw; }
      th, td { padding: .5rem .55rem; font-size: .78rem; }
    }
    @media (max-width: 480px) {
      .logo { font-size: 1.1rem; }
      .stat { min-width: 80px; }
      .grid-2 { grid-template-columns: 1fr; }
    }
  
.etf-explorer .site-header { display: none !important; }
.etf-explorer {
  --bg: var(--wt-bg);
  --surface: var(--wt-surface);
  --surface2: var(--wt-input-bg, #fff);
  --border: var(--wt-border);
  --text: var(--wt-ink);
  --muted: var(--wt-muted);
  --accent: var(--wt-forest);
  --accent2: var(--wt-copper);
  --aus: var(--wt-copper);
  --os: #6a8499;
  --warn: var(--wt-warn);
  --radius: var(--wt-radius, 12px);
  --shadow: 0 8px 24px rgba(44,41,38,.08);
  color: var(--text);
}
[data-theme="dark"] .etf-explorer {
  --surface2: #141a22;
  --shadow: 0 8px 32px rgba(0,0,0,.35);
}
.etf-explorer .main { max-width: none; margin: 0; padding: 0 0 3rem; }
.etf-explorer .app { min-height: auto; }
.etf-explorer .etf-subhead {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
  justify-content: space-between; margin-bottom: 1rem;
}
.etf-explorer .etf-subhead .search-wrap { flex: 1 1 280px; max-width: 420px; }
