:root {
  --ink: #162121;
  --muted: #667170;
  --faint: #98a09f;
  --line: #dfe4e1;
  --paper: #f4f6f2;
  --surface: #ffffff;
  --forest: #123c39;
  --forest-dark: #0c2d2b;
  --mint: #b9e4d3;
  --mint-strong: #7dcdb2;
  --coral: #e8755e;
  --coral-soft: #fbe9e4;
  --yellow: #f1c75b;
  --blue: #5679a5;
  --shadow: 0 14px 38px rgba(19, 55, 51, 0.08);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--paper);
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(86,121,165,.34); outline-offset: 3px; }
section[id] { scroll-margin-top: 92px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 230px 1fr 230px;
  align-items: center;
  min-height: 72px;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid rgba(221, 227, 223, 0.9);
  background: rgba(244, 246, 242, 0.92);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; width: max-content; text-decoration: none; }
.brand-mark { position: relative; display: block; width: 35px; height: 35px; }
.brand-mark i { position: absolute; display: block; width: 19px; height: 19px; border: 2px solid var(--forest); border-radius: 50%; }
.brand-mark i:nth-child(1) { left: 0; top: 0; }
.brand-mark i:nth-child(2) { right: 0; top: 0; }
.brand-mark i:nth-child(3) { left: 8px; bottom: 0; background: var(--forest); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.05rem; letter-spacing: 0; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 0.57rem; font-weight: 700; letter-spacing: 0.08em; }
.topnav { display: flex; justify-content: center; gap: 34px; height: 72px; }
.topnav a { position: relative; display: grid; place-items: center; color: var(--muted); font-size: 0.9rem; text-decoration: none; }
.topnav a::after { position: absolute; bottom: 0; left: 50%; width: 0; height: 2px; background: var(--forest); content: ""; transform: translateX(-50%); transition: width 160ms ease; }
.topnav a.active, .topnav a:hover { color: var(--ink); }
.topnav a.active::after, .topnav a:hover::after { width: 24px; }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; }
.icon-button, .profile-button { border: 0; background: transparent; cursor: pointer; }
.icon-button { position: relative; width: 38px; height: 38px; }
.icon-button > i { position: absolute; right: 4px; top: 4px; width: 7px; height: 7px; border: 2px solid var(--paper); border-radius: 50%; background: var(--coral); }
.icon-button > i[hidden] { display: none; }

.system-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 12px max(16px, calc((100vw - 1180px) / 2)) 0;
  padding: 12px 14px;
  border: 1px solid #d8cfbf;
  border-radius: 10px;
  background: #fff8e8;
  color: #6a4f12;
  font-size: .86rem;
  line-height: 1.5;
}
.system-banner[hidden] { display: none; }

.notice-list { display: grid; gap: 10px; margin-top: 12px; max-height: 50vh; overflow: auto; }
.notice-item { padding: 12px; border: 1px solid #d7ddd9; border-radius: 8px; background: #f7f9f6; }
.notice-item.is-unread { border-color: rgba(18,60,57,.35); background: #eef6f2; }
.notice-item div { display: flex; justify-content: space-between; gap: 10px; }
.notice-item strong { font-size: .9rem; }
.notice-item span { color: var(--faint); font-size: .68rem; white-space: nowrap; }
.notice-item p { margin: 6px 0 0; color: #4d5b57; font-size: .8rem; line-height: 1.55; }

.ops-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.ops-metrics div {
  padding: 10px;
  border-radius: 8px;
  background: #f2f5f1;
}
.ops-metrics span,
.ops-metrics strong {
  display: block;
}
.ops-metrics span {
  color: var(--faint);
  font-size: .62rem;
}
.ops-metrics strong {
  margin-top: 4px;
  font-size: .78rem;
  line-height: 1.4;
  word-break: break-word;
}
.appeal-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #d7ddd9;
}
.bell-icon { position: absolute; left: 12px; top: 10px; width: 14px; height: 15px; border: 1.8px solid var(--ink); border-radius: 9px 9px 5px 5px; }
.bell-icon::after { position: absolute; left: 4px; bottom: -5px; width: 4px; height: 3px; border-radius: 0 0 5px 5px; background: var(--ink); content: ""; }
.profile-button { display: flex; align-items: center; gap: 9px; padding: 0; }
.profile-button span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--surface); background: var(--coral); font-size: 0.85rem; font-weight: 800; }
.profile-button b { font-size: 0.87rem; }
.profile-button i { width: 7px; height: 7px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(45deg) translateY(-2px); }

main { width: min(1240px, calc(100% - 40px)); margin: 0 auto; }
.overview { padding: 28px 0 20px; }
.pool-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 50px;
  min-height: 422px;
  padding: 58px 64px;
  overflow: hidden;
  border-radius: var(--radius);
  color: #eef8f3;
  background: var(--forest);
}
.pool-hero::before { position: absolute; inset: 0; z-index: -2; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 42px 42px; content: ""; }
.pool-hero::after { position: absolute; right: -130px; bottom: -260px; z-index: -1; width: 560px; height: 560px; border: 1px solid rgba(185,228,211,.16); border-radius: 50%; content: ""; }
.hero-orbit { position: absolute; z-index: -1; border: 1px solid rgba(185,228,211,.13); border-radius: 50%; }
.orbit-one { right: -46px; bottom: -168px; width: 370px; height: 370px; }
.orbit-two { right: 55px; bottom: -82px; width: 200px; height: 200px; background: rgba(185,228,211,.035); }
.pool-copy { align-self: center; max-width: 650px; }
.pool-kicker { display: flex; align-items: center; gap: 9px; color: var(--mint); font-size: 0.78rem; font-weight: 700; }
.pool-kicker > span { width: 7px; height: 7px; border-radius: 50%; background: var(--mint-strong); box-shadow: 0 0 0 5px rgba(125,205,178,.12); }
.pool-copy h1 { margin: 20px 0 16px; font-family: "Songti SC", "Noto Serif SC", serif; font-size: clamp(2.35rem, 4.1vw, 4.1rem); line-height: 1.15; letter-spacing: 0; }
.pool-copy > p { max-width: 580px; margin: 0; color: rgba(238,248,243,.73); font-size: 0.98rem; line-height: 1.9; }
.pool-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 0 19px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-weight: 750; transition: transform 150ms ease, background-color 150ms ease; }
.button:hover { transform: translateY(-2px); }
.button-light { color: var(--forest-dark); background: var(--mint); }
.button-light span { font-size: 1.25rem; font-weight: 400; }
.button-ghost { color: #eff8f4; border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.055); }
.button-ghost:hover { background: rgba(255,255,255,.1); }
.pool-balance { align-self: center; padding: 30px 0 0 34px; border-left: 1px solid rgba(255,255,255,.14); }
.balance-label { display: block; color: rgba(238,248,243,.6); font-size: 0.78rem; }
.pool-balance > strong { display: block; margin-top: 10px; color: #fff; font-family: "Arial", sans-serif; font-size: clamp(2.2rem, 3.4vw, 3.55rem); line-height: 1; letter-spacing: 0; }
.balance-change { margin-top: 13px; color: rgba(238,248,243,.56); font-size: 0.77rem; }
.balance-change span { margin-right: 6px; color: var(--mint); font-weight: 800; }
.pool-meter { width: 100%; height: 5px; margin-top: 55px; overflow: hidden; border-radius: 5px; background: rgba(255,255,255,.13); }
.pool-meter i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--mint-strong), var(--yellow)); transition: width 700ms ease; }
.pool-meta { display: flex; justify-content: space-between; margin-top: 12px; color: rgba(238,248,243,.55); font-size: 0.72rem; }
.pool-meta b { color: #eff8f4; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-top: 0; background: var(--surface); box-shadow: var(--shadow); }
.metric-card { display: grid; grid-template-columns: 45px 1fr; align-items: center; gap: 16px; min-height: 132px; padding: 25px 26px; border-right: 1px solid var(--line); }
.metric-card:last-child { border-right: 0; }
.metric-card > div:last-child > span, .metric-card small { display: block; color: var(--muted); font-size: 0.72rem; }
.metric-card strong { display: block; margin: 5px 0 7px; font-size: 1.47rem; letter-spacing: 0; }
.metric-card small b { color: #23725f; font-weight: 750; }
.metric-icon { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--forest); background: #e6f1ec; font-weight: 800; }
.icon-members i { position: absolute; width: 12px; height: 12px; border: 1.5px solid var(--forest); border-radius: 50%; }
.icon-members i::after { position: absolute; left: -4px; top: 11px; width: 17px; height: 9px; border: 1.5px solid var(--forest); border-radius: 11px 11px 2px 2px; content: ""; }
.icon-members i:first-child { left: 11px; top: 10px; }
.icon-members i:last-child { right: 8px; top: 13px; opacity: .5; transform: scale(.8); }
.icon-time i { width: 19px; height: 19px; border: 1.8px solid var(--forest); border-radius: 50%; }
.icon-time i::before { position: absolute; left: 21px; top: 13px; width: 1.5px; height: 9px; background: var(--forest); content: ""; transform-origin: bottom; transform: rotate(-30deg); }
.next-card { grid-template-columns: 48px 1fr; background: #faf8f0; }
.next-date { padding-right: 12px; border-right: 1px solid #d8d8cd; text-align: center; }
.next-date span, .next-date strong, .next-date small { display: block; }
.next-date span { color: var(--coral); font-size: .62rem; font-weight: 800; }
.next-date strong { margin: 1px 0 -1px; font-size: 1.7rem; }
.next-date small { color: var(--muted); font-size: .58rem; }

.workspace, .ledger-section, .rules-section { padding: 72px 0 20px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-heading p { margin: 0 0 7px; color: var(--coral); font-size: .72rem; font-weight: 800; }
.section-heading h2 { margin: 0; font-family: "Songti SC", serif; font-size: clamp(1.7rem, 2.6vw, 2.35rem); letter-spacing: 0; }
.view-switch, .action-tabs { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: #eaede9; }
.view-switch button, .action-tabs button { min-height: 34px; padding: 0 16px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; cursor: pointer; font-size: .78rem; font-weight: 700; }
.view-switch button.active, .action-tabs button.active { color: var(--ink); background: var(--surface); box-shadow: 0 2px 8px rgba(26,42,40,.07); }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(330px, .65fr); gap: 24px; align-items: start; }
.request-list { display: grid; gap: 12px; }
.request-card { display: grid; grid-template-columns: 72px minmax(0, 1fr) 180px; gap: 22px; align-items: center; min-height: 145px; padding: 23px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease; }
.request-card:hover { border-color: #adc3ba; transform: translateY(-2px); box-shadow: var(--shadow); }
.avatar { position: relative; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; color: var(--surface); background: var(--avatar); font-family: "Songti SC", serif; font-size: 1.4rem; font-weight: 800; }
.avatar::after { position: absolute; right: -2px; bottom: 1px; display: grid; place-items: center; width: 20px; height: 20px; border: 3px solid white; border-radius: 50%; color: white; background: var(--forest); content: "✓"; font-size: .55rem; }
.request-info { min-width: 0; }
.request-top { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.request-top h3 { margin: 0; font-size: 1rem; }
.status-tag { padding: 4px 7px; border-radius: 3px; font-size: .62rem; font-weight: 800; }
.status-voting { color: #8e542e; background: #f8ead8; }
.status-approved { color: #246b59; background: #e1f0e9; }
.request-info > p { display: -webkit-box; margin: 9px 0 12px; overflow: hidden; color: var(--muted); font-size: .78rem; line-height: 1.65; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.request-meta { display: flex; flex-wrap: wrap; gap: 15px; color: var(--faint); font-size: .67rem; }
.request-meta span { display: flex; align-items: center; gap: 5px; }
.request-meta i { width: 5px; height: 5px; border-radius: 50%; background: var(--mint-strong); }
.request-progress { align-self: stretch; display: flex; flex-direction: column; justify-content: center; padding-left: 21px; border-left: 1px solid var(--line); }
.request-amount { display: flex; justify-content: space-between; align-items: baseline; }
.request-amount strong { font-size: 1.04rem; }
.request-amount span { color: var(--faint); font-size: .65rem; }
.mini-meter { height: 5px; margin: 10px 0 8px; overflow: hidden; border-radius: 4px; background: #e9ece9; }
.mini-meter i { display: block; height: 100%; border-radius: inherit; background: var(--bar); }
.request-card[data-status="approved"] .mini-meter i { background: var(--mint-strong); }
.request-foot { display: flex; align-items: center; justify-content: space-between; color: var(--faint); font-size: .63rem; }
.detail-button { padding: 4px 0; border: 0; color: var(--forest); background: transparent; cursor: pointer; font-size: .68rem; font-weight: 800; }

.action-panel { position: sticky; top: 94px; min-height: 435px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.action-tabs { margin-bottom: 22px; }
.action-tabs button { flex: 1; }
.form-label { display: block; margin: 17px 0 8px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.amount-input { display: flex; align-items: center; height: 54px; border: 1px solid #cfd6d2; border-radius: 6px; background: #fafbf9; }
.amount-input span { padding-left: 16px; font-size: 1.2rem; font-weight: 800; }
.amount-input input { width: 100%; min-width: 0; padding: 0 12px; border: 0; outline: 0; background: transparent; font-size: 1.2rem; font-weight: 800; }
.amount-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 9px; }
.amount-options button { min-height: 31px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: #fafbf9; cursor: pointer; font-size: .7rem; }
.amount-options button.active { color: var(--forest); border-color: var(--mint-strong); background: #eaf5f0; font-weight: 800; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid #cfd6d2; border-radius: 5px; outline: 0; background: #fafbf9; font-size: .78rem; }
textarea.field { min-height: 78px; padding-top: 11px; resize: vertical; }
.field:focus, .amount-input:focus-within { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(18,60,57,.07); }
.check-row { display: flex; gap: 9px; align-items: flex-start; margin: 15px 0; color: var(--muted); font-size: .69rem; line-height: 1.55; }
.check-row input { margin-top: 2px; accent-color: var(--forest); }
.submit-button { width: 100%; min-height: 46px; border: 0; border-radius: 5px; color: white; background: var(--forest); cursor: pointer; font-weight: 800; }
.submit-button:hover { background: var(--forest-dark); }
.action-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 17px 0; }
.action-summary div { padding: 11px; background: #f2f5f1; }
.action-summary span, .action-summary strong { display: block; }
.action-summary span { color: var(--faint); font-size: .62rem; }
.action-summary strong { margin-top: 3px; font-size: .8rem; }
.field-hint { display: block; margin-top: 7px; color: var(--faint); font-size: .63rem; }

.crypto-pay-panel { display: grid; gap: 12px; }
.crypto-pay-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.crypto-pay-head span { color: var(--faint); font-size: .72rem; font-weight: 700; }
.crypto-pay-head strong { font-size: .95rem; }
.crypto-pay-note { margin: 0; color: var(--ink-soft, #4d5b57); font-size: .78rem; line-height: 1.55; }
.crypto-pay-grid { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; align-items: start; }
.crypto-qr { width: 160px; height: 160px; border: 1px solid #d7ddd9; border-radius: 8px; background: #fff; }
.crypto-pay-fields { display: grid; gap: 8px; }
.crypto-pay-fields div { display: grid; gap: 3px; }
.crypto-pay-fields span { color: var(--faint); font-size: .62rem; }
.crypto-pay-fields code { display: block; padding: 8px 10px; border: 1px solid #d7ddd9; border-radius: 6px; background: #f7f9f6; font-size: .72rem; word-break: break-all; }
.crypto-pay-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crypto-pay-actions .button { min-height: 36px; padding: 0 12px; font-size: .75rem; }
.text-link-button { border: 0; background: transparent; color: var(--forest); cursor: pointer; text-align: left; padding: 0; font-weight: 700; }
@media (max-width: 720px) {
  .crypto-pay-grid { grid-template-columns: 1fr; justify-items: center; }
  .crypto-pay-fields { width: 100%; }
}

.ops-panel { display: grid; gap: 14px; }
.ops-head { display: flex; justify-content: space-between; align-items: center; }
.ops-head span { color: var(--faint); font-size: .72rem; font-weight: 700; }
.ops-section h4 { margin: 0 0 8px; font-size: .9rem; }
.ops-card { padding: 12px; border: 1px solid #d7ddd9; border-radius: 8px; background: #f7f9f6; margin-bottom: 8px; }
.ops-card div { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ops-card p { margin: 6px 0 8px; color: #4d5b57; font-size: .78rem; line-height: 1.5; }
.ops-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ops-actions button { border: 1px solid #cfd6d2; background: #fff; border-radius: 5px; min-height: 32px; padding: 0 10px; cursor: pointer; font-size: .72rem; font-weight: 700; }
.ops-actions button:hover { border-color: var(--forest); color: var(--forest); }

.auth-switch { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.demo-accounts { margin-top: 16px; }
.demo-account-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.demo-account {
  border: 1px solid #cfd6d2;
  background: #fff;
  border-radius: 999px;
  min-height: 32px;
  padding: 0 12px;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 700;
}
.demo-account:hover { border-color: var(--forest); color: var(--forest); }
#authForm { display: grid; gap: 12px; margin-top: 12px; }
.proof-input { padding: 9px 12px; color: var(--muted); font-size: .68rem; }
.member-dashboard { padding-top: 2px; }
.member-dashboard-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.member-dashboard-head span, .member-dashboard-head strong { display: block; }
.member-dashboard-head span { color: var(--faint); font-size: .62rem; }
.member-dashboard-head strong { margin-top: 4px; font-size: .86rem; }
.member-dashboard-head b { padding: 5px 7px; border-radius: 3px; color: #23725f; background: #e7f3ed; font-size: .62rem; }
.member-milestones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 16px 0; background: var(--line); }
.member-milestones div { padding: 11px 8px; background: #f7f9f6; }
.member-milestones span, .member-milestones strong { display: block; }
.member-milestones span { color: var(--faint); font-size: .58rem; }
.member-milestones strong { margin-top: 5px; font-size: .74rem; }
.rotation-card { display: flex; align-items: center; justify-content: space-between; padding: 14px; border-left: 3px solid var(--blue); background: #edf2f7; }
.rotation-card span, .rotation-card strong { display: block; }
.rotation-card span { color: var(--muted); font-size: .62rem; }
.rotation-card strong { margin-top: 3px; font-size: .82rem; }
.rotation-card > b { color: var(--blue); font-size: .65rem; }
.member-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.member-actions button { min-height: 39px; border: 1px solid var(--line); border-radius: 4px; color: var(--forest); background: var(--surface); cursor: pointer; font-size: .68rem; font-weight: 800; }
.member-actions button:first-child { border-color: var(--forest); color: white; background: var(--forest); }

.ledger-heading { align-items: center; }
.text-button { min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); cursor: pointer; font-size: .72rem; font-weight: 700; }
.text-button span { margin-left: 8px; }
.ledger-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.ledger-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .76rem; }
th { padding: 15px 20px; color: var(--faint); background: #f7f8f6; text-align: left; font-size: .64rem; }
td { padding: 18px 20px; border-top: 1px solid var(--line); }
td:nth-child(1), td:nth-child(3) { color: var(--muted); }
.money-in { color: #27725f; font-weight: 800; }
.money-out { color: var(--coral); font-weight: 800; }
.money-note { color: var(--faint); font-weight: 800; }
.ledger-status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .65rem; }
.ledger-status::before { width: 6px; height: 6px; border-radius: 50%; background: var(--mint-strong); content: ""; }
.distribution-card { display: flex; flex-direction: column; align-items: center; padding: 24px; border-left: 1px solid var(--line); background: #fafbf9; }
.distribution-card > p { align-self: flex-start; margin: 0; font-size: .8rem; font-weight: 800; }
.donut { display: grid; place-items: center; width: 138px; height: 138px; margin: 25px 0 20px; border-radius: 50%; background: conic-gradient(var(--forest) 0 51%, var(--blue) 51% 64%, var(--coral) 64% 82%, var(--yellow) 82% 94%, #dfe5e1 94% 100%); }
.donut > div { display: grid; place-items: center; width: 86px; height: 86px; border-radius: 50%; background: #fafbf9; }
.donut strong, .donut span { display: block; }
.donut strong { font-size: 1.2rem; }
.donut span { color: var(--muted); font-size: .6rem; }
.legend { align-self: stretch; display: grid; gap: 9px; }
.legend div { display: flex; justify-content: space-between; color: var(--muted); font-size: .66rem; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 7px; height: 7px; border-radius: 2px; background: var(--dot); }
.audit-strip { display: grid; grid-template-columns: 190px minmax(0, 1fr); margin-top: 14px; border: 1px solid var(--line); background: var(--surface); }
.audit-strip-heading { padding: 18px 20px; border-right: 1px solid var(--line); background: #f7f8f6; }
.audit-strip-heading p { margin: 0; font-size: .72rem; font-weight: 800; }
.audit-strip-heading span { display: block; margin-top: 7px; color: var(--faint); font-size: .61rem; }
.audit-strip-list { display: grid; grid-template-columns: repeat(2, 1fr); }
.audit-entry { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; padding: 14px 17px; border-right: 1px solid var(--line); }
.audit-entry:last-child { border-right: 0; }
.audit-entry > span { color: var(--faint); font-size: .61rem; }
.audit-entry p { margin: 0; color: var(--muted); font-size: .66rem; line-height: 1.45; }
.audit-entry b { display: block; margin-top: 3px; color: var(--forest); font-size: .57rem; }

.rules-section { padding-bottom: 82px; }
.rule-version { color: var(--faint); font-size: .67rem; }
.rule-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid #cbd3cf; }
.rule-grid article { min-height: 180px; padding: 24px 28px 15px 0; border-right: 1px solid #cbd3cf; }
.rule-grid article:not(:first-child) { padding-left: 28px; }
.rule-grid article:last-child { border-right: 0; }
.rule-grid article > span { color: var(--coral); font-family: Georgia, serif; font-size: .72rem; }
.rule-grid h3 { margin: 24px 0 9px; font-size: .96rem; }
.rule-grid p { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.75; }

.rule-explorer { display: grid; grid-template-columns: 180px minmax(0, 1fr) 250px; min-height: 430px; margin-top: 34px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.rule-menu { padding: 24px 14px; border-right: 1px solid var(--line); background: #f1f3ef; }
.rule-menu > p { margin: 0 10px 18px; color: var(--faint); font-size: .64rem; font-weight: 800; }
.rule-menu button { position: relative; width: 100%; min-height: 43px; padding: 0 12px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; cursor: pointer; text-align: left; font-size: .76rem; font-weight: 700; }
.rule-menu button::after { position: absolute; right: 12px; content: "→"; opacity: 0; transform: translateX(-4px); transition: 150ms ease; }
.rule-menu button:hover, .rule-menu button.active { color: var(--forest); background: var(--surface); }
.rule-menu button.active::after { opacity: 1; transform: translateX(0); }
.rule-detail { min-width: 0; padding: 30px 34px; }
.rule-detail-kicker { margin: 0 0 8px; color: var(--coral); font-size: .65rem; font-weight: 800; }
.rule-detail h3 { margin: 0; font-family: "Songti SC", serif; font-size: 1.45rem; }
.rule-detail > p { max-width: 650px; margin: 11px 0 24px; color: var(--muted); font-size: .76rem; line-height: 1.75; }
.fund-split { display: grid; gap: 10px; }
.fund-row { display: grid; grid-template-columns: 36px 108px minmax(90px, 1fr) 42px; align-items: center; gap: 11px; min-height: 42px; }
.fund-row > i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--surface); background: var(--fund-color); font-style: normal; font-size: .58rem; font-weight: 800; }
.fund-row > span { color: var(--ink); font-size: .72rem; font-weight: 700; }
.fund-bar { height: 6px; overflow: hidden; border-radius: 6px; background: #e9ece9; }
.fund-bar i { display: block; height: 100%; border-radius: inherit; background: var(--fund-color); }
.fund-row > b { font-size: .72rem; text-align: right; }
.rule-note { margin-top: 22px; padding: 13px 15px; border-left: 3px solid var(--yellow); color: var(--muted); background: #fbf6e8; font-size: .7rem; line-height: 1.65; }
.score-list { display: grid; gap: 13px; }
.score-row { display: grid; grid-template-columns: 108px 1fr 42px; align-items: center; gap: 12px; }
.score-row span { color: var(--muted); font-size: .7rem; }
.score-row .fund-bar i { background: var(--forest); }
.score-row b { font-size: .7rem; text-align: right; }
.rule-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rule-check { position: relative; min-height: 72px; padding: 14px 14px 14px 39px; border: 1px solid var(--line); }
.rule-check::before { position: absolute; left: 14px; top: 16px; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; color: white; background: var(--forest); content: "✓"; font-size: .52rem; }
.rule-check strong, .rule-check span { display: block; }
.rule-check strong { font-size: .72rem; }
.rule-check span { margin-top: 5px; color: var(--muted); font-size: .64rem; line-height: 1.5; }
.rotation-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; counter-reset: rotation; }
.rotation-flow div { position: relative; min-height: 98px; padding: 14px 11px; background: var(--paper); counter-increment: rotation; }
.rotation-flow div::before { display: block; margin-bottom: 12px; color: var(--coral); content: "0" counter(rotation); font-family: Georgia, serif; font-size: .62rem; }
.rotation-flow strong, .rotation-flow span { display: block; }
.rotation-flow strong { font-size: .7rem; }
.rotation-flow span { margin-top: 5px; color: var(--muted); font-size: .61rem; line-height: 1.45; }
.risk-list { margin: 0; padding: 0; list-style: none; }
.risk-list li { display: grid; grid-template-columns: 90px 1fr; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: .7rem; line-height: 1.6; }
.risk-list li:last-child { border-bottom: 0; }
.risk-list strong { color: var(--ink); }
.risk-list span { color: var(--muted); }
.rights-panel { padding: 25px 22px; color: #e8f3ee; background: var(--forest); }
.rights-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rights-heading p { margin: 0; font-size: .78rem; font-weight: 800; }
.rights-heading span { padding: 4px 7px; border-radius: 3px; color: var(--mint); background: rgba(185,228,211,.1); font-size: .58rem; }
.queue-position { display: grid; place-items: center; width: 148px; height: 148px; margin: 28px auto 24px; border: 1px solid rgba(185,228,211,.35); border-radius: 50%; outline: 1px solid rgba(185,228,211,.12); outline-offset: 8px; }
.queue-position span, .queue-position strong, .queue-position small { display: block; text-align: center; }
.queue-position span { color: rgba(232,243,238,.62); font-size: .61rem; }
.queue-position strong { margin: 2px 0; color: white; font-size: 2rem; }
.queue-position small { color: var(--mint); font-size: .58rem; }
.rights-panel dl { margin: 0; }
.rights-panel dl div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
.rights-panel dt { color: rgba(232,243,238,.6); font-size: .65rem; }
.rights-panel dd { margin: 0; font-size: .68rem; font-weight: 800; }
.rights-action { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 41px; margin-top: 20px; padding: 0 13px; border: 1px solid rgba(255,255,255,.2); border-radius: 4px; color: white; background: rgba(255,255,255,.06); cursor: pointer; font-size: .7rem; font-weight: 800; }
.rights-action:hover { background: rgba(255,255,255,.1); }

footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 135px; padding: 28px max(24px, calc((100vw - 1240px) / 2)); color: #d9e7e0; background: var(--forest-dark); }
.footer-brand .brand-mark i { border-color: var(--mint); }
.footer-brand .brand-mark i:nth-child(3) { background: var(--mint); }
.footer-brand small { color: rgba(217,231,224,.55); }
footer > p { color: rgba(217,231,224,.55); font-family: "Songti SC", serif; font-size: .85rem; }
footer > div { display: flex; gap: 20px; }
footer > div a { color: rgba(217,231,224,.66); font-size: .7rem; text-decoration: none; }

.legal-page { width: min(780px, calc(100% - 40px)); min-height: 100vh; margin: 0 auto; padding: 82px 0 100px; }
.legal-page h1 { margin: 14px 0 10px; font-family: "Songti SC", serif; font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1.15; }
.legal-page h2 { margin: 38px 0 9px; font-family: "Songti SC", serif; font-size: 1.25rem; }
.legal-page p { color: var(--muted); font-size: .88rem; line-height: 1.95; }
.legal-page .legal-updated { color: var(--faint); font-size: .7rem; }
.legal-page a { color: var(--forest); font-weight: 750; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: 330px; padding: 13px 17px; border-radius: 5px; color: white; background: var(--forest-dark); box-shadow: 0 14px 35px rgba(0,0,0,.2); font-size: .78rem; opacity: 0; pointer-events: none; transform: translateY(12px); transition: 180ms ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(9,30,28,.62); backdrop-filter: blur(4px); }
.modal { position: relative; width: min(540px, 100%); max-height: calc(100vh - 40px); padding: 32px; overflow-y: auto; border-radius: var(--radius); background: var(--surface); box-shadow: 0 24px 70px rgba(0,0,0,.25); }
.modal-close { position: absolute; top: 13px; right: 14px; width: 32px; height: 32px; border: 0; border-radius: 50%; color: var(--muted); background: #eef1ee; cursor: pointer; font-size: 1.2rem; }
.modal-kicker { margin: 0 0 8px; color: var(--coral); font-size: .68rem; font-weight: 800; }
.modal h2 { margin: 0 40px 12px 0; font-family: "Songti SC", serif; font-size: 1.65rem; }
.modal-desc { margin: 0 0 20px; color: var(--muted); font-size: .82rem; line-height: 1.75; }
.modal-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.modal-facts div { padding: 12px; background: var(--paper); }
.modal-facts span, .modal-facts strong { display: block; }
.modal-facts span { color: var(--faint); font-size: .61rem; }
.modal-facts strong { margin-top: 5px; font-size: .76rem; }
.witness-box { margin-top: 18px; padding: 14px; border-left: 3px solid var(--mint-strong); background: #eef6f2; color: var(--muted); font-size: .74rem; line-height: 1.65; }
.evidence-strip { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 11px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.evidence-strip > span { flex: 0 0 auto; color: var(--faint); font-size: .65rem; }
.evidence-strip > div { display: flex; flex-wrap: wrap; gap: 6px; }
.evidence-strip b { padding: 5px 7px; border-radius: 3px; color: var(--forest); background: #e8f2ed; font-size: .6rem; }
.witness-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; margin-top: 17px; padding-top: 16px; border-top: 1px solid var(--line); }
.witness-actions div span, .witness-actions div strong { display: block; }
.witness-actions div span { color: var(--faint); font-size: .61rem; }
.witness-actions div strong { margin-top: 4px; font-size: .7rem; }
.witness-actions button, .profile-cta { min-height: 36px; padding: 0 10px; border-radius: 4px; cursor: pointer; font-size: .65rem; font-weight: 800; }
.witness-support { border: 1px solid var(--forest); color: white; background: var(--forest); }
.witness-more { border: 1px solid var(--line); color: var(--muted); background: var(--surface); }
.witness-actions button:disabled { cursor: default; opacity: .55; }
.profile-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 20px; }
.profile-summary div { padding: 12px; background: var(--paper); }
.profile-summary span, .profile-summary strong { display: block; }
.profile-summary span { color: var(--faint); font-size: .61rem; }
.profile-summary strong { margin-top: 5px; color: var(--forest); font-size: .74rem; }
.audit-mini { margin-top: 20px; }
.audit-mini > p { margin: 0 0 8px; color: var(--faint); font-size: .65rem; font-weight: 800; }
.audit-mini ul { margin: 0; padding: 0; list-style: none; }
.audit-mini li { display: grid; grid-template-columns: 72px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.audit-mini li > span { color: var(--faint); font-size: .61rem; }
.audit-mini li p { margin: 0; color: var(--muted); font-size: .68rem; line-height: 1.5; }
.audit-mini li b { display: block; margin-top: 3px; color: var(--forest); font-size: .57rem; }
.profile-cta { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 18px; border: 1px solid var(--forest); color: var(--forest); background: var(--surface); }

@media (max-width: 1050px) {
  .topbar { grid-template-columns: 190px 1fr 150px; }
  .topnav { gap: 18px; }
  .pool-hero { padding: 48px 44px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-card:nth-child(2) { border-right: 0; }
  .metric-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .workspace-grid { grid-template-columns: minmax(0, 1fr) 320px; }
  .request-card { grid-template-columns: 60px minmax(0, 1fr); }
  .request-progress { grid-column: 2; padding: 15px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .rule-explorer { grid-template-columns: 155px minmax(0, 1fr); }
  .rights-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 180px 1fr; align-items: center; gap: 24px; }
  .rights-heading { grid-column: 1; grid-row: 1 / 3; }
  .queue-position { width: 128px; height: 128px; margin: 12px auto; }
  .rights-panel .queue-position { grid-column: 2; grid-row: 1 / 3; }
  .rights-panel dl { grid-column: 3; grid-row: 1; }
  .rights-panel .rights-action { grid-column: 3; grid-row: 2; margin-top: 0; }
}

@media (max-width: 800px) {
  .topbar { grid-template-columns: 1fr auto; min-height: 64px; }
  .topnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: 58px; gap: 0; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(14px); }
  .topnav a { flex: 1; font-size: .68rem; }
  .topnav a::after { top: 0; bottom: auto; }
  .profile-button b, .profile-button i { display: none; }
  main { width: min(100% - 24px, 680px); }
  .pool-hero { grid-template-columns: 1fr; gap: 36px; min-height: 0; padding: 38px 28px; }
  .pool-copy h1 { font-size: 2.45rem; }
  .pool-balance { padding: 26px 0 0; border-top: 1px solid rgba(255,255,255,.14); border-left: 0; }
  .pool-meter { margin-top: 30px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 105px; border-right: 0; border-bottom: 1px solid var(--line); }
  .metric-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .metric-card:last-child { border-bottom: 0; }
  .workspace, .ledger-section, .rules-section { padding-top: 56px; }
  .workspace-grid { grid-template-columns: 1fr; }
  .action-panel { position: static; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .view-switch { width: 100%; }
  .view-switch button { flex: 1; padding: 0 8px; }
  .ledger-layout { grid-template-columns: 1fr; }
  .distribution-card { border-top: 1px solid var(--line); border-left: 0; }
  .audit-strip { grid-template-columns: 1fr; }
  .audit-strip-heading { border-right: 0; border-bottom: 1px solid var(--line); }
  .audit-strip-list { grid-template-columns: 1fr; }
  .audit-entry { border-right: 0; border-bottom: 1px solid var(--line); }
  .audit-entry:last-child { border-bottom: 0; }
  .rule-grid { grid-template-columns: 1fr 1fr; }
  .rule-grid article:nth-child(2) { border-right: 0; }
  .rule-grid article:nth-child(-n+2) { border-bottom: 1px solid #cbd3cf; }
  .rule-explorer { grid-template-columns: 1fr; }
  .rule-menu { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .rule-menu > p { display: none; }
  .rule-menu button { min-width: 105px; text-align: center; }
  .rule-menu button::after { display: none; }
  .rights-panel { grid-column: auto; grid-template-columns: 1fr 150px 1fr; }
  footer { flex-direction: column; align-items: flex-start; padding-bottom: 90px; }
}

@media (max-width: 520px) {
  .pool-hero { padding: 32px 20px; }
  .pool-copy h1 { font-size: 2.1rem; }
  .pool-actions { flex-direction: column; }
  .button { width: 100%; }
  .pool-balance > strong { font-size: 2.15rem; }
  .request-card { grid-template-columns: 48px minmax(0, 1fr); gap: 14px; padding: 18px 16px; }
  .avatar { width: 46px; height: 46px; font-size: 1rem; }
  .request-progress { grid-column: 1 / -1; }
  .form-row { grid-template-columns: 1fr; }
  .ledger-heading .text-button { width: 100%; }
  th, td { padding: 14px 12px; white-space: nowrap; }
  .rule-grid { grid-template-columns: 1fr; }
  .rule-grid article, .rule-grid article:not(:first-child) { min-height: auto; padding: 22px 0; border-right: 0; border-bottom: 1px solid #cbd3cf; }
  .rule-grid h3 { margin-top: 12px; }
  .rule-detail { padding: 24px 18px; }
  .fund-row { grid-template-columns: 30px 85px minmax(60px, 1fr) 34px; gap: 7px; }
  .rule-checks { grid-template-columns: 1fr; }
  .rotation-flow { grid-template-columns: 1fr 1fr; }
  .rights-panel { display: block; }
  .queue-position { margin: 28px auto; }
  .rights-panel .rights-action { margin-top: 20px; }
  .modal { padding: 25px 20px; }
  .modal-facts { grid-template-columns: 1fr; }
  .profile-summary { grid-template-columns: 1fr; }
  .witness-actions { grid-template-columns: 1fr 1fr; }
  .witness-actions div { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
