:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-border: rgba(71, 85, 105, 0.32);
  --text: #e5eefc;
  --muted: #9fb2cd;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.1), transparent 30%),
    linear-gradient(180deg, #07111f 0%, #0b1525 100%);
  color: var(--text);
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.hero,
.toolbar,
.panel,
.card {
  border: 1px solid var(--panel-border);
  background: var(--panel);
  border-radius: 20px;
}

.hero,
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  padding: 20px 22px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-size: 0.78rem;
}

h1, h2, p {
  margin: 0;
}

.subtitle {
  margin-top: 8px;
  color: var(--muted);
}

.back-link,
button {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: white;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.toolbar {
  align-items: center;
  flex-wrap: wrap;
}

.toolbar label {
  display: grid;
  gap: 8px;
  min-width: 180px;
}

.toolbar span {
  color: var(--muted);
  font-size: 0.86rem;
}

.toolbar select,
.toolbar input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text);
  padding: 12px 14px;
}

.symbol-picker {
  position: relative;
  min-width: 240px;
}

.symbol-options {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 20;
  display: none;
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 16px;
  background: rgba(7, 17, 31, 0.98);
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.4);
}

.symbol-options.is-open {
  display: grid;
  gap: 6px;
}

.symbol-option {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 11px 12px;
  text-align: left;
  color: var(--text);
  background: rgba(15, 23, 42, 0.72);
  cursor: pointer;
}

.symbol-option strong {
  display: block;
  font-size: 0.95rem;
}

.symbol-option small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.symbol-option:hover,
.symbol-option.is-active {
  background: rgba(56, 189, 248, 0.18);
}

.symbol-option-empty,
.symbol-option-empty:hover {
  cursor: default;
  background: rgba(239, 68, 68, 0.12);
}

.feedback {
  margin: 0 0 18px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(56, 189, 248, 0.28);
}

.feedback[data-tone="error"] {
  background: rgba(127, 29, 29, 0.25);
  border-color: rgba(248, 113, 113, 0.36);
}

.feedback[data-tone="info"] a,
.feedback[data-tone="error"] a {
  color: #7dd3fc;
  font-weight: 700;
  text-decoration: none;
}

.feedback[data-tone="info"] a:hover,
.feedback[data-tone="error"] a:hover {
  text-decoration: underline;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
  gap: 18px;
}

.details {
  display: grid;
  gap: 18px;
}

.panel {
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.badge {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.card {
  padding: 18px;
}

.card p,
.empty {
  color: var(--muted);
}

.card strong {
  display: block;
  margin-top: 8px;
  margin-bottom: 6px;
  font-size: 1.25rem;
}

.table-shell,
.history-shell {
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(71, 85, 105, 0.2);
  text-align: left;
  white-space: nowrap;
}

.data-table tbody tr.is-selected {
  background: rgba(56, 189, 248, 0.12);
}

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

  .hero,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }
}
