:root {
  color-scheme: light;
  --portal-ink: #1d2430;
  --portal-muted: #667084;
  --portal-paper: #f7f8fa;
  --portal-surface: #ffffff;
  --portal-rule: #d9dde5;
  --portal-accent: #2077b4;
  --portal-ok: #237a4b;
  --portal-warning: #9a5a00;
  --portal-error: #b42318;
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
}

body {
  margin: 0;
  background: var(--portal-paper);
  color: var(--portal-ink);
  font: 16px/1.5 "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
}

main {
  width: 100%;
  box-sizing: border-box;
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px;
}

.portal-panel {
  background: var(--portal-surface);
  border: 1px solid var(--portal-rule);
  border-radius: 8px;
  padding: 24px;
}

.portal-eyebrow {
  margin: 0 0 8px;
  color: var(--portal-muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 16px;
  font-size: 28px;
  line-height: 1.2;
}

dl {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 10px 18px;
  margin: 20px 0 0;
}

dt {
  color: var(--portal-muted);
  font-weight: 700;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.status-ok {
  color: var(--portal-ok);
  font-weight: 700;
}

.status-error {
  color: var(--portal-error);
  font-weight: 700;
}

.auth-body {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(32, 119, 180, 0.10), transparent 34%),
    linear-gradient(315deg, rgba(35, 122, 75, 0.10), transparent 38%),
    var(--portal-paper);
}

.auth-main {
  display: grid;
  min-height: calc(100vh - 80px);
  place-items: center;
}

.auth-panel {
  width: min(100%, 420px);
  box-sizing: border-box;
  background: var(--portal-surface);
  border: 1px solid var(--portal-rule);
  border-radius: 8px;
  padding: 28px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.auth-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 8px;
  background: #1d2430;
  color: #ffffff;
  font-weight: 800;
}

.portal-form {
  display: grid;
  gap: 10px;
}

.portal-form label {
  font-weight: 700;
}

.portal-form input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--portal-rule);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--portal-ink);
  font: inherit;
}

.portal-form input:focus {
  border-color: var(--portal-accent);
  outline: 3px solid rgba(32, 119, 180, 0.18);
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.primary-button {
  margin-top: 10px;
  padding: 12px 16px;
  background: var(--portal-accent);
  color: #ffffff;
}

.secondary-button {
  padding: 10px 14px;
  background: #e7eaf0;
  color: var(--portal-ink);
}

.form-alert,
.field-error {
  color: var(--portal-error);
}

.form-alert {
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-radius: 6px;
  background: rgba(180, 35, 24, 0.08);
  padding: 10px 12px;
}

.field-error {
  margin: -4px 0 4px;
  font-size: 14px;
}

.portal-health-body {
  min-height: 100vh;
  --health-paper: #f7f3ec;
  --health-paper-2: #fffdf8;
  --health-ink: #161616;
  --health-muted: #5d646b;
  --health-line: #d8d0c3;
  --health-cyan: #00a7d8;
  --health-magenta: #e4007f;
  --health-yellow: #ffd100;
  --health-black: #141414;
  --health-blue: #1f5aa6;
  --health-green: #148f5a;
  --health-red: #c8372d;
  margin: 0;
  color: var(--health-ink);
  background:
    radial-gradient(circle at 18px 18px, rgba(22, 22, 22, 0.07) 1.4px, transparent 1.7px) 0 0 / 18px 18px,
    linear-gradient(135deg, rgba(0, 167, 216, 0.08), transparent 28%),
    linear-gradient(315deg, rgba(255, 209, 0, 0.14), transparent 32%),
    var(--health-paper);
}

.portal-health-body::before {
  content: "";
  display: block;
  height: 10px;
  background: linear-gradient(90deg,
    var(--health-cyan) 0 25%,
    var(--health-magenta) 25% 50%,
    var(--health-yellow) 50% 75%,
    var(--health-black) 75% 100%);
}

.portal-health-page {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 48px;
}

.portal-health-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  border-bottom: 1px solid var(--health-line);
  padding-bottom: 26px;
}

.portal-health-header h1 {
  margin: 8px 0 0;
  font-family: "Avenir Next Condensed", "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.portal-health-header p:not(.portal-eyebrow) {
  max-width: 660px;
  margin: 0;
  color: #343a40;
  font-size: clamp(1rem, 2vw, 1.16rem);
  line-height: 1.55;
}

.portal-health-logo {
  width: min(220px, 32vw);
  height: auto;
}

.portal-health-press-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--health-green);
  box-shadow: 0 0 0 4px rgba(20, 143, 90, 0.14);
}

.portal-health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.portal-health-card,
.portal-health-link-card {
  display: grid;
  gap: 12px;
  min-height: 128px;
  border: 1px solid var(--health-line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  color: var(--health-ink);
  padding: 18px;
  text-decoration: none;
  box-shadow: 0 14px 32px rgba(22, 22, 22, 0.08);
}

.portal-health-link-card:hover,
.portal-health-link-card:focus-visible {
  border-color: var(--health-blue);
  outline: 3px solid rgba(31, 90, 166, 0.18);
  outline-offset: 2px;
}

.portal-health-link-card.muted {
  background: rgba(255, 253, 248, 0.64);
}

.portal-health-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--health-line);
  border-radius: 999px;
  background: var(--health-paper-2);
  padding: 8px 12px;
  font-weight: 800;
}

.portal-health-status.is-ok {
  color: var(--health-green);
}

.portal-health-status.is-error {
  color: var(--health-red);
}

.portal-health-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
}

.portal-health-list {
  display: grid;
  grid-template-columns: minmax(120px, 150px) minmax(0, 1fr);
  gap: 9px 14px;
  margin: 0;
}

.portal-health-list dt {
  border-bottom: 1px solid rgba(22, 22, 22, 0.12);
  padding-bottom: 8px;
  color: var(--health-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.portal-health-list dd {
  border-bottom: 1px solid rgba(22, 22, 22, 0.12);
  padding-bottom: 8px;
}

.portal-health-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.portal-health-card-header .portal-eyebrow {
  margin: 0;
}

.portal-health-card-header strong {
  color: var(--health-muted);
  font-size: 0.84rem;
  text-align: right;
}

.portal-health-large-number {
  margin: 0;
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1;
}

.portal-health-muted {
  margin: 8px 0 18px;
  color: var(--health-muted);
}

.portal-health-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.portal-health-mini-grid h2 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.portal-health-meter-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.portal-health-meter-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(22, 22, 22, 0.10);
  padding-bottom: 8px;
}

.portal-health-link-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  font-size: 1.08rem;
  font-weight: 800;
}

.portal-health-link-title span:last-child {
  color: var(--health-blue);
  font-size: 1.25rem;
}

.portal-health-link-meta {
  display: grid;
  gap: 5px;
  color: var(--health-muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.portal-health-link-meta code,
.portal-health-list code {
  color: #1f2933;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.portal-health-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 12px;
  margin-top: 26px;
  border: 1px solid var(--health-ink);
}

.portal-health-strip span:nth-child(1) { background: var(--health-cyan); }
.portal-health-strip span:nth-child(2) { background: var(--health-magenta); }
.portal-health-strip span:nth-child(3) { background: var(--health-yellow); }
.portal-health-strip span:nth-child(4) { background: var(--health-black); }

.portal-health-list.compact {
  grid-template-columns: minmax(105px, 140px) minmax(0, 1fr);
  margin-top: 0;
}

@media (max-width: 820px) {
  .portal-health-header {
    grid-template-columns: 1fr;
  }

  .portal-health-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .portal-health-page {
    width: min(100% - 20px, 1040px);
    padding-top: 28px;
  }

  .portal-health-logo {
    width: 190px;
  }

  .portal-health-list {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .portal-health-mini-grid {
    grid-template-columns: 1fr;
  }

  .portal-health-list dt {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .portal-health-list dd {
    margin-bottom: 10px;
  }
}

.inline-action {
  margin-top: 24px;
}

@media (max-width: 640px) {
  main {
    padding: 24px 16px;
  }

  dl {
    grid-template-columns: 1fr;
    gap: 4px 0;
  }

  .auth-main {
    min-height: calc(100vh - 48px);
    place-items: start center;
  }

  .auth-panel {
    padding: 22px;
  }
}
