:root {
  color-scheme: dark;
  --bg: #101214;
  --panel: #181b1f;
  --panel-2: #20242a;
  --line: #303640;
  --text: #eef2f4;
  --muted: #9aa5ad;
  --green: #43d17a;
  --red: #f46f65;
  --amber: #f2ba4b;
  --blue: #6fb5ff;
  --ink: #0d1115;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
textarea,
select,
input {
  font: inherit;
}

button,
select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
}

button {
  cursor: pointer;
  padding: 0 14px;
  font-weight: 700;
}

button:hover {
  border-color: var(--blue);
}

.app-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.header-controls {
  display: inline-grid;
  grid-template-columns: auto 120px;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}

.header-controls label {
  font-size: 0.82rem;
  font-weight: 800;
}

.header-controls select {
  min-width: 110px;
}

.market-switcher {
  display: inline-flex;
  gap: 6px;
  margin-top: 10px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.market-switcher a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.market-switcher a:hover,
.market-switcher a.active {
  background: var(--green);
  color: var(--ink);
}

.clock-panel {
  display: grid;
  align-content: center;
  min-width: 230px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-align: right;
}

.clock-panel span,
.clock-panel small,
.status-line,
.notes-band,
label {
  color: var(--muted);
}

.clock-panel strong {
  font-size: 1.9rem;
  line-height: 1.1;
}

.control-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field label {
  font-size: 0.82rem;
  font-weight: 800;
}

textarea {
  width: 100%;
  min-height: 64px;
  max-height: 96px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #0d1013;
  color: var(--text);
  text-transform: uppercase;
}

.social-field textarea {
  text-transform: none;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}

select {
  width: 100%;
}

output {
  color: var(--text);
  font-weight: 800;
}

.actions {
  display: flex;
  gap: 8px;
}

.watchlist-actions {
  align-self: start;
}

.watchlist-actions button {
  min-width: 92px;
}

.actions button:first-child {
  background: var(--green);
  border-color: var(--green);
  color: var(--ink);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.column-panel {
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.column-panel summary {
  cursor: pointer;
  min-height: 40px;
  padding: 10px 14px;
  color: var(--text);
  font-weight: 800;
}

.column-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  padding: 0 14px 14px;
}

.column-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.summary-grid article {
  display: grid;
  gap: 8px;
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.summary-grid span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.summary-grid strong {
  font-size: 1.7rem;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.status-line {
  min-height: 42px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

table {
  width: 100%;
  min-width: 1540px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #20262d;
}

.ticker {
  display: grid;
  gap: 2px;
}

.ticker strong {
  font-size: 1.05rem;
}

.ticker span,
.checks,
.social-note {
  color: var(--muted);
  font-size: 0.82rem;
}

.social-note {
  display: grid;
  gap: 3px;
  min-width: 130px;
}

.chart-links {
  display: flex;
  gap: 6px;
}

.chart-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  min-width: 56px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 800;
}

.chart-links a:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-width: 92px;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.badge.buy {
  background: var(--green);
}

.badge.watch {
  background: var(--amber);
}

.badge.avoid {
  background: var(--red);
}

.score {
  font-size: 1.3rem;
  font-weight: 900;
}

.up {
  color: var(--green);
}

.down {
  color: var(--red);
}

.flat {
  color: var(--muted);
}

.notes-band {
  padding: 14px 2px 0;
  line-height: 1.55;
}

@media (max-width: 880px) {
  .app-shell {
    width: min(100% - 20px, 1280px);
    padding-top: 18px;
  }

  .topbar,
  .control-band {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .clock-panel {
    text-align: left;
  }

  .header-controls {
    grid-template-columns: 1fr 120px;
    width: min(100%, 280px);
  }

  .market-switcher {
    display: flex;
    width: min(100%, 320px);
  }

  .market-switcher a {
    flex: 1;
  }

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

  .actions {
    display: flex;
    flex-wrap: wrap;
  }
}

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