:root {
  --bg: #f4f1eb;
  --surface: #ffffff;
  --surface-2: #ece7dc;
  --ink: #241f1b;
  --muted: #736b60;
  --line: #ddd5c9;
  --green: #236453;
  --blue: #255f99;
  --gold: #aa6a2a;
  --red: #a43f3f;
  --violet: #6f4aa0;
  --copper: #aa6628;
  --paper: #fbfaf7;
  --shadow: 0 18px 50px rgba(36, 31, 27, 0.08);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  background:
    radial-gradient(circle at 82% 4%, rgba(170, 102, 40, 0.08), transparent 28rem),
    linear-gradient(180deg, #f8f6f1 0, var(--bg) 370px);
}

.sidebar {
  background: #201d19;
  color: #eef7f2;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e8dbc9;
  color: #4e2d16;
  font-weight: 800;
}

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

.brand span {
  color: #c5b9a8;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #ebe2d5;
  text-align: left;
  padding: 12px 13px;
  border-radius: 8px;
}

.nav-item.active,
.nav-item:hover {
  background: #342d25;
  border-color: #5d4b39;
}

.sidebar-note {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c8bdac;
  font-size: 13px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #d79a58;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto 28px;
  max-width: 1360px;
  padding: 18px 0 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #8d8376;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  max-width: 860px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 54px;
  font-weight: 700;
  line-height: 1.15;
}

h2 {
  margin-bottom: 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

h3 {
  margin-bottom: 12px;
  font-size: 15px;
}

.hero-copy {
  max-width: 920px;
  margin: 10px 0 0;
  color: #5f574e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-style: italic;
  line-height: 1.45;
}

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

.primary-button,
.ghost-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 14px;
  font-weight: 700;
}

.primary-button {
  border-color: var(--copper);
  background: var(--copper);
  color: white;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
}

.demo-badge {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #dacbb8;
  border-radius: 999px;
  background: #fff8ec;
  color: #8a5425;
  padding: 0 13px;
  font-size: 12px;
  font-weight: 850;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  align-items: start;
  gap: 18px;
  max-width: 1360px;
  margin: 0 auto;
}

.intake-panel,
.results-panel,
.queue-panel,
.rules-intro {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.scenario-band {
  max-width: 1360px;
  margin: 0 auto 28px;
  padding: 22px 0 26px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.scenario-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 0 48px 12px;
}

.scenario-heading span {
  color: #9b9184;
  font-size: 13px;
}

.scenario-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding: 0 48px 6px;
  scrollbar-color: #9f9891 transparent;
}

.scenario-card {
  min-height: 138px;
  border: 1px solid #ded6ca;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  text-align: left;
  padding: 16px;
  box-shadow: 0 8px 22px rgba(36, 31, 27, 0.05);
}

.scenario-card:hover {
  border-color: #ba8651;
  transform: translateY(-1px);
}

.scenario-card span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8b8176;
  font-size: 13px;
  font-weight: 700;
}

.scenario-card strong {
  border-radius: 6px;
  background: #f0dac4;
  color: #9a5824;
  padding: 3px 7px;
}

.scenario-card h3 {
  margin: 10px 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.scenario-card p {
  margin: 0;
  color: #756d64;
  font-size: 14px;
  line-height: 1.55;
}

.intake-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--paper);
}

.section-heading {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.section-heading p,
.rules-intro p {
  margin-bottom: 0;
  color: var(--muted);
}

.step-badge {
  flex: 0 0 auto;
  min-width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #efe0cf;
  color: #995a25;
  font-size: 12px;
  font-weight: 900;
  padding: 0 8px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field-grid.compact {
  margin-top: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 7px;
  color: #34413c;
  font-size: 13px;
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d8d0c4;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 11px;
}

input:focus,
select:focus {
  outline: 3px solid rgba(170, 102, 40, 0.17);
  border-color: var(--copper);
}

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

.check-card {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px;
}

.check-card input {
  width: 17px;
  min-height: 17px;
}

.hidden {
  display: none;
}

.results-panel {
  position: sticky;
  top: 20px;
  padding: 18px;
}

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

.case-status {
  border-radius: 999px;
  background: #efe0cf;
  color: #6e3d18;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.result-block {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}

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

.risk-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}

.risk-track {
  height: 8px;
  border-radius: 999px;
  background: #e8e1d7;
  overflow: hidden;
}

.risk-fill {
  height: 100%;
  border-radius: inherit;
}

.risk-meta {
  display: grid;
  gap: 5px;
}

.risk-meta span:first-child {
  font-weight: 800;
  font-size: 13px;
}

.risk-badge,
.pill {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.risk-low {
  background: #e5f3e9;
  color: #18603d;
}

.risk-medium {
  background: #fff2d5;
  color: #7d5207;
}

.risk-high {
  background: #f9dedb;
  color: #8f312d;
}

.risk-critical {
  background: #eadff4;
  color: #5f3187;
}

.pill-list,
.artifact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill,
.artifact {
  background: #f2ece2;
  color: #493f35;
  border: 1px solid #e0d6c8;
}

.artifact {
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 750;
}

.rationale-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-layout,
.rules-layout {
  display: grid;
  gap: 18px;
}

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

.metric {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.metric strong {
  display: block;
  font-size: 26px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.queue-panel,
.rules-intro {
  padding: 18px;
}

.case-table {
  display: grid;
  gap: 10px;
}

.case-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) repeat(3, minmax(120px, 0.7fr)) minmax(180px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.case-row strong,
.case-row span {
  display: block;
}

.case-row span {
  color: var(--muted);
  font-size: 12px;
}

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

.rule-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.rule-card h3 {
  margin-bottom: 8px;
}

.rule-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.empty-state {
  display: grid;
  gap: 5px;
  color: var(--muted);
  border: 1px dashed #b7c3bd;
  border-radius: 8px;
  padding: 18px;
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
}

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

  .results-panel {
    position: static;
  }

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

  h1 {
    font-size: 42px;
  }
}

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

  .sidebar {
    position: static;
    padding: 16px;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-item {
    text-align: center;
    padding: 10px 8px;
  }

  .sidebar-note {
    display: none;
  }

  .main {
    padding: 16px;
  }

  .scenario-heading,
  .scenario-rail {
    padding-left: 0;
    padding-right: 0;
  }

  .scenario-heading {
    display: grid;
  }

  .topbar,
  .panel-header {
    display: grid;
  }

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

  .top-actions button {
    flex: 1 1 120px;
  }

  .field-grid,
  .field-grid.compact,
  .option-grid,
  .metric-strip,
  .rules-grid {
    grid-template-columns: 1fr;
  }

  .case-row {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 34px;
  }

  .hero-copy {
    font-size: 18px;
  }
}
}
