:root {
  color-scheme: light;
  --background: #f4f5f7;
  --surface: #ffffff;
  --surface-muted: #f8f9fa;
  --border: #dfe3e8;
  --text: #20242a;
  --muted: #69717d;
  --accent: #f36b2b;
  --accent-dark: #d95118;
  --blue: #3478c7;
  --green: #26845c;
  --red: #c94b48;
  --shadow: 0 5px 18px rgba(32, 36, 42, 0.07);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--background);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
}

body.access-denied main {
  display: none;
}

body.access-denied::after {
  display: grid;
  width: min(520px, calc(100% - 32px));
  min-height: 180px;
  margin: 80px auto;
  padding: 30px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
  content: "仅 Lionus 管理员可访问盘启行情中心";
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

button,
select {
  font: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 14px max(20px, calc((100% - 1440px) / 2));
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.3;
}

.app-header p,
.panel-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

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

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

main {
  width: min(1440px, calc(100% - 40px));
  margin: 20px auto 40px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric {
  min-width: 0;
  padding: 16px 18px;
  border-right: 1px solid var(--border);
}

.metric:last-child {
  border-right: 0;
}

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

.metric strong {
  display: block;
  overflow: hidden;
  font-size: 24px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.toolbar label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.toolbar select {
  width: 100%;
  height: 36px;
  padding: 0 30px 0 10px;
  border: 1px solid #cfd5dc;
  border-radius: 5px;
  outline: none;
  background: #fff;
  color: var(--text);
}

.toolbar select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(243, 107, 43, 0.14);
}

.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 16px;
}

.panel {
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.panel-heading h2 {
  font-size: 16px;
  line-height: 1.4;
}

.panel-heading > strong {
  color: var(--accent-dark);
  font-size: 22px;
}

.chart {
  width: 100%;
  height: 330px;
}

.table-wrap {
  width: 100%;
  max-height: 520px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

th,
td {
  padding: 11px 14px;
  border-bottom: 1px solid #eceff2;
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-muted);
  color: #4f5864;
  font-size: 12px;
  font-weight: 600;
}

tbody tr:hover {
  background: #fff7f2;
}

.price-high {
  color: var(--red);
}

.price-low {
  color: var(--green);
}

.price-latest {
  color: var(--blue);
  font-weight: 700;
}

.empty-row td {
  height: 90px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(420px, calc(100% - 40px));
  padding: 11px 14px;
  border-radius: 5px;
  background: #20242a;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .metric-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric:nth-child(3) {
    border-right: 0;
  }

  .metric:nth-child(n + 4) {
    border-top: 1px solid var(--border);
  }

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

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

@media (max-width: 680px) {
  .app-header {
    padding: 12px 14px;
  }

  h1 {
    font-size: 18px;
  }

  .primary-button {
    padding: 0 12px;
  }

  main {
    width: calc(100% - 24px);
    margin-top: 12px;
  }

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

  .metric {
    border-top: 1px solid var(--border);
  }

  .metric:nth-child(-n + 2) {
    border-top: 0;
  }

  .metric:nth-child(2n) {
    border-right: 0;
  }

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

  .chart {
    height: 280px;
  }
}

@media (max-width: 520px) {
  .brand-lockup h1,
  .brand-lockup p {
    display: none;
  }

  .brand-lockup {
    flex: 0 0 34px;
  }

  .header-actions {
    min-width: 0;
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: 6px;
  }

  .source-switch {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .source-switch button {
    min-width: 0;
    padding: 0 3px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .primary-button {
    flex: 0 0 auto;
  }
}

/* Pinduoduo exposure monitor */
body.source-pdd {
  --accent: #18a875;
  --accent-dark: #10835d;
}

body.source-pdd .source-switch button:hover,
body.source-pdd .source-switch button.is-active,
body.source-pdd .primary-button {
  border-color: #18a875;
  background: #18a875;
  color: #07120e;
}

body.source-pdd .brand-mark {
  background: #18a875;
  color: #07120e;
}

body.source-pdd .status-dot {
  background: #32d296;
  box-shadow: 0 0 0 4px rgba(50, 210, 150, 0.13);
}

.pdd-target-manager {
  padding: 20px;
  border-top: 3px solid #32d296;
}

.pdd-target-heading {
  margin-bottom: 14px;
}

.pdd-add-target {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(50, 210, 150, 0.45);
  border-radius: 5px;
  color: #65e0b4;
  background: rgba(50, 210, 150, 0.08);
  font-weight: 700;
}

.pdd-add-target span {
  font-size: 18px;
}

.pdd-target-form {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) minmax(140px, 0.7fr) minmax(180px, 1fr);
  gap: 12px;
  margin-bottom: 16px;
  padding: 15px 0;
  border-block: 1px solid #28343e;
}

.pdd-target-form[hidden] {
  display: none;
}

.pdd-target-form label {
  display: grid;
  gap: 6px;
  color: #8d99a4;
  font-size: 11px;
}

.pdd-target-form input[type="text"],
.pdd-target-form select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #35424d;
  border-radius: 5px;
  color: #eef4f8;
  background: #0d141a;
}

.pdd-target-checkbox {
  grid-column: 1 / -1;
  display: flex !important;
  align-items: center;
  gap: 8px !important;
}

.pdd-target-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: #32d296;
}

.pdd-target-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.pdd-target-actions button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #35424d;
  border-radius: 5px;
  color: #d8e0e6;
  background: #121a21;
}

.pdd-target-actions .primary-button {
  border-color: #32d296;
  color: #07120e;
  background: #32d296;
}

.pdd-target-list {
  display: grid;
}

.pdd-target-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  min-height: 66px;
  border-bottom: 1px solid #25313a;
}

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

.pdd-target-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.pdd-target-identity > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.pdd-target-identity strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdd-target-identity span,
.pdd-target-state {
  color: #7f8b97;
  font-size: 11px;
}

.pdd-target-role {
  flex: 0 0 auto;
  padding: 4px 6px;
  border: 1px solid rgba(50, 210, 150, 0.4);
  border-radius: 4px;
  color: #65e0b4 !important;
  font-weight: 700;
}

.pdd-target-role.is-competitor {
  border-color: rgba(255, 189, 90, 0.45);
  color: #ffbd5a !important;
}

.pdd-target-state {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdd-target-state .is-error {
  color: #ff6b74;
}

.pdd-target-subsidy {
  color: #ffbd5a;
}

.pdd-stop-target {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #3b4650;
  border-radius: 4px;
  color: #aeb8c1;
  background: transparent;
}

.pdd-stop-target:hover {
  border-color: #ff6b74;
  color: #ff8d94;
}

body.source-pdd .source-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.source-pdd .source-metrics .metric {
  border-top: 0;
}

body.source-pdd .source-metrics .metric:last-child {
  border-right: 0;
}

.pdd-live {
  padding: 22px;
  border: 1px solid rgba(94, 112, 126, 0.35);
  border-radius: 8px;
  background: rgba(13, 18, 24, 0.82);
}

.pdd-live-heading,
.pdd-product-topline,
.pdd-product-status,
.pdd-product-meta,
.pdd-color-row,
.pdd-alert-item {
  display: flex;
  align-items: center;
}

.pdd-live-heading {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.pdd-live-heading h2 {
  margin: 3px 0 4px;
  font-size: 20px;
}

.pdd-live-heading p,
.pdd-product p,
.pdd-product-meta,
.pdd-color-row span,
.pdd-alert-item span {
  color: #8996a2;
}

.pdd-kicker,
.pdd-product-topline > span:first-child,
.pdd-chart-badge {
  color: #65e0b4;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.pdd-live-time {
  flex: 0 0 auto;
  text-align: right;
}

.pdd-live-time > span {
  display: block;
  margin-bottom: 5px;
  color: #d9f8ed;
  font-size: 12px;
  font-weight: 700;
}

.pdd-live-time i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #32d296;
  box-shadow: 0 0 0 4px rgba(50, 210, 150, 0.12);
}

.pdd-live-time time {
  color: #778590;
  font-size: 12px;
}

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

.pdd-product,
.pdd-product-skeleton {
  min-height: 224px;
  padding: 18px;
  border: 1px solid #293640;
  border-radius: 7px;
  background: #10171e;
}

.pdd-product.is-own {
  border-top: 3px solid #32d296;
}

.pdd-product.is-competitor {
  border-top: 3px solid #ffbd5a;
}

.pdd-product.is-error {
  border-color: rgba(255, 107, 116, 0.55);
  border-top-color: #ff6b74;
}

.pdd-product-topline {
  justify-content: space-between;
  gap: 12px;
}

.pdd-product.is-competitor .pdd-product-topline > span:first-child {
  color: #ffbd5a;
}

.pdd-product-health {
  max-width: 58%;
  color: #aeb9c3;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.pdd-product-health.is-ok {
  color: #65e0b4;
}

.pdd-product-health.is-alert {
  color: #ff6b74;
}

.pdd-product h3 {
  min-height: 44px;
  margin: 18px 0 6px;
  font-size: 16px;
  line-height: 1.4;
}

.pdd-product p {
  margin: 0;
  font-size: 12px;
}

.pdd-product-status {
  justify-content: space-between;
  gap: 16px;
  margin-top: 21px;
}

.pdd-product-status strong {
  font-size: 16px;
}

.pdd-subsidy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #7d8994;
  font-size: 12px;
  font-weight: 700;
}

.pdd-subsidy i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #56616b;
}

.pdd-subsidy.is-active {
  color: #ffbd5a;
}

.pdd-subsidy.is-active i {
  background: #ffbd5a;
  box-shadow: 0 0 0 4px rgba(255, 189, 90, 0.12);
}

.pdd-product-meta {
  justify-content: space-between;
  gap: 10px;
  margin-top: 19px;
  padding-top: 13px;
  border-top: 1px solid #25313a;
  font-size: 11px;
}

.pdd-chart-badge {
  padding: 4px 7px;
  border: 1px solid rgba(50, 210, 150, 0.35);
  border-radius: 4px;
}

.pdd-chart-badge.competitor {
  border-color: rgba(255, 189, 90, 0.4);
  color: #ffbd5a;
}

.pdd-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 14px;
}

.pdd-color-list,
.pdd-alert-list {
  display: grid;
  gap: 8px;
}

.pdd-color-group {
  display: grid;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid #25313a;
}

.pdd-color-group:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.pdd-color-group-heading {
  display: grid;
  gap: 3px;
  padding: 4px 2px;
}

.pdd-color-group-heading strong {
  font-size: 13px;
}

.pdd-color-group-heading span {
  color: #778590;
  font-size: 11px;
}

.pdd-color-row {
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid #28343e;
  border-radius: 6px;
  background: #10171e;
}

.pdd-color-row.is-unavailable {
  border-color: rgba(255, 107, 116, 0.58);
  background: rgba(92, 28, 34, 0.2);
}

.pdd-color-swatch {
  flex: 0 0 auto;
  width: 10px;
  height: 36px;
  margin-right: 12px;
  border-radius: 3px;
  background: #32d296;
}

.pdd-color-row.is-unavailable .pdd-color-swatch {
  background: #ff6b74;
}

.pdd-color-row > div:nth-child(2) {
  display: grid;
  gap: 3px;
}

.pdd-color-row strong {
  font-size: 13px;
}

.pdd-color-row span {
  font-size: 11px;
}

.pdd-color-stock {
  display: grid;
  gap: 3px;
  margin-left: auto;
  text-align: right;
}

.pdd-alert-item {
  align-items: flex-start;
  gap: 11px;
  min-height: 58px;
  padding: 11px 0;
  border-bottom: 1px solid #25313a;
}

.pdd-alert-item:last-child {
  border-bottom: 0;
}

.pdd-alert-icon {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: #ffbd5a;
}

.pdd-alert-icon.is-sent {
  background: #32d296;
}

.pdd-alert-item > div {
  display: grid;
  gap: 5px;
}

.pdd-alert-item strong {
  font-size: 12px;
  line-height: 1.45;
}

.pdd-alert-item span {
  font-size: 11px;
}

.pdd-empty {
  display: grid;
  min-height: 120px;
  place-items: center;
  color: #788590;
  font-size: 13px;
}

@media (max-width: 900px) {
  .pdd-product-grid,
  .pdd-detail-grid {
    grid-template-columns: 1fr;
  }

  .source-switch button {
    padding-inline: 8px;
  }

  .pdd-target-form {
    grid-template-columns: 1fr 1fr;
  }

  .pdd-target-product-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  body.source-pdd .source-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.source-pdd .source-metrics .metric:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border);
  }

  .pdd-live {
    padding: 15px;
  }

  .pdd-live-heading {
    align-items: flex-start;
  }

  .pdd-live-time {
    max-width: 44%;
  }

  .pdd-product {
    min-height: 0;
    padding: 15px;
  }

  .pdd-product-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .pdd-target-manager {
    padding: 15px;
  }

  .pdd-target-form {
    grid-template-columns: 1fr;
  }

  .pdd-target-form > label,
  .pdd-target-checkbox,
  .pdd-target-actions {
    grid-column: 1;
  }

  .pdd-target-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 0;
  }

  .pdd-target-state {
    grid-column: 1;
    padding-left: 48px;
  }

  .pdd-stop-target {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

/* Supplier source switch and Wubu Digital */
body:not(.source-wubu) .wubu-only,
body.source-wubu .panqi-only {
  display: none !important;
}

body:not(.source-pdd) .pdd-only,
body.source-pdd .panqi-only,
body.source-pdd .wubu-only,
body.source-pdd .crab-only {
  display: none !important;
}

body:not(.source-crab) .crab-only,
body.source-crab .panqi-only,
body.source-crab .wubu-only,
body.source-crab .pdd-only {
  display: none !important;
}

.source-switch,
.currency-control {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid #444c57;
  border-radius: 5px;
  background: #11151a;
}

.source-switch button,
.currency-control button {
  height: 32px;
  padding: 0 11px;
  border: 0;
  border-right: 1px solid #444c57;
  background: transparent;
  color: #aeb5be;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.source-switch button:last-child,
.currency-control button:last-child {
  border-right: 0;
}

.source-switch button:hover,
.source-switch button.is-active {
  background: #f05a2a;
  color: #fff;
}

body.source-wubu {
  --accent: #0f7f83;
  --accent-dark: #08676b;
}

body.source-wubu .source-switch button:hover,
body.source-wubu .source-switch button.is-active,
body.source-wubu .primary-button {
  border-color: #0f7f83;
  background: #0f7f83;
  color: #fff;
}

body.source-wubu .brand-mark {
  background: #0f7f83;
}

body.source-wubu .status-dot {
  background: #53d0b5;
  box-shadow: 0 0 0 4px rgba(83, 208, 181, 0.13);
}

.currency-control {
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

.currency-control button {
  min-width: 54px;
  border-color: var(--border-strong);
  color: var(--muted);
}

.currency-control button:hover,
.currency-control button.is-active {
  background: #0f7f83;
  color: #fff;
}

.wubu-filter-grid {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.crab-filter-grid {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

body.source-crab {
  --accent: #087789;
  --accent-dark: #065d6c;
}

body.source-crab .source-switch button:hover,
body.source-crab .source-switch button.is-active,
body.source-crab .primary-button,
body.source-crab .brand-mark {
  border-color: #087789;
  background: #087789;
  color: #fff;
}

body.source-crab .status-dot {
  background: #38b9cb;
  box-shadow: 0 0 0 4px rgba(56, 185, 203, 0.13);
}

.trust-item.is-warning .trust-dot {
  background: #c27a32;
  box-shadow: 0 0 0 4px rgba(194, 122, 50, 0.14);
}

.wubu-selection {
  max-width: 72%;
  color: #505965;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.table-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 10px;
}

.table-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend-dot.in-stock {
  background: #14805e;
}

.legend-dot.out-stock {
  background: #a9b0b8;
}

.wubu-table-wrap {
  max-height: 620px;
}

.wubu-table-wrap table {
  min-width: 1500px;
}

.table-pagination {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
}

.table-pagination button {
  width: 34px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--text);
  cursor: pointer;
}

.table-pagination button:disabled {
  opacity: 0.38;
  cursor: default;
}

.table-pagination span {
  min-width: 92px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.stock-badge {
  display: inline-block;
  min-width: 46px;
  padding: 3px 6px;
  border-radius: 4px;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
}

.stock-badge.is-in {
  background: #e5f5ef;
  color: #0c7051;
}

.stock-badge.is-out {
  background: #eceff2;
  color: #747d88;
}

.stock-up {
  color: #14805e;
  font-weight: 700;
}

.stock-down {
  color: #c23d3d;
  font-weight: 700;
}

@media (max-width: 1120px) {
  .admin-badge {
    display: none;
  }

  .header-actions {
    gap: 9px;
  }
}

@media (max-width: 760px) {
  .source-switch button {
    height: 30px;
    padding: 0 8px;
    font-size: 10px;
  }

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

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

  .wubu-selection {
    max-width: 62%;
    font-size: 10px;
  }

  .table-legend {
    display: none;
  }
}

@media (max-width: 520px) {
  .brand-lockup {
    gap: 7px;
  }

  .brand-lockup h1 {
    font-size: 14px;
    white-space: nowrap;
  }

  .header-actions {
    display: flex;
    gap: 5px;
  }

  .source-switch {
    flex: 0 0 auto;
  }

  .source-switch button {
    height: 30px;
    padding: 0 4px;
    font-size: 9px;
  }

  .sync-icon {
    display: none;
  }

  .primary-button {
    min-height: 32px;
    padding: 0 7px;
  }

  .primary-button span:last-child {
    font-size: 10px;
    white-space: nowrap;
  }

  .page-heading > p {
    display: none;
  }
}

/* Live prices first; historical charts lower on the page */
main {
  display: flex;
  flex-direction: column;
}

.page-heading {
  order: 0;
}

.live-price-panel {
  order: 1;
  overflow: hidden;
  border-color: var(--border-strong);
}

.source-trust {
  order: 2;
}

.source-metrics {
  order: 3;
}

.source-toolbar {
  order: 4;
}

.latest-section {
  order: 5;
}

.history-section {
  order: 6;
}

.market-section {
  order: 7;
}

.secondary-section {
  order: 8;
}

.live-status {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.live-status > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #14805e;
  font-family: Arial, sans-serif;
  font-size: 10px;
  font-weight: 800;
}

.live-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #24b980;
  box-shadow: 0 0 0 4px rgba(36, 185, 128, 0.12);
}

.live-status time {
  color: var(--muted);
  font-size: 10px;
}

.live-price-grid {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-top: 1px solid var(--border);
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}

.live-price-item {
  flex: 0 0 240px;
  min-height: 92px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.live-price-item:hover {
  background: var(--surface-muted);
}

.live-price-item summary {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px;
  cursor: pointer;
  list-style: none;
}

.live-price-item summary::-webkit-details-marker {
  display: none;
}

.live-price-chevron {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 16px;
  transition: transform 160ms ease;
}

.live-price-item[open] {
  flex-basis: min(420px, 88vw);
  background: var(--surface-muted);
}

.live-price-item[open] .live-price-chevron {
  transform: rotate(180deg);
}

.live-price-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 16px;
  padding: 0 15px 15px;
  border-top: 1px solid var(--border);
}

.live-price-details span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding-top: 10px;
  color: var(--text);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.live-price-details b {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.live-price-name,
.live-price-value {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.live-price-name strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-price-name span {
  max-width: 118px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-price-value {
  justify-items: end;
  flex: 0 0 auto;
}

.live-price-value strong {
  color: var(--text);
  font-family: Arial, sans-serif;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.live-price-value span,
.live-price-value small {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.live-price-value small.is-up {
  color: var(--red);
}

.live-price-value small.is-down,
.live-price-value small.is-stock {
  color: var(--green);
}

.live-price-value small.is-flat {
  color: var(--muted);
}

.live-price-value small.is-empty {
  color: #8b949f;
}

.live-price-empty {
  min-height: 92px;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 680px) {
  .live-price-grid {
    display: flex;
  }

  .live-price-item {
    flex-basis: 78vw;
    min-height: 84px;
  }

  .live-price-item summary {
    min-height: 84px;
    padding: 12px;
  }

  .live-status time {
    max-width: 120px;
    text-align: right;
  }
}

/* Analytics extensions */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.trend-actions,
.range-control,
.compare-button,
.trend-summary,
.compare-list,
.compare-chip {
  display: flex;
  align-items: center;
}

.trend-actions {
  gap: 8px;
}

.range-control {
  padding: 3px;
  border: 1px solid #2c3847;
  border-radius: 5px;
  background: #0d131b;
}

.range-control button {
  min-width: 46px;
  height: 28px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #7f8da0;
  cursor: pointer;
}

.range-control button.is-active {
  background: #263442;
  color: #eef6ff;
}

.compare-button {
  gap: 4px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid #3a4a5e;
  border-radius: 5px;
  background: #111922;
  color: #cbd8e6;
  cursor: pointer;
}

.compare-button:hover {
  border-color: #25d3a7;
  color: #25d3a7;
}

.trend-summary {
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 10px 17px;
  border-bottom: 1px solid #202b38;
}

.compare-list {
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.compare-empty {
  color: #647286;
  font-size: 11px;
}

.compare-chip {
  gap: 7px;
  max-width: 260px;
  min-height: 30px;
  padding: 4px 5px 4px 9px;
  border: 1px solid #344455;
  border-radius: 5px;
  background: #111922;
  color: #cbd8e6;
  font-size: 11px;
}

.compare-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-chip button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #7f8da0;
  cursor: pointer;
}

.compare-chip button:hover {
  background: #263442;
  color: #eef6ff;
}

.insight-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  gap: 14px;
}

.insight-grid .panel {
  min-width: 0;
}

.compact-select,
.merchant-search input {
  height: 34px;
  border: 1px solid #344455;
  border-radius: 4px;
  background: #0d131b;
  color: #cbd8e6;
}

.compact-select {
  min-width: 110px;
  padding: 0 28px 0 10px;
}

.merchant-search input {
  width: min(240px, 30vw);
  padding: 0 10px;
}

.merchant-search input::placeholder {
  color: #647286;
}

.analysis-list {
  max-height: 430px;
  overflow: auto;
}

.analysis-item {
  padding: 15px 17px;
  border-bottom: 1px solid #202b38;
}

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

.analysis-item > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.analysis-item strong {
  color: #25d3a7;
  font-size: 12px;
}

.analysis-item time {
  color: #647286;
  font-size: 10px;
}

.analysis-item p {
  margin: 0;
  color: #aab7c6;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.empty-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: #647286;
  font-size: 12px;
}

.compact-table {
  max-height: 430px;
}

.compact-table td strong {
  color: #dbe7f3;
  font-size: 12px;
}

body.fintech .trend-summary,
body.fintech .analysis-item {
  border-color: #202b38;
}

body.fintech .compact-select,
body.fintech .merchant-search input {
  border-color: #344455;
  background: #0d131b;
  color: #cbd8e6;
}

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

@media (max-width: 680px) {
  .panel-heading {
    align-items: flex-start;
    gap: 10px;
  }

  .trend-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .range-control button {
    min-width: 40px;
  }

  .compare-button {
    justify-content: center;
  }

  .trend-summary {
    align-items: flex-start;
  }

  .compare-list {
    flex: 1;
  }

  .compare-chip {
    max-width: 190px;
  }

  .merchant-search input {
    width: 155px;
  }
}

/* Dark theme final precedence */
body.fintech {
  color-scheme: dark;
  --background: #080b10;
  --surface: rgba(18, 24, 33, 0.78);
  --surface-muted: rgba(22, 29, 39, 0.9);
  --border: rgba(157, 180, 207, 0.16);
  --border-strong: rgba(157, 180, 207, 0.24);
  --text: #f2f7fb;
  --muted: #8492a4;
  --accent: #25d3a7;
  --accent-dark: #16b78f;
  --blue: #53a6ff;
  --green: #25d3a7;
  --red: #ff667a;
  --ink: #f2f7fb;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

body.fintech {
  background-color: var(--background);
  background-image:
    linear-gradient(rgba(100, 130, 165, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 130, 165, 0.04) 1px, transparent 1px);
  background-size: 52px 52px;
  color: var(--text);
}

.app-header {
  border-bottom: 1px solid var(--border);
  background: rgba(8, 11, 16, 0.82);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(20px);
}

.brand-mark {
  background: #25d3a7;
  color: #06100d;
  box-shadow: 0 0 24px rgba(37, 211, 167, 0.28);
}

.brand-lockup p,
.eyebrow {
  color: #25d3a7;
}

.status-dot {
  background: #25d3a7;
  box-shadow: 0 0 0 4px rgba(37, 211, 167, 0.1), 0 0 14px rgba(37, 211, 167, 0.55);
}

.home-link,
.sync-status {
  color: #8b9bad;
}

.primary-button {
  border-color: #25d3a7;
  background: #25d3a7;
  color: #06100d;
  box-shadow: 0 8px 20px rgba(37, 211, 167, 0.16);
}

.primary-button:hover {
  background: #58e3be;
}

.page-heading h2 {
  color: #f6fbff;
}

.page-heading p {
  color: #748397;
}

.metric-strip,
.toolbar,
.panel {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.metric {
  border-right-color: var(--border);
}

.metric::before {
  background: #25d3a7;
  box-shadow: 0 0 12px rgba(37, 211, 167, 0.55);
}

.metric:nth-child(2)::before {
  background: #53a6ff;
  box-shadow: 0 0 12px rgba(83, 166, 255, 0.5);
}

.metric:nth-child(3)::before {
  background: #25d3a7;
}

.metric:nth-child(4)::before {
  background: #f3b94f;
  box-shadow: 0 0 12px rgba(243, 185, 79, 0.45);
}

.metric:nth-child(5)::before {
  background: #e578ff;
  box-shadow: 0 0 12px rgba(229, 120, 255, 0.42);
}

.metric span,
.toolbar label,
.panel-heading p,
.price-highlight > span,
.price-highlight small {
  color: #7f8ea1;
}

.metric strong,
.price-highlight strong {
  color: #f6fbff;
}

.toolbar-heading,
.table-panel .panel-heading {
  border-bottom-color: var(--border);
  background: rgba(21, 28, 38, 0.82);
}

.toolbar-heading strong,
.panel-heading h2 {
  color: #eaf2f9;
}

.reset-button {
  border-color: var(--border-strong);
  background: rgba(9, 13, 19, 0.72);
  color: #8fa0b3;
}

.reset-button:hover {
  border-color: #25d3a7;
  color: #25d3a7;
}

.toolbar select {
  border-color: var(--border-strong);
  background: #0d131b;
  color: #dce6f0;
}

.toolbar select:focus {
  border-color: #25d3a7;
  box-shadow: 0 0 0 2px rgba(37, 211, 167, 0.12);
}

.panel-heading {
  border-bottom-color: var(--border);
}

.price-highlight strong {
  color: #25d3a7;
  text-shadow: 0 0 20px rgba(37, 211, 167, 0.18);
}

.price-highlight small.is-up,
.price-high {
  color: #ff667a;
}

.price-highlight small.is-down,
.price-low {
  color: #25d3a7;
}

th {
  background: #111821;
  color: #77879a;
}

th,
td {
  border-bottom-color: rgba(157, 180, 207, 0.1);
}

td {
  color: #c6d1dc;
}

tbody tr:nth-child(even) {
  background: rgba(18, 25, 34, 0.5);
}

tbody tr:hover {
  background: rgba(37, 211, 167, 0.07);
}

.price-latest {
  color: #53a6ff;
}

.toast {
  border: 1px solid var(--border-strong);
  background: rgba(13, 18, 25, 0.96);
  color: #eef6ff;
  box-shadow: var(--shadow);
}

body.fintech .app-header {
  border-bottom: 1px solid var(--border);
  background: rgba(8, 11, 16, 0.82);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
}

body.fintech .brand-mark {
  background: #25d3a7;
  color: #06100d;
}

body.fintech :is(.brand-lockup p, .eyebrow) {
  color: #25d3a7;
}

body.fintech .primary-button {
  border-color: #25d3a7;
  background: #25d3a7;
  color: #06100d;
}

body.fintech .page-heading h2,
body.fintech .metric strong,
body.fintech .price-highlight strong {
  color: #f6fbff;
}

body.fintech :is(.metric-strip, .toolbar, .panel) {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

body.fintech .metric {
  border-right-color: var(--border);
}

body.fintech :is(.toolbar-heading, .table-panel .panel-heading) {
  border-bottom-color: var(--border);
  background: rgba(21, 28, 38, 0.82);
}

body.fintech .reset-button {
  border-color: var(--border-strong);
  background: rgba(9, 13, 19, 0.72);
  color: #8fa0b3;
}

body.fintech .toolbar select {
  border-color: var(--border-strong);
  background: #0d131b;
  color: #dce6f0;
}

body.fintech .panel-heading {
  border-bottom-color: var(--border);
}

body.fintech th {
  background: #111821;
  color: #77879a;
}

body.fintech td {
  border-bottom-color: rgba(157, 180, 207, 0.1);
  color: #c6d1dc;
}

body.fintech tbody tr:nth-child(even) {
  background: rgba(18, 25, 34, 0.5);
}

body.fintech tbody tr:hover {
  background: rgba(37, 211, 167, 0.07);
}

/* Dark fintech preview */
:root {
  color-scheme: dark;
  --background: #080b10;
  --surface: rgba(18, 24, 33, 0.78);
  --surface-muted: rgba(22, 29, 39, 0.9);
  --border: rgba(157, 180, 207, 0.16);
  --border-strong: rgba(157, 180, 207, 0.24);
  --text: #f2f7fb;
  --muted: #8492a4;
  --accent: #25d3a7;
  --accent-dark: #16b78f;
  --blue: #53a6ff;
  --green: #25d3a7;
  --red: #ff667a;
  --ink: #f2f7fb;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

body {
  background-color: var(--background);
  background-image:
    linear-gradient(rgba(100, 130, 165, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 130, 165, 0.04) 1px, transparent 1px);
  background-size: 52px 52px;
  color: var(--text);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, rgba(37, 211, 167, 0.05), transparent 34%, rgba(83, 166, 255, 0.04));
  content: "";
  pointer-events: none;
}

.app-header {
  border-bottom: 1px solid var(--border);
  background: rgba(8, 11, 16, 0.82);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(20px);
}

.brand-mark {
  background: #25d3a7;
  color: #06100d;
  box-shadow: 0 0 24px rgba(37, 211, 167, 0.28);
}

.brand-lockup p,
.eyebrow {
  color: #25d3a7;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #9fb0c3;
  font-family: Arial, sans-serif;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
}

.admin-badge > span {
  color: #25d3a7;
  font-size: 7px;
  text-shadow: 0 0 10px #25d3a7;
}

.status-dot {
  background: #25d3a7;
  box-shadow: 0 0 0 4px rgba(37, 211, 167, 0.1), 0 0 14px rgba(37, 211, 167, 0.55);
}

.home-link,
.sync-status {
  color: #8b9bad;
}

.primary-button {
  border-color: #25d3a7;
  background: #25d3a7;
  color: #06100d;
  box-shadow: 0 8px 20px rgba(37, 211, 167, 0.16);
}

.primary-button:hover {
  background: #58e3be;
}

.page-heading {
  margin-top: 22px;
}

.page-heading h2 {
  color: #f6fbff;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 27px;
}

.page-heading p {
  color: #748397;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(14, 19, 27, 0.66);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px 15px;
  border-right: 1px solid var(--border);
}

.trust-item:last-child {
  border-right: 0;
}

.trust-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
}

.trust-item.is-online .trust-dot {
  background: #25d3a7;
  box-shadow: 0 0 12px rgba(37, 211, 167, 0.7);
}

.trust-item.is-pending .trust-dot {
  background: #f3b94f;
  box-shadow: 0 0 12px rgba(243, 185, 79, 0.55);
}

.trust-item > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.trust-item strong {
  overflow: hidden;
  color: #dfe9f3;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trust-item span:last-child {
  overflow: hidden;
  color: #718094;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-strip,
.toolbar,
.panel {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.metric {
  border-right-color: var(--border);
}

.metric::before {
  background: #25d3a7;
  box-shadow: 0 0 12px rgba(37, 211, 167, 0.55);
}

.metric:nth-child(2)::before {
  background: #53a6ff;
  box-shadow: 0 0 12px rgba(83, 166, 255, 0.5);
}

.metric:nth-child(3)::before {
  background: #25d3a7;
}

.metric:nth-child(4)::before {
  background: #f3b94f;
  box-shadow: 0 0 12px rgba(243, 185, 79, 0.45);
}

.metric:nth-child(5)::before {
  background: #e578ff;
  box-shadow: 0 0 12px rgba(229, 120, 255, 0.42);
}

.metric span,
.toolbar label,
.panel-heading p,
.price-highlight > span,
.price-highlight small {
  color: #7f8ea1;
}

.metric strong {
  color: #f6fbff;
  font-variant-numeric: tabular-nums;
}

.toolbar-heading,
.table-panel .panel-heading {
  border-bottom-color: var(--border);
  background: rgba(21, 28, 38, 0.82);
}

.toolbar-heading strong,
.panel-heading h2 {
  color: #eaf2f9;
}

.reset-button {
  border-color: var(--border-strong);
  background: rgba(9, 13, 19, 0.72);
  color: #8fa0b3;
}

.reset-button:hover {
  border-color: #25d3a7;
  color: #25d3a7;
}

.toolbar select {
  border-color: var(--border-strong);
  background: #0d131b;
  color: #dce6f0;
}

.toolbar select:focus {
  border-color: #25d3a7;
  box-shadow: 0 0 0 2px rgba(37, 211, 167, 0.12);
}

.panel-heading {
  border-bottom-color: var(--border);
}

.price-highlight strong {
  color: #25d3a7;
  text-shadow: 0 0 20px rgba(37, 211, 167, 0.18);
}

.price-highlight small.is-up,
.price-high {
  color: #ff667a;
}

.price-highlight small.is-down,
.price-low {
  color: #25d3a7;
}

.table-wrap {
  scrollbar-color: #314053 #0b1017;
}

th {
  background: #111821;
  color: #77879a;
}

th,
td {
  border-bottom-color: rgba(157, 180, 207, 0.1);
}

td {
  color: #c6d1dc;
}

tbody tr:nth-child(even) {
  background: rgba(18, 25, 34, 0.5);
}

tbody tr:hover {
  background: rgba(37, 211, 167, 0.07);
}

.price-latest {
  color: #53a6ff;
}

.toast {
  border: 1px solid var(--border-strong);
  background: rgba(13, 18, 25, 0.96);
  color: #eef6ff;
  box-shadow: var(--shadow);
}

body.access-denied::after {
  border-color: var(--border);
  background: rgba(17, 23, 32, 0.92);
  color: #f2f7fb;
  backdrop-filter: blur(18px);
}

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

  .trust-item:nth-child(2) {
    border-right: 0;
  }

  .trust-item:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 680px) {
  .admin-badge {
    display: none;
  }

  .page-heading {
    margin-top: 16px;
  }

  .page-heading h2 {
    font-size: 23px;
  }
}

/* 2026 dashboard refresh */
:root {
  --background: #eef1f4;
  --surface: #ffffff;
  --surface-muted: #f5f7f8;
  --border: #d9dee4;
  --border-strong: #c8ced6;
  --text: #171a1f;
  --muted: #68717d;
  --accent: #f05a2a;
  --accent-dark: #d8491e;
  --blue: #2563a8;
  --green: #14805e;
  --red: #c23d3d;
  --ink: #181c22;
  --shadow: 0 8px 24px rgba(24, 28, 34, 0.06);
}

body {
  background:
    linear-gradient(#e4e8ec 1px, transparent 1px),
    var(--background);
  background-size: 100% 48px;
}

.app-header {
  min-height: 68px;
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom: 0;
  background: rgba(24, 28, 34, 0.98);
  color: #fff;
  box-shadow: 0 3px 14px rgba(18, 21, 25, 0.18);
}

.brand-lockup,
.header-actions,
.sync-status,
.toolbar-heading,
.price-highlight {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 11px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 22px;
  font-weight: 800;
}

.brand-lockup h1 {
  font-size: 18px;
}

.brand-lockup p {
  margin-top: 2px;
  color: #aeb5be;
  font-family: Arial, sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
}

.header-actions {
  gap: 14px;
}

.sync-status {
  gap: 7px;
  max-width: 340px;
  color: #c7cdd4;
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #46c792;
  box-shadow: 0 0 0 4px rgba(70, 199, 146, 0.12);
}

.home-link {
  color: #c7cdd4;
  font-size: 12px;
  text-decoration: none;
}

.home-link:hover {
  color: #fff;
}

.primary-button {
  min-height: 36px;
  padding: 0 14px;
  border-color: var(--accent);
  border-radius: 5px;
  font-weight: 700;
}

.sync-icon {
  font-size: 18px;
  line-height: 1;
}

main {
  width: min(1480px, calc(100% - 40px));
  margin-top: 18px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 0 2px 14px;
}

.page-heading h2 {
  margin-top: 2px;
  font-size: 25px;
}

.page-heading p {
  padding-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
}

.eyebrow {
  color: var(--accent-dark);
  font-family: Arial, sans-serif;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
}

.metric-strip {
  overflow: hidden;
  border-color: var(--border-strong);
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.metric {
  position: relative;
  padding: 17px 20px 15px;
}

.metric::before {
  position: absolute;
  top: 0;
  left: 20px;
  width: 30px;
  height: 3px;
  background: var(--accent);
  content: "";
}

.metric:nth-child(2)::before {
  background: var(--blue);
}

.metric:nth-child(3)::before {
  background: var(--green);
}

.metric:nth-child(4)::before {
  background: #8f6b28;
}

.metric:nth-child(5)::before {
  background: #6f5aa8;
}

.metric span {
  margin-bottom: 8px;
  color: #747d88;
  font-size: 11px;
  font-weight: 600;
}

.metric strong {
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 26px;
}

.toolbar {
  display: block;
  margin: 14px 0;
  padding: 0;
  overflow: hidden;
  border-color: var(--border-strong);
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.toolbar-heading {
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}

.toolbar-heading > div {
  display: grid;
  gap: 2px;
}

.toolbar-heading strong {
  font-size: 13px;
}

.toolbar-heading span {
  color: var(--muted);
  font-size: 10px;
}

.reset-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: #505965;
  cursor: pointer;
}

.reset-button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  padding: 12px 14px 14px;
}

.toolbar label {
  color: #5c6570;
  font-size: 11px;
  font-weight: 600;
}

.toolbar select {
  height: 38px;
  border-color: var(--border-strong);
  border-radius: 4px;
  background-color: #fff;
}

.chart-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.75fr);
  gap: 14px;
}

.chart-panel {
  min-width: 0;
}

.history-section,
.latest-section,
.secondary-grid {
  content-visibility: auto;
  contain-intrinsic-size: auto 720px;
}

.panel {
  margin-bottom: 14px;
  border-color: var(--border-strong);
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.panel-heading {
  min-height: 64px;
  padding: 14px 17px;
  border-bottom-color: var(--border);
}

.panel-heading h2 {
  font-size: 15px;
}

.price-highlight {
  align-items: flex-end;
  flex-direction: column;
}

.price-highlight > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.price-highlight strong {
  color: var(--ink);
  font-family: Arial, sans-serif;
  font-size: 24px;
  line-height: 1.2;
}

.price-highlight small {
  color: var(--muted);
  font-size: 10px;
}

.price-highlight small.is-up {
  color: var(--red);
}

.price-highlight small.is-down {
  color: var(--green);
}

.chart {
  height: 320px;
}

.table-panel .panel-heading {
  background: var(--surface-muted);
}

.table-wrap {
  max-height: 480px;
}

th,
td {
  padding: 10px 14px;
}

th {
  background: #eef1f4;
  color: #515a66;
  font-size: 11px;
  text-transform: uppercase;
}

tbody tr:nth-child(even) {
  background: #fafbfc;
}

tbody tr:hover {
  background: #fff2ec;
}

.price-high,
.price-low,
.price-latest {
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-variant-numeric: tabular-nums;
}

.price-latest {
  color: var(--ink);
  font-weight: 800;
}

@media (max-width: 1080px) {
  .filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 680px) {
  .app-header {
    align-items: flex-start;
    padding: 10px 12px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-lockup p,
  .home-link,
  .sync-status {
    display: none;
  }

  .primary-button {
    min-height: 34px;
    padding: 0 10px;
  }

  main {
    width: calc(100% - 20px);
    margin-top: 12px;
  }

  .page-heading {
    align-items: flex-start;
  }

  .page-heading h2 {
    font-size: 21px;
  }

  .page-heading > p {
    max-width: 150px;
    text-align: right;
  }

  .metric {
    padding: 15px 14px 13px;
  }

  .metric::before {
    left: 14px;
  }

  .metric strong {
    font-size: 22px;
  }

  .toolbar-heading > div > span {
    display: none;
  }

  .metric:last-child {
    grid-column: 1 / -1;
    border-right: 0;
  }

  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 11px;
  }

  .chart {
    height: 280px;
  }
}
