:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #777;
  --line: #e7e7e4;
  --paper: #fff;
  --canvas: #f5f5f3;
  --shadow: 0 10px 30px rgba(0, 0, 0, .05);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
#shell { width: min(100% - 36px, 880px); margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #dededb; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 92px; height: 38px; object-fit: contain; border: 1px solid var(--line); border-radius: 9px; background: white; padding: 3px; }
.brand span { display: flex; flex-direction: column; gap: 2px; }
.brand strong { font-size: 18px; letter-spacing: .3px; }
.brand small { color: var(--muted); font-size: 11px; }
.header-profile { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.header-profile button { padding: 0; color: var(--ink); background: none; border: 0; cursor: pointer; }
.main-nav { display: flex; gap: 8px; padding: 12px 0 18px; }
.main-nav:empty { display: none; }
.nav-link { padding: 8px 14px; color: #666; border-radius: 999px; font-size: 13px; }
.nav-link.active, .nav-link:hover { color: white; background: var(--ink); }
#app { flex: 1; padding-bottom: 38px; }
footer { padding: 16px 0 24px; color: #92928e; font-size: 11px; text-align: center; }
footer a { text-decoration: underline; text-underline-offset: 3px; }
.rules-main { flex: 1; padding-top: 24px; }
.rules-hero h1 { margin: 14px 0 10px; }
.rules-hero .rules-intro { max-width: 610px; margin-top: 20px; font-size: 14px; line-height: 1.9; }
.rules-version { margin-top: 22px; color: #aaa; font-size: 11px; }
.rules-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 16px 0 10px; }
.rules-metric { min-width: 0; padding: 18px 16px; background: white; border: 1px solid var(--line); border-radius: 16px; }
.rules-metric > span { display: block; margin-bottom: 10px; color: #777; font-size: 12px; }
.rules-metric strong { display: block; font-size: 27px; font-weight: 800; letter-spacing: -.5px; }
.rules-metric small { color: #777; font-size: 11px; font-weight: 500; letter-spacing: 0; }
.rules-metric:last-child strong { font-size: 19px; line-height: 32px; letter-spacing: 0; }
.rules-metrics-note { margin-bottom: 28px; }
.rules-layout { display: grid; grid-template-columns: 155px minmax(0,1fr); align-items: start; gap: 22px; }
.rules-toc { position: sticky; top: 20px; padding-top: 10px; }
.rules-toc .eyebrow { margin-bottom: 15px; }
.rules-toc a { display: block; padding: 9px 10px; margin-bottom: 4px; color: #666; font-size: 12px; border-radius: 9px; }
.rules-toc a:hover, .rules-toc a:focus-visible { color: #fff; background: #171717; }
.rules-section { padding: 26px; scroll-margin-top: 20px; }
.rules-section > .eyebrow { margin-bottom: 10px; }
.rules-section h2 { margin-bottom: 20px; font-size: 23px; }
.rules-section p, .rules-list { margin-bottom: 12px; color: #555; font-size: 13px; line-height: 1.9; overflow-wrap: anywhere; }
.rules-section .notice { margin: 14px 0; font-size: 12px; }
.rules-item + .rules-item { padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--line); }
.rules-item h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 12px; font-size: 16px; }
.rules-item p:last-child { margin-bottom: 0; }
.rules-section p.small { color: #777; font-size: 12px; }
.rules-steps { padding-left: 21px; margin: 0; }
.rules-steps li { padding-left: 8px; margin-bottom: 18px; font-size: 14px; }
.rules-steps li::marker { color: #888; font-size: 12px; }
.rules-steps strong { display: block; margin-bottom: 7px; }
.rules-steps p { margin-bottom: 0; }
.rules-list { padding-left: 20px; }
.rules-list li { padding-left: 4px; margin-bottom: 12px; }
.rules-examples { width: 100%; margin-bottom: 18px; border-collapse: collapse; table-layout: fixed; font-size: 12px; line-height: 1.7; }
.rules-examples caption { padding-bottom: 14px; color: #777; text-align: left; }
.rules-examples th, .rules-examples td { padding: 14px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.rules-examples thead th { color: #777; background: #f6f6f4; font-weight: 600; }
.rules-examples th:first-child { width: 42%; }
.rules-examples tbody th { font-weight: 500; }
.rules-examples td strong { display: block; font-size: 19px; }
.rules-examples td span { display: block; color: #888; font-size: 11px; }
.rules-question { padding: 15px 0; border-bottom: 1px solid var(--line); }
.rules-question summary { color: #292929; font-size: 14px; font-weight: 650; line-height: 1.7; cursor: pointer; }
.rules-question p { margin: 12px 0 0; }
.rules-section .rules-closing { margin: 22px 0 0; color: #888; font-size: 12px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 8px 0 24px; }
.eyebrow { color: #777; font-size: 11px; font-weight: 800; letter-spacing: 2px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-size: clamp(26px, 6vw, 36px); line-height: 1.15; letter-spacing: -.6px; }
h2 { margin-bottom: 14px; font-size: 22px; }
h3 { margin: 0; font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 1.6; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 28px 0 14px; }
.section-heading h2 { margin: 0; }
.card { padding: 20px; margin-bottom: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.hero-card { position: relative; overflow: hidden; padding: 30px; color: white; background: radial-gradient(ellipse at 90% 10%, rgba(255,255,255,.13), transparent 36%), linear-gradient(140deg,#090909,#2b2b2b); border-radius: 24px; box-shadow: 0 18px 38px rgba(0,0,0,.14); }
.hero-card h1 { max-width: 460px; margin: 12px 0; font-size: clamp(32px, 7vw, 48px); }
.hero-card p { margin: 0; color: #bdbdbd; }
.hero-card .eyebrow { color: #c7c7c7; }
.summary-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 14px 0 30px; }
.summary { display: flex; align-items: center; justify-content: space-between; padding: 15px 17px; background: white; border: 1px solid var(--line); border-radius: 17px; }
.summary span { color: var(--muted); font-size: 12px; }
.summary strong { font-size: 22px; }
.activity-card { padding: 18px; }
.activity-top, .activity-bottom, .row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.activity-date { color: var(--muted); font-size: 13px; font-weight: 700; }
.activity-card h3 { margin: 14px 0 10px; font-size: 21px; }
.activity-meta { display: flex; flex-wrap: wrap; gap: 9px 16px; padding: 12px; color: #555; background: #f5f5f4; border-radius: 12px; font-size: 13px; }
.activity-bottom { padding-top: 13px; margin-top: 13px; border-top: 1px solid #eee; color: var(--muted); font-size: 12px; }
.badge { display: inline-flex; align-items: center; padding: 6px 10px; color: #363636; background: #eee; border-radius: 999px; font-size: 11px; font-weight: 750; }
.button, button.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 16px; color: #fff; background: linear-gradient(135deg,#101010,#303030); border: 0; border-radius: 13px; box-shadow: 0 7px 18px rgba(0,0,0,.13); font-size: 13px; font-weight: 750; cursor: pointer; }
.button.secondary { color: #202020; background: #ececea; box-shadow: none; }
.button.ghost { min-height: 36px; padding: 0 12px; color: #252525; background: white; border: 1px solid var(--line); box-shadow: none; }
.button.danger { color: #fff; background: #6b2525; box-shadow: none; }
.button.small-button { min-height: 32px; padding: 0 10px; font-size: 11px; }
.button:disabled { cursor: not-allowed; opacity: .5; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.form-card { max-width: 650px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 14px; }
.field { min-width: 0; margin: 0 0 16px; }
.field.full { grid-column: 1 / -1; }
.field label, .field-label { display: block; margin-bottom: 7px; color: #575757; font-size: 12px; font-weight: 750; }
.field input, .field textarea, .field select { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--ink); background: #f7f7f6; border: 1px solid #e1e1de; border-radius: 11px; outline: none; }
.field textarea { min-height: 100px; resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #858585; background: #fff; }
.field input[type="checkbox"] { width: auto; min-height: 0; accent-color: #171717; }
.form-hint { margin: -4px 0 16px; color: var(--muted); font-size: 11px; }
.error-box, .success-box, .notice { padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; font-size: 13px; line-height: 1.55; }
.error-box { color: #7a2626; background: #f8e9e9; }
.success-box { color: #265b36; background: #e8f3e9; }
.notice { color: #555; background: #efefed; }
.empty { padding: 42px 20px; color: #888; background: white; border: 1px dashed #d8d8d4; border-radius: 18px; text-align: center; }
.stat-inline { display: flex; flex-wrap: wrap; gap: 8px 18px; color: #666; font-size: 13px; }
.waiver-copy { max-height: 48vh; overflow: auto; padding: 18px; margin: 14px 0; color: #333; background: #f7f7f6; border: 1px solid var(--line); border-radius: 14px; white-space: pre-wrap; line-height: 1.8; font-size: 13px; }
.check-line { display: flex; align-items: flex-start; gap: 9px; margin: 12px 0; color: #454545; font-size: 13px; line-height: 1.5; }
.check-line input { margin-top: 3px; accent-color: #111; }
.participant-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid #eee; }
.participant-row:last-child { border: 0; }
.participant-row label { flex: 1; cursor: pointer; }
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid #ececea; text-align: left; vertical-align: top; }
.table th { color: #777; font-weight: 700; }
.auth-wrap { max-width: 420px; margin: 6vh auto; }
.auth-card { padding: 26px; background: white; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.auth-card h1 { margin: 10px 0 6px; font-size: 27px; }
.auth-toggle { margin-top: 18px; color: #555; font-size: 12px; text-align: center; }
.link-button { padding: 0; color: #111; background: none; border: 0; font-weight: 750; cursor: pointer; }
.waiver-title { margin: 0 0 8px; }
.checkline-wrap { padding: 12px 0; }
#toast { position: fixed; z-index: 9; right: 18px; bottom: 18px; left: 18px; width: fit-content; max-width: min(440px, calc(100vw - 36px)); padding: 11px 16px; margin: auto; color: #fff; background: rgba(22,22,22,.92); border-radius: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s, transform .18s; font-size: 13px; }
#toast.visible { opacity: 1; transform: translateY(0); }
@media (max-width: 620px) {
  #shell { width: min(100% - 24px, 880px); }
  .topbar { height: 68px; }
  .brand img { width: 80px; height: 34px; }
  .brand { gap: 9px; }
  .header-profile { font-size: 11px; }
  .main-nav { overflow-x: auto; padding: 10px 0 14px; }
  .nav-link { flex: none; padding: 8px 12px; }
  .page-heading { align-items: center; }
  .page-heading > .button { flex: none; }
  .card { padding: 16px; border-radius: 17px; }
  .hero-card { padding: 25px 21px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary:last-child { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: 1fr 1fr; gap: 0 10px; }
  .table-wrap { overflow-x: auto; }
  .table { min-width: 560px; }
  .rules-main { padding-top: 16px; }
  .rules-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .rules-metric { padding: 16px; }
  .rules-layout { grid-template-columns: minmax(0,1fr); gap: 14px; }
  .rules-toc { position: static; display: flex; gap: 5px; padding: 0 0 5px; overflow-x: auto; }
  .rules-toc .eyebrow { display: none; }
  .rules-toc a { flex: none; margin-bottom: 0; background: #eaeae7; }
  .rules-section { padding: 20px 17px; }
  .rules-examples th, .rules-examples td { padding: 12px 6px; }
}
@media (max-width: 380px) {
  .page-heading { align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
}
