:root {
  --bg: #f4efe6;
  --panel: #fbf7f0;
  --ink: #181715;
  --muted: #6e665c;
  --line: rgba(24, 23, 21, 0.12);
  --accent: #b5522a;
  --accent-soft: rgba(181, 82, 42, 0.12);
  --good: #1f6b46;
  --good-soft: rgba(31, 107, 70, 0.12);
  --warn: #8b3f24;
  --warn-soft: rgba(139, 63, 36, 0.14);
  --shadow: 0 20px 60px rgba(48, 35, 22, 0.08);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(181, 82, 42, 0.14), transparent 26%),
    linear-gradient(180deg, #f8f3eb 0%, var(--bg) 48%, #efe7da 100%);
}

button,
input {
  font: inherit;
}

.shell {
  min-height: 100vh;
  padding: 28px;
}

.topbar {
  display: grid;
  gap: 24px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
}

.brandblock h1,
.sectionhead h2,
.hero-status h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.brandblock h1 {
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 0.96;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.subcopy {
  margin: 10px 0 0;
  max-width: 34rem;
  color: var(--muted);
}

.pillstrip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(251, 247, 240, 0.85);
  backdrop-filter: blur(10px);
}

.pill strong {
  font-size: 0.82rem;
}

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

.workspace {
  display: grid;
  grid-template-columns: 18rem minmax(0, 1fr) 22rem;
  gap: 22px;
  margin-top: 26px;
}

.programbar {
  display: grid;
  gap: 18px;
  align-items: end;
  margin-top: 18px;
  padding: 18px 0 6px;
  border-bottom: 1px solid var(--line);
}

.programsummary h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.7rem;
}

.leftrail,
.centerpanel,
.rightrail,
.historypanel {
  background: rgba(251, 247, 240, 0.9);
  border: 1px solid rgba(24, 23, 21, 0.09);
  box-shadow: var(--shadow);
}

.leftrail,
.rightrail,
.historypanel {
  padding: 22px;
}

.centerpanel {
  overflow: hidden;
}

.sectionhead {
  margin-bottom: 18px;
}

.sectionhead.compact {
  margin-top: 28px;
}

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

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

.conditionbutton {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  text-align: left;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
}

.conditionbutton.selected {
  border-color: rgba(181, 82, 42, 0.45);
  background: linear-gradient(180deg, rgba(181, 82, 42, 0.16), rgba(181, 82, 42, 0.07));
}

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

.conditionbutton span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.actionbutton {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 14px 16px;
  text-align: left;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(181, 82, 42, 0.16), rgba(181, 82, 42, 0.08));
  transition: transform 160ms ease, background 160ms ease;
  cursor: pointer;
}

.actionbutton.secondary {
  background: linear-gradient(180deg, rgba(24, 23, 21, 0.08), rgba(24, 23, 21, 0.04));
}

.actionbutton.warn {
  background: linear-gradient(180deg, rgba(139, 63, 36, 0.2), rgba(139, 63, 36, 0.1));
}

.actionbutton:hover {
  transform: translateY(-1px);
}

.actionbutton:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

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

.actionbutton span {
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 4px;
}

.parameters {
  display: grid;
  gap: 14px;
}

.parameter {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.parameter:first-child {
  padding-top: 0;
  border-top: 0;
}

.parameterlabel {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.95rem;
}

.parameter input {
  width: 100%;
  margin-top: 8px;
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.applytag {
  color: var(--muted);
  font-size: 0.75rem;
}

.hero-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15rem;
  gap: 20px;
  padding: 30px;
  background:
    linear-gradient(135deg, rgba(24, 23, 21, 0.96), rgba(59, 45, 33, 0.94)),
    linear-gradient(180deg, rgba(181, 82, 42, 0.28), transparent);
  color: #f7efe4;
}

.hero-status .subcopy {
  color: rgba(247, 239, 228, 0.72);
}

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

.metric {
  padding: 12px 14px;
  border: 1px solid rgba(247, 239, 228, 0.12);
  border-radius: 18px;
  background: rgba(247, 239, 228, 0.06);
}

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

.metric span {
  color: rgba(247, 239, 228, 0.68);
  font-size: 0.78rem;
}

.guidanceband {
  padding: 18px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(181, 82, 42, 0.08);
}

.guidanceband p:last-child {
  margin: 0;
  max-width: 56rem;
}

.marketcontext {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 24px 30px 30px;
}

.strategypanel {
  padding: 24px 30px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(251, 247, 240, 0.9), rgba(245, 238, 227, 0.8));
}

.selectorpanel {
  padding: 24px 30px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(247, 240, 230, 0.95), rgba(251, 247, 240, 0.92));
}

.strategygrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.rulelist {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
}

.rulelist li {
  margin-bottom: 8px;
}

.strategyfacts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.strategyfacts.compact {
  margin-top: 14px;
}

.fallbackbox {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
}

.fallbackbox strong {
  display: block;
}

.fallbackbox p {
  margin: 8px 0 0;
  color: var(--muted);
}

.contextitem {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

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

.contextitem span {
  color: var(--muted);
  margin-top: 6px;
}

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

.stageitem {
  padding: 10px 0 10px 14px;
  border-left: 3px solid var(--line);
}

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

.stageitem span {
  color: var(--muted);
  margin-top: 4px;
  font-size: 0.9rem;
}

.feeditem {
  border-left: 3px solid var(--line);
  padding: 10px 0 10px 14px;
}

.feeditem.good {
  border-color: var(--good);
}

.feeditem.warning {
  border-color: var(--warn);
}

.feeditem.info {
  border-color: var(--accent);
}

.tablewrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.92rem;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

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

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

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

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

@media (max-width: 720px) {
  .shell {
    padding: 16px;
  }

  .topbar {
    padding-bottom: 18px;
  }

  .leftrail,
  .rightrail,
  .historypanel {
    padding: 18px;
  }

  .hero-status,
  .guidanceband,
  .marketcontext {
    padding-left: 18px;
    padding-right: 18px;
  }
}
