:root {
  color-scheme: light;
  --navy-950: #071625;
  --navy-900: #0b1f38;
  --navy-800: #12304f;
  --navy-700: #1c466d;
  --ink: #13283f;
  --muted: #60748a;
  --muted-strong: #435d75;
  --blue-700: #0879bd;
  --blue-600: #0d91dc;
  --blue-500: #21adf6;
  --blue-300: #8bd8ff;
  --blue-200: #bce9ff;
  --blue-100: #e1f4ff;
  --blue-50: #f0f9ff;
  --surface: #ffffff;
  --surface-muted: #f4f8fc;
  --line: #dce7f1;
  --line-strong: #c8d8e6;
  --success: #087f5b;
  --success-soft: #e5f7f0;
  --warning: #9b6700;
  --warning-soft: #fff5d8;
  --danger: #b4233a;
  --danger-soft: #ffedf0;
  --shadow-sm: 0 1px 2px rgb(9 38 64 / 6%), 0 8px 24px rgb(9 38 64 / 5%);
  --shadow-lg: 0 28px 80px rgb(1 12 25 / 28%);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-sans:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--surface-muted);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--surface-muted);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

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

button {
  border: 0;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgb(33 173 246 / 38%);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 6px;
  color: white;
  background: var(--navy-900);
  transform: translateY(-160%);
}

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

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

.auth-shell {
  position: relative;
  display: grid;
  min-height: 100vh;
  overflow: hidden;
  place-items: center;
  padding: 36px 20px;
  color: var(--blue-300);
  background: var(--navy-950);
}

.matrix-canvas,
.auth-vignette {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.matrix-canvas {
  z-index: 0;
  opacity: 0.58;
}

.auth-vignette {
  z-index: 1;
  background:
    radial-gradient(
      circle at 50% 42%,
      transparent 0 18%,
      rgb(7 22 37 / 30%) 56%,
      rgb(7 22 37 / 92%) 100%
    ),
    linear-gradient(180deg, rgb(7 22 37 / 15%), rgb(7 22 37 / 54%));
}

.auth-wrap {
  position: relative;
  z-index: 2;
  width: min(100%, 456px);
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
  color: #e8f8ff;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.auth-brand img {
  filter: drop-shadow(0 0 16px rgb(33 173 246 / 25%));
}

.auth-card {
  padding: 34px;
  border: 1px solid rgb(139 216 255 / 30%);
  border-radius: var(--radius-md);
  background: rgb(7 22 37 / 88%);
  box-shadow:
    var(--shadow-lg),
    inset 0 1px rgb(255 255 255 / 5%);
  backdrop-filter: blur(12px);
}

.system-line {
  margin: 0 0 21px;
  color: rgb(139 216 255 / 58%);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-align: center;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--blue-700);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-eyebrow {
  color: rgb(139 216 255 / 72%);
  text-align: center;
}

.auth-card h1 {
  max-width: 360px;
  margin: 0 auto;
  color: #e8f8ff;
  font-family: var(--font-mono);
  font-size: clamp(24px, 7vw, 31px);
  line-height: 1.12;
  letter-spacing: -0.035em;
  text-align: center;
}

.auth-copy {
  max-width: 360px;
  margin: 14px auto 0;
  color: rgb(188 233 255 / 66%);
  font-size: 13px;
  line-height: 1.65;
  text-align: center;
}

.terminal-rule {
  height: 1px;
  margin: 25px 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgb(139 216 255 / 30%) 20% 80%,
    transparent
  );
}

.field {
  margin-bottom: 18px;
}

.field label,
.compact-field span {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.auth-card .field label {
  color: rgb(139 216 255 / 78%);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: white;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

input:focus,
select:focus {
  border-color: var(--blue-600);
  outline: none;
  box-shadow: 0 0 0 4px rgb(33 173 246 / 12%);
}

input[readonly] {
  color: var(--muted-strong);
  background: var(--surface-muted);
}

.auth-card input {
  border-color: rgb(139 216 255 / 24%);
  color: #e8f8ff;
  background: rgb(4 16 29 / 68%);
  font-family: var(--font-mono);
}

.auth-card input:focus {
  border-color: rgb(139 216 255 / 72%);
  box-shadow:
    0 0 0 4px rgb(33 173 246 / 10%),
    0 0 18px rgb(33 173 246 / 8%);
}

.auth-card input[readonly] {
  color: rgb(188 233 255 / 62%);
  background: rgb(4 16 29 / 42%);
}

.field-help,
.honesty-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.auth-card .field-help {
  color: rgb(188 233 255 / 48%);
  font-family: var(--font-mono);
}

.form-status {
  min-height: 20px;
  margin: 0 0 8px;
  color: var(--muted-strong);
  font-size: 12px;
}

.auth-card .form-status {
  color: var(--blue-300);
  font-family: var(--font-mono);
}

.form-status[data-tone='error'] {
  color: var(--danger);
}

.auth-card .form-status[data-tone='error'] {
  color: #ff9daf;
}

.form-status[data-tone='success'] {
  color: var(--success);
}

.auth-card .form-status[data-tone='success'] {
  color: #81efc8;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  gap: 10px;
  padding: 10px 15px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.button-terminal {
  width: 100%;
  margin-top: 3px;
  border: 1px solid rgb(139 216 255 / 42%);
  color: #bce9ff;
  background: rgb(33 173 246 / 10%);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.button-terminal:hover:not(:disabled) {
  border-color: rgb(139 216 255 / 68%);
  background: rgb(33 173 246 / 18%);
  box-shadow: 0 0 24px rgb(33 173 246 / 12%);
}

.text-button {
  display: block;
  margin: 18px auto 0;
  padding: 5px;
  color: rgb(188 233 255 / 62%);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
}

.text-button:hover {
  color: #e8f8ff;
}

.auth-foot {
  margin: 18px 0 0;
  color: rgb(139 216 255 / 44%);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.13em;
  text-align: center;
}

.app-shell {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
  align-items: center;
  width: min(100% - 40px, 1320px);
  min-height: 70px;
  margin: 0 auto;
  gap: 24px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 10px;
  text-decoration: none;
}

.brand-lockup span {
  display: grid;
}

.brand-lockup strong {
  color: var(--navy-900);
  font-size: 14px;
  letter-spacing: -0.01em;
}

.brand-lockup small,
.account-copy small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.primary-nav {
  display: flex;
  align-self: stretch;
  gap: 6px;
}

.primary-nav a {
  position: relative;
  display: grid;
  align-items: center;
  padding: 0 14px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.primary-nav a::after {
  position: absolute;
  right: 13px;
  bottom: -1px;
  left: 13px;
  height: 2px;
  content: '';
  background: transparent;
}

.primary-nav a[aria-current='page'] {
  color: var(--navy-900);
}

.primary-nav a[aria-current='page']::after {
  background: var(--blue-500);
}

.account-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 13px;
}

.account-copy {
  display: grid;
  min-width: 0;
  text-align: right;
}

.account-copy > span {
  max-width: 220px;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button-primary {
  color: white;
  background: var(--blue-700);
}

.button-primary:hover:not(:disabled) {
  background: #066da9;
}

.button-quiet {
  border: 1px solid var(--line-strong);
  color: var(--muted-strong);
  background: white;
}

.button-quiet:hover:not(:disabled) {
  border-color: #a8bfd2;
  color: var(--ink);
  background: var(--blue-50);
}

.button-small {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 12px;
}

.app-main {
  width: min(100% - 40px, 1240px);
  min-height: calc(100vh - 142px);
  margin: 0 auto;
  padding: 56px 0 70px;
}

.view {
  animation: view-in 220ms ease-out both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.page-heading {
  max-width: 720px;
  margin-bottom: 30px;
}

.page-heading-split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  max-width: none;
  gap: 30px;
}

.page-heading h1 {
  margin: 0;
  color: var(--navy-900);
  font-size: clamp(29px, 4vw, 43px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.page-heading > p:not(.eyebrow),
.page-heading > div > p:not(.eyebrow) {
  max-width: 670px;
  margin: 13px 0 0;
  color: var(--muted-strong);
  font-size: 15px;
}

.health-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 38px;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-strong);
  background: white;
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9eb0c1;
  box-shadow: 0 0 0 4px rgb(158 176 193 / 14%);
}

.health-chip[data-state='operational'] .status-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgb(8 127 91 / 12%);
}

.health-chip[data-state='degraded'] .status-dot {
  background: #d89a00;
  box-shadow: 0 0 0 4px rgb(216 154 0 / 12%);
}

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

.metric-card {
  min-height: 150px;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.metric-card p {
  margin: 0 0 19px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 650;
}

.metric-card strong {
  display: block;
  margin-bottom: 9px;
  color: var(--navy-900);
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.metric-card small {
  color: var(--muted);
  font-size: 11px;
}

.metric-primary {
  border-color: var(--navy-800);
  color: white;
  background: var(--navy-900);
}

.metric-primary p,
.metric-primary small {
  color: rgb(225 244 255 / 68%);
}

.metric-primary strong {
  color: var(--blue-300);
}

.metric-explainer {
  background: var(--blue-50);
}

.metric-explainer strong {
  font-size: 24px;
}

.content-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  gap: 20px;
  padding: 21px 24px;
  border-bottom: 1px solid var(--line);
}

.card-header h2 {
  margin: 0;
  color: var(--navy-900);
  font-size: 19px;
  letter-spacing: -0.025em;
}

.compact-field {
  min-width: 150px;
}

.compact-field span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.compact-field select {
  min-height: 36px;
  padding: 7px 30px 7px 10px;
  font-size: 12px;
}

.loading-state {
  display: grid;
  gap: 1px;
  padding: 1px 0;
}

.loading-line {
  display: block;
  height: 78px;
  background: linear-gradient(90deg, #f7fafc 20%, #ecf3f8 46%, #f7fafc 72%);
  background-size: 230% 100%;
  animation: shimmer 1.25s linear infinite;
}

@keyframes shimmer {
  to {
    background-position-x: -230%;
  }
}

.activity-list,
.data-list {
  min-height: 120px;
}

.activity-row {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(170px, 0.75fr) minmax(
      112px,
      0.5fr
    );
  align-items: center;
  width: 100%;
  min-height: 86px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  background: white;
  text-align: left;
  cursor: pointer;
}

.activity-row:hover {
  background: var(--blue-50);
}

.activity-row:last-child {
  border-bottom: 0;
}

.message-main {
  min-width: 0;
}

.message-subject {
  display: block;
  overflow: hidden;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-route {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-state {
  justify-self: start;
}

.evidence-label,
.role-badge,
.release-badge,
.count-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--muted-strong);
  background: var(--surface-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.evidence-label[data-state='human'] {
  color: var(--success);
  background: var(--success-soft);
}

.evidence-label[data-state='machine'] {
  color: var(--warning);
  background: var(--warning-soft);
}

.message-time {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  gap: 20px;
  padding: 13px 24px;
  border-top: 1px solid var(--line);
}

.card-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.empty-state,
.error-state {
  display: grid;
  min-height: 220px;
  align-content: center;
  justify-items: center;
  padding: 30px;
  text-align: center;
}

.empty-state-mark {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 13px;
  border: 1px solid var(--blue-200);
  border-radius: 50%;
  color: var(--blue-700);
  background: var(--blue-50);
  font-family: var(--font-mono);
  place-items: center;
}

.empty-state strong,
.error-state strong {
  color: var(--navy-900);
  font-size: 15px;
}

.empty-state p,
.error-state p {
  max-width: 460px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.setup-grid,
.team-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.85fr);
  gap: 20px;
  margin-bottom: 20px;
}

.team-grid {
  grid-template-columns: minmax(310px, 0.8fr) minmax(0, 1.3fr);
}

.install-card {
  grid-row: span 2;
}

.step-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 8px 24px 0;
  list-style: none;
}

.step-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 15px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.step-list li:last-child {
  border-bottom: 0;
}

.step-list li > span {
  color: var(--blue-700);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 750;
}

.step-list strong {
  color: var(--ink);
  font-size: 13px;
}

.step-list p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.install-card > .button {
  margin: 22px 24px 0;
}

.install-card > .honesty-note {
  margin: 10px 24px 24px;
}

.release-badge {
  color: var(--warning);
  background: var(--warning-soft);
}

.inline-form,
.stack-form {
  padding: 24px;
}

.inline-form .button,
.stack-form .button {
  width: 100%;
}

.field-light label {
  color: var(--muted-strong);
}

.table-card {
  overflow: hidden;
}

.data-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  min-height: 72px;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
}

.data-row:last-child {
  border-bottom: 0;
}

.data-primary {
  min-width: 0;
}

.data-primary strong,
.data-primary span {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-primary small,
.data-meta {
  color: var(--muted);
  font-size: 11px;
}

.role-badge[data-role='owner'] {
  color: var(--blue-700);
  background: var(--blue-100);
}

.role-badge[data-role='admin'] {
  color: #6450a2;
  background: #f0ebff;
}

.role-badge[data-status='revoked'] {
  color: var(--danger);
  background: var(--danger-soft);
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 40px, 1240px);
  min-height: 72px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.app-footer nav {
  display: flex;
  gap: 20px;
}

.app-footer a:hover {
  color: var(--ink);
}

.dialog {
  width: min(calc(100% - 32px), 680px);
  max-height: min(82vh, 760px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--ink);
  background: white;
  box-shadow: 0 34px 100px rgb(7 22 37 / 34%);
}

.dialog::backdrop {
  background: rgb(7 22 37 / 56%);
  backdrop-filter: blur(4px);
}

.dialog-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  gap: 20px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 96%);
}

.dialog-header h2 {
  margin: 0;
  color: var(--navy-900);
  font-size: 20px;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted-strong);
  background: white;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  place-items: center;
}

.icon-button:hover {
  color: var(--ink);
  background: var(--blue-50);
}

.detail-summary {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--blue-50);
}

.detail-summary strong,
.detail-summary span {
  display: block;
}

.detail-summary strong {
  margin-bottom: 5px;
  color: var(--navy-900);
  font-size: 15px;
}

.detail-summary span {
  color: var(--muted-strong);
  font-size: 12px;
}

.open-list {
  min-height: 160px;
}

.open-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.open-event:last-child {
  border-bottom: 0;
}

.open-event h3 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 14px;
}

.open-event p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.open-event time {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.reason-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.reason-list span {
  padding: 3px 6px;
  border-radius: 4px;
  color: var(--muted-strong);
  background: var(--surface-muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.secret-dialog {
  width: min(calc(100% - 32px), 560px);
  padding-bottom: 24px;
}

.dialog-copy {
  margin: 22px 24px 12px;
  color: var(--muted-strong);
  font-size: 13px;
}

.secret-value {
  display: block;
  margin: 0 24px 18px;
  padding: 14px;
  overflow-wrap: anywhere;
  border: 1px solid var(--blue-200);
  border-radius: var(--radius-sm);
  color: var(--navy-900);
  background: var(--blue-50);
  font-family: var(--font-mono);
  font-size: 12px;
  user-select: all;
}

.secret-dialog > .button,
.secret-dialog > .form-status {
  margin-right: 24px;
  margin-left: 24px;
}

.loading-state:empty {
  min-height: 160px;
  background: linear-gradient(90deg, #f7fafc 20%, #ecf3f8 46%, #f7fafc 72%);
  background-size: 230% 100%;
  animation: shimmer 1.25s linear infinite;
}

.legal-page {
  min-height: 100vh;
  padding: 30px 20px 70px;
  background: var(--surface-muted);
}

.legal-header,
.legal-main {
  width: min(100%, 780px);
  margin: 0 auto;
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

.legal-main {
  padding: clamp(24px, 6vw, 54px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow-sm);
}

.legal-main h1 {
  margin: 0 0 8px;
  color: var(--navy-900);
  font-size: clamp(30px, 6vw, 44px);
  letter-spacing: -0.045em;
}

.legal-main h2 {
  margin: 32px 0 9px;
  color: var(--navy-900);
  font-size: 18px;
}

.legal-main p,
.legal-main li {
  color: var(--muted-strong);
}

.legal-main ul {
  padding-left: 21px;
}

.legal-updated {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 980px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 45px;
    border-top: 1px solid var(--line);
  }

  .primary-nav a {
    flex: 1;
    justify-content: center;
    padding: 0 10px;
  }

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

  .setup-grid,
  .team-grid {
    grid-template-columns: 1fr;
  }

  .install-card {
    grid-row: auto;
  }
}

@media (max-width: 700px) {
  .auth-shell {
    align-items: start;
    padding-top: 24px;
  }

  .auth-card {
    padding: 27px 21px;
  }

  .header-inner,
  .app-main,
  .app-footer {
    width: min(100% - 24px, 1240px);
  }

  .header-inner {
    gap: 12px;
  }

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

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

  .app-main {
    padding: 38px 0 54px;
  }

  .page-heading {
    margin-bottom: 24px;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .metric-card {
    min-height: 136px;
    padding: 17px;
  }

  .metric-card p {
    min-height: 36px;
    margin-bottom: 11px;
  }

  .metric-card strong {
    font-size: 25px;
  }

  .card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .compact-field {
    width: 100%;
  }

  .activity-row {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 102px;
    gap: 10px;
    padding: 15px 17px;
  }

  .evidence-state {
    grid-column: 1;
    grid-row: 2;
  }

  .message-time {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

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

  .data-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
    padding: 14px 17px;
  }

  .data-meta {
    grid-column: 1;
    grid-row: 2;
  }

  .data-row .button {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .open-event {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .app-footer {
    min-height: 86px;
  }
}

@media (max-width: 430px) {
  .auth-brand {
    font-size: 13px;
  }

  .brand-lockup strong {
    font-size: 12px;
  }

  .button-small {
    padding: 7px 9px;
  }

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

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

  .metric-card p {
    min-height: auto;
  }

  .dialog {
    max-height: 92vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .matrix-canvas {
    opacity: 0.28;
  }
}
