:root {
  --page-bg: #f3f6f8;
  --surface: #ffffff;
  --surface-muted: #f7f9fa;
  --ink: #17212b;
  --muted: #5c6975;
  --border: #d6dee4;
  --border-strong: #aab8c2;
  --brand-950: #0b2635;
  --brand-900: #12394a;
  --brand-700: #075985;
  --brand-100: #dff3f8;
  --success-700: #18794e;
  --success-100: #e5f5ec;
  --warning-800: #854d0e;
  --warning-100: #fff4cf;
  --danger-700: #b42318;
  --danger-100: #fee9e7;
  --deadline-red: #b42318;
  --deadline-black: #101316;
  --focus: #f59e0b;
  --shadow: 0 1px 2px rgb(11 38 53 / 7%), 0 10px 30px rgb(11 38 53 / 5%);
  --radius: 0.75rem;
  --radius-small: 0.45rem;
  --content-width: 88rem;
}

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

html {
  min-width: 20rem;
  background: var(--page-bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 100%;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgb(223 243 248 / 35%), transparent 19rem),
    var(--page-bg);
}

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

button,
input[type="submit"] {
  cursor: pointer;
}

a {
  color: var(--brand-700);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

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

h1 {
  margin-bottom: 0.5rem;
  font-size: clamp(1.75rem, 3vw, 2.55rem);
  letter-spacing: -0.035em;
  line-height: 1.12;
}

h2 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  letter-spacing: -0.015em;
  line-height: 1.25;
}

h3 {
  margin-bottom: 0.3rem;
  font-size: 1rem;
  line-height: 1.35;
}

code {
  padding: 0.12rem 0.3rem;
  border-radius: 0.25rem;
  background: #edf1f3;
  color: #293944;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  transform: translateY(-180%);
}

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

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

.site-header {
  border-bottom: 1px solid rgb(255 255 255 / 13%);
  background: var(--brand-950);
  color: #ffffff;
}

.site-header__inner {
  display: flex;
  width: min(100% - 2rem, var(--content-width));
  min-height: 4.75rem;
  margin: 0 auto;
  align-items: center;
  gap: 1.4rem;
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.7rem;
  color: #ffffff;
  line-height: 1.05;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  width: 2.45rem;
  height: 2.45rem;
  border: 1px solid rgb(255 255 255 / 52%);
  border-radius: 0.55rem;
  background: rgb(255 255 255 / 9%);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  place-items: center;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.brand small {
  margin-top: 0.24rem;
  color: #b9d2dd;
  font-size: 0.72rem;
  font-weight: 500;
}

.main-nav {
  display: flex;
  flex: 1 1 auto;
  align-self: stretch;
  align-items: stretch;
  gap: 0.15rem;
}

.main-nav a {
  display: inline-flex;
  position: relative;
  padding: 0.75rem 0.8rem;
  align-items: center;
  border-radius: 0.35rem;
  color: #d8e7ed;
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.main-nav a:hover {
  background: rgb(255 255 255 / 8%);
  color: #ffffff;
}

.main-nav a[aria-current="page"] {
  color: #ffffff;
}

.main-nav a[aria-current="page"]::after {
  position: absolute;
  right: 0.75rem;
  bottom: 0;
  left: 0.75rem;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #67d0e8;
  content: "";
}

.account-menu {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.75rem;
}

.account-menu__identity {
  display: block;
  max-width: 13rem;
  color: #ffffff;
  font-size: 0.82rem;
  text-align: right;
}

.account-menu__identity > span,
.account-menu__identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu__identity small {
  color: #b9d2dd;
  font-size: 0.7rem;
}

.page-shell {
  width: min(100% - 2rem, var(--content-width));
  min-height: calc(100vh - 10rem);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) 0 4rem;
}

.page-heading {
  display: flex;
  margin-bottom: 1.5rem;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.page-heading > div:first-child {
  max-width: 55rem;
}

.page-heading h1 {
  margin-bottom: 0.4rem;
}

.page-lead,
.page-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.eyebrow,
.step-label {
  margin-bottom: 0.35rem !important;
  color: var(--brand-700) !important;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}

.heading-stat {
  display: grid;
  min-width: 7.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
  box-shadow: var(--shadow);
}

.heading-stat strong {
  color: var(--brand-900);
  font-size: 1.5rem;
  line-height: 1.1;
}

.heading-stat span {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.heading-badges,
.title-line,
.button-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.title-line h2,
.title-line h3 {
  margin: 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.1rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.back-link::before {
  content: "← ";
}

.panel {
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel__header {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.panel__header > h2:last-child,
.panel__header > div > p:last-child {
  margin-bottom: 0;
}

.panel__header p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.panel__header--actions,
.source-card__header,
.timeline-item__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.panel--form {
  max-width: 48rem;
}

.panel--form-wide {
  max-width: 64rem;
}

.notice {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-left-width: 0.35rem;
  border-radius: var(--radius-small);
  background: var(--surface);
}

.notice h2,
.notice h3 {
  margin-bottom: 0.25rem;
}

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

.notice--important {
  border-color: #7db9ca;
  border-left-color: var(--brand-700);
  background: #eef9fc;
}

.notice--warning {
  border-color: #eacb6e;
  border-left-color: #b7791f;
  background: var(--warning-100);
}

.notice--danger {
  border-color: #f3aaa4;
  border-left-color: var(--danger-700);
  background: var(--danger-100);
}

.notice--success {
  border-color: #8bc4a6;
  border-left-color: var(--success-700);
  background: var(--success-100);
}

.notice--muted {
  border-left-color: var(--border-strong);
  background: var(--surface-muted);
}

.flash-stack {
  display: grid;
  margin-bottom: 1.25rem;
  gap: 0.6rem;
}

.flash {
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
  font-weight: 650;
}

.flash--success {
  border-color: #8bc4a6;
  background: var(--success-100);
  color: #115e3b;
}

.flash--error {
  border-color: #f3aaa4;
  background: var(--danger-100);
  color: #8f1c13;
}

.flash--warning {
  border-color: #eacb6e;
  background: var(--warning-100);
  color: var(--warning-800);
}

.flash--info {
  border-color: #8ec8d7;
  background: #eef9fc;
  color: #164e63;
}

.button {
  display: inline-flex;
  min-height: 2.55rem;
  padding: 0.55rem 0.9rem;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.button:hover {
  filter: brightness(0.95);
  text-decoration: none;
}

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

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

.button--quiet {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--brand-900);
}

.site-header .button--quiet {
  border-color: rgb(255 255 255 / 42%);
  background: transparent;
  color: #ffffff;
}

.button--small {
  min-height: 2.15rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.78rem;
}

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

.filter-panel .panel__header {
  padding-bottom: 0.85rem;
}

.filter-form {
  display: grid;
  padding: 1rem 1.25rem 1.25rem;
  align-items: end;
  grid-template-columns: minmax(14rem, 2fr) minmax(12rem, 1fr) auto;
  gap: 1rem;
}

.filter-form .form-field {
  margin: 0;
}

.filter-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stacked-form {
  padding: 1.25rem;
}

.stacked-form > :last-child {
  margin-bottom: 0;
}

.form-field {
  margin: 0 0 1.05rem;
}

.form-grid {
  display: grid;
  gap: 0 1rem;
}

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

.form-label {
  display: block;
  margin-bottom: 0.35rem;
  color: #263844;
  font-size: 0.87rem;
  font-weight: 750;
}

.form-control {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.58rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-small);
  background: #ffffff;
  box-shadow: inset 0 1px 1px rgb(11 38 53 / 4%);
}

textarea.form-control {
  min-height: 7.25rem;
  line-height: 1.5;
  resize: vertical;
}

select[multiple].form-control {
  min-height: 10rem;
}

.form-control:hover {
  border-color: #7c909d;
}

.form-control:focus {
  border-color: var(--brand-700);
  outline: 3px solid rgb(245 158 11 / 48%);
  outline-offset: 1px;
}

.form-field--invalid .form-control {
  border-color: var(--danger-700);
}

.field-help {
  margin: 0.38rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.field-errors,
.form-error-summary {
  margin: 0.4rem 0 0;
  color: #8f1c13;
  font-size: 0.82rem;
  font-weight: 650;
}

.field-errors {
  padding-left: 1.2rem;
}

.form-error-summary {
  margin-bottom: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #f3aaa4;
  border-radius: var(--radius-small);
  background: var(--danger-100);
}

.form-error-summary p:last-child {
  margin-bottom: 0;
}

.form-field--checkbox {
  padding: 0.25rem 0;
}

.checkbox-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.checkbox-label input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.16rem 0 0;
  accent-color: var(--brand-700);
}

.inline-form {
  display: inline-flex;
  margin-top: 0.85rem;
}

.inline-disclosure summary {
  color: var(--brand-700);
  cursor: pointer;
  font-weight: 750;
}

.inline-disclosure[open] {
  min-width: 16rem;
}

.stacked-form--compact {
  margin-top: 0.55rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: #f8fafb;
}

.stacked-form--compact textarea.form-control {
  min-height: 4.5rem;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.table-scroll:focus-visible {
  outline-offset: -3px;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.86rem;
}

.data-table th,
.data-table td {
  padding: 0.8rem 0.85rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: #f2f5f7;
  color: #43535e;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  white-space: nowrap;
}

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

.data-table tbody tr:not(.deadline-warning):not(.deadline-overdue):hover td {
  background: #f8fafb;
}

.data-table--compact th,
.data-table--compact td {
  padding: 0.6rem 0.7rem;
}

.table-action {
  text-align: right !important;
  white-space: nowrap;
}

.row-link {
  font-weight: 750;
}

.deadline-warning > td {
  border-color: rgb(255 255 255 / 34%);
  background: var(--deadline-red);
  color: #ffffff;
}

.deadline-overdue > td {
  border-color: #3d4144;
  background: var(--deadline-black);
  color: #ffffff;
}

.deadline-warning a,
.deadline-overdue a,
.deadline-warning code,
.deadline-overdue code {
  color: #ffffff;
}

.deadline-warning code,
.deadline-overdue code {
  background: rgb(255 255 255 / 15%);
}

.deadline-label {
  display: inline-flex;
  padding: 0.23rem 0.48rem;
  align-items: center;
  border: 1px solid #b5c1c9;
  border-radius: 999px;
  background: #ffffff;
  color: #34444f;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.deadline-label--warning {
  border-color: #ffffff;
  background: #ffffff;
  color: var(--deadline-red);
}

.deadline-label--overdue {
  border-color: #ffffff;
  background: #ffffff;
  color: #000000;
}

.deadline-label--closed {
  border-color: #83bda0;
  background: var(--success-100);
  color: #115e3b;
}

.request-heading {
  padding: 1rem;
  border-left: 0.4rem solid var(--border-strong);
  border-radius: var(--radius-small);
  background: rgb(255 255 255 / 62%);
}

.deadline-heading--warning {
  border-left-color: var(--deadline-red);
}

.deadline-heading--overdue {
  border-left-color: var(--deadline-black);
}

.status {
  display: inline-flex;
  max-width: 100%;
  padding: 0.22rem 0.48rem;
  align-items: center;
  border: 1px solid #b9c4cb;
  border-radius: 999px;
  background: #edf1f3;
  color: #34444f;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
}

.status--new,
.status--pending,
.status--queued {
  border-color: #8bbbd4;
  background: #e8f5fb;
  color: #0c5578;
}

.status--in-progress,
.status--running {
  border-color: #baa7dc;
  background: #f1ebfb;
  color: #5b3b8c;
}

.status--completed,
.status--verified,
.status--succeeded,
.status--active {
  border-color: #86bfa2;
  background: var(--success-100);
  color: #115e3b;
}

.status--unverified {
  border-color: #d8b75c;
  background: var(--warning-100);
  color: #75420a;
}

.status--no-match {
  border-color: #d8b75c;
  background: var(--warning-100);
  color: #75420a;
}

.status--needs-attention,
.status--partial-failure,
.status--failed,
.status--unknown,
.status--delete {
  border-color: #e7a09a;
  background: var(--danger-100);
  color: #8f1c13;
}

.status--rejected,
.status--rolled-back,
.status--cancelled,
.status--inactive {
  border-color: #b9c4cb;
  background: #edf1f3;
  color: #4b5963;
}

.status--anonymize,
.status--email,
.status--phone {
  border-color: #86c1ce;
  background: #e8f7fa;
  color: #155e70;
}

.status--superadmin {
  border-color: #b9a1d1;
  background: #f2eafa;
  color: #59367b;
}

.status--operator {
  border-color: #8bbbd4;
  background: #e8f5fb;
  color: #0c5578;
}

.status--auditor {
  border-color: #b9c4cb;
  background: #edf1f3;
  color: #43515b;
}

.empty-state {
  padding: 2.25rem 1.25rem;
  color: var(--muted);
  text-align: center;
}

.empty-state h2,
.empty-state h3 {
  color: var(--ink);
}

.empty-state p:last-child {
  margin-bottom: 0;
}

.empty-state--compact {
  padding: 1rem;
}

.detail-grid,
.operation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.detail-grid > .panel,
.operation-grid > .panel {
  min-width: 0;
}

.definition-grid {
  display: grid;
  margin: 0;
  padding: 1.15rem 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.definition-grid > div {
  min-width: 0;
}

.definition-grid dt {
  margin-bottom: 0.15rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
}

.definition-grid dd {
  margin: 0;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.definition-grid--compact {
  max-width: 42rem;
  padding-right: 0;
  padding-left: 0;
}

.masked-identifier,
.revealed-value {
  margin: 1.15rem 1.25rem 0;
}

.masked-identifier {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.masked-value {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 750;
  letter-spacing: 0.035em;
}

.masked-identifier .masked-value {
  font-size: 1.15rem;
}

.masked-identifier > span:last-child {
  color: var(--muted);
  font-size: 0.8rem;
}

#identifier-heading + p + .masked-identifier,
.panel > .inline-form {
  margin-left: 1.25rem;
}

.panel > .inline-form {
  margin-bottom: 1.2rem;
}

.revealed-value {
  margin-bottom: 1.2rem;
  padding: 1rem;
  border: 2px solid var(--danger-700);
  border-radius: var(--radius-small);
  background: #fff8f7;
}

.revealed-value__label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--danger-700);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.revealed-value strong {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.revealed-value p {
  margin: 0.65rem 0 0;
  color: #70403c;
  font-size: 0.8rem;
}

.timeline,
.comment-list,
.source-list,
.project-list {
  display: grid;
  gap: 1rem;
}

.timeline,
.comment-list,
.source-list {
  padding: 1.15rem 1.25rem;
}

.timeline-item,
.source-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface-muted);
}

.timeline-item__header h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.timeline-item__header p,
.source-card__header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.timeline-item .table-scroll {
  margin-top: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
}

.inline-error {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-small);
  background: var(--danger-100);
  color: #8f1c13;
  font-size: 0.84rem;
  font-weight: 650;
}

.pre-wrap {
  margin: 0.75rem 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.muted-text {
  color: var(--muted);
  font-size: 0.8rem;
}

.comment-list {
  margin: 0;
  list-style: none;
}

.comment-list li {
  padding: 0.9rem 1rem;
  border-left: 3px solid #91b7c3;
  background: var(--surface-muted);
}

.comment-meta {
  display: flex;
  margin-bottom: 0.45rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.comment-meta strong {
  color: var(--ink);
}

.comment-list p:last-child {
  margin-bottom: 0;
}

.project-card > .panel__header {
  border-bottom: 0;
}

.project-card > .source-list {
  padding-top: 0;
}

.source-card__header {
  margin-bottom: 0.9rem;
}

.source-card .table-scroll {
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
}

.key-list {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.secret-panel {
  max-width: 58rem;
  padding: 0 1.25rem 1.25rem;
}

.secret-panel > .panel__header {
  margin: 0 -1.25rem 1.25rem;
}

.secret-token {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--brand-700);
  border-radius: var(--radius-small);
  background: var(--brand-950);
  color: #ffffff;
  overflow-x: auto;
}

.secret-token code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 0.9rem;
  overflow-wrap: normal;
  white-space: nowrap;
}

.login-page .site-header__inner {
  justify-content: center;
}

.login-page .page-shell {
  display: grid;
  max-width: 34rem;
  place-items: start stretch;
}

.auth-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: 0 18px 60px rgb(11 38 53 / 12%);
}

.auth-card__intro {
  padding: 1.6rem 1.6rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #edf9fb, #ffffff);
}

.auth-card__intro p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.auth-card .stacked-form {
  padding: 1.5rem 1.6rem 1.1rem;
}

.security-note {
  margin: 0;
  padding: 0 1.6rem 1.5rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.error-page {
  max-width: 44rem;
  margin: 2rem auto;
  padding: clamp(2rem, 7vw, 4rem);
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  text-align: center;
  box-shadow: var(--shadow);
}

.error-code {
  margin-bottom: 0.5rem;
  color: #a9b4bb;
  font-size: clamp(3rem, 12vw, 6rem);
  font-weight: 850;
  letter-spacing: -0.06em;
  line-height: 1;
}

.error-page > p:not(.error-code) {
  margin-bottom: 1.5rem;
  color: var(--muted);
}

.site-footer {
  display: flex;
  width: min(100% - 2rem, var(--content-width));
  min-height: 4.5rem;
  margin: 0 auto;
  padding: 1rem 0;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.75rem;
}

.site-footer span:first-child {
  color: var(--ink);
  font-weight: 800;
}

@media (max-width: 72rem) {
  .site-header__inner {
    flex-wrap: wrap;
    padding: 0.75rem 0;
    gap: 0.65rem 1rem;
  }

  .main-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .main-nav a {
    min-height: 2.5rem;
    padding: 0.45rem 0.7rem;
    white-space: nowrap;
  }

  .account-menu {
    margin-left: auto;
  }
}

@media (max-width: 52rem) {
  .filter-form,
  .detail-grid,
  .operation-grid,
  .form-grid--two {
    grid-template-columns: 1fr;
  }

  .filter-form__actions .button {
    flex: 1 1 auto;
  }

  .panel__header--actions,
  .source-card__header,
  .timeline-item__header {
    align-items: stretch;
    flex-direction: column;
  }

  .data-table--responsive thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .data-table--responsive,
  .data-table--responsive tbody,
  .data-table--responsive tr,
  .data-table--responsive td {
    display: block;
    width: 100%;
  }

  .data-table--responsive tbody {
    padding: 0.65rem;
  }

  .data-table--responsive tr {
    margin-bottom: 0.65rem;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    background: var(--surface);
  }

  .data-table--responsive tr:last-child {
    margin-bottom: 0;
  }

  .data-table--responsive td,
  .data-table--responsive tbody tr:last-child td {
    display: grid;
    padding: 0.65rem 0.7rem;
    border-bottom: 1px solid var(--border);
    grid-template-columns: minmax(7.5rem, 38%) minmax(0, 1fr);
    gap: 0.75rem;
    text-align: left !important;
    white-space: normal;
  }

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

  .data-table--responsive td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .data-table--responsive .deadline-warning,
  .data-table--responsive .deadline-overdue {
    border-color: transparent;
  }

  .data-table--responsive .deadline-warning td,
  .data-table--responsive .deadline-overdue td {
    border-color: rgb(255 255 255 / 28%);
  }

  .data-table--responsive .deadline-warning td::before,
  .data-table--responsive .deadline-overdue td::before {
    color: rgb(255 255 255 / 78%);
  }

  .definition-grid {
    grid-template-columns: 1fr;
  }

  .comment-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.15rem;
  }
}

@media (max-width: 38rem) {
  .site-header__inner,
  .page-shell,
  .site-footer {
    width: min(100% - 1.2rem, var(--content-width));
  }

  .brand small,
  .account-menu__identity {
    display: none;
  }

  .account-menu {
    gap: 0.35rem;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .page-heading > .button {
    width: 100%;
  }

  .heading-stat {
    display: flex;
    min-width: 0;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
  }

  .panel__header,
  .stacked-form,
  .timeline,
  .comment-list,
  .source-list,
  .definition-grid {
    padding-right: 0.9rem;
    padding-left: 0.9rem;
  }

  .button-group {
    align-items: stretch;
    flex-direction: column;
  }

  .button-group > .button,
  .button-group > form,
  .button-group > form .button {
    width: 100%;
  }

  .masked-identifier,
  .revealed-value,
  .panel > .inline-form {
    margin-right: 0.9rem;
    margin-left: 0.9rem;
  }

  .masked-identifier {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }

  .data-table--responsive td,
  .data-table--responsive tbody tr:last-child td {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

@media (forced-colors: active) {
  .deadline-warning > td,
  .deadline-overdue > td {
    border: 3px solid CanvasText;
    background: Canvas;
    color: CanvasText;
  }

  .deadline-warning a,
  .deadline-overdue a {
    color: LinkText;
  }

  .status,
  .deadline-label {
    border: 1px solid CanvasText;
  }
}

@media print {
  .site-header,
  .site-footer,
  .button,
  form,
  .skip-link {
    display: none !important;
  }

  body,
  .panel,
  .timeline-item,
  .source-card {
    background: #ffffff;
    box-shadow: none;
  }

  .page-shell {
    width: 100%;
    padding: 0;
  }
}
