:root {
  color-scheme: light;
  --ink: #18202a;
  --muted: #647081;
  --line: #d9dee7;
  --panel: #ffffff;
  --page: #f5f7fa;
  --accent: #0f766e;
  --accent-soft: #d8f3ee;
  --warn: #a15c00;
  --warn-soft: #fff1d7;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --ok: #177245;
  --ok-soft: #dcfce7;
  --blue: #2457a6;
  --blue-soft: #e4ecfb;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background: #eef2f6;
}

.auth-panel {
  width: min(100%, 450px);
  background: white;
  border: 1px solid var(--line);
  border-top: 5px solid #2f4f88;
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 14px 40px rgba(24, 32, 42, 0.09);
}

.auth-loading {
  text-align: center;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.auth-brand > div:last-child {
  display: grid;
  gap: 3px;
}

.auth-brand strong {
  font-size: 15px;
}

.auth-brand span,
.auth-security,
.password-hint {
  color: var(--muted);
  font-size: 12px;
}

.auth-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #2f4f88;
  color: white;
  font-weight: 800;
  font-size: 14px;
}

.auth-heading {
  margin: 25px 0 20px;
}

.auth-heading h1,
.auth-loading h1 {
  margin: 0 0 8px;
  font-size: 25px;
  letter-spacing: 0;
}

.auth-heading p,
.auth-loading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-submit {
  width: 100%;
  min-height: 44px;
}

.auth-error {
  padding: 10px 12px;
  border-left: 3px solid var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 4px;
  font-size: 13px;
}

.auth-security {
  margin: 20px 0 0;
  text-align: center;
}

.password-hint {
  margin: -4px 0 0;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 7px;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--ink);
}

button:hover {
  border-color: #aeb8c7;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(36, 87, 166, 0.28);
  outline-offset: 2px;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

button.warning {
  background: var(--warn);
  border-color: var(--warn);
  color: white;
}

button.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

button.ghost {
  background: transparent;
}

button.small {
  padding: 5px 8px;
  font-size: 12px;
}

button.ircc-primary,
.ircc-primary,
.ircc-upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  background: #2f4f88;
  color: white;
  border-radius: 5px;
  padding: 10px 18px;
  font-size: 16px;
  font-weight: 650;
  text-decoration: none;
}

.ircc-primary.large {
  min-height: 50px;
  font-size: 18px;
}

.ircc-upload-button {
  position: relative;
  cursor: pointer;
}

.ircc-upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.portal-drop-zone {
  position: relative;
  display: inline-flex;
  min-width: 150px;
  min-height: 76px;
  padding: 10px 12px;
  border: 2px dashed #8da2c6;
  border-radius: 6px;
  background: #f7f9fc;
  color: #17356b;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  text-align: center;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.portal-drop-zone:hover,
.portal-drop-zone.is-drag-over {
  border-color: #2f63b8;
  background: #eaf1ff;
}

.portal-drop-zone span {
  font-weight: 700;
}

.portal-drop-zone small {
  color: #5e6d84;
  font-size: 12px;
}

.portal-drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.link-button {
  border: 0;
  background: transparent;
  color: #284a82;
  text-decoration: underline;
  padding: 0;
  font-size: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  background: white;
  color: var(--ink);
}

textarea {
  min-height: 86px;
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 252px 1fr;
}

.sidebar {
  background: #202833;
  color: white;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: grid;
  gap: 4px;
  padding: 0 6px 10px;
}

.brand strong {
  font-size: 16px;
}

.brand span {
  color: #b9c3d2;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav a {
  color: #d8dee8;
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 14px;
}

.nav a.active,
.nav a:hover {
  background: #334050;
  color: white;
}

.main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  background: white;
  border-bottom: 1px solid var(--line);
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
}

.topbar h1 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.staff-identity {
  display: grid;
  gap: 2px;
  min-width: 125px;
  padding-right: 12px;
  border-right: 1px solid var(--line);
}

.staff-identity strong {
  font-size: 13px;
}

.staff-identity span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.account-button {
  white-space: nowrap;
}

.content {
  padding: 24px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.panel {
  padding: 18px;
}

.card {
  padding: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title h2,
.section-title h3 {
  margin: 0;
  font-size: 16px;
}

.muted {
  color: var(--muted);
}

.tiny {
  font-size: 12px;
}

.stat {
  display: grid;
  gap: 6px;
}

.stat strong {
  font-size: 28px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  padding: 11px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.category-row td {
  background: #eef3f8;
  color: #22314a;
  font-weight: 750;
  border-bottom-color: #cfd8e5;
}

.select-column {
  width: 54px;
  text-align: center !important;
}

.create-case-docs tr[data-create-doc-row] {
  opacity: 0.72;
}

.create-case-docs tr[data-create-doc-row].recommended-row {
  opacity: 1;
  background: #f6fbf9;
}

.reference-code {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 5px;
  border: 1px solid #b9c6d8;
  border-radius: 4px;
  color: #4e596c;
  font-size: 11px;
}

.recommendation-reason {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.case-intake {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}

.is-hidden {
  display: none !important;
}

.caq-wizard {
  display: grid;
  gap: 18px;
}

.caq-wizard-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.caq-wizard-heading h3,
.caq-wizard-heading p {
  margin: 0;
}

.caq-wizard-progress {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.caq-wizard-track {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: #e5eaf1;
}

.caq-wizard-track span {
  display: block;
  width: 0;
  height: 100%;
  background: #1b7f75;
  transition: width 180ms ease;
}

.caq-wizard-questions {
  min-height: 150px;
}

.caq-wizard-question {
  display: grid;
  max-width: 760px;
  gap: 10px;
  padding: 18px 0 6px;
}

.caq-question-label {
  color: var(--ink);
  font-size: 19px;
  font-weight: 750;
}

.caq-wizard-question input,
.caq-wizard-question select {
  max-width: 620px;
}

.caq-wizard-actions {
  display: flex;
  justify-content: space-between;
  max-width: 760px;
  gap: 12px;
}

.caq-wizard-summary dl,
.case-intake-summary dl {
  display: grid;
  gap: 0;
  margin: 10px 0 0;
}

.caq-wizard-summary dl div,
.case-intake-summary dl div {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(120px, 0.6fr);
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.caq-wizard-summary dt,
.caq-wizard-summary dd,
.case-intake-summary dt,
.case-intake-summary dd {
  margin: 0;
}

.caq-wizard-summary dd,
.case-intake-summary dd {
  font-weight: 700;
}

.funds-threshold {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto;
  align-items: center;
  gap: 4px 18px;
  margin-top: 18px;
  padding: 14px 16px;
  border-left: 4px solid #28796f;
  background: #f2f8f6;
}

.funds-threshold strong {
  color: #145b54;
  font-size: 20px;
}

.funds-threshold small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.add-case-document-panel {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.add-case-document-panel summary {
  color: #22314a;
  font-weight: 750;
  cursor: pointer;
}

.case-intake-summary {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.case-intake-summary summary {
  color: #2f4f88;
  font-weight: 700;
  cursor: pointer;
}

.case-intake-summary dl {
  display: grid;
  gap: 0;
  margin: 12px 0;
}

.case-intake-summary dl div {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(100px, 1fr);
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.case-intake-summary dt {
  color: var(--muted);
}

.case-intake-summary dd {
  margin: 0;
  font-weight: 650;
}

.admin-category-group {
  display: grid;
  gap: 10px;
}

.admin-category-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  background: #eef3f8;
  color: #22314a;
}

.admin-category-heading span {
  color: var(--muted);
  font-size: 12px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.single-column {
  grid-template-columns: 1fr;
}

.account-details {
  display: grid;
  gap: 0;
  margin: 0;
}

.account-details div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.account-details div:last-child {
  border-bottom: 0;
}

.account-details dt {
  color: var(--muted);
  font-size: 12px;
}

.account-details dd {
  margin: 0;
  font-size: 14px;
}

.staff-layout {
  grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
  align-items: start;
}

.staff-create-panel {
  position: sticky;
  top: 18px;
}

.staff-account-list {
  display: grid;
  gap: 12px;
}

.staff-account-card {
  display: grid;
  gap: 13px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
}

.staff-account-heading,
.staff-account-meta,
.staff-account-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.staff-account-heading > div {
  display: grid;
  gap: 3px;
}

.staff-account-heading span,
.staff-account-meta {
  color: var(--muted);
  font-size: 12px;
}

.staff-edit-grid {
  grid-template-columns: minmax(150px, 1fr) minmax(210px, 1.2fr) minmax(130px, 0.7fr) auto;
  align-items: end;
}

.active-account-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  white-space: nowrap;
}

.active-account-toggle input {
  width: auto;
}

.staff-account-actions {
  justify-content: flex-start;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.staff-account-actions label {
  min-width: min(100%, 260px);
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: white;
}

.pill.ok {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: #b7e4ca;
}

.pill.warn {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: #ffd596;
}

.pill.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #fecaca;
}

.pill.blue {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: #c6d5f3;
}

.split {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 16px;
}

.list {
  display: grid;
  gap: 10px;
}

.list-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: white;
  display: grid;
  gap: 8px;
}

.list-item.highlight {
  border-color: #f2b94b;
  background: #fffaf0;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tabs button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #075f56;
}

.portal {
  max-width: 1060px;
  margin: 0 auto;
  padding: 22px;
  display: grid;
  gap: 16px;
}

.portal-header {
  background: #18202a;
  color: white;
  border-radius: 8px;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.portal-header h1 {
  margin: 0 0 5px;
  font-size: 22px;
}

.portal-header .muted {
  color: #c6ced9;
}

.progress-bar {
  height: 10px;
  width: 220px;
  background: #334050;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: #20b2a3;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 32, 42, 0.42);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 10;
}

.modal {
  width: min(720px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.sample-preview img,
.sample-preview video,
.sample-preview iframe {
  display: block;
  width: 100%;
  max-height: 420px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f8fa;
  object-fit: contain;
}

.sample-preview iframe {
  min-height: 380px;
}

.timeline {
  position: relative;
  display: grid;
  gap: 10px;
}

.timeline-event {
  border-left: 3px solid var(--accent);
  padding: 8px 0 8px 12px;
  background: white;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  background: white;
}

.file-input {
  display: grid;
  gap: 8px;
}

.ircc-page {
  min-height: 100vh;
  background: #fff;
  color: #17191d;
  font-family: Arial, Helvetica, sans-serif;
}

.gc-header {
  background: white;
  border-bottom: 1px solid #d7d7d7;
}

.gc-inner {
  max-width: 1440px;
  margin: 0 auto;
  min-height: 68px;
  padding: 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.gc-brand {
  display: flex;
  align-items: center;
  gap: 28px;
  color: #111;
  font-size: 20px;
  line-height: 1.05;
}

.gc-flag {
  width: 76px;
  height: 40px;
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  border: 1px solid #efefef;
  background: white;
}

.gc-flag span {
  background: #e3262e;
}

.gc-flag::before {
  content: "";
}

.gc-language {
  border: 0;
  background: transparent;
  color: #333;
  font-size: 18px;
  font-weight: 700;
  flex: 0 0 auto;
  white-space: nowrap;
}

.ircc-session a {
  white-space: nowrap;
}

.gc-rule {
  height: 4px;
  background: #273d78;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.gc-tabs {
  height: 74px;
  background: #fff;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: end;
  padding-left: max(24px, calc((100vw - 1440px) / 2 + 34px));
}

.gc-tabs span {
  display: inline-flex;
  align-items: center;
  height: 50px;
  padding: 0 2px;
  font-size: 17px;
  font-weight: 700;
  border-bottom: 6px solid #71c5c3;
}

.ircc-session {
  max-width: 1440px;
  margin: 28px auto 0;
  padding: 0 34px;
  display: flex;
  justify-content: flex-end;
  gap: 26px;
  font-size: 16px;
}

.ircc-session a {
  color: #2f4f88;
  text-decoration: none;
  font-weight: 700;
}

.ircc-main {
  max-width: 1440px;
  margin: 52px auto 0;
  padding: 0 34px 64px;
}

.my-apps h1,
.ircc-content h1 {
  margin: 0 0 28px;
  color: #17191d;
  font-size: 30px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: 0;
}

.ircc-filters {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
}

.ircc-filters label {
  color: #17191d;
  font-size: 16px;
  font-weight: 700;
}

.ircc-filters select,
.ircc-search-row select {
  height: 48px;
  border: 1px solid #8d8d8d;
  border-radius: 5px;
  background: white;
  color: #555;
  font-size: 16px;
  padding: 0 44px 0 12px;
}

.ircc-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: #08194b;
  font-size: 16px;
  line-height: 1.45;
}

.ircc-table th,
.ircc-table td {
  border: 1px solid #dedede;
  padding: 18px 16px;
  text-align: left;
  vertical-align: middle;
}

.ircc-table th {
  background: #fafafa;
  color: #071648;
  font-size: 16px;
  font-weight: 800;
}

.ircc-category-row td {
  background: #f2f4f7;
  color: #071648;
  font-weight: 800;
  font-size: 15px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.applications-table th:nth-child(1) {
  width: 20%;
}

.applications-table th:nth-child(2) {
  width: 18%;
}

.applications-table th:nth-child(3),
.applications-table th:nth-child(4),
.applications-table th:nth-child(5) {
  width: 16%;
}

.applications-table th:nth-child(6) {
  width: 22%;
}

.forms-table th:nth-child(1),
.upload-table th:nth-child(1) {
  width: 24%;
}

.forms-table th:nth-child(3) {
  width: 18%;
}

.forms-table th:nth-child(4),
.upload-table th:nth-child(4) {
  width: 16%;
}

.upload-table th:nth-child(3) {
  width: 36%;
}

.ircc-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ircc-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  min-height: 36px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 15px;
  color: #17191d;
  background: white;
  border: 2px solid #e58335;
}

.ircc-status.not-started {
  border-color: #9b9b9b;
  background: #f6f6f6;
}

.ircc-status.complete {
  border-color: #21885b;
  background: #e4f7ee;
}

.ircc-status.progress {
  border-color: #2f4f88;
  background: #edf3ff;
}

.ircc-status.revision {
  border-color: #b42318;
  background: #fff3f2;
}

.required-star,
.required-text,
.revision-note {
  color: #a42026;
}

.revision-note {
  margin: 14px 0 0;
  font-size: 18px;
}

.ircc-disclaimer {
  color: #555;
  margin-top: 20px;
  font-size: 14px;
}

.ircc-workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 38px;
  padding: 0 32px 70px 0;
}

.ircc-side {
  border-left: 4px solid #a9a9a9;
  padding: 20px 16px 0 28px;
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: calc(100vh - 72px);
}

.ircc-side h2 {
  margin: 0;
  font-size: 20px;
  color: #17191d;
}

.ircc-side a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #17191d;
  text-decoration: none;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 700;
}

.ircc-side a small {
  display: block;
  margin-top: 3px;
  color: #5e6674;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 600;
}

.ircc-side a.active {
  color: #071648;
}

.portal-nav-primary {
  padding: 10px 8px;
  border-left: 3px solid transparent;
}

.portal-nav-primary.active {
  border-left-color: #2f4f88;
  background: #f2f5fa;
}

.portal-nav-primary strong {
  display: block;
  font-size: 17px;
}

.portal-section-links {
  display: grid;
  gap: 3px;
  margin: -4px 0 4px 14px;
  padding-left: 14px;
  border-left: 1px solid #d7dce5;
}

.portal-section-category {
  display: grid;
  gap: 2px;
  margin: 4px 0 8px;
}

.portal-section-category > span {
  color: #667085;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

.ircc-side .portal-section-link {
  min-height: 34px;
  padding: 5px 4px;
  color: #4e596c;
  font-size: 14px;
  font-weight: 600;
}

.ircc-side .portal-section-link.active {
  color: #071648;
  font-weight: 750;
}

.back-link {
  color: #2f4f88 !important;
  font-size: 16px !important;
}

.step-dot {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid #d3d3d3;
  background: #f7f7f7;
  color: #555;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex: 0 0 auto;
}

.progress-card {
  margin-top: 22px;
  border-top: 1px solid #ddd;
  padding-top: 18px;
  color: #555;
  display: grid;
  gap: 8px;
}

.progress-card .progress-bar {
  width: 100%;
  background: #e8e8e8;
}

.ircc-content {
  padding-top: 30px;
  min-width: 0;
}

.ircc-content h1 {
  margin-bottom: 22px;
}

.section-return-link {
  display: inline-block;
  margin-bottom: 20px;
  color: #2f4f88;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.ircc-lead {
  max-width: 920px;
  font-size: 16px;
  line-height: 1.55;
  margin: 0 0 30px;
  color: #17191d;
}

.ircc-section-heading {
  margin: 34px 0 14px;
  font-size: 24px;
  color: #17191d;
}

.ircc-inline-form {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.ircc-inline-form h2 {
  font-size: 24px;
  margin: 0 0 12px;
}

.ircc-inline-form p {
  max-width: 820px;
  font-size: 16px;
  line-height: 1.55;
  color: #555;
}

.questionnaire {
  display: grid;
  gap: 20px;
}

.question-group {
  border: 1px solid #dedede;
  border-radius: 6px;
  background: #fff;
  padding: 20px;
}

.question-group h3 {
  margin: 0 0 18px;
  color: #071648;
  font-size: 18px;
  line-height: 1.25;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.question-field {
  position: relative;
  display: grid;
  gap: 8px;
  color: #17191d;
  font-size: 16px;
  line-height: 1.3;
}

.question-field.full {
  grid-column: 1 / -1;
}

.question-field > input,
.question-field > select,
.question-field > textarea,
.question-field .checkbox-line {
  width: 100%;
}

.question-field small {
  color: #666;
  font-size: 15px;
  line-height: 1.35;
}

.question-field em {
  color: #a42026;
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
  margin-left: 8px;
}

.question-field.is-hidden {
  display: none;
}

.repeat-group-block {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.repeat-group-block.is-hidden,
.repeat-instance.is-hidden,
.add-repeat.is-hidden {
  display: none;
}

.repeat-instance {
  border-top: 1px solid #dedede;
  padding-top: 18px;
}

.repeat-instance h4 {
  margin: 0 0 14px;
  font-size: 20px;
  color: #17191d;
}

.add-repeat {
  width: fit-content;
  min-height: 46px;
  border-color: #2f4f88;
  color: #2f4f88;
  background: #fff;
  font-weight: 650;
}

.questionnaire > .full:last-child {
  display: flex;
  justify-content: flex-end;
}

.save-message {
  margin: 0 0 18px;
  border: 1px solid #9bd2b7;
  background: #e8f7ef;
  color: #155f3b;
  border-radius: 6px;
  padding: 14px 16px;
  font-size: 18px;
  font-weight: 700;
}

.portal-task-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ircc-secondary,
.ircc-icon-button {
  min-height: 42px;
  border: 1px solid #2f4f88;
  border-radius: 5px;
  background: white;
  color: #233f72;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 700;
}

.ircc-icon-button {
  width: 42px;
  padding: 0;
  border-color: #b42318;
  color: #b42318;
  font-size: 22px;
}

.reuse-file {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-left: 3px solid #21885b;
  background: #eef9f3;
  color: #174d36;
  overflow-wrap: anywhere;
}

.reuse-file span,
.reuse-file small {
  color: #41534a;
}

.file-name {
  overflow-wrap: anywhere;
}

.additional-name {
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
}

.additional-name input {
  width: 100%;
  min-width: 0;
  height: 42px;
  font-size: 15px;
}

.ircc-search-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 30px;
  max-width: 720px;
}

.ircc-search-row select {
  min-width: 520px;
  height: 52px;
  font-size: 16px;
}

.search-icon {
  font-size: 24px;
  color: #111;
}

.review-finish {
  max-width: 980px;
}

.review-progress {
  max-width: 680px;
  margin: 0 0 26px;
  display: grid;
  gap: 8px;
}

.review-progress .progress-bar {
  width: 100%;
  height: 10px;
  background: #e6e9ee;
  border-radius: 99px;
  overflow: hidden;
}

.review-progress .progress-bar span {
  display: block;
  height: 100%;
  background: #21885b;
}

.finish-actions {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid #d9dee7;
}

.collection-submitted {
  display: grid;
  gap: 6px;
  max-width: 680px;
  border-left: 4px solid #21885b;
  background: #eef9f3;
  padding: 16px 18px;
}

.reminder-timeline {
  display: grid;
  gap: 18px;
}

.reminder-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.reminder-block h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.reminder-block ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.consultant-note {
  background: #f7fbff;
  border-color: #c7d8f3;
}

.compact-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.content-list {
  margin-top: 16px;
}

.content-editor {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

.content-editor h3 {
  margin: 10px 0 0;
  font-size: 17px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.summary-strip > div {
  min-width: 0;
  padding: 16px 18px;
  display: grid;
  gap: 5px;
  border-right: 1px solid var(--line);
}

.summary-strip > div:last-child {
  border-right: 0;
}

.summary-strip span {
  color: var(--muted);
  font-size: 12px;
}

.summary-strip strong {
  font-size: 24px;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(220px, 320px) auto auto;
  gap: 12px;
  align-items: end;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.progress-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 14px 0 6px;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e9edf3;
}

.progress-track span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.snapshot-item,
.case-type-config,
.config-create-panel,
.danger-zone {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.snapshot-item summary,
.case-type-config summary,
.config-create-panel summary,
.danger-zone summary {
  padding: 12px 14px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
}

.snapshot-item summary,
.case-type-config summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.snapshot-item summary span,
.case-type-config summary span {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
}

.snapshot-item dl {
  padding: 0 14px 14px;
  margin: 0;
  display: grid;
  gap: 8px;
}

.snapshot-item dl > div {
  display: grid;
  grid-template-columns: minmax(100px, 0.8fr) 1.2fr;
  gap: 8px;
}

.snapshot-item dt {
  color: var(--muted);
  text-transform: capitalize;
}

.snapshot-item dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.content-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: white;
  padding: 0 18px;
}

.content-tabs button {
  border: 0;
  border-radius: 0;
  border-bottom: 3px solid transparent;
  padding: 14px 16px 11px;
  background: transparent;
  color: var(--muted);
}

.content-tabs button.active {
  border-bottom-color: var(--accent);
  color: var(--ink);
  font-weight: 700;
}

.config-create-panel {
  margin-bottom: 16px;
}

.config-create-panel form,
.danger-zone > :not(summary) {
  margin: 0 14px 14px;
}

.selected-config-form {
  margin-top: 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.case-type-config-list {
  display: grid;
  gap: 10px;
}

.case-type-config form {
  padding: 4px 14px 16px;
  display: grid;
  gap: 16px;
}

fieldset {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

legend {
  padding: 0 6px;
  font-weight: 700;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 14px;
}

.check-grid label span {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink);
}

.check-grid input {
  width: auto;
  margin-top: 2px;
}

.config-doc-group + .config-doc-group {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 10px;
}

.config-doc-group h4 {
  margin: 0 0 10px;
}

.table-scroll {
  overflow-x: auto;
}

.requirement-editor {
  min-width: 980px;
}

.requirement-editor textarea {
  min-width: 220px;
  min-height: 66px;
}

.file-name {
  display: inline-block;
  max-width: 220px;
  overflow-wrap: anywhere;
}

.form-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 14px;
}

.inline-filter {
  display: flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
}

.inline-filter select {
  min-width: 180px;
}

.handoff-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.file-action {
  display: inline-flex;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 12px;
  color: var(--ink);
  cursor: pointer;
}

.file-action input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.notice p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.warning-notice {
  background: var(--warn-soft);
  border-color: #f0ca86;
}

.danger-zone {
  margin-top: 16px;
  border-color: #f3b8b4;
  background: #fffafa;
}

.full-span {
  grid-column: 1 / -1;
}

.acceptance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.acceptance-grid > div {
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  display: grid;
  gap: 5px;
}

.acceptance-grid span {
  color: var(--muted);
  line-height: 1.45;
}

.empty-state {
  max-width: 680px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid #9bd2b7;
  border-radius: 8px;
  background: #e8f7ef;
  color: #155f3b;
  padding: 12px 16px;
  box-shadow: 0 12px 32px rgba(24, 32, 42, 0.18);
  font-weight: 650;
}

.toast.danger {
  border-color: #f3b8b4;
  background: var(--danger-soft);
  color: var(--danger);
}

.section-config-item {
  gap: 14px;
}

.section-config-heading {
  display: grid;
  gap: 4px;
}

.field-config-list {
  display: grid;
  gap: 8px;
}

.field-config,
.add-field-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfe;
}

.field-config {
  transition: border-color 120ms ease, background 120ms ease, opacity 120ms ease;
}

.field-config.is-dragging {
  opacity: 0.45;
}

.field-config.is-drag-over {
  border-color: #1b7f75;
  background: #edf8f6;
}

.field-config summary,
.add-field-panel summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
}

.field-config summary span {
  color: var(--muted);
  font-weight: 500;
  margin-left: 8px;
}

.field-config summary .drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0 8px 0 0;
  color: #526176;
  border: 1px solid #cdd7e4;
  border-radius: 4px;
  background: #fff;
  cursor: grab;
  user-select: none;
}

.field-config summary .drag-handle:active {
  cursor: grabbing;
}

.field-config form,
.add-field-panel form {
  margin-top: 12px;
}

.config-filter {
  align-items: end;
  margin: 12px 0 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.advanced-config {
  grid-column: 1 / -1;
  padding-top: 6px;
}

.advanced-config summary {
  color: var(--muted);
  font-weight: 650;
  cursor: pointer;
}

.advanced-config .form-grid {
  margin-top: 12px;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .caq-wizard-summary dl div,
  .case-intake-summary dl div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.two,
  .grid.three,
  .split,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .summary-strip,
  .snapshot-grid,
  .acceptance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .staff-layout,
  .account-grid {
    grid-template-columns: 1fr;
  }

  .staff-create-panel {
    position: static;
  }

  .staff-edit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-bar {
    grid-template-columns: 1fr 1fr;
  }

  .check-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .question-grid {
    grid-template-columns: 1fr;
  }

  .gc-inner,
  .ircc-session,
  .ircc-main {
    padding-left: 18px;
    padding-right: 18px;
  }

  .ircc-workspace {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 0 18px 48px;
  }

  .ircc-side {
    border-left: 0;
    border-bottom: 1px solid #ddd;
    min-height: 0;
    padding: 18px 0;
  }

  .ircc-side a {
    font-size: 16px;
  }

  .ircc-content .ircc-table,
  .my-apps .ircc-table {
    display: block;
    border: 0;
    overflow: visible;
    white-space: normal;
  }

  .ircc-content .ircc-table thead,
  .my-apps .ircc-table thead {
    display: none;
  }

  .ircc-content .ircc-table tbody,
  .my-apps .ircc-table tbody {
    display: grid;
    min-width: 0;
    gap: 12px;
  }

  .ircc-content .ircc-table tr,
  .my-apps .ircc-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    border: 1px solid #d8dce2;
    background: #fff;
  }

  .ircc-content .ircc-table td,
  .my-apps .ircc-table td {
    display: block;
    width: auto !important;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #e6e8ec;
    overflow-wrap: anywhere;
  }

  .ircc-content .ircc-table td:last-child,
  .my-apps .ircc-table td:last-child {
    border-bottom: 0;
  }

  .ircc-content .ircc-table .ircc-category-row,
  .my-apps .ircc-table .ircc-category-row {
    border: 0;
    margin-top: 6px;
  }

  .ircc-content .ircc-table .ircc-category-row td,
  .my-apps .ircc-table .ircc-category-row td {
    border: 0;
    padding: 9px 12px;
  }

  .portal-task-actions {
    align-items: stretch;
  }

  .portal-task-actions button,
  .portal-task-actions .ircc-upload-button,
  .portal-task-actions .portal-drop-zone {
    width: 100%;
  }

  .my-apps h1,
  .ircc-content h1 {
    font-size: 30px;
  }

  .ircc-search-row {
    align-items: stretch;
  }

  .ircc-search-row select {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .auth-page {
    align-items: start;
    padding: 14px;
  }

  .auth-panel {
    padding: 22px 18px;
  }

  .content,
  .portal {
    padding: 14px;
  }

  .topbar {
    padding: 12px 14px;
    align-items: flex-start;
    flex-direction: column;
  }

  .sidebar {
    padding: 14px;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
  }

  .brand {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: 4px;
  }

  .nav {
    display: flex;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .caq-wizard-heading {
    flex-direction: column;
    gap: 8px;
  }

  .summary-strip,
  .snapshot-grid,
  .acceptance-grid,
  .filter-bar,
  .check-grid {
    grid-template-columns: 1fr;
  }

  .summary-strip > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary-strip > div:last-child {
    border-bottom: 0;
  }

  .content-tabs {
    overflow-x: auto;
    padding: 0 8px;
  }

  .content-tabs button {
    white-space: nowrap;
  }

  .gc-inner {
    gap: 12px;
  }

  .gc-brand {
    gap: 12px;
  }

  .gc-brand strong {
    font-size: 17px;
  }

  .gc-flag {
    width: 56px;
    height: 32px;
  }

  .ircc-session {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .ircc-content {
    padding-top: 20px;
  }

  .ircc-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 0;
  }

  .ircc-side .back-link {
    grid-column: 1 / -1;
  }

  .ircc-side h2,
  .portal-section-links,
  .progress-card {
    display: none;
  }

  .portal-nav-primary {
    min-height: 54px;
    margin: 0;
    padding: 9px 10px;
  }

  .portal-nav-primary strong {
    font-size: 14px;
  }

  .portal-nav-primary small {
    display: none;
  }

  .top-actions,
  .top-actions label,
  .top-actions select {
    width: 100%;
  }

  .staff-identity {
    width: 100%;
    padding: 0 0 9px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .staff-edit-grid {
    grid-template-columns: 1fr;
  }

  .staff-account-actions > button,
  .staff-account-actions label {
    width: 100%;
  }

  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

.section-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  background: #f7f9fc;
}

.rule-scope-picker {
  align-items: end;
  margin: 16px 0 22px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #f7f9fc;
}

.rule-version-actions {
  align-self: end;
  margin: 0;
}

.validation-errors {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-left: 4px solid #b42318;
  background: #fff1f0;
  color: #8a1c13;
}

.validation-errors ul {
  margin: 8px 0 0;
  padding-left: 22px;
}

.plain-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.plain-fieldset:disabled {
  opacity: .72;
}

.section-picker label {
  margin: 0;
}

.question-order-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.caq-rule-admin {
  margin: 18px 0 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.caq-answer-rules {
  margin: 18px 0;
}

.caq-answer-rule,
.config-selection-group {
  margin: 10px 0;
  border: 1px solid var(--line);
  background: #fff;
}

.caq-answer-rule > summary,
.config-selection-group > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
}

.caq-answer-rule > label,
.caq-answer-rule > .config-selection-group,
.config-selection-group > .check-grid {
  margin: 0 14px 14px;
}

.config-selection-group > summary span,
.caq-answer-rule > summary span {
  color: var(--muted);
  font-weight: 500;
}

.caq-answer-rule > h5 {
  margin: 16px 14px 8px;
}

.config-selection-subgroup {
  margin: 0 14px 12px;
  border-top: 1px solid var(--line);
}

.config-selection-subgroup > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  cursor: pointer;
  font-weight: 650;
}

.config-selection-subgroup > summary span {
  color: var(--muted);
  font-weight: 500;
}

.create-case-information {
  margin-bottom: 24px;
}

.generated-task-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 8px 0 12px;
}

.generated-task-count strong {
  color: #17356b;
  font-size: 26px;
}

.manual-task-adjustment {
  border: 1px solid var(--line);
  background: #f7f9fc;
}

.manual-task-adjustment > summary {
  padding: 13px 16px;
  cursor: pointer;
  font-weight: 700;
}

.manual-task-adjustment > p,
.manual-task-adjustment > .config-selection-group {
  margin-right: 16px;
  margin-left: 16px;
}

.create-info-section {
  padding: 0 14px 12px;
}

.create-info-section h4 {
  margin: 8px 0;
}

.create-info-section [data-create-info-row].is-recommended {
  background: #edf4ff;
}

[data-sample-file] small,
[data-sample-url] small {
  display: block;
  margin-top: 7px;
}

@media (max-width: 760px) {
  .section-picker {
    grid-template-columns: 1fr;
  }
}
