.market-card {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.market-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.5);
}

.ghost-button {
  height: 32px;
  border: 1px solid rgba(96, 165, 250, 0.26);
  border-radius: 999px;
  padding: 0 12px;
  color: #dbeafe;
  background: rgba(96, 165, 250, 0.1);
  transition: 0.16s ease;
}

.ghost-button:hover:not(:disabled) {
  border-color: rgba(96, 165, 250, 0.58);
  background: rgba(96, 165, 250, 0.18);
}

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

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.switch-control input {
  width: 14px;
  height: 14px;
  accent-color: #60a5fa;
}

.refresh-countdown {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 32px;
  border-radius: 999px;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.12);
  font-size: 12px;
  font-weight: 900;
}

.detail-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.18);
}

.detail-tab {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 6px;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.5);
  font-size: 12px;
  font-weight: 800;
  transition: 0.16s ease;
}

.detail-tab:hover {
  color: var(--text);
  background: rgba(96, 165, 250, 0.1);
}

.detail-tab.is-active {
  color: #e0f2fe;
  border-color: rgba(96, 165, 250, 0.44);
  background: rgba(37, 99, 235, 0.28);
}

.detail-tab-content {
  padding-top: 16px;
}

.compact-metrics {
  padding: 0;
  grid-template-columns: 1fr;
}

.full-section {
  padding-top: 0;
}

.table-headline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.table-headline h3 {
  margin: 0;
}

.table-headline span {
  color: var(--muted-2);
  font-size: 11px;
  white-space: nowrap;
}

.stock-table {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.24);
}

.stock-row {
  display: grid;
  grid-template-columns: 54px minmax(64px, 1fr) 64px 64px 64px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  font-size: 12px;
}

.stock-row:last-child {
  border-bottom: 0;
}

.stock-row span:first-child {
  color: var(--muted-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.stock-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-row-head {
  color: var(--muted);
  background: rgba(15, 23, 42, 0.64);
  font-weight: 800;
}

.etf-card-list {
  display: grid;
  gap: 10px;
}

.etf-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(99, 102, 241, 0.1);
}

.etf-card strong,
.etf-card span {
  display: block;
}

.etf-card strong {
  font-size: 14px;
}

.etf-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.etf-score {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 16px;
  font-weight: 950;
}

.etf-watch-block {
  border-color: rgba(129, 140, 248, 0.26);
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.12), rgba(2, 6, 23, 0.18));
}

.etf-watch-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.etf-watch-item:last-child {
  border-bottom: 0;
}

.etf-watch-item .rank-name {
  color: #e0e7ff;
}

.loading-box {
  margin: 0 16px 16px;
  padding: 20px;
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
  background: rgba(2, 6, 23, 0.2);
}

.flow-list {
  display: grid;
  gap: 12px;
}

.flow-item {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.24);
}

.flow-item > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.flow-item strong {
  font-size: 14px;
}

.flow-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
}

.flow-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.flow-positive {
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.42), rgba(248, 113, 113, 0.95));
}

.flow-negative {
  background: linear-gradient(90deg, rgba(74, 222, 128, 0.42), rgba(74, 222, 128, 0.95));
}

@media (max-width: 900px) {
  .market-card {
    justify-items: stretch;
  }

  .market-actions {
    justify-content: space-between;
  }

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

  .stock-row {
    grid-template-columns: 48px minmax(70px, 1fr) 58px 58px;
  }

  .stock-row span:last-child {
    display: none;
  }
}
