:root {
  --navy: #1f2a52;
  --navy-deep: #18213f;
  --royal: #2b3890;
  --green: #317444;
  --teal: #087b76;
  --blue: #176b9c;
  --red: #b93642;
  --amber: #a65a08;
  --ink: #18202c;
  --muted: #647083;
  --subtle: #8a94a3;
  --canvas: #f3f5f7;
  --surface: #ffffff;
  --surface-alt: #f8f9fb;
  --border: #dce1e7;
  --border-strong: #c8d0d9;
  --focus: #3e65bf;
  --shadow: 0 8px 24px rgba(24, 32, 44, 0.08);
  --sidebar-width: 252px;
  --topbar-height: 68px;
  --radius: 6px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-width: 320px;
  max-width: 100%;
  min-height: 100%;
  overflow-x: clip;
  background: var(--canvas);
}

body {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.5;
}

body.sidebar-open {
  overflow: hidden;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 1.8;
}

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

.sr-only {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: clip;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar-width);
  min-height: 100vh;
  flex-direction: column;
  color: #eef2fa;
  background: var(--navy-deep);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__brand {
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar__brand img {
  width: 164px;
  max-height: 42px;
  object-fit: contain;
  object-position: left center;
  filter: brightness(0) invert(1);
}

button.sidebar__close,
button.topbar__menu {
  display: none;
}

.context-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 14px 12px 5px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
}

.context-switch form {
  min-width: 0;
}

.context-switch__item {
  display: flex;
  width: 100%;
  min-height: 54px;
  padding: 7px 4px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  color: #aeb8cb;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
}

.context-switch__item svg {
  width: 17px;
  height: 17px;
}

.context-switch__item:hover,
.context-switch__item.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.context-switch__item.is-active {
  box-shadow: inset 0 -2px 0 #6db77c;
}

.context-label {
  display: flex;
  min-height: 42px;
  margin: 14px 12px 5px;
  padding: 9px 11px;
  align-items: center;
  gap: 9px;
  color: #dce4f2;
  background: rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 650;
}

.sidebar__nav {
  flex: 1;
  min-height: 0;
  padding: 10px 9px 22px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.nav-group + .nav-group {
  margin-top: 19px;
}

.nav-group h2 {
  margin: 0 10px 6px;
  color: #8996ad;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.3;
  text-transform: uppercase;
}

.nav-link {
  position: relative;
  display: flex;
  min-height: 40px;
  padding: 9px 12px;
  align-items: center;
  gap: 11px;
  color: #c9d1df;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 560;
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-link.is-active {
  color: #ffffff;
  background: #2c3869;
  box-shadow: inset 3px 0 0 #68ad75;
}

.nav-link.is-active svg {
  color: #82ca8f;
}

.sidebar__footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.demo-indicator {
  display: flex;
  margin: 0 5px 8px;
  align-items: center;
  gap: 7px;
  color: #95a3b8;
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
}

.demo-indicator > span,
.demo-pill > span {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: #5fb671;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(95, 182, 113, 0.15);
}

.sidebar-action {
  display: flex;
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  align-items: center;
  gap: 9px;
  color: #b5bfd0;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}

.sidebar-action:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(15, 21, 33, 0.48);
}

.app-main {
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: var(--topbar-height);
  padding: 0 28px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--border);
}

.topbar__left,
.topbar__actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.breadcrumbs {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--subtle);
  font-size: 12px;
  white-space: nowrap;
}

.breadcrumbs svg {
  width: 14px;
  height: 14px;
}

.breadcrumbs strong {
  max-width: 320px;
  overflow: hidden;
  color: #354052;
  font-weight: 680;
  text-overflow: ellipsis;
}

.icon-button {
  position: relative;
  display: inline-flex;
  width: 38px;
  height: 38px;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #4e5a6b;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
}

.icon-button:hover {
  color: var(--navy);
  background: #f0f3f7;
  border-color: var(--border);
}

.notification-button > span {
  position: absolute;
  top: 1px;
  right: 0;
  display: grid;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  place-items: center;
  color: #ffffff;
  background: var(--red);
  border: 2px solid #ffffff;
  border-radius: 9px;
  font-size: 9px;
  font-weight: 750;
}

.user-menu {
  position: relative;
}

.user-menu__trigger {
  display: flex;
  min-width: 190px;
  max-width: 270px;
  min-height: 48px;
  padding: 5px 7px;
  align-items: center;
  gap: 9px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
}

.user-menu__trigger:hover,
.user-menu__trigger[aria-expanded="true"] {
  background: var(--surface-alt);
  border-color: var(--border);
}

.user-menu__trigger > svg {
  width: 15px;
  height: 15px;
  margin-left: auto;
  color: var(--subtle);
}

.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  flex: 0 0 auto;
  color: #ffffff;
  background: var(--royal);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 760;
}

.avatar--small {
  width: 28px;
  height: 28px;
  font-size: 10px;
}

.user-menu__identity {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

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

.user-menu__identity strong {
  font-size: 12px;
  font-weight: 700;
}

.user-menu__identity small {
  color: var(--muted);
  font-size: 10px;
}

.user-menu__popover {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 50;
  width: 250px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.user-menu__popover > span {
  display: block;
  padding: 8px 9px 10px;
  overflow: hidden;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu__popover button {
  display: flex;
  width: 100%;
  min-height: 36px;
  margin-top: 5px;
  padding: 7px 9px;
  align-items: center;
  gap: 9px;
  color: var(--red);
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.user-menu__popover button:hover {
  background: #fff1f2;
}

.page-container {
  width: 100%;
  max-width: 1580px;
  margin: 0 auto;
  padding: 27px 30px 48px;
}

.page-header {
  display: flex;
  min-height: 64px;
  margin-bottom: 22px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.page-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--royal);
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

.page-header h1 {
  margin-bottom: 3px;
  color: #172033;
  font-size: 24px;
  font-weight: 720;
  line-height: 1.25;
}

.page-header p,
.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.page-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.button {
  display: inline-flex;
  min-height: 38px;
  padding: 8px 13px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 690;
  line-height: 1.2;
  white-space: normal;
}

.button svg {
  width: 16px;
  height: 16px;
}

.button--primary {
  color: #ffffff;
  background: var(--royal);
  border-color: var(--royal);
}

.button--primary:hover {
  background: #233078;
  border-color: #233078;
}

.button--secondary {
  color: #344052;
  background: #ffffff;
}

.button--secondary:hover {
  color: var(--navy);
  background: #f5f7fa;
  border-color: #aeb8c5;
}

.button--success {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green);
}

.button--warning {
  color: #ffffff;
  background: var(--amber);
  border-color: var(--amber);
}

.button--danger-outline {
  color: var(--red);
  background: #ffffff;
  border-color: #e4aeb3;
}

.button--full {
  width: 100%;
}

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

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

.metric-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 118px;
  padding: 18px;
  align-items: flex-start;
  gap: 14px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-top: 3px solid var(--navy);
  border-radius: var(--radius);
}

.metric-card--green { border-top-color: var(--green); }
.metric-card--amber { border-top-color: var(--amber); }
.metric-card--red { border-top-color: var(--red); }
.metric-card--blue { border-top-color: var(--blue); }
.metric-card--navy { border-top-color: var(--navy); }

.metric-card__icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--navy);
  background: #eef0f7;
  border-radius: 5px;
}

.metric-card--green .metric-card__icon { color: var(--green); background: #edf6ef; }
.metric-card--amber .metric-card__icon { color: var(--amber); background: #fff4e5; }
.metric-card--red .metric-card__icon { color: var(--red); background: #fff0f1; }
.metric-card--blue .metric-card__icon { color: var(--blue); background: #edf6fa; }

.metric-card > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.metric-card small {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.metric-card strong {
  overflow-wrap: anywhere;
  color: #172033;
  font-size: 23px;
  font-weight: 730;
  line-height: 1.2;
}

.metric-card em {
  margin-top: 2px;
  color: var(--subtle);
  font-size: 10px;
  font-style: normal;
}

.content-section {
  min-width: 0;
  margin-bottom: 18px;
  padding: 19px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.content-section--flush {
  padding: 0;
  overflow: hidden;
}

.content-section--flush > .section-heading,
.content-section--flush > .filter-bar {
  margin: 0;
  padding: 18px 19px;
}

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

.section-heading h2 {
  margin-bottom: 2px;
  color: #202a3b;
  font-size: 15px;
  font-weight: 720;
}

.text-link {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  color: var(--royal);
  font-size: 11px;
  font-weight: 700;
}

.text-link:hover {
  text-decoration: underline;
}

.text-link svg {
  width: 14px;
  height: 14px;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.content-section--flush .table-wrap {
  border-top: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  vertical-align: middle;
  border-bottom: 1px solid #e8ebef;
  text-align: left;
}

.data-table th {
  height: 40px;
  color: #687487;
  background: #f7f8fa;
  font-size: 10px;
  font-weight: 740;
  text-transform: uppercase;
}

.data-table tbody tr:hover {
  background: #fafbfd;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table td:first-child,
.data-table th:first-child {
  padding-left: 18px;
}

.data-table td:last-child,
.data-table th:last-child {
  padding-right: 18px;
}

.data-table .icon-button--table {
  width: 30px;
  height: 30px;
}

.case-link {
  color: var(--royal);
  font-weight: 720;
}

.case-link:hover {
  text-decoration: underline;
}

.cell-subtitle {
  display: block;
  margin-top: 1px;
  color: var(--subtle);
  font-size: 10px;
}

.status,
.priority,
.mock-badge {
  display: inline-flex;
  min-height: 23px;
  padding: 4px 8px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 740;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.status--success,
.status--approved,
.status--verified,
.status--passed {
  color: #276338;
  background: #edf7ef;
  border-color: #c7e4ce;
}

.status--warning,
.status--pending {
  color: #87500f;
  background: #fff6e9;
  border-color: #edd5ad;
}

.status--danger,
.status--failed,
.status--rejected {
  color: #9f2d38;
  background: #fff0f2;
  border-color: #efc6ca;
}

.status--info,
.status--processing {
  color: #155d86;
  background: #edf6fa;
  border-color: #bfdae7;
}

.status--neutral {
  color: #596576;
  background: #f1f3f5;
  border-color: #d8dde3;
}

.priority--alta,
.priority--high {
  color: #a42f3a;
  background: #fff0f2;
  border-color: #efc6ca;
}

.priority--media,
.priority--medium {
  color: #87500f;
  background: #fff6e9;
  border-color: #edd5ad;
}

.priority--baixa,
.priority--low {
  color: #276338;
  background: #edf7ef;
  border-color: #c7e4ce;
}

.mock-badge {
  color: #4d5970;
  background: #eef1f6;
  border-color: #d6dce5;
}

.mock-badge--light {
  color: #e0e6f0;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.competency-strip {
  display: grid;
  grid-template-columns: minmax(210px, 1.2fr) minmax(220px, 1fr) minmax(150px, 0.65fr) auto;
  min-height: 92px;
  margin-bottom: 18px;
  padding: 16px 18px;
  align-items: center;
  gap: 22px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
}

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

.section-icon,
.list-icon,
.record-card__icon,
.document-card__icon,
.profile-choice__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--royal);
  background: #eef0f8;
  border-radius: 5px;
}

.section-icon {
  width: 38px;
  height: 38px;
}

.competency-strip__main > div,
.competency-strip__stat {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.competency-strip small,
.progress-block span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.competency-strip__main strong {
  font-size: 15px;
}

.competency-strip__main span,
.competency-strip__stat small {
  color: var(--muted);
  font-size: 10px;
}

.competency-strip__stat strong {
  font-size: 15px;
}

.progress-block > div:first-child {
  display: flex;
  margin-bottom: 7px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.progress {
  height: 7px;
  overflow: hidden;
  background: #e6e9ee;
  border-radius: 4px;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: 4px;
}

.dashboard-split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.8fr);
  gap: 18px;
}

.dashboard-split > * {
  min-width: 0;
}

.compact-list > div {
  display: flex;
  min-height: 56px;
  padding: 9px 0;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid #e8ebef;
}

.compact-list > div:first-child {
  padding-top: 0;
}

.compact-list > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.list-icon {
  width: 32px;
  height: 32px;
}

.list-icon svg {
  width: 16px;
  height: 16px;
}

.compact-list p {
  display: flex;
  min-width: 0;
  margin: 0;
  flex: 1;
  flex-direction: column;
}

.compact-list p strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-list p small {
  color: var(--muted);
  font-size: 10px;
}

.compact-list b {
  flex: 0 0 auto;
  font-size: 12px;
}

.notice-band,
.inline-alert,
.integrity-banner,
.decision-notice,
.attention-block,
.resubmit-band {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border-radius: var(--radius);
}

.notice-band {
  min-height: 86px;
  padding: 15px;
  color: #264c32;
  background: #eef7f0;
  border: 1px solid #cae2d0;
}

.notice-band svg {
  margin-top: 2px;
  color: var(--green);
}

.notice-band strong {
  font-size: 12px;
}

.notice-band p {
  margin: 4px 0 0;
  color: #55715d;
  font-size: 11px;
}

.bar-list > div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 26px;
  min-height: 34px;
  align-items: center;
  gap: 9px;
  font-size: 11px;
}

.bar-list > div > div {
  height: 7px;
  overflow: hidden;
  background: #e9edf1;
  border-radius: 4px;
}

.bar-list i {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: 4px;
}

.bar-list strong {
  text-align: right;
}

.filter-bar {
  display: flex;
  margin-bottom: 14px;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-bar label,
.form-stack label {
  display: flex;
  color: #3e495b;
  font-size: 11px;
  font-weight: 660;
}

.filter-bar label {
  min-width: 150px;
  flex-direction: column;
  gap: 4px;
}

.filter-bar input,
.filter-bar select,
.form-stack input,
.form-stack select,
.form-stack textarea,
.semantic-search input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  outline: 0;
}

.form-stack textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

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

.record-card,
.document-card {
  display: flex;
  min-width: 0;
  padding: 15px;
  align-items: flex-start;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.record-card__icon,
.document-card__icon {
  width: 36px;
  height: 36px;
}

.record-card > div,
.document-card > div {
  min-width: 0;
  flex: 1;
}

.record-card h3,
.document-card h3 {
  margin: 0 0 4px;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 700;
}

.record-card p,
.document-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 10px;
}

.record-card dl,
.case-overview dl {
  margin: 0;
}

.record-card dt,
.case-overview dt {
  color: var(--subtle);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.record-card dd,
.case-overview dd {
  margin: 1px 0 8px;
  font-size: 11px;
  font-weight: 620;
}

.queue-summary {
  display: flex;
  margin-bottom: 14px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.queue-summary strong {
  color: var(--ink);
}

.case-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, 0.72fr);
  gap: 18px;
  align-items: start;
}

.case-workspace > div {
  min-width: 0;
}

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

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

.case-overview small {
  margin-bottom: 4px;
  color: var(--subtle);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.case-overview strong {
  overflow-wrap: anywhere;
  font-size: 11px;
}

.case-overview > div > span:not(.status) {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

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

.case-overview > div:last-child {
  border-right: 0;
}

.analysis-tabs {
  display: flex;
  padding: 4px;
  gap: 4px;
  background: #eef1f4;
  border-radius: var(--radius);
}

.analysis-tabs button {
  min-height: 33px;
  padding: 6px 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.analysis-tabs button.is-active {
  color: var(--navy);
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(24, 32, 44, 0.1);
}

[data-tab-panel][hidden] {
  display: none;
}

.analysis-panel {
  position: sticky;
  top: calc(var(--topbar-height) + 18px);
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ai-recommendation > header {
  display: flex;
  min-height: 56px;
  padding: 12px 15px;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  background: var(--navy);
}

.ai-recommendation > header .ai-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 5px;
}

.ai-recommendation > header > div,
.ai-recommendation > header > div > div {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.ai-recommendation > header h2 {
  margin: 0;
  font-size: 12px;
}

.ai-recommendation > header span {
  color: #bac5da;
  font-size: 9px;
}

.analysis-block {
  padding: 14px 15px;
  border-bottom: 1px solid var(--border);
}

.analysis-block:last-child {
  border-bottom: 0;
}

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

.analysis-block__heading h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 720;
}

.confidence {
  display: inline-flex;
  min-height: 24px;
  padding: 4px 7px;
  align-items: center;
  color: #28653a;
  background: #edf7ef;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 740;
}

.confidence--low {
  color: #9d303a;
  background: #fff0f2;
}

.ai-list,
.rule-list,
.source-list,
.trace-list,
.comparison-list,
.comment-list,
.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-list li,
.rule-list > div,
.source-list > a,
.trace-list li {
  display: flex;
  min-height: 31px;
  padding: 6px 0;
  align-items: flex-start;
  gap: 8px;
  color: #485466;
  border-bottom: 1px solid #edf0f3;
  font-size: 10px;
}

.ai-list li:last-child,
.rule-list > div:last-child,
.source-list > a:last-child,
.trace-list li:last-child {
  border-bottom: 0;
}

.check-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--green);
}

.check-icon svg {
  width: 15px;
  height: 15px;
}

.check-icon--warning { color: var(--amber); }
.check-icon--danger { color: var(--red); }

.ai-recommendation {
  padding: 0;
  overflow: hidden;
  background: #ffffff;
  border: 0;
  border-radius: 0;
}

.ai-recommendation > p,
.ai-recommendation > ul,
.ai-recommendation > footer,
.ai-recommendation__result {
  margin-right: 15px;
  margin-left: 15px;
}

.ai-recommendation > p {
  margin: 0;
  padding: 0 15px;
  color: #47536a;
  font-size: 10px;
}

.ai-recommendation > ul {
  margin-top: 8px;
  margin-bottom: 0;
  padding: 0 0 12px;
  color: #566275;
  list-style: none;
  font-size: 10px;
}

.ai-recommendation > ul li {
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

.ai-recommendation > ul svg {
  width: 13px;
  height: 13px;
}

.ai-recommendation > footer {
  display: flex;
  margin: 0;
  padding: 10px 15px;
  align-items: center;
  gap: 7px;
  color: #4a5870;
  background: #f1f3f9;
  border-top: 1px solid #dce1ea;
  font-size: 9px;
  font-weight: 650;
}

.ai-recommendation__result {
  display: flex;
  margin-top: 13px;
  margin-bottom: 8px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ai-recommendation__result > div {
  display: flex;
  flex-direction: column;
}

.ai-recommendation__result small {
  color: var(--muted);
  font-size: 9px;
}

.ai-recommendation__result strong {
  font-size: 11px;
}

.decision-bar {
  position: sticky;
  bottom: 12px;
  z-index: 20;
  display: flex;
  min-height: 67px;
  margin-top: 18px;
  padding: 12px 15px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.decision-bar > div:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.decision-bar strong {
  font-size: 11px;
}

.decision-bar small {
  color: var(--muted);
  font-size: 9px;
}

.decision-bar__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.decision-notice,
.resubmit-band,
.attention-block,
.integrity-banner,
.inline-alert {
  padding: 12px 14px;
  border: 1px solid var(--border);
  font-size: 11px;
}

.decision-notice,
.inline-alert--info {
  color: #155d86;
  background: #edf6fa;
  border-color: #bfdae7;
}

.resubmit-band,
.inline-alert--warning,
.attention-block {
  color: #815014;
  background: #fff7eb;
  border-color: #ecd6b6;
}

.inline-alert--error,
.inline-alert--danger {
  color: #982f39;
  background: #fff0f2;
  border-color: #ebc5c9;
}

.inline-alert--success,
.integrity-banner--success,
.integrity-banner--verified {
  color: #28633a;
  background: #eef7f0;
  border-color: #c8e2ce;
}

.integrity-banner--warning {
  color: #815014;
  background: #fff7eb;
  border-color: #ecd6b6;
}

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

.form-stack label {
  flex-direction: column;
  gap: 5px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(15, 21, 33, 0.56);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(100%, 500px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 18px 54px rgba(15, 21, 33, 0.24);
}

.modal > header {
  display: flex;
  min-height: 60px;
  padding: 13px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.modal > header h2 {
  margin: 0;
  font-size: 15px;
}

.modal > form,
.modal > .form-stack {
  padding: 16px;
}

.modal__actions {
  display: flex;
  margin-top: 3px;
  justify-content: flex-end;
  gap: 8px;
}

.document-tool {
  min-width: 0;
}

.document-tool > header {
  display: flex;
  min-height: 62px;
  padding: 10px 12px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #e8edf6;
  background: #273248;
  border-radius: var(--radius) var(--radius) 0 0;
}

.document-tool > header > div:first-child {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.document-tool > header > div:first-child > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.document-tool h2,
.document-tool p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-tool h2 {
  font-size: 11px;
}

.document-tool p {
  color: #aeb9ca;
  font-size: 9px;
}

.document-tool > header .section-icon {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.11);
}

.document-tool__actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.document-tool .icon-button {
  color: #dce3ee;
}

.document-tool .icon-button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.13);
}

.document-tool > footer {
  display: flex;
  min-height: 38px;
  padding: 8px 11px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 9px;
}

.document-tool > footer span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.document-tool > footer svg {
  width: 14px;
  height: 14px;
}

.document-canvas {
  min-height: 580px;
  padding: 28px;
  overflow: auto;
  background: #e5e8ec;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}

.synthetic-document {
  position: relative;
  width: min(100%, 660px);
  min-height: 760px;
  margin: 0 auto;
  padding: 46px 50px;
  overflow: hidden;
  color: #273142;
  background: #ffffff;
  box-shadow: 0 4px 18px rgba(24, 32, 44, 0.16);
  transform: scale(var(--document-zoom, 1));
  transform-origin: top center;
}

.synthetic-document__brand {
  display: flex;
  padding-bottom: 20px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 2px solid var(--navy);
}

.synthetic-document__brand img {
  width: 130px;
}

.synthetic-document__brand span {
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.synthetic-document__lead {
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.synthetic-document__lead h3 {
  margin-bottom: 6px;
  font-size: 17px;
}

.synthetic-document__lead p {
  color: var(--muted);
  font-size: 11px;
}

.synthetic-document > h3 {
  margin: 34px 0 0;
  font-size: 17px;
}

.synthetic-document dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 30px 0;
}

.synthetic-document dt {
  color: var(--subtle);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.synthetic-document dd {
  margin: 2px 0 0;
  font-size: 11px;
  font-weight: 650;
}

.synthetic-document > footer {
  position: absolute;
  right: 50px;
  bottom: 45px;
  left: 50px;
  display: flex;
  padding-top: 12px;
  align-items: center;
  justify-content: space-between;
  color: var(--subtle);
  border-top: 1px solid var(--border);
  font-size: 8px;
}

.synthetic-document > footer strong {
  color: var(--red);
}

.synthetic-document__lines {
  margin-top: 34px;
}

.synthetic-document__lines span {
  display: block;
  height: 8px;
  margin-bottom: 14px;
  background: #e4e8ed;
}

.synthetic-document__lines span:nth-child(3n) { width: 68%; }
.synthetic-document__lines span:nth-child(4n) { width: 84%; }

.synthetic-document__watermark {
  position: absolute;
  right: 18px;
  bottom: 18px;
  padding: 6px 9px;
  color: #9b5c0b;
  background: #fff4e4;
  border: 1px solid #eccf9f;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.distribution-layout,
.search-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 18px;
  align-items: start;
}

.calculation-table {
  border-top: 1px solid var(--border);
}

.calculation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  min-height: 43px;
  padding: 10px 12px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
}

.calculation-row span {
  color: var(--muted);
}

.calculation-row strong {
  text-align: right;
}

.calculation-row--credit strong { color: var(--green); }
.calculation-row--debit strong { color: var(--red); }

.calculation-row--total {
  color: #ffffff;
  background: var(--navy);
  border-bottom: 0;
}

.calculation-row--total span,
.calculation-row--total strong {
  color: #ffffff;
  font-size: 13px;
}

.timeline li {
  position: relative;
  min-height: 61px;
  padding: 0 0 18px 27px;
}

.timeline li::before {
  position: absolute;
  top: 5px;
  left: 6px;
  bottom: -4px;
  width: 1px;
  content: "";
  background: var(--border-strong);
}

.timeline li::after {
  position: absolute;
  top: 4px;
  left: 2px;
  width: 9px;
  height: 9px;
  content: "";
  background: var(--green);
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--green);
}

.timeline li:last-child::before {
  display: none;
}

.timeline strong,
.timeline span,
.timeline small {
  display: block;
}

.timeline strong { font-size: 11px; }
.timeline span { color: #4d596b; font-size: 10px; }
.timeline small { color: var(--subtle); font-size: 9px; }

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

.competency-list > article {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  min-height: 94px;
  padding: 14px;
  align-items: center;
  gap: 17px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.competency-list__body header,
.competency-list__body header > div,
.competency-list__body footer {
  display: flex;
  align-items: center;
}

.competency-list__body header {
  margin-bottom: 9px;
  justify-content: space-between;
  gap: 14px;
}

.competency-list__body header > div {
  min-width: 0;
  gap: 9px;
}

.competency-list__body header > strong {
  flex: 0 0 auto;
  font-size: 13px;
}

.competency-list__body footer {
  margin-top: 9px;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 9px;
}

.competency-list__body footer span,
.competency-list__body footer a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.competency-list__body footer a {
  margin-left: auto;
  color: var(--royal);
  font-weight: 700;
}

.competency-list__body footer svg {
  width: 13px;
  height: 13px;
}

.competency-list__date {
  display: grid;
  width: 67px;
  height: 61px;
  place-items: center;
  align-content: center;
  color: var(--navy);
  background: #eef1f7;
  border-radius: 5px;
}

.competency-list__date strong {
  font-size: 18px;
  line-height: 1.1;
}

.competency-list__date span {
  font-size: 9px;
  font-weight: 720;
  text-transform: uppercase;
}

.competency-list__body h3 {
  margin: 0 0 3px;
  font-size: 13px;
}

.competency-list__body p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.semantic-search {
  display: flex;
  gap: 8px;
}

.semantic-search input {
  min-width: 0;
  flex: 1;
}

.search-meta {
  display: flex;
  margin: 13px 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
}

.search-results {
  display: grid;
  gap: 9px;
}

.search-results article {
  padding: 13px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.search-results h3 {
  margin: 0 0 4px;
  font-size: 12px;
}

.search-results p {
  margin: 0;
  color: #566275;
  font-size: 10px;
}

.search-results footer {
  display: flex;
  margin-top: 9px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--subtle);
  font-size: 9px;
}

.comparison-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr) 22px;
  min-height: 44px;
  padding: 9px 11px;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
}

.comparison-row > svg {
  width: 15px;
  height: 15px;
  color: var(--subtle);
}

.comparison-row > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.comparison-row > div small {
  color: var(--subtle);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.comparison-row > div span,
.comparison-row > div strong {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-row--warning {
  background: #fff9ef;
}

.trace-list li,
.comment-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.comment-list strong,
.comment-list span,
.comment-list small {
  display: block;
}

.comment-list strong { font-size: 11px; }
.comment-list span { color: #4e596a; font-size: 10px; }
.comment-list small { margin-top: 3px; color: var(--subtle); font-size: 9px; }

.file-placeholder {
  display: grid;
  min-height: 140px;
  padding: 18px;
  place-items: center;
  align-content: center;
  color: var(--muted);
  background: #f6f8fa;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  text-align: center;
}

.file-placeholder svg {
  width: 28px;
  height: 28px;
  margin-bottom: 7px;
  color: var(--royal);
}

.empty-state,
.empty-page {
  display: grid;
  min-height: 260px;
  padding: 28px;
  place-items: center;
  align-content: center;
  color: var(--muted);
  text-align: center;
}

.empty-state--compact {
  min-height: 110px;
}

.empty-state svg,
.empty-page svg {
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  color: var(--subtle);
}

.empty-state h2,
.empty-state h3,
.empty-page h1 {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 16px;
}

.empty-state p,
.empty-page p {
  max-width: 440px;
  margin-bottom: 14px;
  font-size: 11px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  width: min(390px, calc(100vw - 32px));
  min-height: 52px;
  padding: 10px 10px 10px 13px;
  align-items: center;
  gap: 9px;
  color: #ffffff;
  background: #364154;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(15, 21, 33, 0.22);
}

.toast--success { background: #28643a; }
.toast--error { background: #9c303a; }
.toast--warning { background: #8b5616; }

.toast > span {
  min-width: 0;
  flex: 1;
  font-size: 11px;
}

.toast .icon-button {
  color: #ffffff;
}

.login-page {
  color: #172033;
  background: #ffffff;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(420px, 0.95fr) minmax(480px, 1.05fr);
}

.login-brand {
  display: flex;
  min-height: 100vh;
  padding: clamp(42px, 6vw, 90px);
  justify-content: center;
  flex-direction: column;
  color: #ffffff;
  background: var(--navy-deep);
}

.login-brand > img {
  width: 88px;
  height: 88px;
  margin-bottom: 52px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.login-brand__tag {
  display: inline-block;
  margin-bottom: 10px;
  color: #83ca91;
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.login-brand h1 {
  max-width: 560px;
  margin-bottom: 15px;
  font-size: 39px;
  font-weight: 730;
  line-height: 1.12;
}

.login-brand p {
  max-width: 540px;
  margin-bottom: 0;
  color: #c5cede;
  font-size: 16px;
  line-height: 1.65;
}

.login-brand__signals {
  display: flex;
  margin-top: 55px;
  flex-wrap: wrap;
  gap: 9px 20px;
  color: #aeb9ca;
  font-size: 11px;
}

.login-brand__signals span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.login-brand__signals svg {
  width: 15px;
  height: 15px;
  color: #82c78f;
}

.login-panel {
  width: min(100%, 590px);
  margin: auto;
  padding: 48px 62px;
}

.login-panel__header {
  margin-bottom: 22px;
}

.demo-pill {
  display: inline-flex;
  min-height: 27px;
  margin-bottom: 18px;
  padding: 5px 9px;
  align-items: center;
  gap: 8px;
  color: #40614a;
  background: #edf7ef;
  border: 1px solid #c8e2ce;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.login-panel h2 {
  margin-bottom: 4px;
  font-size: 25px;
  font-weight: 720;
}

.login-panel__header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.demo-profiles {
  display: grid;
  gap: 8px;
}

.profile-choice {
  display: flex;
  width: 100%;
  min-height: 66px;
  padding: 10px 12px;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
}

.profile-choice:hover {
  background: #f8f9fb;
  border-color: #adb7c4;
  box-shadow: 0 4px 12px rgba(24, 32, 44, 0.06);
}

.profile-choice__icon {
  width: 38px;
  height: 38px;
}

.profile-choice > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

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

.profile-choice strong {
  font-size: 12px;
  font-weight: 700;
}

.profile-choice small {
  color: var(--muted);
  font-size: 10px;
}

.profile-choice > svg {
  width: 16px;
  height: 16px;
  color: var(--subtle);
}

.credential-login {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.credential-login summary {
  color: var(--royal);
  cursor: pointer;
  font-size: 11px;
  font-weight: 690;
}

.credential-login .form-stack {
  margin-top: 14px;
}

.login-panel > footer {
  margin-top: 23px;
  color: var(--subtle);
  font-size: 9px;
  text-align: center;
  text-transform: uppercase;
}

.record-grid {
  margin-bottom: 18px;
}

.record-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
}

.record-card > div {
  display: flex;
  flex-direction: column;
}

.record-card > div strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-card > div span,
.record-card > small {
  color: var(--muted);
  font-size: 9px;
}

.record-card > small {
  grid-column: 2 / -1;
}

.document-card h2 {
  margin: 6px 0 4px;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.document-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  color: var(--subtle);
  font-size: 9px;
}

.analysis-block__heading > div,
.analysis-block__heading > div > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.analysis-block__heading > div > div {
  align-items: flex-start;
  flex-direction: column;
  gap: 0;
}

.analysis-block__heading h2,
.analysis-block__heading p {
  margin: 0;
}

.analysis-block__heading h2 {
  font-size: 11px;
}

.analysis-block__heading p {
  color: var(--muted);
  font-size: 9px;
}

.analysis-block__heading .section-icon {
  width: 30px;
  height: 30px;
}

.analysis-block__heading .section-icon svg {
  width: 15px;
  height: 15px;
}

.rule-list > div {
  display: flex;
  min-height: 39px;
  padding: 7px 0;
  align-items: flex-start;
  gap: 8px;
  border-bottom: 1px solid #edf0f3;
}

.rule-list > div:last-child {
  border-bottom: 0;
}

.rule-list p {
  display: flex;
  min-width: 0;
  margin: 0;
  flex-direction: column;
}

.rule-list strong {
  font-size: 10px;
}

.rule-list small {
  color: var(--subtle);
  font-size: 8px;
}

.source-list > a {
  align-items: center;
}

.source-list > a > span {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.source-list strong {
  font-size: 10px;
}

.source-list small {
  color: var(--subtle);
  font-size: 8px;
}

.source-list svg:last-child {
  width: 13px;
  height: 13px;
  margin-left: auto;
}

.attention-block {
  margin: 0 15px 14px;
}

.attention-block > svg {
  color: var(--amber);
}

.attention-block strong {
  font-size: 10px;
}

.attention-block p {
  margin: 3px 0 0;
  font-size: 9px;
}

.comment-list > div {
  display: flex;
  padding: 9px 0;
  align-items: flex-start;
  gap: 9px;
  border-bottom: 1px solid var(--border);
}

.comment-list > div:last-child {
  border-bottom: 0;
}

.comment-list p {
  display: flex;
  min-width: 0;
  margin: 0;
  flex-direction: column;
}

.decision-bar > div:first-child {
  align-items: center;
  flex-direction: row;
  gap: 10px;
}

.decision-bar > div:first-child > div {
  display: flex;
  flex-direction: column;
}

.resubmit-band {
  align-items: center;
  justify-content: space-between;
}

.resubmit-band > div,
.resubmit-band > div > div,
.resubmit-band form {
  display: flex;
  align-items: center;
}

.resubmit-band > div {
  gap: 10px;
}

.resubmit-band > div > div {
  align-items: flex-start;
  flex-direction: column;
}

.resubmit-band form {
  min-width: min(100%, 460px);
  gap: 8px;
}

.resubmit-band input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
}

.trace-list li > span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  flex: 0 0 auto;
  color: #ffffff;
  background: var(--royal);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 750;
}

.trace-list li > div {
  min-width: 0;
}

.trace-list strong {
  display: block;
  color: var(--ink);
  font-size: 10px;
}

.trace-list p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.search-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.search-meta svg {
  width: 13px;
  height: 13px;
}

.search-results article > header {
  display: flex;
  margin-bottom: 9px;
  align-items: center;
  gap: 10px;
}

.search-results article > header > div {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.search-results article > header span {
  color: var(--subtle);
  font-size: 8px;
}

.search-results article > header h3 {
  margin: 1px 0 0;
}

.search-results article > header > strong {
  color: var(--green);
  font-size: 11px;
}

.search-results footer span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.search-results footer svg {
  width: 12px;
  height: 12px;
}

.suggestion-grid > a {
  display: grid;
  min-height: 130px;
  padding: 18px;
  align-content: center;
  background: #ffffff;
  border: 1px solid var(--border);
  border-top: 3px solid var(--royal);
  border-radius: var(--radius);
}

.suggestion-grid > a:hover {
  border-color: #aeb8c5;
  box-shadow: 0 5px 15px rgba(24, 32, 44, 0.06);
}

.suggestion-grid > a svg {
  margin-bottom: 11px;
  color: var(--royal);
}

.suggestion-grid > a strong,
.suggestion-grid > a span {
  display: block;
}

.suggestion-grid > a strong {
  font-size: 12px;
}

.suggestion-grid > a span {
  color: var(--muted);
  font-size: 9px;
}

.ai-list > a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 74px 18px;
  min-height: 68px;
  padding: 10px 0;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.ai-list > a:last-child {
  border-bottom: 0;
}

.ai-list .ai-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--royal);
  background: #eef0f8;
  border-radius: 5px;
}

.ai-list > a > div {
  min-width: 0;
}

.ai-list > a > div strong {
  font-size: 10px;
}

.ai-list > a > div p {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-list > a > span:nth-last-child(2) {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
}

.ai-list > a > span small {
  color: var(--subtle);
  font-size: 8px;
}

.ai-list > a > span b {
  color: var(--green);
  font-size: 11px;
}

.ai-list > a > svg {
  width: 14px;
  height: 14px;
  color: var(--subtle);
}

.integrity-banner {
  margin-bottom: 18px;
  align-items: center;
}

.integrity-banner > div {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.integrity-banner > div strong {
  font-size: 11px;
}

.integrity-banner > div span {
  font-size: 9px;
}

.text-warning { color: var(--amber); }

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

  .competency-strip {
    grid-template-columns: minmax(200px, 1fr) minmax(220px, 1fr) auto;
  }

  .competency-strip__stat {
    display: none;
  }

  .record-grid,
  .document-grid,
  .suggestion-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .case-overview > div:nth-child(2) {
    border-right: 0;
  }

  .login-brand h1 {
    font-size: 33px;
  }
}

@media (max-width: 960px) {
  :root {
    --sidebar-width: 276px;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  button.sidebar__close,
  button.topbar__menu {
    display: inline-flex;
  }

  .sidebar__close {
    color: #dbe2ee;
  }

  .app-main {
    margin-left: 0;
  }

  .topbar {
    padding: 0 18px;
  }

  .page-container {
    padding-right: 20px;
    padding-left: 20px;
  }

  .case-workspace,
  .distribution-layout,
  .search-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .analysis-panel {
    position: static;
  }

  .login-shell {
    grid-template-columns: minmax(340px, 0.75fr) minmax(440px, 1.25fr);
  }

  .login-brand {
    padding: 45px;
  }

  .login-brand__signals {
    display: grid;
  }

  .login-panel {
    padding: 42px;
  }
}

@media (max-width: 760px) {
  .topbar {
    height: 60px;
    padding: 0 12px;
  }

  :root {
    --topbar-height: 60px;
  }

  .breadcrumbs > span,
  .breadcrumbs > svg,
  .user-menu__identity,
  .user-menu__trigger > svg {
    display: none;
  }

  .breadcrumbs strong {
    max-width: 180px;
  }

  .user-menu__trigger {
    min-width: 44px;
    min-height: 44px;
    padding: 4px;
  }

  .page-container {
    padding: 20px 14px 40px;
  }

  .page-header {
    margin-bottom: 17px;
    flex-direction: column;
    gap: 12px;
  }

  .page-header h1 {
    font-size: 21px;
  }

  .page-header__actions {
    width: 100%;
    justify-content: flex-start;
  }

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

  .metric-card {
    min-height: 96px;
  }

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

  .competency-strip .button {
    width: 100%;
  }

  .dashboard-split {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .record-grid,
  .document-grid,
  .suggestion-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .case-overview > div {
    padding: 0 0 7px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .case-overview > div:last-child {
    border-bottom: 0;
  }

  .decision-bar {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .decision-bar__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .decision-bar__actions .button {
    width: 100%;
  }

  .document-canvas {
    min-height: 440px;
    padding: 12px;
  }

  .synthetic-document {
    min-height: 600px;
    padding: 28px 25px;
  }

  .competency-list > article {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .competency-list > article > :nth-child(3),
  .competency-list > article > :nth-child(4) {
    grid-column: 1 / -1;
  }

  .semantic-search {
    flex-direction: column;
  }

  .semantic-search .button {
    width: 100%;
  }

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

  .resubmit-band {
    align-items: stretch;
    flex-direction: column;
  }

  .resubmit-band form {
    min-width: 0;
    align-items: stretch;
    flex-direction: column;
  }

  .ai-list > a {
    grid-template-columns: 32px minmax(0, 1fr) 54px;
  }

  .ai-list > a > svg {
    display: none;
  }

  .modal-backdrop {
    padding: 10px;
    align-items: start;
    overflow-y: auto;
  }

  .modal {
    max-height: none;
    margin: auto;
    overflow: visible;
  }

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

  .modal__actions .button {
    width: 100%;
  }

  .login-shell {
    display: block;
  }

  .login-brand {
    min-height: 250px;
    padding: 32px 24px;
  }

  .login-brand > img {
    width: 58px;
    height: 58px;
    margin-bottom: 22px;
  }

  .login-brand h1 {
    max-width: 400px;
    margin-bottom: 8px;
    font-size: 27px;
  }

  .login-brand p {
    font-size: 13px;
  }

  .login-brand__signals {
    display: none;
  }

  .login-panel {
    width: 100%;
    padding: 30px 22px 38px;
  }
}

@media (max-width: 430px) {
  .content-section {
    padding: 15px;
  }

  .section-heading {
    flex-direction: column;
    gap: 7px;
  }

  .data-table td,
  .data-table th {
    padding: 10px 9px;
  }

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

  .document-tool > div:first-child span {
    max-width: 150px;
  }

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

  .comparison-row {
    grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr) 16px;
    padding-right: 7px;
    padding-left: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
