:root {
  --ink: #14223a;
  --muted: #687891;
  --line: #dce4ef;
  --page: #f4f7fb;
  --panel: #ffffff;
  --f: #2f7d70;
  --c: #2563eb;
  --d: #d97706;
  --nav: #061d3b;
  --nav-soft: #0d315f;
  --gold: #f6c15d;
  --alert: #a4493d;
  --ready: #2d7b48;
  --wait: #68717a;
  --done: #2f6e9d;
  --review: #7756a2;
  --change: #a45f32;
  --stale: #a23d62;
  --shadow: 0 10px 30px rgba(26, 45, 77, 0.07);
}

* {
  box-sizing: border-box;
}

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

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.product-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
  background: #f4f7fb;
}

.product-sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  padding: 24px 16px;
  background:
    radial-gradient(circle at top right, rgba(42, 107, 191, 0.28), transparent 34%),
    linear-gradient(180deg, var(--nav), #03142a);
  color: #ffffff;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 10px 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(246, 193, 93, 0.5);
  border-radius: 8px;
  color: var(--gold);
  font-weight: 900;
  letter-spacing: 0;
}

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

.brand-lockup strong {
  font-size: 19px;
}

.brand-lockup span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
}

.main-menu {
  display: grid;
  align-content: start;
  gap: 8px;
  padding-top: 24px;
}

.main-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 760;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.main-menu button:hover,
.main-menu button.is-active {
  background: linear-gradient(90deg, rgba(246, 193, 93, 0.18), rgba(255, 255, 255, 0.08));
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--gold);
}

.view-section[hidden],
[data-view-section][hidden] {
  display: none !important;
}

.sidebar-note {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-note strong {
  color: var(--gold);
}

.sidebar-note span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

button,
input,
select {
  font: inherit;
}

.workspace-shell {
  min-width: 0;
  width: min(100%, 1520px);
  margin: 0 auto;
  padding: 0 24px 40px;
}

.public-review-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 14px -8px 0;
  padding: 12px 16px;
  border: 1px solid #b8d1ff;
  border-radius: 8px;
  background: #eef5ff;
  color: #15325f;
}

.public-review-banner strong,
.public-review-banner span {
  display: block;
}

.public-review-banner strong {
  font-size: 15px;
}

.public-review-banner span {
  margin-top: 3px;
  color: #5f718a;
  font-size: 13px;
}

.public-review-banner em {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 7px;
  background: #ffffff;
  color: #1557ce;
  font-style: normal;
  font-size: 12px;
  font-weight: 760;
}

.topbar {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 10;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
  margin: 0 -24px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.eyebrow,
.summary-label,
.layer-label,
.section-heading p,
.control-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

h1 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 760;
  white-space: nowrap;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

h3 {
  margin-bottom: 10px;
  font-size: 17px;
}

.status-strip,
.control-panel,
.progress-panel,
.summary-band,
.real-data-panel,
.analysis-page,
.workbench-grid,
.mapping-section,
.advanced-workbench {
  margin-top: 18px;
}

.global-search {
  flex: 1 1 360px;
  max-width: 620px;
}

.global-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.global-search input {
  width: 100%;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.topbar-meta {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.stage-pill,
.status-badge,
.output-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.stage-f {
  color: var(--f);
  background: rgba(47, 125, 112, 0.1);
}

.stage-c {
  color: var(--c);
  background: rgba(74, 101, 143, 0.12);
}

.stage-d {
  color: var(--d);
  background: rgba(147, 106, 53, 0.13);
}

.home-dashboard {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 172px;
  padding: 24px 28px;
  border: 1px solid #cfdae8;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(4, 32, 68, 0.98), rgba(23, 83, 151, 0.82) 42%, rgba(255, 255, 255, 0.88)),
    #0a2a57;
  color: #ffffff;
  box-shadow: var(--shadow);
}

.dashboard-hero .eyebrow,
.dashboard-hero p {
  color: rgba(255, 255, 255, 0.82);
}

.dashboard-hero h2 {
  margin: 6px 0 10px;
  color: #ffffff;
  font-size: 28px;
}

.dashboard-hero p {
  max-width: 660px;
  margin-bottom: 0;
  line-height: 1.7;
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.summary-item {
  min-height: 92px;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.summary-item:last-child {
  border-right: 0;
}

.summary-item strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.25;
}

.progress-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(320px, 1fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.progress-copy h2 {
  margin-top: 6px;
}

.progress-copy p:last-child,
.guidance-grid p {
  margin-bottom: 0;
  color: #43515b;
  line-height: 1.55;
}

.progress-stack {
  display: grid;
  gap: 12px;
}

.layer-progress {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 46px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9ecec;
}

.bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--f);
  transition: width 160ms ease;
}

.layer-progress:nth-child(2) .bar i {
  background: var(--c);
}

.layer-progress:nth-child(3) .bar i {
  background: var(--d);
}

.guidance-grid {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr 1fr minmax(180px, 0.35fr);
  gap: 12px;
}

.guidance-grid > div {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.control-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.real-data-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.real-data-panel > .section-heading {
  align-items: center;
  margin-bottom: 16px;
}

.real-data-panel > .section-heading p {
  max-width: 760px;
}

.real-control-grid {
  grid-template-columns: minmax(170px, 0.5fr) minmax(260px, 0.9fr) minmax(320px, 1.2fr);
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.real-case-actions {
  display: grid;
  align-content: end;
  gap: 6px;
}

.lawyer-start-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.lawyer-start-panel article {
  min-width: 0;
  min-height: 128px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.lawyer-start-panel h3 {
  margin: 8px 0 6px;
  font-size: 16px;
}

.lawyer-start-panel p {
  min-height: 40px;
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.45;
}

.step-kicker {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #eaf2ff;
  color: #1d4ed8;
  font-weight: 850;
  font-size: 12px;
}

.real-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.real-stat {
  min-height: 88px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.real-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.real-stat strong {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
  color: #111c33;
  font-size: 20px;
  line-height: 1.35;
}

.case-list-table {
  display: grid;
  gap: 0;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.case-table-head,
.case-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(100px, 0.55fr) minmax(180px, 0.85fr) minmax(150px, 0.72fr) minmax(170px, 0.65fr);
  gap: 12px;
  align-items: center;
  padding: 13px 16px;
}

.case-table-head {
  background: #f1f5fb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.case-row {
  border-top: 1px solid var(--line);
  color: #27354c;
  font-size: 13px;
}

.case-row.is-active {
  background: #f8fbff;
}

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

.case-row strong {
  margin-bottom: 4px;
  color: #1d4ed8;
  font-size: 14px;
}

.case-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.empty-state {
  padding: 22px;
  color: var(--muted);
  line-height: 1.6;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 16px;
}

.skill-delivery-overview {
  display: grid;
  grid-template-columns: 0.72fr minmax(0, 1fr) minmax(0, 1.18fr);
  gap: 12px;
  margin-top: 14px;
}

.skill-delivery-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.skill-delivery-card h3 {
  margin: 8px 0 6px;
  font-size: 16px;
}

.skill-delivery-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.delivery-meter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.delivery-meter span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.delivery-meter strong {
  font-size: 20px;
  color: #111c33;
}

.delivery-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.delivery-chip {
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
}

.delivery-chip.is-generated {
  border-color: rgba(31, 111, 88, 0.34);
  background: #edf7f3;
  color: #145f58;
}

.real-data-card {
  min-height: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.real-data-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.material-tree,
.real-output-files {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
}

.material-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.material-group summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  cursor: pointer;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.material-group ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0 10px 10px 24px;
}

.material-group li,
.real-output-row {
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.material-group li span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.real-output-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  font-size: 13px;
}

.real-output-row a,
.real-output-row em {
  grid-column: 2;
}

.real-output-row.has-file {
  border-color: rgba(47, 110, 157, 0.32);
}

.real-output-row em {
  color: var(--muted);
  font-style: normal;
}

.control-grid,
.toggle-grid {
  display: grid;
  gap: 10px;
}

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

.control-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

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

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-weight: 700;
  cursor: pointer;
}

.toggle input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  accent-color: var(--f);
}

.action-row,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.action-row {
  margin-top: 14px;
}

button {
  min-height: 34px;
  border: 1px solid #cfd9e6;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 730;
  cursor: pointer;
}

button:not(.step-button) {
  padding: 7px 11px;
}

button:hover:not(:disabled) {
  border-color: #889ba6;
}

button:disabled {
  color: #9aa4aa;
  cursor: not-allowed;
  background: #eef0f0;
}

.secondary-button {
  background: #f7faff;
}

.primary-case-button {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.primary-case-button:hover:not(:disabled) {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

input,
select,
textarea {
  min-width: 0;
}

.create-case-form {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.form-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.form-heading h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.form-heading p {
  margin: 0;
  color: var(--muted);
}

.create-case-form input,
.create-case-form select {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.create-dir-toggle {
  align-self: end;
  min-height: 36px;
}

.path-grid {
  margin-top: 12px;
}

.material-upload-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 8px;
  background: #f8fbff;
}

.material-center {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.material-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.material-center .material-upload-panel {
  margin-top: 0;
  min-height: 100%;
}

.material-upload-panel.is-disabled {
  opacity: 0.72;
}

.material-upload-panel.is-disabled .material-drop-zone {
  cursor: not-allowed;
  background: #f2f4f3;
}

.material-drop-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 96px;
  padding: 16px;
  border: 1px dashed rgba(37, 99, 235, 0.45);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.material-drop-zone.is-dragging {
  border-color: #2563eb;
  background: #eff6ff;
}

.material-drop-zone strong,
.material-drop-zone span {
  display: block;
  overflow-wrap: anywhere;
}

.material-drop-zone span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.upload-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.upload-options label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.upload-options input {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

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

.step-nav,
.step-detail,
.mapping-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.step-nav {
  padding: 12px;
}

.step-nav ol {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.step-button:hover,
.step-button:focus-visible,
.step-button.is-active {
  border-color: #9fb2bd;
  outline: none;
  background: #eef5ff;
}

.step-button.is-locked {
  color: #697781;
  background: #f1f2f2;
}

.step-number {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: #ffffff;
  font-weight: 800;
  font-size: 12px;
}

.step-number.layer-f {
  background: var(--f);
}

.step-number.layer-c {
  background: var(--c);
}

.step-number.layer-d {
  background: var(--d);
}

.step-title {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 760;
}

.step-meta {
  display: none;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.step-detail {
  min-height: 560px;
  padding: 20px;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.detail-description {
  margin: 18px 0;
  color: #43515b;
  line-height: 1.7;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.detail-grid div {
  min-height: 102px;
  padding: 12px;
  background: #f8fbff;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

dd {
  margin: 8px 0 0;
  line-height: 1.55;
}

.outputs-section {
  margin-top: 24px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  margin-bottom: 14px;
}

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

.output-card {
  min-width: 0;
  min-height: 116px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.output-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.output-card strong {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.output-card p {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.output-status {
  color: var(--wait);
  background: rgba(104, 113, 122, 0.12);
}

.output-status.ready,
.status-ready {
  color: var(--ready);
  background: rgba(45, 123, 72, 0.12);
}

.output-status.waiting,
.status-waiting {
  color: var(--wait);
  background: rgba(104, 113, 122, 0.12);
}

.output-status.locked,
.status-locked {
  color: var(--alert);
  background: rgba(164, 73, 61, 0.11);
}

.output-status.progress,
.status-progress {
  color: var(--change);
  background: rgba(164, 95, 50, 0.13);
}

.output-status.done,
.status-done {
  color: var(--done);
  background: rgba(47, 110, 157, 0.13);
}

.output-status.review,
.status-review {
  color: var(--review);
  background: rgba(119, 86, 162, 0.13);
}

.output-status.change,
.status-change {
  color: var(--change);
  background: rgba(164, 95, 50, 0.13);
}

.output-status.disabled,
.status-disabled {
  color: #6c7378;
  background: rgba(108, 115, 120, 0.13);
}

.output-status.stale,
.status-stale {
  color: var(--stale);
  background: rgba(162, 61, 98, 0.13);
}

.mini-meta {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 10px 0 0;
}

.mini-meta div {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.mini-meta dt {
  font-size: 11px;
}

.mini-meta dd {
  margin-top: 4px;
  color: #3f4c55;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.card-actions {
  margin-top: 12px;
}

.card-actions button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.mapping-section {
  min-width: 0;
  padding: 22px;
}

.analysis-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}

.analysis-main {
  min-width: 0;
}

.analysis-rail {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.analysis-rail .real-data-card {
  box-shadow: var(--shadow);
}

.review-rail button {
  width: 100%;
}

.output-center-section {
  box-shadow: var(--shadow);
}

.advanced-workbench {
  min-width: 0;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.system-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 18px 0;
  min-width: 0;
}

.system-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.advanced-content {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 18px;
}

.advanced-content .mapping-section,
.advanced-content .progress-panel,
.advanced-content .control-panel {
  margin-top: 0;
  box-shadow: none;
}

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

.output-center-details {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.output-detail-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.detail-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fbff;
}

.detail-group-heading h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.detail-group-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.detail-group-heading > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.output-delivery-list {
  display: grid;
}

.output-delivery-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.output-delivery-item:last-child {
  border-bottom: 0;
}

.delivery-code {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #eef5ff;
  color: #1d5fd1;
  font-weight: 800;
}

.delivery-main {
  min-width: 0;
}

.delivery-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.delivery-title-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.delivery-main p {
  margin: 6px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.delivery-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.delivery-meta span,
.delivery-file {
  color: var(--muted);
  font-size: 12px;
}

.delivery-meta span {
  padding: 3px 7px;
  border: 1px solid #dde8f6;
  border-radius: 8px;
  background: #f8fbff;
}

.delivery-file {
  margin-top: 7px;
  overflow-wrap: anywhere;
}

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

.run-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.run-action-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  min-width: 0;
}

.run-action-panel p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.provider-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  min-width: 0;
}

.provider-toolbar p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

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

.provider-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  overflow-wrap: anywhere;
}

.ocr-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.ocr-summary-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  overflow-wrap: anywhere;
}

.ocr-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.ocr-summary-card strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.ocr-text-preview {
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 8px;
}

.ocr-selected-notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1f4f4;
  color: #3f4c55;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ocr-queue-notice {
  margin: 12px 0 8px;
  padding: 10px 12px;
  border-left: 3px solid var(--change);
  background: rgba(164, 95, 50, 0.08);
  color: var(--text);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.inline-toggle {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.inline-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.ocr-select-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.ocr-select-row input {
  flex: 0 0 auto;
  margin-top: 3px;
}

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

.run-log-viewer {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #3f4c55;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.run-log-viewer ol {
  margin: 8px 0 0;
  padding-left: 18px;
}

.run-log-viewer span {
  display: inline-block;
  min-width: 104px;
  color: var(--muted);
}

.provider-log-snapshot {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.provider-log-snapshot p {
  margin-top: 6px;
  color: var(--muted);
}

.run-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  overflow-wrap: anywhere;
}

.run-card h3 {
  margin-bottom: 4px;
}

.run-table-card {
  grid-column: 1 / -1;
  min-width: 0;
}

.run-table-wrap {
  margin-top: 10px;
  max-width: 100%;
  overflow-x: auto;
}

.run-table-wrap table,
.artifact-section table {
  min-width: 980px;
}

.center-group {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.center-group h3 {
  margin-bottom: 4px;
}

.center-group p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

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

.center-stats span {
  min-height: 46px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
}

.center-stats strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 17px;
}

.scenario-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  counter-reset: scenario;
}

.scenario-item {
  position: relative;
  min-height: 46px;
  padding: 10px 12px 10px 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  line-height: 1.45;
  counter-increment: scenario;
}

.scenario-item::before {
  content: counter(scenario);
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e8eeee;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.output-inspector {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  justify-items: end;
  background: rgba(30, 42, 50, 0.28);
}

.output-inspector[hidden] {
  display: none;
}

.inspector-panel {
  width: min(760px, 100%);
  height: 100%;
  overflow: auto;
  padding: 22px;
  background: var(--panel);
  box-shadow: -18px 0 40px rgba(30, 42, 50, 0.16);
}

.inspector-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.review-box {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.review-box label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

textarea {
  width: 100%;
  resize: vertical;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
}

.inspector-message {
  min-height: 72px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #43515b;
  line-height: 1.55;
}

.file-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.file-link-row a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  font-weight: 750;
}

.file-preview {
  max-height: 520px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f9f9;
  color: #26333a;
  white-space: pre-wrap;
  word-break: break-word;
  font:
    13px/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", monospace;
}

.mapping-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
}

.compact-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compact-list.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-list li {
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  font-size: 13px;
  line-height: 1.4;
}

.legacy-table-wrap {
  margin-top: 18px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  border: 1px solid var(--line);
  background: #ffffff;
}

caption {
  padding: 10px 0;
  color: var(--muted);
  text-align: left;
  font-size: 13px;
}

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

th {
  background: #f1f4f4;
  font-size: 13px;
}

td {
  font-size: 13px;
  line-height: 1.55;
}

.status-table-section table {
  min-width: 1080px;
}

.status-table-section .card-actions {
  min-width: 220px;
}

.run-record-links {
  display: grid;
  gap: 8px;
}

.run-record-links a {
  color: #145f58;
  overflow-wrap: anywhere;
}

.run-provider-failed {
  border-left: 3px solid #a93f3f;
  color: #7d2424;
  padding-left: 10px;
}

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

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

@media (max-width: 980px) {
  .product-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-sidebar {
    position: static;
    min-height: auto;
    padding: 14px;
  }

  .brand-lockup {
    padding-bottom: 8px;
  }

  .main-menu {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-top: 10px;
  }

  .sidebar-note {
    display: none;
  }

  .workspace-shell {
    width: 100%;
    padding: 0 14px 32px;
  }

  .topbar {
    margin: 0 -14px;
    padding: 12px 14px;
  }

  .global-search {
    width: 100%;
    max-width: none;
  }

  .topbar,
  .section-heading,
  .control-panel,
  .run-action-panel,
  .provider-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-band,
  .dashboard-hero,
  .lawyer-start-panel,
  .material-layout,
  .workbench-grid,
  .progress-panel,
  .detail-grid,
  .mapping-grid,
  .output-list,
  .compact-list.two-col,
  .control-grid,
  .real-control-grid,
  .skill-delivery-overview,
  .toggle-grid,
  .guidance-grid,
  .real-stats,
  .analysis-rail,
  .output-center-grid,
  .provider-grid,
  .ocr-summary-grid,
  .run-grid,
  .scenario-list,
  .inspector-meta {
    grid-template-columns: minmax(0, 1fr);
  }

  .case-table-head {
    display: none;
  }

  .case-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: start;
  }

  .run-table-card {
    grid-column: auto;
  }

  .status-strip {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .workspace-shell {
    width: 100%;
    padding-top: 14px;
  }

  .product-sidebar {
    padding: 12px;
  }

  .main-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  h1 {
    font-size: 22px;
  }

  .step-button {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .step-button .stage-pill {
    display: none;
  }

  .detail-header,
  .output-head,
  .material-drop-zone {
    flex-direction: column;
  }

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

  .real-output-row a,
  .real-output-row em {
    grid-column: 1;
  }

  .material-drop-zone,
  .upload-options {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

}

/* Reference-style product redesign: dense legal workbench, not a developer dump. */
:root {
  --page: #f7f9fc;
  --ink: #12213b;
  --muted: #6b7890;
  --line: #e2e8f2;
  --nav: #061d3f;
  --nav-deep: #03152e;
  --blue: #1f6feb;
  --blue-soft: #eaf2ff;
  --green: #2fa86b;
  --orange: #f59e32;
  --red: #e45858;
  --purple: #7c5cff;
  --shadow: 0 12px 30px rgba(19, 36, 69, 0.06);
}

body {
  background: var(--page);
}

.product-shell {
  grid-template-columns: 248px minmax(0, 1fr);
}

.product-sidebar {
  padding: 26px 16px 20px;
  background:
    radial-gradient(circle at 96% 0%, rgba(55, 113, 202, 0.28), transparent 32%),
    linear-gradient(180deg, var(--nav), var(--nav-deep));
  box-shadow: 10px 0 30px rgba(4, 19, 42, 0.1);
}

.brand-lockup {
  align-items: center;
  gap: 14px;
  padding: 0 14px 22px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-color: rgba(246, 193, 93, 0.65);
  background: rgba(255, 255, 255, 0.06);
  color: #ffd27a;
  font-size: 16px;
}

.brand-lockup strong {
  color: #ffffff;
  font-size: 20px;
  letter-spacing: 0;
}

.brand-lockup span {
  color: rgba(255, 255, 255, 0.78);
}

.main-menu {
  gap: 6px;
  padding-top: 18px;
}

.main-menu button {
  position: relative;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
}

.main-menu button::before {
  content: none;
}

.main-menu button.is-active,
.main-menu button:hover {
  background: linear-gradient(90deg, rgba(255, 195, 77, 0.18), rgba(255, 255, 255, 0.08));
  color: #ffffff;
  box-shadow: inset 3px 0 0 #f6c15d;
}

.main-menu button:not(.is-active):not(:hover) {
  background: transparent;
  border-color: transparent;
  color: rgba(255, 255, 255, 0.82);
}

.sidebar-note {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

.workspace-shell {
  width: 100%;
  max-width: 1480px;
  padding: 0 22px 32px;
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(130px, auto) minmax(320px, 620px) auto;
  justify-content: stretch;
  gap: 18px;
  min-height: 74px;
  margin: 0 -22px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.topbar-menu {
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-color: transparent;
  color: #41516d;
  background: transparent;
  font-size: 22px;
}

.topbar .eyebrow {
  display: none;
}

#topbarViewTitle {
  font-size: 22px;
}

.global-search input {
  min-height: 42px;
  border-color: var(--line);
  border-radius: 7px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.status-strip {
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.topbar-meta,
.provider-mini,
.user-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-left: 1px solid var(--line);
  color: #293a59;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.provider-mini::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--green);
}

.user-chip::before {
  content: "";
  width: 34px;
  height: 34px;
  margin-right: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #dbeafe, #c7d2fe);
}

.home-dashboard,
.real-data-panel,
.material-center,
.analysis-page,
.output-center-section,
.advanced-workbench,
.scenario-section {
  margin-top: 18px;
}

.dashboard-hero,
.real-data-panel,
.material-center,
.mapping-section,
.advanced-workbench,
.progress-panel,
.workbench-grid,
.step-detail,
.real-data-card,
.control-panel,
.create-case-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.dashboard-hero {
  min-height: 210px;
  background:
    linear-gradient(90deg, rgba(5, 31, 68, 0.98), rgba(33, 94, 169, 0.88) 44%, rgba(255, 255, 255, 0.9)),
    #08254d;
}

.dashboard-hero h2 {
  font-size: 30px;
}

.section-heading {
  align-items: center;
  margin-bottom: 16px;
}

.section-heading h2 {
  font-size: 24px;
  letter-spacing: 0;
}

.section-heading p {
  margin-top: 6px;
}

button {
  border-color: #d4ddea;
  border-radius: 6px;
}

button:not(.secondary-button):not(.topbar-menu):not(.step-button):not(.delivery-chip):not(.main-menu button) {
  background: #1769e8;
  border-color: #1769e8;
  color: #ffffff;
}

button.secondary-button,
.secondary-button {
  background: #ffffff;
  color: #1f3b64;
}

button.text-button,
.text-button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent !important;
  color: #1769e8 !important;
  font-weight: 800;
}

.primary-case-button {
  background: #1769e8 !important;
  border-color: #1769e8 !important;
  color: #ffffff !important;
}

.status-badge,
.output-status {
  min-height: 26px;
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 12px;
}

.lawyer-start-panel article,
.real-stat,
.skill-delivery-card,
.center-group,
.provider-card,
.run-table-card {
  border-color: var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(19, 36, 69, 0.04);
}

.lawyer-start-panel article {
  display: grid;
  align-content: start;
  min-height: 150px;
}

.step-kicker {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #1769e8;
  background: #eaf2ff;
}

.real-control-grid {
  grid-template-columns: minmax(180px, 0.45fr) minmax(280px, 0.65fr) minmax(420px, 1fr);
  background: #ffffff;
}

.developer-hidden-controls {
  display: none !important;
}

.case-business-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 16px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.case-business-toolbar strong {
  display: block;
  margin: 5px 0;
  color: #10213c;
  font-size: 20px;
}

.case-business-toolbar p {
  margin: 0;
  color: var(--muted);
}

.case-center-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 18px;
  align-items: start;
  margin-top: 16px;
}

.case-main-column {
  min-width: 0;
}

.case-right-rail {
  display: grid;
  gap: 14px;
}

.case-right-rail section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.rail-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.rail-title h3 {
  margin: 0;
  font-size: 16px;
}

.rail-title button {
  min-height: 28px;
  padding: 4px 6px;
  border: 0;
  background: transparent !important;
  color: #1769e8 !important;
}

.task-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-list li {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eef2f7;
}

.task-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.task-list strong {
  color: #16253f;
  font-size: 13px;
}

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

.task-list em {
  justify-self: start;
  border-radius: 5px;
  padding: 3px 6px;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}

.priority-high {
  color: #b42318;
  background: #fff1f0;
}

.priority-mid {
  color: #b45309;
  background: #fff7ed;
}

.priority-low {
  color: #475569;
  background: #f1f5f9;
}

.full-width-button {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

.real-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.real-stat {
  position: relative;
  min-height: 100px;
  padding: 18px;
}

.real-stat::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 20px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #eaf2ff, #dbeafe);
}

.real-stat strong {
  max-width: calc(100% - 44px);
  font-size: 20px;
}

.case-list-table {
  margin-top: 16px;
}

.case-table-head {
  min-height: 46px;
  background: #f6f8fb;
}

.case-row {
  min-height: 68px;
}

.case-row:hover {
  background: #f8fbff;
}

.case-row strong {
  color: #1769e8;
}

.case-row-actions button {
  min-height: 30px;
  padding: 5px 10px;
}

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

.delivery-chip {
  border-radius: 5px;
}

.material-layout {
  grid-template-columns: 250px minmax(0, 1fr) 290px;
}

.material-tree-panel,
.material-detail-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.material-upload-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.material-drop-zone {
  min-height: 120px;
  border-color: rgba(23, 105, 232, 0.45);
  background: #f8fbff;
}

.upload-options {
  align-items: end;
}

.material-kpi-grid {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.material-kpi-grid span {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
}

.material-kpi-grid strong {
  color: #16253f;
  font-size: 15px;
}

.case-analysis-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 138px;
  gap: 18px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.case-title-block {
  min-width: 0;
}

.case-title-block h2 {
  margin: 8px 0 12px;
  overflow: hidden;
  color: #10213c;
  font-size: 24px;
  line-height: 1.28;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-meta-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid #edf1f7;
  border-radius: 8px;
  background: #fbfcfe;
}

.case-meta-strip span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid #edf1f7;
  color: var(--muted);
  font-size: 12px;
}

.case-meta-strip span:last-child {
  border-right: 0;
}

.case-meta-strip strong {
  overflow: hidden;
  color: #182943;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-primary-actions {
  display: grid;
  gap: 10px;
  min-width: 150px;
}

.case-completion-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.case-completion-card strong {
  color: #10213c;
  font-size: 24px;
}

.case-completion-card i {
  display: block;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, #fff 58%, transparent 60%),
    conic-gradient(#1769e8 var(--percent, 0deg), #e7edf6 0);
}

.progress-panel {
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.1fr);
  padding: 18px;
}

.workbench-grid {
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 14px;
}

.step-nav,
.step-detail {
  background: #ffffff;
}

.step-button {
  border-radius: 6px;
}

.step-button.is-active {
  background: #eef5ff;
  box-shadow: inset 3px 0 0 #1769e8;
}

.analysis-page {
  grid-template-columns: minmax(0, 1fr) 300px;
}

.analysis-rail .real-data-card {
  border-radius: 8px;
}

.output-center-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.output-summary-band {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(130px, 0.6fr));
  gap: 0;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.output-summary-band div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}

.output-summary-band div:last-child {
  border-right: 0;
}

.output-summary-band span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.output-summary-band strong {
  overflow: hidden;
  color: #10213c;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.center-group {
  min-height: 150px;
}

.advanced-workbench .mapping-section,
.scenario-section {
  box-shadow: none;
}

@media (max-width: 1180px) {
  .case-center-shell,
  .material-layout,
  .analysis-page,
  .case-analysis-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .case-right-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .skill-delivery-overview,
  .real-stats,
  .case-meta-strip,
  .output-center-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-completion-card {
    justify-items: start;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 14px 0 0;
  }
}

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

  .global-search,
  .status-strip {
    grid-column: 1 / -1;
  }

  .main-menu button {
    padding-left: 16px;
  }
}

@media (max-width: 620px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .product-shell {
    display: block;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .product-sidebar {
    position: relative;
    min-height: auto;
    width: 100%;
    padding: 16px 12px;
  }

  .brand-lockup {
    padding: 0 4px 12px;
  }

  .main-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-top: 10px;
  }

  .main-menu button,
  .main-menu button:not(.is-active):not(:hover) {
    min-height: 42px;
    padding: 0 10px;
    font-size: 13px;
    white-space: normal;
  }

  .main-menu button::before {
    display: none;
  }

  .sidebar-note {
    display: none;
  }

  .workspace-shell {
    width: 100%;
    min-width: 0;
    padding: 0 12px 28px;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
    margin: 0 -12px;
    padding: 12px;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .status-strip {
    justify-content: start;
    overflow: hidden;
  }

  .topbar-meta,
  .provider-mini,
  .user-chip {
    min-height: 28px;
    padding: 0 8px;
    font-size: 12px;
  }

  .lawyer-start-panel,
  .real-stats,
  .case-right-rail,
  .skill-delivery-overview,
  .case-meta-strip,
  .output-summary-band,
  .output-center-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .case-title-block h2 {
    white-space: normal;
  }

  .case-meta-strip span,
  .output-summary-band div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .case-meta-strip span:last-child,
  .output-summary-band div:last-child {
    border-bottom: 0;
  }

  .real-control-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .case-center-shell,
  .material-layout,
  .analysis-page,
  .case-analysis-header,
  .progress-panel,
  .workbench-grid,
  .detail-grid,
  .guidance-grid,
  .control-grid,
  .path-grid,
  .upload-options {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .real-data-panel,
  .material-center,
  .mapping-section,
  .advanced-workbench,
  .progress-panel,
  .workbench-grid,
  .step-detail,
  .real-data-card,
  .case-analysis-header,
  .output-summary-band,
  .create-case-form {
    max-width: 100%;
    overflow: hidden;
  }

  .case-table-head {
    display: none;
  }

  .case-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 14px;
  }

  .case-row-actions {
    justify-content: start;
  }

  .output-delivery-item {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .delivery-code {
    width: 40px;
    height: 36px;
  }

  .delivery-title-row,
  .detail-group-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .delivery-actions {
    justify-content: stretch;
    width: 100%;
  }

  .delivery-actions button {
    flex: 1 1 82px;
  }

  .legacy-table-wrap,
  .case-list-table,
  .real-output-files,
  .output-list,
  .run-log-viewer {
    max-width: 100%;
    overflow-x: auto;
  }

  .legacy-table-wrap table {
    min-width: 720px;
  }

  .step-nav {
    max-height: 320px;
    overflow: auto;
  }

  .case-primary-actions {
    width: 100%;
  }
}
