:root {
  color-scheme: light;
  font-family: Aptos, "Segoe UI", sans-serif;
  font-size: 16px;
  letter-spacing: 0;
  color: #172126;
  background: #f2f4f3;
  --ink: #172126;
  --muted: #5d696c;
  --surface: #ffffff;
  --line: #cbd2d0;
  --teal: #126b64;
  --teal-dark: #0b514c;
  --red: #a43737;
  --amber: #9a6416;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #f2f4f3;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

:focus-visible {
  outline: 3px solid #d2932f;
  outline-offset: 2px;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(100%, 390px);
}

.login-panel {
  border: 1px solid var(--line);
  border-top: 4px solid var(--teal);
  border-radius: 6px;
  padding: 28px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgb(23 33 38 / 8%);
}

.product-label {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.2;
}

.form-error {
  margin: 18px 0 -10px;
  border-left: 3px solid var(--red);
  padding: 8px 10px;
  color: #752424;
  background: #fff4f3;
  font-size: 0.9rem;
}

form {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

label {
  font-size: 0.9rem;
  font-weight: 650;
}

input[type="password"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid #899593;
  border-radius: 4px;
  padding: 9px 11px;
  color: var(--ink);
  background: var(--surface);
}

button {
  min-height: 44px;
  margin-top: 8px;
  border: 1px solid var(--teal-dark);
  border-radius: 4px;
  padding: 9px 16px;
  color: #ffffff;
  background: var(--teal-dark);
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: #073e3a;
}

.section-heading form {
  display: block;
  margin: 0;
}

.section-heading form button {
  margin: 0;
}

.danger-button {
  border-color: #8f302d;
  background: #8f302d;
}

.danger-button:hover {
  background: #742522;
}

.secondary-button {
  border-color: #66716f;
  color: var(--ink);
  background: #ffffff;
}

.secondary-button:hover {
  background: #e9edeb;
}

.launch-check-row form {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  gap: 8px;
  width: min(100%, 420px);
  margin: 0;
}

.launch-check-row input,
.canary-form select {
  min-height: 40px;
  border: 1px solid #899593;
  border-radius: 4px;
  padding: 8px 10px;
  color: var(--ink);
  background: #ffffff;
}

.launch-check-row button {
  min-height: 40px;
  margin: 0;
}

.canary-form {
  max-width: 560px;
  margin-top: 16px;
}

@media (max-width: 700px) {
  .launch-check-row {
    align-items: stretch;
  }

  .launch-check-row form {
    grid-template-columns: 1fr;
  }
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 8px;
  left: 8px;
  transform: translateY(-160%);
  border-radius: 4px;
  padding: 8px 12px;
  color: #ffffff;
  background: var(--ink);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  width: min(100% - 40px, 1120px);
  min-height: 62px;
  margin: 0 auto;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 4px;
  color: #ffffff;
  background: var(--teal-dark);
  font-size: 0.72rem;
}

.primary-nav {
  display: flex;
  justify-self: end;
  align-self: stretch;
  gap: 4px;
}

.primary-nav a {
  display: grid;
  min-width: 86px;
  place-items: center;
  border-bottom: 3px solid transparent;
  padding: 0 12px;
  color: #465356;
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.primary-nav a:hover {
  color: var(--teal-dark);
  background: #f4f8f7;
}

.primary-nav a[aria-current="page"] {
  border-bottom-color: var(--teal);
  color: var(--teal-dark);
}

.signout-form {
  display: block;
  margin: 0 0 0 12px;
}

.signout-button {
  min-height: 34px;
  margin: 0;
  border-color: #899593;
  padding: 6px 10px;
  color: #394649;
  background: #ffffff;
  font-size: 0.84rem;
}

.signout-button:hover {
  color: #ffffff;
  background: #394649;
}

.dashboard-main {
  width: min(100% - 40px, 1120px);
  margin: 0 auto;
  padding: 28px 0 48px;
}

.state-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 0 0 22px;
}

.section-label {
  margin: 0 0 5px;
  color: var(--teal-dark);
  font-size: 0.76rem;
  font-weight: 750;
  text-transform: uppercase;
}

.dashboard-page h1 {
  font-size: 1.7rem;
}

.lock-state {
  display: flex;
  align-items: center;
  min-width: 220px;
  gap: 10px;
  border: 1px solid #d8aaaa;
  border-radius: 6px;
  padding: 10px 13px;
  color: #692424;
  background: #fff5f4;
}

.lock-state span:last-child {
  display: grid;
  gap: 2px;
}

.lock-state small {
  color: #845353;
}

.status-indicator {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
}

.dashboard-section {
  margin-top: 26px;
  border-top: 3px solid #73817e;
  background: var(--surface);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  gap: 16px;
  border: 1px solid var(--line);
  border-top: 0;
  padding: 13px 16px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.05rem;
}

.section-meta {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.category-list {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  gap: 16px;
  border-top: 1px solid #e2e6e5;
  padding: 10px 16px;
}

.category-row:first-child {
  border-top: 0;
}

.category-row > div {
  display: grid;
  gap: 3px;
}

.category-row span {
  color: var(--muted);
  font-size: 0.82rem;
}

.category-row--active {
  box-shadow: inset 4px 0 0 var(--teal);
}

.category-row--disabled {
  color: #626b6d;
  background: #f7f8f8;
}

.category-row .row-state {
  min-width: 58px;
  color: #6a5555;
  font-weight: 700;
  text-align: right;
}

.category-row .row-state--active {
  color: var(--teal-dark);
}

.operations-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.status-list {
  margin: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.status-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(110px, auto);
  align-items: center;
  min-height: 48px;
  gap: 16px;
  border-top: 1px solid #e2e6e5;
  padding: 9px 16px;
}

.status-row:first-child {
  border-top: 0;
}

.status-row dt {
  font-weight: 650;
}

.status-row dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: right;
}

.status-row a,
.operations-table a,
.breadcrumb a {
  color: var(--teal-dark);
  font-weight: 700;
  text-underline-offset: 3px;
}

.page-summary {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.record-count {
  display: grid;
  min-width: 190px;
  gap: 2px;
  border-left: 3px solid var(--teal);
  padding: 8px 0 8px 14px;
}

.record-count strong {
  color: var(--teal-dark);
  font-size: 1.15rem;
}

.record-count span {
  color: var(--muted);
  font-size: 0.82rem;
}

.priority-strip {
  display: grid;
  grid-template-columns: minmax(170px, 0.4fr) minmax(0, 1fr);
  align-items: stretch;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-left: 3px solid #73817e;
  background: var(--surface);
}

.priority-heading {
  display: grid;
  align-content: center;
  border-right: 1px solid var(--line);
  padding: 14px 16px;
}

.priority-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.priority-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.priority-list li {
  display: grid;
  align-content: center;
  min-height: 68px;
  gap: 4px;
  border-left: 1px solid #e2e6e5;
  padding: 10px 14px;
  color: #626b6d;
  background: #f7f8f8;
}

.priority-list li:first-child {
  border-left: 0;
}

.priority-list li span {
  overflow-wrap: anywhere;
  font-size: 0.85rem;
  font-weight: 650;
}

.priority-list li strong {
  color: #626b6d;
  font-size: 0.75rem;
}

.priority-list .priority-active {
  box-shadow: inset 0 3px 0 var(--teal);
  color: var(--ink);
  background: #f3faf8;
}

.priority-list .priority-active strong {
  color: var(--teal-dark);
}

.data-section,
.detail-band {
  margin-top: 24px;
  border-top: 3px solid #73817e;
  background: var(--surface);
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.operations-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--surface);
  font-size: 0.86rem;
}

.operations-table th,
.operations-table td {
  border-top: 1px solid #e2e6e5;
  padding: 11px 12px;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
}

.operations-table thead th {
  border-top: 0;
  color: #465356;
  background: #f4f6f5;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.operations-table tbody th {
  font-weight: 700;
}

.operations-table small,
.stacked-definitions small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.4;
}

.table-row--review {
  box-shadow: inset 4px 0 0 var(--amber);
  background: #fffbf2;
}

.table-row--suppressed {
  box-shadow: inset 4px 0 0 var(--red);
  color: #674949;
  background: #fbf5f5;
}

.state-tag {
  display: inline-block;
  border: 1px solid #a7b3b0;
  border-radius: 4px;
  padding: 3px 7px;
  color: #394649;
  background: #f4f7f6;
  font-size: 0.76rem;
  font-weight: 700;
}

.state-tag--suppressed {
  border-color: #d3a3a3;
  color: #752424;
  background: #fff4f3;
}

.review-text {
  color: #704707;
}

.muted-text {
  color: var(--muted);
}

.empty-state {
  padding: 24px 16px;
  color: var(--muted);
  text-align: center;
}

.section-empty-state {
  margin: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.breadcrumb {
  display: flex;
  align-items: center;
  min-height: 34px;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.84rem;
}

.breadcrumb span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.identity-alert {
  display: grid;
  min-width: 230px;
  gap: 3px;
  border: 1px solid #a7b3b0;
  border-radius: 6px;
  padding: 10px 13px;
  color: #394649;
  background: #f4f7f6;
}

.identity-alert span {
  font-size: 0.8rem;
}

.identity-alert--review {
  border-color: #d6b77c;
  color: #704707;
  background: #fff9eb;
}

.identity-alert--suppressed {
  border-color: #d8aaaa;
  color: #752424;
  background: #fff4f3;
}

.definition-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.definition-grid > div {
  min-width: 0;
  border-top: 1px solid #e2e6e5;
  border-left: 1px solid #e2e6e5;
  padding: 12px 16px;
}

.definition-grid > div:nth-child(3n + 1) {
  border-left: 0;
}

.definition-grid dt,
.stacked-definitions dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.definition-grid dd,
.stacked-definitions dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.definition-grid code {
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.detail-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.stacked-definitions {
  margin: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.stacked-definitions > div:not(.empty-state) {
  border-top: 1px solid #e2e6e5;
  padding: 12px 16px;
}

.stacked-definitions > div:first-child {
  border-top: 0;
}

.source-url {
  max-width: 320px;
  overflow-wrap: anywhere;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.score-state {
  display: grid;
  min-width: 150px;
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 14px;
}

.score-state strong {
  font-size: 1.8rem;
  line-height: 1;
}

.score-state span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.score-dimensions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.score-dimensions > div {
  min-width: 0;
  border-left: 1px solid #e2e6e5;
  padding: 13px 14px;
}

.score-dimensions > div:first-child {
  border-left: 0;
}

.score-dimensions dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.score-dimensions dd {
  margin: 5px 0 0;
  font-weight: 700;
}

.audit-findings-table {
  min-width: 720px;
}

.severity-tag {
  display: inline-block;
  border: 1px solid #c8cecc;
  border-radius: 4px;
  padding: 3px 7px;
  color: #394649;
  background: #f4f7f6;
  font-size: 0.76rem;
  font-weight: 700;
}

.severity-tag--high {
  border-color: #d8aaaa;
  color: #752424;
  background: #fff4f3;
}

.severity-tag--medium {
  border-color: #d6b77c;
  color: #704707;
  background: #fff9eb;
}

.dry-run-banner {
  border: 1px solid #d8aaaa;
  border-radius: 4px;
  padding: 10px 13px;
  color: #752424;
  background: #fff4f3;
  font-size: 0.82rem;
}

.outbox-list {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}

.outbox-item {
  border: 1px solid var(--line);
  border-top: 3px solid #73817e;
  border-radius: 4px;
  background: var(--surface);
}

.outbox-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}

.outbox-item__header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.outbox-metadata {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.outbox-metadata > div {
  min-width: 0;
  border-left: 1px solid #e2e6e5;
  padding: 10px 16px;
}

.outbox-metadata > div:first-child {
  border-left: 0;
}

.outbox-metadata dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.outbox-metadata dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 0.86rem;
}

.message-body {
  margin: 0;
  padding: 16px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font: inherit;
  line-height: 1.55;
}

.evidence-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  border-top: 1px solid #e2e6e5;
  padding: 11px 16px;
  font-size: 0.82rem;
}

.outbox-empty {
  border: 1px solid var(--line);
  background: var(--surface);
}

.approval-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.approval-layout .dashboard-section {
  margin-top: 0;
}

.approval-form {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.approval-form label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.approval-form input,
.approval-form textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  font: inherit;
}

.approval-form textarea {
  min-height: 220px;
  resize: vertical;
}

.approval-form button,
.approval-secondary-actions button {
  min-height: 40px;
  border: 1px solid #0f5d56;
  border-radius: 4px;
  background: #0f5d56;
  color: #fff;
  padding: 8px 14px;
  font: inherit;
  font-weight: 700;
}

.approval-form button:disabled,
.approval-secondary-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.form-alert {
  margin: 16px 16px 0;
  border-left: 3px solid var(--danger);
  background: #fff5f4;
  padding: 11px 13px;
  color: #6f2723;
}

.approval-secondary-actions {
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 14px 16px;
}

.approval-secondary-actions .button-secondary {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink);
}

.approval-secondary-actions .button-danger {
  border-color: #9b312d;
  background: #9b312d;
}

@media (max-width: 420px) {
  .login-page {
    padding: 16px;
  }

  .login-panel {
    padding: 22px 18px;
  }
}

@media (max-width: 760px) {
  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    width: min(100% - 24px, 1120px);
    padding-top: 12px;
  }

  .brand {
    min-height: 40px;
  }

  .primary-nav {
    grid-column: 1 / -1;
    justify-content: space-between;
    justify-self: stretch;
    min-height: 48px;
    margin-top: 8px;
  }

  .primary-nav a {
    min-width: 0;
    flex: 1 1 auto;
    padding: 0 4px;
    font-size: 0.76rem;
  }

  .signout-form {
    grid-column: 2;
    grid-row: 1;
  }

  .dashboard-main {
    width: min(100% - 24px, 1120px);
    padding-top: 22px;
  }

  .state-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .lock-state {
    width: 100%;
  }

  .operations-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .approval-layout {
    grid-template-columns: 1fr;
  }

  .priority-strip,
  .detail-columns {
    grid-template-columns: 1fr;
  }

  .score-dimensions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-dimensions > div:nth-child(odd) {
    border-left: 0;
  }

  .outbox-metadata {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .outbox-metadata > div:nth-child(odd) {
    border-left: 0;
  }

  .priority-heading {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .definition-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .definition-grid > div:nth-child(3n + 1) {
    border-left: 1px solid #e2e6e5;
  }

  .definition-grid > div:nth-child(2n + 1) {
    border-left: 0;
  }
}

@media (max-width: 420px) {
  .primary-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 84px;
  }

  .primary-nav a {
    min-height: 42px;
    padding: 0 6px;
  }

  .section-heading,
  .category-row,
  .status-row {
    padding-right: 12px;
    padding-left: 12px;
  }

  .status-row {
    grid-template-columns: minmax(92px, 1fr) minmax(104px, auto);
    gap: 10px;
  }

  .priority-list,
  .definition-grid {
    grid-template-columns: 1fr;
  }

  .priority-list li {
    border-top: 1px solid #e2e6e5;
    border-left: 0;
  }

  .priority-list li:first-child {
    border-top: 0;
  }

  .definition-grid > div,
  .definition-grid > div:nth-child(3n + 1),
  .definition-grid > div:nth-child(2n + 1) {
    border-left: 0;
  }

  .record-count,
  .identity-alert,
  .score-state {
    width: 100%;
    min-width: 0;
  }

  .section-actions {
    align-items: flex-end;
    flex-direction: column;
    gap: 5px;
  }

  .score-dimensions {
    grid-template-columns: 1fr;
  }

  .score-dimensions > div {
    border-top: 1px solid #e2e6e5;
    border-left: 0;
  }

  .score-dimensions > div:first-child {
    border-top: 0;
  }

  .outbox-item__header {
    align-items: flex-start;
  }

  .outbox-metadata {
    grid-template-columns: 1fr;
  }

  .outbox-metadata > div,
  .outbox-metadata > div:nth-child(odd) {
    border-top: 1px solid #e2e6e5;
    border-left: 0;
  }

  .outbox-metadata > div:first-child {
    border-top: 0;
  }
}
