:root {
  --navy: #0a1f33;
  --navy-light: #15324e;
  --navy-muted: #1e4265;
  --blue: #1b6ca8;
  --blue-hover: #14598d;
  --sky: #f0f7fc;
  --bg: #f5f8fa;
  --panel: #ffffff;
  --line: #e1e8ed;
  --text: #1a2a36;
  --muted: #657786;
  --green: #0e8a55;
  --green-bg: #e8f7f0;
  --amber: #b87100;
  --amber-bg: #fff6e0;
  --red: #d63031;
  --red-dark: #b81d22;
  --danger: #d63031;
  --danger-bg: #ffebeb;
  
  --shadow-sm: 0 1px 2px rgba(10, 31, 51, 0.05);
  --shadow-md: 0 4px 12px rgba(10, 31, 51, 0.08);
  --shadow-lg: 0 12px 32px rgba(10, 31, 51, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background-color: var(--bg);
}

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

button {
  cursor: pointer;
  transition: var(--transition);
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  display: block;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 8px;
}

h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 12px;
}

h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy-light);
  margin: 0 0 8px;
}

p {
  margin: 0 0 12px;
}

/* Login screen */
#loginScreen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(27, 108, 168, 0.45), transparent 60%),
    radial-gradient(700px 480px at 95% 110%, rgba(214, 48, 49, 0.18), transparent 55%),
    linear-gradient(135deg, #061527 0%, #0a2a47 55%, #0d4771 100%);
}

#loginScreen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  pointer-events: none;
}

.login-shell {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  width: min(880px, 100%);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 32px 90px rgba(2, 12, 27, 0.55);
  animation: login-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes login-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 40px 36px;
  color: #eaf3fb;
  background: linear-gradient(160deg, rgba(13, 41, 68, 0.92), rgba(9, 28, 48, 0.96));
  backdrop-filter: blur(6px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.login-brand .brand-mark {
  width: 48px;
  height: 48px;
  font-size: 28px;
  margin-bottom: 18px;
}

.login-brand h2 {
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.login-brand p {
  color: #a5c3db;
  font-size: 13px;
  margin: 0;
  max-width: 34ch;
}

.login-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-points li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 13px;
  color: #cfe1f0;
}

.login-points li span {
  color: var(--red);
  font-size: 10px;
}

.login-brand small {
  color: #7d9cb8;
  font-size: 11px;
}

.login-card {
  background: #fff;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
}

.login-card h1 {
  margin: 0 0 6px;
}

.login-field {
  display: block;
  margin-top: 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy-light);
}

.login-field select,
.login-field input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  font-size: 14px;
  font-weight: 500;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: #fbfdfe;
  outline: none;
  transition: var(--transition);
}

.login-field select:focus,
.login-field input:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(27, 108, 168, 0.12);
}

.login-role-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
}

.login-submit {
  width: 100%;
  margin-top: 24px;
  padding: 12px;
  font-size: 15px;
}

.login-submit.button.secondary {
  margin-top: 10px;
}

.login-switch {
  align-self: center;
  margin-top: 12px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 700;
}

.login-switch:hover {
  color: var(--blue-hover);
  text-decoration: underline;
}

.login-switch:focus-visible {
  outline: 2px solid rgba(27, 108, 168, 0.45);
  outline-offset: 3px;
  border-radius: 4px;
}

.login-error {
  color: var(--danger);
  font-size: 12.5px;
  min-height: 18px;
  margin: 12px 0 0;
}

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

/* Header & Navigation */
.topbar {
  height: 70px;
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy-light) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.brand-mark {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 900;
  color: white;
  box-shadow: 0 4px 10px rgba(214, 48, 49, 0.3);
}

.brand strong {
  display: block;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand span {
  display: block;
  font-size: 11px;
  color: #a5c3db;
  margin-top: 1px;
}

.top-context {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-context label {
  font-size: 10px;
  color: #a5c3db;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.05em;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.top-context select {
  background: var(--navy-muted);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  outline: none;
  min-width: 160px;
}

.top-context select:disabled {
  opacity: 0.8;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.05);
}

.demo-badge {
  background: rgba(214, 48, 49, 0.15);
  color: #ff7675;
  border: 1px solid rgba(214, 48, 49, 0.3);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.toast {
  position: fixed;
  top: 86px;
  right: 24px;
  width: min(420px, calc(100vw - 48px));
  padding: 16px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  font-size: 13.5px;
  font-weight: 500;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 12px;
}

@keyframes slideIn {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.toast.success { background: #0c7347; color: white; border-left: 4px solid #1dd1a1; }
.toast.error { background: #ab1f2c; color: white; border-left: 4px solid #ff7675; }
.toast.warning { background: #a87900; color: white; border-left: 4px solid #ffcc00; }

/* Case Summary Bar */
.case-summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 16px 24px;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.case-summary > div {
  padding: 0 16px;
  border-right: 1px solid var(--line);
  min-width: 0;
}

.case-summary > div:first-child { padding-left: 0; }
.case-summary > div:last-child { border: 0; padding-right: 0; }

.case-summary span {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.05em;
  display: block;
}

.case-summary strong {
  font-size: 14px;
  margin-top: 4px;
  color: var(--navy);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Stepper */
.stepper {
  display: flex;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
}

.stepper button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  padding: 16px 12px;
  text-align: left;
  color: #7b8b9a;
  outline: none;
}

.stepper button:not(:last-child):after {
  content: "";
  position: absolute;
  right: 0;
  top: 22px;
  width: 1px;
  height: 28px;
  background: var(--line);
}

.stepper i {
  font-style: normal;
  width: 28px;
  height: 28px;
  border: 2px solid #b8c5cc;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  transition: var(--transition);
}

.stepper span {
  font-size: 13px;
  font-weight: 700;
}

.stepper small {
  display: block;
  font-size: 10.5px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}

.stepper button.active {
  border-bottom-color: var(--red);
  color: var(--navy);
}

.stepper button.active i {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  box-shadow: 0 2px 6px rgba(214, 48, 49, 0.3);
}

.stepper button.done {
  color: var(--green);
}

.stepper button.done i {
  background: var(--green-bg);
  border-color: #8bc7ad;
}

/* Workspace Layout */
.workspace {
  display: grid;
  grid-template-columns: 310px minmax(560px, 1fr) 360px;
  gap: 20px;
  max-width: 1780px;
  margin: 20px auto;
  padding: 0 20px;
  align-items: start;
}

.left-column, .main-column, .right-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* Panel / Cards */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.panel:hover {
  box-shadow: var(--shadow-md);
}

.panel.compact {
  padding: 16px;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-title h1, .panel-title h2 {
  margin: 0 0 4px;
}

.panel-title p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.icon-button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  font-size: 16px;
  display: grid;
  place-items: center;
}

.icon-button:hover {
  background: var(--sky);
  border-color: var(--blue);
}

/* Form Controls */
.field {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--navy-light);
  display: block;
}

.field input, .field select, .field textarea, select {
  width: 100%;
  margin-top: 6px;
  background: #fff;
  border: 1px solid #cbd6dc;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  outline: none;
  font-size: 13.5px;
  color: var(--text);
  transition: var(--transition);
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22, 102, 168, 0.15);
}

.field textarea {
  resize: vertical;
}

.field small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  margin-top: 5px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.span-2 {
  grid-column: span 2;
}

/* Buttons */
.button-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.button-row.center { justify-content: center; }
.button-row.split { justify-content: space-between; }

.button {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Action hierarchy: primary = brand blue (proceed), danger = solid red
   (destructive only). Red is never the default "go" color in a banking UI. */
.button.primary {
  background: var(--blue);
  color: #fff;
}

.button.primary:hover {
  background: var(--blue-hover);
  box-shadow: 0 4px 12px rgba(27, 108, 168, 0.25);
}

.button.secondary {
  background: var(--navy);
  color: #fff;
}

.button.secondary:hover {
  background: var(--navy-light);
}

.button.danger {
  background: var(--red);
  color: #fff;
}

.button.danger:hover {
  background: var(--red-dark);
  box-shadow: 0 4px 12px rgba(214, 48, 49, 0.2);
}

.button.ghost {
  background: #fff;
  border-color: #cbd6dc;
  color: var(--navy);
}

.button.ghost:hover {
  background: var(--sky);
  border-color: var(--blue);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

/* Keyboard accessibility: visible focus ring on every interactive element. */
.button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
.nbw-item:focus-visible,
.case-item:focus-visible {
  outline: 3px solid rgba(27, 108, 168, 0.55);
  outline-offset: 2px;
}

/* Status Pills */
.status-pill {
  font-size: 9.5px;
  font-weight: 800;
  border-radius: 20px;
  padding: 5px 10px;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: 0.05em;
  display: inline-block;
}

.status-pill.neutral { background: #eef2f4; color: #526570; }
.status-pill.green { background: var(--green-bg); color: var(--green); }
.status-pill.amber { background: var(--amber-bg); color: var(--amber); }
.status-pill.red { background: var(--danger-bg); color: var(--danger); }

/* Guide & Notice Boxes */
.guide-box {
  background: var(--sky);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.5;
}

.guide-box b {
  color: var(--navy);
}

.expected-output {
  font-size: 12.5px;
}

.expect-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.expect-row b {
  color: var(--navy);
}

/* Case List styling */
.case-list {
  max-height: 320px;
  overflow-y: auto;
}

.case-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 12px 8px;
  transition: var(--transition);
}

.case-item:first-child { border-top: 0; }
.case-item:hover {
  background: var(--sky);
}

.case-item strong {
  display: block;
  font-size: 13px;
  color: var(--navy);
}

.case-item span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* Upload Dropzone */
.dropzone {
  border: 2px dashed #9fb3bf;
  background: #f7fafb;
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  transition: var(--transition);
}

.dropzone.drag {
  background: var(--sky);
  border-color: var(--blue);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--sky);
  color: var(--blue);
  font-size: 24px;
  font-weight: 800;
}

.dropzone h3 { margin-bottom: 4px; }
.dropzone p { font-size: 11.5px; color: var(--muted); }

.file-list {
  margin-top: 12px;
}

.file-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 8px;
  background: #fff;
}

.file-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: #edf3f6;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--navy);
}

.file-item strong { display: block; font-size: 12.5px; }
.file-item small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.file-state { font-size: 11px; font-weight: 700; color: var(--green); }

/* Document Processing Screen */
.processing-hero {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--sky);
  border-radius: var(--radius-md);
  align-items: center;
}

.processing-hero h3 { margin: 0 0 4px; }
.processing-hero p { font-size: 12.5px; color: #466176; margin: 0; }

.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid #bddbef;
  border-top-color: var(--blue);
  border-radius: 50%;
  flex: none;
}

.spinner.running {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.job-list {
  font-size: 12.5px;
  margin-top: 12px;
}

.job {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 8px 4px;
}

/* Notices */
.notice {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.notice.warning { background: var(--amber-bg); color: #674700; border-left: 4px solid var(--amber); }
.notice.success { background: var(--green-bg); color: #075b3a; border-left: 4px solid var(--green); }
.notice.danger { background: var(--danger-bg); color: #852030; border-left: 4px solid var(--danger); }

/* Profile & Conflict Check */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.profile-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #fff;
}

.profile-section h3 {
  color: var(--navy);
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.profile-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  font-size: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #f6f8fa;
}

.profile-field:last-child { border-bottom: 0; }
.profile-field span { color: var(--muted); }
.profile-field b { text-align: right; max-width: 250px; color: var(--navy); }

.source-chip {
  display: inline-block;
  background: #edf3f6;
  color: #536875;
  border-radius: 3px;
  padding: 2px 6px;
  margin-left: 6px;
  font-size: 8.5px;
  font-weight: 700;
}

.conflict {
  border: 1px solid #e4bd5d;
  background: #fffdf6;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  border-left: 4px solid #d69e2e;
}

.conflict h3 { color: #815400; margin-bottom: 6px; }

.candidate-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.candidate {
  border: 1px solid #d8c184;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  text-align: left;
  transition: var(--transition);
}

.candidate:hover {
  background: #fffbf0;
  border-color: #bfa55a;
}

.manual-correction {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.manual-correction summary {
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--blue);
}

.inline-form {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 8px;
  margin-top: 10px;
}

.inline-form select, .inline-form input {
  border: 1px solid #cbd6dc;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.attestation {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 12px;
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
}

.attestation input {
  margin-top: 2px;
}

.confirmation-card {
  display: flex;
  gap: 16px;
  background: var(--green-bg);
  border: 1px solid #b7dfcc;
  border-radius: var(--radius-md);
  padding: 16px;
  align-items: center;
}

.confirmation-card > span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(14, 138, 85, 0.2);
}

.confirmation-card h3 { margin: 0 0 4px; color: #075c3a; }
.confirmation-card p { font-size: 12.5px; margin-bottom: 6px; }
.confirmation-card code { font-size: 9.5px; color: #45685a; word-break: break-all; }

/* Decision Results Layout */
.section-heading {
  margin: 12px 2px 16px;
}

.section-heading p {
  font-size: 13px;
  color: var(--muted);
}

.decision-overview {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.decision-overview > div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.decision-overview .decision-main {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: #fff;
  border: 0;
  box-shadow: 0 8px 24px rgba(10, 31, 51, 0.15);
}

.decision-overview .decision-main p {
  color: #c9d7e3;
  margin: 6px 0 0;
  font-size: 12.5px;
}

.decision-overview span {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.decision-overview .decision-main span {
  color: #a5c3db;
}

.decision-overview strong {
  display: block;
  margin-top: 8px;
  color: var(--navy);
  font-size: 15px;
  line-height: 1.35;
}

.decision-overview .decision-main strong {
  color: #fff;
  font-size: 17px;
}

.decision-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.decision-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  min-height: 200px;
}

.decision-card:nth-child(2) { border-top-color: var(--blue); }
.decision-card:nth-child(3) { border-top-color: var(--red); }

.decision-card h2 {
  padding-left: 32px;
  min-height: 38px;
  font-size: 15px;
  margin-bottom: 12px;
}

.card-number {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}

.decision-card:nth-child(2) .card-number { background: var(--blue); }
.decision-card:nth-child(3) .card-number { background: var(--red); }

.primary-insight {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.45;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.chip {
  font-size: 9.5px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 4px;
  background: #edf3f6;
  color: #456071;
  letter-spacing: 0.02em;
}

.chip.blue { background: var(--sky); color: var(--blue); }

.product-card, .eligibility-card {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.product-card:first-child, .eligibility-card:first-child { border-top: 0; }

.product-card strong {
  font-size: 13px;
  color: var(--navy);
}

.score {
  float: right;
  font-size: 10.5px;
  color: var(--blue);
  font-weight: 800;
}

.product-card p {
  font-size: 11.5px;
  color: var(--muted);
  margin: 6px 0;
}

.rule {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  margin-top: 8px;
  font-size: 11.5px;
}

.rule i {
  font-style: normal;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 900;
}

.rule.pass i { background: var(--green-bg); color: var(--green); }
.rule.wait i { background: var(--amber-bg); color: var(--amber); }
.rule.fail i { background: var(--danger-bg); color: var(--danger); }

/* Execution Plan styling */
.plan-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.plan-step {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  min-height: 110px;
  background: #fff;
  transition: var(--transition);
}

.plan-step:after {
  content: "→";
  position: absolute;
  right: -10px;
  top: 40px;
  z-index: 2;
  color: #9aa8b1;
  font-weight: 700;
}

.plan-step:last-child:after { display: none; }

.plan-step b { display: block; font-size: 11.5px; color: var(--navy); }
.plan-step span { display: block; font-size: 9.5px; text-transform: uppercase; font-weight: 800; margin-top: 8px; color: var(--muted); }
.plan-step small { display: block; font-size: 9.5px; color: var(--muted); margin-top: 4px; line-height: 1.35; }

.plan-step.completed { border-color: #9dd1b7; background: #f4fbf7; }
.plan-step.ready { border-color: #8fc5e6; background: #f5faff; }
.plan-step.blocked { border-color: #e2b4ba; background: #fff8f9; }

/* Operations Draft styling */
.operations-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.op-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  background: #fff;
}

.check-item {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 8px;
  font-size: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  align-items: center;
}

.check-item:first-of-type { border-top: 0; }
.check-item i { font-style: normal; font-weight: 700; }

.draft-box {
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 12px;
  white-space: pre-wrap;
  max-height: 240px;
  overflow-y: auto;
  font-family: inherit;
  line-height: 1.6;
}

/* Sidebar Next Action panel */
.sticky {
  position: sticky;
  top: 90px;
}

.action-panel {
  border-top: 4px solid var(--red);
}

.next-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
}

.next-reason {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 12px;
}

.question-card, .action-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 12px;
  background: #fff;
}

.question-card { border-left: 4px solid var(--amber); }
.action-card { border-left: 4px solid var(--blue); }

.action-buttons {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.action-buttons .button {
  width: 100%;
}

.approval-preview {
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 10px;
}

.approval-preview pre {
  max-height: 250px;
  overflow-y: auto;
  font-size: 9.5px;
  margin-top: 8px;
}

/* Control Tabs */
.tab-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
  margin: -17px -17px 16px;
}

.tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: #fff;
  padding: 12px 4px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.tab.active {
  color: var(--red);
  border-bottom-color: var(--red);
  background: var(--sky);
}

.tab-content h3 {
  font-size: 13px;
  color: var(--navy);
  margin-bottom: 12px;
}

.evidence, .log-entry {
  border-bottom: 1px solid var(--line);
  padding: 10px 4px;
}

.evidence:last-child, .log-entry:last-child { border-bottom: 0; }

.evidence b, .evidence span, .evidence small, .log-entry b, .log-entry span, .log-entry small {
  display: block;
}

.evidence b, .log-entry b {
  font-size: 12.5px;
  color: var(--navy);
}

.evidence span, .log-entry span {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.evidence small, .log-entry small {
  font-size: 9.5px;
  color: #83929b;
  margin-top: 4px;
}

.log-list {
  max-height: 450px;
  overflow-y: auto;
}

pre {
  white-space: pre-wrap;
  word-break: break-all;
  background: #0f2233;
  color: #e2eff8;
  padding: 12px;
  border-radius: var(--radius-sm);
  font: 11px/1.5 Consolas, Monaco, monospace;
  max-height: 500px;
  overflow-y: auto;
  margin: 0;
}

/* Footer */
footer {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  padding: 32px 24px;
  border-top: 1px solid var(--line);
  margin-top: 40px;
  background: #fff;
}

/* Responsive Overrides */
@media (max-width: 1440px) {
  .workspace {
    grid-template-columns: 280px minmax(520px, 1fr) 320px;
    gap: 16px;
  }
}

@media (max-width: 1200px) {
  .workspace {
    grid-template-columns: 280px 1fr;
  }
  .right-column {
    grid-column: 2;
  }
  .sticky {
    position: static;
  }
  .case-summary {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .topbar {
    padding: 0 16px;
  }
  .brand strong {
    font-size: 14px;
  }
  .case-summary {
    grid-template-columns: 1fr 1fr;
  }
  .stepper {
    overflow-x: auto;
  }
  .stepper button {
    min-width: 140px;
  }
  .workspace {
    grid-template-columns: 1fr;
    padding: 0 16px;
  }
  .left-column, .right-column {
    grid-column: 1;
  }
  .main-column {
    grid-row: 1;
  }
  .form-grid, .profile-grid, .operations-grid, .decision-grid, .plan-list {
    grid-template-columns: 1fr;
  }
}

/* Chatbot UI Styles */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 520px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}

.chat-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header h3 {
  margin: 0;
  color: #ffffff;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #a5c3db;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #1dd1a1;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #1dd1a1;
}

.chat-history {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background-color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.chat-bubble-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 85%;
}

.chat-bubble-wrapper.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.chat-bubble-wrapper.user .chat-avatar {
  background: var(--navy-muted);
}

.chat-bubble {
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 14px 18px;
  border-radius: 0 16px 16px 16px;
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

.chat-bubble-wrapper.user .chat-bubble {
  background: var(--sky);
  border-color: #bcd6eb;
  color: var(--navy);
  border-radius: 16px 0 16px 16px;
}

.chat-bubble p {
  margin: 0 0 10px;
}

.chat-bubble p:last-child {
  margin-bottom: 0;
}

.chat-bubble .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 20px;
  background-color: #ffffff;
  border-top: 1px solid var(--line);
}

.suggestion-chip {
  background-color: var(--sky);
  border: 1px solid #cce3f5;
  color: var(--blue);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.suggestion-chip:hover {
  background-color: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
}

.chat-input-area {
  padding: 12px 20px;
  background-color: #ffffff;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  align-items: center;
}

.chat-input-area textarea {
  flex: 1;
  border: 1px solid #cbd6dc;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  resize: none;
  height: 44px;
  outline: none;
  font-size: 13.5px;
  transition: var(--transition);
  line-height: 1.4;
}

.chat-input-area textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22, 102, 168, 0.15);
}

.chat-input-area button {
  height: 44px;
  width: 44px;
  border-radius: 50%;
  border: 0;
  background-color: var(--red);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 18px;
  box-shadow: 0 2px 6px rgba(214, 48, 49, 0.3);
}

.chat-input-area button:hover {
  background-color: var(--red-dark);
  transform: scale(1.05);
}

.collapsible-form {
  margin-top: 10px;
}

.collapsible-form summary {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 12px;
  background-color: #f1f5f7;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.collapsible-form summary:hover {
  color: var(--navy);
  background-color: #e6ebed;
}

/* Make sure chatbot fills column correctly */
.main-column {
  max-width: 100%;
}

