* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #dceaf2; color: #203e55; font: 1rem Georgia, serif; }
main { display: grid; grid-template-columns: [left] clamp(210px, 16vw, 300px) [centre] minmax(0, 1fr) [right] clamp(210px, 16vw, 300px); gap: 12px; padding: 12px; height: 100dvh; }
.panel { min-width: 0; padding: clamp(10px, 1vw, 16px); background: #edf3f7; border: 1px solid #92b4cb; border-radius: 15px; overflow: auto; }
h1, h2 { margin: 0 0 1rem; }
.eyebrow { font-size: .75rem; letter-spacing: .14em; font-weight: bold; }
nav { display: grid; gap: .7rem; margin: .8rem 0; }
a { color: #285a7e; }
textarea { display: block; width: 100%; margin-top: .5rem; }
.archive-notebook { margin-top: 1rem; }
.scene { position: relative; overflow: hidden; border-radius: 15px; isolation: isolate; background: #dceaf2 url(garden.png) center / cover no-repeat; }
.scene:not(.active) { background-image: url(arrival.png); }
.scene { container-type: size; }
.easel-layer {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100cqw, calc(100cqh * 1536 / 1024));
  aspect-ratio: 1536 / 1024;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
body[data-pattern-place] .easel {
  position: absolute;
  left: 73%;
  top: 43%;
  width: 21%;
  height: 32%;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  pointer-events: auto;
}
body[data-pattern-place] .easel:is(:hover, :focus-visible) {
  outline: 2px solid #f8fdff;
  outline-offset: -3px;
}
#drawing { position: absolute; inset: clamp(10px, 2vw, 30px); border: 7px solid #6993b0; border-radius: 5px; background: #f9fcff; box-shadow: 0 5px 25px #203e5566; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
button { cursor: pointer; color: #f8fdff; background: #285a7e; border: 1px solid #203e55; border-radius: 6px; font: inherit; padding: .55em .75em; }
.scene.active { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: .6rem; padding: clamp(10px, 2vw, 24px); }
#drawing { position: relative; inset: auto; min-height: 0; }
.actions { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .4rem .55rem; background: #edf3f7; border: 1px solid #92b4cb; border-radius: 8px; }
.doodle-actions { display: flex; justify-content: flex-end; gap: .4rem; flex-wrap: wrap; margin-inline-start: auto; }
body[data-pattern-place] .actions button { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .55rem .15rem .25rem; color: #203e55; background: #f8fdff; border-color: #92b4cb; }
body[data-pattern-place] .actions button:not(:disabled):hover { background: #d9eaf6; }
.tool-art { flex: 0 0 2.6rem; height: 2.6rem; background: url(doodle-tools.png) 0 0 / 200% 200% no-repeat; }
#new .tool-art { background-position: 100% 0; }
#clear .tool-art { background-position: 0 100%; }
#clear-all .tool-art { background-position: 100% 100%; }
button:disabled { cursor: default; opacity: .55; }
#marker[aria-pressed="true"] { color: #173a69; background: #d9e8ff; outline: 2px solid #255ba2; outline-offset: 1px; }
canvas.annotating { cursor: cell; }
td button[aria-current="true"] { outline: 2px solid #254f70; outline-offset: 2px; }
table, #counting-hint { margin-top: 1rem; }
table { width: 100%; border-collapse: collapse; text-align: center; font-size: .85rem; table-layout: fixed; overflow-wrap: anywhere; }
caption { text-align: left; font-weight: bold; margin-bottom: .5rem; }
th, td { padding: .35rem .15rem; border-bottom: 1px solid #92b4cb; }
td button { padding: .2rem .45rem; }
@media (max-width: 850px), (max-height: 480px) {
  main { height: auto; min-height: 100dvh; grid-template-columns: minmax(0, 1fr); }
  .scene { min-height: max(340px, 62dvh); }
}

th .count-symbol { display: block; font-weight: normal; margin-top: .18em; }
th { vertical-align: middle; line-height: 1.15; }

.garden-nav { gap: .35rem; }
.garden-nav a, .garden-nav span {
  display: block;
  padding: .45rem .65rem;
  border: 1px solid #6394b4;
  border-radius: 6px;
  text-decoration: none;
}
.garden-nav a:hover { background: #d9eaf6; }
.garden-nav a[aria-current="page"] { background: #285a7e; color: #f8fdff; }
.garden-nav span { border-style: dashed; }

.garden-right { display: grid; grid-template-rows: minmax(0, 1fr); overflow: hidden; }
#welcome, #activity { min-height: 0; }
#welcome { display: flex; flex-direction: column; gap: 1rem; overflow: auto; }
.artist-vignette { flex: 1; min-height: 10rem; position: relative; }
.artist-vignette img { display: block; width: 100%; height: 100%; position: absolute; object-fit: contain; }
#activity { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: .65rem; }
.garden-results { overflow: auto; min-height: 0; display: flex; flex-direction: column; }
.garden-results > * { flex-shrink: 0; }
.palette-vignette { display: block; width: min(66%, 10rem); height: auto; margin: auto auto 0; padding-top: 1.5rem; }
#back { margin-bottom: 3px; }
#euler-parchment { width: min(46rem, 96vw); max-height: 90dvh; padding: clamp(1.6rem, 5vw, 3.75rem); border: 0; background: transparent url(euler-parchment.png?v=painted) center / 100% 100% no-repeat; color: #30251c; filter: drop-shadow(0 12px 20px #203e5580); }
#euler-parchment::backdrop { background: #203e5599; }
#euler-parchment form { display: flex; justify-content: flex-end; margin-bottom: .8rem; }
#euler-parchment table { table-layout: auto; }
#euler-parchment td:last-child { min-width: 5rem; }
#euler-expression { display: block; min-height: 2.6em; margin: 1rem 0 .5rem; padding: .4rem .65rem; background: #fff9e8; border: 1px solid #997547; font-weight: bold; }
#euler-keys { display: flex; flex-wrap: wrap; gap: .45rem; }
#euler-almanac, #discovery { margin-top: 1rem; }
.canvas-badge { position: absolute; padding: .2rem .55rem; background: #edf3f7; color: #203e55; border: 1px solid #92b4cb; border-radius: 5px; pointer-events: none; }
#canvas-mode { inset: .45rem auto auto .45rem; }
#canvas-number { inset: auto .45rem .45rem auto; }
.pen-guidance { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.pen-guidance:has(#status:not(:empty)) { flex: 1 1 18rem; }
#marker { flex: none; }
#status { min-width: 0; margin: 0; padding: .25rem .2rem; font-size: .85rem; color: #203e55; }
#status:empty { display: none; }
#marker[aria-pressed="true"] + #status:not(:empty)::before { content: "←" / ""; color: #255ba2; font-size: 1.45em; font-weight: bold; margin-inline-end: .35em; }
.garden-footer { display: grid; gap: .65rem; }
#doodle-guide { width: min(30rem, 90vw); padding: 1.5rem; color: #203e55; background: #edf3f7; border: 1px solid #92b4cb; border-radius: 12px; }
#doodle-guide::backdrop { background: #203e5577; }
#doodle-guide button { display: block; margin: 1rem 0 .25rem; }
.style-choices { display: grid; gap: .45rem; }
body[data-pattern-place] .style-choices [aria-pressed="true"] { background: #285a7e; color: #fff; }
#prepared-guide select { display: block; width: 100%; margin-top: .25rem; font: inherit; }
@media (max-width: 850px), (max-height: 480px) {
  .artist-vignette { min-height: 17rem; }
  .garden-results { max-height: 65dvh; }
}
