:root {
  color-scheme: dark;
  --bg: #090a0c;
  --panel: #14171c;
  --panel-2: #191e25;
  --text: #f3f0e8;
  --muted: #9ea8b4;
  --line: #29313c;
  --gold: #d7aa54;
  --green: #7ccf79;
  --red: #e66b64;
  --blue: #74a7ff;
}

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

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

.topbar,
.section-heading,
.actions,
.budget-row {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.actions,
.section-heading {
  gap: 12px;
}

h1,
h2,
p {
  margin: 0;
}

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

h2 {
  font-size: 1.2rem;
  line-height: 1.25;
}

.eyebrow {
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.button {
  border: 1px solid #c99747;
  background: var(--gold);
  color: #17120a;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

.button.secondary {
  border-color: var(--line);
  background: #20262f;
  color: var(--text);
}

.button.full {
  width: 100%;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

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

.metric {
  min-height: 86px;
  padding: 16px;
}

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

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

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

.panel {
  padding: 18px;
}

.controls {
  display: grid;
  gap: 12px;
}

label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1217;
  color: var(--text);
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

input[type="file"] {
  padding: 9px 12px;
}

.field-note {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

textarea {
  min-height: 150px;
  padding: 12px;
  resize: vertical;
  line-height: 1.4;
}

.divider {
  border-top: 1px solid var(--line);
  margin: 2px 0;
}

.budget-row {
  gap: 10px;
}

.budget-row input {
  max-width: 112px;
}

.budget-row span {
  color: var(--muted);
}

.note {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
  line-height: 1.45;
}

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

.recommendations {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.rec {
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 14px;
}

.rec.high {
  border-left-color: var(--red);
}

.rec.medium {
  border-left-color: var(--gold);
}

.rec.watch {
  border-left-color: var(--green);
}

.rec-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.rec-title {
  font-weight: 900;
}

.pill {
  align-self: flex-start;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 0.76rem;
  font-weight: 800;
}

.rec p,
.rec li {
  color: var(--muted);
  line-height: 1.45;
}

.rec ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.mods {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mod {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 7px;
  color: #c8d0da;
  background: #10141a;
  font-size: 0.78rem;
}

.trade-link {
  display: inline-flex;
  margin-top: 12px;
  color: var(--gold);
  font-weight: 800;
  text-decoration: none;
}

.payload-panel {
  margin-top: 12px;
}

.legal {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.78rem;
}

.payload-panel .section-heading {
  justify-content: space-between;
  margin-bottom: 12px;
}

pre {
  margin: 0;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080a0e;
  padding: 14px;
  color: #d3dee9;
  font-size: 0.82rem;
}

@media (max-width: 820px) {
  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    width: 100%;
  }

  .actions .button {
    flex: 1;
  }

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