:where(
.hero-actions,
.hero-stack,
.logo-tile,
.metrics,
.metric,
.cards,
.card,
.grid-2,
.list,
.list-item,
.badge-row,
.market-form,
.chart-header,
.chart-wrap,
.chart-card,
.summary-cards,
.summary-card,
.bess-grid,
.bess-form-grid,
.cta-block
) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

:where(
.hero-stack,
.metrics,
.cards,
.grid-2,
.list,
.summary-cards,
.bess-grid,
.bess-form-grid
) {
  justify-items: stretch;
}

:where(
.hero-stack > *,
.metrics > *,
.cards > *,
.grid-2 > *,
.list > *,
.summary-cards > *,
.bess-form-grid > *
) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  justify-self: stretch;
}

:where(
.pill,
.card,
.list-item,
.badge,
.metric,
.summary-card,
.summary-card strong,
.status,
.chart-empty
) {
  overflow-wrap: anywhere;
}
.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0f1c14;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(128, 245, 168, 0.22), 0 6px 18px rgba(181, 255, 214, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}

@media (hover: hover) {
  .cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(128, 245, 168, 0.28), 0 10px 24px rgba(181, 255, 214, 0.25);
  }
}

a.cta:active,
button.cta:active {
  transform: translateY(1px);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  background: linear-gradient(135deg, rgba(23, 195, 107, 0.2), rgba(108, 226, 167, 0.24));
  border: 1px solid rgba(23, 195, 107, 0.28);
  color: #0a1a13;
  font-size: 0.9rem;
}

.pill .pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(89, 240, 181, 0.5);
  animation: pulse 2.5s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(89, 240, 181, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(89, 240, 181, 0); }
  100% { box-shadow: 0 0 0 0 rgba(89, 240, 181, 0); }
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-actions > * {
  min-width: 0;
  max-width: 100%;
}

.subtle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.95rem;
  cursor: default;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) {
  a.subtle:hover,
  button.subtle:hover {
    border-color: rgba(89, 240, 181, 0.35);
    color: var(--text);
    background: rgba(89, 240, 181, 0.1);
  }
}

a.subtle:active,
button.subtle:active {
  transform: translateY(1px);
}

a.subtle,
button.subtle,
.subtle[role="button"] {
  cursor: pointer;
}

a.cta,
button.cta,
a.subtle,
button.subtle {
  min-height: 44px;
  touch-action: manipulation;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.card {
  padding: 18px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  display: grid;
  gap: 10px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-2px);
    border-color: rgba(89, 240, 181, 0.35);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.26);
  }
}

.card .label {
  font-size: 0.9rem;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.card strong {
  font-size: 1.1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.list {
  display: grid;
  gap: 12px;
  color: var(--muted);
}

.list-item {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

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

.badge {
  padding: 6px 10px;
  background: linear-gradient(135deg, rgba(23, 195, 107, 0.2), rgba(108, 226, 167, 0.24));
  color: #0a1a13;
  border-radius: 10px;
  border: 1px solid rgba(23, 195, 107, 0.28);
  font-size: 0.9rem;
  min-width: 0;
  max-width: 100%;
}
.market-form {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  justify-self: stretch;
}
.market-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  min-width: 0;
  width: 100%;
}

.market-form label > span {
  font-weight: 500;
}

.market-form label:focus-within {
  color: var(--text);
}

.field-hint {
  font-size: 0.82rem;
  color: var(--muted);
}

.market-form input,
.market-form select {
  padding: 10px 12px;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)), var(--panel);
  color: var(--text);
  width: 100%;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.market-form input[type="datetime-local"],
.market-form input[type="date"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (hover: hover) {
  .market-form input:hover,
  .market-form select:hover {
    border-color: rgba(89, 240, 181, 0.35);
  }
}

.market-form input:focus-visible,
.market-form select:focus-visible {
  outline: none;
  border-color: rgba(89, 240, 181, 0.6);
  box-shadow: 0 0 0 2px rgba(89, 240, 181, 0.25);
}

.market-form select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
  linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03)),
  url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%23e8ecf3"><path d="M4 6l4 5 4-5z"/></svg>');
  background-repeat: no-repeat, no-repeat;
  background-position: left top, right 12px center;
  background-size: auto, 16px 16px;
  padding-right: 36px;
}

.market-form select option {
  background: var(--panel);
  color: var(--text);
}


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

.market-actions .status {
  flex-basis: 100%;
}

#market-form .market-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  align-items: center;
  justify-items: stretch;
}

#market-form .market-actions .status {
  grid-column: 1 / -1;
}

#market-form .market-actions > * {
  justify-content: center;
}

.market-actions .selected {
  border-color: rgba(23, 195, 107, 0.28);
  background: linear-gradient(135deg, rgba(23, 195, 107, 0.2), rgba(108, 226, 167, 0.24));
  color: #0a1a13;
  box-shadow: 0 6px 16px rgba(23, 195, 107, 0.2);
  font-weight: 700;
}
.chart-card {
  padding: 14px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  justify-self: stretch;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.chart-wrap {
  position: relative;
  min-height: 240px;
  height: clamp(240px, 38vh, 360px);
  overflow: hidden;
  color: #0f1c14;
}

.status {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.4;
}

.status:empty {
  display: none;
}

.status[data-type="error"] { color: #c41b52; }
.status[data-type="success"] { color: #0f7a3a; }
.status[data-type="loading"] { color: #0f4f30; }

button:disabled,
input:disabled,
select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.summary-card {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 6px;
}

.summary-card .label {
  color: var(--muted);
  font-size: 0.9rem;
}

.summary-card strong {
  white-space: pre-line;
  font-size: 1.05rem;
}

.chart-header .label {
  flex: 1;
  min-width: 220px;
}

.chart-header .market-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chart-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 12, 0.55);
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.3px;
  backdrop-filter: blur(4px);
  z-index: 2;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 12px;
  z-index: 1;
}

.chart-hint {
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 720px;
}
.bess-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.chart-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 20px);
  z-index: 20;
}

.chart-modal[hidden] {
  display: none;
}

.chart-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 4, 12, 0.65);
  backdrop-filter: blur(6px);
}

.chart-modal__content {
  position: relative;
  z-index: 1;
  width: min(1375px, 96vw);
  max-height: 95vh;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: clamp(12px, 2vw, 18px);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.5vw, 12px);
  overflow: hidden;
}

.chart-modal__actions {
  display: flex;
  justify-content: flex-end;
}

.chart-modal .chart-wrap {
  min-height: min(600px, 85vh);
  height: min(95vh, clamp(600px, 95vh, 900px));
  flex: 1;
  display: flex;
  align-items: center;
}

.chart-modal canvas {
  width: 100% !important;
  height: 100% !important;
}
