:root {
  color-scheme: light;
  --bg: #f5f6f2;
  --surface: #ffffff;
  --ink: #151515;
  --soft-ink: #4f5652;
  --muted: #747b76;
  --line: #dde2da;
  --line-strong: #cbd2c8;
  --accent: #2458d9;
  --accent-soft: #eaf0ff;
  --ok: #24633e;
  --warn: #9b5a14;
  --radius: 8px;
  --max: 1040px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, 0) 240px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.42;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

h1,
h2,
p,
dl,
dd {
  margin: 0;
}

.shell {
  width: min(calc(100% - 36px), var(--max));
  margin: 0 auto;
  padding: 18px 0 34px;
}

.topbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--soft-ink);
  font-size: 14px;
  font-weight: 850;
}

.brand img {
  width: 32px;
  height: 32px;
  display: block;
  border-radius: var(--radius);
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

button,
.button-link,
.paper-row a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

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

.button-link,
.paper-row a {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.button-link.secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.dashboard {
  margin-top: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 16px 44px rgba(17, 24, 39, .07);
}

.dashboard-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1.15;
  text-transform: uppercase;
}

h1 {
  margin-top: 7px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: .98;
  font-weight: 930;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.subtitle {
  max-width: 720px;
  margin-top: 10px;
  color: var(--soft-ink);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.score-box {
  width: 130px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcf9;
}

.score-box span,
.score-box small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.score-box strong {
  display: block;
  margin: 6px 0;
  color: var(--accent);
  font-size: 52px;
  line-height: .95;
  font-weight: 950;
}

.state-list {
  border-bottom: 1px solid var(--line);
}

.state-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) minmax(220px, .54fr);
  gap: 18px;
  align-items: baseline;
  min-height: 58px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.state-row:first-child {
  border-top: 0;
}

.state-row > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.state-row strong {
  min-width: 0;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.state-row em {
  min-width: 0;
  color: var(--soft-ink);
  font-size: 14px;
  font-style: normal;
  overflow-wrap: anywhere;
}

.paper-row {
  align-items: center;
}

.paper-row a {
  width: max-content;
  min-width: 92px;
  justify-self: start;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.metrics div {
  min-width: 0;
  padding: 0 18px;
  border-left: 1px solid var(--line);
}

.metrics div:first-child {
  padding-left: 0;
  border-left: 0;
}

.metrics dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.metrics dd {
  margin-top: 7px;
  color: var(--accent);
  font-size: 32px;
  line-height: 1;
  font-weight: 940;
}

.lower {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(270px, .85fr);
  gap: 28px;
  padding-top: 22px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

h2 {
  font-size: 17px;
  line-height: 1.2;
  font-weight: 880;
  letter-spacing: 0;
}

.section-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-align: right;
}

.dimensions,
.journal {
  display: grid;
  gap: 0;
}

.dimension {
  display: grid;
  grid-template-columns: minmax(144px, .34fr) minmax(0, 1fr) 46px;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  border-top: 1px solid var(--line);
}

.dimension:first-child,
.journal-item:first-child {
  border-top: 0;
}

.dimension strong {
  min-width: 0;
  color: var(--soft-ink);
  font-size: 14px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0ea;
}

.bar i {
  width: var(--score);
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--accent);
}

.score {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-align: right;
}

.journal-item {
  min-width: 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.journal-item strong {
  display: block;
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 830;
  overflow-wrap: anywhere;
}

.journal-item span {
  display: block;
  min-width: 0;
  margin-top: 3px;
  color: var(--soft-ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

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

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

.packet {
  margin-top: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 16px 44px rgba(17, 24, 39, .07);
}

.packet * {
  min-width: 0;
}

.packet-hero {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.packet-section {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.packet-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.packet-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .05em;
  line-height: 1.15;
  text-transform: uppercase;
}

.packet-head h2 {
  margin-top: 8px;
  font-size: 20px;
  line-height: 1.15;
}

.packet-grid {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(260px, 1fr);
  gap: 24px;
}

.packet p,
.packet li,
.fit-table span {
  color: var(--soft-ink);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.packet ul {
  margin: 0;
  padding-left: 18px;
}

.packet li + li {
  margin-top: 7px;
}

.fit-table {
  display: grid;
  border-top: 1px solid var(--line);
}

.fit-table div {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.fit-table div:last-child {
  border-bottom: 0;
}

.fit-table strong {
  font-size: 15px;
}

.review-note {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcf9;
}

.sources a {
  color: var(--accent);
  font-weight: 760;
}

@media (max-width: 860px) {
  .dashboard {
    padding: 22px;
  }

  .dashboard-head,
  .lower,
  .packet-section,
  .packet-grid {
    grid-template-columns: 1fr;
  }

  .score-box {
    width: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 10px;
    align-items: baseline;
  }

  .score-box strong {
    margin: 0;
    font-size: 42px;
  }

  .score-box small {
    text-align: right;
  }

  .state-row {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .state-row em,
  .paper-row a {
    grid-column: 2;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 16px;
  }

  .metrics div:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .shell {
    width: calc(100% - 22px);
    padding-top: 12px;
  }

  .topbar,
  .actions {
    align-items: stretch;
  }

  .topbar {
    flex-direction: column;
  }

  .brand,
  .actions,
  .actions > * {
    width: 100%;
  }

  .actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  button,
  .button-link {
    min-height: 40px;
  }

  .dashboard {
    margin-top: 12px;
    padding: 18px;
  }

  .packet {
    margin-top: 12px;
    padding: 18px;
  }

  h1 {
    font-size: 36px;
  }

  .packet h1 {
    font-size: 32px;
    line-height: 1.02;
    word-break: break-word;
  }

  .state-row,
  .dimension,
  .fit-table div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .state-row em,
  .paper-row a {
    grid-column: auto;
  }

  .paper-row a {
    width: 100%;
  }

  .metrics {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .metrics div,
  .metrics div:nth-child(3) {
    padding: 12px 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .metrics div:first-child {
    border-top: 0;
  }

  .section-head {
    display: block;
  }

  .score-box {
    display: block;
  }

  .score-box strong {
    margin: 4px 0;
    font-size: 48px;
  }

  .score-box small {
    text-align: left;
  }

  .section-head span {
    display: block;
    margin-top: 4px;
    text-align: left;
  }

  .score {
    text-align: left;
  }
}
