:root {
  color-scheme: light;
  --paper: #f5f4ef;
  --paper-2: #ecebe4;
  --ink: #17201c;
  --muted: #6e7772;
  --line: #d9d9d1;
  --green: #176b4b;
  --green-dark: #0f5038;
  --green-soft: #dfece5;
  --yellow: #bc7a12;
  --yellow-soft: #f7eacb;
  --red: #b64138;
  --red-soft: #f5dfdc;
  --white: #fff;
  --shadow: 0 18px 60px rgba(26, 42, 34, 0.09);
  font-family:
    Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% -10%, rgba(23, 107, 75, 0.1), transparent 30rem),
    var(--paper);
}

.not-found-cover {
  display: flex;
  min-height: 100dvh;
  padding: 32px;
  color: #111827;
  background: #fff;
  flex-direction: column;
  justify-content: space-between;
  font-family: Arial, Helvetica, sans-serif;
  text-align: center;
}

.not-found-inner {
  width: min(100%, 620px);
  margin: auto;
}

.not-found-brand {
  margin: 0 0 54px;
  color: #f48120;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.not-found-code {
  display: flex;
  justify-content: center;
  color: #202938;
  font-size: clamp(96px, 22vw, 164px);
  font-weight: 700;
  letter-spacing: -0.08em;
  line-height: 0.85;
  user-select: none;
}

.zero-trigger {
  position: relative;
  width: 0.72em;
  padding: 0;
  touch-action: none;
  cursor: default;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
}

.zero-trigger::after {
  position: absolute;
  right: 10%;
  bottom: -20px;
  left: 10%;
  height: 3px;
  content: "";
  border-radius: 99px;
  background: #f48120;
  transform: scaleX(0);
  transform-origin: left;
}

.zero-trigger.is-pressing::after {
  transition: transform 1.4s linear;
  transform: scaleX(1);
}

.not-found-cover h1 {
  margin: 42px 0 14px;
  font-size: 28px;
}

.not-found-cover .not-found-inner > p:not(.not-found-brand) {
  max-width: 520px;
  margin: 0 auto 30px;
  color: #6b7280;
  font-size: 15px;
  line-height: 1.7;
}

.not-found-cover a {
  display: inline-block;
  padding: 12px 20px;
  color: #fff;
  border-radius: 6px;
  background: #2563eb;
  font-size: 14px;
  text-decoration: none;
}

.not-found-cover footer {
  color: #9ca3af;
  font-size: 12px;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
  padding: 0 max(22px, calc((100vw - 1080px) / 2));
  border-bottom: 1px solid rgba(23, 32, 28, 0.08);
  background: rgba(245, 244, 239, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--white);
  border-radius: 14px;
  background: var(--green);
  box-shadow: 0 7px 20px rgba(23, 107, 75, 0.2);
}

.brand-mark svg {
  width: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.brand-mark .brand-check {
  stroke-width: 2;
}

.brand > span:last-child {
  display: grid;
  line-height: 1.1;
}

.brand strong {
  letter-spacing: 0.08em;
  font-size: 16px;
}

.brand small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  color: var(--green);
  border: 1px solid rgba(23, 107, 75, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 700;
}

.live-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #30a46c;
  box-shadow: 0 0 0 4px rgba(48, 164, 108, 0.12);
  animation: pulse 2s infinite;
}

.page {
  min-height: calc(100dvh - 78px);
  padding: 72px 24px 132px;
}

.report-wrap,
.stats-wrap {
  width: min(100%, 800px);
  margin: 0 auto;
}

.report-wrap {
  width: min(100%, 590px);
}

.eyebrow {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.page h1 {
  margin: 17px 0 0;
  font-family: "Songti SC", "Noto Serif SC", Georgia, serif;
  font-size: clamp(42px, 7vw, 68px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.page h1 em {
  color: var(--green);
  font-style: normal;
}

.lead {
  max-width: 440px;
  margin: 24px 0 34px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.checkin-card {
  padding: 28px;
  border: 1px solid rgba(23, 32, 28, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.checkin-card label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.input-wrap {
  position: relative;
}

.input-wrap svg {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 22px;
  transform: translateY(-50%);
  fill: none;
  stroke: #7b837f;
  stroke-linecap: round;
  stroke-width: 1.6;
}

.input-wrap input {
  width: 100%;
  height: 58px;
  padding: 0 16px 0 50px;
  color: var(--ink);
  outline: none;
  border: 1.5px solid #d6d8d3;
  border-radius: 14px;
  background: var(--white);
  font-size: 17px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrap input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(23, 107, 75, 0.1);
}

.input-wrap input::placeholder {
  color: #a1a7a3;
}

.field-hint {
  margin: 9px 2px 20px;
  color: #8b928e;
  font-size: 11px;
}

.safe-button {
  width: 100%;
  height: 60px;
  cursor: pointer;
  border: 0;
  border-radius: 15px;
  color: var(--white);
  background: var(--green);
  box-shadow: 0 12px 25px rgba(23, 107, 75, 0.22);
  font-size: 16px;
  font-weight: 750;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
}

.safe-button:hover {
  background: var(--green-dark);
  box-shadow: 0 15px 30px rgba(23, 107, 75, 0.27);
  transform: translateY(-1px);
}

.safe-button:active {
  transform: translateY(1px);
}

.safe-button:disabled {
  cursor: wait;
  opacity: 0.8;
}

.button-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.button-label svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.button-loader {
  display: none;
  width: 22px;
  height: 22px;
  margin: auto;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.safe-button.is-loading .button-label {
  display: none;
}

.safe-button.is-loading .button-loader {
  display: block;
}

.form-message {
  min-height: 18px;
  margin: 12px 0 -6px;
  color: var(--red);
  font-size: 12px;
  text-align: center;
}

.form-message:empty {
  min-height: 0;
  margin: 0;
}

.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 19px;
  color: #858d88;
  font-size: 11px;
}

.privacy-note svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.page-stats {
  padding-top: 52px;
}

.stats-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.stats-heading h1 {
  margin-top: 10px;
  font-family: inherit;
  font-size: clamp(36px, 5vw, 52px);
  letter-spacing: -0.04em;
}

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

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  cursor: pointer;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.55);
  transition: border-color 0.2s, transform 0.2s;
}

.icon-button:hover {
  border-color: var(--green);
}

.icon-button.is-spinning svg {
  animation: spin 0.7s linear infinite;
}

.icon-button svg,
.search-box svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.summary-card {
  position: relative;
  min-height: 138px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid rgba(23, 32, 28, 0.06);
  border-radius: 20px;
}

.summary-card::after {
  position: absolute;
  right: -28px;
  bottom: -40px;
  width: 100px;
  height: 100px;
  content: "";
  border-radius: 50%;
  background: currentColor;
  opacity: 0.06;
}

.summary-safe {
  color: var(--green);
  background: var(--green-soft);
}

.summary-warning {
  color: var(--yellow);
  background: var(--yellow-soft);
}

.summary-danger {
  color: var(--red);
  background: var(--red-soft);
}

.summary-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.5);
}

.summary-icon svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.summary-card strong {
  display: block;
  margin-top: 14px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.summary-card small {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  font-weight: 700;
}

.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 18px 2px 42px;
  color: var(--muted);
  font-size: 11px;
}

.status-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot.safe {
  background: var(--green);
}

.dot.warning {
  background: var(--yellow);
}

.dot.danger {
  background: var(--red);
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.list-head h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.list-head h2 span {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  margin-left: 5px;
  place-items: center;
  color: var(--muted);
  border-radius: 999px;
  background: var(--paper-2);
  font-size: 11px;
}

.search-box {
  position: relative;
  color: var(--muted);
}

.search-box svg {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 16px;
  pointer-events: none;
  transform: translateY(-50%);
}

.search-box input {
  width: 150px;
  height: 38px;
  padding: 0 12px 0 34px;
  outline: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

.search-box input:focus {
  border-color: var(--green);
}

.people-list {
  display: grid;
  gap: 10px;
}

.person-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid rgba(23, 32, 28, 0.07);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.62);
  animation: rise 0.35s both;
}

.person-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px;
  font-size: 15px;
  font-weight: 800;
}

.person-row.status-safe .person-avatar {
  color: var(--green);
  background: var(--green-soft);
}

.person-row.status-warning .person-avatar {
  color: var(--yellow);
  background: var(--yellow-soft);
}

.person-row.status-danger .person-avatar {
  color: var(--red);
  background: var(--red-soft);
}

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

.person-main strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-main small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.status-badge {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.status-safe .status-badge {
  color: var(--green);
  background: var(--green-soft);
}

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

.status-danger .status-badge {
  color: var(--red);
  background: var(--red-soft);
}

.empty-state {
  padding: 55px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state > span {
  display: grid;
  width: 58px;
  height: 58px;
  margin: auto;
  place-items: center;
  color: var(--green);
  border-radius: 20px;
  background: var(--green-soft);
}

.empty-state svg {
  width: 29px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.empty-state h3 {
  margin: 18px 0 6px;
  color: var(--ink);
  font-size: 16px;
}

.empty-state p {
  margin: 0;
  font-size: 12px;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: min(calc(100% - 32px), 390px);
  height: 68px;
  padding: 6px;
  border: 1px solid rgba(23, 32, 28, 0.1);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 45px rgba(20, 33, 27, 0.15);
  transform: translateX(-50%);
  backdrop-filter: blur(20px);
}

.nav-item {
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 16px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  transition: color 0.2s, background 0.2s;
}

.nav-item.is-active {
  color: var(--white);
  background: var(--green);
}

.nav-item svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.toast {
  position: fixed;
  z-index: 50;
  top: 92px;
  left: 50%;
  display: flex;
  width: min(calc(100% - 32px), 360px);
  padding: 14px;
  pointer-events: none;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(23, 107, 75, 0.14);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, -18px);
  transition: opacity 0.25s, transform 0.25s;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--white);
  border-radius: 13px;
  background: var(--green);
}

.toast-icon svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.toast strong,
.toast small {
  display: block;
}

.toast strong {
  font-size: 13px;
}

.toast small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  50% {
    opacity: 0.5;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
}

@media (min-width: 900px) {
  .page-report {
    display: grid;
    align-items: center;
    padding-top: 30px;
  }
}

@media (max-width: 620px) {
  .topbar {
    height: 70px;
    padding: 0 18px;
  }

  .brand small,
  .live-pill {
    display: none;
  }

  .page {
    min-height: calc(100dvh - 70px);
    padding: 50px 18px 120px;
  }

  .page h1 {
    font-size: clamp(40px, 12vw, 54px);
  }

  .checkin-card {
    padding: 22px;
    border-radius: 21px;
  }

  .summary-grid {
    gap: 8px;
  }

  .summary-card {
    min-height: 122px;
    padding: 15px 13px;
    border-radius: 17px;
  }

  .summary-card strong {
    font-size: 26px;
  }

  .status-legend {
    gap: 11px;
    margin-bottom: 34px;
  }

  .list-head {
    align-items: flex-start;
  }

  .search-box input {
    width: 124px;
  }

  .person-row {
    padding: 14px;
  }
}

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