:root {
  --yellow: #f2c50f;
  --yellow-soft: #fff7cf;
  --green: #127940;
  --green-dark: #194f25;
  --green-pale: #e9f4e4;
  --red: #ba4222;
  --red-pale: #fff0eb;
  --leaf: #8dbb66;
  --surface: #ffffff;
  --canvas: #f3f5fb;
  --ink: #173026;
  --muted: #617269;
  --line: #dce4df;
  --line-strong: #c1cec6;
  --blue: #1779be;
  --blue-pale: #e8f4fc;
  --shadow-sm: 0 2px 7px rgba(25, 79, 37, .08);
  --shadow-md: 0 14px 38px rgba(25, 79, 37, .14);
  --shadow-lg: 0 28px 80px rgba(19, 48, 38, .24);
  --radius-sm: .55rem;
  --radius: .9rem;
  --radius-lg: 1.35rem;
  --focus: 0 0 0 3px rgba(242, 197, 15, .5);
  --content: 1220px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

*, *::before, *::after { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; }
img, svg { display: block; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--green-dark); line-height: 1.15; letter-spacing: -.025em; }

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

.skip-link {
  position: fixed;
  z-index: 1000;
  top: .75rem;
  left: .75rem;
  padding: .65rem 1rem;
  color: #fff;
  background: var(--green-dark);
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
  transition: transform .15s ease;
}

.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 2px solid var(--green-dark);
  outline-offset: 2px;
  box-shadow: var(--focus);
}

.eyebrow {
  margin-bottom: .45rem;
  color: var(--green);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.eyebrow--light { color: #fbe986; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  text-decoration: none;
}

.brand__mark { flex: 0 0 auto; border-radius: 28%; }
.brand__name { display: block; margin: 0; font-size: 1.35rem; font-weight: 850; line-height: 1.05; letter-spacing: -.04em; }
.brand__product { display: block; margin: .2rem 0 0; font-size: .8rem; opacity: .74; }
.brand--light { color: #fff; }
.brand--light .brand__name { color: #fff; font-size: 1.7rem; }
.brand--compact .brand__mark { width: 44px; height: 44px; }
.brand--compact .brand__name { color: var(--green-dark); }

.button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .65rem 1.05rem;
  color: var(--green-dark);
  background: transparent;
  border: 1px solid transparent;
  border-radius: .7rem;
  font-weight: 750;
  line-height: 1.1;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .12s ease, box-shadow .15s ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { opacity: .55; }
.button--primary { color: var(--green-dark); background: var(--yellow); border-color: #dab000; box-shadow: 0 3px 0 #c9a300; }
.button--primary:hover:not(:disabled) { background: #ffda30; box-shadow: 0 4px 0 #c9a300; }
.button--secondary { color: var(--green-dark); background: #fff; border-color: var(--line-strong); }
.button--secondary:hover:not(:disabled) { color: var(--green); background: var(--green-pale); border-color: var(--leaf); }
.button--quiet { color: var(--green-dark); background: transparent; }
.button--quiet:hover:not(:disabled) { background: rgba(25, 79, 37, .08); }
.button--danger-quiet { color: var(--red); }
.button--danger-quiet:hover:not(:disabled) { background: var(--red-pale); }
.button--compact { min-height: 2.35rem; padding: .5rem .75rem; font-size: .88rem; }
.button--large { min-height: 3.15rem; }
.button--full { width: 100%; }
.button--icon { width: 2.7rem; min-height: 2.7rem; padding: .45rem; border-radius: 50%; }
.button svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.spinner {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.spinner--large { width: 2rem; height: 2rem; border-width: 3px; color: var(--green); }
[hidden] { display: none !important; }
@keyframes spin { to { transform: rotate(360deg); } }

.stack > * + * { margin-top: 1.1rem; }

.field { min-width: 0; }
.field label {
  display: block;
  margin-bottom: .4rem;
  color: var(--green-dark);
  font-size: .88rem;
  font-weight: 720;
}

.field small { display: block; margin-top: .35rem; color: var(--muted); font-size: .76rem; }
.optional { color: var(--muted); font-weight: 500; }

input, select, textarea {
  width: 100%;
  min-height: 2.85rem;
  padding: .65rem .78rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: .65rem;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

textarea { min-height: 5.5rem; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #90a49a; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(18, 121, 64, .14); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 3px rgba(186, 66, 34, .12); }
input:disabled, select:disabled, textarea:disabled { color: #75837b; background: #edf1ee; }
.field__error { min-height: 1.15rem; margin: .25rem 0 0; color: var(--red); font-size: .78rem; }

.message {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .8rem 1rem;
  color: #0b5630;
  background: var(--green-pale);
  border: 1px solid #b9dca8;
  border-radius: .7rem;
  font-size: .9rem;
}

.message--error { color: #812d17; background: var(--red-pale); border-color: #edb5a5; }
.message--warning { color: #684f00; background: var(--yellow-soft); border-color: #ecd874; }
.message strong { display: block; }

.noscript {
  position: fixed;
  z-index: 2000;
  inset: auto 1rem 1rem;
  margin: 0;
  padding: 1rem;
  color: #fff;
  background: var(--red);
  border-radius: var(--radius);
  text-align: center;
}

/* Login */
.login-page { background: #fff; }
.login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(390px, .9fr) minmax(470px, 1.1fr); }
.login-intro {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(2rem, 6vw, 5rem);
  color: #fff;
  background: var(--green-dark);
}

.login-intro::before, .login-intro::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.login-intro::before { width: 25rem; height: 25rem; right: -12rem; bottom: -7rem; background: rgba(141, 187, 102, .22); }
.login-intro::after { width: 12rem; height: 12rem; right: 8%; top: 22%; border: 2.5rem solid rgba(242, 197, 15, .08); }
.login-intro > * { position: relative; z-index: 1; }
.login-intro__content { max-width: 36rem; margin: 4rem 0; }
.login-intro__content h1 { max-width: 32rem; margin-bottom: 1.4rem; color: #fff; font-size: clamp(2.25rem, 5vw, 4.5rem); line-height: 1.01; }
.login-intro__content > p:last-child { max-width: 30rem; margin: 0; color: #d9eadc; font-size: 1.06rem; }
.feature-list { display: grid; max-width: 35rem; gap: .7rem; margin: 0; padding: 0; list-style: none; }
.feature-list li { display: flex; align-items: center; gap: .75rem; color: #e5f1e7; font-size: .92rem; }
.feature-list__icon { display: grid; width: 2rem; height: 2rem; place-items: center; color: var(--green-dark); background: var(--yellow); border-radius: 50%; font-size: .65rem; font-weight: 850; }
.login-panel { display: grid; align-content: center; justify-items: center; padding: 2rem; background: #fff; }
.login-card { width: min(100%, 27rem); padding: clamp(1.5rem, 4vw, 2.5rem); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.login-card__heading { margin-bottom: 1.7rem; }
.login-card__heading h2 { margin-bottom: .55rem; font-size: 2rem; }
.login-card__heading > p:last-child { margin: 0; color: var(--muted); }
.password-field { position: relative; }
.password-field input { padding-right: 3.2rem; }
.password-field .button { position: absolute; top: .08rem; right: .08rem; }
.security-note { display: flex; gap: .7rem; margin-top: 1.45rem; padding-top: 1.2rem; color: var(--muted); border-top: 1px solid var(--line); font-size: .78rem; }
.security-note svg { flex: 0 0 auto; fill: none; stroke: var(--green); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.security-note p { margin: 0; }
.login-footer { margin: 1.35rem 0 0; color: var(--muted); font-size: .78rem; text-align: center; }

/* Header and page */
.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem max(1rem, calc((100% - var(--content)) / 2));
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar__actions { display: flex; align-items: center; gap: .75rem; }
.network-state { display: inline-flex; align-items: center; gap: .4rem; padding: .28rem .55rem; color: var(--green); background: var(--green-pale); border-radius: 99px; font-size: .75rem; font-weight: 700; }
.network-state__dot { width: .48rem; height: .48rem; background: var(--green); border-radius: 50%; }
.network-state--offline { color: var(--red); background: var(--red-pale); }
.network-state--offline .network-state__dot { background: var(--red); }
.account { display: flex; align-items: center; gap: .5rem; max-width: 18rem; padding: .3rem .65rem .3rem .35rem; background: var(--canvas); border-radius: 99px; }
.account__avatar { display: grid; width: 1.8rem; height: 1.8rem; flex: 0 0 auto; place-items: center; color: #fff; background: var(--green); border-radius: 50%; font-size: .72rem; font-weight: 800; }
.account__email { overflow: hidden; font-size: .78rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.admin-main { width: min(calc(100% - 2rem), var(--content)); margin: 0 auto; padding: clamp(1.8rem, 4vw, 3.2rem) 0 4rem; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.page-heading h1 { margin-bottom: .5rem; font-size: clamp(2rem, 4vw, 3rem); }
.page-heading > div > p:last-child { max-width: 43rem; margin: 0; color: var(--muted); }
.admin-main > .message { margin-bottom: 1.2rem; }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.summary-card { display: flex; min-width: 0; align-items: center; gap: .85rem; padding: 1.05rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.summary-card__icon { display: grid; width: 2.65rem; height: 2.65rem; flex: 0 0 auto; place-items: center; border-radius: .75rem; }
.summary-card__icon svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.summary-card__label { display: block; overflow: hidden; color: var(--muted); font-size: .74rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.summary-card__value { display: block; margin-top: .05rem; color: var(--green-dark); font-size: 1.5rem; line-height: 1.15; }
.summary-card--attention .summary-card__icon { color: #6f5600; background: var(--yellow-soft); }
.summary-card--processing .summary-card__icon { color: #12669d; background: var(--blue-pale); }
.summary-card--success .summary-card__icon { color: var(--green); background: var(--green-pale); }
.summary-card--danger .summary-card__icon { color: var(--red); background: var(--red-pale); }

.documents-panel { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.35rem 1.5rem 1rem; }
.panel-heading h2 { margin-bottom: .25rem; font-size: 1.25rem; }
.panel-heading p { margin: 0; color: var(--muted); font-size: .82rem; }
.filters { display: flex; align-items: end; gap: .8rem; padding: 0 1.5rem 1.25rem; border-bottom: 1px solid var(--line); }
.filters .search-field { flex: 1 1 23rem; }
.filters .field--inline { flex: 0 1 14rem; }
.search-field { position: relative; }
.search-field svg { position: absolute; top: 50%; left: .8rem; color: var(--muted); fill: none; stroke: currentColor; stroke-width: 2; transform: translateY(-50%); }
.search-field input { padding-left: 2.5rem; }
.table-wrap { overflow-x: auto; }
.documents-table { width: 100%; border-collapse: collapse; }
.documents-table th { padding: .7rem 1rem; color: var(--muted); background: #f8faf8; border-bottom: 1px solid var(--line); font-size: .7rem; font-weight: 800; letter-spacing: .045em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.documents-table td { padding: .95rem 1rem; border-bottom: 1px solid var(--line); font-size: .86rem; vertical-align: middle; }
.documents-table tbody tr { transition: background-color .15s ease; }
.documents-table tbody tr:hover { background: #fbfcfb; }
.documents-table tbody tr:last-child td { border-bottom: 0; }
.document-cell { display: flex; min-width: 18rem; align-items: center; gap: .75rem; }
.document-cell__icon { display: grid; width: 2.5rem; height: 2.8rem; flex: 0 0 auto; place-items: center; color: #fff; background: var(--red); border-radius: .4rem; font-size: .6rem; font-weight: 850; }
.document-cell__text { min-width: 0; }
.document-cell__text strong { display: block; max-width: 29rem; overflow: hidden; color: var(--green-dark); text-overflow: ellipsis; white-space: nowrap; }
.document-cell__text span { display: block; max-width: 28rem; margin-top: .13rem; overflow: hidden; color: var(--muted); font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.date-cell { min-width: 9.5rem; color: var(--muted); white-space: nowrap; }
.status-badge { display: inline-flex; align-items: center; gap: .35rem; width: max-content; padding: .28rem .58rem; color: var(--muted); background: #edf1ef; border-radius: 99px; font-size: .7rem; font-weight: 780; white-space: nowrap; }
.status-badge::before { content: ""; width: .42rem; height: .42rem; background: currentColor; border-radius: 50%; }
.status-badge--pending { color: #715700; background: var(--yellow-soft); }
.status-badge--processing { color: #12669d; background: var(--blue-pale); }
.status-badge--completed { color: #0b6a37; background: var(--green-pale); }
.status-badge--failed { color: #9c3218; background: var(--red-pale); }
.status-badge--neutral { color: var(--muted); background: #edf1ef; }
.review-cell { color: var(--muted); white-space: nowrap; }
.row-action { margin-left: auto; }
.panel-footer { display: flex; min-height: 3.3rem; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem 1.5rem; color: var(--muted); background: #fbfcfb; border-top: 1px solid var(--line); font-size: .74rem; }
.loading-list { display: grid; gap: .7rem; padding: 1.2rem 1.5rem 1.7rem; }
.loading-list span { height: 3.8rem; overflow: hidden; background: linear-gradient(90deg, #edf1ef 20%, #f8faf8 40%, #edf1ef 60%); background-size: 300% 100%; border-radius: .6rem; animation: skeleton 1.35s ease infinite; }
@keyframes skeleton { to { background-position: -150% 0; } }
.empty-state { display: grid; justify-items: center; padding: 3rem 1rem; text-align: center; }
.empty-state__illustration { display: grid; width: 5rem; height: 5rem; place-items: center; margin-bottom: .85rem; color: var(--leaf); background: var(--green-pale); border-radius: 50%; }
.empty-state__illustration svg { width: 3.2rem; height: 3.2rem; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.empty-state h3 { margin-bottom: .35rem; }
.empty-state p { margin-bottom: 1.2rem; color: var(--muted); }

/* Dialogs and upload */
.modal {
  width: min(calc(100% - 2rem), 38rem);
  max-width: none;
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal[open] { animation: modal-in .18s ease both; }
.modal::backdrop { background: rgba(10, 34, 24, .6); backdrop-filter: blur(3px); }
.modal--wide { width: min(calc(100% - 2rem), 76rem); }
.modal__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.4rem 1.5rem 1rem; border-bottom: 1px solid var(--line); }
.modal__header h2 { margin: 0; font-size: 1.45rem; }
.modal__header--sticky { position: sticky; z-index: 4; top: 0; background: #fff; }
.modal__body { padding: 1.4rem 1.5rem; }
.modal__actions { display: flex; justify-content: flex-end; gap: .65rem; padding-top: .3rem; }
@keyframes modal-in { from { opacity: 0; transform: translateY(.6rem) scale(.985); } }

.drop-zone { display: grid; min-height: 13rem; place-items: center; align-content: center; gap: .35rem; padding: 1.5rem; color: var(--green-dark); background: #fafcf9; border: 2px dashed var(--leaf); border-radius: var(--radius); text-align: center; transition: background-color .15s ease, border-color .15s ease, transform .15s ease; }
.drop-zone:hover, .drop-zone--active { background: var(--green-pale); border-color: var(--green); }
.drop-zone--active { transform: scale(1.01); }
.drop-zone__icon { display: grid; width: 3.3rem; height: 3.3rem; place-items: center; margin-bottom: .4rem; color: var(--green); background: #fff; border-radius: 50%; box-shadow: var(--shadow-sm); }
.drop-zone__icon svg { width: 1.8rem; height: 1.8rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drop-zone span, .drop-zone small { color: var(--muted); }
.drop-zone small { margin-top: .25rem; font-size: .75rem; }
.selected-file { display: flex; align-items: center; gap: .75rem; padding: .75rem; background: var(--red-pale); border: 1px solid #efd0c8; border-radius: .75rem; }
.selected-file__icon { display: grid; width: 2.6rem; height: 2.8rem; flex: 0 0 auto; place-items: center; color: #fff; background: var(--red); border-radius: .38rem; font-size: .58rem; font-weight: 850; }
.selected-file__info { min-width: 0; flex: 1; }
.selected-file__info strong, .selected-file__info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-file__info span { color: var(--muted); font-size: .78rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .95rem 1rem; }
.form-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid__wide { grid-column: 1 / -1; }
.upload-progress__heading { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .35rem; color: var(--muted); font-size: .82rem; }
.upload-progress progress { width: 100%; height: .6rem; overflow: hidden; appearance: none; border: 0; border-radius: 99px; }
.upload-progress progress::-webkit-progress-bar { background: #e6ece8; }
.upload-progress progress::-webkit-progress-value { background: var(--green); }
.upload-progress progress::-moz-progress-bar { background: var(--green); }

/* Review */
.review-heading { min-width: 0; }
.review-heading h2 { max-width: 52rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-heading__meta { display: flex; align-items: center; gap: .7rem; margin-top: .55rem; color: var(--muted); font-size: .76rem; }
.review-loading { display: grid; min-height: 22rem; place-items: center; align-content: center; gap: .8rem; color: var(--muted); }
.review-loading p { margin: 0; }
.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; }
.review-content { min-width: 0; padding: 1.4rem 1.5rem 6.1rem; }
.review-content > .message { margin-bottom: 1rem; }
.form-section { padding: 1.2rem 0 1.5rem; border-bottom: 1px solid var(--line); }
.form-section:first-of-type { padding-top: .3rem; }
.form-section:last-child { border-bottom: 0; }
.form-section__heading, .form-section__title { display: flex; align-items: flex-start; gap: .75rem; }
.form-section__heading { margin-bottom: 1.15rem; }
.form-section__heading--action { align-items: center; justify-content: space-between; }
.form-section__heading h3 { margin: .08rem 0 .18rem; font-size: 1.05rem; }
.form-section__heading p { margin: 0; color: var(--muted); font-size: .8rem; }
.section-number { display: grid; width: 1.8rem; height: 1.8rem; flex: 0 0 auto; place-items: center; color: var(--green-dark); background: var(--yellow); border-radius: 50%; font-size: .75rem; font-weight: 850; }
.repeat-list { display: grid; gap: .65rem; }
.repeat-row { display: grid; align-items: end; gap: .65rem; padding: .75rem; background: #f8faf8; border: 1px solid var(--line); border-radius: .75rem; }
.repeat-row--creator { grid-template-columns: minmax(10rem, 1.3fr) minmax(9rem, .8fr) minmax(10rem, 1fr) auto; }
.repeat-row--identifier { grid-template-columns: minmax(8rem, .45fr) minmax(13rem, 1fr) auto; }
.repeat-row .field label { font-size: .75rem; }
.repeat-row input, .repeat-row select { min-height: 2.55rem; background: #fff; }
.repeat-empty { margin: -.2rem 0 0; padding: .8rem; color: var(--muted); background: #f8faf8; border-radius: .65rem; font-size: .82rem; text-align: center; }

.review-sidebar { padding: 1.4rem 1.1rem 6.1rem; background: #f8faf8; border-left: 1px solid var(--line); }
.document-summary, .pipeline-card { padding: 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.document-summary__type { display: block; margin-bottom: .3rem; color: var(--red); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.document-summary > strong { display: block; overflow: hidden; color: var(--green-dark); font-size: .85rem; text-overflow: ellipsis; white-space: nowrap; }
.document-summary dl { margin: .8rem 0 0; }
.document-summary dl > div { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: .4rem; padding: .35rem 0; border-top: 1px solid var(--line); font-size: .7rem; }
.document-summary dt { color: var(--muted); }
.document-summary dd { min-width: 0; margin: 0; overflow: hidden; color: var(--ink); font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pipeline-card { margin-top: .8rem; }
.pipeline-card h3 { margin-bottom: .9rem; font-size: .88rem; }
.pipeline-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.pipeline-list li { position: relative; display: grid; grid-template-columns: 1rem 1fr; gap: .6rem; min-height: 3.3rem; color: var(--muted); }
.pipeline-list li > span { position: relative; z-index: 1; width: .8rem; height: .8rem; margin-top: .18rem; background: #fff; border: 2px solid var(--line-strong); border-radius: 50%; }
.pipeline-list li:not(:last-child)::after { content: ""; position: absolute; top: .85rem; bottom: -.12rem; left: .36rem; width: 2px; background: var(--line); }
.pipeline-list strong { display: block; font-size: .76rem; }
.pipeline-list small { display: block; font-size: .67rem; }
.pipeline-list li.is-complete { color: var(--green); }
.pipeline-list li.is-complete > span { background: var(--green); border-color: var(--green); box-shadow: inset 0 0 0 2px #fff; }
.pipeline-list li.is-complete:not(:last-child)::after { background: var(--leaf); }
.pipeline-list li.is-active { color: #12669d; }
.pipeline-list li.is-active > span { background: #fff; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-pale); }
.pipeline-list li.is-failed { color: var(--red); }
.pipeline-list li.is-failed > span { background: var(--red); border-color: var(--red); }
.polling-note { display: flex; align-items: center; gap: .45rem; margin: .4rem 0 0; color: var(--blue); font-size: .68rem; }
.review-sidebar__note { display: flex; gap: .55rem; margin-top: .8rem; padding: .75rem; color: #695100; background: var(--yellow-soft); border: 1px solid #ecd874; border-radius: .75rem; font-size: .7rem; }
.review-sidebar__note svg { flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.review-sidebar__note p { margin: 0; }
.review-actions { position: absolute; z-index: 5; right: 0; bottom: 0; left: 0; display: flex; min-height: 5rem; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.5rem; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
.review-actions > div { display: flex; gap: .65rem; }
.review-actions__note { max-width: 25rem; color: var(--muted); font-size: .75rem; }

.toast-region { position: fixed; z-index: 200; right: 1rem; bottom: 1rem; display: grid; width: min(calc(100% - 2rem), 24rem); gap: .55rem; pointer-events: none; }
.toast { padding: .85rem 1rem; color: #fff; background: var(--green-dark); border-radius: .75rem; box-shadow: var(--shadow-md); font-size: .84rem; animation: toast-in .2s ease both; }
.toast--error { background: #8f3018; }
@keyframes toast-in { from { opacity: 0; transform: translateY(.5rem); } }

@media (max-width: 980px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .review-layout { grid-template-columns: 1fr; }
  .review-sidebar { padding: 1rem 1.5rem 6.2rem; border-top: 1px solid var(--line); border-left: 0; }
  .review-sidebar { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: .8rem; }
  .pipeline-card { margin-top: 0; }
  .review-sidebar__note { grid-column: 1 / -1; margin-top: 0; }
  .repeat-row--creator { grid-template-columns: 1fr 1fr auto; }
  .repeat-row--creator .field:nth-child(3) { grid-column: 1 / 3; }
}

@media (max-width: 780px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-intro { min-height: auto; padding: 1.4rem; }
  .login-intro__content { margin: 3rem 0 2rem; }
  .login-intro__content h1 { font-size: clamp(2rem, 10vw, 3.3rem); }
  .feature-list { display: none; }
  .login-panel { padding: 1.4rem; }
  .login-card { margin-top: -2.6rem; }
  .topbar { padding-inline: 1rem; }
  .network-state, .account__email { display: none; }
  .account { padding-right: .35rem; background: transparent; }
  .page-heading { align-items: flex-start; }
  .filters { flex-wrap: wrap; }
  .filters .search-field { flex-basis: 100%; }
  .filters .field--inline { flex: 1; }
  .documents-table thead { display: none; }
  .documents-table, .documents-table tbody, .documents-table tr, .documents-table td { display: block; width: 100%; }
  .documents-table tr { position: relative; padding: .9rem 4.5rem .9rem 1rem; border-bottom: 1px solid var(--line); }
  .documents-table td { padding: .16rem 0; border: 0; }
  .documents-table td:last-child { position: absolute; top: 50%; right: 1rem; transform: translateY(-50%); }
  .document-cell { min-width: 0; }
  .document-cell__text strong { white-space: normal; }
  .date-cell { padding-left: 3.25rem !important; font-size: .75rem !important; }
  .review-cell { display: none !important; }
  .documents-table .status-badge { margin-left: 3.25rem; }
  .form-grid--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-actions { align-items: flex-end; }
  .review-actions__note { display: none; }
  .review-actions > div { width: 100%; justify-content: flex-end; }
  .modal--wide { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; }
}

@media (max-width: 560px) {
  .brand--compact .brand__product { display: none; }
  .topbar__actions { gap: .15rem; }
  .topbar .button span { display: none; }
  .admin-main { width: min(calc(100% - 1rem), var(--content)); padding-top: 1.4rem; }
  .page-heading { display: grid; gap: 1rem; }
  .page-heading .button { width: 100%; }
  .summary-grid { grid-template-columns: 1fr 1fr; gap: .55rem; }
  .summary-card { align-items: flex-start; gap: .55rem; padding: .75rem; }
  .summary-card__icon { width: 2rem; height: 2rem; }
  .summary-card__icon svg { width: 1.1rem; height: 1.1rem; }
  .summary-card__label { white-space: normal; }
  .panel-heading, .filters, .panel-footer { padding-inline: .9rem; }
  .panel-heading .button span { display: none; }
  .filters .field--inline { flex-basis: 100%; }
  .filters > .button { width: 100%; }
  .modal { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .modal__body { padding-inline: 1rem; }
  .form-grid, .form-grid--three { grid-template-columns: 1fr; }
  .review-content { padding-inline: 1rem; }
  .review-sidebar { grid-template-columns: 1fr; padding-inline: 1rem; }
  .review-sidebar__note { grid-column: auto; }
  .repeat-row--creator, .repeat-row--identifier { grid-template-columns: 1fr auto; }
  .repeat-row--creator .field, .repeat-row--identifier .field { grid-column: 1; }
  .repeat-row [data-remove-row] { grid-column: 2; grid-row: 1; }
  .form-section__heading--action { align-items: flex-start; }
  .form-section__heading--action > .button span { display: none; }
  .review-actions { padding-inline: .75rem; }
  .review-actions > div { gap: .4rem; }
  .review-actions .button { padding-inline: .7rem; font-size: .78rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (prefers-contrast: more) {
  :root { --line: #788a80; --line-strong: #52665b; --muted: #405248; }
  .button, input, select, textarea { border-width: 2px; }
}
