:root {
  color-scheme: light;
  --bg: #f5f3ee;
  --panel: #fffdf8;
  --panel-strong: #f0eee6;
  --ink: #24211c;
  --muted: #69635a;
  --line: #d9d3c7;
  --accent: #23615f;
  --accent-strong: #174543;
  --amber: #a15c18;
  --red: #9a3b32;
  --blue: #395f92;
  --shadow: 0 18px 48px rgba(31, 25, 16, 0.12);
  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;
  background:
    linear-gradient(120deg, rgba(35, 97, 95, 0.08), transparent 42%),
    var(--bg);
  color: var(--ink);
}

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

.shell {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  min-height: 100vh;
}

.control-panel {
  border-right: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.84);
  padding: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.brand-block {
  margin-bottom: 28px;
}

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

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.1rem, 7vw, 3rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.source-note {
  margin: 0;
  max-width: 32rem;
  color: var(--muted);
  line-height: 1.45;
}

.run-form {
  display: grid;
  gap: 18px;
}

.panel-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.panel-section h2 {
  margin: 0 0 2px;
  font-size: 0.96rem;
}

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

.field-group {
  display: grid;
  gap: 8px;
}

.field-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

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

.inline-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.inline-note.warn {
  color: var(--amber);
}

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

textarea {
  resize: vertical;
  min-height: 84px;
}

select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(35, 97, 95, 0.22);
  outline-offset: 2px;
}

.workspace {
  padding: 30px;
  min-width: 0;
}

.toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.toolbar h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2.15rem);
  line-height: 1.08;
  letter-spacing: 0;
}

button {
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  min-height: 40px;
  padding: 0 14px;
}

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

.status-strip,
.next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.pill.warn {
  border-color: rgba(161, 92, 24, 0.45);
  background: rgba(161, 92, 24, 0.08);
  color: var(--amber);
}

.prediction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}

.prediction-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
}

.prediction-card.featured {
  border-color: rgba(35, 97, 95, 0.42);
}

.prediction-card.warning {
  border-color: rgba(161, 92, 24, 0.38);
}

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

.card-head h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.2;
}

.confidence {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.bar-list {
  display: grid;
  gap: 9px;
}

.bar-row {
  display: grid;
  gap: 5px;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.bar-label {
  overflow-wrap: anywhere;
  color: var(--ink);
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-strong);
}

.bar-fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--accent);
}

.bar-fill.hot {
  background: var(--red);
}

.bar-fill.cool {
  background: var(--blue);
}

.card-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.42;
}

.source-link {
  display: inline-flex;
  margin-top: 12px;
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
}

.source-link:hover {
  text-decoration: underline;
}

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

  .control-panel {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    padding: 22px;
  }

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