:root {
  color-scheme: light;
  --paper: #fafaf8;
  --surface: #fff;
  --ink: #171b19;
  --muted: #58645e;
  --green: #103d32;
  --soft: #e9f1ec;
  --border: #e3e8e3;
  --outline: #7b8a81;
  --danger: #8a293b;
  --danger-bg: #faedf0;
  --radius: 12px;
  --medium: 720px;
  font: 400 1rem/1.55 Inter, Geist, system-ui, -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-block-size: 100svh; display: flex; flex-direction: column; }
p { margin: 0 0 1em; }
a { color: var(--green); text-underline-offset: .22em; }
button, input, textarea, select { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 2px solid #1e715a; outline-offset: 4px; }
main:focus { outline: none; }
h1, h2, h3 { margin: 0; line-height: 1.2; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.5rem, 4vw, 1.875rem); letter-spacing: -.045em; font-weight: 700; }
h2 { font-size: 1.125rem; letter-spacing: -.015em; }
.sr, .auth-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip, .auth-skip { position: fixed; inset: .5rem auto auto .5rem; z-index: 10; background: var(--surface); padding: .65rem 1rem; transform: translateY(-200%); }
.skip:focus, .auth-skip:focus { transform: none; }

.signature-header {
  position: sticky; top: 0; z-index: 3;
  background: var(--paper); border-bottom: 1px solid var(--border);
}
.signature-header-inner { margin-inline: auto; width: min(100% - 48px, 1120px); min-height: 66px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; }
.signature-brand { display: inline-flex; align-items: center; gap: .42rem; width: fit-content; min-height: 44px; color: var(--green); text-decoration: none; font: 700 1.43rem/1 Georgia, serif; letter-spacing: -.06em; }
.signature-brand svg { width: 1.52rem; flex: 0 0 auto; }
.signature-nav a, .wm-sign-in { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .7rem; border-radius: 10px; font-size: .9rem; font-weight: 650; text-decoration: none; white-space: nowrap; }
.signature-nav a[aria-current="page"] { color: var(--green); background: var(--soft); }
.signature-account { justify-self: end; display: flex; align-items: center; gap: .45rem; }
.signature-footer, body[data-signature-legal] > footer { margin: auto auto 0; width: min(100% - 48px, var(--medium)); border-top: 1px solid var(--border); padding: .7rem 0 1.15rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .25rem 1rem; }
.signature-footer nav, body[data-signature-legal] footer nav { display: flex; gap: .9rem; flex-wrap: wrap; }
.signature-footer a, body[data-signature-legal] footer a { display: inline-flex; align-items: center; min-height: 44px; font-size: .83rem; text-decoration: none; color: var(--muted); }
.signature-footer a:hover, .wm-text-button:hover { text-decoration: underline; }

.wm-share, .auth-primary, .member-primary, .primary, .button, button:not([class]), .auth-secondary, .member-secondary, .feed-more, .wm-text-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; gap: .35rem;
  padding: .55rem .9rem; border: 1px solid transparent; border-radius: var(--radius);
  background: var(--green); color: white; font-size: .92rem; font-weight: 650; text-align: center; text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.wm-share svg { width: 17px; height: 17px; }
.wm-share:hover, .auth-primary:hover, .member-primary:hover, .primary:hover, .button:hover, button:not([class]):hover { background: #092d24; }
.auth-secondary, .member-secondary, .feed-more, .wm-text-button { color: var(--green); background: transparent; border-color: var(--border); }
.auth-secondary:hover, .member-secondary:hover, .feed-more:hover, .wm-text-button:hover, .wm-sign-in:hover { background: var(--soft); }
button:disabled { cursor: default; opacity: .62; }
.wm-avatar { flex: none; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: #e5eee8; color: var(--green); font-size: .8rem; font-weight: 700; line-height: 1; user-select: none; }
.wm-avatar svg { width: 1.2rem; }
.wm-avatar-large { width: 4.5rem; height: 4.5rem; font-size: 1.5rem; }
.wm-icon-button, .account-menu > summary, dialog .close {
  display: grid; place-items: center; min-width: 44px; min-height: 44px; list-style: none; background: transparent; padding: 0;
  color: var(--muted); border: 0; border-radius: 10px; font-size: 1.4rem;
}
.wm-icon-button:hover, .account-menu > summary:hover, dialog .close:hover { background: var(--soft); }
.wm-icon-button::-webkit-details-marker, .account-menu > summary::-webkit-details-marker { display: none; }
.wm-icon-button svg { width: 21px; height: 21px; }
.account-menu, .post-menu { position: relative; }
.wm-menu {
  position: absolute; z-index: 2; inset: calc(100% + 3px) 0 auto auto; min-width: 9.4rem; padding: .25rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 4px 14px #122a1d14;
}
.wm-menu a { display: flex; align-items: center; min-height: 44px; padding: .5rem .65rem; border-radius: 8px; text-decoration: none; white-space: nowrap; font-size: .875rem; }
.wm-menu a:hover, .wm-menu a:focus-visible { background: var(--soft); }

.app-layout { width: min(100% - 48px, var(--medium)); margin: 0 auto; padding-block: 2rem 3.5rem; }
#main { min-width: 0; overflow-wrap: anywhere; }
#main :is(section[id], form[id], article) { scroll-margin-top: 84px; }
.flow-header { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.signature-reading-context { color: var(--muted); font-size: .78rem; text-align: end; overflow-wrap: anywhere; }
.feed-day { font-size: .8rem; font-weight: 650; color: var(--muted); margin: 1rem 0 .1rem; letter-spacing: 0; }
.post { position: relative; background: transparent; padding: .8rem 0 1rem; border-bottom: 1px solid var(--border); }
.post-head { display: flex; align-items: center; gap: .35rem; }
.author-name { display: flex; align-items: center; gap: .75rem; margin-inline-end: auto; min-height: 44px; min-width: 0; color: var(--ink); text-decoration: none; }
.author-block { display: grid; gap: .06rem; justify-items: start; min-width: 0; }
.author-display { font-size: .92rem; line-height: 1.28; font-weight: 685; overflow-wrap: anywhere; }
.author-name:hover .author-display { text-decoration: underline; }
.post-username, .post-time { color: var(--muted); font-size: .775rem; line-height: 1.35; }
.post-time { flex: none; font-variant-numeric: tabular-nums; }
.post-body { margin: .4rem 2.7rem 0 3.25rem; line-height: 1.56; white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; }
#feed-status:not(:empty), .member-notice { color: var(--muted); padding: .75rem 0; margin: .65rem 0; }
#feed-status:empty { display: none; }
#retry-feed, #load-more { margin-top: .75rem; }

#composer, dialog, body[data-wm-auth-v1] .auth-main {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
}
#composer { padding: clamp(.95rem, 3vw, 1.45rem); margin-block: 1.25rem; }
.composer-top, .composer-identity, .composer-bottom { display: flex; align-items: center; gap: .75rem; }
.composer-top, .composer-bottom { justify-content: space-between; flex-wrap: wrap; }
.composer-top { margin-block-end: .5rem; }
.composer-identity { margin-block-end: 1rem; }
.composer-identity strong, .composer-identity bdi { display: block; font-size: .875rem; }
.composer-identity bdi, #character-count { color: var(--muted); font-size: .78rem; }
.composer-bottom { margin: .8rem 0; }
#post-text { min-height: 10rem; }
#composer .field-help { margin-block: .65rem; }
#composer-error:empty, .auth-progress:empty, .member-progress:empty { display: none; }
dialog { width: min(100% - 32px, 420px); max-height: calc(100% - 48px); color: var(--ink); padding: 1.6rem; }
dialog::backdrop { background: #10261cb0; }
dialog .close { position: absolute; top: .5rem; inset-inline-end: .5rem; }
dialog h2 { padding-inline-end: 2.4rem; margin-bottom: .6rem; }
dialog p { color: var(--muted); }
.profile-dialog-footer { display: flex; gap: 1rem; flex-wrap: wrap; }
.profile-dialog-footer a { display: inline-flex; min-height: 44px; align-items: center; }
#profile-content .wm-avatar { margin-bottom: .85rem; }
.success, .error, .auth-feedback, .state-card [role="alert"] { padding: .8rem 1rem; border-radius: var(--radius); margin: .8rem 0; }
.success { color: var(--green); background: var(--soft); }
.error, .auth-feedback, .state-card [role="alert"] { color: var(--danger); background: var(--danger-bg); }
.auth-feedback p { margin: 0; }

body[data-wm-auth-v1] .auth-main { width: min(100% - 48px, 444px); margin: clamp(1.5rem, 7vh, 4rem) auto 3rem; padding: clamp(1.15rem, 5vw, 2rem); }
.auth-copy { margin-bottom: 1.45rem; }
.auth-copy p, .auth-destination { color: var(--muted); margin: .5rem 0 0; font-size: .9rem; }
.auth-destination { margin: 0 0 1rem; }
.auth-destination strong { color: var(--ink); }
.auth-field, .member-field { display: grid; gap: .35rem; margin-bottom: 1.08rem; }
label { font-size: .91rem; font-weight: 620; }
#main :is(input:not([type=hidden],[type=checkbox],[type=radio]), textarea, select) {
  display: block; min-height: 46px; width: 100%; min-width: 0; padding: .65rem .75rem;
  border: 1px solid var(--outline); border-radius: var(--radius); color: var(--ink); background: var(--surface);
}
#main :is(input, textarea, select):user-invalid { border-color: var(--danger); }
textarea { resize: vertical; min-height: 6rem; }
:where(input[type=checkbox],input[type=radio]) { accent-color: var(--green); width: 1.1rem; height: 1.1rem; vertical-align: middle; }
.auth-primary { width: 100%; }
#main .auth-code { font-size: 1.22rem; letter-spacing: .28em; }
.auth-hint, .auth-note, .field-help, .auth-progress, .member-progress, .ui-character-count { font-size: .825rem; color: var(--muted); margin: .25rem 0 0; }
.auth-note, .auth-resend, .auth-progress { margin-top: 1rem; }
.auth-session-choice { margin-bottom: 1.2rem; }
.auth-session-choice label, .onboarding-confirm, [data-draft-choice] label { display: flex; align-items: center; gap: .55rem; min-height: 44px; cursor: pointer; }
.onboarding-confirm { display: block; }
.onboarding-steps { display: flex; flex-wrap: wrap; gap: .38rem .75rem; padding: 0; margin: 0 0 1.1rem; list-style: none; }
.onboarding-steps li { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; color: var(--muted); }
.onboarding-steps li > span:first-child { display: grid; place-items: center; width: 1.18rem; height: 1.18rem; border-radius: 50%; border: 1px solid var(--border); }
.onboarding-steps [aria-current] { font-weight: 700; color: var(--green); }
.onboarding-steps [aria-current] > span:first-child { background: var(--green); color: white; }
.onboarding-review, [data-onboarding-form] > p { color: var(--muted); font-size: .88rem; }
.auth-resend form { margin-block: .28rem; }

body[data-member-ui] .app-layout { max-width: 648px; }
.member-heading { margin: 0 0 1.2rem; }
.member-heading > p { margin: .35rem 0 0; }
.member-handle, .wm-profile-facts, .wm-section-head [role="status"] { color: var(--muted); font-size: .875rem; }
.member-status, .status { display: inline-flex; width: fit-content; font-size: .75rem; font-weight: 650; background: var(--soft); color: var(--green); border-radius: 20px; padding: .2rem .65rem; margin-top: .5rem; }
.member-status.rejected, .status.rejected { color: var(--danger); background: var(--danger-bg); }
.member-field { margin-bottom: 1.1rem; }
.member-heading + [data-member-profile] { margin-bottom: 1rem; }
[data-member-profile] p { margin: .35rem 0; }
.member-notice, .member-write { margin-block: 1rem; }
.member-report, .member-write a, [data-public-view] { display: inline-flex; align-items: center; min-height: 44px; font-size: .85rem; }
.member-compose, .wm-setting-group { margin: 1.45rem 0; }
.member-compose summary { min-height: 44px; padding-block: .6rem; }
.member-public-identity { border-bottom: 1px solid var(--border); padding-bottom: 1.15rem; }
.wm-profile-head, .wm-section-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .7rem; }
.wm-profile-facts { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin-top: .65rem; }
.member-bio { white-space: pre-wrap; unicode-bidi: plaintext; }
.profile-pagination { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.wm-setting-group h2 { color: var(--muted); font-size: .8rem; letter-spacing: 0; margin-bottom: .45rem; }
.wm-setting-row {
  min-height: 48px; padding: .55rem .85rem; background: var(--surface); display: flex; justify-content: space-between;
  align-items: center; color: var(--ink); text-decoration: none; gap: .65rem; border: 1px solid var(--border); font-size: .93rem;
}
.wm-setting-row + .wm-setting-row { margin-top: -1px; }
a.wm-setting-row:hover { color: var(--green); background: var(--soft); }
.wm-setting-row:first-of-type { border-radius: var(--radius) var(--radius) 0 0; }
.wm-setting-row:last-of-type { border-radius: 0 0 var(--radius) var(--radius); }
.wm-setting-row:only-of-type { border-radius: var(--radius); }
.wm-setting-row form { margin: 0; }
.wm-setting-row form[action="/auth/logout"] button { color: var(--danger); }
.wm-setting-row form[action="/auth/refresh"] button { border-color: transparent; }
#main > :is(h1,h2,.page-heading,.state-card,.auth-panel) { margin-bottom: .9rem; }
body[data-signature-legal] > main { width: min(100% - 48px, var(--medium)); margin: 2rem auto 3rem; }
body[data-signature-legal] section { margin-block: 1.2rem; }
body[data-signature-legal] section h2 { margin-block-end: .5rem; }
body[data-signature-legal] dt { color: var(--muted); font-size: .85rem; font-weight: 650; }
body[data-signature-legal] dd { margin: 0 0 .55rem; }
.draft { background: var(--soft); padding: .75rem 1rem; border-radius: var(--radius); }
.draft p { margin: .4rem 0 0; }
body[data-signature-legal] footer p { margin: .5rem 0; font-size: .85rem; }

@media (max-width: 580px) {
  .signature-header-inner { width: calc(100% - 28px); grid-template-columns: minmax(0,1fr) auto; gap: 0 .6rem; min-height: 60px; }
  .signature-brand { font-size: 1.15rem; gap: .2rem; }
  .signature-brand svg { width: 1.2rem; }
  .signature-nav { grid-row: 2; grid-column: 1/-1; border-top: 1px solid var(--border); }
  .signature-nav a { min-height: 44px; border-radius: 0; padding-inline: .2rem; }
  .signature-nav a[aria-current="page"] { background: transparent; box-shadow: inset 0 -2px var(--green); }
  .signature-account { grid-column: 2; grid-row: 1; gap: .2rem; }
  .wm-share, .wm-sign-in { padding-inline: .48rem; font-size: .82rem; }
  .wm-share { gap: .15rem; }
  .wm-share svg { width: .9rem; }
  .app-layout { padding-block: 1.25rem 2.4rem; }
  .app-layout, .signature-footer, body[data-signature-legal] > :is(main,footer), body[data-wm-auth-v1] .auth-main { width: calc(100% - 28px); }
  .post-body { margin-inline-end: 0; }
  .post-head { gap: .2rem; }
  .post-head .wm-avatar { width: 2.15rem; height: 2.15rem; }
  .author-name { gap: .55rem; }
  .post-body { margin-inline-start: 2.7rem; }
  #main :is(section[id], form[id], article) { scroll-margin-top: 114px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .signature-header, .skip, .auth-skip { display: none; }
  body[data-signature-legal] > main { width: 100%; }
}
.state-card h1 { margin-bottom: .55rem; }
.state-card .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.signature-header + .app-layout main > nav[aria-label="Support and legal"] { display: none; }

/* Account pages share the published reading width. */
body[data-member-ui] .app-layout:has(.member-profile-view, .member-editor) { max-width: var(--medium); }
.member-profile-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.member-profile-view .wm-profile-head { align-items: flex-start; }
.member-back { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: .875rem; }
.member-editor form > label { display: block; margin-block: 0 1.1rem; }
.member-editor form > label > :is(input, select, textarea) { margin-block-start: .35rem; }
.member-editor form + p { margin-top: 1rem; color: var(--muted); font-size: .875rem; }
