:root { color-scheme: light; --reader-ink: #24362e; --reader-muted: #59615c; --reader-green: #285f46; --reader-line: #cbd0ca; --reader-paper: #fff; }
* { box-sizing: border-box; }
body { margin: 0; background: #d9dad8; color: var(--reader-ink); font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; border: 1px solid var(--reader-line); border-radius: 5px; background: #fff; color: var(--reader-ink); padding: 8px 12px; }
button:hover:not(:disabled) { background: #edf1ec; }
button:disabled { opacity: .5; cursor: not-allowed; }
a { color: var(--reader-green); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid #97640f; outline-offset: 3px; }
[hidden] { display: none !important; }
.reader-shell { min-height: 100vh; }
.reader-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.reader-skip { position: fixed; z-index: 30; left: 14px; top: 10px; transform: translateY(-160%); padding: 9px 14px; border: 1px solid var(--reader-green); background: #fff; border-radius: 4px; }
.reader-skip:focus { transform: translateY(0); }
.reader-masthead { position: sticky; top: 0; z-index: 6; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; min-height: 84px; padding: 13px 32px; border-bottom: 1px solid #bec4bc; background: #f3f4f0; }
.reader-brand { display: inline-flex; align-items: center; justify-self: start; gap: 10px; text-decoration: none; color: #27563e; }
.reader-brand > img { display: block; width: 200px; height: auto; }
.reader-title { text-align: center; }
.reader-title h1 { font-family: Georgia, 'Times New Roman', serif; font-size: 27px; font-weight: 400; line-height: 1.1; margin: 0; letter-spacing: -.02em; }
.reader-title p { margin: 4px 0 0; font-size: 11px; letter-spacing: .08em; color: var(--reader-muted); }
.reader-header-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; font-size: 12px; }
.reader-header-actions > a { white-space: nowrap; }
.reader-text-button { border: 0; background: transparent; padding: 5px 7px; text-decoration: underline; text-underline-offset: 3px; font-size: 12px; }
.reader-reading-tools { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 18px; padding: 12px 20px 0; color: #4b544d; font-size: 12px; }
.reader-reading-tools p { margin: 0; }
.reader-document-status { text-align: center; margin: 3px 20px 17px; color: #4d554e; font-size: 11px; }
.reader-status-pending { color: #6c512a; }
.reader-status-error { color: #843629; }
.reader-pages { width: calc(100% - 72px); max-width: 1100px; margin: 0 auto; padding-bottom: 18px; scroll-margin-top: 98px; }
.reader-page { display: grid; grid-template-columns: minmax(0, 860px) 156px; gap: 22px; align-items: start; margin-bottom: 32px; }
.reader-page-paper { min-width: 0; }
.reader-sheet { position: relative; width: 100%; background: white; aspect-ratio: 1200 / 1698; box-shadow: 0 2px 5px #25302920, 0 12px 28px #25302912; cursor: crosshair; scroll-margin-top: 102px; container-type: inline-size; }
.reader-page-image { display: block; width: 100%; height: auto; background: #fff; user-select: none; -webkit-user-drag: none; }
.reader-text-layer { position: absolute; inset: 0; z-index: 1; color: transparent; -webkit-text-fill-color: transparent; cursor: text; user-select: text; -webkit-user-select: text; }
.reader-text-word { position: absolute; display: inline-block; white-space: pre; line-height: 1; font-family: Arial, Helvetica, sans-serif; font-weight: 400; color: transparent; -webkit-text-fill-color: transparent; user-select: text; -webkit-user-select: text; }
.reader-text-word::selection { background: #4c92ca55; color: transparent; -webkit-text-fill-color: transparent; }
.reader-mobile-dock, .reader-mobile-instruction { display: none; }
.reader-sheet:focus { outline: 2px solid #5e7866; outline-offset: 4px; }
.reader-page-caption { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0 0; font-size: 11px; color: #4d554e; }
.reader-page-caption .reader-text-button { min-height: 34px; font-size: 11px; padding: 4px 2px; }
.reader-page-margin { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; min-width: 0; }
.reader-margin-note { display: flex; align-items: flex-start; justify-content: flex-start; gap: 7px; width: 100%; padding: 8px; text-align: left; background: #eef0e9; border-color: #b8c4b2; font-size: 11px; box-shadow: 1px 2px 0 #b9c1b333; }
.reader-margin-note > span:first-child { display: flex; align-items: center; justify-content: center; width: 19px; height: 19px; flex-shrink: 0; margin-top: 1px; border-radius: 50%; background: #285f46; color: white; font-size: 10px; }
.reader-margin-note > span:last-child { min-width: 0; }
.reader-margin-note strong, .reader-margin-note > span > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 111px; }
.reader-margin-note > span > span { color: #57624f; margin-top: 2px; }
.reader-note-pin, .reader-draft-pin { position: absolute; z-index: 2; transform: translate(-50%, -50%); min-width: 28px; width: 28px; min-height: 28px; height: 28px; padding: 0; border: 2px solid white; border-radius: 50%; background: #285f46; color: white; box-shadow: 0 1px 5px #1727195c; font-size: 11px; font-weight: 700; cursor: pointer; }
.reader-note-pin:hover:not(:disabled), .reader-note-pin.reader-pin-selected { background: #173e2a; box-shadow: 0 0 0 3px #bad0a9, 0 2px 6px #17271955; }
.reader-draft-pin { border: 2px solid #285f46; background: #fffceb; color: #285f46; font-size: 20px; z-index: 3; }
.reader-context-menu { position: absolute; z-index: 4; width: 160px; max-width: calc(100% - 8px); padding: 4px; border: 1px solid #bbc6b5; border-radius: 5px; background: white; box-shadow: 0 6px 22px #26362933; cursor: default; }
.reader-context-menu > button { width: 100%; border: 0; padding: 9px 10px; min-height: 40px; font-size: 12px; }
.reader-editor-open .reader-pages { width: calc(100% - 470px); max-width: 1080px; margin-left: 32px; margin-right: 438px; }
.reader-editor { position: fixed; z-index: 10; width: 386px; right: 18px; top: 101px; bottom: 18px; display: flex; flex-direction: column; background: #fffef8; border: 1px solid #bbc6b5; border-radius: 7px; box-shadow: 0 12px 32px #27382c25; overflow: hidden; }
.reader-editor-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid #d6ddcf; padding: 10px 16px; background: #eff2e9; font-size: 11px; color: #4d6044; }
.reader-editor-close { width: 34px; min-height: 34px; padding: 0; font-size: 23px; border: 0; background: transparent; }
.reader-editor-body { min-height: 0; overflow: auto; padding: 19px 20px 23px; overscroll-behavior: contain; }
.reader-editor-body > h2 { margin: 0 0 9px; font-family: Georgia, 'Times New Roman', serif; font-size: 25px; font-weight: 400; line-height: 1.2; }
.reader-editor-body > h2:focus { outline: 0; }
.reader-public-notice { margin: 0 0 12px; font-size: 11px; color: #56624f; }
.reader-availability { margin: 0 0 16px; font-size: 11px; color: var(--reader-muted); }
.reader-availability-pending { padding: 10px 11px; border: 1px solid #ded4b8; border-radius: 4px; color: #705525; background: #f7f2df; }
.reader-availability-error { color: #8b3e2d; }
.reader-form h3, .reader-form h4 { font-family: Georgia, 'Times New Roman', serif; font-size: 19px; font-weight: 400; margin: 0 0 15px; }
.reader-form h3 span { color: var(--reader-muted); font-size: 14px; }
.reader-field { margin-bottom: 14px; }
.reader-field > label { display: block; margin: 0 0 5px; font-size: 12px; font-weight: 700; }
.reader-field > label span { font-size: 10px; font-weight: 400; color: var(--reader-muted); }
input[type=text], textarea { width: 100%; border: 1px solid #7c8b72; background: #fff; color: var(--reader-ink); border-radius: 4px; padding: 9px 10px; font-size: 13px; }
input::placeholder, textarea::placeholder { color: #617155; opacity: 1; }
textarea { display: block; resize: vertical; min-height: 108px; }
textarea[name=quote] { min-height: 64px; }
input:disabled, textarea:disabled { opacity: .7; cursor: not-allowed; }
input[aria-invalid=true], textarea[aria-invalid=true] { border-color: #9a4937; }
.reader-hint { margin: 5px 0 0; font-size: 10px; color: var(--reader-muted); line-height: 1.45; }
.reader-counter { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.reader-counter > span { font-variant-numeric: tabular-nums; }
.reader-publication-notice { font-size: 10px; color: #59664f; line-height: 1.5; margin: 12px 0 13px; }
.reader-primary { background: var(--reader-green); border-color: var(--reader-green); color: white; padding: 10px 15px; font-size: 12px; }
.reader-primary:hover:not(:disabled) { background: #1d4b34; color: white; }
.reader-feedback { margin: 12px 0 0; font-size: 12px; overflow-wrap: anywhere; }
.reader-error, .reader-field-error { color: #923e2b; }
.reader-field-error { margin: 6px 0 8px; font-size: 11px; }
.reader-success { color: #285f46; }
.reader-threads { list-style: none; padding: 0; margin: 0; }
.reader-thread { min-width: 0; }
.reader-thread-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.reader-author { min-width: 0; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.reader-page-tag { flex-shrink: 0; font-size: 10px; color: #4f6444; padding: 2px 6px; background: #eaf0df; border-radius: 3px; }
.reader-declared { display: block; margin: 3px 0 0; color: #617154; font-size: 10px; }
.reader-quote { margin: 13px 0; padding: 10px 12px; background: #f0f2e7; border-left: 2px solid #b2c397; }
.reader-quote > span { font-size: 9px; font-weight: 700; letter-spacing: .06em; color: #5c6d48; text-transform: uppercase; }
.reader-quote > p { margin: 5px 0 0; font-family: Georgia, 'Times New Roman', serif; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.reader-comment-text { font-size: 13px; margin: 13px 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.reader-date { display: block; color: #617154; font-size: 10px; }
.reader-thread-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 15px; padding-top: 12px; border-top: 1px solid #dce2d5; }
.reader-thread-actions > button { font-size: 11px; min-height: 38px; padding: 6px 8px; }
.reader-vote-count { font-variant-numeric: tabular-nums; padding: 0 4px; border-left: 1px solid #cbd6be; }
.reader-replies { list-style: none; margin: 17px 0 0; padding: 0 0 0 13px; border-left: 1px solid #c6d4b8; }
.reader-replies > li + li { border-top: 1px solid #e1e7da; margin-top: 13px; padding-top: 13px; }
.reader-replies .reader-comment-text { margin-top: 8px; }
.reader-inline-form { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--reader-line); }
.reader-inline-form .reader-form h4 { font-size: 18px; margin-bottom: 13px; }
.reader-close { display: flex; margin: 4px 0 0 auto; }
.reader-vote-options { border: 0; padding: 0; margin: 0 0 14px; }
.reader-vote-options > legend { font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.reader-vote-options > label { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; font-size: 12px; cursor: pointer; }
.reader-vote-options input { width: 16px; height: 16px; margin: 0; accent-color: var(--reader-green); cursor: pointer; }
.reader-vote-options > p { margin-top: 9px; }
.reader-empty { font-size: 13px; color: var(--reader-muted); padding: 15px 0; }
.reader-footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px; color: #4b554b; font-size: 11px; padding: 8px 20px 25px; }

/* The guide uses a neutral editing canvas; the shared rules reader keeps its theme. */
.reader-guide { --reader-ink: #2e3236; --reader-muted: #5c6268; --reader-line: #bdc1c5; background: #c6c7c9; }
.reader-guide .reader-masthead { background: #ececee; border-bottom-color: #aeb2b6; }
.reader-guide .reader-title h1, .reader-guide .reader-editor-body > h2, .reader-guide .reader-form h3, .reader-guide .reader-form h4 { font-family: Arial, Helvetica, sans-serif; font-weight: 500; letter-spacing: normal; }
.reader-guide .reader-reading-tools, .reader-guide .reader-document-status, .reader-guide .reader-page-caption, .reader-guide .reader-footer { color: #41464b; }
.reader-guide .reader-sheet { box-shadow: 0 1px 4px #00000026, 0 8px 24px #00000014; }
.reader-guide .reader-editor { border-color: #afb5bb; box-shadow: 0 10px 28px #00000026; }
.reader-guide .reader-editor-top { background: #ececee; border-bottom-color: #c8cbd0; color: #484f55; }
.reader-guide .reader-mobile-dock { background: #ececeef5; border-top-color: #aeb2b6; }

@media (min-width: 1700px) { .reader-editor-open .reader-pages { margin-left: auto; margin-right: 455px; } }
@media (max-width: 1150px) { .reader-page { grid-template-columns: minmax(0, 1fr) 116px; gap: 14px; } .reader-margin-note { padding: 6px; font-size: 10px; } .reader-margin-note strong, .reader-margin-note > span > span { max-width: 75px; } }
@media (orientation: portrait), (max-width: 950px), (pointer: coarse) {
  .reader-shell { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  .reader-editor-open { padding-bottom: calc(min(55dvh, 440px) + 88px + env(safe-area-inset-bottom, 0px)); }
  .reader-desktop-add, .reader-desktop-instruction { display: none; }
  .reader-mobile-instruction { display: inline; }
  .reader-sheet { cursor: text; touch-action: auto; }
  .reader-mobile-dock { display: flex; position: fixed; z-index: 12; left: 0; right: 0; bottom: var(--reader-viewport-bottom, 0px); justify-content: center; align-items: center; padding: 9px 16px calc(9px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #b7c0b4; background: #f3f4f0f2; box-shadow: 0 -3px 12px #27382c15; }
  .reader-mobile-dock > button { min-height: 44px; width: min(100%, 370px); font-size: 14px; }
  .reader-masthead { padding: 12px 18px; gap: 13px; }
  .reader-pages, .reader-editor-open .reader-pages { width: calc(100% - 44px); max-width: 930px; margin: 0 auto; }
  .reader-editor { top: auto; right: 12px; bottom: calc(var(--reader-viewport-bottom, 0px) + 74px + env(safe-area-inset-bottom, 0px)); left: 12px; width: auto; max-width: 680px; margin: 0 auto; max-height: min(55dvh, 440px, calc(var(--reader-viewport-height, 100dvh) - 88px - env(safe-area-inset-bottom, 0px))); border-radius: 14px; }
  .reader-editor-top { padding: 6px 14px; }
  .reader-editor-close { width: auto; padding: 4px 7px; font-size: 12px; }
  .reader-editor-body { padding: 12px 16px 16px; scroll-padding: 16px; }
  .reader-editor-body > h2 { font-size: 20px; margin-bottom: 7px; }
  .reader-editor-body > .reader-public-notice, .reader-editor-body > .reader-availability-ready { display: none; }
  .reader-form h3 { font-size: 17px; margin-bottom: 10px; }
  .reader-field { margin-bottom: 10px; }
  .reader-form-comment textarea[name=text] { min-height: 85px; }
  .reader-form-comment textarea[name=quote] { min-height: 48px; }
  .reader-form-comment .reader-hint { font-size: 10px; }
  .reader-publication-notice { margin: 9px 0; }
  .reader-editor .reader-primary { min-height: 44px; }
  .reader-page { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .reader-page-margin { flex-direction: row; flex-wrap: wrap; padding: 3px 0 0; gap: 5px; }
  .reader-margin-note { width: auto; max-width: 180px; align-items: center; min-height: 33px; padding: 5px 7px; font-size: 11px; }
  .reader-margin-note > span > span { display: none; }
  .reader-margin-note strong { max-width: 135px; }
  input[type=text], textarea { font-size: 16px; }
}
@media (max-width: 570px) {
  .reader-masthead { grid-template-columns: 1fr auto 1fr; min-height: 74px; gap: 6px; padding: 10px 12px; }
  .reader-brand { gap: 5px; }
  .reader-brand > img { width: 115px; height: auto; }
  .reader-title h1 { font-size: 22px; }
  .reader-title p { font-size: 10px; margin-top: 3px; }
  .reader-header-actions { gap: 2px; font-size: 10px; }
  .reader-header-actions .reader-text-button { font-size: 10px; min-height: 30px; padding: 2px; }
  .reader-reading-tools { padding: 10px 14px 0; gap: 0; font-size: 11px; text-align: center; }
  .reader-reading-tools .reader-text-button { min-height: 30px; font-size: 11px; }
  .reader-document-status { margin-bottom: 14px; font-size: 10px; }
  .reader-pages, .reader-editor-open .reader-pages { width: calc(100% - 30px); }
  .reader-page { margin-bottom: 24px; }
  .reader-editor { left: 7px; right: 7px; }
  .reader-editor-body { padding: 12px 15px 15px; }
  .reader-note-pin, .reader-draft-pin { width: 30px; height: 30px; min-height: 30px; min-width: 30px; }
}
.rules-review .reader-pages { padding-bottom: 35px; }
.rules-intro { margin: 0 0 28px; padding: 24px 28px; background: #f3f4f0; border: 1px solid #bec4bc; border-radius: 4px; }
.rules-intro h2 { font-size: 22px; margin: 8px 0; }
.rules-intro p, .rules-end { line-height: 1.6; font-size: 14px; }
.rules-status { font-weight: 700; color: #53634c; font-size: 12px !important; letter-spacing: .04em; }
.rules-index { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; margin-top: 20px; font-size: 13px; }
.rules-page { scroll-margin-top: 110px; }
.rules-sheet { padding: 28px; background: white; border-radius: 3px; box-shadow: 0 2px 5px #25302920, 0 12px 28px #25302912; }
.rules-sheet h2 { margin: 0 0 13px; font-size: 20px; line-height: 1.35; }
.rules-text { margin: 0; font-size: 16px; line-height: 1.8; white-space: normal; overflow-wrap: anywhere; }
.rules-review .reader-page-caption button { min-height: 44px; }
.rules-review .reader-masthead .reader-header-actions { gap: 8px 14px; }
@media (max-width: 570px) {
  .rules-intro, .rules-sheet { padding: 20px; }
  .rules-index { grid-template-columns: 1fr; }
  .rules-sheet h2 { font-size: 18px; }
  .rules-text { font-size: 15px; line-height: 1.8; }
  .rules-review .reader-header-actions { flex-direction: column; gap: 3px !important; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }

.portal-auth { display:flex; align-items:center; flex-wrap:wrap; gap:.75rem; padding:.75rem 1rem; border-bottom:1px solid #c9d4d7; background:#f6faf9; color:#143239; font-family:system-ui,sans-serif; }
.portal-auth div { flex:1 1 18rem; }
.portal-auth p { margin:.3rem 0; font-size:.88rem; }
.portal-auth button { border:1px solid #31575e; border-radius:.4rem; padding:.6rem .9rem; background:#143239; color:#fff; cursor:pointer; }
.portal-auth button:disabled { opacity:.6; cursor:wait; }
.portal-auth a { color:#143239; font-size:.9rem; }
