:root {
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  color: #293f3b;
  background: #f6f3e8;
  font-synthesis: none;
  --ink: #293f3b;
  --muted: #65746c;
  --line: #c8cec0;
  --accent: #345f51;
  --soft: #e4edd9;
  --paper: #fffdf5;
  --water: #e0f0ec;
  --sand: #f4d37d;
  --coral: #bd6044;
  --shadow: #d8ddcb;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background-image: radial-gradient(#8d9c7923 .8px, transparent .8px); background-size: 20px 20px; }
button, input, select, summary { font: inherit; }
button, summary { cursor: pointer; }
button { color: inherit; touch-action: manipulation; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 11px; }
button:disabled { opacity: .38; cursor: default; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #248493; outline-offset: 4px; }
button:not(:disabled), summary { transition: background-color .14s, box-shadow .14s, transform .14s; }
button:not(:disabled):active { transform: translateY(1px); }
input:disabled { cursor: default; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* An illustrated workbench: paper, water, sand, and ink. */
.app-header { min-height: 88px; display: flex; align-items: center; gap: 24px; padding: 16px 32px; background: var(--paper); border-bottom: 2px solid var(--ink); }
.brand { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-fish { display: block; width: 49px; height: 29px; transform: rotate(-7deg); }
.brand-word { font-family: "Arial Rounded MT Bold", "Hiragino Maru Gothic ProN", sans-serif; font-size: 25px; font-weight: 800; letter-spacing: -.9px; }
.brand-dot { color: var(--coral); }
.header-divider { height: 27px; border-left: 1px dashed #aeb8a6; }
.header-title { color: #536e60; font-size: 12px; letter-spacing: .05em; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.reset-scene-button { flex-shrink: 0; min-height: 44px; padding: 10px 13px; border-color: #a4b396; font-size: 12px; white-space: nowrap; }
.reset-scene-button:hover { background: var(--water); }
.history-actions { display: flex; grid-column: 1 / -1; gap: 9px; padding: 12px 14px 8px; }
.history-hint { grid-column: 1 / -1; padding: 0 14px 12px; border-bottom: 1px dashed #c0cdb5; color: #6b7b61; font-size: 10px; line-height: 1.8; }
.history-actions button { flex: 1; min-width: 0; min-height: 44px; padding: 8px 5px; font-size: 12px; border-color: #a4b396; background: #edf4e7; white-space: nowrap; }
.history-actions button span { margin-right: 3px; font-size: 18px; vertical-align: -1px; }
.history-actions button:not(:disabled):hover { background: var(--water); border-color: var(--ink); }
.primary-button { display: flex; align-items: center; justify-content: space-between; gap: 27px; padding: 12px 21px; min-height: 46px; background: var(--sand); border: 2px solid var(--ink); border-radius: 24px 21px 23px 19px; font-size: 13px; font-weight: 700; box-shadow: 2px 3px 0 var(--ink); }
.primary-button span { font-size: 18px; }
.primary-button:not(:disabled):hover { background: #f9df96; box-shadow: 3px 4px 0 var(--ink); transform: translateY(-1px); }
.primary-button:not(:disabled):active { box-shadow: 0 1px 0 var(--ink); transform: translate(1px,2px); }
.save-menu { position: relative; }
.save-menu summary { list-style: none; display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 12px; border: 1.5px solid var(--ink); border-radius: 13px; font-size: 12px; white-space: nowrap; background: var(--paper); }
.save-menu summary::-webkit-details-marker { display: none; }
.save-menu summary:hover { background: var(--water); }
.menu-content { position: absolute; top: 51px; right: 0; width: 235px; padding: 7px; z-index: 20; border: 1.5px solid var(--ink); border-radius: 15px; background: var(--paper); box-shadow: 4px 5px 0 #bcc8b780; }
.menu-content button { display: block; width: 100%; padding: 13px 10px; border: 0; text-align: left; font-size: 12px; border-radius: 9px; }
.menu-content button:hover { background: var(--water); }

.workspace { display: grid; grid-template-columns: 252px minmax(0,1fr) 240px; align-items: start; gap: 26px; max-width: 1660px; margin: auto; padding: 31px 28px 40px; }
.site-intro { grid-column: 1 / -1; min-width: 0; padding: 0 3px 4px; }
.site-intro h1 { font-size: clamp(20px, 2.1vw, 27px); line-height: 1.6; letter-spacing: .02em; }
.site-intro p { margin-top: 7px; max-width: 780px; color: var(--muted); font-size: 13px; line-height: 1.9; }
.site-guide { grid-column: 1 / -1; min-width: 0; margin-top: 8px; padding: 24px 3px 0; border-top: 1px dashed #bac6ad; }
.site-guide h2 { font-size: 17px; line-height: 1.7; }
.site-guide ol { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 26px; margin: 16px 0; padding-left: 22px; }
.site-guide li { padding-left: 3px; font-size: 13px; line-height: 1.9; }
.site-guide strong { display: block; margin-bottom: 3px; }
.site-guide p { font-size: 12px; color: var(--muted); line-height: 1.9; }
.no-script { margin: 20px; padding: 16px; background: var(--paper); border: 1px solid var(--line); line-height: 1.8; }
.panel { background: var(--paper); border: 1.5px solid var(--ink); border-radius: 19px 22px 20px 17px; box-shadow: 3px 4px 0 var(--shadow); overflow: hidden; }
.panel-heading { display: flex; align-items: center; gap: 10px; padding: 19px 16px 17px; }
.panel-heading>div { min-width: 0; }
.panel-step { display: flex; flex-shrink: 0; align-items: center; justify-content: center; width: 29px; height: 31px; border: 1.5px solid var(--ink); border-radius: 50% 46% 48% 45%; background: var(--sand); font-size: 14px; font-weight: 700; transform: rotate(-6deg); }
.eyebrow { display: block; font-size: 11px; line-height: 1.7; letter-spacing: .05em; color: var(--muted); margin-bottom: 5px; }
h1, .panel h2 { font-size: 17px; font-weight: 700; line-height: 1.6; letter-spacing: .03em; }
.panel-heading .eyebrow { font-size: 10px; white-space: nowrap; }
.library .panel-heading { background: var(--water); border-bottom: 1px dashed #9eb9aa; margin-bottom: 16px; }
.library-total { margin-left: auto; font-size: 11px; padding: 3px 6px; color: #527062; border: 1px solid #9eb9aa; border-radius: 50%; background: #f5fbf4; }
.library-search { padding: 0 13px 11px; }
.library-search input { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid #aab7a4; border-radius: 11px; background: #fff; font-size: 12px; color: var(--ink); }
.library-search input::placeholder { color: #718173; }
.categories { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 12px; }
.categories button { border: 1px solid transparent; border-radius: 18px; background: transparent; color: #55665c; padding: 7px 10px; font-size: 11px; white-space: nowrap; }
.categories button:hover { background: #edf2e5; }
.categories button[aria-pressed=true] { border-color: var(--ink); background: var(--accent); color: #fffdf5; }
.library-note { font-size: 11px; color: var(--muted); padding: 14px 16px; line-height: 1.7; }
.asset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 1px 13px 18px; max-height: calc(100vh - 500px); min-height: 190px; overflow: auto; align-content: start; scrollbar-color: #a9b99b transparent; scrollbar-width: thin; }
.asset-card { position: relative; min-width: 0; padding: 12px 6px 9px; text-align: center; background: #fff; border: 1px solid #b8c5b3; border-radius: 12px 10px 13px 9px; box-shadow: 1px 2px 0 #dce4d5; }
.asset-card:not(:disabled):hover { border-color: var(--ink); background: #f3f8ee; box-shadow: 2px 3px 0 #cbd8c1; transform: translateY(-2px); }
.asset-art { display: flex; align-items: center; justify-content: center; height: 73px; margin: 0 4px 10px; pointer-events: none; }
.asset-art img, .asset-art svg, .layer-thumb img, .layer-thumb svg, #selected-thumb img, #selected-thumb svg { display: block; width: 100%; height: 100%; object-fit: contain; }
.asset-label { display: flex; align-items: center; justify-content: center; min-height: 33px; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; color: #455b4c; }
.asset-plus { position: absolute; top: 5px; right: 5px; display: flex; align-items: center; justify-content: center; width: 19px; height: 19px; border: 1px solid #cba889; border-radius: 50%; background: #fff0d8; color: #99522f; font-size: 14px; }
.asset-card[aria-pressed=true] { background: #edf3df; border-color: var(--accent); }
.tank-action { width: auto; padding: 3px 5px; border-radius: 6px; font-size: 9px; height: auto; }
.library-empty { padding: 12px 17px 26px; font-size: 12px; line-height: 1.8; color: var(--muted); }
.library-bottom { display: flex; flex-direction: column; gap: 5px; padding: 15px 17px; border-top: 1px dashed #c0cdb5; color: #6c7a62; font-size: 10px; }
.library-bottom span:last-child { font-family: "Arial Rounded MT Bold", sans-serif; font-size: 12px; }

.canvas-column { min-width: 0; padding-top: 3px; }
.canvas-heading { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding: 0 3px 24px; }
.canvas-heading>div { min-width: 0; flex: 1 1 180px; }
.canvas-heading .eyebrow, .finish-heading .eyebrow { color: #527360; font-weight: 700; letter-spacing: .12em; }
.canvas-heading input { width: 100%; max-width: 380px; min-width: 0; padding: 4px 0 8px; border: 0; border-bottom: 1px dashed #a1b190; background: transparent; color: var(--ink); font-size: 24px; font-weight: 700; letter-spacing: .02em; }
.reference-button { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 14px; min-height: 46px; padding: 12px 17px; border: 1.5px solid var(--accent); background: var(--water); color: var(--accent); font-size: 13px; font-weight: 700; white-space: nowrap; }
.reference-button:hover { background: #cfe6df; }
.reference-button span { font-size: 17px; }
.artboard-wrap { position: relative; overflow: hidden; background: #fff; border: 2px solid var(--ink); border-radius: 22px 18px 20px 17px; box-shadow: 5px 6px 0 #cdd7c0; }
#artboard { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
#artboard:focus-visible { outline: 3px solid #248493; outline-offset: -5px; }
#artboard.zoomed, #artboard.zoomed .scene-item.locked { cursor: grab; }
#artboard.panning, #artboard.panning .scene-item { cursor: grabbing; }
#artboard .scene-item { cursor: grab; }
#artboard .scene-item.locked { cursor: default; }
#artboard.gesturing .scene-item, .gesturing .rotation-handle { cursor: grabbing; }
.scene-item .asset-artwork { pointer-events: auto; }
.scene-item .asset-artwork path { pointer-events: visiblePainted; }
.rotation-handle { cursor: grab; }
.empty-hint { position: absolute; bottom: 7%; inset-inline: 5%; text-align: center; color: #687b61; font-size: 12px; line-height: 1.7; pointer-events: none; }
.canvas-actions { display: flex; justify-content: flex-end; margin: 18px 4px 0; }
.canvas-actions .primary-button { min-width: 164px; min-height: 48px; }
.view-tools { margin: 12px 3px 0; }
.view-zoom-heading { display: flex; align-items: center; gap: 10px; color: #536e53; font-size: 12px; }
.view-zoom-heading label { font-weight: 700; }
.view-zoom-heading output { font-variant-numeric: tabular-nums; }
.view-zoom-heading button { margin-left: auto; min-height: 38px; padding: 7px 12px; font-size: 11px; background: var(--paper); border-color: #a8b99a; }
#view-zoom { display: block; width: 100%; height: 30px; margin: 4px 0; }
.view-tools p { color: #718066; font-size: 10px; line-height: 1.7; }
.canvas-footer { display: flex; justify-content: space-between; align-items: start; gap: 14px; padding: 21px 4px 12px; color: #5f715d; font-size: 11px; line-height: 1.8; }
#object-count { flex-shrink: 0; padding: 0 7px; border-radius: 8px; background: #e4ecd8; white-space: nowrap; }
.status-bar { display: flex; align-items: flex-start; gap: 8px; min-height: 30px; padding: 0 4px; color: #697961; font-size: 11px; line-height: 1.8; }
.save-dot { width: 6px; height: 6px; flex-shrink: 0; margin-top: 6px; background: #6a8d5e; border-radius: 50%; }
.workspace-note { display: flex; justify-content: space-between; gap: 15px; margin: 25px 4px 0; padding-top: 17px; border-top: 1px dashed #bac6ad; color: #6c7d65; font-size: 11px; line-height: 1.7; }
.workspace-note span:last-child { white-space: nowrap; }

.inspector .panel-heading { background: #eaf0db; border-bottom: 1px dashed #b2bda0; }
.inspector .panel-step { background: #fffaf0; transform: rotate(6deg); }
.nothing-selected { text-align: center; padding: 25px 14px 29px; }
.selection-symbol { display: flex; align-items: center; justify-content: center; width: 78px; height: 87px; margin: 0 auto 16px; background: #e9f2e8; border-radius: 46% 51% 47% 43%; }
.selection-symbol img { display: block; width: 46px; height: 70px; object-fit: contain; transform: rotate(-8deg); }
.nothing-selected p { font-size: 14px; font-weight: 700; line-height: 1.8; color: #4f6c53; }
.nothing-selected>span:last-child { display: block; margin-top: 13px; font-size: 11px; line-height: 1.8; color: var(--muted); }
.selected-preview { display: flex; align-items: center; gap: 12px; padding: 19px 15px; }
#selected-thumb { display: block; width: 59px; height: 58px; flex-shrink: 0; border: 1px solid #c1ceb6; border-radius: 13px; background: #fff; padding: 7px; }
.selected-preview h3 { font-size: 13px; font-weight: 700; line-height: 1.6; }
.selected-preview span { display: block; margin-bottom: 5px; color: #6f8266; font-size: 11px; }
fieldset { min-width: 0; padding: 0 16px 18px; margin: 0; border: 0; }
.field-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: #53664f; }
.field-heading output { min-width: 43px; padding: 2px 6px; border-radius: 6px; background: #edf1e4; text-align: center; font-size: 11px; font-variant-numeric: tabular-nums; }
input[type=range] { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 23px; margin: 10px 0 20px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border: 1px solid #a7b69c; border-radius: 5px; background: #dfe9d4; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 19px; height: 19px; margin-top: -7px; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--sand); box-shadow: 1px 2px 0 #bfccb1; }
input[type=range]::-moz-range-track { height: 5px; border: 1px solid #a7b69c; border-radius: 5px; background: #dfe9d4; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--sand); }
.action-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.action-pair button { min-height: 36px; padding: 8px 2px; border: 1px solid #a8b89b; border-radius: 10px; background: #fffdf8; color: #4a644c; font-size: 11px; }
.action-pair button:not(:disabled):hover { border-color: var(--ink); background: #e7efdb; }
.action-pair button[aria-pressed=true] { border-color: var(--accent); background: var(--water); }
.depth-heading { margin: 22px 0 10px; }
.position-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 19px; }
.position-fields label { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #5f7559; }
input[type=number] { width: 100%; min-width: 0; padding: 8px 6px; border: 1px solid #b8c5ac; border-radius: 8px; background: #fff; font-size: 12px; color: var(--ink); }
.reset-button { width: 100%; margin-top: 17px; padding: 10px 7px; border: 1px dashed #8fa57d; border-radius: 11px; background: #edf2e2; font-size: 11px; color: #4e6948; }
.reset-button:not(:disabled):hover { background: #e0e9cf; }
.reset-note { margin-top: 8px; color: #6d7d63; font-size: 10px; line-height: 1.7; }
.delete-button { width: 100%; margin-top: 16px; padding: 10px; border: 1px solid #dfc7af; border-radius: 10px; background: #fff8ee; color: #9d533f; font-size: 11px; }
.delete-button:hover { background: #fae8d9; }
.base-note { padding: 0 16px 20px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.layers-heading { display: flex; align-items: center; justify-content: space-between; border-top: 1px dashed #b9c6aa; border-bottom: 1px solid #dce4d1; padding: 16px 16px 11px; background: #f5f6eb; }
.layers-heading h2 { font-size: 14px; }
.layers-heading>span { font-size: 10px; color: #65785b; }
.layers { max-height: 290px; overflow: auto; padding: 8px; scrollbar-color: #a9b99b transparent; scrollbar-width: thin; }
.layer-button { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 43px; padding: 7px; border: 1px solid transparent; border-radius: 9px; background: transparent; text-align: left; }
.layer-button:hover { background: #edf2e3; }
.layer-button[aria-pressed=true] { border-color: #7a976b; background: #e4edd8; }
.layer-thumb { display: block; width: 30px; height: 27px; flex-shrink: 0; pointer-events: none; }
.layer-name { flex: 1; font-size: 11px; color: #4e6549; line-height: 1.6; }
.layer-lock { border: 1px solid #c6d2b8; border-radius: 4px; padding: 2px 4px; font-size: 9px; color: #667c5b; }
.layer-button:last-child { margin-top: 5px; border-top: 1px dashed #c5d0ba; }

/* A finished aquarium becomes a print on the same workbench. */
.back-button { display: flex; align-items: center; gap: 12px; min-height: 41px; padding: 9px 16px; border: 1.5px solid var(--ink); border-radius: 18px; background: var(--paper); color: #49634c; font-size: 12px; }
.back-button:hover { background: var(--water); }
.back-button span { font-size: 17px; }
.finish-view { max-width: 1120px; margin: auto; padding: 32px 36px 50px; }
.finish-heading { margin: 0 0 28px; }
.finish-heading h1 { font-size: 29px; font-weight: 700; letter-spacing: .04em; line-height: 1.6; outline: none; }
.finish-heading>p:last-child { margin-top: 8px; font-size: 13px; line-height: 1.8; color: #687b61; }
.finish-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; align-items: start; gap: 35px; }
.card-stage { min-width: 0; margin: 0; }
.aquarium-expand { display: flex; align-items: center; justify-content: center; gap: 12px; width: min(100%,420px); min-height: 44px; margin: 0 auto 15px; padding: 10px 16px; border: 1px solid #95aa88; border-radius: 12px; color: #345f51; background: #f1f5e9; font-size: 13px; }
.aquarium-expand:hover { background: #e1eee5; }
.aquarium-viewer { width: calc(100vw - 32px); max-width: 1440px; height: calc(100dvh - 32px); max-height: none; margin: auto; padding: 20px 24px; border: 2px solid #345f51; border-radius: 20px; background: #f6f3e8; color: #294e43; overflow: hidden; }
.aquarium-viewer[open] { display: flex; flex-direction: column; gap: 12px; }
.aquarium-viewer::backdrop { background: #203c32c7; }
.aquarium-viewer-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: none; }
.aquarium-viewer-heading>div { min-width: 0; }
.aquarium-viewer-heading p { font-size: 11px; letter-spacing: .08em; color: #62785c; margin-bottom: 5px; }
.aquarium-viewer-heading h2 { font-size: 20px; line-height: 1.4; overflow-wrap: anywhere; }
.aquarium-viewer-close,.aquarium-viewer-motion { flex-shrink: 0; min-height: 44px; padding: 9px 16px; border: 1px solid #95aa88; border-radius: 12px; background: #fffbed; color: #345f51; font-size: 12px; }
.aquarium-viewer-stage { flex: 1; min-height: 0; overflow: hidden; }
.aquarium-viewer-stage>svg { display: block; width: 100%; height: 100%; }
.aquarium-viewer footer { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; font-size: 11px; color: #62785c; }
@media(max-width:600px) { .aquarium-viewer { width: calc(100vw - 16px); height: calc(100dvh - 16px); padding: 14px 12px; border-radius: 14px; }.aquarium-viewer-heading { gap: 10px; }.aquarium-viewer-heading h2 { font-size: 17px; }.aquarium-viewer-close { padding-inline: 11px; } }
.card-paper { position: relative; width: min(100%,420px); margin-inline: auto; overflow: hidden; background: transparent; border-radius: 19px; box-shadow: 5px 7px 0 #bac8ad, 12px 16px 28px #324d3920; transform-origin: 50% 58%; }
#card-preview { aspect-ratio: 5/7; }
#card-preview>svg { display: block; width: 100%; height: auto; }
.completion-sparkles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.completion-sparkle { opacity: 0; transform-origin: 0 0; }
.viewing-controls { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 22px; }
.viewing-controls button { min-height: 39px; padding: 8px 15px; border: 1px solid #8d9e80; border-radius: 20px 16px 18px 16px; background: var(--paper); color: #49634b; font-size: 12px; }
.viewing-controls button:hover { background: #e8f0dd; border-color: var(--ink); }
.viewing-controls button[aria-pressed=false] { background: var(--water); border-color: #638e7b; }
.viewing-controls span { margin-left: 5px; font-size: 16px; }
.card-stage figcaption { margin-top: 12px; color: #62785c; font-size: 11px; line-height: 1.8; text-align: center; }
.finish-form { position: sticky; top: 24px; padding: 29px 23px 24px; background: #fff8df; border-radius: 18px 20px 16px 21px; box-shadow: 4px 5px 0 #d9d3b6; }
.finish-form .eyebrow { color: #7a704c; }
.finish-form h2 { font-size: 18px; line-height: 1.6; }
.finish-description { margin: 16px 0 23px; color: #6c7358; font-size: 12px; line-height: 1.9; }
.finish-form label { display: block; color: #506649; font-size: 12px; margin-bottom: 9px; }
.finish-form input { width: 100%; min-width: 0; display: block; padding: 13px 12px; border: 1.5px solid #8a9a7b; border-radius: 11px 9px 12px 10px; color: var(--ink); background: #fffef8; font-size: 16px; line-height: 1.5; }
.finish-form input::placeholder { color: #77816a; font-size: 13px; }
.name-count { margin-top: 8px; text-align: right; font-size: 11px; color: #6d795e; }
.finish-form .primary-button { width: 100%; margin-top: 24px; padding: 13px 16px; min-height: 49px; gap: 8px; font-size: 13px; }
.card-save-note { text-align: center; color: #70795e; font-size: 10px; margin-top: 13px; }
.finish-form .animation-format-label { margin-top: 22px; }
.animation-format { display: block; width: 100%; min-width: 0; min-height: 43px; padding: 10px 9px; border: 1px solid #8f9f7d; border-radius: 10px; color: var(--ink); background: #fffdf1; font-size: 12px; }
.save-card-still { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; margin-top: 20px; padding: 11px 14px; border: 1px solid #8f9f7d; background: #fffdf1; color: #4a664b; font-size: 12px; }
.save-card-still:not(:disabled):hover { background: #e7efda; }
.gif-progress { margin-top: 20px; padding: 14px; border: 1px dashed #a8b587; border-radius: 12px; background: #f8faec; }
.gif-progress>div { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: #55704d; }
.gif-progress output { font-variant-numeric: tabular-nums; }
.gif-progress progress { display: block; width: 100%; height: 8px; margin: 12px 0; accent-color: var(--accent); border: 0; border-radius: 5px; overflow: hidden; }
.gif-progress progress::-webkit-progress-bar { background: #dae4cc; }
.gif-progress progress::-webkit-progress-value { background: #5c8869; }
.gif-progress button { display: block; margin-left: auto; padding: 7px 10px; border-color: #b1bd9c; font-size: 11px; }
.card-status { min-height: 38px; margin-top: 20px; font-size: 11px; color: #5e7657; line-height: 1.8; }
.share-card { width: min(100%,420px); margin: 23px auto 0; }
.share-x-button, .open-x { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 50px; padding: 13px 17px; border: 1.5px solid var(--accent); border-radius: 11px; background: var(--accent); color: #fffdf5; font-size: 13px; font-weight: 700; line-height: 1.6; }
.share-x-button:not(:disabled):hover, .open-x:hover { background: #254c3e; }
.share-card p { margin-top: 10px; font-size: 11px; line-height: 1.8; color: #5e7657; }
.share-status:empty { display: none; }
.share-help { display: block; width: 100%; min-height: 44px; margin-top: 8px; padding: 8px 4px; border: 0; border-radius: 8px; background: transparent; color: #4d694e; font-size: 11px; line-height: 1.7; text-decoration: underline; text-underline-offset: 3px; }
.share-help:not(:disabled):hover { background: #e8f0dd; }
.share-ready { margin-top: 14px; padding: 12px; border: 1px solid #b3c3a8; border-radius: 12px; background: #eef3e4; }
.share-ready p { margin: 0 0 12px; }
.share-ready .share-save-note { margin: 12px 0 0; }
.publication-url { width: 100%; min-width: 0; padding: 10px; border: 1px solid #b3c3a8; border-radius: 7px; background: #fffdf5; color: var(--ink); font-size: 12px; }
.publication-actions { display: flex; gap: 8px; margin: 10px 0 12px; }
.publication-actions>* { display: flex; justify-content: center; align-items: center; flex: 1; min-height: 44px; padding: 8px 4px; border: 1px solid #95aa88; border-radius: 8px; background: #fffdf5; font-size: 11px; }
.share-ready .publication-note { margin: 12px 0 0; }
.open-x { font-size: 12px; }
.reference-actions { display: grid; gap: 16px; margin-top: 16px; }
.reference-actions .primary-button { justify-self: end; }
.finish-note { display: flex; gap: 12px; align-items: flex-start; margin-top: 19px; padding-top: 18px; border-top: 1px dashed #b9bd91; color: #6b7757; }
.finish-note>span { font-size: 20px; }
.finish-note p { font-size: 11px; line-height: 1.9; }

dialog { width: min(580px,calc(100% - 30px)); padding: 25px; border: 2px solid var(--ink); border-radius: 22px 18px 20px 17px; background: var(--paper); color: var(--ink); box-shadow: 8px 10px 0 #2d493338; }
dialog::backdrop { background: #314d405c; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { font-size: 25px; font-weight: 700; }
.dialog-heading select { margin-left: auto; min-width: 0; padding: 8px; border: 1px solid #9eaf90; border-radius: 9px; color: var(--ink); background: #fff; font-size: 13px; }
.dialog-heading button { width: 34px; height: 34px; border: 0; flex-shrink: 0; border-radius: 50%; background: #e8efde; font-size: 24px; }
dialog img { width: 100%; display: block; border-radius: 14px; margin: 18px 0; }
dialog>p { color: var(--muted); font-size: 12px; line-height: 1.8; }

.card-paper.is-revealing { animation: card-arrive 1.9s steps(1,end) both; }
.is-revealing .completion-sparkle { animation: card-sparkle .6s steps(1,end) var(--sparkle-delay) both; }
@keyframes card-arrive { 0% { transform: translateY(12px) rotate(-.35deg) scale(.90); } 18% { transform: translateY(9px) rotate(.35deg) scale(.92); } 36% { transform: translateY(6px) rotate(-.35deg) scale(.94); } 54% { transform: translateY(3px) rotate(.35deg) scale(.96); } 66% { transform: rotate(-.15deg) scale(.985); } 74% { transform: translateY(-2px) scale(1.02); } 84%,100% { transform: none; } }
@keyframes card-sparkle { 0% { opacity: 0; transform: scale(.25) rotate(-12deg); } 15% { opacity: 1; transform: scale(.65) rotate(-6deg); } 30% { opacity: 1; transform: scale(1.2); } 55% { opacity: 1; transform: scale(1); } 75% { opacity: .55; transform: scale(.55) rotate(8deg); } 100% { opacity: 0; transform: scale(.15) rotate(12deg); } }

@media (max-width: 1280px) {
  .workspace { grid-template-columns: 232px minmax(0,1fr) 222px; gap: 20px; padding: 27px 22px 38px; }
  .app-header { padding-inline: 25px; gap: 19px; }
  .panel-heading { padding-inline: 13px; gap: 8px; }
  .panel-heading .eyebrow { font-size: 10px; }
  .panel-step { width: 26px; height: 28px; }
  .library-total { font-size: 10px; padding-inline: 4px; }
  .canvas-heading input { font-size: 21px; }
  .canvas-heading { gap: 10px; }
  .categories { gap: 3px; padding-inline: 10px; }
  .categories button { padding-inline: 8px; }
  .asset-art { height: 65px; }
  .asset-grid { gap: 8px; padding-inline: 11px; }
}
@media (max-width: 1080px) {
  .workspace { grid-template-columns: 225px minmax(0,1fr); gap: 23px; padding-inline: 22px; }
  .library { grid-row: 2 / 4; }
  .inspector { grid-column: 2; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .inspector>.panel-heading { grid-column: 1 / -1; }
  .inspector>.nothing-selected, .inspector>#selected-panel { grid-column: 1; grid-row: 4 / 6; }
  .layers-heading { grid-column: 2; border-top: 0; border-left: 1px dashed #c2ceb4; }
  .layers { grid-column: 2; border-left: 1px dashed #c2ceb4; max-height: 340px; }
  .header-divider, .header-title { display: none; }
  .workspace-note { margin-top: 18px; }
  .finish-view { padding-inline: 25px; }
  .finish-layout { grid-template-columns: minmax(0,1fr) 275px; gap: 26px; }
  .finish-form { padding-inline: 19px; }
}
@media (max-width: 760px) {
  .app-header { min-height: 79px; padding: 15px 18px; gap: 12px; }
  .brand { gap: 7px; }
  .brand-word { font-size: 22px; }
  .brand-fish { width: 33px; height: 24px; }
  .header-actions { gap: 8px; }
  .primary-button { gap: 14px; padding: 10px 16px; font-size: 12px; min-height: 42px; }
  .workspace { display: flex; flex-direction: column; gap: 25px; padding: 24px 17px 36px; }
  .site-intro { order: -1; }
  .site-intro h1 { font-size: 20px; }
  .site-guide { order: 3; width: 100%; }
  .site-guide ol { grid-template-columns: 1fr; gap: 14px; }
  .canvas-column { width: 100%; order: 0; padding-top: 0; }
  .canvas-heading { padding-bottom: 20px; }
  .canvas-heading input { font-size: 22px; max-width: 360px; }
  .canvas-heading .eyebrow { font-size: 11px; }
  .artboard-wrap { box-shadow: 4px 5px 0 #cdd7c0; border-radius: 18px 15px 18px 16px; }
  .canvas-footer { font-size: 11px; }
  .workspace-note { display: none; }
  .inspector { width: 100%; order: 1; }
  .library { width: 100%; order: 2; }
  .panel-heading { padding: 16px 17px; }
  .panel-heading .eyebrow { font-size: 11px; }
  .panel-step { width: 29px; height: 31px; }
  .library-total { padding-inline: 7px; font-size: 12px; }
  .asset-grid { grid-template-columns: repeat(4,1fr); max-height: none; min-height: 0; overflow: visible; gap: 9px; padding: 0 14px 19px; }
  .asset-art { height: 67px; }
  .library-search { padding-inline: 15px; }
  .library-search input { min-height: 44px; font-size: 16px; }
  .categories { gap: 7px; padding-inline: 14px; }
  .categories button { min-height: 41px; padding-inline: 13px; font-size: 12px; }
  .library-note { padding: 13px 17px; }
  .library-bottom { flex-direction: row; justify-content: space-between; }
  .action-pair button, .reset-button, .delete-button { min-height: 40px; }
  .layer-button { min-height: 44px; }
  .layers { max-height: 350px; }
  .finish-view { padding: 26px 18px 40px; }
  .finish-heading { margin-bottom: 24px; }
  .finish-heading h1 { font-size: 25px; }
  .finish-heading>p:last-child { font-size: 12px; }
  .finish-layout { grid-template-columns: minmax(0,1fr); gap: 27px; max-width: 580px; margin-inline: auto; }
  .card-paper { width: 100%; }
  .finish-form { position: relative; padding: 27px 23px; }
  .finish-form .primary-button { font-size: 14px; }
  .card-status { min-height: 0; }
  .viewing-controls { gap: 10px; }
  .viewing-controls button { min-height: 44px; padding-inline: 13px; }
  .card-stage figcaption { font-size: 10px; }
  .back-button { padding: 9px 13px; font-size: 11px; }
}
@media (max-width: 540px) {
  .app-header { flex-wrap: wrap; gap: 13px; padding: 14px 16px; }
  .brand-word { font-size: 23px; }
  .brand-fish { width: 38px; }
  #editor-actions { flex-basis: 100%; justify-content: space-between; gap: 7px; }
  #finish-button { min-height: 44px; padding-inline: 15px; gap: 8px; }
  .reset-scene-button { margin-right: auto; padding-inline: 10px; font-size: 11px; }
  .save-menu summary { min-height: 44px; padding-inline: 10px; font-size: 11px; }
  .canvas-heading { align-items: flex-start; gap: 12px; }
  .canvas-heading input { font-size: 20px; }
  .reference-button { width: 100%; }
  .canvas-footer { gap: 8px; font-size: 10px; }
  .canvas-footer .edit-hint { max-width: 73%; }
  .empty-hint { font-size: 9px; }
  .status-bar { font-size: 10px; }
  .selected-preview { padding: 15px 11px; gap: 8px; }
  #selected-thumb { width: 41px; height: 45px; padding: 4px; }
  .selected-preview h3 { font-size: 11px; }
  .selected-preview span { font-size: 10px; }
  fieldset { padding-inline: 11px; }
  .action-pair { gap: 5px; }
  .action-pair button { font-size: 10px; }
  .field-heading { font-size: 11px; }
  .position-fields { gap: 6px; }
  .position-fields label { gap: 4px; font-size: 10px; }
  .reset-button, .delete-button { font-size: 10px; }
  .reset-note { font-size: 10px; }
  .layers-heading { padding-inline: 11px; }
  .layers-heading h2 { font-size: 13px; }
  .layers-heading>span { font-size: 9px; }
  .layers { padding-inline: 5px; }
  .layer-button { padding-inline: 4px; gap: 6px; }
  .layer-thumb { width: 23px; }
  .layer-name { font-size: 10px; }
  .layer-lock { font-size: 8px; padding-inline: 2px; }
  .nothing-selected { padding-inline: 10px; }
  .nothing-selected p { font-size: 12px; }
  .nothing-selected>span:last-child { font-size: 10px; }
  .selection-symbol { width: 66px; height: 75px; }
  .selection-symbol img { height: 61px; }
  .asset-grid { grid-template-columns: repeat(3,1fr); }
  .asset-art { height: 63px; }
  .asset-label { font-size: 10px; }
  .library-bottom { flex-direction: column; }
  .finish-heading h1 { font-size: 22px; letter-spacing: .01em; }
  .finish-heading .eyebrow { font-size: 10px; }
  #finish-actions { margin-left: auto; }
  .back-button { padding-inline: 10px; gap: 5px; font-size: 10px; }
  .back-button span { font-size: 15px; }
  .finish-form h2 { font-size: 18px; }
  dialog { padding: 20px; }
  .dialog-heading { gap: 8px; }
  .dialog-heading h2 { font-size: 21px; }
  .dialog-heading .eyebrow { font-size: 10px; }
  .dialog-heading select { font-size: 11px; padding-inline: 5px; }
}
@media (max-width: 370px) {
  .app-header { padding-inline: 13px; }
  .brand-word { font-size: 20px; }
  .brand-fish { width: 30px; }
  .workspace, .finish-view { padding-inline: 12px; }
  .canvas-heading input { font-size: 18px; }
  .canvas-heading .eyebrow { font-size: 10px; }
  .finish-heading h1 { font-size: 20px; }
  .back-button { padding-inline: 7px; }
  .asset-grid { gap: 7px; padding-inline: 11px; }
  .asset-art { height: 58px; }
}
@media (prefers-reduced-motion: reduce) {
  button:not(:disabled), summary { transition: none; }
}

/* A small, transparent sketchbook for original aquarium residents. */
.draw-material { display: flex; align-items: center; gap: 13px; width: calc(100% - 26px); margin: 0 13px 16px; padding: 10px 14px; text-align: left; background: #fff3ce; border: 1.5px dashed #9b986b; border-radius: 13px 11px 14px 12px; }
.draw-material:hover { background: #fce9b2; border-color: var(--ink); }
.draw-material>span:first-child { font-size: 29px; font-weight: 400; color: #7d7447; }
.draw-material strong { display: block; font-size: 13px; }
.draw-material small { display: block; margin-top: 5px; font-size: 10px; color: #7b795c; }
.handmade-entry { display: flex; flex-direction: column; min-width: 0; gap: 7px; }
.handmade-entry .asset-card { width: 100%; flex: 1; background: #fffdf4; }
.remove-material { padding: 5px 0; border: 0; background: transparent; font-size: 9px; color: #8c6855; text-decoration: underline; text-underline-offset: 3px; }
.remove-material:hover { background: #f8ecdf; }
.drawing-dialog { width: min(1000px,calc(100% - 30px)); max-height: calc(100dvh - 32px); overflow: auto; }
.drawing-dialog .dialog-heading { align-items: flex-start; margin-bottom: 22px; }
.drawing-dialog h2 { font-size: 23px; line-height: 1.6; outline: none; }
#drawing-close { flex-shrink: 0; }
.drawing-layout { display: grid; grid-template-columns: minmax(0,1fr) 235px; gap: 22px; align-items: start; }
.drawing-workspace { min-width: 0; }
.drawing-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.drawing-tools, .drawing-history { display: flex; gap: 5px; }
.drawing-toolbar button { min-height: 38px; padding: 8px 12px; font-size: 12px; border-color: #a4b198; }
.drawing-history button { padding-inline: 10px; font-size: 17px; }
.drawing-history #drawing-clear { font-size: 11px; }
.drawing-tools button[aria-pressed=true] { background: var(--accent); color: var(--paper); border-color: var(--ink); }
.drawing-toolbar button:not(:disabled):hover { box-shadow: 1px 2px 0 #b9c8aa; }
.drawing-surface { position: relative; border: 1.5px solid var(--ink); border-radius: 14px 11px 13px 12px; background-color: #fff; background-image: conic-gradient(#f0f1eb 25%,transparent 0 50%,#f0f1eb 0 75%,transparent 0); background-size: 20px 20px; overflow: hidden; }
#drawing-canvas { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
#drawing-canvas:focus-visible { outline: 3px solid #248493; outline-offset: -4px; }
.drawing-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; padding: 15px; text-align: center; pointer-events: none; color: #7c8b7d; font-size: 15px; }
.drawing-placeholder small { font-size: 11px; }
.drawing-paint-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 15px; margin-top: 17px; }
.drawing-palette { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.drawing-palette button { width: 30px; height: 30px; padding: 0; background: var(--ink-swatch); border: 3px solid var(--paper); outline: 1px solid #b7c1b0; border-radius: 50% 47% 48% 45%; }
.drawing-palette button[aria-pressed=true] { outline: 2px solid var(--ink); box-shadow: 0 0 0 4px #f3d991; }
.drawing-palette button:focus-visible { outline: 3px solid #248493; outline-offset: 4px; }
.drawing-custom-color { display: flex; align-items: center; gap: 6px; margin-left: 4px; font-size: 10px; color: var(--muted); }
.drawing-custom-color input { width: 31px; height: 31px; padding: 2px; border: 1px solid #a4b198; border-radius: 8px; background: #fff; cursor: pointer; }
.drawing-width { display: grid; grid-template-columns: 1fr auto; gap: 6px; min-width: 110px; font-size: 11px; color: var(--muted); }
.drawing-width output { font-variant-numeric: tabular-nums; }
.drawing-width input { grid-column: 1/-1; width: 125px; margin: 0; }
.drawing-hint { margin-top: 15px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.drawing-settings { min-width: 0; padding: 19px 17px 14px; background: #f4f1df; border: 1px dashed #b5b895; border-radius: 14px 17px 13px 16px; }
.drawing-settings .eyebrow { margin-bottom: 18px; }
.drawing-settings label { display: block; margin-bottom: 8px; font-size: 12px; color: #52664b; }
.drawing-settings input, .drawing-settings select { display: block; width: 100%; min-width: 0; margin-bottom: 20px; padding: 11px 9px; border: 1px solid #9cae91; border-radius: 9px; background: #fffef8; color: var(--ink); font-size: 12px; }
.drawing-settings input::placeholder { color: #839078; font-size: 11px; }
.drawing-save-note { margin: 2px 0 22px; color: #6b785e; font-size: 11px; line-height: 1.9; }
.drawing-settings .primary-button { width: 100%; padding: 11px 12px; gap: 5px; font-size: 12px; }
.drawing-status { min-height: 20px; margin-top: 17px; font-size: 11px; line-height: 1.8; color: #806039; }
@media (max-width: 760px) {
  .drawing-dialog { width: calc(100% - 18px); max-height: calc(100dvh - 18px); padding: 17px; }
  .drawing-dialog .dialog-heading { margin-bottom: 17px; }
  .drawing-dialog h2 { font-size: 19px; }
  .drawing-layout { grid-template-columns: minmax(0,1fr); gap: 21px; }
  .drawing-toolbar { gap: 8px; }
  .drawing-toolbar button { min-height: 40px; padding-inline: 11px; }
  .drawing-palette { gap: 9px; }
  .drawing-placeholder { font-size: 12px; gap: 9px; }
  .drawing-placeholder small { font-size: 10px; }
  .drawing-paint-controls { gap: 17px; }
  .drawing-settings input, .drawing-settings select { font-size: 16px; }
  .drawing-settings .primary-button { font-size: 14px; }
  .remove-material { min-height: 35px; font-size: 10px; }
}
