.fund-intent-view {
  --fund-intent-series: var(--chart-series-4, #478a82);
  overflow-y: auto;
  padding: 0 26px 28px;
  background: var(--ui-canvas, #f7f5f1);
  color: var(--ui-text, #1d2025);
}

.fund-intent-panel {
  display: grid;
  gap: 16px;
  width: min(1220px, 100%);
  margin: 0 auto;
}

.fund-intent-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.fund-intent-header h1 {
  margin: 5px 0 7px;
  font-size: clamp(27px, 3vw, 36px);
  letter-spacing: -.035em;
}

.fund-intent-header p {
  max-width: 720px;
  margin: 0;
  color: var(--ui-text-secondary, #545b63);
  line-height: 1.65;
}

.fund-intent-code-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 9px 13px;
  border: 1px solid var(--tool-accent-ring, rgba(40, 119, 137, .2));
  border-radius: 999px;
  background: var(--tool-accent-soft, #edf5f6);
  color: var(--tool-accent, #287789);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.fund-intent-header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.fund-intent-code-badge span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tool-accent, #287789);
  box-shadow: 0 0 0 4px var(--tool-accent-ring, rgba(40, 119, 137, .12));
}

.fund-intent-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1.05fr) minmax(150px, .8fr) minmax(200px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--ui-line, #dedad5);
  border-radius: var(--ui-radius, 8px);
  background: var(--ui-surface, #fff);
  box-shadow: 0 10px 30px rgba(29, 32, 37, .055);
}

.fund-intent-field {
  display: grid;
  gap: 7px;
}

.fund-intent-field > span {
  color: var(--ui-text-secondary, #545b63);
  font-size: 12px;
  font-weight: 700;
}

.fund-intent-field select,
.fund-intent-field input {
  width: 100%;
  height: var(--ui-control-height, 40px);
  border: 1px solid var(--ui-control-border, #8c8781);
  border-radius: var(--ui-radius, 8px);
  outline: none;
  background: var(--ui-surface, #fff);
  color: var(--ui-text, #1d2025);
  font: inherit;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.fund-intent-field select { padding: 0 34px 0 12px; }
.fund-intent-field input { padding: 0 12px; }

.fund-intent-field select:focus,
.fund-intent-field input:focus {
  border-color: var(--ui-primary, #a61e3a);
  box-shadow: var(--ui-shadow-focus, 0 0 0 3px rgba(166, 30, 58, .18));
}

.fund-intent-active-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--ui-control-height, 40px);
  color: var(--ui-text-secondary, #545b63);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.fund-intent-active-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.fund-intent-active-toggle > span {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--ui-surface-strong, #ece7e2);
  transition: background .18s ease;
}

.fund-intent-active-toggle > span::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(29, 32, 37, .25);
  transition: transform .18s ease;
}

.fund-intent-active-toggle input:checked + span { background: var(--ui-primary, #a61e3a); }
.fund-intent-active-toggle input:focus-visible + span { outline: 2px solid var(--brand-primary, #a61e3a); outline-offset: 2px; box-shadow: var(--ui-shadow-focus, 0 0 0 3px rgba(166, 30, 58, .18)); }
.fund-intent-active-toggle input:checked + span::after { transform: translateX(14px); }

.fund-intent-query-btn {
  height: var(--ui-control-height, 40px);
  padding: 0 18px;
  border: 0;
  border-radius: var(--ui-radius, 8px);
  background: var(--ui-primary, #a61e3a);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(166, 30, 58, .2);
}

.fund-intent-query-btn:hover { background: var(--ui-primary-hover, #85162e); }
.fund-intent-query-btn:disabled { cursor: wait; opacity: .65; }

.fund-intent-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 34px;
}

.fund-intent-direction-switch {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--ui-line, #dedad5);
  border-radius: var(--ui-radius, 8px);
  background: var(--ui-surface-subtle, #f2efeb);
}

.fund-intent-direction-switch button {
  min-height: 29px;
  padding: 0 13px;
  border: 0;
  border-radius: calc(var(--ui-radius, 8px) - 1px);
  background: transparent;
  color: var(--ui-text-secondary, #545b63);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.fund-intent-direction-switch button.active {
  background: var(--ui-primary-soft, #faecef);
  color: var(--ui-primary, #a61e3a);
  box-shadow: 0 2px 8px rgba(29, 32, 37, .1);
}

.fund-intent-status {
  color: var(--ui-text-muted, #697078);
  font-size: 12px;
  text-align: right;
}

.fund-intent-status.success { color: var(--ui-success, #137a48); }
.fund-intent-status.warning { color: var(--ui-warning, #9a6700); }
.fund-intent-status.error { color: var(--ui-danger, #b42318); }

.fund-intent-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.fund-intent-stats article {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 112px;
  padding: 17px 18px;
  overflow: hidden;
  border: 1px solid var(--ui-line, #dedad5);
  border-radius: var(--ui-radius, 8px);
  background: var(--ui-surface, #fff);
}

.fund-intent-stats article::after {
  content: '';
  position: absolute;
  right: -22px;
  bottom: -34px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(73, 111, 150, .055);
}

.fund-intent-stats article.bullish::after { background: rgba(201, 67, 54, .07); }
.fund-intent-stats article.bearish::after { background: rgba(22, 129, 93, .075); }
.fund-intent-stats span { color: var(--ui-text-secondary, #545b63); font-size: 12px; font-weight: 650; }
.fund-intent-stats strong { font-size: 28px; line-height: 1.15; letter-spacing: -.03em; }
.fund-intent-stats .bullish strong { color: var(--market-up, #c94336); }
.fund-intent-stats .bearish strong { color: var(--market-down, #16815d); }
.fund-intent-stats small { color: var(--ui-text-muted, #697078); font-size: 11px; }

.fund-intent-empty {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-height: 260px;
  padding: 54px 20px;
  border: 1px dashed var(--ui-line-strong, #c9c3bc);
  border-radius: var(--ui-radius, 8px);
  background: linear-gradient(180deg, rgba(255, 255, 255, .78), rgba(242, 239, 235, .62));
  text-align: center;
}

.fund-intent-empty strong { margin-top: 8px; font-size: 15px; }
.fund-intent-empty p { max-width: 520px; margin: 0; color: var(--ui-text-muted, #697078); font-size: 12px; line-height: 1.7; }
.fund-intent-empty-mark { display: flex; align-items: end; gap: 5px; height: 36px; }
.fund-intent-empty-mark span { width: 7px; border-radius: 5px; background: var(--chart-series-1, #496f96); opacity: .62; }
.fund-intent-empty-mark span:nth-child(1) { height: 18px; }
.fund-intent-empty-mark span:nth-child(2) { height: 32px; background: var(--chart-series-1, #496f96); opacity: 1; }
.fund-intent-empty-mark span:nth-child(3) { height: 24px; background: var(--chart-series-4, #478a82); opacity: .82; }

.fund-intent-result {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, .75fr);
  gap: 14px;
  align-items: start;
}

.fund-intent-table-card,
.fund-intent-detail {
  border: 1px solid var(--ui-line, #dedad5);
  border-radius: var(--ui-radius, 8px);
  background: var(--ui-surface, #fff);
  box-shadow: 0 10px 30px rgba(29, 32, 37, .045);
}

.fund-intent-table-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 0 17px;
  border-bottom: 1px solid var(--ui-line, #dedad5);
}

.fund-intent-table-card > header div { display: flex; align-items: baseline; gap: 10px; }
.fund-intent-table-card > header span { font-size: 14px; font-weight: 750; }
.fund-intent-table-card > header strong,
.fund-intent-table-card > header small { color: var(--ui-text-muted, #697078); font-size: 11px; font-weight: 600; }
.fund-intent-table-scroll { max-height: 610px; overflow: auto; }

.fund-intent-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.fund-intent-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 11px 13px;
  border-bottom: 1px solid var(--ui-line, #dedad5);
  background: var(--ui-surface-subtle, #f2efeb);
  color: var(--ui-text-secondary, #545b63);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.fund-intent-table th:first-child,
.fund-intent-table th:nth-child(2) { text-align: left; }
.fund-intent-table td { padding: 12px 13px; border-bottom: 1px solid var(--ui-line, #dedad5); text-align: right; white-space: nowrap; }
.fund-intent-table td:first-child,
.fund-intent-table td:nth-child(2) { text-align: left; }
.fund-intent-table tbody tr { cursor: pointer; transition: background .14s ease; }
.fund-intent-table tbody tr:hover { background: var(--ui-surface-subtle, #f2efeb); }
.fund-intent-table tbody tr.selected { background: var(--ui-primary-soft, #faecef); box-shadow: inset 3px 0 var(--ui-primary, #a61e3a); }
.fund-intent-table td:first-child strong,
.fund-intent-table td:first-child span { display: block; }
.fund-intent-table td:first-child strong { color: var(--ui-text, #1d2025); font-size: 12px; }
.fund-intent-table td:first-child span { margin-top: 3px; color: var(--ui-text-muted, #697078); font-size: 10px; }
.fund-intent-action span { display: block; line-height: 1.55; }
.fund-intent-table .positive,
.fund-intent-detail .positive { color: var(--market-up, #c94336); }
.fund-intent-table .negative,
.fund-intent-detail .negative { color: var(--market-down, #16815d); }
.fund-intent-no-result { height: 180px; color: var(--ui-text-muted, #697078); text-align: center !important; }

.fund-intent-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border: 1px solid transparent;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

.fund-intent-badge.intent-long { border-color: rgba(201, 67, 54, .28); background: var(--ui-surface, #fff); color: var(--market-up, #c94336); }
.fund-intent-badge.intent-short { border-color: rgba(22, 129, 93, .28); background: var(--ui-surface, #fff); color: var(--market-down, #16815d); }
.fund-intent-badge.intent-neutral { background: var(--ui-surface-strong, #ece7e2); color: var(--ui-text-secondary, #545b63); }

.fund-intent-detail {
  position: sticky;
  top: 0;
  min-height: 390px;
  padding: 19px;
}

.fund-intent-detail-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fund-intent-detail-top > div > span { color: var(--ui-text-muted, #697078); font-size: 11px; }
.fund-intent-detail-top h2 { margin: 4px 0 0; font-size: 21px; }
.fund-intent-reason { min-height: 58px; margin: 16px 0; color: var(--ui-text-secondary, #545b63); font-size: 12px; line-height: 1.72; }
.fund-intent-confidence-line { display: grid; grid-template-columns: 1fr auto; gap: 7px; align-items: center; font-size: 11px; color: var(--ui-text-muted, #697078); }
.fund-intent-confidence-line strong { color: var(--ui-text, #1d2025); font-size: 12px; }
.fund-intent-confidence-line i { grid-column: 1 / -1; height: 5px; overflow: hidden; border-radius: 999px; background: var(--ui-surface-strong, #ece7e2); }
.fund-intent-confidence-line b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--chart-series-1, #496f96), var(--chart-series-4, #478a82)); }

.fund-intent-position-grid,
.fund-intent-pnl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.fund-intent-position-grid div,
.fund-intent-pnl-grid div { padding: 10px 11px; border-radius: var(--ui-radius, 8px); background: var(--ui-surface-subtle, #f2efeb); }
.fund-intent-position-grid dt,
.fund-intent-pnl-grid span { color: var(--ui-text-muted, #697078); font-size: 10px; }
.fund-intent-position-grid dd { margin: 4px 0 0; color: var(--ui-text, #1d2025); font-size: 13px; font-weight: 750; }
.fund-intent-pnl-title { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.fund-intent-pnl-title span { font-size: 12px; font-weight: 750; }
.fund-intent-pnl-title small { color: var(--ui-text-muted, #697078); font-size: 10px; }
.fund-intent-pnl-grid { margin-top: 8px; }
.fund-intent-pnl-grid strong { display: block; margin-top: 4px; color: var(--ui-text, #1d2025); font-size: 12px; }
.fund-intent-detail > footer { display: flex; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--ui-line, #dedad5); color: var(--ui-text-muted, #697078); font-size: 9px; }
.fund-intent-detail-empty { display: grid; min-height: 330px; place-items: center; color: var(--ui-text-muted, #697078); font-size: 12px; text-align: center; }

.fund-intent-disclaimer {
  display: flex;
  gap: 10px;
  padding: 11px 14px;
  border-left: 3px solid var(--ui-warning, #9a6700);
  border-radius: 3px 10px 10px 3px;
  background: rgba(154, 103, 0, .08);
  color: #6f500e;
  font-size: 11px;
  line-height: 1.6;
}

.fund-intent-disclaimer strong { white-space: nowrap; }

@media (max-width: 1020px) {
  .fund-intent-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fund-intent-query-btn { min-width: 160px; }
  .fund-intent-result { grid-template-columns: 1fr; }
  .fund-intent-detail { position: static; }
}

@media (max-width: 720px) {
  .fund-intent-view { padding: 0 12px 20px; }
  .fund-intent-header { display: grid; gap: 12px; }
  .fund-intent-code-badge { justify-self: start; }
  .fund-intent-header-actions { justify-self: start; }
  .fund-intent-controls { grid-template-columns: 1fr; padding: 13px; }
  .fund-intent-query-btn { width: 100%; }
  .fund-intent-toolbar { align-items: stretch; flex-direction: column; }
  .fund-intent-direction-switch { display: grid; grid-template-columns: repeat(4, 1fr); }
  .fund-intent-direction-switch button { padding: 0 7px; }
  .fund-intent-status { min-height: 18px; text-align: left; }
  .fund-intent-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fund-intent-stats article { min-height: 98px; padding: 14px; }
  .fund-intent-stats strong { font-size: 23px; }
  .fund-intent-table-scroll { max-height: none; overflow: visible; }
  .fund-intent-table thead { display: none; }
  .fund-intent-table,
  .fund-intent-table tbody,
  .fund-intent-table tr,
  .fund-intent-table td { display: block; width: 100%; }
  .fund-intent-table tbody { padding: 7px; }
  .fund-intent-table tbody tr { margin: 8px 0; padding: 8px 10px; border: 1px solid var(--ui-line, #dedad5); border-radius: var(--ui-radius, 8px); }
  .fund-intent-table tbody tr.selected { box-shadow: inset 3px 0 var(--ui-primary, #a61e3a); }
  .fund-intent-table td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 3px; border: 0; text-align: right !important; white-space: normal; }
  .fund-intent-table td::before { content: attr(data-label); color: var(--ui-text-muted, #697078); font-size: 10px; }
  .fund-intent-table td:first-child { align-items: flex-start; }
  .fund-intent-action span { display: inline; margin-left: 8px; }
  .fund-intent-detail { padding: 16px; }
  .fund-intent-disclaimer { display: grid; }
}
