:root {
  color-scheme: dark;
  --bg: #0e1116;
  --panel: #171b22;
  --panel-soft: #1e242d;
  --text: #f6f7f9;
  --muted: #9ca8b8;
  --line: rgba(255, 255, 255, 0.1);
  --green: #23c483;
  --red: #f45d5d;
  --amber: #e9b44c;
  --blue: #64a7ff;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(35, 196, 131, 0.14), transparent 26rem),
    linear-gradient(145deg, #0e1116 0%, #141820 55%, #0d1015 100%);
}

button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-soft);
  font: inherit;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  font: inherit;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(14, 17, 22, 0.96);
}

.login-screen[hidden] {
  display: none;
}

.login-card {
  display: grid;
  gap: 12px;
  width: min(420px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.login-card h2 {
  font-size: 1.4rem;
}

.form-message {
  min-height: 18px;
  color: var(--amber);
  font-size: 0.86rem;
}

.shell {
  width: min(860px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 18px;
}

.eyebrow,
.label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.9rem, 9vw, 3.7rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  font-size: 1.05rem;
}

.icon-button {
  width: 48px;
  min-width: 48px;
  padding: 0;
  font-size: 1.35rem;
}

.status-strip,
.actions,
.section-title,
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.status-strip {
  margin: 4px 0 12px;
}

.status-strip > div,
.market-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 27, 34, 0.82);
}

.status-strip > div {
  padding: 12px;
}

.status-strip strong {
  display: block;
  min-height: 20px;
  font-size: 0.95rem;
}

.actions {
  margin-top: 10px;
}

.actions button:first-child {
  background: #f6f7f9;
  color: #101318;
}

.tabs {
  grid-template-columns: repeat(3, 1fr);
  position: sticky;
  top: max(8px, env(safe-area-inset-top));
  z-index: 2;
  margin: 4px 0 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(14, 17, 22, 0.88);
  backdrop-filter: blur(16px);
}

.tab-button {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
}

.tab-button.active {
  background: var(--panel-soft);
  color: var(--text);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.signals {
  display: grid;
  gap: 10px;
}

.signal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(23, 27, 34, 0.9);
}

.signal-card.long {
  border-color: rgba(35, 196, 131, 0.42);
}

.signal-card.short {
  border-color: rgba(244, 93, 93, 0.44);
}

.signal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.symbol {
  display: block;
  font-size: 1.2rem;
}

.title {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
}

.score {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--amber);
  font-weight: 900;
}

.reason {
  margin-top: 12px;
  color: #dce3ec;
  line-height: 1.42;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.metrics span,
.wall,
.pressure,
.trade-plan,
.timeframes span,
.leader-row {
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
}

.metrics span {
  min-height: 40px;
  padding: 9px;
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.metrics b {
  display: block;
  color: var(--text);
  font-size: 0.95rem;
}

.timeframes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.timeframes span {
  min-height: 34px;
  padding: 8px 9px;
  color: var(--muted);
  font-size: 0.82rem;
}

.timeframes b {
  float: right;
  color: var(--text);
  font-size: 0.88rem;
}

.pressure {
  margin-top: 8px;
  padding: 10px;
  color: #dce3ec;
  font-size: 0.88rem;
  font-weight: 700;
}

.wall {
  display: none;
  margin-top: 8px;
  padding: 10px;
  color: var(--blue);
  font-weight: 700;
}

.wall.visible {
  display: block;
}

.trade-plan {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
}

.trade-plan.long {
  border-color: rgba(35, 196, 131, 0.38);
}

.trade-plan.short {
  border-color: rgba(244, 93, 93, 0.4);
}

.trade-plan.wait {
  border-color: rgba(233, 180, 76, 0.34);
}

.plan-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.plan-label {
  font-size: 0.98rem;
}

.plan-confidence {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
}

.plan-text {
  margin-top: 8px;
  color: #dce3ec;
  font-size: 0.9rem;
  line-height: 1.42;
}

.plan-levels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.plan-levels span {
  min-height: 42px;
  padding: 8px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.16);
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.plan-levels b {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
}

.market-table,
.monitor-group,
.settings-block {
  margin-top: 16px;
  padding: 14px;
}

.settings-block,
.monitor-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 27, 34, 0.82);
}

.section-title {
  align-items: end;
  margin-bottom: 10px;
}

.section-title span {
  color: var(--muted);
  text-align: right;
  font-size: 0.85rem;
}

.leaders,
.monitor-list {
  display: grid;
  gap: 7px;
}

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

.monitor-summary > div,
.setting-grid span,
.monitor-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 27, 34, 0.86);
}

.monitor-summary > div,
.setting-grid span {
  padding: 12px;
}

.monitor-summary strong,
.setting-grid b {
  display: block;
  color: var(--text);
}

.setting-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

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

.user-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.users-list {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.user-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  min-height: 40px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
}

.user-row span {
  color: var(--muted);
  font-size: 0.84rem;
}

.monitor-card {
  padding: 13px;
}

.monitor-card.long {
  border-color: rgba(35, 196, 131, 0.36);
}

.monitor-card.short {
  border-color: rgba(244, 93, 93, 0.36);
}

.monitor-card.closed {
  opacity: 0.76;
}

.monitor-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.monitor-symbol {
  display: block;
  font-size: 1.05rem;
}

.monitor-title {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.84rem;
}

.monitor-status {
  height: 28px;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.monitor-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.monitor-metrics span {
  min-height: 40px;
  padding: 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.monitor-metrics b {
  display: block;
  color: var(--text);
  font-size: 0.88rem;
}

.monitor-event {
  margin-top: 10px;
  color: #dce3ec;
  font-size: 0.88rem;
  line-height: 1.38;
}

.monitor-history {
  margin-top: 10px;
}

.monitor-history summary {
  min-height: 36px;
  padding: 9px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 800;
}

.history-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.history-list li {
  position: relative;
  padding: 0 0 0 18px;
  color: var(--muted);
  font-size: 0.78rem;
}

.history-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
}

.history-list span,
.history-list b,
.history-list em {
  display: block;
}

.history-list b {
  margin-top: 2px;
  color: var(--text);
  font-size: 0.86rem;
}

.history-list em {
  margin-top: 2px;
  color: #dce3ec;
  font-style: normal;
}

.leader-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 9px 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.leader-row strong {
  color: var(--text);
}

.positive,
.metrics b.positive,
.timeframes b.positive,
.monitor-metrics b.positive,
.monitor-summary strong.positive,
.history-list em.positive {
  color: var(--green);
}

.negative,
.metrics b.negative,
.timeframes b.negative,
.monitor-metrics b.negative,
.monitor-summary strong.negative,
.history-list em.negative {
  color: var(--red);
}

@media (max-width: 520px) {
  .status-strip,
  .actions,
  .monitor-summary,
  .setting-grid,
  .user-form,
  .metrics,
  .timeframes,
  .plan-levels {
    grid-template-columns: 1fr;
  }

  .plan-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .plan-confidence {
    text-align: left;
  }

  .leader-row {
    grid-template-columns: 1fr auto;
  }

  .monitor-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .leader-row span:last-child {
    grid-column: 1 / -1;
  }
}
