:root {
  color-scheme: light;
  --ink: #171714;
  --muted: #6c6c65;
  --line: #deded6;
  --paper: #fafaf7;
  --white: #fff;
  font-family: Arial, Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button, a, input, [tabindex] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: Georgia, 'Times New Roman', 'Songti SC', 'Noto Serif SC', serif; font-weight: 400; }
h1 { font-size: clamp(2.5rem, 5vw, 4.4rem); letter-spacing: -.05em; line-height: 1; margin-bottom: 18px; }
h2 { font-size: 1.7rem; letter-spacing: -.025em; margin-bottom: 12px; }
h3 { font-size: .92rem; font-weight: 600; margin-bottom: 26px; }
p { line-height: 1.6; }
.masthead { min-height: 96px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 5vw; }
.wordmark { font-family: Georgia, 'Times New Roman', serif; font-size: 20px; letter-spacing: .3em; text-decoration: none; }
.masthead-note, .subtle { color: var(--muted); font-size: .78rem; line-height: 1.5; }
.page { width: min(1280px, 90%); margin: 64px auto 96px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 46px; }
.eyebrow { margin-bottom: 16px; color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .16em; }
.intro { font-size: .92rem; color: var(--muted); max-width: 550px; margin-bottom: 0; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 11px 19px; border: 1px solid var(--ink); color: var(--ink); background: transparent; border-radius: 0; font-size: .78rem; line-height: 1.3; text-decoration: none; }
.button:hover { background: #eeeee7; }
.button-primary { background: var(--ink); color: var(--white); }
.button-primary:hover { background: #383832; }
.session-controls { display: flex; gap: 10px; flex-shrink: 0; }
.notice { border: 1px solid var(--line); border-left: 3px solid var(--ink); padding: 14px 18px; background: var(--white); font-size: .85rem; margin-bottom: 28px; overflow-wrap: anywhere; }
.notice[data-kind="error"] { border-left-color: #863626; }
.access-panel { background: var(--white); border: 1px solid var(--line); padding: 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 80px; }
.access-copy p:last-child { max-width: 390px; color: var(--muted); font-size: .86rem; margin-bottom: 0; }
.access-form { align-self: center; display: grid; gap: 12px; }
.access-form label { font-size: .8rem; }
.access-form input { width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px; border: 1px solid #a6a69b; border-radius: 0; background: transparent; }
.access-form .button { justify-self: start; min-width: 124px; }
.access-forms { align-self: center; min-width: 0; }
.code-form { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 28px; }
.access-form input[readonly] { color: var(--muted); background: var(--paper); }
#access-code { font-size: 1.4rem; letter-spacing: .35em; }
.field-hint { color: var(--muted); font-size: .74rem; line-height: 1.6; margin: 0; }
.automation { background: var(--ink); color: var(--white); padding: 30px 34px; display: flex; justify-content: space-between; align-items: flex-start; gap: 28px; margin-bottom: 44px; }
.automation .eyebrow { color: #bdbdb4; margin-bottom: 12px; }
.automation h2 { font-size: 1.65rem; margin-bottom: 9px; }
.automation p:last-child { margin-bottom: 0; color: #d0d0c7; font-size: .85rem; max-width: 650px; }
.badge { display: inline-block; padding: 5px 10px; border: 1px solid currentColor; border-radius: 999px; font-size: .67rem; line-height: 1.4; white-space: nowrap; }
.automation .badge { margin-top: 2px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-heading h2, .section-heading p { margin-bottom: 0; }
.metrics { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--white); }
.metric { padding: 26px 25px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric dt { font-size: .75rem; color: var(--muted); margin-bottom: 20px; }
.metric dd { font-family: Georgia, 'Times New Roman', serif; font-size: 2.65rem; font-variant-numeric: tabular-nums; margin: 0; overflow-wrap: anywhere; }
.delivery-section, .table-section { margin-top: 44px; }
.delivery-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); background: var(--white); }
.delivery-card { padding: 28px; }
.delivery-card + .delivery-card { border-left: 1px solid var(--line); }
.allowance { margin-bottom: 23px; }
.allowance-label { display: flex; justify-content: space-between; gap: 16px; font-size: .79rem; margin-bottom: 11px; font-variant-numeric: tabular-nums; }
progress { width: 100%; height: 3px; border: 0; display: block; appearance: none; background: #e8e8e1; accent-color: var(--ink); }
progress::-webkit-progress-bar { background: #e8e8e1; }
progress::-webkit-progress-value { background: var(--ink); }
progress::-moz-progress-bar { background: var(--ink); }
.outbox-counts { margin: 0 0 23px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.outbox-counts dt { color: var(--muted); font-size: .73rem; margin-bottom: 12px; }
.outbox-counts dd { margin: 0; font-family: Georgia, 'Times New Roman', serif; font-size: 2rem; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--white); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .76rem; }
thead { background: #f2f2ec; }
th { padding: 14px 18px; color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 400; white-space: nowrap; }
td { border-top: 1px solid var(--line); padding: 19px 18px; vertical-align: top; line-height: 1.55; }
td:first-child { max-width: 230px; overflow-wrap: anywhere; }
.piece-name { display: block; min-width: 170px; max-width: 340px; }
.variant-name { display: block; color: var(--muted); margin-top: 4px; }
.date-cell { color: var(--muted); white-space: nowrap; font-size: .72rem; }
.issue-cell { max-width: 310px; min-width: 150px; overflow-wrap: anywhere; color: var(--muted); }
.reference-cell { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .66rem; min-width: 130px; }
.table-state { margin: 0; border: 1px solid var(--line); padding: 28px; font-size: .82rem; color: var(--muted); background: var(--white); }
.load-more { margin-top: 18px; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); padding: 26px 5vw; color: var(--muted); font-size: .67rem; line-height: 1.6; }
.footer span:first-child { letter-spacing: .18em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.desk-nav { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 28px; margin-bottom: 40px; border-bottom: 1px solid var(--line); }
.membership-section .section-heading .eyebrow { margin-bottom: 10px; }
.membership-section > .subtle { max-width: 790px; margin-bottom: 24px; }
.membership-config { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-top: 0; background: var(--white); }
.settings-form, .sync-panel { padding: 28px; min-width: 0; }
.sync-panel { border-left: 1px solid var(--line); }
.settings-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 16px; }
.settings-fields label, .member-search label { display: block; font-size: .75rem; margin-bottom: 9px; }
.settings-fields input, .member-search input { border: 1px solid #a6a69b; background: var(--paper); padding: 12px; width: 100%; min-width: 0; border-radius: 0; min-height: 44px; }
.settings-form > .button { margin-top: 18px; }
.sync-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0; }
.member-search { margin: 0 0 20px; max-width: 420px; }
.member-search .field-hint { display: block; margin-top: 8px; }
.member-name { display: block; min-width: 135px; }
.money-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.consent-line { display: block; min-width: 140px; }
#members-table-wrap table { min-width: 1040px; }
#care-drafts-table-wrap table { min-width: 670px; }
#rewards-table-wrap table { min-width: 790px; }
#subscriptions-table-wrap table { min-width: 900px; }
#jobs-table-wrap table { min-width: 790px; }
#care-drafts-table-wrap td:nth-child(2), #rewards-table-wrap td:nth-child(2) { min-width: 140px; }
#rewards-table-wrap td:first-child { min-width: 95px; }
.draft-previews { border: 1px solid var(--line); background: #f3f2ed; padding: 23px; margin: 24px 0; }
.draft-previews > .field-hint { display: block; margin-bottom: 13px; }
.draft-previews > div { display: flex; flex-wrap: wrap; gap: 10px; }
.reward-explainer { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; margin: 0 0 16px; padding: 24px; background: var(--white); border: 1px solid var(--line); }
.reward-explainer p { margin: 0; font-size: .8rem; }
.reward-explainer strong { display: block; margin-bottom: 7px; font: normal 1.6rem Georgia, 'Times New Roman', serif; }
.reward-note { margin-bottom: 22px; }
.restock-divider { margin-top: 68px; padding-top: 36px; border-top: 1px solid var(--line); }
.restock-divider .eyebrow { margin-bottom: 22px; }
h2[id] { scroll-margin-top: 25px; }

@media (max-width: 800px) {
  .masthead { min-height: 76px; }
  .masthead-note { display: none; }
  .page { margin-top: 42px; }
  .page-heading { display: block; margin-bottom: 30px; }
  .session-controls { margin-top: 24px; }
  .access-panel { padding: 28px; gap: 30px; grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--line); }
  .metric { padding: 23px; }
  .metric dd { font-size: 2.2rem; }
  .delivery-grid { grid-template-columns: 1fr; }
  .delivery-card + .delivery-card { border-left: 0; border-top: 1px solid var(--line); }
  .section-heading { display: block; }
  .section-heading p { margin-top: 8px; }
  .automation { padding: 26px; display: block; }
  .automation .badge { margin-top: 20px; }
  .footer { align-items: flex-start; flex-direction: column; gap: 8px; }
  .membership-config { grid-template-columns: 1fr; }
  .sync-panel { border-left: 0; border-top: 1px solid var(--line); }
  .membership-section .section-heading > .badge { margin-top: 14px; }
  .section-heading > .button { margin-top: 16px; }
  .reward-explainer { grid-template-columns: 1fr; gap: 17px; }
  .reward-explainer p + p { border-top: 1px solid var(--line); padding-top: 17px; }
  .reward-explainer strong { display: inline; margin-right: 8px; font-size: 1.3rem; }
  .settings-fields { gap: 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  .button { transition: background-color 150ms ease; }
}
