:root {
  color-scheme: light;
  --forest: #1e3126;
  --forest-soft: #294436;
  --sage: #6f7e7b;
  --gold: #ccb363;
  --gold-pale: #f1e5b8;
  --gold-ink: #5b4915;
  --cream: #fff9e1;
  --canvas: #f6f1e4;
  --paper: #ffffff;
  --ink-soft: #4c5b55;
  --ink-faint: #68756f;
  --success: #25523a;
  --success-pale: #e3efe7;
  --danger: #7a2e25;
  --danger-pale: #f7e6e2;
  --warning: #665315;
  --warning-pale: #f5e9b9;
  --line: rgba(30, 49, 38, 0.14);
  --line-strong: rgba(30, 49, 38, 0.28);
  --shadow-soft: 0 18px 56px rgba(30, 49, 38, 0.08);
  --shadow-card: 0 8px 30px rgba(30, 49, 38, 0.06);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--cream);
  scroll-behavior: smooth;
}

body {
  min-width: 0;
  min-height: 100svh;
  margin: 0;
  color: var(--forest);
  background: var(--cream);
}

button,
input {
  font: inherit;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex="-1"]:focus-visible {
  outline: 3px solid var(--forest);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.is-pending {
  color: var(--ink-soft) !important;
  font-style: italic;
}

.is-negative {
  color: var(--danger) !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 12px;
  min-height: 44px;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--cream);
  background: var(--forest);
  transform: translateY(-150%);
}

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

/* Public access */

.login-page {
  display: grid;
  grid-template-rows: 1fr auto;
  border-top: 7px solid var(--gold);
  background:
    radial-gradient(circle at 8% 12%, rgba(204, 179, 99, 0.17), transparent 34rem),
    var(--cream);
}

.login-shell {
  width: min(100% - 28px, 560px);
  margin: auto;
  padding: 42px 0 28px;
  display: grid;
  gap: 32px;
}

.login-brand {
  min-width: 0;
}

.login-logo {
  display: block;
  width: min(100%, 310px);
  height: auto;
}

.portal-label {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-panel {
  min-width: 0;
  padding: 26px 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.security-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.security-status__mark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--forest);
  box-shadow: 0 0 0 5px rgba(30, 49, 38, 0.09);
}

.login-panel h1 {
  margin: 26px 0 14px;
  font-size: clamp(2.15rem, 11vw, 3.45rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.login-intro {
  max-width: 38rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.65;
}

.login-form {
  margin-top: 30px;
  display: grid;
  gap: 10px;
}

.login-form label {
  margin-top: 10px;
  color: var(--forest);
  font-size: 0.9rem;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 54px;
  padding: 13px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  color: var(--forest);
  background: var(--paper);
  font-size: 1rem;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.login-form input:focus-visible {
  border-color: var(--forest);
  box-shadow: 0 0 0 4px rgba(30, 49, 38, 0.11);
}

.form-message {
  min-height: 1.5rem;
  margin: 4px 0 0;
  color: var(--danger);
  font-size: 0.9rem;
  line-height: 1.45;
}

.login-form button {
  min-height: 56px;
  margin-top: 2px;
  padding: 14px 20px;
  border: 0;
  border-radius: 12px;
  color: var(--cream);
  background: var(--forest);
  cursor: pointer;
  font-weight: 750;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.login-form button:hover:not(:disabled) {
  background: var(--forest-soft);
  transform: translateY(-1px);
}

.login-form button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.privacy-note {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 0.875rem;
  line-height: 1.55;
}

.privacy-note strong {
  color: var(--forest);
}

.login-footer {
  padding: 24px 24px calc(28px + env(safe-area-inset-bottom));
  color: var(--ink-soft);
  text-align: center;
  font-size: 0.9rem;
}

.login-footer strong {
  color: var(--forest);
}

/* Private dashboard */

.portal-page {
  background:
    radial-gradient(circle at 82% 0, rgba(204, 179, 99, 0.14), transparent 32rem),
    linear-gradient(180deg, var(--cream) 0, var(--canvas) 36rem);
}

.portal-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-top: 5px solid var(--gold);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 249, 225, 0.92);
  backdrop-filter: blur(16px);
}

.portal-header__inner {
  width: min(100% - 24px, 1320px);
  min-height: 80px;
  margin: 0 auto;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.portal-home {
  min-width: 0;
  display: inline-flex;
  align-items: center;
}

.portal-home img {
  display: block;
  width: clamp(118px, 37vw, 190px);
  height: auto;
}

.account-area {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.account-area form {
  flex: 0 0 auto;
}

.account-copy {
  min-width: 0;
  max-width: 94px;
  display: grid;
  gap: 1px;
  text-align: right;
}

.account-copy strong,
.account-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong {
  font-size: 0.72rem;
}

.account-copy span {
  color: var(--ink-soft);
  font-size: 0.66rem;
}

.sign-out,
.secondary-button {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--forest);
  background: transparent;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 750;
  white-space: nowrap;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.sign-out:hover,
.secondary-button:hover {
  border-color: var(--forest);
  background: rgba(255, 255, 255, 0.72);
  transform: translateY(-1px);
}

.portal-main {
  width: min(100% - 28px, 1320px);
  margin: 0 auto;
  padding: 42px 0 64px;
}

.portal-hero {
  min-width: 0;
  display: grid;
  gap: 24px;
}

.portal-kicker {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.portal-hero h1 {
  margin: 10px 0 0;
  font-size: clamp(2.55rem, 13vw, 6rem);
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.portal-welcome {
  max-width: 44rem;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.65;
}

.portal-hero__status {
  min-width: 0;
  padding-left: 17px;
  border-left: 3px solid var(--gold);
  align-self: end;
}

.portal-hero__status p {
  max-width: 34rem;
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.55;
}

.state-chip,
.record-status,
.count-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--forest);
  background: rgba(255, 255, 255, 0.64);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.025em;
  line-height: 1.2;
  text-align: center;
}

.state-chip--success,
.record-status--success {
  border-color: rgba(37, 82, 58, 0.24);
  color: var(--success);
  background: var(--success-pale);
}

.state-chip--warning,
.record-status--warning {
  border-color: rgba(102, 83, 21, 0.27);
  color: var(--warning);
  background: var(--warning-pale);
}

.state-chip--danger,
.record-status--danger {
  border-color: rgba(122, 46, 37, 0.24);
  color: var(--danger);
  background: var(--danger-pale);
}

.state-chip--loading {
  color: var(--forest);
  background: var(--gold-pale);
}

.dashboard-skeleton,
.dashboard-message,
.dashboard-content {
  margin-top: 38px;
}

.dashboard-skeleton {
  display: grid;
  gap: 14px;
}

.skeleton-card,
.skeleton-kpis span,
.skeleton-panels span {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: var(--shadow-card);
}

.skeleton-card--lead {
  min-height: 230px;
  padding: 28px;
  display: grid;
  align-content: center;
  gap: 14px;
}

.skeleton-line,
.skeleton-kpis span::after,
.skeleton-panels span::after {
  display: block;
  height: 13px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(30, 49, 38, 0.07), rgba(204, 179, 99, 0.25), rgba(30, 49, 38, 0.07));
  background-size: 240% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-line--short {
  width: 31%;
}

.skeleton-line--title {
  width: 62%;
  height: 42px;
}

.skeleton-kpis,
.skeleton-panels {
  display: grid;
  gap: 14px;
}

.skeleton-kpis span {
  min-height: 150px;
  padding: 25px;
}

.skeleton-kpis span::after,
.skeleton-panels span::after {
  content: "";
}

.skeleton-panels span {
  min-height: 280px;
  padding: 25px;
}

@keyframes skeleton-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.dashboard-message {
  min-height: 330px;
  padding: 34px 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
  display: grid;
  align-content: center;
  gap: 20px;
}

.dashboard-message__mark {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(102, 83, 21, 0.3);
  border-radius: 50%;
  color: var(--warning);
  background: var(--warning-pale);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  font-weight: 800;
}

.dashboard-message h2 {
  max-width: 38rem;
  margin: 12px 0 10px;
  font-size: clamp(1.8rem, 8vw, 3.1rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.dashboard-message p:not(.portal-kicker) {
  max-width: 42rem;
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.65;
}

.dashboard-message .secondary-button {
  margin-top: 22px;
  padding-inline: 18px;
  font-size: 0.85rem;
}

.dashboard-content {
  display: grid;
  gap: 16px;
}

.closing-card {
  min-width: 0;
  padding: 30px 24px;
  border-radius: 24px;
  color: var(--cream);
  background:
    linear-gradient(120deg, rgba(204, 179, 99, 0.08), transparent 45%),
    var(--forest);
  box-shadow: 0 24px 54px rgba(30, 49, 38, 0.18);
  display: grid;
  gap: 28px;
}

.closing-card .portal-kicker,
.closing-card__context,
.source-stamp span,
.source-stamp small {
  color: rgba(255, 249, 225, 0.72);
}

.closing-card__copy,
.closing-card__title-row {
  min-width: 0;
}

.closing-card__title-row {
  margin-top: 10px;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
}

.closing-card h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(2.25rem, 12vw, 5.25rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.closing-card .state-chip {
  border-color: rgba(255, 249, 225, 0.24);
}

.closing-card__context {
  max-width: 44rem;
  margin: 18px 0 0;
  font-size: 0.92rem;
  line-height: 1.6;
}

.source-stamp {
  min-width: 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 249, 225, 0.18);
  display: grid;
  gap: 5px;
}

.source-stamp span {
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.source-stamp strong {
  overflow-wrap: anywhere;
  font-size: 0.92rem;
}

.source-stamp small {
  font-size: 0.76rem;
  line-height: 1.45;
}

.data-note {
  min-width: 0;
  padding: 17px;
  border: 1px solid rgba(204, 179, 99, 0.34);
  border-radius: 14px;
  color: var(--gold-ink);
  background: var(--warning-pale);
}

.data-note strong {
  display: block;
  font-size: 0.85rem;
}

.data-note p {
  margin: 6px 0 0;
  font-size: 0.8rem;
  line-height: 1.55;
}

.dashboard-section {
  min-width: 0;
  margin-top: 34px;
}

.section-heading {
  margin-bottom: 18px;
  display: grid;
  gap: 12px;
}

.section-heading h2,
.panel-card h2,
.risk-card h2 {
  margin: 8px 0 0;
  font-size: clamp(1.55rem, 7vw, 2.45rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.section-heading > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.5;
}

.kpi-grid {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.kpi-card {
  min-width: 0;
  min-height: 164px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-card--primary {
  border-top: 4px solid var(--gold);
}

.kpi-card--emphasis {
  color: var(--cream);
  background: var(--forest);
}

.kpi-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

.kpi-card--emphasis p,
.kpi-card--emphasis span {
  color: rgba(255, 249, 225, 0.72);
}

.kpi-card strong {
  margin: 22px 0 8px;
  overflow-wrap: anywhere;
  font-size: clamp(1.55rem, 7vw, 2.15rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.035em;
}

.kpi-card span {
  color: var(--ink-soft);
  font-size: 0.77rem;
  line-height: 1.45;
}

.dashboard-grid {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.dashboard-grid--risk {
  margin-top: 16px;
}

.risk-card,
.panel-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
}

.risk-card {
  padding: 28px 24px;
  color: var(--forest);
  background: linear-gradient(135deg, #efd98b, var(--gold-pale));
}

.risk-card .portal-kicker {
  color: var(--gold-ink);
}

.risk-card__heading,
.panel-card__heading {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.risk-dot {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 3px;
  border: 4px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: var(--gold-ink);
  box-shadow: 0 0 0 1px rgba(30, 49, 38, 0.2);
}

.risk-card__value {
  display: block;
  margin-top: 40px;
  overflow-wrap: anywhere;
  color: var(--forest) !important;
  font-size: clamp(2.2rem, 11vw, 4.3rem);
  font-variant-numeric: tabular-nums;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.risk-card__ratio {
  margin: 12px 0 0;
  color: var(--gold-ink);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.45;
}

.risk-card__note {
  margin-top: 38px;
  padding-top: 18px;
  border-top: 1px solid rgba(30, 49, 38, 0.23);
  display: grid;
  gap: 5px;
}

.risk-card__note strong {
  font-size: 0.82rem;
}

.risk-card__note span {
  max-width: 38rem;
  color: #3f4c42;
  font-size: 0.79rem;
  line-height: 1.55;
}

.panel-card {
  padding: 28px 24px;
  background: rgba(255, 255, 255, 0.8);
}

.panel-card__heading--split {
  display: grid;
}

.panel-card__intro {
  margin: 20px 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.55;
}

.panel-total {
  min-width: 0;
  display: grid;
  gap: 4px;
  text-align: left;
}

.panel-total span {
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.panel-total strong {
  overflow-wrap: anywhere;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.definition-list {
  margin: 26px 0 0;
}

.definition-list > div {
  min-width: 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 7px;
}

.definition-list dt {
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.5;
}

.definition-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--forest);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.55;
}

.panel-card--history {
  padding-bottom: 34px;
}

.chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.chart-legend i {
  width: 20px;
  height: 5px;
  border-radius: 999px;
  background: var(--gold);
}

.income-chart {
  min-width: 0;
  margin-top: 28px;
  display: grid;
  gap: 24px;
}

.chart-row {
  min-width: 0;
}

.chart-row__top,
.chart-row__meta,
.record-item__top,
.record-item__bottom {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.chart-row__top > div:first-child,
.chart-row__value {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.chart-row__top > div:first-child strong {
  font-size: 0.88rem;
}

.chart-row__top span,
.chart-row__meta,
.chart-row__value span {
  color: var(--ink-soft);
  font-size: 0.69rem;
  line-height: 1.45;
}

.chart-row__value {
  text-align: right;
}

.chart-row__value strong {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.chart-row--negative .chart-row__value strong {
  color: var(--danger);
}

.chart-row__track {
  width: 100%;
  height: 8px;
  margin-top: 11px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(30, 49, 38, 0.08);
}

.chart-row__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
}

.chart-row--negative .chart-row__fill {
  background: var(--danger);
}

.chart-row__fill--0 { width: 0; }
.chart-row__fill--1 { width: 5%; }
.chart-row__fill--2 { width: 10%; }
.chart-row__fill--3 { width: 15%; }
.chart-row__fill--4 { width: 20%; }
.chart-row__fill--5 { width: 25%; }
.chart-row__fill--6 { width: 30%; }
.chart-row__fill--7 { width: 35%; }
.chart-row__fill--8 { width: 40%; }
.chart-row__fill--9 { width: 45%; }
.chart-row__fill--10 { width: 50%; }
.chart-row__fill--11 { width: 55%; }
.chart-row__fill--12 { width: 60%; }
.chart-row__fill--13 { width: 65%; }
.chart-row__fill--14 { width: 70%; }
.chart-row__fill--15 { width: 75%; }
.chart-row__fill--16 { width: 80%; }
.chart-row__fill--17 { width: 85%; }
.chart-row__fill--18 { width: 90%; }
.chart-row__fill--19 { width: 95%; }
.chart-row__fill--20 { width: 100%; }

.chart-row__meta {
  margin-top: 9px;
  align-items: center;
  flex-wrap: wrap;
}

.chart-row__meta p {
  flex-basis: 100%;
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.73rem;
  line-height: 1.5;
}

.record-list,
.partners-list,
.policies-list {
  margin-top: 24px;
  display: grid;
  gap: 10px;
}

.record-item,
.partner-item,
.policy-item {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 249, 225, 0.27);
}

.record-item__top {
  align-items: center;
}

.record-item__top strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.88rem;
}

.record-item > p {
  margin: 13px 0 16px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.55;
}

.record-item__bottom {
  align-items: flex-end;
}

.record-item__bottom span {
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.4;
}

.record-item__bottom strong {
  max-width: 56%;
  overflow-wrap: anywhere;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.quality-flags,
.missing-data {
  margin-top: 22px;
  padding: 18px;
  border-radius: 14px;
}

.quality-flags {
  border: 1px solid rgba(102, 83, 21, 0.25);
  color: var(--gold-ink);
  background: var(--warning-pale);
}

.missing-data {
  border: 1px solid rgba(122, 46, 37, 0.2);
  color: var(--danger);
  background: var(--danger-pale);
}

.quality-flags > strong,
.missing-data > strong {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.quality-flag {
  margin-top: 13px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: flex-start;
  gap: 8px;
}

.quality-flag span {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(102, 83, 21, 0.32);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 900;
}

.quality-flag p {
  margin: 1px 0 0;
  font-size: 0.78rem;
  line-height: 1.55;
}

.missing-data ul {
  margin: 12px 0 0;
  padding-left: 19px;
}

.missing-data li {
  font-size: 0.78rem;
  line-height: 1.55;
}

.partner-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.partner-item__monogram {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--cream);
  background: var(--forest);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 800;
}

.partner-item > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.partner-item > div strong,
.partner-item > div span {
  overflow-wrap: anywhere;
}

.partner-item > div strong {
  font-size: 0.84rem;
}

.partner-item > div span {
  color: var(--ink-soft);
  font-size: 0.69rem;
}

.partner-item .record-status {
  grid-column: 2;
  width: fit-content;
}

.policy-item > div:first-child {
  display: grid;
  gap: 3px;
}

.policy-item > div:first-child strong {
  overflow-wrap: anywhere;
  font-size: 0.85rem;
}

.policy-item > div:first-child span {
  color: var(--ink-soft);
  font-size: 0.69rem;
}

.policy-item > p {
  margin: 13px 0;
  color: var(--ink-soft);
  font-size: 0.77rem;
  line-height: 1.55;
}

.policy-item > div:last-child {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 12px;
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.count-badge {
  width: fit-content;
  min-height: 28px;
  color: var(--ink-soft);
  font-size: 0.67rem;
}

.empty-copy {
  margin: 24px 0 0;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.5;
}

.control-strip {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.68);
}

.control-strip > div {
  min-width: 0;
  min-height: 98px;
  padding: 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  align-content: center;
  gap: 8px;
}

.control-strip > div:nth-child(2n) {
  border-right: 0;
}

.control-strip > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.control-strip span {
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.control-strip strong {
  overflow-wrap: anywhere;
  font-size: 0.87rem;
  font-variant-numeric: tabular-nums;
}

.dashboard-footnote {
  padding: 20px 4px 0;
  border-top: 1px solid var(--line-strong);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.55;
}

.dashboard-footnote strong {
  flex: 0 0 auto;
  color: var(--forest);
}

.portal-footer {
  width: min(100% - 28px, 1320px);
  margin: 0 auto;
  padding: 28px 0 calc(34px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-strong);
  color: var(--ink-soft);
  text-align: center;
  font-size: 0.74rem;
  line-height: 1.5;
}

.portal-footer p {
  margin: 0 0 5px;
}

.portal-footer strong {
  color: var(--forest);
}

@media (min-width: 480px) {
  .portal-header__inner,
  .portal-main,
  .portal-footer {
    width: min(100% - 40px, 1320px);
  }

  .portal-home img {
    width: 200px;
  }

  .account-area {
    gap: 14px;
  }

  .account-copy {
    max-width: 150px;
  }

  .account-copy strong {
    font-size: 0.82rem;
  }

  .account-copy span,
  .sign-out {
    font-size: 0.74rem;
  }

  .portal-main {
    padding-top: 52px;
  }

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

  .panel-card__heading--split,
  .section-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .panel-total {
    text-align: right;
  }

  .definition-list > div {
    grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
    gap: 18px;
  }

  .definition-list dd {
    text-align: right;
  }

  .partner-item {
    grid-template-columns: 40px minmax(0, 1fr) auto;
  }

  .partner-item .record-status {
    grid-column: auto;
  }
}

@media (min-width: 760px) {
  .login-shell {
    width: min(100% - 64px, 1120px);
    padding: 70px 0 48px;
    grid-template-columns: minmax(260px, 1fr) minmax(360px, 480px);
    align-items: center;
    gap: clamp(56px, 9vw, 130px);
  }

  .login-brand {
    align-self: start;
    padding-top: 48px;
  }

  .login-logo {
    width: min(100%, 420px);
  }

  .login-panel {
    padding: clamp(34px, 5vw, 52px);
    border-radius: 28px;
  }

  .portal-header__inner {
    min-height: 98px;
  }

  .portal-home img {
    width: 235px;
  }

  .account-copy {
    max-width: 240px;
  }

  .account-copy strong {
    font-size: 0.9rem;
  }

  .account-copy span {
    font-size: 0.75rem;
  }

  .sign-out {
    padding-inline: 16px;
    font-size: 0.8rem;
  }

  .portal-main {
    padding: 68px 0 86px;
  }

  .portal-hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    align-items: end;
    gap: 56px;
  }

  .dashboard-skeleton,
  .dashboard-message,
  .dashboard-content {
    margin-top: 52px;
  }

  .skeleton-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .dashboard-message {
    grid-template-columns: 62px minmax(0, 1fr);
    padding: 50px;
  }

  .closing-card {
    padding: 44px;
    grid-template-columns: minmax(0, 1fr) minmax(210px, 0.36fr);
    align-items: end;
    gap: 40px;
  }

  .closing-card .data-note {
    grid-column: 1 / -1;
  }

  .source-stamp {
    padding: 0 0 2px 28px;
    border-top: 0;
    border-left: 1px solid rgba(255, 249, 225, 0.18);
  }

  .dashboard-section {
    margin-top: 46px;
  }

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

  .kpi-card {
    min-height: 182px;
    padding: 24px;
  }

  .risk-card,
  .panel-card {
    padding: 34px;
  }

  .dashboard-grid--risk .risk-card,
  .dashboard-grid--risk .panel-card {
    min-height: 420px;
  }

  .control-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .control-strip > div,
  .control-strip > div:nth-child(2n),
  .control-strip > div:nth-last-child(-n + 2) {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .control-strip > div:last-child {
    border-right: 0;
  }
}

@media (min-width: 1120px) {
  .closing-card {
    padding: 52px;
  }

  .risk-card,
  .panel-card {
    padding: 40px;
  }
}

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