:root {
  --paper: #f5f0e5;
  --paper-light: #fbf8f1;
  --ink: #1d1c18;
  --ink-soft: #666156;
  --line: rgba(29, 28, 24, 0.13);
  --line-strong: rgba(29, 28, 24, 0.22);
  --red: #b53a2d;
  --red-dark: #8f2b22;
  --red-soft: #ead1ca;
  --gold: #bd8a3c;
  --blue: #315c74;
  --green: #4e6b55;
  --white: #fffdf8;
  --shadow: 0 24px 70px rgba(44, 35, 20, 0.1);
  --radius: 22px;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 3%, rgba(181, 58, 45, 0.07), transparent 28rem),
    radial-gradient(circle at 92% 18%, rgba(189, 138, 60, 0.08), transparent 25rem),
    var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

button {
  color: inherit;
}

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

.paper-grain {
  position: fixed;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    repeating-linear-gradient(0deg, rgba(70, 55, 37, 0.025) 0, rgba(70, 55, 37, 0.025) 1px, transparent 1px, transparent 4px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0, rgba(255, 255, 255, 0.12) 1px, transparent 1px, transparent 7px);
  mix-blend-mode: multiply;
}

[hidden] {
  display: none !important;
}

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

.site-header,
.admin-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1240px, calc(100% - 64px));
  min-height: 88px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-seal {
  display: grid;
  width: 42px;
  height: 42px;
  color: var(--paper-light);
  background: var(--red);
  border-radius: 7px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 700;
  place-items: center;
  transform: rotate(-2deg);
}

.brand > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand strong {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.08em;
}

.brand small {
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  color: var(--ink-soft);
  font-size: 14px;
}

.site-nav a {
  position: relative;
  padding: 8px 0;
  transition: color 160ms ease;
}

.site-nav a::after {
  position: absolute;
  right: 0;
  bottom: 1px;
  left: 0;
  height: 1px;
  background: var(--red);
  content: "";
  opacity: 0;
  transform: scaleX(0.5);
  transition: 160ms ease;
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

.site-nav .nav-admin {
  color: var(--red);
}

.account-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.55);
  cursor: pointer;
  font-size: 13px;
  transition: 160ms ease;
}

.account-button:hover {
  border-color: var(--ink);
  background: var(--white);
}

.account-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(181, 58, 45, 0.11);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: clamp(48px, 8vw, 120px);
  align-items: center;
  width: min(1180px, calc(100% - 64px));
  min-height: 610px;
  margin: 0 auto;
  padding: 76px 0 96px;
}

.hero-copy {
  animation: rise-in 650ms ease both;
}

.eyebrow,
.section-kicker {
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
}

.eyebrow span {
  width: 28px;
  height: 1px;
  background: var(--red);
}

.hero h1 {
  margin: 22px 0 25px;
  font-family: var(--serif);
  font-size: clamp(52px, 6.3vw, 88px);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.hero h1 em {
  color: var(--red);
  font-style: normal;
}

.hero-intro {
  max-width: 580px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  transition: 160ms ease;
}

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

.button-primary {
  color: #fffaf3;
  background: var(--red);
  box-shadow: 0 12px 24px rgba(181, 58, 45, 0.2);
}

.button-primary:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
}

.button-primary span {
  font-size: 18px;
  font-weight: 400;
}

.button-quiet {
  border-color: var(--line-strong);
  background: transparent;
}

.button-quiet:hover {
  background: var(--white);
}

.cloud-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 26px 0 0;
  color: #82796c;
  font-size: 11px;
}

.cloud-icon {
  display: grid;
  width: 21px;
  height: 21px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 11px;
  place-items: center;
}

.hero-card {
  position: relative;
  min-height: 390px;
  padding: 36px;
  overflow: hidden;
  color: #f7f0e3;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), transparent 40%),
    #1c1d19;
  border-radius: 4px 44px 4px 44px;
  box-shadow: 0 35px 60px rgba(33, 29, 22, 0.2);
  animation: rise-in 700ms 120ms ease both;
}

.hero-card::before {
  position: absolute;
  right: -90px;
  bottom: -120px;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  box-shadow:
    0 0 0 30px rgba(255, 255, 255, 0.025),
    0 0 0 65px rgba(255, 255, 255, 0.018);
  content: "";
}

.hero-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255, 250, 243, 0.62);
  font-size: 12px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
}

.live-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d96252;
  box-shadow: 0 0 0 4px rgba(217, 98, 82, 0.14);
  animation: pulse 2s infinite;
}

.hero-score {
  display: flex;
  flex-direction: column;
  margin-top: 58px;
}

.hero-score > span {
  font-family: var(--serif);
  font-size: clamp(68px, 8vw, 108px);
  letter-spacing: -0.06em;
  line-height: 1;
}

.hero-score small {
  margin-top: 12px;
  color: rgba(255, 250, 243, 0.56);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.hero-stats {
  position: absolute;
  right: 36px;
  bottom: 34px;
  left: 36px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-stats > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 20px;
}

.hero-stats > div + div {
  padding-left: 30px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-stats strong {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
}

.hero-stats span {
  color: rgba(255, 250, 243, 0.5);
  font-size: 10px;
}

.hero-card-mark {
  position: absolute;
  top: 38%;
  right: 36px;
  display: grid;
  width: 48px;
  height: 48px;
  color: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  font-family: var(--serif);
  place-items: center;
  transform: rotate(6deg);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.section-shell {
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
  padding: 100px 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 38px;
}

.section-heading h2,
.admin-title-row h1 {
  margin: 9px 0 0;
  font-family: var(--serif);
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 600;
  letter-spacing: -0.04em;
}

.section-description {
  max-width: 460px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.8;
}

.compact-heading {
  margin-bottom: 28px;
}

.compact-heading h2 {
  font-size: 40px;
}

.text-button {
  padding: 8px 0;
  color: var(--ink-soft);
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.dashboard {
  padding-top: 40px;
}

.member-summary {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 60px;
  align-items: center;
  padding: 28px 34px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 55px rgba(44, 35, 20, 0.06);
}

.member-identity {
  display: flex;
  align-items: center;
  gap: 18px;
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  color: var(--paper-light);
  background: var(--ink);
  border-radius: 50%;
  font-family: var(--serif);
  place-items: center;
}

.avatar-large {
  width: 62px;
  height: 62px;
  background: var(--red);
  font-size: 24px;
}

.member-identity p,
.member-metric span {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.07em;
}

.member-identity h3 {
  margin: 4px 0 3px;
  font-family: var(--serif);
  font-size: 25px;
}

.member-identity div > span {
  color: var(--ink-soft);
  font-size: 10px;
}

.member-metric {
  display: flex;
  min-width: 110px;
  flex-direction: column;
  gap: 3px;
  padding-left: 38px;
  border-left: 1px solid var(--line);
}

.member-metric strong {
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 500;
}

.member-metric.accent strong {
  color: var(--red);
}

.checkin-form {
  margin-top: 18px;
  padding: 36px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 55px rgba(44, 35, 20, 0.06);
}

.score-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.score-preview > div {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.score-preview span {
  color: var(--ink-soft);
  font-size: 12px;
}

.score-preview strong {
  color: var(--red);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}

.score-preview strong b {
  font-size: 34px;
  font-weight: 500;
}

.score-preview p {
  margin: 0;
  color: #92897c;
  font-size: 10px;
}

.checkin-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 28px;
}

.activity-group {
  min-width: 0;
  padding: 24px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #faf7f0;
}

.activity-group legend {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
}

.activity-group legend small {
  margin-left: auto;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 400;
}

.group-number {
  color: var(--red);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.group-blue .group-number {
  color: var(--blue);
}

.group-water .group-number {
  color: var(--green);
}

.activity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 62px;
  border-bottom: 1px solid var(--line);
  cursor: text;
}

.activity-row > span:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.activity-row > span:first-child small {
  color: var(--ink-soft);
  font-size: 9px;
}

.number-control {
  display: flex;
  align-items: center;
  width: 104px;
  min-width: 0;
  height: 37px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.number-control:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(181, 58, 45, 0.08);
}

.number-control input {
  width: 100%;
  min-width: 0;
  padding: 0 4px 0 10px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}

.number-control > span {
  padding-right: 9px;
  color: var(--ink-soft);
  font-size: 9px;
}

.wide-row {
  min-height: 89px;
}

.remainder-note {
  padding-top: 17px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.7;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  margin-top: 28px;
}

.form-actions p {
  margin: 0 auto 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.ranking {
  padding-top: 65px;
}

.refresh-note {
  color: var(--ink-soft);
  font-size: 10px;
}

.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  min-height: 230px;
  margin-bottom: 16px;
}

.podium-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 210px;
  padding: 25px;
  overflow: hidden;
  color: #fffaf3;
  background: #23231f;
  border-radius: 18px;
}

.podium-card.place-1 {
  min-height: 242px;
  color: var(--ink);
  background: #e4c380;
}

.podium-card.place-2 {
  background: #4d4b43;
}

.podium-card.place-3 {
  background: #7d5547;
}

.podium-card .podium-rank {
  position: absolute;
  top: 20px;
  right: 22px;
  color: rgba(255, 250, 243, 0.18);
  font-family: var(--serif);
  font-size: 72px;
  line-height: 1;
}

.podium-card.place-1 .podium-rank {
  color: rgba(29, 28, 24, 0.13);
}

.podium-label {
  margin-bottom: 18px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  opacity: 0.62;
}

.podium-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  color: var(--ink);
  background: rgba(255, 250, 243, 0.85);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 18px;
  place-items: center;
}

.podium-card h3 {
  max-width: 100%;
  margin: 0 0 6px;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-card p {
  margin: 0;
  font-size: 12px;
  opacity: 0.68;
}

.podium-card p strong {
  margin-right: 4px;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  opacity: 1;
}

.ranking-panel {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 55px rgba(44, 35, 20, 0.05);
}

.ranking-head,
.ranking-row {
  display: grid;
  grid-template-columns: 90px minmax(180px, 1fr) minmax(220px, 1.4fr) 100px;
  align-items: center;
}

.ranking-head {
  min-height: 50px;
  padding: 0 28px;
  color: var(--ink-soft);
  background: #f0ebe1;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ranking-row {
  min-height: 70px;
  padding: 0 28px;
  border-top: 1px solid var(--line);
  transition: background 140ms ease;
}

.ranking-row:hover,
.ranking-row.is-me {
  background: #fbf6ed;
}

.ranking-row.is-me {
  box-shadow: inset 3px 0 var(--red);
}

.rank-number {
  font-family: var(--serif);
  font-size: 18px;
}

.rank-number.top-rank {
  color: var(--red);
}

.ranking-member {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ranking-member .avatar {
  width: 34px;
  height: 34px;
  background: #e4ded3;
  color: var(--ink);
  font-size: 12px;
}

.ranking-member strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-tag {
  padding: 2px 6px;
  color: var(--red);
  border: 1px solid rgba(181, 58, 45, 0.22);
  border-radius: 4px;
  font-size: 8px;
}

.ranking-data {
  display: flex;
  gap: 17px;
  color: var(--ink-soft);
  font-size: 9px;
}

.ranking-data span {
  white-space: nowrap;
}

.ranking-score {
  color: var(--red);
  font-family: var(--serif);
  font-size: 22px;
  text-align: right;
}

.ranking-score small {
  margin-left: 3px;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 8px;
}

.empty-state {
  padding: 54px 20px;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: center;
}

.rules {
  padding-bottom: 115px;
}

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

.rule-card {
  min-height: 380px;
  padding: 30px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.rule-card header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.rule-icon {
  display: grid;
  width: 46px;
  height: 46px;
  color: var(--red);
  background: #f2ded8;
  border-radius: 12px;
  font-family: var(--serif);
  font-size: 19px;
  place-items: center;
}

.rule-blue .rule-icon {
  color: var(--blue);
  background: #dde8eb;
}

.rule-water .rule-icon {
  color: var(--green);
  background: #e2e9df;
}

.rule-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
}

.rule-card header p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
}

.rule-card dl {
  margin: 11px 0 0;
}

.rule-card dl > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.rule-card dt {
  font-size: 12px;
}

.rule-card dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
}

.rule-card dd small {
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 8px;
}

.rule-footnote {
  margin: 20px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.75;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 44px;
  align-items: center;
  width: min(1180px, calc(100% - 64px));
  min-height: 150px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}

.footer-brand .brand-seal {
  width: 35px;
  height: 35px;
  font-size: 18px;
}

.footer-brand strong {
  font-size: 15px;
}

.footer-brand small {
  font-family: var(--serif);
  letter-spacing: 0.08em;
}

.site-footer p,
.site-footer a {
  color: var(--ink-soft);
  font-size: 10px;
}

.site-footer a:hover {
  color: var(--red);
}

.modal {
  width: min(480px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.modal::backdrop {
  background: rgba(23, 22, 18, 0.63);
  backdrop-filter: blur(5px);
}

.modal-card {
  position: relative;
  padding: 38px;
  background: var(--paper-light);
  border-radius: 22px;
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.24);
}

.modal-close {
  position: absolute;
  top: 17px;
  right: 18px;
  width: 32px;
  height: 32px;
  color: var(--ink-soft);
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.modal-close:hover {
  background: #eee8dc;
}

.modal-kicker {
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.modal h2 {
  margin: 10px 0 9px;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.modal-intro {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.75;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin: 28px 0 22px;
  background: #eee8dd;
  border-radius: 10px;
}

.auth-tab {
  min-height: 38px;
  color: var(--ink-soft);
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.auth-tab.active {
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 2px 8px rgba(42, 35, 23, 0.08);
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 15px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
}

.field-label input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: 0;
  background: var(--white);
  font-size: 13px;
  transition: 160ms ease;
}

.field-label input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(181, 58, 45, 0.08);
}

.field-label small {
  margin-left: 5px;
  color: #9a9184;
  font-weight: 400;
}

.form-hint {
  margin: 12px 0 0;
  color: #8d8579;
  font-size: 9px;
}

.form-error {
  min-height: 16px;
  margin: 12px 0 0;
  color: var(--red);
  font-size: 10px;
}

.full-button {
  width: 100%;
  margin-top: 10px;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  max-width: min(380px, calc(100% - 48px));
  padding: 14px 18px;
  color: #fffaf3;
  background: var(--ink);
  border-radius: 10px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.2);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--red-dark);
}

/* Admin */
.admin-body {
  min-height: 100vh;
  color: #f4efe5;
  background:
    radial-gradient(circle at 80% 0, rgba(181, 58, 45, 0.18), transparent 34rem),
    #171714;
}

.admin-body .paper-grain {
  opacity: 0.12;
  mix-blend-mode: screen;
}

.admin-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.admin-brand .brand-seal {
  color: #171714;
  background: #dfbd7b;
}

.admin-brand small {
  color: rgba(255, 255, 255, 0.42);
}

.admin-header-actions,
.admin-title-actions {
  display: flex;
  gap: 10px;
}

.dark-quiet {
  color: #f4efe5;
  border-color: rgba(255, 255, 255, 0.15);
}

.dark-quiet:hover {
  background: rgba(255, 255, 255, 0.07);
}

.admin-logout {
  color: rgba(255, 255, 255, 0.68);
  border-color: transparent;
  background: transparent;
}

.admin-logout:hover {
  color: #fff;
}

.admin-main {
  position: relative;
  z-index: 1;
  width: min(1400px, calc(100% - 64px));
  margin: 0 auto;
}

.admin-login-view {
  display: grid;
  grid-template-columns: 1fr 430px;
  gap: 100px;
  align-items: center;
  min-height: calc(100vh - 88px);
  padding: 70px 7%;
}

.admin-login-copy {
  max-width: 620px;
}

.admin-login-copy .section-kicker {
  color: #d5a94f;
}

.admin-login-copy h1 {
  margin: 16px 0 20px;
  font-family: var(--serif);
  font-size: clamp(44px, 5.5vw, 82px);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 1.06;
  white-space: nowrap;
}

.admin-login-copy > p {
  max-width: 460px;
  color: rgba(255, 255, 255, 0.53);
  font-size: 14px;
  line-height: 1.9;
}

.admin-security-note {
  display: flex;
  gap: 16px;
  max-width: 410px;
  padding-top: 24px;
  margin-top: 42px;
  color: rgba(255, 255, 255, 0.42);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 10px;
  line-height: 1.7;
}

.admin-security-note span {
  color: #d5a94f;
  white-space: nowrap;
}

.admin-login-card {
  padding: 40px;
  background: #23231f;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 24px;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.3);
}

.lock-mark {
  display: grid;
  width: 56px;
  height: 56px;
  margin-bottom: 28px;
  color: #171714;
  background: #dfbd7b;
  border-radius: 14px;
  font-family: var(--serif);
  font-size: 22px;
  place-items: center;
}

.admin-login-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 29px;
  font-weight: 500;
}

.admin-login-card > p {
  margin: 8px 0 25px;
  color: rgba(255, 255, 255, 0.44);
  font-size: 11px;
}

.dark-label {
  color: rgba(255, 255, 255, 0.58);
}

.dark-label input {
  color: #fff;
  background: #1a1a17;
  border-color: rgba(255, 255, 255, 0.13);
}

.dark-label input:focus {
  border-color: #d5a94f;
  box-shadow: 0 0 0 3px rgba(213, 169, 79, 0.1);
}

.button-light {
  color: #191915;
  background: #e1bf7b;
}

.button-light:hover {
  background: #f0d18f;
  transform: translateY(-1px);
}

.admin-dashboard {
  padding: 62px 0 90px;
}

.admin-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 42px;
}

.admin-title-row .section-kicker {
  color: #d5a94f;
}

.admin-title-row h1 {
  color: #f7f2e8;
  font-size: 46px;
}

.admin-title-row p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.38);
  font-size: 10px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.admin-stats article {
  display: flex;
  min-height: 140px;
  flex-direction: column;
  padding: 24px 26px;
  background: #22221e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

.admin-stats span {
  color: rgba(255, 255, 255, 0.44);
  font-size: 10px;
}

.admin-stats strong {
  margin: 12px 0 6px;
  color: #f5ead4;
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 500;
  line-height: 1;
}

.admin-stats article:nth-child(2) strong {
  color: #dfbd7b;
}

.admin-stats small {
  margin-top: auto;
  color: rgba(255, 255, 255, 0.25);
  font-size: 9px;
}

.admin-settings-card {
  padding: 30px;
  margin-bottom: 18px;
  background: #22221e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
}

.admin-settings-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.admin-settings-heading h2 {
  margin: 8px 0 6px;
  color: #f5efe3;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
}

.admin-settings-heading p {
  margin: 0;
  color: rgba(255, 255, 255, 0.34);
  font-size: 10px;
}

.cloud-saved {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  color: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  font-size: 9px;
  white-space: nowrap;
}

.cloud-saved i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #dfbd7b;
}

.settings-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 26px;
  align-items: start;
}

.settings-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 16px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
}

.settings-field-wide {
  grid-column: 1 / -1;
}

.settings-field input,
.settings-field textarea {
  width: 100%;
  padding: 0 12px;
  color: #f5efe3;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  outline: 0;
  background: #191916;
  font-size: 12px;
  resize: vertical;
}

.settings-field input {
  height: 43px;
}

.settings-field textarea {
  min-height: 86px;
  padding-top: 11px;
  line-height: 1.65;
}

.settings-field input:focus,
.settings-field textarea:focus {
  border-color: #dfbd7b;
  box-shadow: 0 0 0 3px rgba(223, 189, 123, 0.08);
}

.settings-field small {
  color: rgba(255, 255, 255, 0.24);
  font-size: 8px;
}

.settings-preview {
  min-width: 0;
  padding: 23px;
  color: #1b1a16;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 255, 255, 0.35), transparent 13rem),
    #dfbd7b;
  border-radius: 14px;
}

.settings-preview > span {
  color: rgba(27, 26, 22, 0.5);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.settings-preview-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 17px;
}

.settings-preview-brand b {
  display: grid;
  width: 30px;
  height: 30px;
  color: #fff8ec;
  background: var(--red);
  border-radius: 5px;
  font-family: var(--serif);
  font-size: 16px;
  place-items: center;
}

.settings-preview-brand div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.settings-preview-brand strong {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-preview-brand small {
  overflow: hidden;
  color: rgba(27, 26, 22, 0.52);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-preview h3 {
  margin: 24px 0 10px;
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.16;
}

.settings-preview h3 em {
  color: var(--red);
  font-style: normal;
}

.settings-preview p {
  margin: 0;
  color: rgba(27, 26, 22, 0.62);
  font-size: 9px;
  line-height: 1.7;
}

.settings-preview-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.settings-preview .button-primary {
  flex: 0 0 auto;
  background: #1b1b17;
  box-shadow: none;
}

.settings-preview .button-primary:hover {
  background: #33322b;
}

#settings-status {
  color: rgba(27, 26, 22, 0.66);
  font-size: 8px;
  line-height: 1.5;
}

.admin-table-card {
  position: relative;
  overflow: hidden;
  background: #22221e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
}

.admin-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 92px;
  padding: 0 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-table-toolbar h2 {
  margin: 0 0 5px;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
}

.admin-table-toolbar p {
  margin: 0;
  color: rgba(255, 255, 255, 0.3);
  font-size: 9px;
}

.admin-search {
  display: flex;
  align-items: center;
  width: 260px;
  height: 40px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.38);
  background: #191916;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
}

.admin-search input {
  width: 100%;
  height: 100%;
  padding-left: 8px;
  color: #f4efe5;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 11px;
}

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

.admin-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
}

.admin-table th {
  height: 44px;
  padding: 0 15px;
  color: rgba(255, 255, 255, 0.33);
  background: #1e1e1a;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: left;
  white-space: nowrap;
}

.admin-table th:first-child,
.admin-table td:first-child {
  padding-left: 26px;
}

.admin-table th:last-child,
.admin-table td:last-child {
  padding-right: 26px;
}

.admin-table th small {
  color: rgba(255, 255, 255, 0.2);
  font-weight: 400;
}

.admin-table td {
  height: 70px;
  padding: 0 15px;
  color: rgba(255, 255, 255, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 10px;
  white-space: nowrap;
}

.admin-table tbody tr {
  transition: background 140ms ease;
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.admin-rank {
  color: rgba(255, 255, 255, 0.35);
  font-family: var(--serif);
  font-size: 16px;
}

.admin-member-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-member-cell .avatar {
  width: 32px;
  height: 32px;
  color: #1b1b17;
  background: #cfb77f;
  font-size: 11px;
}

.admin-member-cell strong {
  color: #f5efe3;
  font-size: 11px;
  font-weight: 600;
}

.admin-score {
  color: #dfbd7b;
  font-family: var(--serif);
  font-size: 19px;
}

.admin-data-pair {
  color: rgba(255, 255, 255, 0.46);
  font-variant-numeric: tabular-nums;
}

.admin-edit {
  padding: 7px 11px;
  color: #dfbd7b;
  border: 1px solid rgba(223, 189, 123, 0.24);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 9px;
}

.admin-edit:hover {
  color: #181815;
  background: #dfbd7b;
}

.admin-empty {
  color: rgba(255, 255, 255, 0.35);
}

.admin-modal {
  width: min(680px, calc(100% - 32px));
}

.edit-card {
  color: var(--ink);
}

.edit-score-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 20px;
  margin-top: 22px;
  background: #eee7da;
  border-radius: 10px;
}

.edit-score-strip span {
  color: var(--ink-soft);
  font-size: 10px;
}

.edit-score-strip strong {
  color: var(--red);
  font-family: var(--serif);
  font-weight: 500;
}

.edit-score-strip b {
  font-size: 26px;
}

.edit-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.edit-groups fieldset {
  min-width: 0;
  padding: 16px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.edit-groups fieldset:last-child {
  grid-column: 1 / -1;
}

.edit-groups legend {
  padding: 0 7px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.edit-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 9px;
}

.edit-grid input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  background: var(--white);
}

.edit-grid input:focus {
  border-color: var(--red);
}

.edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 1050px) {
  .site-nav {
    display: none;
  }

  .hero {
    gap: 45px;
  }

  .checkin-groups {
    grid-template-columns: 1fr 1fr;
  }

  .activity-group:last-child {
    grid-column: 1 / -1;
  }

  .admin-login-view {
    gap: 50px;
    padding-right: 0;
    padding-left: 0;
  }
}

@media (max-width: 820px) {
  .site-header,
  .admin-header,
  .section-shell,
  .hero,
  .site-footer,
  .admin-main {
    width: min(100% - 36px, 680px);
  }

  .site-header {
    min-height: 76px;
  }

  .brand small,
  .account-dot {
    display: none;
  }

  .account-button {
    padding: 0 13px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 42px;
    padding: 64px 0 76px;
  }

  .hero h1 {
    font-size: clamp(48px, 13vw, 68px);
  }

  .hero-card {
    min-height: 350px;
  }

  .member-summary {
    grid-template-columns: 1fr 1fr;
    gap: 25px;
  }

  .member-identity {
    grid-column: 1 / -1;
  }

  .member-metric {
    padding-left: 0;
    border-left: 0;
  }

  .checkin-form {
    padding: 24px;
  }

  .podium {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .podium-card,
  .podium-card.place-1 {
    min-height: 170px;
  }

  .ranking-head {
    display: none;
  }

  .ranking-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 9px;
    min-height: 68px;
    padding: 0 18px;
  }

  .ranking-data {
    display: none;
  }

  .rules-grid {
    grid-template-columns: 1fr;
  }

  .rule-card {
    min-height: 0;
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 34px 0;
  }

  .admin-login-view {
    grid-template-columns: 1fr;
    gap: 40px;
    min-height: auto;
    padding: 70px 0;
  }

  .admin-login-copy h1 {
    font-size: 58px;
  }

  .admin-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }

  .admin-stats article {
    min-height: 115px;
  }

  .settings-form {
    grid-template-columns: 1fr;
  }

  .settings-preview {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .site-header,
  .admin-header,
  .section-shell,
  .hero,
  .site-footer,
  .admin-main {
    width: calc(100% - 28px);
  }

  .brand-seal {
    width: 36px;
    height: 36px;
    font-size: 19px;
  }

  .brand strong {
    font-size: 16px;
  }

  .account-button {
    min-height: 37px;
    font-size: 10px;
  }

  .hero {
    padding-top: 48px;
  }

  .hero h1 {
    font-size: clamp(43px, 11.7vw, 54px);
    margin-top: 16px;
  }

  .hero-intro {
    font-size: 14px;
  }

  .hero-actions .button {
    width: 100%;
  }

  .hero-card {
    min-height: 320px;
    padding: 25px;
  }

  .hero-score {
    margin-top: 45px;
  }

  .hero-score > span {
    font-size: 74px;
  }

  .hero-stats {
    right: 25px;
    bottom: 25px;
    left: 25px;
  }

  .hero-card-mark {
    top: 35%;
    right: 25px;
  }

  .section-shell {
    padding: 70px 0;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .section-heading h2 {
    font-size: 36px;
  }

  .member-summary {
    padding: 22px;
  }

  .member-metric strong {
    font-size: 27px;
  }

  .checkin-form {
    padding: 18px;
  }

  .score-preview {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .checkin-groups {
    grid-template-columns: 1fr;
  }

  .activity-group:last-child {
    grid-column: auto;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions .button {
    width: 100%;
  }

  .podium-card .podium-rank {
    font-size: 58px;
  }

  .rule-card {
    padding: 24px;
  }

  .modal-card {
    padding: 30px 22px;
  }

  .admin-header-actions .button:first-child {
    display: none;
  }

  .admin-login-copy h1 {
    font-size: 48px;
  }

  .admin-login-card {
    padding: 28px 22px;
  }

  .admin-title-row h1 {
    font-size: 38px;
  }

  .admin-title-actions,
  .admin-title-actions .button {
    width: 100%;
  }

  .admin-settings-card {
    padding: 22px 18px;
  }

  .admin-settings-heading {
    flex-direction: column;
  }

  .settings-fields {
    grid-template-columns: 1fr;
  }

  .settings-field-wide {
    grid-column: auto;
  }

  .settings-preview-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-preview-actions .button {
    width: 100%;
  }

  .admin-table-toolbar {
    align-items: stretch;
    flex-direction: column;
    padding: 20px;
  }

  .admin-search {
    width: 100%;
  }

  .edit-card {
    padding: 30px 20px;
  }

  .edit-groups {
    grid-template-columns: 1fr;
  }

  .edit-groups fieldset:last-child {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
