:root {
  color-scheme: light;
  --ink: #193e3b;
  --muted: #52665f;
  --line: #cbd4cb;
  --deep: #153f3d;
  --green: #23734d;
  --canvas: #f7f8f3;
  --serif: Georgia, "Noto Serif", "Times New Roman", serif;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid #b16a20; outline-offset: 3px; }
button:disabled { opacity: .38; cursor: default; }
[hidden], .icon-bank { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.icon { width: 1.2rem; height: 1.2rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.wrap { width: min(91%, 88rem); margin-inline: auto; }
.masthead { color: #fffaf0; background: var(--deep); }
.masthead-inner { min-height: 4.45rem; display: flex; align-items: center; gap: 1.35rem; }
.brand { display: flex; align-items: center; gap: .72rem; white-space: nowrap; }
.brand img { display: block; width: 2.45rem; height: 2.45rem; }
.brand span { font: 600 1.58rem/1.1 var(--serif); letter-spacing: -.05em; }
.masthead-context { color: #d7e3dc; padding-left: 1.35rem; border-left: 1px solid #5b7873; font-size: .94rem; }
.screen-button, .button, .close-button { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; border-radius: .55rem; font-size: .91rem; font-weight: 600; min-height: 2.65rem; padding: .55rem .95rem; line-height: 1.25; }
.screen-button { margin-left: auto; color: #fffdf6; border: 1px solid #72938b; background: transparent; }
.screen-button:hover { background: #27504d; border-color: #b1c6b7; }
.screen-button .icon { width: 1rem; height: 1rem; }
main { padding-bottom: 1.8rem; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.2rem; margin: clamp(1.35rem, 3.8vh, 2.5rem) 0 clamp(1.15rem, 3vh, 1.9rem); }
.phase { display: flex; align-items: center; gap: .55rem; margin: 0 0 .45rem; color: #5c6e60; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .13em; }
.phase span { width: 1.4rem; height: 2px; background: #ae7f34; }
.phase b { color: #97712d; font-weight: 400; }
h1 { margin: 0; font: 500 clamp(2.7rem,4.2vw,4.05rem)/1.07 var(--serif); letter-spacing: -.06em; }
h1 em { font-weight: 400; }
.question { margin: .55rem 0 0; color: #465e53; font-size: clamp(1.04rem,1.3vw,1.2rem); line-height: 1.42; }
.secondary, .close-button { background: #fff; border: 1px solid #b9c9bf; }
.secondary:hover, .close-button:hover { background: #eef4ed; border-color: #829e8c; }
.new-button { flex: none; margin-bottom: .15rem; }
.new-button .icon { width: 1rem; height: 1rem; }
.workspace { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(.95rem,1.7vw,1.6rem); align-items: stretch; }
.paper, .idea-panel, .reference { border: 1px solid var(--line); border-radius: .95rem; overflow: hidden; }
.paper { min-width: 0; display: flex; flex-direction: column; min-height: clamp(23rem,calc(100vh - 17.85rem),57rem); min-height: clamp(23rem,calc(100svh - 17.85rem),57rem); background: white; box-shadow: 0 3px 8px #173a2910; }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.paper-tools { padding: .83rem 1.25rem; min-height: 3.8rem; border-bottom: 1px solid #d5ded5; }
.panel-title, .reference-caption { display: flex; align-items: center; gap: .65rem; }
.panel-title h2, .reference-dialog h2 { margin: 0; font-size: clamp(1.05rem,1.4vw,1.3rem); font-weight: 650; letter-spacing: -.025em; }
.pencil-icon { width: 1.9rem; height: 1.9rem; display: grid; place-items: center; background: #f5ead0; color: #78551f; border-radius: .52rem; }
.pencil-icon .icon { width: 1.05rem; height: 1.05rem; }
.zoom-tools { display: flex; align-items: center; overflow: hidden; border: 1px solid #d2dbd1; border-radius: .45rem; }
.zoom-tools button { display: flex; align-items: baseline; justify-content: center; gap: .06rem; padding: .28rem .55rem; min-width: 2.4rem; height: 2rem; background: #fff; border: 0; font-size: .98rem; font-weight: 600; line-height: 1.45; }
.zoom-tools button + button { border-left: 1px solid #d2dbd1; }
.zoom-tools span { font-size: .8rem; }
.zoom-tools button:hover:not(:disabled) { background: #eaf1ea; }
.zoom-tools button:focus-visible { outline-offset: -3px; }
.sheet { position: relative; flex: 1; background-color: #fff; background-image: radial-gradient(circle, #dbe3da 1px, transparent 1.15px); background-size: 19px 19px; background-position: .6rem .65rem; }
#notes { position: absolute; inset: 0; display: block; width: 100%; height: 100%; min-width: 0; resize: none; overflow: auto; margin: 0; padding: clamp(1.2rem,2.4vw,2.4rem); border: 0; border-radius: 0; background: transparent; color: #173c36; font-family: inherit; font-size: var(--writing-size,1.75rem); line-height: 1.55; letter-spacing: -.012em; tab-size: 4; caret-color: #166840; }
#notes::placeholder { opacity: 1; color: #697b71; font-size: .85em; font-weight: 400; }
#notes:focus { outline: 0; }
#notes:focus-visible { box-shadow: inset 0 0 0 2px #8baa978a; }
.paper-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .45rem .8rem; padding: .7rem 1.2rem; border-top: 1px solid #dce3db; color: #53665b; background: #fbfcf9; font-size: .82rem; line-height: 1.4; }
.paper-footer > span { display: inline-flex; gap: .4rem; align-items: center; }
.paper-footer .icon { width: .97rem; height: .97rem; }
.sidebar { min-width: 0; display: grid; gap: 1rem; align-content: start; }
.idea-panel { padding: 1.15rem; background: #edf4ed; border-color: #c4d5c6; }
.idea-top .panel-title { gap: .45rem; }
.list-icon { color: #356e54; width: 1.35rem; height: 1.35rem; }
.count { display: inline-flex; gap: .25rem; align-items: center; padding: .28rem .62rem; background: #fff; border: 1px solid #cddacd; border-radius: 2rem; line-height: 1; color: #50665a; font-size: .84rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.count strong { color: #19553b; font-size: .98rem; font-weight: 700; }
.progress-track { display: flex; gap: .3rem; margin: .98rem 0 1.05rem; }
.progress-track i { height: .32rem; background: #cfddce; border-radius: 5px; flex: 1; }
.progress-track i.on { background: var(--green); }
.ideas-empty { min-height: 2.65rem; border: 1px dashed #b5c9b8; border-radius: .65rem; display: flex; align-items: center; padding: .55rem .8rem; }
.ideas-empty p { margin: 0; line-height: 1.5; color: #4c6757; font-size: .98rem; }
.word-list { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0; list-style: none; }
.word-list li { display: flex; align-items: center; gap: .65rem; min-height: 2.45rem; padding: .4rem .7rem; border: 1px solid #c5d8c8; border-radius: .5rem; background: #fff; color: #174e32; font-size: clamp(1.03rem,1.36vw,1.3rem); line-height: 1.25; font-weight: 600; }
.tick { display: inline-grid; flex: none; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: #daf0df; color: #17653a; }
.tick .icon { width: 1rem; height: 1rem; stroke-width: 3; }
.reference { margin: 0; background: white; }
.reference-button { width: 100%; display: block; border: 0; padding: 0; background: white; text-align: left; }
.reference-button:focus-visible { outline-offset: -4px; }
.reference-bar { display: flex; justify-content: space-between; align-items: center; gap: .7rem; padding: .72rem 1rem; border-bottom: 1px solid #e1e3d8; background: #f6f3ea; font-size: .96rem; font-weight: 600; }
.reference-caption { gap: .5rem; }
.reference-caption .icon { width: 1.08rem; height: 1.08rem; color: #77633a; }
.expand-icon { display: grid; place-items: center; height: 1.65rem; width: 1.65rem; color: #53675c; border-radius: .35rem; }
.reference-button:hover .expand-icon { background: #e6e3d6; color: var(--deep); }
.expand-icon .icon { width: 1.04rem; height: 1.04rem; }
.reference-image { display: block; padding: .5rem .75rem; }
.reference-image img { display: block; width: 100%; height: auto; }
dialog { width: min(28.5rem,calc(100% - 2rem)); max-height: 90vh; max-height: 90svh; border: 1px solid var(--line); border-radius: 1rem; padding: 1.5rem; background: #fff; color: var(--ink); box-shadow: 0 16px 70px #112c2738; }
dialog::backdrop { background: #102b29a8; }
.reset-dialog h2 { font: 600 1.55rem/1.2 var(--serif); margin: 0 0 .75rem; }
.reset-dialog p { margin: 0; line-height: 1.5; color: var(--muted); }
.dialog-actions { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; margin-top: 1.4rem; }
.primary { color: white; background: var(--deep); border: 1px solid var(--deep); }
.primary:hover { background: #285d4f; }
.reference-dialog { width: min(65rem,94vw); padding: 1rem 1.25rem; }
.reference-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: 0 0 .8rem; }
.close-button { min-height: 2.4rem; width: 2.4rem; padding: .4rem; }
.reference-dialog > img { display: block; width: 100%; height: auto; max-height: 70vh; max-height: 70svh; object-fit: contain; }

body.projection .page-heading { margin-top: 1rem; margin-bottom: 1rem; }
body.projection .wrap { width: 94%; }
body.projection .page-heading h1 { font-size: clamp(2.1rem,3.2vw,3rem); }
body.projection .phase, body.projection .new-button { display: none; }
body.projection .paper { min-height: max(23rem,calc(100svh - 14rem)); }
@media (min-width: 1540px) { :root { font-size: 18px; } }
@media (max-width: 900px) { .wrap { width: 94%; } .idea-panel { padding: 1rem; } }
@media (max-width: 700px) {
  .wrap { width: min(93%,38rem); }
  .masthead-inner { min-height: 3.7rem; gap: .85rem; }
  .masthead-context { display: none; }
  .brand img { width: 2.15rem; height: 2.15rem; }
  .brand span { font-size: 1.4rem; }
  .screen-button { min-height: 2.4rem; padding: .45rem .7rem; }
  .page-heading { flex-wrap: wrap; gap: .85rem; margin: 1.25rem 0 .9rem; }
  .phase { font-size: .75rem; }
  h1 { font-size: 2.75rem; }
  .question { font-size: 1rem; }
  .new-button { min-height: 2.45rem; }
  .workspace { grid-template-columns: minmax(0,1fr); }
  .paper { min-height: clamp(17rem,45svh,30rem); }
  .paper-tools { padding: .55rem .8rem; min-height: 3.2rem; }
  .paper-footer { padding: .52rem .7rem; font-size: .78rem; }
  .sidebar { gap: .85rem; }
  .idea-panel { padding: 1rem; }
  .ideas-empty { min-height: 3.4rem; }
  body.projection .paper { min-height: clamp(17rem,43svh,30rem); }
}
@media (max-width: 365px) { .paper-footer .entry-hint { display: none; } }
@media (max-height: 800px) and (min-width: 701px) {
  .masthead-inner { min-height: 3.6rem; }
  .page-heading { margin-top: 1rem; margin-bottom: .95rem; }
  h1 { font-size: 2.8rem; }
  .paper { min-height: max(19rem,calc(100svh - 12.6rem)); }
  .idea-panel { padding: .8rem 1rem; }
  .progress-track { margin: .6rem 0; }
  .reference-bar { padding-block: .45rem; }
}
@media (forced-colors: active) {
  .progress-track i { border: 1px solid GrayText; }
  .progress-track i.on, .tick { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  #notes:focus-visible { outline: 2px solid Highlight; outline-offset: -3px; }
}
