:root { color-scheme: light; font: 15px/1.6 "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif; color: #22392e; background: #e9ede9; --paper: #fafbf7; --line: #d6ddd3; --muted: #58665c; --accent: #365743; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
button, select { font: inherit; color: inherit; }
button { min-height: 48px; padding: 10px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; touch-action: manipulation; }
button:hover { background: #e3eadf; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid #365743; outline-offset: 3px; }
button[aria-pressed="true"], button[aria-expanded="true"] { background: #dce6d8; border-color: #9bae98; }
.primary { background: var(--accent); color: white; border-color: var(--accent); }
.primary:hover { background: #254732; }
.text-button { background: transparent; border-color: transparent; text-decoration: underline; text-underline-offset: 4px; font-weight: 400; text-align: left; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--paper); border-bottom: 1px solid var(--line); padding: calc(8px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 8px max(20px, env(safe-area-inset-left)); }
.wordmark { font: 400 21px/1.2 Georgia, serif; letter-spacing: -.035em; }
header button { border: 0; }
.header-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 4px; }
#cloud-account-email { overflow-wrap: anywhere; }
#cloud-homes-title { margin: 24px 0 8px; font-size: 19px; }
#cloud-homes-list { max-height: min(38dvh, 320px); overflow-y: auto; overscroll-behavior: contain; }
#cloud-homes-list button { width: 100%; text-align: left; overflow-wrap: anywhere; }
#cloud-account-error { color: #614726; }
#cloud-account-retry { margin-top: 16px; }
#cloud-account-status:empty { display: none; }
main { position: relative; flex: 1; min-height: 0; }
#viewport { position: absolute; inset: 0; }
#viewport canvas { display: block; touch-action: none; width: 100%; height: 100%; outline-offset: -4px; }
body.loading #viewport { pointer-events: none; }
#welcome { position: absolute; left: max(32px, env(safe-area-inset-left)); top: 50%; transform: translateY(-50%); width: 350px; padding: 26px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
h1, h2 { font-family: Georgia, serif; font-weight: 400; line-height: 1.15; letter-spacing: -.025em; text-wrap: balance; }
#welcome h1 { font-size: 36px; margin: 0 0 20px; }
p { margin: 0 0 16px; }
#welcome p { color: var(--muted); }
#welcome > button { display: block; width: 100%; }
#welcome .small { font-size: 13px; margin: 20px 0 0; }
#scene-heading { position: absolute; top: 22px; left: max(24px, env(safe-area-inset-left)); max-width: min(500px, calc(100% - 48px)); }
#scene-heading h1 { font-size: 31px; margin: 0 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#saved-state { font-size: 13px; margin: 0 0 12px; background: var(--paper); padding: 2px 6px; width: fit-content; }
.variant-label { font-size: 13px; margin-right: 8px; }
select { max-width: min(300px, 70vw); min-height: 48px; border: 1px solid #aebfaa; border-radius: 6px; background: var(--paper); padding: 8px 28px 8px 12px; }
#example-label { position: absolute; bottom: 28px; right: 24px; font-size: 13px; background: var(--paper); padding: 4px 8px; }
#controls { position: absolute; bottom: calc(42px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; gap: 4px; padding: 5px; border: 1px solid var(--line); background: var(--paper); border-radius: 8px; box-shadow: 0 6px 20px #22392e14; white-space: nowrap; }
#controls button { border-color: transparent; }
#concept-note { position: absolute; bottom: env(safe-area-inset-bottom); left: 16px; right: 16px; text-align: center; font-size: 12px; margin: 10px 0; }
#focus-label { position: absolute; bottom: calc(112px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); padding: 5px 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; max-width: 80%; pointer-events: none; }
#details { position: absolute; top: 22px; bottom: calc(118px + env(safe-area-inset-bottom)); right: max(24px, env(safe-area-inset-right)); width: 340px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 20px; overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 12px 36px #29472e16; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.panel-heading h2 { font-size: 25px; margin: 8px 0 0; overflow-wrap: anywhere; }
.panel-heading button { border: 0; }
#details h3 { font-size: 14px; margin: 24px 0 8px; }
#details p, dialog p { color: var(--muted); overflow-wrap: anywhere; }
#details-content p { white-space: pre-wrap; }
.plain-list { padding: 0; margin: 0; list-style: none; }
.plain-list li { border-bottom: 1px solid var(--line); }
.plain-list button { border: 0; width: 100%; text-align: left; font-weight: 400; overflow-wrap: anywhere; }
.library-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.library-item p { font-size: 13px; margin: 4px 0; }
.library-item > button:first-child { display: block; width: 100%; text-align: left; overflow-wrap: anywhere; }
.library-item .remove { min-height: 48px; font-size: 13px; border: 0; background: transparent; text-decoration: underline; }
dialog { width: min(480px, calc(100% - 28px)); max-height: calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); background: var(--paper); color: #22392e; border: 1px solid #b8c3b6; border-radius: 8px; padding: 24px; }
dialog::backdrop { background: #22392e66; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; }
#details details { margin: 24px 0 16px; }
#details summary { padding: 12px 0; font-weight: 600; cursor: pointer; }
#offline-status { margin-top: 24px; font-size: 13px; }
#notice { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: min(560px, calc(100% - 24px)); padding: 14px; background: #fff8e9; color: #614726; border: 1px solid #cba67e; border-radius: 6px; z-index: 5; box-shadow: 0 8px 20px #293d2918; max-height: 60%; overflow: auto; }
#notice p { margin: 0; overflow-wrap: anywhere; }
#notice button { background: transparent; border: 0; text-decoration: underline; }
#progress { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); padding: 12px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; z-index: 4; }
@media (max-width: 760px) {
  header { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .wordmark { font-size: 19px; }
  header button { font-size: 13px; padding: 8px; }
  header .wordmark { min-width: 0; }
  .header-actions { max-width: 52%; gap: 0; }
  #welcome { left: 14px; right: 14px; width: auto; top: auto; bottom: calc(16px + env(safe-area-inset-bottom)); transform: none; padding: 20px; max-height: 75%; overflow: auto; }
  #welcome h1 { font-size: 31px; margin-bottom: 12px; }
  #welcome h1 br { display: none; }
  #welcome .small { margin-top: 12px; }
  #scene-heading { top: 16px; left: max(16px, env(safe-area-inset-left)); max-width: calc(100% - 32px); }
  #scene-heading h1 { font-size: 25px; }
  #example-label { top: 16px; bottom: auto; right: 16px; }
  body.exploring #example-label { display: none; }
  #controls { width: calc(100% - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)); max-width: 430px; gap: 0; padding: 4px; }
  #controls button { flex: 1; min-width: 0; white-space: normal; font-size: 13px; padding: 10px 6px; }
  #concept-note { font-size: 11px; }
  #details { top: auto; left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); bottom: calc(114px + env(safe-area-inset-bottom)); width: auto; max-height: 48%; padding: 16px; }
  .panel-heading { margin-bottom: 12px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  header { padding-top: env(safe-area-inset-top); padding-bottom: 0; }
  #welcome { width: 340px; left: max(14px, env(safe-area-inset-left)); top: 10px; bottom: 10px; max-height: none; }
  #welcome h1 { font-size: 25px; }
  #details { left: auto; right: max(14px, env(safe-area-inset-right)); width: 320px; top: 10px; max-height: none; bottom: 96px; }
  #scene-heading h1 { max-width: 40vw; }
  #controls { bottom: calc(32px + env(safe-area-inset-bottom)); }
}
