:root {
  color-scheme: light;
  --bg: #f4f6f1;
  --ink: #17201a;
  --muted: #617064;
  --line: #d8ded4;
  --panel: #ffffff;
  --accent: #0f6b5f;
  --accent-strong: #09483f;
  --blue: #315f9b;
  --amber: #ad6b00;
  --red: #a93b3b;
  --green: #3f7651;
  --shadow: 0 18px 40px rgba(23, 32, 26, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.login-box {
  width: min(100%, 360px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-box h1 {
  margin-bottom: 18px;
  font-size: 1.35rem;
}

.login-box .notice {
  margin: 0 0 14px;
}

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

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

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 2.8vw, 3rem);
  letter-spacing: 0;
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

h3 {
  margin: 22px 0 10px;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--muted);
}

h4 {
  margin-bottom: 6px;
  font-size: 0.95rem;
}

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

.primary,
.secondary {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 14px;
  font-weight: 750;
}

.primary {
  background: var(--accent);
  color: white;
}

.primary:hover {
  background: var(--accent-strong);
}

.primary:disabled {
  cursor: wait;
  opacity: 0.72;
}

.secondary {
  background: white;
  border-color: var(--line);
  color: var(--ink);
}

.compact {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.full {
  width: 100%;
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.metric {
  min-height: 88px;
  padding: 16px;
  background: white;
}

.metric span,
.score span,
label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.metric strong {
  font-size: 2rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(420px, 1.65fr) minmax(300px, 0.85fr);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.monitor-list,
.detail-panel,
.settings-panel,
.calendar-panel {
  padding: 16px;
}

.right-rail {
  display: grid;
  gap: 16px;
}

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

.panel-header p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.panel-header > span {
  color: var(--muted);
  font-size: 0.82rem;
}

.symbol-list {
  display: grid;
  gap: 8px;
}

.symbol-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.symbol-row:hover,
.symbol-row.active {
  border-color: var(--accent);
  background: #eef8f4;
}

.symbol-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  white-space: nowrap;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 0.76rem;
  font-weight: 850;
}

.high-priority {
  background: #ffe8d2;
  color: #803d00;
}

.watch {
  background: #dfeeff;
  color: #214a80;
}

.risk-off {
  background: #fbe0de;
  color: #842626;
}

.monitor {
  background: #e6eee6;
  color: #345b3f;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.score {
  min-height: 108px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  background: #fbfcfa;
}

.score strong {
  font-size: 1.8rem;
}

.compact-score strong {
  font-size: 1.35rem;
}

meter {
  width: 100%;
  height: 10px;
  margin-top: 14px;
}

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.signal-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.signal-list li {
  border-left: 3px solid var(--accent);
  padding: 7px 9px;
  background: #f4f8f3;
  color: #24352a;
}

.news-list {
  display: grid;
  gap: 10px;
}

.news-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.news-item p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.news-item footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.news-item a {
  color: var(--blue);
  font-weight: 750;
  text-decoration: none;
}

.calendar-list {
  display: grid;
  gap: 8px;
}

.calendar-item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
  padding: 10px;
}

.calendar-item time {
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.25;
  text-transform: uppercase;
}

.calendar-item h4 {
  margin-bottom: 3px;
}

.calendar-item p,
.calendar-item small {
  display: block;
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.calendar-item a {
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
}

label {
  display: block;
  margin-bottom: 14px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
  color: var(--ink);
  padding: 10px 11px;
}

textarea {
  resize: vertical;
}

code {
  color: var(--accent-strong);
  font-weight: 800;
}

.settings-note,
.empty {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.notice {
  margin-top: 12px;
  border: 1px solid #d9c998;
  border-radius: 6px;
  background: #fff7df;
  color: #664b00;
  padding: 10px 12px;
}

.notice.danger {
  border-color: #e7b7b7;
  background: #fff0ef;
  color: #7a2020;
}

@media (max-width: 1100px) {
  .summary-band {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1480px);
    padding-top: 10px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .topbar-actions button {
    flex: 1;
  }

  .summary-band,
  .score-grid,
  .columns {
    grid-template-columns: 1fr;
  }

  .calendar-item {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 72px;
  }
}
