:root { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; color: #111; background: #fff; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { display: grid; place-items: center; }
.sheet { width: min(100vw, 154.54545dvh); aspect-ratio: 17 / 11; container-type: inline-size; display: flex; flex-direction: column; padding: min(2.35vw, 3.631dvh); background: #fff; }
nav { display: flex; justify-content: flex-end; gap: 1.5cqw; flex: none; }
button, nav a { font: inherit; color: #111; background: none; border: 0; padding: 0; text-decoration: none; cursor: pointer; }
nav, footer, #archive-status { font-size: 1cqw; line-height: 1.4; }
nav { font-size: 1.23cqw; }
button:focus-visible, a:focus-visible { outline: 1px solid #111; outline-offset: 3px; }
.composition { flex: 1; min-height: 0; overflow: hidden; padding-top: 3cqw; }
textarea { display: block; width: 100%; height: 2.8cqw; min-height: 2.8cqw; padding: 0; border: 0; outline: 0; box-shadow: none; appearance: none; -webkit-appearance: none; resize: none; overflow: hidden; background: transparent; color: #111; font: 1.4cqw/2 "Helvetica Neue", Helvetica, Arial, sans-serif; }
.generate { display: block; margin: .6cqw 0 max(0px, 2.4cqw - 28px); color: #888; font: 1.1cqw/1.4 "Helvetica Neue", Helvetica, Arial, sans-serif; }
.generate[hidden] { display: none; }
.canvas[hidden] { display: none; }
.generate.completed { visibility: hidden; }
textarea::placeholder, #archive-intro { color: #888; opacity: 1; }
#archive-intro { margin: .6cqw 0; font-size: 1.35cqw; line-height: 1.4; }
.print-text { display: none; }
.archive-grid { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.archive-item { margin: 0; min-width: 0; break-inside: avoid; }
.archive-item img { display: block; width: 100%; height: auto; }
.archive-item figcaption { padding-top: .2cqw; font-size: .8cqw; line-height: 1.2; color: #888; overflow-wrap: anywhere; }
.archive-item figcaption span, .archive-item figcaption a { display: block; color: inherit; }
#archive-status { flex: none; margin: -0.3cqw 0 0; min-height: 1.5cqw; color: #888; }
footer { color: #888; display: flex; justify-content: space-between; align-items: baseline; gap: 1cqw; flex: none; white-space: nowrap; }
.canvas-nav { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: .6cqw; }
.canvas-nav button { color: inherit; }
.canvas-nav button:disabled { visibility: hidden; }
footer { position: relative; }
dialog { border: 1px solid #111; background: #fff; font: 16px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif; max-width: 90vw; }
dialog::backdrop { background: rgba(0,0,0,.2); }
dialog button { text-decoration: underline; }
dialog [hidden] { display: none; }
#save-dialog[open] { width: 260px; height: 130px; padding: 12px; display: flex; flex-direction: column; justify-content: center; text-align: center; }
#save-dialog p { margin: 0 0 8px; }
#save-dialog button, #save-dialog input { font: inherit; }
#save-confirm p { margin-bottom: 10px; }
#save-confirm button + button { margin-left: 10px; }
#save-name-form p { margin: 4px 0 8px; }
#save-error:empty { display: none; }
#save-error:not(:empty) { margin: 4px 0 0; font-size: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

nav [aria-current="page"] { color: #888; }

.generate { visibility: hidden; pointer-events: none; }

@media screen and (max-width: 767px) {
  html, body { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
  body { display: block; }
  .sheet { width: 100%; min-height: 100dvh; aspect-ratio: auto; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  nav { gap: clamp(8px, 2.7vw, 16px); font-size: clamp(13px, 3.7vw, 17px); white-space: nowrap; }
  .composition { flex: 1; overflow: visible; padding-top: 2.5em; }
  textarea { font: 16px/1.6 "Helvetica Neue", Helvetica, Arial, sans-serif; min-height: 1.6em; }
  .archive-grid { gap: 10px 14px; }
  .archive-grid:not(:empty) { margin-top: 2em; }
  .archive-item figcaption { font-size: clamp(10px, 2.8vw, 12px); padding-top: 3px; }
  footer, #archive-status { font-size: clamp(10px, 2.8vw, 12px); }
  footer { margin-top: 24px; }
}
@media screen and (max-width: 767px) {
  .about-copy { width: 100% !important; font-size: 16px !important; line-height: 1.6 !important; }
  .about-copy .attribution { font-size: calc(16px * .85 / 1.4 + 3px) !important; }
}

.composition { position: relative; }
#archive-status.searching { visibility: hidden; }
.search-indicator { position: absolute; top: 55%; left: 50%; transform: translate(-50%, calc(-50% - 66px)); font: 1.4cqw/2 "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: nowrap; pointer-events: none; }
.search-indicator[hidden] { display: none; }
.search-indicator span { animation: search-dot 1.2s infinite step-end; }
.search-indicator span:nth-child(2) { animation-delay: .2s; }
.search-indicator span:nth-child(3) { animation-delay: .4s; }
@keyframes search-dot { 0%, 60%, 100% { opacity: .2; } 20%, 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .search-indicator span { animation: none; opacity: 1; } }
@media screen and (max-width: 767px) { .search-indicator { font-size: 16px; transform: translate(-50%, -50%); } }
