/* Alpha Competitions: Modern Web3 Financial Terminal Design System */

.skip-link {
  position: fixed;
  left: 20px;
  top: -80px;
  background: var(--primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  z-index: 100;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 14px; }

/* 1. Overview Strip */
.overview-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 1.35fr;
  margin-bottom: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.overview-item {
  padding: 14px 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.overview-item:not(:last-child):after {
  content: '';
  position: absolute;
  right: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: var(--line);
}
.overview-item > span {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.overview-item strong {
  display: block;
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 2px 0 0;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.overview-item small {
  font-size: 11px;
  color: var(--muted);
}
.overview-focus {
  padding: 14px 22px;
  background: var(--primary-soft);
  border-left: 1px solid var(--primary-border);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.focus-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.focus-label::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary);
}
.overview-focus > div {
  font-size: 16px;
  font-weight: 700;
  margin: 6px 0 4px;
  color: var(--ink);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.overview-focus b {
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  background: var(--panel);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--primary-border);
}
.overview-focus small {
  color: var(--muted);
  font-size: 11px;
}

/* 2. List Toolbar */
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.segmented {
  display: inline-flex;
  background: var(--soft);
  padding: 3px;
  border-radius: 10px;
  gap: 2px;
  border: 1px solid var(--line);
}
.segmented button {
  border: 0;
  background: transparent;
  padding: 8px 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  border-radius: 7px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.segmented button[aria-pressed=true] {
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.segmented span {
  font-size: 10px;
  background: var(--line);
  color: var(--muted);
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
}
.segmented button[aria-pressed=true] span {
  background: var(--primary-soft);
  color: var(--primary);
}

.list-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-left: auto;
}
.search-field {
  display: flex;
  align-items: center;
  position: relative;
  min-width: 0;
}
.search-field > span {
  position: absolute;
  left: 12px;
  color: var(--muted);
  display: flex;
  pointer-events: none;
}
.search-field input {
  width: 240px;
  height: 38px;
  padding-left: 38px;
  padding-right: 12px;
  font-size: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  transition: all 0.15s ease;
}
.search-field input:focus {
  width: 270px;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  outline: none;
}
.select-control {
  height: 38px;
  padding: 0 12px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}
.more-wrap { position: relative; }
.more-menu {
  position: absolute;
  right: 0;
  top: 44px;
  width: 200px;
  padding: 6px;
  z-index: 50;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}
.more-menu button, .more-menu a {
  display: block;
  text-align: left;
  border: 0;
  background: none;
  padding: 9px 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  width: 100%;
  border-radius: 6px;
  transition: background 0.12s ease;
}
.more-menu button:hover, .more-menu a:hover {
  background: var(--soft);
  color: var(--primary);
}

/* 3. Parameter Strip (inline inside right action cluster on desktop) */
.list-toolbar .coefficient-settings {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0 10px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}
.list-toolbar .coefficient-settings[hidden] {
  display: none;
}
.coefficient-settings label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.coefficient-settings input[type="number"],
.coefficient-settings input:not([type="checkbox"]) {
  width: 60px;
  height: 26px;
  padding: 2px 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: center;
  transition: all 0.15s ease;
}
.coefficient-settings input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--primary);
  vertical-align: middle;
}
.coefficient-settings input:focus {
  background: var(--panel);
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.coefficient-settings > span {
  display: none;
  font-size: 11.5px;
  color: var(--muted);
  align-items: center;
  gap: 4px;
}
.coefficient-settings > span::before {
  content: 'ℹ';
  font-size: 11px;
  color: var(--primary);
}
@media(max-width: 1080px) {
  .list-actions {
    flex-wrap: wrap;
    width: 100%;
    margin-left: 0;
  }
  .list-actions .coefficient-settings {
    order: 4;
    flex: 1 1 100%;
    height: auto;
    min-height: 38px;
    padding: 8px 12px;
    background: var(--panel);
    box-shadow: var(--shadow);
    justify-content: space-between;
  }
  .list-actions .coefficient-settings label {
    color: var(--ink);
  }
  .list-actions .coefficient-settings > span {
    display: inline-flex;
  }
}

.list-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  padding: 0 2px;
}

/* 4. Competition Grid & Cards (Full-width 3-zone horizontal layout on wide desktop) */
.competition-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.competition-grid.history-mode {
  grid-template-columns: minmax(0, 1fr);
}
.competition-card {
  padding: 16px 20px;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1.05fr 1.72fr 1.22fr;
  gap: 18px;
  align-items: stretch;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card-zone-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding-right: 16px;
  border-right: 1px solid var(--line);
}
.card-zone-mid {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}
.card-zone-right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}
.card-reward-compact {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}
.card-right-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-right-foot .text-btn {
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--primary);
  font-weight: 600;
  font-size: 12px;
  border: 1px solid var(--line);
  transition: all 0.15s ease;
}
.card-right-foot .text-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary-border);
}
.upcoming-mid-note {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: var(--soft);
}
.upcoming-mid-note > span {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink);
  margin-bottom: 4px;
}
.upcoming-mid-note > small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}
.competition-card > .error-text {
  grid-column: 1 / -1;
  margin: 0;
}
.competition-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-border);
  box-shadow: var(--shadow-lg);
}

/* Card Heading & Token Identity */
.card-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.token-identity {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  flex: 1;
}
.token-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  background: var(--soft);
}
.token-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}
.token-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.token-identity h2 {
  font-size: 16px;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.token-detail-link {
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  cursor: pointer;
  transition: color 0.15s ease;
}
.token-detail-link:hover {
  color: var(--primary);
}
.token-symbol-text {
  font-weight: 750;
  color: var(--ink);
}
.token-identity h2 .round {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  background: var(--soft);
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.token-identity p {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.quote-pill {
  font-size: 10px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--primary-border);
}

/* Card Schedule & Progress Track */
.card-schedule {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted);
}
.card-schedule b {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--soft);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.card-schedule .urgent {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: var(--warning-border);
}
.progress-track {
  height: 4px;
  background: var(--soft);
  margin: 2px 0;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.progress-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #6366f1 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Dual Metric Boxes (Aligns perfectly!) */
.card-metrics {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 10px;
  margin-bottom: 0;
}
.card-metrics > div {
  background: var(--soft);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 74px;
}
.metric-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 4px;
}
.metric-value {
  font-size: 24px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 3px;
  white-space: nowrap;
}
.metric-value .unit {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.metric-sub {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-zone-right .metric-value { font-size: 19px; }
.card-zone-right .metric-small .metric-value { font-size: 18px; }
.card-zone-mid .official-threshold-panel { margin: 0; }
.card-zone-mid .prediction-panel {
  border: 1px solid var(--line);
  background: var(--soft);
  margin: 0;
  padding: 8px 12px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.card-zone-mid .prediction-panel h3 {
  margin: 0;
  font-size: 11px;
  gap: 6px;
}
.card-zone-mid .prediction-panel .prediction-tiles {
  display: inline-flex;
  margin: 0;
}
.card-zone-mid .prediction-panel .prediction-tile {
  padding: 0;
  border: 0;
  background: none;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.card-zone-mid .prediction-panel .prediction-tile > span { display: none; }
.card-zone-mid .prediction-panel .prediction-tile > strong { font-size: 14.5px; }
.card-zone-mid .prediction-panel .prediction-note { display: none; }
.card-right-foot .card-freshness {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.card-right-foot .mini-spark {
  width: 64px;
}
.chain-volume-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  margin: -4px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.chain-volume-row strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
}
.chain-volume-row small { text-align: right; font-size: 10px; }
.detail-chain { margin: 10px 0; }
@media (max-width: 600px) {
  .chain-volume-row { flex-direction: column; }
  .chain-volume-row small { text-align: left; }
}

/* Card Bottom (Reward & Action) */
.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 10px;
  margin-top: 2px;
  border-top: 1px solid var(--line);
  gap: 12px;
}
.reward-line {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}
.reward-line b {
  color: var(--ink);
  font-weight: 600;
}
.reward-line .metric-sub {
  display: inline-block;
  margin-top: 0;
  margin-left: 6px;
  color: var(--positive);
  font-weight: 500;
  background: var(--positive-soft);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--positive-border);
}
.card-bottom .text-btn {
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--primary);
  font-weight: 600;
  font-size: 12px;
  border: 1px solid var(--line);
  transition: all 0.15s ease;
}
.card-bottom .text-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

/* Card Freshness & Sparkline */
.card-freshness {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}
.card-freshness .chip {
  padding: 2px 7px;
  font-size: 10px;
}
.mini-spark-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: var(--soft);
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.mini-spark {
  width: 90px;
  height: 22px;
  flex: none;
  color: var(--primary);
  display: block;
}

/* 5. Prediction Panel (Web3 Analytics Reference) */
.prediction-panel {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
  min-width: 0;
}
.prediction-panel h3 {
  font-size: 13px;
  font-weight: 650;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
}
.prediction-panel h3 > span {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-soft);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--primary-border);
}
.prediction-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.prediction-tile {
  padding: 12px 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 0;
}
.prediction-tile:only-child {
  grid-column: 1 / -1;
}
.prediction-tile > span {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}
.prediction-tile > strong {
  display: block;
  font-size: 22px;
  font-weight: 750;
  line-height: 1.25;
  color: var(--ink);
  white-space: nowrap;
}
.prediction-tile > strong > small {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 4px;
}
.prediction-panel .prediction-note {
  font-size: 11px;
  color: var(--muted);
  margin: 8px 0 0;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 6. History Table */
.history-list {
  display: block;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.history-table th {
  background: var(--soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.history-table td {
  padding: 16px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
.history-table th:first-child, .history-table td:first-child {
  text-align: left;
}
.history-table tr:last-child td {
  border-bottom: 0;
}
.history-table tbody tr {
  transition: background 0.12s ease;
}
.history-table tbody tr:hover {
  background: var(--soft);
}
.history-table .token-avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 12px;
}
.history-table .token-identity {
  gap: 10px;
}
.history-table .token-identity h2 {
  font-size: 13px;
  white-space: nowrap;
}
.history-table .row-date {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.history-table .row-date small {
  display: block;
  font-size: 10px;
  margin-top: 2px;
}
.history-table .reward-col {
  white-space: nowrap;
}
.history-table .reward-col strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.history-table .reward-val {
  display: block;
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 2px;
}
.history-table .volume-col {
  white-space: nowrap;
}
.history-table .result-amount {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.history-table small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}
.history-table .final-coefficient {
  font-size: 15px;
  font-weight: 750;
  color: var(--primary);
  white-space: nowrap;
}
.history-table .text-btn {
  font-size: 11px;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--soft);
  border: 1px solid var(--line);
}
.history-table .text-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary-border);
}
.history-table .row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* 7. Detail Dialog */
.detail-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  gap: 10px;
  padding: 14px 24px;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}
.detail-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px 12px;
  color: var(--muted);
  font-size: 13px;
}
.detail-empty p { margin: 0; }
#detail-content > .detail-info-panel,
#detail-content > .detail-standalone-threshold {
  margin: 0 24px 18px;
}
.detail-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
}
.detail-total {
  padding: 18px 20px;
  background: var(--primary-soft);
  border-radius: 12px;
  border: 1px solid var(--primary-border);
}
.detail-total > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.detail-total > strong {
  display: block;
  font-size: 26px;
  color: var(--primary);
  font-weight: 750;
  letter-spacing: -0.02em;
  margin: 6px 0;
  word-break: break-word;
}
.detail-total small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}
.detail-days {
  margin-top: 16px;
  display: grid;
  gap: 6px;
}
.day-list-heading {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  margin: 0 4px 6px;
  text-transform: uppercase;
}
.day-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  width: 100%;
  font-size: 12px;
  transition: all 0.15s ease;
}
.day-button:hover {
  background: var(--soft);
}
.day-button[aria-pressed=true] {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  color: var(--primary);
}
.day-button small {
  color: var(--muted);
  font-size: 10px;
  display: block;
  margin-top: 2px;
}
.day-button > strong {
  font-weight: 700;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.detail-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}
.detail-section-heading h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}
.detail-section-heading span {
  font-size: 11px;
  color: var(--muted);
}
.detail-hours {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.hour-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  min-width: 0;
  background: var(--panel);
  position: relative;
  transition: all 0.15s ease;
}
.hour-tile > span {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
}
.hour-tile > .hour-time {
  padding-right: 32px;
  font-weight: 600;
}
.hour-tile > .hour-multiplier {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--negative-soft);
  color: var(--negative);
  border: 1px solid rgba(244, 63, 94, 0.2);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.hour-tile strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  color: var(--ink);
}
.hour-tile small {
  font-size: 9px;
  color: var(--muted);
}
.hour-tile.future {
  background: var(--soft);
  color: var(--muted);
  border-color: transparent;
}
.hour-tile.live {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 8px var(--primary-soft);
}
.hour-tile.gap {
  border-style: dashed;
  background: var(--warning-soft);
  color: var(--warning);
}
.hour-tile.gap small { color: var(--warning); }

.detail-chart {
  margin: 0 24px 24px;
  padding: 18px 20px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  position: relative;
}
.volume-chart {
  width: 100%;
  height: auto;
  display: block;
  color: var(--muted);
  overflow: visible;
}
.volume-chart rect.bar {
  fill: var(--primary);
  opacity: 0.65;
  cursor: pointer;
  transition: opacity 0.15s, fill 0.15s;
}
.volume-chart rect.bar.selected { opacity: 1; fill: var(--primary-hover); }
.volume-chart rect.bar:hover, .volume-chart rect.bar:focus {
  opacity: 1;
  fill: var(--positive);
}
.chart-tooltip {
  margin-top: 8px;
  min-height: 18px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.chart-legend {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--muted);
}
.chart-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--primary);
  margin-right: 4px;
}
.chart-legend i.gap { background: var(--warning); }
.chart-legend i.up { background: var(--positive); }
.chart-legend i.down { background: var(--negative); }
.detail-chart-head {
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.detail-chart-head > div:first-child {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.chart-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.chart-segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 9px;
  background: var(--panel);
  border: 1px solid var(--line);
  gap: 2px;
}
.chart-tab-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.14s ease;
}
.chart-tab-btn:hover { color: var(--ink); }
.chart-tab-btn[aria-pressed="true"] {
  background: var(--primary-soft);
  color: var(--primary);
}
.chart-tab-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
[data-zoom-chart].is-zoomed {
  cursor: grab;
  touch-action: pan-y;
}
[data-zoom-chart].is-grabbing {
  cursor: grabbing;
  user-select: none;
}
@media (max-width: 640px) {
  .chart-tab-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
}

.detail-lower {
  margin: 0 24px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.detail-lower.single-panel {
  grid-template-columns: 1fr;
}
.detail-info-panel {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.detail-info-panel h3 {
  font-size: 13px;
  margin: 0 0 10px;
  font-weight: 650;
  color: var(--ink);
}
.detail-rules {
  margin: 0 24px 24px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.detail-rules summary {
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}
.rule-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
.rule-list .chip { font-size: 10px; }

/* 8. Responsive Design & Mobile Web3 Alignment Fixes */

/* Half-screen Desktop / Landscape Tablet (900px – 1199px): Smooth 2-tier wide card */
@media(max-width: 1199px) {
  .competition-card {
    grid-template-columns: 1fr 1.12fr;
    gap: 14px 18px;
    padding: 16px 18px;
  }
  .card-zone-left {
    grid-column: 1;
    grid-row: 1;
    padding-right: 16px;
    border-right: 1px solid var(--line);
  }
  .card-zone-right {
    grid-column: 2;
    grid-row: 1;
    padding-left: 0;
    border-left: 0;
  }
  .card-zone-mid {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }
}

/* Large Tablets / Small Laptops */
@media(max-width: 1100px) {
  .competition-grid {
    grid-template-columns: 1fr;
  }
  .overview-strip {
    grid-template-columns: repeat(3, 1fr) 1.2fr;
  }
  .history-table td, .history-table th {
    padding: 12px 10px;
  }

  /* History Bento Card Grid for <= 1100px */
  .history-list.panel {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }
  .history-table, .history-table tbody { display: block; width: 100%; }
  .history-table thead { display: none; }
  .history-table tbody {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .history-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px;
    gap: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel);
    box-shadow: var(--shadow);
    align-content: start;
  }
  .history-table tr:hover {
    background: var(--panel);
    border-color: var(--primary-border);
  }
  .history-table td {
    display: block;
    padding: 0;
    border: 0;
    text-align: left;
    min-width: 0;
  }
  .history-table td:first-child {
    grid-column: 1;
    grid-row: 1;
  }
  .history-table td:nth-child(7) {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: start;
    text-align: right;
  }
  .history-table td:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line-light);
  }
  .history-table td:last-child {
    grid-column: 1 / -1;
  }
  .history-table td[data-label]:before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 3px;
    text-transform: uppercase;
  }
  .history-table td:nth-child(7):before {
    display: none;
  }
  .history-table .row-actions {
    justify-content: flex-end;
    border-top: 1px solid var(--line-light);
    padding-top: 10px;
    margin-top: 2px;
    gap: 10px;
  }
  .history-table .text-btn {
    min-height: 38px;
    padding: 8px 14px;
  }
}
@media(max-width: 680px) {
  .history-table tbody {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Portrait Tablets (<= 899px): Compact 2-column vertical cards */
@media(max-width: 899px) {
  .competition-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .competition-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }
  .card-zone-left,
  .card-zone-mid,
  .card-zone-right {
    padding: 0;
    border: 0;
  }
  .card-zone-mid .prediction-panel {
    display: block;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    padding: 12px 0 0;
  }
  .card-zone-mid .prediction-panel h3 { margin-bottom: 8px; }
  .card-zone-mid .prediction-panel .prediction-tiles { display: grid; }
  .card-zone-mid .prediction-panel .prediction-tile {
    display: block;
    padding: 10px 12px;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 8px;
  }
  .card-zone-mid .prediction-panel .prediction-tile > span { display: block; }
  .card-zone-mid .prediction-panel .prediction-tile > strong { font-size: 18px; }
  .card-zone-mid .prediction-panel .prediction-note { display: flex; }
  .card-right-foot {
    border-top: 1px solid var(--line);
    padding-top: 10px;
    flex-wrap: wrap;
  }
}

/* Tablets (<= 850px) */
@media(max-width: 850px) {
  .overview-strip {
    grid-template-columns: repeat(3, 1fr);
  }
  .overview-focus {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--primary-border);
    padding: 16px 20px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .overview-focus > div { margin: 0; }
  .overview-focus small { margin-left: auto; }
  .detail-layout {
    grid-template-columns: 240px 1fr;
    gap: 16px;
  }
  .detail-hours {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Mobile & Web3 In-App Wallet Browser (<= 640px) */
@media(max-width: 640px) {
  /* Prevent horizontal overflow */
  html, body {
    overflow-x: hidden;
  }
  
  /* Overview single-row 3 KPIs + full-width next-finish strip */
  .overview-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 14px;
  }
  .overview-item {
    padding: 12px 8px;
    align-items: center;
    text-align: center;
  }
  .overview-item:nth-child(3):after {
    display: none;
  }
  .overview-item strong {
    font-size: 22px;
    margin: 2px 0 0;
  }
  .overview-focus {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 10px;
    padding: 10px 14px;
  }
  .overview-focus > div {
    font-size: 14px;
    margin: 0;
  }
  .overview-focus small {
    margin-left: 0;
    width: 100%;
  }

  /* Toolbar 2-row responsive stack */
  .list-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .segmented {
    width: 100%;
    display: flex;
  }
  .segmented button {
    flex: 1;
    justify-content: center;
    min-height: 38px;
    padding: 8px 10px;
  }
  .list-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .list-actions .search-field {
    flex: 1 1 calc(100% - 48px);
    min-width: 0;
    order: 1;
  }
  .list-actions .more-wrap {
    order: 2;
    flex: none;
  }
  .list-actions .select-control {
    order: 3;
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    height: 40px;
  }
  .list-actions .search-field input {
    width: 100%!important;
    height: 40px;
    font-size: 13px;
  }

  /* Parameter strip */
  .list-actions .coefficient-settings {
    width: 100%;
    height: auto;
    padding: 8px 12px;
    font-size: 12px;
    justify-content: space-between;
  }
  .list-actions .coefficient-settings label {
    font-size: 12px;
    gap: 8px;
  }
  .list-actions .coefficient-settings input[type="number"],
  .list-actions .coefficient-settings input:not([type="checkbox"]) {
    width: 72px;
    height: 36px;
  }
  .competition-card .text-btn {
    min-height: 38px;
    padding: 8px 14px;
  }
  
  /* Cards (<= 640px mobile single-column stack) */
  .competition-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .competition-card {
    padding: 16px;
  }
  .card-right-foot .text-btn {
    min-height: 38px;
    padding: 8px 14px;
  }
  .token-avatar {
    width: 38px;
    height: 38px;
    font-size: 13px;
  }
  .token-identity h2 {
    font-size: 15px;
  }
  .card-metrics {
    gap: 8px;
  }
  .card-metrics > div {
    padding: 10px 12px;
    min-height: 76px;
  }
  .metric-value {
    font-size: 20px;
  }
  .metric-small .metric-value {
    font-size: 18px;
  }
  .card-bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .card-bottom .text-btn {
    width: 100%;
    justify-content: center;
    min-height: 38px;
  }
  
  /* Detail Dialog on Mobile - Complete Native Mobile Adaptation */
  dialog:not([open]) {
    display: none !important;
  }
  #detail-dialog[open] {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--page);
    display: flex !important;
    flex-direction: column;
    padding: 0;
    box-sizing: border-box;
    z-index: 1000;
  }
  #detail-dialog .dialog-header {
    padding: 12px 16px;
    min-height: 52px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
  }
  #detail-dialog .dialog-header h2 {
    font-size: 15.5px;
    font-weight: 700;
    margin: 0;
    line-height: 1.25;
  }
  #detail-dialog .dialog-header p {
    font-size: 11px;
    color: var(--muted);
    margin: 2px 0 0;
    line-height: 1.25;
  }
  #detail-dialog .dialog-header .icon-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--soft);
    border: 1px solid var(--line);
    color: var(--ink);
  }
  #detail-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 30px;
  }
  .detail-meta-bar {
    padding: 10px 14px;
    font-size: 11px;
    gap: 8px;
    background: var(--soft);
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
  }
  .detail-meta-bar .chip {
    font-size: 10px;
    padding: 2px 6px;
  }
  .detail-empty {
    padding: 16px 14px 10px;
  }
  #detail-content > .detail-info-panel,
  #detail-content > .detail-standalone-threshold {
    margin: 0 14px 14px;
  }
  .detail-layout {
    display: flex;
    flex-direction: column;
    padding: 14px 14px 0;
    gap: 14px;
  }
  .detail-total {
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--primary-soft);
    border: 1px solid var(--primary-border);
  }
  .detail-total > span {
    font-size: 11px;
    color: var(--muted);
  }
  .detail-total > strong {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
    margin: 4px 0 6px;
    word-break: break-all;
  }
  .detail-total small {
    font-size: 11px;
    line-height: 1.5;
  }
  .day-list-heading {
    display: none !important;
  }
  .detail-days {
    margin-top: 0;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding: 2px 2px 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .detail-days::-webkit-scrollbar {
    display: none;
  }
  .day-button {
    flex: 0 0 115px;
    min-height: 56px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 2px;
    box-sizing: border-box;
    text-align: left;
    transition: all .15s ease;
  }
  .day-button[aria-pressed=true] {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
  }
  .day-button > span {
    font-size: 11.5px;
    font-weight: 600;
    display: block;
    white-space: nowrap;
  }
  .day-button small {
    font-size: 9.5px;
    color: var(--muted);
    display: block;
    white-space: nowrap;
    margin-top: 1px;
  }
  .day-button > strong {
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);
    display: block;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
  }
  .day-button[aria-pressed=true] > strong {
    color: var(--primary);
  }
  .detail-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 10px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .detail-section-heading h3 {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink);
  }
  .detail-section-heading span {
    font-size: 11px;
    color: var(--muted);
  }
  .detail-hours {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .hour-tile {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    background: var(--panel);
    position: relative;
    min-height: 54px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
  }
  .hour-tile > span {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
  .hour-tile > .hour-time {
    padding-right: 0;
    font-weight: 700;
    font-size: 11.5px;
    color: var(--ink);
  }
  .hour-tile > .hour-multiplier {
    position: static;
    display: inline-flex;
    align-items: center;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--negative-soft);
    color: var(--negative);
    border: 1px solid rgba(244, 63, 94, 0.25);
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1.2;
  }
  .hour-tile .hour-value {
    margin-top: 4px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
  }
  .hour-tile strong {
    font-size: 12px;
    font-weight: 700;
    margin-top: 0;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
  }
  .hour-tile small.hour-status {
    font-size: 9.5px;
    color: var(--muted);
    font-weight: 500;
  }
  .detail-chart {
    margin: 14px 14px 0;
    padding: 14px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  .volume-chart {
    width: 100%;
    height: auto;
    min-height: 110px;
  }
  .chart-tooltip {
    font-size: 10.5px;
    margin-top: 6px;
  }
  .detail-lower {
    margin: 14px 14px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .detail-info-panel {
    padding: 14px 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  .detail-info-panel h3 {
    font-size: 13px;
    margin: 0 0 8px;
    font-weight: 700;
  }
  .detail-rules {
    margin: 14px 14px 24px;
    padding: 12px 14px;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 12px;
  }
}

/* 9. Official Threshold Tracking, Calculating Transition, Trend Curve & Admin Watcher */
.heading-statuses {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.chip.calculating {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: var(--warning-border);
}
.chip.calculating::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}
.chip.alert-chip {
  background: var(--negative-soft);
  color: var(--negative);
  border-color: rgba(225, 29, 72, 0.28);
}

.competition-card.is-calculating-card {
  border-color: var(--warning-border);
}

.official-threshold-panel {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--soft);
}
.official-threshold-panel.is-live {
  background: linear-gradient(180deg, var(--positive-soft), transparent 130%);
  border-color: var(--positive-border);
}
.official-threshold-panel.is-calculating {
  background: linear-gradient(180deg, var(--warning-soft), transparent 130%);
  border-color: var(--warning-border);
}
.official-threshold-panel.is-waiting {
  padding: 10px 13px;
  border-style: dashed;
}
.detail-info-panel .official-threshold-panel {
  margin-top: 0;
}
.detail-standalone-threshold {
  padding: 0 24px 18px;
}

.threshold-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.official-threshold-panel:not(.is-waiting) .threshold-panel-head {
  margin-bottom: 10px;
}
.threshold-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.threshold-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.threshold-badge.live { color: var(--positive); }
.threshold-badge.live i { background: var(--positive); box-shadow: 0 0 6px var(--positive); }
.threshold-badge.calculating { color: var(--warning); }
.threshold-badge.calculating i { background: var(--warning); box-shadow: 0 0 6px var(--warning); }
.threshold-badge.waiting { color: var(--muted); font-weight: 600; font-size: 11.5px; }
.threshold-sync-meta {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.threshold-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.threshold-tile {
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  min-width: 0;
}
.threshold-tile.accent {
  border-color: var(--primary-border);
  background: linear-gradient(180deg, var(--primary-soft), var(--panel) 95%);
}
.threshold-tile > span {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 4px;
}
.threshold-tile > strong {
  display: block;
  font-size: 21px;
  font-weight: 750;
  line-height: 1.25;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.threshold-tile.accent > strong {
  color: var(--primary);
}
.threshold-tile > strong > small {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 3px;
}
.threshold-sub {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.threshold-calc-foot {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--warning-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}
.btn-xs {
  min-height: 30px;
  padding: 4px 11px;
  font-size: 11.5px;
  border-radius: 7px;
}

/* Threshold Trend Chart in Detail Modal */
.threshold-trend-section.is-empty {
  padding: 14px 20px;
}
.threshold-trend-section.is-empty .hint {
  margin: 4px 0 0;
}
.threshold-summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.threshold-summary-pills > span {
  font-size: 11px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 3px 9px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.threshold-summary-pills b {
  color: var(--ink);
  font-weight: 700;
}
.threshold-chart {
  width: 100%;
  height: auto;
  display: block;
  color: var(--muted);
  overflow: visible;
}
.threshold-dot {
  fill: var(--panel);
  stroke: var(--positive);
  stroke-width: 2.2;
  transition: transform 0.15s ease, fill 0.15s ease;
}
.threshold-dot.is-final {
  fill: var(--positive);
}
.threshold-point-group:hover .threshold-dot,
.threshold-point-group:focus-within .threshold-dot {
  fill: var(--positive);
  stroke-width: 3;
}
.threshold-step-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.threshold-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  font-size: 11px;
  border-radius: 7px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
}
.threshold-step-pill b {
  color: var(--muted);
  font-weight: 600;
}
.threshold-step-pill em {
  font-style: normal;
  font-weight: 650;
  color: var(--positive);
}

/* Admin Watcher Maintenance Panel */
.admin-watcher-panel {
  padding: 18px 22px;
  margin-bottom: 22px;
}
.admin-watcher-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.admin-watcher-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.admin-watcher-head strong {
  font-size: 14px;
  color: var(--ink);
}
.admin-watcher-head .hint {
  margin: 0;
  font-size: 11.5px;
}
#admin-watcher-alert {
  margin-top: 12px;
}
.cookie-update-form {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.cookie-update-form input {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--soft);
  color: var(--ink);
  font-size: 12.5px;
  min-width: 0;
}
.cookie-update-form input:focus {
  background: var(--panel);
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-soft);
}
#threshold-cookie-error:empty {
  display: none;
}

@media(max-width: 640px) {
  .heading-statuses {
    width: 100%;
  }
  .threshold-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .threshold-tile > strong {
    font-size: 19px;
  }
  .threshold-calc-foot {
    flex-direction: column;
    align-items: stretch;
  }
  .cookie-update-form {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-watcher-panel {
    padding: 14px 16px;
  }
}
