:root {
  --page: #f6f3ee;
  --page-2: #ece7df;
  --panel: #fffefa;
  --panel-soft: #f7f3ea;
  --ink: #211f1c;
  --muted: #746f66;
  --muted-2: #9b9488;
  --line: #dfd7cb;
  --line-strong: #c7bcae;
  --charcoal: #191c1b;
  --charcoal-2: #2b302e;
  --rail: #234650;
  --rail-deep: #17323b;
  --rail-ink: #f7f3ea;
  --emerald: #124338;
  --emerald-2: #1d6555;
  --sage: #dfe9e2;
  --brass: #a9782b;
  --brass-soft: #f4e7cf;
  --claret: #8b3431;
  --claret-soft: #f2ddda;
  --lavender: #ebe7f2;
  --radius: 8px;
  --shadow: 0 22px 58px rgba(35, 31, 26, 0.12), 0 3px 10px rgba(35, 31, 26, 0.06);
  --shadow-soft: 0 12px 28px rgba(35, 31, 26, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(33, 31, 28, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(169, 120, 43, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, var(--page) 0%, #faf8f3 50%, var(--page-2) 100%);
  background-size: 56px 56px, 56px 56px, auto;
  color: var(--ink);
  font-family: Aptos, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

button:hover {
  border-color: var(--emerald);
  transform: translateY(-1px);
}

button:disabled,
button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.primary {
  border-color: var(--charcoal);
  background: var(--charcoal);
  color: #fff;
  box-shadow: 0 10px 24px rgba(25, 28, 27, 0.18);
}

.primary:hover {
  background: var(--emerald);
  border-color: var(--emerald);
}

.secondary {
  background: var(--panel-soft);
}

.app {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  grid-template-rows: 82px minmax(0, 1fr);
  min-height: 100vh;
}

.side-rail {
  position: sticky;
  top: 0;
  z-index: 30;
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 22px 18px;
  border-right: 1px solid rgba(255, 254, 250, 0.14);
  background:
    linear-gradient(180deg, #2a5660 0%, var(--rail) 48%, var(--rail-deep) 100%);
  color: var(--rail-ink);
}

.brand-block {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 254, 250, 0.13);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 254, 250, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.12);
  color: var(--rail-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
}

.brand-block strong,
.brand-block span,
.rail-footer strong,
.rail-footer span {
  display: block;
}

.brand-block strong {
  font-family: "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1.1;
}

.brand-block span,
.rail-footer span {
  margin-top: 4px;
  color: rgba(247, 243, 234, 0.62);
  font-size: 12px;
}

.surface-tabs {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.surface-tabs button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 48px;
  border-color: transparent;
  background: transparent;
  color: rgba(247, 243, 234, 0.74);
  text-align: left;
}

.surface-tabs button:hover {
  background: rgba(255, 254, 250, 0.08);
  color: #fffefa;
  transform: none;
}

.surface-tabs button.active {
  border-color: rgba(255, 254, 250, 0.22);
  background: rgba(255, 254, 250, 0.13);
  color: #fffefa;
  box-shadow: inset 3px 0 0 var(--brass-soft), 0 10px 22px rgba(12, 23, 25, 0.16);
}

.surface-tabs span {
  color: var(--brass-soft);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.surface-tabs strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.rail-body {
  display: grid;
  gap: 12px;
  margin: 20px 0 18px;
}

.rail-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(255, 254, 250, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.075);
  box-shadow: inset 0 1px 0 rgba(255, 254, 250, 0.08);
}

.rail-card span,
.rail-card p,
.rail-card small,
.rail-card em {
  color: rgba(247, 243, 234, 0.68);
}

.rail-card > span,
.rail-card-head > span {
  display: block;
  margin-bottom: 5px;
  color: rgba(247, 243, 234, 0.58);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rail-card strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #fffefa;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.2;
}

.rail-card p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.38;
}

.rail-project {
  background:
    linear-gradient(135deg, rgba(244, 231, 207, 0.14), rgba(255, 254, 250, 0.06));
}

.rail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 11px;
}

.rail-meta small {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgba(255, 254, 250, 0.13);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.07);
  text-align: center;
  font-size: 11px;
}

.rail-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: end;
}

.rail-card-head strong {
  text-align: right;
  font-size: 13px;
}

.rail-progress-line {
  height: 7px;
  margin: 10px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(10, 25, 27, 0.28);
}

.rail-progress-line b {
  display: block;
  width: var(--rail-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brass-soft), #cfaa68);
}

.rail-dept-list {
  display: grid;
  gap: 7px;
  margin-top: 11px;
}

.rail-dept-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 45px;
  padding: 8px;
  border-color: rgba(255, 254, 250, 0.12);
  background: rgba(10, 25, 27, 0.12);
  color: var(--rail-ink);
  text-align: left;
  box-shadow: none;
}

.rail-dept-row:hover {
  border-color: rgba(255, 254, 250, 0.26);
  background: rgba(255, 254, 250, 0.1);
  transform: none;
}

.rail-dept-row.active {
  border-color: rgba(244, 231, 207, 0.42);
  background: rgba(244, 231, 207, 0.15);
  box-shadow: inset 3px 0 0 var(--brass-soft);
}

.rail-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(247, 243, 234, 0.34);
}

.rail-dept-row.good .rail-dot {
  background: #b8dcc8;
}

.rail-dept-row.bad .rail-dot {
  background: #e0a19b;
}

.rail-dept-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.rail-dept-copy strong {
  font-size: 12px;
}

.rail-dept-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.rail-dept-row em {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 254, 250, 0.14);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.07);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.rail-next {
  border-color: rgba(244, 231, 207, 0.22);
}

.rail-next.good {
  border-color: rgba(184, 220, 200, 0.34);
  background: rgba(184, 220, 200, 0.11);
}

.rail-next.warn {
  border-color: rgba(244, 231, 207, 0.36);
  background: rgba(244, 231, 207, 0.12);
}

.rail-next.bad {
  border-color: rgba(224, 161, 155, 0.4);
  background: rgba(139, 52, 49, 0.12);
}

.rail-next button {
  width: 100%;
  min-height: 36px;
  margin-top: 10px;
  border-color: rgba(244, 231, 207, 0.48);
  background: rgba(255, 254, 250, 0.92);
  color: var(--rail-deep);
  font-weight: 900;
  box-shadow: none;
}

.rail-next button:hover {
  border-color: var(--brass-soft);
  background: #fffefa;
  transform: none;
}

.rail-footer {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 254, 250, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.08);
}

.rail-footer strong {
  margin-top: 3px;
  color: #fffefa;
  font-size: 14px;
}

.rail-footer p {
  margin: 10px 0 0;
  color: rgba(247, 243, 234, 0.68);
  font-size: 12px;
  line-height: 1.4;
}

.rail-mini-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.rail-mini-stats small {
  padding: 4px 7px;
  border: 1px solid rgba(255, 254, 250, 0.16);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.08);
  color: rgba(247, 243, 234, 0.78);
  font-size: 11px;
}

.context-bar {
  position: sticky;
  top: 0;
  z-index: 25;
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 14px 32px;
  border-bottom: 1px solid rgba(223, 215, 203, 0.86);
  background: rgba(250, 248, 243, 0.88);
  backdrop-filter: blur(18px);
}

.context-kicker,
.eyebrow {
  display: block;
  margin: 0 0 6px;
  color: var(--brass);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.context-bar h2 {
  margin: 0;
  color: var(--charcoal);
  font-family: "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: 24px;
  line-height: 1.05;
}

.context-bar p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.context-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 8px;
}

.context-metrics div,
.setup-dossier,
.entry-dossier {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.92);
  box-shadow: var(--shadow-soft);
}

.context-metrics div {
  padding: 9px 11px;
}

.context-metrics span {
  display: block;
  color: var(--charcoal);
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
}

.context-metrics small {
  color: var(--muted);
  font-size: 11px;
}

.context-metrics .attention span {
  color: var(--claret);
}

.shell-main {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
}

.page {
  width: min(1380px, calc(100% - 58px));
  margin: 0 auto;
  padding: 30px 0 48px;
}

.setup-hero,
.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  gap: 22px;
  align-items: end;
  margin-bottom: 20px;
}

.setup-hero,
.form-card,
.preview-card,
.panel,
.setup-panel {
  border: 1px solid rgba(223, 215, 203, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.94);
  box-shadow: var(--shadow);
}

.setup-hero {
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(255, 254, 250, 0.96) 0%, rgba(247, 243, 234, 0.96) 100%);
}

.setup-hero h1,
.page-head h1 {
  max-width: 820px;
  margin: 0;
  color: var(--charcoal);
  font-family: "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: 39px;
  font-weight: 700;
  line-height: 1.05;
}

.setup-hero p,
.page-head p {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.58;
}

.setup-dossier,
.entry-dossier {
  padding: 15px;
}

.dossier-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.dossier-title small,
.entry-dossier span,
.signal-grid span {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dossier-title strong {
  color: var(--emerald);
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.signal-grid div,
.entry-dossier div,
.entry-dossier button {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.signal-grid strong,
.entry-dossier strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--charcoal);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.entry-dossier button {
  min-height: auto;
  text-align: left;
  box-shadow: none;
}

.entry-dossier button:hover {
  transform: translateY(-1px);
}

.entry-dossier button small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.entry-dossier button.bad {
  border-color: rgba(139, 52, 49, 0.28);
  background: var(--claret-soft);
}

.entry-dossier button.good {
  border-color: rgba(29, 101, 85, 0.24);
  background: var(--sage);
}

.entry-dossier {
  display: grid;
  gap: 8px;
}

.setup-board {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.setup-board.company-only {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.setup-panel {
  display: flex;
  flex-direction: column;
  padding: 21px;
}

.profile-panel {
  grid-column: span 6;
}

.org-panel {
  grid-column: span 6;
}

.department-workplan-panel {
  grid-column: 1 / -1;
}

.digital-panel,
.risk-panel {
  grid-column: span 6;
}

.panel-heading {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  margin-bottom: 17px;
}

.panel-heading > span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(169, 120, 43, 0.26);
  border-radius: var(--radius);
  background: var(--brass-soft);
  color: var(--brass);
  font-size: 12px;
  font-weight: 900;
}

.panel-heading h2 {
  margin: 0;
  color: var(--charcoal);
  font-family: "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: 21px;
}

.panel-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.field {
  position: relative;
  display: grid;
  gap: 7px;
}

.field.wide {
  grid-column: 1 / -1;
}

.field.disabled {
  opacity: 0.54;
}

.field span {
  color: var(--charcoal);
  font-size: 13px;
  font-weight: 900;
}

.field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
}

.field input,
.field textarea,
.field select,
.inline-add input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fffefa;
  color: var(--ink);
  padding: 11px 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.field textarea {
  min-height: 118px;
  resize: vertical;
  line-height: 1.48;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.inline-add input:focus {
  outline: 3px solid rgba(29, 101, 85, 0.14);
  border-color: var(--emerald-2);
}

.field-pulse {
  animation: fieldPulse 1200ms ease;
}

@keyframes fieldPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(169, 120, 43, 0.38);
  }
  45% {
    box-shadow: 0 0 0 6px rgba(169, 120, 43, 0.16);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(169, 120, 43, 0);
  }
}

.combo-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
}

.combo-control input {
  border-radius: var(--radius) 0 0 var(--radius);
}

.combo-control button {
  min-height: 44px;
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--charcoal);
  color: #fff;
  font-size: 17px;
}

.picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 40;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fffefa;
  box-shadow: 0 22px 54px rgba(35, 31, 26, 0.2);
}

.picker-title,
.picker-foot {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  background: var(--panel-soft);
}

.picker-title {
  color: var(--charcoal);
  font-weight: 900;
}

.picker-options {
  display: grid;
  max-height: 270px;
  overflow: auto;
  padding: 7px;
}

.picker-options button {
  min-height: 36px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
}

.picker-options button:hover {
  background: var(--sage);
}

.subject-guide {
  padding: 16px;
  border: 1px solid rgba(29, 101, 85, 0.28);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(223, 233, 226, 0.64), rgba(255, 254, 250, 0.92));
  box-shadow: inset 4px 0 0 var(--emerald), var(--shadow-soft);
}

.subject-question {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  padding-left: 4px;
}

.subject-question span {
  color: var(--charcoal);
  font-size: 17px;
  font-weight: 900;
}

.subject-question p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.subject-current {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid rgba(18, 67, 56, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.9);
}

.subject-current small {
  display: block;
  margin-bottom: 3px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.subject-current strong {
  color: var(--charcoal);
  font-size: 15px;
}

.subject-current.empty strong {
  color: var(--muted);
  font-weight: 700;
}

.subject-current button {
  background: var(--emerald);
  color: #fff;
  border-color: var(--emerald);
}

.recommendation-strip,
.chip-list,
.setup-suggestions,
.suggestion-chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.recommendation-strip {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.72);
}

.recommendation-strip button,
.setup-suggestions button,
.suggestion-chips button,
.picker-group button {
  min-height: 30px;
  border-color: var(--line);
  border-radius: 999px;
  background: #fffefa;
  color: var(--charcoal);
  font-size: 12px;
  font-weight: 750;
}

.recommendation-strip button:last-child {
  background: var(--brass-soft);
  color: var(--brass);
}

.subject-picker {
  top: calc(100% + 8px);
}

.picker-group {
  display: grid;
  gap: 7px;
  padding: 11px;
  border-bottom: 1px solid var(--line);
}

.picker-group strong {
  color: var(--charcoal);
  font-size: 13px;
}

.picker-group p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.picker-group button {
  justify-self: start;
  background: var(--panel-soft);
}

.chip-list {
  margin: 14px 0;
}

.chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 5px 8px 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--charcoal);
  font-size: 13px;
  font-weight: 760;
}

.chip button {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 50%;
  line-height: 1;
}

.inline-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.setup-suggestions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.department-guidance {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(29, 101, 85, 0.18);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(223, 233, 226, 0.7), rgba(255, 254, 250, 0.86));
}

.department-guidance strong {
  color: var(--emerald);
  font-size: 15px;
}

.department-guidance p,
.department-guidance ul {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.department-guidance ul {
  padding-left: 18px;
}

.suggested-departments {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid rgba(29, 101, 85, 0.14);
}

.suggested-departments span {
  width: 100%;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.suggested-departments button {
  min-height: 30px;
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.72);
  font-size: 12px;
  font-weight: 750;
}

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

.department-card {
  display: grid;
  gap: 12px;
  min-height: 156px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.department-card.good {
  border-color: rgba(29, 101, 85, 0.25);
  background: rgba(223, 233, 226, 0.56);
}

.department-card.bad {
  border-color: rgba(139, 52, 49, 0.28);
  background: var(--claret-soft);
}

.department-card span {
  display: block;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.department-card strong {
  display: block;
  margin-top: 4px;
  color: var(--charcoal);
  font-size: 15px;
}

.department-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.department-card-metrics {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.department-card-metrics small {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.72);
  color: var(--muted);
  font-size: 11px;
}

.setup-suggestions button,
.suggestion-chips button {
  max-width: 280px;
  padding: 5px 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.setup-suggestions button:hover,
.suggestion-chips button:hover,
.recommendation-strip button:hover {
  background: var(--sage);
  color: var(--emerald);
}

.suggestion-chips {
  max-height: 112px;
  overflow: auto;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.department-focus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 13px;
  align-items: stretch;
  margin: 0 0 14px;
  padding: 13px;
  border: 1px solid rgba(29, 101, 85, 0.24);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(223, 233, 226, 0.72), rgba(255, 254, 250, 0.94));
  box-shadow: inset 4px 0 0 var(--emerald), var(--shadow-soft);
}

.department-focus-main {
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 3px 4px;
}

.department-focus-main span,
.drawer-copy span {
  color: var(--emerald);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.department-focus-main strong {
  overflow: hidden;
  margin-top: 3px;
  color: var(--charcoal);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: 24px;
  line-height: 1.05;
}

.department-focus-main p,
.drawer-copy p {
  max-width: 760px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.department-focus-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 8px;
  min-width: 280px;
}

.department-focus-stats div {
  display: grid;
  align-content: center;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid rgba(29, 101, 85, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.74);
}

.department-focus-stats strong,
.department-focus-stats small {
  display: block;
}

.department-focus-stats strong {
  color: var(--charcoal);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.department-focus-stats small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.department-focus-stats .bad strong {
  color: var(--claret);
}

.department-focus-stats .good strong {
  color: var(--emerald);
}

.department-switch-button {
  align-self: stretch;
  min-width: 158px;
  border-color: var(--emerald);
  background: var(--emerald);
  color: #fffefa;
  font-weight: 900;
  box-shadow: none;
}

.department-switch-button:hover {
  border-color: var(--emerald-2);
  background: var(--emerald-2);
}

.department-switch-drawer {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin: -3px 0 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.9);
  box-shadow: var(--shadow-soft);
}

.drawer-copy {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.drawer-copy strong {
  display: block;
  margin-top: 5px;
  color: var(--charcoal);
  font-size: 14px;
}

.department-strip.compact {
  align-content: start;
}

.department-strip.compact button {
  min-height: 68px;
}

.department-picker {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin: 0 0 18px;
  padding: 16px;
  border: 2px solid rgba(169, 120, 43, 0.42);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(244, 231, 207, 0.96), rgba(255, 254, 250, 0.86));
  box-shadow: inset 5px 0 0 var(--brass), 0 20px 42px rgba(92, 64, 24, 0.12);
}

.picker-copy {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 15px;
  border: 1px solid rgba(169, 120, 43, 0.3);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.72);
  box-shadow: none;
}

.picker-copy > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--brass);
  color: #fffefa;
  font-size: 12px;
  font-weight: 900;
}

.picker-copy small {
  display: block;
  margin-bottom: 5px;
  color: var(--brass);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.picker-copy strong {
  color: var(--charcoal);
  font-size: 15px;
}

.picker-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.38;
}

.department-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.department-strip button {
  display: grid;
  gap: 5px;
  min-height: 72px;
  padding: 12px;
  border-color: rgba(169, 120, 43, 0.22);
  background: rgba(255, 254, 250, 0.86);
  text-align: left;
  box-shadow: none;
}

.department-strip button.active {
  border-color: rgba(29, 101, 85, 0.46);
  background: var(--sage);
  box-shadow: inset 0 0 0 2px rgba(29, 101, 85, 0.18), inset 4px 0 0 var(--emerald), 0 14px 26px rgba(29, 101, 85, 0.12);
}

.department-strip button.bad {
  border-color: rgba(139, 52, 49, 0.3);
}

.department-strip button.active small {
  color: var(--emerald);
}

.department-strip small,
.department-strip strong,
.department-strip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.department-strip small {
  color: var(--brass);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.department-strip strong {
  color: var(--charcoal);
  font-size: 14px;
}

.department-strip button.active strong {
  color: var(--emerald);
}

.department-strip span {
  color: var(--muted);
  font-size: 11px;
}

.step-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 15px;
}

.step-tabs button {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 72px;
  background: rgba(255, 254, 250, 0.92);
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.step-tabs button.active {
  border-color: var(--charcoal);
  background: #fffefa;
  box-shadow: inset 0 -3px 0 var(--brass), var(--shadow-soft);
}

.step-tabs button.done span {
  background: var(--emerald);
}

.step-tabs button.warn span,
.step-tabs button.missing span {
  background: var(--brass);
}

.step-tabs span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--charcoal);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.step-tabs strong,
.step-tabs small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-tabs small {
  color: var(--muted);
}

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

.form-card {
  min-height: 570px;
  padding: 24px;
}

.card-head,
.preview-head,
.row-table-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.card-head {
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 19px;
}

.step-count {
  color: var(--brass);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-head h2,
.panel h2,
.preview-head h3 {
  margin: 4px 0 6px;
  color: var(--charcoal);
  font-family: "Iowan Old Style", Georgia, "Times New Roman", serif;
}

.card-head h2 {
  font-size: 28px;
}

.card-head p {
  margin: 0;
  color: var(--muted);
}

.sample-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.plain-note,
.dependency-note {
  margin-top: 16px;
  padding: 13px 14px;
  border-left: 4px solid var(--emerald);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--sage);
  color: #21433b;
  line-height: 1.45;
}

.dependency-note.special {
  border-left-color: var(--brass);
  background: var(--brass-soft);
  color: #674818;
}

.dependency-note strong {
  display: block;
  margin-bottom: 4px;
}

.dependency-note p {
  margin: 0;
}

.row-table {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.row-table-head strong {
  padding-top: 8px;
}

.row-pill {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 46px;
  text-align: left;
}

.row-pill.active {
  border-color: var(--emerald);
  background: var(--sage);
}

.row-pill span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--charcoal);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.row-pill strong,
.row-pill small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-pill small {
  color: var(--muted);
}

.locked-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.locked-fields div {
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.locked-fields span,
.locked-fields strong,
.locked-fields small {
  display: block;
}

.locked-fields span {
  color: var(--brass);
  font-size: 12px;
  font-weight: 900;
}

.locked-fields small {
  margin-top: 4px;
  color: var(--muted);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.preview-card {
  position: sticky;
  top: 104px;
  max-height: calc(100vh - 126px);
  overflow: auto;
  padding: 17px;
}

.preview-head {
  align-items: center;
  margin-bottom: 12px;
}

.preview-head h3 {
  margin: 0;
  font-size: 21px;
}

.status-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.status-badge.good {
  background: var(--sage);
  color: var(--emerald);
}

.status-badge.warn {
  background: var(--brass-soft);
  color: var(--brass);
}

.status-badge.bad {
  background: var(--claret-soft);
  color: var(--claret);
}

.inventory-ledger {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(247, 243, 234, 0.62);
}

.ledger-head strong,
.ledger-head small {
  display: block;
}

.ledger-head strong {
  color: var(--charcoal);
}

.ledger-head small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.ledger-list {
  display: grid;
  gap: 7px;
  max-height: 230px;
  overflow: auto;
}

.ledger-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 58px;
  padding: 9px;
  text-align: left;
}

.ledger-row.active {
  border-color: var(--emerald);
  background: var(--sage);
}

.ledger-row > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--charcoal);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.ledger-row strong,
.ledger-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-row strong {
  color: var(--charcoal);
  font-size: 13px;
}

.ledger-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.ledger-row em {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.ledger-row em.good {
  background: var(--sage);
  color: var(--emerald);
}

.ledger-row em.warn {
  background: var(--brass-soft);
  color: var(--brass);
}

.ledger-row em.bad {
  background: var(--claret-soft);
  color: var(--claret);
}

.ledger-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.38;
}

.checks {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  max-height: 430px;
  overflow: auto;
  padding-right: 3px;
}

.checks-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 0;
  background: rgba(255, 254, 250, 0.96);
}

.checks-head strong,
.checks-head small {
  display: block;
}

.checks-head strong {
  color: var(--charcoal);
  font-size: 13px;
}

.checks-head small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.check {
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: var(--panel-soft);
  text-align: left;
  transform: none;
}

.check:hover {
  border-color: var(--emerald);
  transform: translateY(-1px);
}

.check.good {
  border-left-color: var(--emerald);
  background: var(--sage);
}

.check.warn {
  border-left-color: var(--brass);
  background: var(--brass-soft);
}

.check.bad {
  border-left-color: var(--claret);
  background: var(--claret-soft);
}

.check strong {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.check p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
}

.check small {
  display: inline-flex;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

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

.department-inventory-table {
  margin-top: 18px;
}

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

.table-title h2 {
  margin: 0;
  color: var(--charcoal);
  font-family: "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.table-title p:not(.eyebrow) {
  max-width: 840px;
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.inventory-table-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffefa;
}

.inventory-table {
  width: max(1180px, 100%);
  border-collapse: collapse;
}

.inventory-table th,
.inventory-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid rgba(223, 215, 203, 0.62);
  text-align: left;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.35;
}

.inventory-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-soft);
  color: var(--charcoal);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.inventory-table tr.active td {
  background: rgba(223, 233, 226, 0.58);
}

.table-row-link {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 50%;
  background: var(--charcoal);
  color: #fff;
  font-weight: 900;
}

.table-status {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.table-status.good {
  background: var(--sage);
  color: var(--emerald);
}

.table-status.warn {
  background: var(--brass-soft);
  color: var(--brass);
}

.table-status.bad {
  background: var(--claret-soft);
  color: var(--claret);
}

.preview-title {
  margin-bottom: 10px;
}

.preview-title strong,
.preview-title small {
  display: block;
}

.preview-title small {
  color: var(--muted);
}

.preview-rows {
  display: grid;
  gap: 6px;
}

.preview-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 150px) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.preview-row.active {
  border-color: var(--emerald);
  background: var(--sage);
}

.preview-row.locked {
  opacity: 0.62;
}

.preview-row span {
  color: var(--brass);
  font-size: 12px;
  font-weight: 900;
}

.preview-row strong {
  font-size: 12px;
  line-height: 1.25;
}

.preview-row p {
  max-height: 56px;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

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

.panel {
  padding: 21px;
}

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

.clean-table th,
.clean-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.clean-table th {
  background: var(--panel-soft);
  color: var(--charcoal);
}

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

.report-list div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.report-list span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--charcoal);
  color: #fff;
  font-weight: 900;
}

.report-list p {
  margin: 5px 0 0;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

@media (max-width: 1180px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .side-rail,
  .context-bar,
  .shell-main {
    grid-column: 1;
  }

  .side-rail {
    position: static;
    grid-row: 1;
    min-height: auto;
    padding: 14px 18px;
  }

  .context-bar {
    grid-row: 2;
  }

  .shell-main {
    grid-row: 3;
  }

  .brand-block {
    padding-bottom: 14px;
  }

  .surface-tabs {
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    overflow-x: auto;
  }

  .rail-body,
  .rail-footer {
    display: none;
  }

  .context-bar {
    position: sticky;
    top: 0;
  }

  .setup-board,
  .workbench,
  .department-focus,
  .department-switch-drawer,
  .simple-grid {
    grid-template-columns: 1fr;
  }

  .profile-panel,
  .org-panel,
  .department-workplan-panel,
  .digital-panel,
  .risk-panel {
    grid-column: 1;
  }

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

  .department-focus-stats {
    min-width: 0;
  }

  .preview-card {
    position: static;
    max-height: none;
  }

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

@media (max-width: 760px) {
  .context-bar,
  .setup-hero,
  .page-head,
  .card-head,
  .table-title,
  .row-table-head,
  .inline-add {
    display: block;
  }

  .context-bar {
    padding: 13px 14px;
  }

  .context-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
  }

  .surface-tabs {
    grid-template-columns: repeat(5, 150px);
  }

  .page {
    width: calc(100% - 28px);
    padding-top: 18px;
  }

  .setup-hero,
  .form-card,
  .preview-card,
  .panel,
  .setup-panel {
    padding: 16px;
  }

  .setup-hero h1,
  .page-head h1 {
    font-size: 29px;
  }

  .setup-dossier,
  .entry-dossier {
    margin-top: 14px;
  }

  .sample-actions {
    justify-content: flex-start;
    margin-top: 12px;
  }

  .inline-add input,
  .inline-add button {
    width: 100%;
    margin-top: 8px;
  }

  .step-tabs,
  .setup-fields,
  .field-grid,
  .locked-fields,
  .signal-grid,
  .department-workplan,
  .department-picker,
  .department-focus-stats,
  .department-strip {
    grid-template-columns: 1fr;
  }

  .department-switch-button {
    width: 100%;
  }

  .preview-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .preview-row p {
    grid-column: 2;
  }
}
