:root {
  color-scheme: dark;
  --bg: #0b1118;
  --panel: #151c24;
  --panel-soft: #111820;
  --text: #f5fbff;
  --muted: #8ea0b4;
  --line: #2a3440;
  --brand: #3b82f6;
  --brand-dark: #60a5fa;
  --accent: #ff6b2c;
  --warn: #eab308;
  --ok: #22c55e;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

.shell {
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 20px 16px 36px;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 360px;
  display: grid;
  place-items: center;
}

.login-card {
  width: min(440px, 100%);
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-copy,
.customer-line {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.auth-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.auth-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101720;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

.auth-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
}

.auth-panel {
  display: none;
}

.auth-panel.active {
  display: grid;
}

.topbar,
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 2px 18px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow,
h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 17px;
}

.icon-button,
.primary,
.ghost,
.tab,
select,
input {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.icon-button {
  width: 44px;
  height: 44px;
  background: var(--panel);
  color: var(--brand);
  font-size: 24px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.market-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
}

.market-strip span {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #18212b;
  color: var(--muted);
  font-weight: 700;
}

.market-strip small {
  margin-left: 8px;
  font-weight: 400;
}

.market-strip .is-live {
  color: var(--ok);
  border-color: #16a34a;
  background: rgba(22, 163, 74, 0.12);
}

.market-strip .is-closed {
  color: #94a3b8;
  border-color: #2a3440;
  background: #18212b;
}

.market-strip .fresh {
  color: #86efac;
  background: transparent;
  border-color: transparent;
}

.live-clock {
  margin-left: auto;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #17202a;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.dash-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.dash-metrics article {
  min-height: 106px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #151c24;
}

.dash-metrics span,
.dash-metrics small {
  color: var(--muted);
  font-size: 13px;
}

.dash-metrics strong {
  display: block;
  margin: 10px 0 5px;
  font-size: 30px;
  line-height: 1;
}

.dash-metrics em {
  margin-left: 4px;
  font-size: 14px;
  font-style: normal;
  font-weight: 500;
}

.sort-row,
.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.sort-chip {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #151c24;
  color: var(--muted);
  font-weight: 700;
}

.sort-chip.active {
  color: #60a5fa;
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.12);
}

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

.legend-row i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 50%;
}

.legend-row .green { background: #22c55e; }
.legend-row .yellow { background: #eab308; }
.legend-row .red { background: #ef4444; }
.legend-row .blue { background: #38bdf8; }

.status-grid,
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  min-height: 82px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 22px;
}

.tabs,
.main-nav {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 0 10px;
  background: var(--bg);
}

.tab {
  min-height: 40px;
  padding: 8px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
}

.hot-tab {
  position: relative;
}

.flame {
  display: inline-block;
  width: 9px;
  height: 13px;
  margin-right: 4px;
  border-radius: 9px 9px 9px 2px;
  background: linear-gradient(180deg, #ffbf47, #dc2626);
  transform: rotate(-12deg);
  animation: flamePulse 0.9s infinite alternate ease-in-out;
  color: transparent;
  vertical-align: -2px;
}

@keyframes flamePulse {
  from {
    transform: rotate(-12deg) scale(0.9);
    filter: drop-shadow(0 0 2px rgba(220, 38, 38, 0.25));
  }
  to {
    transform: rotate(-6deg) scale(1.12);
    filter: drop-shadow(0 0 7px rgba(220, 38, 38, 0.45));
  }
}

.index-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 14px;
  align-items: stretch;
  height: 248px;
  margin-top: 12px;
  padding: 10px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #151c24;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.index-hero h2 {
  font-size: 26px;
}

.index-hero p {
  margin-top: 10px;
  max-width: 680px;
  color: var(--muted);
  line-height: 1.8;
}

.hero-score {
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 16px;
  border-radius: 8px;
  background: #101720;
  text-align: center;
}

.hero-score span {
  color: var(--muted);
  font-size: 13px;
}

.hero-score strong {
  color: var(--brand-dark);
  font-size: 18px;
}

.filter-loading {
  color: var(--muted);
  font-size: 14px;
}

.filter-area {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  min-width: 0;
  height: 100%;
  min-height: 0;
}

.filter-title {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 8px;
  min-height: 0;
}

.filter-title h2 {
  font-size: 26px;
  line-height: 1.15;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, max-content));
  align-items: stretch;
  justify-content: start;
  gap: 10px;
  padding-top: 2px;
  min-height: 0;
}

.filter-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 6px 9px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101720;
}

.filter-title .filter-group {
  margin-top: 8px;
  align-self: stretch;
}

.filter-fee {
  max-width: 230px;
}

.filter-scale {
  width: min(290px, 100%);
}

.filter-premium {
  width: min(250px, 100%);
}

.filter-volume {
  width: min(270px, 100%);
}

.filter-group legend {
  padding: 0 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.filter-checks {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding-top: 4px;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #151c24;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  line-height: 1.25;
}

.check-pill input {
  width: 11px;
  height: 11px;
  padding: 0;
  accent-color: var(--brand);
}

.check-pill:has(input:checked) {
  color: #dbeafe;
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.16);
}

.filter-result {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  padding: 14px 16px;
  border-radius: 8px;
  background: #101720;
  overflow: hidden;
}

.filter-result > span {
  color: var(--muted);
  font-size: 13px;
}

.filter-result p {
  color: var(--warn);
  font-size: 14px;
  line-height: 1.7;
}

.result-list {
  display: grid;
  align-content: start;
  gap: 0;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

.result-list strong {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(142, 160, 180, 0.16);
  color: var(--brand-dark);
  font-size: 13px;
}

.result-list em {
  flex: 0 0 auto;
  color: #a855f7;
  font-style: normal;
}

.ranking-table strong {
  color: var(--brand-dark);
}

.tool {
  display: none;
}

.tool.active {
  display: block;
}

.panel {
  margin-top: 14px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.intro-panel {
  background: #111820;
  border-color: #263241;
}

.intro-panel p {
  margin-top: 8px;
  color: #9fb1c7;
  font-size: 14px;
  line-height: 1.7;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.collapsible-panel summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.collapsible-panel summary::-webkit-details-marker {
  display: none;
}

.collapsible-panel summary span {
  font-size: 16px;
  font-weight: 800;
}

.collapsible-panel summary small {
  color: var(--muted);
  font-size: 12px;
}

.collapsible-panel summary::before {
  content: ">";
  color: var(--brand);
  font-weight: 900;
  margin-right: 2px;
}

.collapsible-panel[open] summary {
  margin-bottom: 14px;
}

.collapsible-panel[open] summary::before {
  transform: rotate(90deg);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  background: #0f1720;
  color: var(--text);
}

.lookup-line {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.form-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.form-status.error {
  color: var(--warn);
}

.form-status.loading {
  color: var(--brand);
}

.lookup-line.found {
  color: var(--ok);
  font-weight: 700;
}

.lookup-line.missing,
.lookup-line.error,
.lookup-line.invalid {
  color: var(--warn);
}

.primary {
  grid-column: 1 / -1;
  height: 44px;
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  cursor: pointer;
  font-weight: 700;
}

.primary:hover {
  background: var(--brand-dark);
}

.primary:disabled,
.ghost:disabled,
.icon-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.list,
.timeline {
  display: grid;
  gap: 10px;
}

.empty {
  color: var(--muted);
  font-size: 14px;
}

.item-card,
.event-card {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.item-card.is-hot {
  border-color: rgba(180, 35, 24, 0.4);
}

.item-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.subline {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.rate {
  min-width: 120px;
  text-align: right;
}

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

.rate strong {
  display: block;
  margin-top: 3px;
  color: var(--accent);
  font-size: 20px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.pill {
  padding: 4px 8px;
  border: 1px solid rgba(96, 165, 250, 0.55);
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-edit {
  display: grid;
  grid-template-columns: minmax(120px, 180px) auto auto;
  gap: 8px;
  align-items: end;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.inline-edit label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.inline-edit input {
  min-height: 38px;
}

.ghost {
  min-width: 76px;
  height: 34px;
  background: #101720;
  color: var(--text);
  cursor: pointer;
}

.ghost.compact {
  min-width: 56px;
  height: 38px;
}

.progress {
  height: 8px;
  overflow: hidden;
  background: #e7edf3;
  border-radius: 999px;
}

.progress i {
  display: block;
  height: 100%;
  background: var(--warn);
}

.table-wrap,
.ranking-scroll {
  margin-top: 12px;
  overflow-x: auto;
}

.dashboard-wrap {
  margin-top: 12px;
  overflow: visible;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
  font-size: 13px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.ranking-table tr {
  background: #131a22;
}

.ranking-table tbody tr:hover {
  background: #182330;
}

.ranking-table td {
  position: relative;
}

.ranking-table td b {
  display: inline-block;
  height: 4px;
  max-width: 70px;
  margin-left: 8px;
  border-radius: 999px;
  background: #60a5fa;
  vertical-align: middle;
}

.ranking-table td b.purple {
  background: #c084fc;
}

.ranking-table td b.cyan {
  background: #22d3ee;
}

.code-cell {
  color: #a855f7;
  font-weight: 800;
}

.fee-low {
  color: #22c55e;
  font-weight: 900;
}

.fee-mid {
  color: #eab308;
  font-weight: 900;
}

.fee-high,
.premium {
  color: #ff6b2c;
  font-weight: 900;
}

.down {
  color: #22c55e;
  font-weight: 800;
}

.up {
  color: #ff6b2c;
  font-weight: 800;
}

.muted-cell {
  color: #94a3b8;
  font-weight: 700;
}

.exchange {
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 12px;
}

.exchange.sz {
  color: #86efac;
  background: rgba(34, 197, 94, 0.14);
}

.exchange.sh {
  color: #fde68a;
  background: rgba(234, 179, 8, 0.14);
}

.exchange.us {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.16);
}

.detail-button {
  height: 30px;
  padding: 0 12px;
  border: 1px solid #3b82f6;
  border-radius: 5px;
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  font-weight: 700;
  cursor: pointer;
}

.fund-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 12, 0.72);
}

.fund-dialog {
  position: relative;
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111820;
  box-shadow: var(--shadow);
}

.fund-dialog header {
  display: grid;
  gap: 6px;
  padding-right: 36px;
  margin-bottom: 16px;
}

.fund-dialog header span {
  color: var(--muted);
  font-size: 12px;
}

.fund-dialog h3 {
  margin: 0;
  font-size: 22px;
}

.fund-dialog header strong {
  color: #a855f7;
  font-size: 16px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #17202a;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.detail-grid div {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #151c24;
}

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

.detail-grid strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-summary {
  margin: 14px 0 0;
  padding: 12px;
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.1);
  color: #bfdbfe;
  font-size: 13px;
  line-height: 1.8;
}

.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr) minmax(500px, 1.28fr);
  gap: 12px;
  margin-top: 20px;
}

.chart-card,
.findings {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #151c24;
}

.chart-card h3,
.findings h3 {
  margin: 0 0 14px;
  font-size: 15px;
}

.bar-row {
  display: grid;
  grid-template-columns: 74px minmax(90px, 1fr) 58px;
  align-items: center;
  gap: 8px;
  margin: 9px 0;
  color: var(--muted);
  font-size: 12px;
}

.bar-row span {
  overflow: hidden;
  color: #b9c8da;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row i {
  width: 0;
  height: 13px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.charts-ready .bar-row i {
  width: var(--bar-width);
}

.charts-ready.chart-animate .bar-row i {
  transition: width var(--bar-duration, 1.2s) cubic-bezier(0.2, 0.72, 0.2, 1);
}

.bar-row i.bar-good {
  background: linear-gradient(90deg, #16a34a, #4ade80);
}

.bar-row i.bar-low {
  background: linear-gradient(90deg, #22c55e, #a3e635);
}

.bar-row i.bar-mid {
  background: linear-gradient(90deg, #eab308, #f97316);
}

.bar-row i.bar-high {
  background: linear-gradient(90deg, #f97316, #ef4444);
}

.bar-row em {
  color: #b7d9ff;
  font-style: normal;
  text-align: right;
}

.chart-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.chart-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.chart-title-row h3 {
  margin: 0;
}

.chart-title-row span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.chart-title-row i,
.chart-title-row b {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.chart-title-row i {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.chart-title-row b {
  background: linear-gradient(180deg, #c084fc, #7c3aed);
}

.dual-chart {
  min-height: 330px;
}

.column-chart {
  display: grid;
  grid-template-columns: repeat(10, minmax(34px, 1fr));
  align-items: end;
  gap: 10px;
  min-height: 268px;
  padding: 18px 4px 2px;
  border-top: 1px solid rgba(142, 160, 180, 0.16);
  background:
    linear-gradient(rgba(142, 160, 180, 0.11) 1px, transparent 1px) 0 18px / 100% 42px;
}

.column-group {
  display: grid;
  grid-template-rows: 210px auto;
  gap: 8px;
  min-width: 0;
}

.column-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 4px;
  height: 210px;
}

.column-bars i,
.column-bars b {
  position: relative;
  width: 13px;
  height: 0;
  min-height: 3px;
  border-radius: 3px 3px 0 0;
}

.charts-ready .column-bars i,
.charts-ready .column-bars b {
  height: var(--bar-height);
}

.charts-ready.chart-animate .column-bars i,
.charts-ready.chart-animate .column-bars b {
  transition: height var(--bar-duration, 1.2s) cubic-bezier(0.2, 0.72, 0.2, 1);
}

.column-bars i {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.column-bars b {
  background: linear-gradient(180deg, #c084fc, #7c3aed);
}

.column-bars em {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  color: #b7d9ff;
  font-size: 10px;
  font-style: normal;
  line-height: 1;
  white-space: nowrap;
}

.column-group span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .bar-row i {
    width: var(--bar-width);
  }

  .column-bars i,
  .column-bars b {
    height: var(--bar-height);
  }
}

.findings {
  margin-top: 20px;
}

.findings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.findings-head h3 {
  margin: 0;
}

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

.findings p {
  margin: 0;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.8;
}

.findings p:first-of-type {
  border-top: 0;
}

.findings strong {
  color: #60a5fa;
}

.findings em {
  color: #ff6b2c;
  font-style: normal;
  font-weight: 900;
}

.findings .risk-line {
  color: #f87171;
}

.findings .insight-ok strong {
  color: #22c55e;
}

.findings .insight-warn strong {
  color: #f97316;
}

.findings .insight-info strong {
  color: #60a5fa;
}

.event-card {
  border-left: 4px solid var(--ok);
}

.event-card span,
.event-card time {
  color: var(--muted);
  font-size: 12px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.plan-card {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.plan-card strong {
  color: var(--text);
}

.plan-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.plan-button {
  grid-column: auto;
  width: 100%;
}

.subscription-button {
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  color: #fff;
  background: #dc2626;
  font-weight: 700;
  cursor: pointer;
}

.subscription-button:hover {
  background: #b91c1c;
}

.legal-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-left: 10px;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
}

.legal-item {
  display: block;
}

.legal-item summary {
  width: fit-content;
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
  list-style-position: inside;
}

.legal-item[open] {
  flex-basis: 100%;
}

.legal-content {
  max-width: 920px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101720;
  line-height: 1.8;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.footer-legal.hidden {
  display: none;
}

.legal-content p {
  margin: 0 0 8px;
}

.legal-content p:last-child {
  margin-bottom: 0;
}

.legal-content .form-grid {
  grid-template-columns: minmax(180px, 280px) auto;
  align-items: end;
}

.danger-panel summary {
  color: #991b1b;
}

.danger-button {
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  color: #fff;
  background: #dc2626;
  font-weight: 700;
  cursor: pointer;
}

.danger-button:hover {
  background: #b91c1c;
}

.order-list {
  margin-top: 12px;
}

.notice,
.site-footer {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.notice {
  text-align: center;
}

.risk-banner {
  padding: 14px 16px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 8px;
  background: rgba(127, 29, 29, 0.28);
  color: #cbd5e1;
}

.risk-banner strong {
  color: #ef4444;
}

.footer-meta {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr 1fr auto;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
  color: var(--muted);
}

.footer-meta a {
  color: var(--muted);
  text-decoration: none;
}

.footer-meta a:hover {
  color: var(--brand-dark);
}

@media (max-width: 1180px) {
  .chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dual-chart {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .shell {
    padding-inline: 12px;
  }

  h1 {
    font-size: 24px;
  }

  .result-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .status-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(68px, 1fr);
    grid-template-columns: none;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .status-grid::-webkit-scrollbar {
    display: none;
  }

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

  .topbar,
  .site-header {
    align-items: flex-start;
  }

  .site-header > div:first-child {
    min-width: 0;
  }

  .customer-line {
    overflow-wrap: anywhere;
  }

  .main-nav {
    grid-auto-flow: column;
    grid-auto-columns: minmax(92px, 1fr);
    grid-template-columns: none;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .index-hero {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
    padding: 16px;
  }

  .filter-grid {
    grid-template-columns: 1fr;
    padding-top: 0;
  }

  .filter-area {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .filter-title {
    grid-template-rows: none;
    min-height: 0;
  }

  .filter-fee,
  .filter-scale,
  .filter-premium,
  .filter-volume {
    width: 100%;
    max-width: none;
  }

  .filter-title h2 {
    font-size: 22px;
  }

  .filter-checks {
    max-height: none;
  }

  .filter-result {
    padding: 14px;
  }

  .site-header {
    flex-direction: row;
    align-items: flex-start;
  }

  .dash-metrics,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .chart-card {
    overflow-x: auto;
  }

  .column-chart {
    min-width: 560px;
  }

  .market-strip span {
    flex: 1 1 150px;
  }

  .live-clock {
    margin-left: 0;
    flex: 1 1 100%;
    text-align: center;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .fund-dialog {
    padding: 16px;
  }

  .footer-meta {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .index-hero h2 {
    font-size: 22px;
  }

  .top-actions {
    flex: 0 0 auto;
    flex-direction: row;
    align-self: flex-start;
    padding-top: 28px;
  }

  .ghost.compact {
    min-width: 52px;
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }

  .metric {
    min-height: 48px;
    padding: 7px 6px;
  }

  .metric span {
    font-size: 10px;
    white-space: nowrap;
  }

  .metric strong {
    margin-top: 4px;
    font-size: 14px;
    white-space: nowrap;
  }

  .item-main {
    flex-direction: column;
  }

  .inline-edit {
    grid-template-columns: 1fr;
  }

  .rate {
    text-align: left;
  }
}
