/**
 * 美股風向 · 對齊產業地圖 / Hub 視覺
 */
.us-lens {
  --us-r-sm: 12px;
  --us-r-md: 16px;
  --us-r-lg: 24px;
  --us-panel: rgba(255, 255, 255, 0.92);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "PingFang TC", "Noto Sans TC", sans-serif;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

.us-lens *,
.us-lens *::before,
.us-lens *::after {
  box-sizing: border-box;
}

.us-wrap {
  max-width: min(1680px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 8px 14px calc(var(--hub-bottom-nav-h, 56px) + 12px);
}

@media (min-width: 1024px) {
  .us-wrap {
    padding-left: 18px;
    padding-right: 18px;
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - var(--hub-top-nav-h, 52px));
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .us-wrap > .us-status-row,
  .us-wrap > .us-hero,
  .us-wrap > .us-top-band,
  .us-wrap > .us-util-fold {
    flex-shrink: 0;
  }

  .us-wrap > .us-workbench--dashboard {
    flex: 1;
    min-height: min(62vh, 760px);
  }
}

/* ── 頁首 ── */
.us-hero {
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.us-hero__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.us-page-title {
  margin: 0;
  font-size: clamp(20px, 3.5vw, 24px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.us-lead {
  margin: 4px 0 0;
  max-width: none;
  font-size: 11px;
  line-height: 1.35;
  color: var(--ink-soft);
}

.us-lead strong {
  color: var(--ink);
  font-weight: 700;
}

.us-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 12px;
  margin: 0;
  flex-shrink: 0;
}

.us-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.us-btn {
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--accent);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.us-btn:hover {
  background: #f5f2ec;
  border-color: var(--accent);
}

.us-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.us-btn--primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.us-btn--primary:hover {
  background: #1a2744;
  color: var(--paper);
}

.us-btn--ghost {
  background: transparent;
  color: var(--ink-soft);
}

.us-meta {
  font-size: 11px;
  color: var(--ink-faint);
}

.us-seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}

.us-seg button {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.us-seg button.active,
.us-seg button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

/* ── 區塊標籤（對齊 map-section-label）── */
.us-section-label {
  margin: 20px 0 8px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.us-section-label:first-child {
  margin-top: 0;
}

/* ── 面板 ── */
.us-panel {
  border: 1px solid var(--line);
  border-radius: var(--us-r-lg);
  background: var(--us-panel);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 14px;
}

.us-panel__head {
  margin-bottom: 12px;
}

.us-panel__head h2 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 850;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.us-panel__hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ── 盤勢 / 提示 ── */
.us-status-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 0 0 8px;
}

.us-status-row > .hint-box--top,
.us-status-row > .session-bar--compact {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.hint-box--top {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.4;
}

.hint-box--top code {
  font-size: 9px;
  padding: 1px 4px;
}

.session-bar {
  border: 1px solid var(--line);
  border-radius: var(--us-r-sm);
  padding: 12px 14px;
  margin: 0 0 12px;
  background: linear-gradient(165deg, #faf8f4 0%, #fff 100%);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
  box-shadow: var(--shadow);
}

.session-bar--compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1.35;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.88);
}

.session-bar--compact .session-bar__phase {
  font-weight: 800;
  color: var(--accent);
}

.session-bar--compact .session-bar__sep {
  color: var(--ink-faint);
}

.session-bar--compact .session-bar__clock {
  color: var(--ink-faint);
  font-size: 10px;
}

.session-bar .phase {
  font-weight: 800;
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 4px;
}

.session-bar .clock {
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 6px;
}

.hint-box {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--us-r-sm);
  font-size: 12px;
  line-height: 1.55;
  border: 1px solid #fde68a;
  background: var(--yellow-bg);
  color: #713f12;
}

.hint-box.ok {
  border-color: #bbf7d0;
  background: var(--green-bg);
  color: #14532d;
}

.hint-box code {
  font-size: 10px;
  font-family: ui-monospace, monospace;
  background: rgba(255, 255, 255, 0.55);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ── 頂部帶：影響 + 指數（三欄工作台上方固定）── */
.us-top-band {
  margin-bottom: 8px;
}

.us-top-row {
  display: grid;
  gap: 12px;
  align-items: stretch;
}

.us-top-row__impact {
  margin: 0;
}

.us-top-row__impact.us-panel {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  margin-bottom: 0;
}

.us-top-row__impact .us-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 8px;
  min-height: 20px;
}

.us-top-row__impact .us-panel__head h2 {
  margin: 0;
  font-size: 14px;
  flex-shrink: 0;
}

.us-top-row__impact .us-panel__hint {
  margin: 0 0 0 auto;
  font-size: 11px;
  line-height: 1.4;
  text-align: right;
  min-width: 0;
}

.us-top-row__indices {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--us-r-lg);
  background: var(--us-panel);
  box-shadow: 0 1px 3px rgba(15, 23, 41, 0.04);
}

.us-section-label--inline {
  margin: 0 0 8px;
  padding: 0;
  border: none;
  min-height: 20px;
  display: flex;
  align-items: center;
}

.index-strip--top {
  flex: 1;
  margin-bottom: 0;
  align-items: stretch;
}

.index-strip--top .index-chip {
  min-width: 86px;
  flex: 1 1 86px;
  height: 90px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
}

.index-strip--top .index-chip .pr {
  font-size: 14px;
  margin-top: 3px;
}

.index-strip--top .index-chip .chg {
  font-size: 10px;
  margin-top: 2px;
}

.index-strip--top .index-chip .nm {
  font-size: 10px;
  line-height: 1.2;
  min-height: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .us-top-row {
    grid-template-columns: minmax(0, 40%) minmax(0, 60%);
    gap: 10px;
  }

  .index-strip--top {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    overflow-x: hidden;
    padding-bottom: 0;
  }

  .us-top-row__impact .impact-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    align-items: stretch;
  }
}

.us-top-row__impact .impact-grid {
  flex: 1;
  align-items: stretch;
}

.us-top-row__impact .impact-item {
  height: 90px;
  min-height: 90px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.us-top-row__impact .impact-item span {
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

@media (max-width: 1023px) {
  .us-status-row {
    flex-direction: column;
    gap: 6px;
  }

  .us-hero__title-row {
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
  }

  .us-toolbar {
    margin-left: auto;
  }

  .us-lead {
    font-size: 12px;
    line-height: 1.45;
  }

  .us-top-row__indices {
    order: -1;
  }

  .us-top-row__impact .us-panel__head {
    flex-wrap: wrap;
  }

  .us-top-row__impact .us-panel__hint {
    flex: 1 1 100%;
    margin-left: 0;
    text-align: left;
  }
}

/* ── 影響格 ── */
.impact-grid {
  display: grid;
  gap: 8px;
}

@media (min-width: 768px) {
  .impact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.impact-item {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--us-r-sm);
  padding: 6px 7px;
  background: rgba(248, 250, 252, 0.8);
}

.impact-item strong {
  display: block;
  font-size: 10px;
  color: var(--ink);
  margin-bottom: 2px;
}

.impact-item span {
  display: block;
  font-size: 10px;
  color: var(--ink-soft);
  line-height: 1.3;
}

.impact-item.up {
  border-color: rgba(22, 163, 74, 0.28);
  background: rgba(240, 253, 244, 0.85);
}

.impact-item.down {
  border-color: rgba(220, 38, 38, 0.22);
  background: rgba(254, 242, 242, 0.85);
}

.impact-item.warn {
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(255, 251, 235, 0.9);
}

/* ── 指數 strip ── */
.index-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  margin-bottom: 4px;
}

.index-strip::-webkit-scrollbar {
  display: none;
}

.index-chip {
  flex: 0 0 auto;
  min-width: 112px;
  background: var(--paper);
  border-radius: var(--us-r-md);
  padding: 10px 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.15s;
}

.index-chip:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.index-chip .nm {
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 700;
}

.index-chip .sym {
  font-size: 10px;
  color: var(--ink-faint);
  margin-top: 2px;
}

.index-chip .pr {
  font-size: 17px;
  font-weight: 800;
  margin-top: 6px;
  letter-spacing: -0.02em;
}

.index-chip .chg {
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
}

.index-chip .chg.up { color: var(--green); }
.index-chip .chg.down { color: var(--red); }
.index-chip.loading { opacity: 0.6; }

/* ── 自訂面板 ── */
.add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.add-row input {
  flex: 1 1 100px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

.add-row input:focus {
  outline: 2px solid rgba(30, 58, 95, 0.18);
  border-color: var(--accent);
}

.add-row button.secondary,
.prefs-sync-row button.secondary,
.holdings-sync-row button.secondary {
  background: var(--paper);
  color: var(--accent);
  border: 1px solid var(--line-strong);
}

.quick-add {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.quick-add .qa-label {
  font-size: 11px;
  color: var(--ink-faint);
  align-self: center;
  margin-right: 4px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.quick-add button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.quick-add button:hover {
  background: #f5f2ec;
  border-color: var(--line-strong);
}

.quick-add button.added {
  background: var(--green-bg);
  color: var(--green);
  border-color: #bbf7d0;
  cursor: default;
}

.custom-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.custom-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: #f5f2ec;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink);
}

.custom-pill button {
  background: var(--red-bg);
  color: var(--red);
  border: none;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.holdings-sync-row,
.prefs-sync-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-soft);
}

.holdings-sync-row {
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.holdings-sync-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.holdings-sync-hint,
.prefs-sync-status {
  font-size: 11px;
  color: var(--ink-faint);
  line-height: 1.5;
  flex: 1 1 100%;
}

/* ── 三欄 Dashboard（對齊產業地圖 20·32·48）── */
.us-workbench {
  align-items: stretch;
  margin-top: 0;
  margin-bottom: 12px;
}

.us-workbench--dashboard {
  display: grid;
  grid-template-columns: minmax(172px, 18%) minmax(320px, 37%) minmax(360px, 45%);
  gap: 10px;
  align-items: stretch;
  min-height: min(62vh, 760px);
}

.us-workbench--stacked {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.us-workbench--stacked > .us-major-nav,
.us-workbench--stacked > .us-summary-card,
.us-workbench--stacked > .us-stock-panel {
  max-height: min(52vh, 640px);
}

.us-impact--compact {
  margin-bottom: 10px;
  padding: 10px 12px;
}

.us-impact--compact .impact-grid {
  margin: 0;
}

.us-major-nav,
.us-summary-card,
.us-stock-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--us-r-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.us-panel-head {
  flex-shrink: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.us-panel-head b {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.us-panel-head span {
  font-size: 10px;
  color: var(--ink-soft);
}

.us-nav-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 10px 12px;
  scrollbar-width: thin;
}

.us-nav-divider {
  margin: 10px 0 6px;
  padding: 4px 2px 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-top: 1px dashed rgba(148, 163, 184, 0.28);
}

.us-major-card {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--us-r-sm);
  padding: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.us-major-card + .us-major-card {
  margin-top: 6px;
}

.us-major-card:hover,
.us-major-card.is-active {
  border-color: rgba(37, 99, 235, 0.26);
  background: #f8fbff;
  box-shadow: inset 4px 0 0 var(--major-color, var(--accent));
}

.us-major-card--etf.is-active {
  background: #eef2ff;
}

.us-major-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--major-color, #64748b);
  font-size: 12px;
  font-weight: 900;
}

.us-major-card b,
.us-major-card small,
.us-major-card em {
  display: block;
}

.us-major-card b {
  font-size: 13px;
  font-weight: 800;
}

.us-major-card small {
  margin-top: 2px;
  font-size: 10px;
  color: var(--ink-soft);
  line-height: 1.35;
}

.us-major-card em {
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  color: var(--ink-faint);
}

.us-summary-card__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 16px;
  scrollbar-width: thin;
}

.us-summary-empty {
  margin: 0;
  font-size: 12px;
  color: var(--ink-soft);
}

.us-summary-head {
  margin-bottom: 12px;
}

.us-summary-kicker {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

.us-summary-head h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.us-summary-lead {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.us-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--us-r-sm);
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid var(--line);
}

.us-summary-meta dt {
  font-size: 10px;
  color: var(--ink-faint);
  font-weight: 700;
}

.us-summary-meta dd {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 800;
}

.us-summary-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.us-summary-section h3 {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.us-summary-section p,
.us-summary-section .detail-section p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.us-summary-section--risk p {
  color: #b45309;
}

.us-summary-stock-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.us-summary-stock-card {
  appearance: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 72px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.us-summary-stock-card:hover,
.us-summary-stock-card.is-active {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: inset 3px 0 0 var(--stock-accent, var(--accent));
  background: #f8fbff;
}

.us-summary-stock-card strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--stock-accent, var(--ink));
}

.us-summary-stock-card span {
  font-size: 10px;
  color: var(--ink-soft);
}

.us-summary-stock-card em {
  margin-top: auto;
  font-size: 11px;
  font-weight: 800;
  font-style: normal;
}

.us-summary-stock-card em.up { color: var(--green); }
.us-summary-stock-card em.down { color: var(--red); }

.us-summary-stock-card.is-muted {
  cursor: default;
  opacity: 0.72;
}

.us-stock-panel__head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(248, 250, 252, 0.65);
}

.us-stock-layout-toggle {
  flex-shrink: 0;
}

.us-stock-layout-toggle button {
  padding: 4px 10px;
  font-size: 11px;
}

.us-stock-panel__kicker {
  margin: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.us-stock-panel__hint {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
}

.us-stock-panel__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px 14px;
  scrollbar-width: thin;
}

.us-stock-panel__empty {
  margin: 24px 8px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  text-align: center;
}

.us-stock-panel .stock-card--panel {
  border: none;
  box-shadow: none;
  background: transparent;
  scroll-margin-top: 0;
}

.us-stock-panel .stock-card--panel::before {
  opacity: 1;
}

.us-stock-panel .chart-area {
  height: 220px;
}

.us-stock-panel__scroll.layout-grid .stock-card .chart-area {
  height: 120px;
}

.us-stock-panel__scroll.layout-grid .stock-card .stats-row2:last-of-type {
  display: none;
}

.us-stock-panel__scroll.layout-grid .us-v3-panel {
  margin-top: 8px;
  padding: 8px 10px;
}

.us-stock-panel__scroll.layout-grid .iw-fund-charts--compact .iw-fund-charts__plot {
  min-height: 160px;
  height: 160px;
}

.us-util-fold {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--us-r-md);
  background: rgba(255, 255, 255, 0.88);
}

.us-util-fold__sum {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  list-style: none;
}

.us-util-fold__sum::-webkit-details-marker {
  display: none;
}

.us-util-fold .add-panel {
  border: none;
  box-shadow: none;
  margin: 0;
  border-radius: 0;
}

.index-chip.is-clickable {
  cursor: pointer;
}

.index-chip.is-clickable:hover {
  border-color: var(--accent);
}

@media (max-width: 1100px) {
  .us-workbench--dashboard {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .us-workbench--stacked > .us-major-nav,
  .us-workbench--stacked > .us-summary-card,
  .us-workbench--stacked > .us-stock-panel {
    max-height: none;
  }

  .us-major-nav,
  .us-summary-card,
  .us-stock-panel {
    max-height: none;
  }

  .us-nav-scroll,
  .us-summary-card__body,
  .us-stock-panel__scroll {
    max-height: 420px;
  }
}

/* ── 舊主題 rail（保留 class 相容）── */
.lens-body {
  display: block;
}

.theme-rail {
  display: none;
}

/* ── 主題 rail ── */
.theme-map {
  padding: 0;
  margin: 0;
}

.theme-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--ink-soft);
}

.theme-filter-bar button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.theme-filter-bar button.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.theme-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.theme-card {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--us-r-md);
  padding: 12px 14px;
  background: #fff;
  border-left: 4px solid var(--theme-accent, var(--accent));
  transition: box-shadow 0.15s, border-color 0.15s;
}

.theme-card:hover {
  border-color: rgba(148, 163, 184, 0.38);
}

.theme-card.is-active {
  box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.12);
  background: #faf8f4;
}

.theme-card.is-active-drawer {
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
  background: #f8fafc;
}

.theme-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.theme-card-head strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  display: block;
  letter-spacing: -0.02em;
}

.theme-card-head small {
  font-size: 11px;
  color: var(--ink-faint);
  font-weight: 500;
}

.theme-card-pct {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.theme-card-pct.up { color: var(--green); }
.theme-card-pct.down { color: var(--red); }

.theme-card-desc {
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 8px;
}

.theme-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.theme-card-actions button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.theme-card-actions button:hover {
  background: #f5f2ec;
}

.theme-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.theme-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 11px;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
}

.theme-pill:hover {
  border-color: var(--line-strong);
  background: #f5f2ec;
}

.theme-pill em {
  font-style: normal;
  color: var(--ink-faint);
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-pill .pct {
  font-weight: 800;
  font-size: 10px;
}

.theme-pill .pct.up { color: var(--green); }
.theme-pill .pct.down { color: var(--red); }
.theme-pill.is-muted { cursor: default; opacity: 0.72; }

/* ── 個股卡 grid ── */
.page {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .page.layout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .page.layout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.page.layout-list {
  display: flex;
  flex-direction: column;
}

.page.layout-grid .stock-card .chart-area {
  height: 96px;
}

.page.layout-grid .stock-card .stats-row2:last-of-type {
  display: none;
}

/* ── 個股卡（對齊 v3 暖色面板）── */
.stock-card {
  --stock-accent: var(--accent);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--us-r-lg);
  background: linear-gradient(180deg, rgba(254, 243, 199, 0.22) 0%, rgba(255, 255, 255, 0.98) 42%);
  box-shadow: 0 1px 3px rgba(15, 23, 41, 0.04), 0 8px 24px rgba(15, 23, 41, 0.04);
  scroll-margin-top: calc(var(--hub-top-nav-h, 52px) + 16px);
}

.stock-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--stock-accent);
  opacity: 0.85;
}

.stock-card.is-filtered-out {
  display: none !important;
}

.stock-card.is-highlight {
  box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.18);
}

.card-top {
  padding: 16px 18px 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-left {
  flex: 1;
  min-width: 0;
}

.stock-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--stock-accent, var(--ink));
}

.stock-sub {
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 4px;
  line-height: 1.45;
}

.badge-us,
.badge-holdings,
.badge-watch {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

.badge-us {
  color: var(--accent);
  background: #eef2ff;
  border: 1px solid rgba(30, 58, 95, 0.12);
}

.badge-holdings {
  color: #0f766e;
  background: #ccfbf1;
  border: 1px solid rgba(15, 118, 110, 0.15);
}

.badge-watch {
  color: #6d28d9;
  background: #ede9fe;
  border: 1px solid rgba(109, 40, 217, 0.12);
}

.price-row {
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.price {
  font-size: 30px;
  font-weight: 300;
  letter-spacing: -0.03em;
}

.currency {
  font-size: 12px;
  color: var(--ink-faint);
}

.change {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.change.up { color: var(--green); }
.change.down { color: var(--red); }

.card-right {
  text-align: right;
  flex-shrink: 0;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.badge.up {
  background: var(--green-bg);
  color: var(--green);
}

.badge.down {
  background: var(--red-bg);
  color: var(--red);
}

.src-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: #f5f2ec;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

.src-tag.yahoo {
  background: var(--yellow-bg);
  color: #92400e;
  border-color: #fde68a;
}

.range-row {
  display: flex;
  gap: 4px;
  padding: 0 16px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.range-row::-webkit-scrollbar {
  display: none;
}

.range-pill {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
}

.range-pill:hover {
  background: #f5f2ec;
}

.range-pill.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.chart-area {
  padding: 0 14px 10px;
  position: relative;
  height: 148px;
}

.chart-skeleton {
  position: absolute;
  inset: 0;
  margin: 0 14px 10px;
  border-radius: var(--us-r-sm);
  border: 1px solid var(--line);
  background: linear-gradient(90deg, #f5f2ec 25%, #ebe6dc 50%, #f5f2ec 75%);
  background-size: 200% 100%;
  animation: usShimmer 1.3s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--ink-faint);
}

@keyframes usShimmer {
  to { background-position: -200% 0; }
}

.stats-row,
.stats-row2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.55);
}

.stat {
  padding: 10px 12px;
  border-right: 1px solid rgba(148, 163, 184, 0.14);
}

.stat:nth-child(3n) {
  border-right: none;
}

.stat-label {
  font-size: 10px;
  color: var(--ink-faint);
  margin-bottom: 3px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.stat-value {
  font-size: 13px;
  font-weight: 600;
  word-break: break-all;
}

.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 0 16px 12px;
}

.card-foot button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--accent);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.card-foot button:hover {
  background: #f5f2ec;
}

.update-bar {
  padding: 8px 16px 14px;
  font-size: 10px;
  color: var(--ink-faint);
  line-height: 1.4;
  border-top: 1px dashed rgba(148, 163, 184, 0.2);
}

.card-error {
  margin: 12px 16px 16px;
  background: var(--red-bg);
  border-radius: var(--us-r-sm);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--red);
  border: 1px solid #fecaca;
}

.card-error .retry {
  margin-top: 8px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

/* ── 詳情抽屜 ── */
.detail-drawer-backdrop {
  position: fixed;
  top: var(--hub-top-nav-h, 52px);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(4px);
  z-index: 100010;
  display: flex;
  justify-content: flex-end;
  padding: 12px 12px 12px 0;
}

.detail-drawer-backdrop.hidden {
  display: none;
}

.detail-drawer {
  width: min(520px, calc(100vw - 16px));
  height: 100%;
  max-height: calc(100dvh - var(--hub-top-nav-h, 52px) - 24px);
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.18);
  border: 1px solid var(--line);
  border-radius: var(--us-r-lg) 0 0 var(--us-r-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: usDrawerIn 0.2s ease-out;
}

@keyframes usDrawerIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.detail-drawer-head {
  flex-shrink: 0;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(165deg, #faf8f4 0%, #fff 100%);
}

.detail-drawer-head h3 {
  font-size: 18px;
  color: var(--ink);
  margin: 0 0 4px;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.detail-drawer-sub {
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.detail-drawer-close {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.detail-drawer-close:hover {
  background: #f5f2ec;
}

.detail-drawer-body {
  padding: 0 18px 28px;
  overflow-y: auto;
  flex: 1;
}

.detail-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 14px 0 6px;
}

.detail-quote-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}

.detail-quote-box div {
  background: #faf8f4;
  border: 1px solid var(--line);
  border-radius: var(--us-r-sm);
  padding: 8px 10px;
}

.detail-quote-box dt {
  font-size: 10px;
  color: var(--ink-faint);
  margin-bottom: 2px;
}

.detail-quote-box dd {
  font-size: 14px;
  font-weight: 800;
  margin: 0;
}

.detail-quote-box dd.up { color: var(--green); }
.detail-quote-box dd.down { color: var(--red); }

.detail-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 4px;
}

.detail-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f5f2ec;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

.detail-chip.theme {
  background: #eef2ff;
  color: var(--accent);
  border-color: rgba(30, 58, 95, 0.15);
}

.detail-headline {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.55;
  margin: 8px 0 0;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}

.detail-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.detail-section:first-of-type {
  margin-top: 12px;
  padding-top: 0;
  border-top: none;
}

.detail-section h4 {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.detail-section p,
.detail-section li {
  font-size: 12px;
  color: var(--ink);
  line-height: 1.6;
}

.detail-section ul {
  padding-left: 18px;
  margin: 0;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.detail-table th,
.detail-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.detail-tw-link {
  display: block;
  padding: 8px 10px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: var(--us-r-sm);
  background: #faf8f4;
  font-size: 12px;
  line-height: 1.5;
}

.detail-tw-link strong {
  color: var(--accent);
}

.detail-news {
  border-left: 3px solid var(--line-strong);
  padding: 6px 0 6px 10px;
  margin-bottom: 10px;
}

.detail-decision {
  background: var(--green-bg);
  border: 1px solid #bbf7d0;
  border-radius: var(--us-r-sm);
  padding: 10px 12px;
}

.detail-decision.warn {
  background: var(--yellow-bg);
  border-color: #fde68a;
}

.detail-decision p {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.55;
}

.detail-tier {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.detail-tier.a { background: var(--green-bg); color: var(--green); }
.detail-tier.b { background: #dbeafe; color: #1d4ed8; }
.detail-tier.c { background: #f3e8ff; color: #7c3aed; }
.detail-tier.hold { background: #ccfbf1; color: #0f766e; }

.detail-theme-members {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.detail-theme-members button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  color: var(--accent);
}

.detail-footnote {
  font-size: 10px;
  color: var(--ink-faint);
  margin-top: 16px;
  line-height: 1.5;
}

/* ── Loading ── */
.global-loading {
  position: fixed;
  inset: 0;
  background: rgba(250, 248, 244, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 999;
}

.global-loading.hidden {
  display: none;
}

.global-loading .spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: usSpin 0.8s linear infinite;
}

@keyframes usSpin {
  to { transform: rotate(360deg); }
}

.global-loading .msg {
  font-size: 14px;
  color: var(--ink-soft);
}

/* ── v3 季報表 + 交叉圖表 ── */
.us-page-divider {
  width: 100%;
  grid-column: 1 / -1;
  margin: 8px 0 4px;
  padding: 8px 4px 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}

.us-v3-panel {
  margin-top: 12px;
  padding: 12px 14px 14px;
  border-radius: var(--us-r-sm);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(99, 102, 241, 0.18);
}

.us-v3-kicker {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.us-v3-snapshot {
  margin-bottom: 10px;
}

.us-v3-snapshot__head h3 {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.us-v3-snapshot__head p {
  margin: 0 0 6px;
  font-size: 10px;
  color: var(--ink-soft);
}

.us-v3-snapshot__loading,
.us-v3-snapshot__empty {
  margin: 0;
  font-size: 11px;
  color: var(--ink-soft);
}

.us-v3-snapshot-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.us-v3-snapshot-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 11px;
  line-height: 1.4;
}

.us-v3-snapshot-table th,
.us-v3-snapshot-table td {
  padding: 4px 6px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.us-v3-snapshot-table th:first-child,
.us-v3-snapshot-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--ink-soft);
}

.us-v3-snapshot-table td small {
  font-size: 9px;
  font-weight: 400;
  color: var(--ink-faint);
}

.us-v3-snapshot-table thead th {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.06);
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}

.stock-etf-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  vertical-align: middle;
}

.stock-card--etf {
  border-style: dashed;
}

.theme-map--etf {
  margin-top: 12px;
}

.theme-card--etf .theme-card-head strong {
  color: var(--theme-accent, var(--accent));
}

/* 交叉圖（對齊產業工作台 compact） */
.us-lens .iw-fund-charts {
  margin-top: 6px;
}

.us-lens .iw-fund-charts--compact {
  max-width: 100%;
}

.us-lens .iw-fund-charts__compact-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-bottom: 6px;
  width: 100%;
}

.us-lens .iw-fund-charts__compact-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.us-lens .iw-fund-charts__compact-meta {
  font-size: 10px;
  color: var(--ink-soft);
}

.us-lens .iw-fund-charts__warn {
  color: #b45309;
}

.us-lens .iw-fund-charts__zoom-hint {
  font-size: 10px;
  color: var(--accent);
  margin-left: auto;
}

.us-lens .iw-fund-charts__stage[data-fund-chart-zoom] {
  cursor: zoom-in;
}

.us-lens .iw-fund-charts-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100020;
}

.us-lens .iw-fund-charts-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.us-lens .iw-fund-charts-lightbox__dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  height: 90vh;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.us-lens .iw-fund-charts-lightbox__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.us-lens .iw-fund-charts-lightbox__head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.us-lens .iw-fund-charts-lightbox__close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-soft);
  padding: 2px 6px;
}

.us-lens .iw-fund-charts-lightbox__plot {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

body.iw-fund-lightbox-open {
  overflow: hidden;
}

.us-lens .iw-fund-charts__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.us-lens .iw-fund-charts__tab {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  line-height: 1.4;
  cursor: pointer;
  font-family: inherit;
}

.us-lens .iw-fund-charts__tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.us-lens .iw-fund-charts__stage {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  padding: 0;
}

.us-lens .iw-fund-charts--compact .iw-fund-charts__plot {
  min-height: 210px;
  height: 210px;
  margin: 0;
  padding: 0;
}

.us-lens .iw-fund-charts__caption {
  margin: 4px 0 0;
  font-size: 10px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.us-lens .iw-fund-charts__loading,
.us-lens .iw-fund-charts__err,
.us-lens .iw-fund-charts__hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.us-lens .iw-fund-charts__loading {
  color: var(--ink-soft);
}

.us-lens .iw-fund-charts__err {
  color: #b91c1c;
}

.us-lens .iw-fund-charts__hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-soft);
}

/* ── 爆炸圖 / Hub iframe 內嵌統一個股卡 ── */
body.us-embed-stock-card {
  overflow: auto;
  background: var(--surface, #faf8f4);
}

body.us-embed-stock-card .global-loading,
body.us-embed-stock-card .us-wrap,
body.us-embed-stock-card .detail-drawer-backdrop,
body.us-embed-stock-card .hub-top-nav,
body.us-embed-stock-card .hub-quick-nav {
  display: none !important;
}

.us-embed-shell {
  min-height: 100vh;
  padding: 0;
}

.us-embed-scroll {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 12px 24px;
}

.us-embed-scroll .stock-card--panel {
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  box-shadow: none;
}

body.us-embed-stock-card .card-foot {
  display: none;
}

.us-drawer-supply-chain {
  margin-top: 4px;
}

/* ── 統一個股卡（單一頁首 + 單一頁籤列） ── */
.usc-card {
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.usc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line, #e2e8f0);
  border-top: 3px solid var(--stock-accent, #64748b);
  background: linear-gradient(180deg, #f8fafc, #fff);
}

.usc-head__id {
  min-width: 0;
}

.usc-head__title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.usc-head__title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.usc-head__title h2 em {
  font-style: normal;
  font-weight: 600;
  font-size: 13px;
  color: #64748b;
  margin-left: 6px;
}

.usc-head__id .detail-meta-chips {
  margin-top: 8px;
}

.usc-head__quote {
  text-align: right;
  flex-shrink: 0;
}

.usc-head__price {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.usc-head__price span {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  margin-left: 4px;
}

.usc-head__chg {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
}

.usc-head__quote.up .usc-head__price,
.usc-head__quote.up .usc-head__chg {
  color: #16a34a;
}

.usc-head__quote.down .usc-head__price,
.usc-head__quote.down .usc-head__chg {
  color: #dc2626;
}

.usc-tabs__nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line, #e2e8f0);
  background: #fafafa;
  position: sticky;
  top: 0;
  z-index: 5;
}

.usc-tabs__btn {
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.usc-tabs__btn:hover {
  background: #eef2f7;
  color: #1a3a6b;
}

.usc-tabs__btn.active {
  background: #1a3a6b;
  color: #fff;
}

.usc-panel {
  display: none;
  padding: 14px 16px 18px;
}

.usc-panel.active {
  display: block;
}

.usc-panel .detail-kicker:first-child,
.usc-panel .detail-meta-chips:first-child,
.usc-panel .us-v3-panel {
  margin-top: 0;
}

.usc-foot {
  padding: 10px 16px 14px;
  font-size: 10px;
  color: #94a3b8;
  border-top: 1px solid var(--line, #e2e8f0);
}

.usc-tv-slot {
  min-height: 320px;
}

.us-sc-h4 {
  margin: 16px 0 8px;
  font-size: 12px;
  font-weight: 800;
  color: #1a3a6b;
}

.us-sc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin: 0;
}

.us-sc-grid dt {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
}

.us-sc-grid dd {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.us-sc-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

@media (min-width: 520px) {
  .us-sc-metrics { grid-template-columns: repeat(4, 1fr); }
}

.us-sc-metrics span {
  display: block;
  font-size: 10px;
  color: #64748b;
}

.us-sc-metrics strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  color: #c0392b;
}

.us-sc-bars {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 120px;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fafafa;
}

.us-sc-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.us-sc-bar__fill {
  width: 100%;
  max-width: 36px;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
}

.us-sc-bar__label,
.us-sc-bar__val {
  font-size: 10px;
  color: #64748b;
  margin-top: 4px;
}

.us-sc-bar__val {
  font-weight: 700;
  color: #1a3a6b;
}

.us-sc-ai-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.us-sc-ai-bar__track {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: #ecf0f1;
  overflow: hidden;
}

.us-sc-ai-bar__fill {
  height: 100%;
  background: #4472c4;
  border-radius: 999px;
}

.us-sc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.us-sc-chip {
  border: 1px solid #bdc3c7;
  background: #f0f4fc;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  color: #2c3e50;
}

.us-sc-jensen {
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 1px solid #d4a012;
  background: #fff9e6;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #9a7b0a;
}

.us-sc-muted {
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

.us-sc-inst {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.us-sc-inst span {
  display: block;
  font-size: 10px;
  color: #64748b;
}

.us-sc-inst strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  color: #95a5a6;
}

.us-sc-tv {
  width: 100%;
  height: 280px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-top: 8px;
}

.us-sc-flow__hint {
  font-size: 11px;
  color: #566573;
  line-height: 1.5;
  margin: 0 0 10px;
}

.us-sc-flow__note {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid #e8eef4;
  border-radius: 6px;
  background: #fff;
  color: #2c3e50;
}

.us-sc-flow__note.muted {
  border: none;
  background: transparent;
  padding: 0;
  color: #7f8c8d;
}

.us-sc-flow__canvas {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fafafa;
  padding: 12px;
}

.us-sc-flow__label {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  margin: 8px 0 6px;
}

.us-sc-flow__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.us-sc-flow__row--peers {
  align-items: center;
}

.us-sc-flow__peer-sep {
  color: #95a5a6;
  font-weight: 700;
}

.us-sc-flow__arrow {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: #e67e22;
  padding: 4px 0;
}

.us-sc-node {
  border: 2px solid #bdc3c7;
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  text-align: center;
  min-width: 72px;
}

.us-sc-node--focus {
  border-color: #d4a012;
  background: #fff9e6;
  box-shadow: 0 0 10px rgba(212, 160, 18, 0.2);
}

.us-sc-node--compact {
  padding: 6px 8px;
  min-width: 60px;
}

.us-sc-node strong {
  display: block;
  font-size: 11px;
  color: #2c3e50;
}

.us-sc-node__star {
  color: #d4a012;
  margin-right: 2px;
}

.us-sc-node__tk {
  display: block;
  font-size: 10px;
  color: #7f8c8d;
}

.us-sc-node__sub {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  font-weight: 600;
  color: #e67e22;
}

.us-sc-empty {
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
  margin: 8px 0 0;
}
