:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --line: #dbe4f0;
  --text: #122033;
  --muted: #66758a;
  --title: #0d1828;
  --brand: #1768e5;
  --brand-soft: rgba(23, 104, 229, 0.08);
  --positive: #db3a34;
  --negative: #17986a;
  --shadow: 0 18px 40px rgba(16, 39, 68, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(23, 104, 229, 0.08), transparent 26%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero,
.panel,
.search-item,
.fund-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 360px;
  gap: 20px;
  margin-bottom: 24px;
}

.hero-copy,
.hero-card,
.panel {
  border-radius: 28px;
  padding: 28px;
}

.hero-copy {
  background:
    linear-gradient(135deg, #ffffff 0%, #f5faff 100%);
}

.eyebrow,
.panel-kicker,
.fund-type {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1,
.panel h2,
.search-item h3,
.fund-card h3 {
  margin: 0;
  color: var(--title);
  font-family: "Outfit", sans-serif;
}

.hero h1 {
  max-width: 10ch;
  font-size: clamp(34px, 4.4vw, 58px);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.hero-text,
.panel-desc,
.code-line,
.footnote {
  color: var(--muted);
}

.hero-text {
  max-width: 50ch;
  margin: 16px 0 0;
  font-size: 16px;
  line-height: 1.8;
}

.data-status-banner,
.drawer-grid,
.api-grid {
  display: grid;
  gap: 12px;
}

.data-status-banner {
  margin-top: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.status-banner-item {
  min-width: 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f8fbff;
  border: 1px solid #e7eef7;
}

.status-banner-item span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.status-banner-item strong {
  display: block;
  margin-top: 6px;
  color: var(--title);
  font-size: 14px;
  line-height: 1.5;
}

.hero-meta,
.hero-stats,
.layout,
.search-results,
.watchlist-grid,
.search-metrics,
.fund-metrics {
  display: grid;
  gap: 16px;
}

.hero-meta {
  margin-top: 22px;
  grid-auto-flow: column;
  justify-content: start;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.pill.subtle {
  background: #eef4fb;
  color: var(--text);
}

.hero-card {
  background: linear-gradient(180deg, #12355a 0%, #0f2740 100%);
  color: #ffffff;
}

.hero-card-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}

.hero-stats {
  margin-top: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-item {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
}

.summary-item span {
  font-size: 12px;
  opacity: 0.72;
}

.summary-item strong,
.metric-value {
  font-family: "Outfit", sans-serif;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.summary-item strong {
  font-size: clamp(18px, 2.2vw, 28px);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.layout {
  grid-template-columns: 380px minmax(0, 1fr);
  align-items: start;
}

.left-stack,
.position-form {
  display: grid;
  gap: 20px;
}

.auth-panel,
.auth-guest,
.auth-user,
.auth-actions {
  display: grid;
  gap: 14px;
}

.auth-help {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.auth-guest label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.auth-guest input {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbff;
  color: var(--text);
}

.auth-guest input.input-error {
  border-color: rgba(219, 58, 52, 0.45);
  box-shadow: 0 0 0 4px rgba(219, 58, 52, 0.08);
  background: #fff7f7;
}

.auth-user {
  display: none;
}

.auth-user-card,
.auth-status {
  padding: 14px 16px;
  border-radius: 16px;
  background: #f8fbff;
  border: 1px solid #e7eef7;
}

.auth-user-card span,
.auth-status span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.auth-user-card strong,
.auth-status strong {
  display: block;
  margin-top: 6px;
  color: var(--title);
  font-size: 14px;
}

.auth-status {
  min-height: 58px;
}

.auth-status.positive strong {
  color: var(--negative);
}

.auth-status.negative strong {
  color: var(--positive);
}

.focus-detail,
.focus-grid,
.focus-metric-row,
.trend-bars {
  display: grid;
  gap: 14px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.panel h2 {
  font-size: 28px;
  line-height: 1.12;
}

.panel-desc {
  margin: 0;
  max-width: 320px;
  font-size: 14px;
  line-height: 1.7;
}

.focus-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.focus-header h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  font-family: "Outfit", sans-serif;
  color: var(--title);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.strong,
.status-badge.warm {
  background: rgba(219, 58, 52, 0.1);
  color: var(--positive);
}

.status-badge.weak,
.status-badge.cool {
  background: rgba(23, 152, 106, 0.1);
  color: var(--negative);
}

.status-badge.flat {
  background: #eef4fb;
  color: var(--text);
}

.focus-metric-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.focus-metric,
.focus-stat,
.trend-card,
.focus-note {
  padding: 16px;
  border-radius: 18px;
  background: #f8fbff;
  border: 1px solid #e8f0f8;
}

.focus-metric span,
.focus-stat span,
.trend-copy span,
.focus-note span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.focus-metric strong,
.focus-stat strong,
.focus-note strong {
  display: block;
  margin-top: 6px;
  font-family: "Outfit", sans-serif;
  font-size: 22px;
  line-height: 1.1;
  color: var(--title);
}

.trend-card {
  display: grid;
  gap: 14px;
}

.trend-copy strong {
  display: block;
  margin-top: 4px;
  color: var(--title);
  font-size: 15px;
}

.trend-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.trend-bars {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  min-height: 108px;
}

.trend-bar {
  display: block;
  width: 100%;
  border-radius: 999px;
}

.trend-bar.up {
  background: linear-gradient(180deg, #ffb3ae 0%, var(--positive) 100%);
}

.trend-bar.down {
  background: linear-gradient(180deg, #8ce2bf 0%, var(--negative) 100%);
}

.focus-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.focus-note {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.focus-note strong {
  margin-top: 0;
}

.watch-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #f8fbff;
  border: 1px solid #e8f0f8;
}

.toolbar-field {
  display: grid;
  gap: 8px;
  min-width: 220px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.toolbar-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--text);
}

.toolbar-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.toolbar-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.search-box {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.search-box input {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbff;
  color: var(--text);
}

.search-box input:focus {
  outline: none;
  border-color: rgba(23, 104, 229, 0.45);
  box-shadow: 0 0 0 4px rgba(23, 104, 229, 0.1);
  background: #ffffff;
}

.position-form label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.position-form input,
.position-form select,
.toolbar-field select {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbff;
  color: var(--text);
}

.position-form input:focus,
.position-form select:focus,
.toolbar-field select:focus {
  outline: none;
  border-color: rgba(23, 104, 229, 0.45);
  box-shadow: 0 0 0 4px rgba(23, 104, 229, 0.1);
  background: #ffffff;
}

.search-item,
.fund-card {
  border-radius: 20px;
  padding: 18px;
}

.fund-card-active {
  border-color: rgba(23, 104, 229, 0.45);
  box-shadow: 0 0 0 4px rgba(23, 104, 229, 0.08), var(--shadow);
}

.search-item {
  display: grid;
  gap: 14px;
}

.search-item h3,
.fund-card h3 {
  font-size: 21px;
  line-height: 1.25;
}

.code-line {
  margin: 8px 0 0;
  font-size: 13px;
}

.search-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fund-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.metric-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 16px;
  background: var(--panel-soft);
  border: 1px solid #ecf2f8;
}

.metric-label {
  font-size: 12px;
  color: var(--muted);
}

.metric-value {
  margin-top: 4px;
  font-size: 24px;
}

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

.fund-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.secondary-btn {
  justify-self: start;
  background: var(--brand);
  color: #ffffff;
}

.ghost-btn {
  background: #eef4fb;
  color: var(--text);
}

.secondary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
}

.secondary-btn:disabled,
.ghost-btn:disabled,
.position-form input:disabled,
.position-form select:disabled,
.toolbar-field select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.empty-state {
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed #d7e1ec;
  background: #f8fbff;
  color: var(--muted);
}

.footnote {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
}

.drawer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.drawer-open {
  pointer-events: auto;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 18, 32, 0.34);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.drawer-open .drawer-backdrop {
  opacity: 1;
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(560px, 100%);
  height: 100%;
  padding: 24px;
  background: #ffffff;
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px rgba(7, 18, 32, 0.12);
  transform: translateX(100%);
  transition: transform 0.24s ease;
  overflow-y: auto;
}

.drawer-open .drawer-panel {
  transform: translateX(0);
}

.drawer-head,
.drawer-summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.drawer-head {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid #e7eef7;
}

.drawer-content {
  display: grid;
  gap: 18px;
}

.drawer-summary h3,
.drawer-section h3 {
  margin: 0;
  color: var(--title);
  font-family: "Outfit", sans-serif;
}

.drawer-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.drawer-section {
  display: grid;
  gap: 12px;
}

.history-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: #f8fbff;
  border: 1px solid #e7eef7;
}

.history-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.history-head span {
  color: var(--muted);
  font-size: 12px;
}

.history-head strong {
  color: var(--title);
  font-size: 13px;
}

.history-chart {
  height: 140px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(23, 104, 229, 0.06), rgba(23, 104, 229, 0.01));
  padding: 8px;
}

.history-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.history-line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.api-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.api-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: #f8fbff;
  border: 1px solid #e7eef7;
}

.api-item span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.api-item strong {
  display: block;
  margin-top: 6px;
  color: var(--title);
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

.positive {
  color: var(--positive);
}

.negative {
  color: var(--negative);
}

@media (max-width: 1080px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 20px, 1220px);
    padding-top: 18px;
  }

  .hero-copy,
  .hero-card,
  .panel {
    padding: 20px;
  }

  .hero-meta {
    grid-auto-flow: row;
  }

  .hero-stats,
  .data-status-banner,
  .focus-metric-row,
  .focus-grid,
  .drawer-grid,
  .api-grid,
  .search-metrics,
  .fund-metrics {
    grid-template-columns: 1fr;
  }

  .watch-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-head,
  .focus-header,
  .drawer-head,
  .history-head,
  .drawer-summary,
  .fund-card-top {
    flex-direction: column;
  }

  .panel h2 {
    font-size: 24px;
  }

  .secondary-btn,
  .ghost-btn {
    width: 100%;
  }

  .fund-actions {
    width: 100%;
    flex-direction: column;
  }

  .drawer-panel {
    width: 100%;
    padding: 18px;
  }
}
