:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-soft: #f1eee7;
  --text: #1c1d1f;
  --muted: #656b73;
  --line: #ddd7cc;
  --positive: #0f7a52;
  --negative: #ba3f3f;
  --amber: #a96413;
  --shadow: 0 12px 28px rgba(31, 28, 23, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "YuGothic",
    "Noto Sans JP", "Segoe UI", sans-serif;
}

.app-shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

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

.last-updated {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--amber);
  font-size: 0.88rem;
  font-weight: 700;
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: 2.7rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.version-label {
  color: var(--muted);
  font-size: 0.36em;
  font-weight: 800;
  vertical-align: baseline;
  white-space: nowrap;
}

.mobile-label {
  display: none;
}

.account-link {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.account-link:hover {
  border-color: #bdb5a9;
  background: var(--surface-soft);
}

.account-link:focus-visible {
  outline: 3px solid rgba(28, 29, 31, 0.22);
  outline-offset: 2px;
}

.account-link-mark {
  font-size: 0.9rem;
  font-weight: 900;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.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;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.76rem;
  font-weight: 800;
}

td {
  font-variant-numeric: tabular-nums;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.row-missing {
  color: var(--muted);
}

.show-all-row {
  color: var(--muted);
}

.show-all-row td {
  padding: 0;
  text-align: center;
}

.show-all-row:hover td {
  background: var(--surface-soft);
}

.show-all-button {
  display: block;
  width: 100%;
  border: 0;
  padding: 15px 18px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
}

.show-all-button:focus-visible {
  outline: 3px solid rgba(15, 122, 82, 0.22);
  outline-offset: -3px;
}

.measurement-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  height: 24px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.75rem;
  font-weight: 800;
}

.status-measured {
  color: var(--positive);
  background: rgba(15, 122, 82, 0.1);
}

.status-missing {
  color: var(--muted);
  background: var(--surface-soft);
}

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

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 24px, 920px);
    padding-top: 20px;
  }

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

  .header-actions {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 12px;
  }

  h1 {
    font-size: 1.95rem;
  }

  table {
    display: block;
    width: 100%;
    min-width: 0;
    table-layout: auto;
    font-size: 0.78rem;
  }

  thead,
  tbody {
    display: block;
    width: 100%;
  }

  thead tr,
  tbody tr:not(.show-all-row) {
    display: grid;
    grid-template-columns: 38% 22% 40%;
    width: 100%;
    border-bottom: 1px solid var(--line);
  }

  thead tr {
    background: var(--surface-soft);
  }

  th:nth-child(1),
  td:nth-child(1) {
    width: 38%;
  }

  th:nth-child(2),
  td:nth-child(2) {
    width: 22%;
  }

  th:nth-child(3),
  td:nth-child(3) {
    width: 0;
    display: none;
  }

  th:nth-child(4),
  td:nth-child(4) {
    width: 40%;
    text-align: right;
  }

  th:nth-child(5),
  td:nth-child(5) {
    display: none;
  }

  th,
  td {
    display: block;
    border-bottom: 0;
    padding: 12px 6px;
  }

  th {
    background: transparent;
  }

  .show-all-row,
  .show-all-row td {
    display: block;
    width: 100%;
  }

  .desktop-label {
    display: none;
  }

  .mobile-label {
    display: inline;
  }

  .measurement-status {
    min-width: 0;
    height: 22px;
    padding: 0 6px;
    font-size: 0.68rem;
  }
}
