:root {
  --ink: #12221a;
  --muted: #647069;
  --paper: #f4f5ec;
  --card: #fffef8;
  --line: #dfe3d6;
  --lime: #c8f36c;
  --lime-deep: #7da92b;
  --mint: #dff7e8;
  --coral: #ff8e72;
  --shadow: 0 18px 50px rgba(18, 34, 26, .08);
  --radius: 24px;
}
* { box-sizing: border-box; }
html { color-scheme: light; background: var(--paper); }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 85% -10%, #e2f6ae 0, transparent 28rem), var(--paper); font-family: ui-rounded, "SF Pro Rounded", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.5; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 99; background: var(--ink); color: white; padding: .75rem 1rem; border-radius: 12px; }
.skip-link:focus { top: 1rem; }
.topbar { max-width: 880px; margin: 0 auto; padding: 18px 20px 8px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; background: var(--ink); color: var(--lime); border-radius: 12px 12px 12px 4px; }
.topbar-actions { display: flex; gap: 14px; align-items: center; }
.topbar-actions form { margin: 0; }
.admin-link, .text-button { color: var(--muted); font-weight: 700; font-size: .9rem; text-decoration: none; border: 0; background: none; padding: 6px 0; }
.page-shell { width: min(100% - 28px, 820px); margin: 0 auto; padding: 28px 0 110px; }
.messages { position: sticky; z-index: 10; top: 8px; width: min(100% - 28px, 760px); margin: 8px auto -8px; }
.message { padding: 13px 16px; border-radius: 14px; background: var(--ink); color: white; box-shadow: var(--shadow); }
.message.error { background: #8d2f27; }
.message.info { background: #34473e; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.8rem, 7vw, 3rem); line-height: 1.08; letter-spacing: -.04em; }
h2 { margin-bottom: 6px; letter-spacing: -.02em; }
.eyebrow, .auth-kicker { margin-bottom: 8px; color: var(--lime-deep); font-size: .76rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.lede, .page-heading > p:last-child { color: var(--muted); max-width: 48ch; }
.welcome-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.streak-pill, .status-chip { display: inline-flex; width: fit-content; white-space: nowrap; padding: 7px 11px; border-radius: 999px; color: #416115; background: #e8f7c8; font-size: .76rem; font-weight: 800; }
.status-chip.muted { color: #55615a; background: #e5e8e3; }
.status-chip.success { color: #17623b; background: var(--mint); }
.checkin-card, .team-card, .month-card, .week-row, .admin-panel, .audit-section { background: rgba(255,254,248,.92); border: 1px solid rgba(255,255,255,.9); box-shadow: var(--shadow); border-radius: var(--radius); }
.checkin-card { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 28px; padding: 26px; overflow: hidden; position: relative; }
.checkin-card::after { content: ""; position: absolute; right: -70px; bottom: -110px; width: 220px; height: 220px; background: var(--lime); border-radius: 50%; opacity: .22; }
.ring { position: relative; display: grid; place-items: center; width: 142px; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--lime-deep) calc(min(var(--progress), 4) * 25%), #e7eadd 0); }
.ring::before { content: ""; position: absolute; inset: 13px; background: var(--card); border-radius: 50%; }
.ring div { position: relative; display: flex; align-items: baseline; }
.ring strong { font-size: 3rem; line-height: 1; }
.ring span { color: var(--muted); font-weight: 800; }
.checkin-copy { position: relative; z-index: 1; }
.checkin-copy > p:not(.eyebrow) { color: var(--muted); }
.primary-button { display: inline-flex; min-height: 50px; align-items: center; justify-content: center; border: 0; border-radius: 15px; background: var(--ink); color: white; padding: 13px 20px; font-weight: 900; box-shadow: 0 8px 0 #07100b; transition: transform .15s, box-shadow .15s; }
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 10px 0 #07100b; }
.primary-button:active { transform: translateY(5px); box-shadow: 0 3px 0 #07100b; }
.primary-button:disabled { cursor: default; box-shadow: none; transform: none; opacity: .85; }
.done-button { background: #2f724c; }
.team-card { margin-top: 18px; padding: 24px; }
.section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.section-heading > strong { font-size: 2rem; }
.progress-track, .mini-track { overflow: hidden; display: block; background: #e7eadd; border-radius: 999px; }
.progress-track { height: 13px; margin: 18px 0 22px; }
.progress-track span, .mini-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--lime-deep), var(--lime)); border-radius: inherit; }
.metric-grid, .money-grid, .review-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.metric-grid > div, .money-grid > div { display: grid; padding: 14px; background: #f2f4e9; border-radius: 16px; }
.metric-grid strong { font-size: 1.45rem; }
.metric-grid span { color: var(--muted); }
.metric-grid small, .money-grid small { color: var(--muted); margin-top: 5px; }
.today-section { padding: 26px 4px 0; }
.avatar-list { display: flex; flex-wrap: wrap; gap: 16px; }
.avatar-person { width: 58px; display: grid; gap: 5px; justify-items: center; }
.avatar-person > span, .mini-avatar { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 16px 16px 16px 5px; background: var(--mint); color: #21603e; font-weight: 900; }
.avatar-person small { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.empty-note { padding: 18px; border: 1px dashed #c9cec1; border-radius: 16px; color: var(--muted); background: rgba(255,255,255,.45); }
.confirm-dialog { width: min(92vw, 430px); border: 0; border-radius: 26px; padding: 28px; color: var(--ink); background: var(--card); box-shadow: 0 30px 100px rgba(0,0,0,.28); }
.confirm-dialog::backdrop { background: rgba(9,18,13,.62); backdrop-filter: blur(4px); }
.confirm-dialog .primary-button { width: 100%; }
.dialog-close { float: right; border: 0; border-radius: 50%; background: #ecefe8; width: 34px; height: 34px; font-size: 1.3rem; }
.page-heading { margin-bottom: 24px; }
.week-list, .month-list { display: grid; gap: 14px; }
.week-row, .month-card { padding: 20px; }
.week-row-top { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.week-row-top > div { display: grid; gap: 3px; }
.week-row-top span, .week-row > small { color: var(--muted); }
.day-dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; margin: 17px 0 12px; }
.day-dots span { aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: #ecefe6; color: #8b948d; font-size: .72rem; }
.day-dots .filled { background: var(--lime); color: var(--ink); font-weight: 900; }
.week-switcher { display: flex; justify-content: space-between; margin: -8px 0 18px; }
.week-switcher a { color: var(--muted); font-weight: 800; text-decoration: none; }
.review-summary { grid-template-columns: repeat(3, 1fr); margin-bottom: 16px; }
.review-summary div { display: grid; gap: 4px; background: var(--ink); color: white; padding: 18px; border-radius: 18px; }
.review-summary strong { color: var(--lime); font-size: 1.7rem; }
.review-summary span { font-size: .8rem; opacity: .78; }
.member-progress { background: var(--card); border-radius: var(--radius); padding: 8px 18px; }
.member-progress > div { display: grid; grid-template-columns: 42px minmax(70px, 1fr) minmax(70px, 2fr) 35px 20px; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.member-progress > div:last-child { border-bottom: 0; }
.mini-avatar { width: 38px; height: 38px; border-radius: 13px 13px 13px 4px; }
.mini-track { height: 8px; }
.money-grid { margin-top: 20px; }
.money-grid strong { font-size: 1.55rem; margin: 4px 0; }
.money-grid span, .card-note { color: var(--muted); font-size: .85rem; }
.card-note { margin: 14px 2px 0; }
.admin-panel { margin-bottom: 14px; padding: 0 18px 18px; }
.admin-panel summary { cursor: pointer; padding: 18px 0; font-weight: 900; }
.inline-form { display: grid; grid-template-columns: repeat(5, minmax(90px, 1fr)); gap: 8px; margin-bottom: 10px; }
.inline-form input, .inline-form select, .stack-form input, .admin-member input { width: 100%; border: 1px solid var(--line); background: white; border-radius: 12px; padding: 11px 12px; }
.inline-form button, .admin-member button, .settlement-row button { border: 0; border-radius: 12px; padding: 10px 13px; background: var(--ink); color: white; font-weight: 800; }
.admin-member, .settlement-row { display: grid; grid-template-columns: 1fr 1fr 2fr 1.3fr; gap: 10px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line); }
.admin-member form { display: flex; gap: 6px; }
.settlement-row > div { display: grid; }
.audit-section { padding: 20px; }
.audit-row { display: grid; grid-template-columns: 90px 1fr 1.5fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); color: var(--muted); }
.audit-row code { color: var(--ink); }
.bottom-nav { position: fixed; z-index: 20; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 24px), 520px); display: grid; grid-template-columns: repeat(4, 1fr); padding: 7px; background: rgba(18,34,26,.94); backdrop-filter: blur(16px); border-radius: 22px; box-shadow: 0 12px 40px rgba(0,0,0,.24); }
.bottom-nav a { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; color: #b7c1bb; font-size: .7rem; font-weight: 800; text-decoration: none; border-radius: 15px; }
.bottom-nav a span { font-size: 1rem; }
.bottom-nav a.active { color: var(--ink); background: var(--lime); }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, #d7f39b, transparent 28rem), radial-gradient(circle at 100% 90%, #ffd6c7, transparent 24rem), var(--paper); }
.auth-page .page-shell { width: min(100%, 460px); padding: 0; }
.auth-card { padding: clamp(26px, 7vw, 42px); background: rgba(255,254,248,.94); border: 1px solid white; border-radius: 32px 32px 32px 10px; box-shadow: var(--shadow); }
.stack-form { display: grid; gap: 15px; margin-top: 28px; }
.stack-form label { display: grid; gap: 7px; font-size: .85rem; font-weight: 800; }
.stack-form input { min-height: 50px; }
.stack-form .primary-button { margin-top: 5px; }
.field-error, .form-errors { color: #9c3529; font-size: .8rem; font-weight: 700; }
.form-errors ul { margin: 0; padding-left: 18px; }
.auth-foot { margin: 22px 0 0; color: var(--muted); text-align: center; }
.auth-foot a { color: var(--ink); font-weight: 900; }
@media (max-width: 650px) {
  .page-shell { padding-top: 18px; }
  .welcome-row { display: block; }
  .streak-pill { margin-top: 8px; }
  .checkin-card { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 24px 20px; }
  .checkin-copy { width: 100%; }
  .checkin-copy .primary-button { width: 100%; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .review-summary { grid-template-columns: 1fr; }
  .member-progress > div { grid-template-columns: 38px 1fr 35px 18px; }
  .member-progress .mini-track { grid-column: 2 / -1; grid-row: 2; }
  .inline-form, .admin-member, .settlement-row { grid-template-columns: 1fr; }
  .admin-member form { display: grid; grid-template-columns: 1fr 1fr; }
  .topbar { padding-inline: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
