:root { color-scheme: light; --ink:#233b36; --muted:#586660; --paper:#fbf8f1; --line:#d9dfd5; --accent:#254f43; --wash:#eef2e9; }
* { box-sizing:border-box; }
body { margin:0; background:var(--paper); color:var(--ink); font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; line-height:1.6; }
button,input,textarea { font:inherit; }
button,a,summary { -webkit-tap-highlight-color:transparent; }
button { cursor:pointer; }
button:disabled { opacity:.5; cursor:not-allowed; }
a { color:var(--accent); text-underline-offset:3px; }
:focus-visible { outline:3px solid #a46424; outline-offset:4px; }
[hidden] { display:none !important; }
.site-header { max-width:1320px; margin:auto; padding:19px 36px; display:flex; justify-content:space-between; align-items:center; gap:16px; border-bottom:1px solid var(--line); }
.brand { display:flex; align-items:center; gap:10px; font-family:Georgia,serif; font-size:23px; font-weight:bold; text-decoration:none; color:var(--ink); }
.brand img { object-fit:contain; }
main { max-width:1320px; margin:auto; padding:30px 36px 38px; }
.intro { margin-bottom:25px; }
.eyebrow { margin:0 0 7px; font-size:11px; letter-spacing:.11em; text-transform:uppercase; color:var(--muted); }
h1 { margin:0 0 9px; font-family:Georgia,"Times New Roman",serif; font-weight:normal; font-size:clamp(29px,3.5vw,43px); line-height:1.2; letter-spacing:-.02em; }
.invitation { margin:0 0 5px; font-size:17px; }
.permission { margin:0; color:var(--muted); font-size:13px; }
.workspace { display:grid; grid-template-columns:minmax(0,.84fr) minmax(0,1.16fr); gap:30px; align-items:start; }
.dossier { min-width:0; }
.scene-photo { margin:0; }
.scene-photo img { width:100%; height:auto; display:block; border-radius:11px; }
figcaption { font-size:10px; color:var(--muted); margin:6px 0 15px; }
.clues { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:14px; }
.paper-note,.phone-note { padding:18px; min-width:0; border-radius:5px; }
.paper-note { background:#f1e7c9; box-shadow:0 3px 8px #4a3e2910; transform:rotate(-1deg); color:#463e29; }
.clue-label { font-size:10px; text-transform:uppercase; letter-spacing:.08em; font-weight:500; margin:0 0 15px; opacity:.8; }
.paper-note p { font-family:Georgia,"Times New Roman",serif; font-size:18px; line-height:1.6; margin:0; }
.paper-note .signature { text-align:right; margin:12px 6px 0; }
.phone-note { background:#e9ede7; }
.bubble { background:white; border-radius:10px 10px 10px 2px; padding:9px 12px; margin:0 0 8px; }
.bubble p { margin:0; font-size:13px; }
.bubble span { display:block; font-size:10px; color:#66716b; text-align:right; }
.unanswered { margin:0; font-size:10px; color:var(--muted); }
.writing-area { min-width:0; }
.writing-card { background:white; border:1px solid var(--line); border-radius:11px; padding:23px; }
.section-heading { display:flex; justify-content:space-between; align-items:baseline; gap:10px; margin-bottom:13px; flex-wrap:wrap; }
.section-heading label { font-family:Georgia,serif; font-size:22px; }
.section-heading span { color:var(--muted); font-size:11px; }
textarea { display:block; width:100%; resize:vertical; min-height:310px; padding:10px 0; border:0; border-radius:0; background:transparent; color:var(--ink); font-family:Georgia,"Times New Roman",serif; font-size:19px; line-height:1.9; }
textarea[readonly] { min-height:175px; font-size:17px; }
textarea:focus { outline:2px solid #a6b8ab; outline-offset:5px; }
.draft-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:19px; }
.button { display:inline-flex; justify-content:center; align-items:center; padding:10px 14px; font-size:12px; border-radius:7px; border:1px solid var(--accent); min-height:44px; }
.primary { background:var(--accent); color:white; }
.secondary { background:white; color:var(--accent); }
.button:not(:disabled):hover { box-shadow:0 2px 6px #193b251c; }
.text-button { border:0; background:transparent; color:var(--accent); text-decoration:underline; text-underline-offset:4px; padding:9px 0; font-size:12px; min-height:44px; }
.backup-bar { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; margin:12px 0; }
.backup-bar p { font-size:11px; margin:0; color:var(--muted); }
.reading-card { background:var(--wash); border:1px solid var(--line); border-radius:11px; padding:23px; margin-top:18px; }
h2 { font-family:Georgia,serif; font-weight:normal; font-size:24px; margin:0 0 13px; line-height:1.35; }
.reading-card p { font-size:14px; }
blockquote { font-family:Georgia,"Times New Roman",serif; font-size:21px; line-height:1.8; margin:20px 0; padding-left:17px; border-left:3px solid #a3b39b; }
.reading-card .attribution { font-size:11px; color:var(--muted); }
.source-link { font-size:12px; }
.reading-question { border-top:1px solid #cbd5c5; padding-top:15px; margin-top:18px; }
.phrase-tools { margin-top:15px; border-top:1px solid var(--line); padding-top:10px; }
.phrase-tools p { font-size:11px; color:var(--muted); margin:0; }
.focus-phrase { font-size:13px; background:var(--wash); border-left:3px solid #a3b39b; padding:10px 13px; white-space:pre-wrap; overflow-wrap:anywhere; }
#revision-panel { margin-top:18px; }
.optional-label { display:block; font-size:12px; margin-top:20px; }
label span { font-size:10px; color:var(--muted); font-weight:normal; }
.small-textarea { min-height:70px; font-family:inherit; font-size:13px; line-height:1.6; border-bottom:1px solid var(--line); }
.metadata { display:grid; grid-template-columns:1.3fr 1fr; gap:15px; margin:20px 0; }
.metadata label { display:block; font-size:12px; }
input:not([type=file]) { width:100%; min-height:44px; border:1px solid var(--line); border-radius:5px; background:white; padding:8px 10px; margin-top:5px; }
.manuscript { font-family:Georgia,"Times New Roman",serif; font-size:19px; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.85; }
.comparison-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.comparison-grid .manuscript { font-size:15px; }
h3 { font-size:12px; font-weight:500; margin-top:18px; }
details { margin-top:20px; }
summary { cursor:pointer; color:var(--accent); font-size:12px; padding:10px 0; min-height:44px; }
.local-info { margin-top:30px; border-top:1px solid var(--line); padding-top:10px; color:var(--muted); font-size:12px; }
.local-info p { max-width:760px; }
.local-info label { display:block; margin-top:20px; }
input[type=file] { max-width:100%; margin:10px 0; font-size:12px; }
.warning { background:#fff1d3; color:#674a13; border:1px solid #caa55f; border-radius:6px; padding:13px 16px; font-size:13px; margin-bottom:16px; }
.message { font-size:12px; color:var(--accent); }
.message:empty { display:none; }
.message:not(:empty) { padding:0 0 14px; }
dialog { max-width:min(500px,calc(100% - 32px)); border:1px solid var(--line); border-radius:12px; color:var(--ink); padding:27px; }
dialog::backdrop { background:#17322966; }
dialog p { font-size:14px; }
.skip-link { position:absolute; left:15px; top:-100px; background:white; padding:12px; z-index:5; }
.skip-link:focus { top:10px; }
#print-sheet { display:none; }
@media (min-width:1000px) { .dossier { position:sticky; top:24px; } }
@media (max-width:760px) {
  .site-header { padding:14px 18px; gap:8px; }
  .brand { font-size:18px; gap:7px; }
  .brand img { width:30px; height:30px; }
  main { padding:22px 18px 30px; }
  .intro { margin-bottom:20px; }
  .invitation { font-size:15px; }
  .workspace { grid-template-columns:1fr; gap:20px; }
  .scene-photo img { max-height:235px; object-fit:cover; }
  .paper-note,.phone-note { padding:14px; }
  .paper-note p { font-size:16px; }
  .clue-label { margin-bottom:10px; }
  .writing-card,.reading-card { padding:18px; }
  textarea { min-height:290px; font-size:18px; }
  .draft-actions { gap:8px; }
  .button { flex:1 1 145px; }
  .metadata,.comparison-grid { grid-template-columns:1fr; }
}
@media (prefers-reduced-motion:reduce) { * { scroll-behavior:auto !important; } }
@media print {
  @page { margin:22mm; }
  body { background:white; color:black; }
  body > :not(#print-sheet) { display:none !important; }
  #print-sheet { display:block; font-family:Georgia,"Times New Roman",serif; }
  #print-sheet h1 { font-size:24pt; }
  #print-sheet p { font-size:12pt; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.6; }
}

/* Compare before choosing: immutable original beside the editable revision. */
.workspace.is-revising { grid-template-columns:minmax(0,1fr); }
.workspace.is-revising .dossier { display:none; }
#revision-panel .section-heading h2 { font-family:Georgia,serif; font-size:24px; font-weight:normal; margin:0; }
.revision-comparison { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:24px; margin:22px 0; }
.version-pane { min-width:0; border:1px solid var(--line); border-radius:8px; padding:18px; }
.version-pane h3,.version-label { display:block; font:500 13px system-ui,sans-serif; margin:0 0 15px; color:var(--muted); }
.version-pane .manuscript,.version-pane textarea { font-family:Georgia,serif; font-size:19px; line-height:1.9; margin:0; padding:0; white-space:pre-wrap; overflow-wrap:anywhere; }
.version-pane textarea { min-height:360px; }
@media (max-width:600px) { .revision-comparison { grid-template-columns:minmax(0,1fr); gap:16px; } }

.diff-legend { font-size:12px; color:var(--muted); margin:16px 0 0; }
.diff-removed { background:#f5e8e4; text-decoration:line-through; text-decoration-color:#98665b; border-radius:2px; }
.diff-added { background:#e5efe4; text-decoration:underline; text-decoration-color:#708b65; text-underline-offset:3px; border-radius:2px; }
.revision-editor { border-top:1px solid var(--line); padding-top:8px; }

.diff-legend span { text-decoration:none; padding:2px 5px; }

.reading-route { font-size:13px; color:var(--muted); max-width:760px; margin:12px 0; }
.literary-bridge { padding:14px 16px; margin:18px 0; border-left:2px solid #a6b8ab; background:#f6f8f3; font-size:14px; }
.literary-bridge h3 { margin:0 0 10px; font-size:15px; }
.literary-bridge p { margin:8px 0; }
.author-note { white-space:pre-wrap; overflow-wrap:anywhere; }
