:root {
  color-scheme: light;
  --paper: #f4efe6;
  --ink: #242824;
  --muted: #65685d;
  --accent: #275c48;
  --line: #d4d5c8;
  --panel: #fdfaf3;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
header { border-bottom: 1px solid var(--line); }
header .shell { padding: 1rem 0; }
.shell { width: min(100% - 2rem, 54rem); margin-inline: auto; }
main { padding-block: 2rem 4rem; }
a { color: var(--accent); text-underline-offset: 0.2em; }
.brand { font-family: Georgia, serif; font-size: 1.6rem; font-weight: 700; text-decoration: none; }
.brand small { font: 500 0.85rem system-ui, sans-serif; color: var(--muted); margin-inline-start: 0.4rem; }
h1 { margin: 0 0 1.25rem; font-size: clamp(1.8rem, 5vw, 2.8rem); }
h2 { margin: 0 0 0.75rem; font-size: 1.3rem; }
p { line-height: 1.65; margin: 0.65rem 0; }
label, summary { font-weight: 620; }
summary { cursor: pointer; }
small, .muted { color: var(--muted); }
.panel { padding: 1.25rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); margin-block: 1rem; }
.bar, .inline-form { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
.bar { justify-content: space-between; }
.inline-form { margin-block: 1rem; }
form .bar { justify-content: flex-start; margin: 0.5rem 0; }
input { max-width: 100%; min-height: 2.5rem; color: var(--ink); font: inherit; }
input[type=password], input[type=number] { border: 1px solid var(--line); border-radius: 6px; padding: 0.4rem; }
input[type=number] { width: 6rem; }
button { min-height: 2.5rem; background: var(--accent); border: 0; border-radius: 6px; color: white; font: inherit; font-weight: 620; cursor: pointer; padding: 0.4rem 0.85rem; }
button:disabled { opacity: 0.55; cursor: wait; }
.error { color: #9a2f26; }
#status { position: sticky; top: 0; background: var(--paper); padding-block: 0.35rem; z-index: 1; }
#status:empty { display: none; }
.reader-web .shell { width: min(100% - 2rem, 42rem); }
.reader-web h1, .reader-web article { font-family: Georgia, serif; }
.reader-web article { font-size: clamp(1.15rem, 3vw, 1.35rem); margin-block: 1.75rem; }
.reader-web article p { white-space: pre-line; margin-block: 0 1em; }
.reader-web nav { display: flex; justify-content: space-between; gap: 0.75rem; }
.tag { color: var(--accent); font-weight: 700; font-size: 0.85rem; }
.web-catalog, .web-toc { list-style: none; padding: 0; }
.web-catalog a { display: grid; border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem; margin-block: 0.75rem; background: var(--panel); text-decoration: none; gap: 0.45rem; }
.web-catalog strong { font: 700 1.6rem Georgia, serif; color: var(--ink); }
.web-toc li { border-top: 1px solid var(--line); padding: 0.9rem 0; }
.web-toc small { margin-inline-start: 0.5rem; }
.trial-intro, .trial-next { padding: 1.5rem; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.trial-intro .tag { margin-top: 0; }
.trial-author { color: var(--muted); }
.reader-action { display: inline-block; padding: 0.72rem 1rem; background: var(--accent); color: white; border-radius: 9px; font-weight: 650; text-decoration: none; }
.reader-action:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.trial-next { margin-block-start: 2rem; }
[data-handoff-code] { display: block; width: fit-content; max-width: 100%; padding: 0.35rem 0.55rem; background: var(--paper); overflow-wrap: anywhere; user-select: all; }
select { min-height: 2.5rem; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); font: inherit; padding-inline: 0.45rem; }
.trial-admin { border-top: 1px solid var(--line); margin-block-start: 1rem; }
.trial-admin h3 { margin: 1rem 0 0; }
.trial-form { align-items: end; }
.trial-form label { display: grid; gap: 0.2rem; }
.trial-form input { width: min(10rem, 100%); border: 1px solid var(--line); border-radius: 6px; padding: 0.45rem; }
.trial-form input[type=number] { width: 7rem; }
.trial-report { margin-block-start: 0.8rem; padding: 0.7rem 0.85rem; border: 1px solid var(--line); border-radius: 8px; }
.trial-report p, .trial-report .inline-form { margin-block: 0.25rem; }
.trial-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr)); gap: 0.5rem; margin-bottom: 0; }
.trial-counts dt { color: var(--muted); font-size: 0.8rem; }
.trial-counts dd { margin: 0; font-size: 1.3rem; font-weight: 700; }
button.secondary { background: var(--panel); color: var(--accent); border: 1px solid var(--line); }
#import-preview { margin-top: 1rem; padding: 1rem; border-radius: 8px; background: var(--paper); overflow-wrap: anywhere; }
#import-preview h3 { margin-top: 0; }
#import-preview select { display: block; width: 100%; margin-block: 0.35rem; }
#import-preview h4 { margin-block: 0.75rem 0.3rem; }
#import-preview blockquote { margin: 0; border-inline-start: 2px solid var(--line); padding-inline-start: 0.7rem; white-space: pre-wrap; line-height: 1.6; }
.trial-table { overflow-x: auto; }
.trial-table table { border-collapse: collapse; width: 100%; font-size: 0.87rem; }
.trial-table th, .trial-table td { padding: 0.45rem; border-bottom: 1px solid var(--line); text-align: start; }
.trial-table th { min-width: 4.3rem; }
