:root {
  --bg: #f4f6f3;
  --panel: #ffffff;
  --ink: #17201b;
  --muted: #667268;
  --line: #dce4dc;
  --green: #168447;
  --red: #c33d35;
  --gold: #c58b1f;
  --blue: #235b8f;
  --shadow: 0 18px 45px rgba(28, 40, 32, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  background: #122018;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: #e9f6eb;
  color: #122018;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.8rem;
}

.nav-list {
  display: grid;
  gap: 8px;
  margin-top: 34px;
}

.nav-list a {
  color: rgba(255, 255, 255, 0.76);
  text-decoration: none;
  padding: 10px 12px;
  border-left: 3px solid transparent;
}

.nav-list a.active,
.nav-list a:hover {
  color: #fff;
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  gap: 9px;
  align-items: center;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.86rem;
}

.status-dot {
  width: 9px;
  height: 9px;
  background: #42d073;
  border-radius: 50%;
}

.shell {
  margin-left: 248px;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow,
.label {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.1rem;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.primary-button,
.icon-button {
  border: 0;
  min-height: 42px;
  cursor: pointer;
}

.primary-button {
  padding: 0 18px;
  background: #17201b;
  color: #fff;
  font-weight: 700;
}

.primary-button.full {
  width: 100%;
}

.icon-button {
  width: 42px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.15rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.chart-panel,
.tool-panel,
.info-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.chart-panel {
  padding: 18px;
  min-width: 0;
}

.tool-panel,
.info-panel {
  padding: 18px;
}

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

.panel-header.compact {
  margin-bottom: 14px;
}

.signal-pill {
  min-width: 92px;
  padding: 8px 12px;
  text-align: center;
  background: #eef1ed;
  color: var(--muted);
  font-weight: 800;
}

.signal-pill.buy {
  background: #dff4e6;
  color: var(--green);
}

.signal-pill.sell {
  background: #f9e3e1;
  color: var(--red);
}

canvas {
  display: block;
  width: 100%;
  height: min(44vh, 420px);
  background: #fbfcfa;
  border: 1px solid var(--line);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  margin-top: 16px;
}

.metric-strip div {
  padding: 14px 10px 2px 0;
}

.metric-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 4px;
}

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

.control-form {
  display: grid;
  gap: 13px;
}

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

input,
select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  background: #fbfcfa;
  color: var(--ink);
  padding: 0 11px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--blue);
}

.response-box {
  min-height: 96px;
  margin: 16px 0 0;
  padding: 12px;
  white-space: pre-wrap;
  color: #29342d;
  background: #f7f8f6;
  border: 1px solid var(--line);
  overflow: auto;
}

.check-list,
.roadmap-list {
  display: grid;
  gap: 9px;
}

.check-list span,
.roadmap-list span {
  padding-left: 18px;
  position: relative;
  color: #344038;
  font-size: 0.92rem;
}

.check-list span::before,
.roadmap-list span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 7px;
  height: 7px;
  background: var(--gold);
}

@media (max-width: 980px) {
  .sidebar {
    position: static;
    width: auto;
    min-height: auto;
  }

  .shell {
    margin-left: 0;
    padding: 18px;
  }

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

@media (max-width: 640px) {
  .topbar,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions .primary-button {
    flex: 1;
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  h1 {
    font-size: 1.55rem;
  }
}
