/* handy.moe Webmaker shelf (Kumo, 2026-12-03). Uses the site's variables; nothing here loads from elsewhere. */
.web-wide { max-width: var(--wide); }
.web .mono, .web textarea.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.45; }
.web code { overflow-wrap: anywhere; }

/* ---- gallery */
.tpl-filter { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: end; }
.tpl-filter p { margin: 0 0 6px; }
.tpl-group { margin: 32px 0 12px; font-size: var(--h2, 20px); color: var(--fire); }
.tpl-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.tpl-card { background: var(--card); border: 1px solid var(--rule); display: flex; flex-direction: column; min-width: 0; transition: outline-color .3s; outline: 2px solid transparent; }
.tpl-card.flash { outline-color: var(--fire); }
.tpl-thumb { display: block; aspect-ratio: 16 / 10; background: var(--check-a); overflow: hidden; border-bottom: 1px solid var(--rule); }
.tpl-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.tpl-thumb span { display: grid; place-items: center; height: 100%; padding: 8px; text-align: center; }
.tpl-meta { padding: 10px 12px 12px; }
.tpl-meta h3 { margin: 0 0 4px; font-size: 1em; }
.tpl-meta p { margin: 4px 0; }
.lic { color: var(--ok); }

.tpl-bar { align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.tpl-frame-wrap { position: relative; width: 100%; height: 600px; overflow: hidden; background: var(--check-b); border: 1px solid var(--rule); }
.tpl-frame-wrap iframe { position: absolute; top: 0; left: 0; border: 0; background: #fff; transform-origin: 0 0; }
.tpl-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; margin-top: 16px; }
.tpl-info .panel { margin: 0; min-width: 0; }
.web .panel > h2:first-child { margin-top: 0; }
.tpl-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 0 0 8px; }
.tpl-dl dt { color: var(--ink-3, var(--ink)); }
.tpl-dl dd { margin: 0; overflow-wrap: anywhere; }
.tpl-files { list-style: none; padding: 0; margin: 8px 0 0; max-height: 280px; overflow: auto; }
.tpl-files li { overflow-wrap: anywhere; }

/* ---- generators */
.gen-grid { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
.gen-ctl { display: grid; gap: 4px; min-width: 0; }
.gen-ctl .row { gap: 8px 12px; }
.gen-ctl input[type=color] { width: 4rem; height: 36px; padding: 2px; }
.gen-out { min-width: 0; display: grid; gap: 12px; }
.gen-stage { min-height: 300px; display: grid; place-items: center; padding: 32px 16px; border: 1px solid var(--rule); overflow: hidden; position: relative; }
.gen-demo { width: 100%; display: grid; place-items: center; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.gen-demo h3 { margin: 0 0 6px; font-size: 22px; font-weight: 700; }
.gen-demo p { margin: 0 0 10px; }
.g-card { width: min(100%, 360px); min-height: 200px; padding: 24px; border-radius: 16px; display: flex; flex-direction: column; justify-content: center; }
.g-btn { border: 0; color: #fff; padding: 10px 18px; border-radius: 999px; font: inherit; font-weight: 600; align-self: start; filter: saturate(1.2) brightness(.9); }
.s-card, .gl-card { width: min(100%, 320px); padding: 28px; }
.px-card { width: min(100%, 320px); }
.stop { gap: 8px; align-items: center; margin: 0 0 6px; flex-wrap: nowrap; }
.stop input[type=range] { flex: 1; min-width: 60px; }
.stop input[type=color] { width: 3rem; height: 32px; padding: 2px; flex: none; }
.layer { border: 1px dashed var(--rule); padding: 8px 10px; margin: 0 0 10px; min-width: 0; }
.layer legend { padding: 0 4px; }
.gl-bg-blobs { background: radial-gradient(circle at 20% 30%, #ff7eb6 0 18%, transparent 19%), radial-gradient(circle at 78% 70%, #5ec8ff 0 22%, transparent 23%), radial-gradient(circle at 70% 20%, #ffe14d 0 10%, transparent 11%), linear-gradient(135deg, #3a1d6e, #13254a); }
.gl-bg-sky { background: radial-gradient(1px 1px at 20% 30%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 70% 60%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 40% 80%, #fff 50%, transparent 51%), radial-gradient(circle at 50% 120%, #ff9ac8 0 30%, transparent 31%), linear-gradient(#0b0f2e, #2a1550); }
.gl-bg-photo { background-size: cover; background-position: center; background-color: #333; }
.sb-box { width: min(100%, 360px); height: 220px; overflow: auto; background: #fff; border: 1px solid #ccc; color: #111; }
.sb-inner { padding: 12px 16px; width: 520px; }
.cu-area { width: min(100%, 380px); padding: 28px; background: #fff; border: 2px dashed #f4949c; color: #111; }
.cu-edit { width: 192px; height: 192px; image-rendering: pixelated; cursor: crosshair; border: 1px solid var(--rule); }

/* ---- pattern maker */
.pat-list { display: grid; grid-template-columns: repeat(auto-fill, 48px); gap: 6px; max-height: 360px; overflow: auto; padding: 4px; border: 1px solid var(--rule); }
.pat-item { width: 48px; height: 48px; border: 2px solid transparent; padding: 0; cursor: pointer; image-rendering: pixelated; background-size: 48px 48px; }
.pat-item[aria-selected=true] { border-color: var(--fire); }
.pat-item:focus-visible { outline: 2px solid var(--fire); outline-offset: 2px; }
.pat-stage { height: 260px; border: 1px solid var(--rule); image-rendering: pixelated; background-repeat: repeat; }
.pat-edit { display: grid; grid-template-columns: repeat(8, 22px); gap: 1px; background: var(--rule); border: 1px solid var(--rule); width: max-content; touch-action: none; }
.pat-edit button { width: 22px; height: 22px; padding: 0; border: 0; background: var(--card); cursor: pointer; }
.pat-edit button[aria-pressed=true] { background: var(--fire); }
.pat input[type=color] { width: 4rem; height: 36px; padding: 2px; }

/* ---- 88x31 / blinkie */
.b88-stage { min-height: 200px; display: grid; place-items: center; border: 1px solid var(--rule); padding: 16px; overflow: auto; }
.b88-stage canvas { image-rendering: pixelated; display: block; max-width: 100%; }
.btn88 input[type=color] { width: 4rem; height: 36px; padding: 2px; }

/* ---- homepage maker */
.hp-grid { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
.hp-form { display: grid; gap: 12px; min-width: 0; }
.hp-form fieldset { border: 1px solid var(--rule); padding: 10px 12px 12px; margin: 0; min-width: 0; display: grid; gap: 6px; }
.hp-form legend { color: var(--fire); padding: 0 4px; }
.hp-form input[type=color] { width: 100%; height: 36px; padding: 2px; }
.hp-looks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hp-look { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 0 8px; align-items: center; padding: 8px; border: 1px solid var(--rule); cursor: pointer; }
.hp-look input { position: absolute; opacity: 0; pointer-events: none; }
.hp-look .sw { grid-row: span 2; width: 28px; height: 28px; background: var(--b); border: 3px solid var(--a); display: grid; place-items: center; }
.hp-look .sw i { width: 10px; height: 10px; background: var(--p); }
.hp-look small { font-size: 12px; line-height: 1.3; color: var(--ink-3, inherit); }
.hp-look:has(input:checked) { border-color: var(--fire); background: var(--hl); }
.hp-look:has(input:focus-visible) { outline: 2px solid var(--fire); }
.hp-checks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.hp-colors { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.hp-colors .field span { font-size: 12px; }
.hp-preview { position: sticky; top: 12px; min-width: 0; }
.tpl-frame-wrap.tall { height: 900px; }

/* ---- guide */
.guide ol li, .guide ul li { margin-bottom: 6px; }
.toc { border: 1px solid var(--rule); padding: 8px 16px; margin: 16px 0; }
.toc ol { margin: 0; }

/* ---- HTML editor */
.hed { padding: 10px; display: grid; gap: 8px; min-width: 0; }
.hed.over { outline: 3px dashed var(--fire); outline-offset: -3px; }
.hed-top { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.hed-proj, .hed-viewbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.hed-name input { width: 12rem; max-width: 100%; font-weight: 700; }
.hed-filebtn { position: relative; overflow: hidden; cursor: pointer; }
.hed-filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.hed-filebtn:focus-within { outline: 2px solid var(--fire); outline-offset: 2px; }
.hed-fmt { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px; border: 1px solid var(--rule); background: var(--paper); }
.hed-tb { min-width: 34px; height: 32px; padding: 0 8px; border: 1px solid var(--rule); background: var(--card); color: var(--ink); cursor: pointer; font: inherit; font-size: 14px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; gap: 2px; }
.hed-tb:hover { border-color: var(--fire); }
.hed-tb[aria-pressed=true] { background: var(--hl); border-color: var(--fire); }
.hed-tb:focus-visible, .hed-tsel:focus-visible { outline: 2px solid var(--fire); outline-offset: 1px; }
.hed-tsel { height: 32px; max-width: 9rem; }
.hed-color { position: relative; }
.hed-color input { width: 22px; height: 22px; padding: 0; border: 0; background: none; }
.hed-sep { width: 1px; height: 24px; background: var(--rule); margin: 0 2px; }
.hed-main { display: grid; grid-template-columns: 180px minmax(0, 1fr) 250px; gap: 8px; min-height: 640px; }
.hed-files, .hed-insp { border: 1px solid var(--rule); padding: 8px; min-width: 0; overflow: auto; max-height: 82vh; }
.hed-label { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3, var(--ink)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hed-tree { list-style: none; margin: 0 0 8px; padding: 0; font-size: 13px; }
.hed-dir { margin-top: 6px; color: var(--ink-3, var(--ink)); font-size: 12px; overflow-wrap: anywhere; }
.hed-file { display: block; width: 100%; text-align: left; padding: 3px 6px 3px 20px; border: 0; background: none; color: var(--ink); cursor: pointer; font: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: relative; }
.hed-dir + li .hed-file, .hed-dir ~ li .hed-file { padding-left: 28px; }
.hed-file::before { position: absolute; left: 4px; font-size: 11px; opacity: .8; }
.hed-dir ~ li .hed-file::before { left: 12px; }
.hed-file.k-page::before { content: "◧"; } .hed-file.k-css::before { content: "✎"; } .hed-file.k-js::before { content: "ƒ"; } .hed-file.k-img::before { content: "▣"; } .hed-file.k-font::before { content: "Aa"; font-size: 9px; } .hed-file.k-other::before { content: "·"; }
.hed-file:hover { background: var(--hl); }
.hed-file.is-open { background: var(--hl); outline: 1px solid var(--fire); }
.hed-file.is-page { font-weight: 700; }
.hed-file-btns { display: flex; flex-wrap: wrap; gap: 4px; }
.hed-work { display: grid; gap: 8px; min-width: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.hed-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.hed-vwrap { position: relative; flex: 1; min-height: 560px; border: 1px solid var(--rule); background: #fff; }
.hed-vwrap iframe, .hed-prevpane iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.hed-prevpane { position: relative; } .hed-prevpane iframe { position: relative; flex: 1; min-height: 600px; border: 1px solid var(--rule); }
.hed-codepane { min-height: 560px; }
.hed-code { flex: 1; min-height: 520px; border: 1px solid var(--rule); overflow: hidden; display: flex; }
.hed-code .cm-editor { flex: 1; min-width: 0; max-height: 78vh; }
.hed-bin { flex: 1; border: 1px solid var(--rule); padding: 12px; overflow: auto; }
.hed-bin img { max-width: 100%; image-rendering: auto; background: repeating-conic-gradient(var(--check-a) 0 25%, var(--check-b) 0 50%) 0 0 / 16px 16px; }
.hed-hints { font-size: 12px; color: var(--ok); text-transform: none; letter-spacing: 0; }
.hed-hints.warn { color: var(--warn); }
.hed-hint-box { font-size: 13px; margin-top: 4px; }
.hed-hint-list { margin: 4px 0 0; padding-left: 18px; max-height: 160px; overflow: auto; }
.hed-hint-list li.error, .hed-hint-list li.warning { color: var(--warn); }
.linkish { border: 0; background: none; padding: 0; color: var(--fire); text-decoration: underline; cursor: pointer; font: inherit; }
.hed-sel { position: absolute; pointer-events: none; border: 1px dashed var(--fire); z-index: 2; }
.hed-sel-tag { position: absolute; left: -1px; top: -20px; font: 11px/18px ui-monospace, Menlo, Consolas, monospace; padding: 0 6px; background: #e8557a; color: #fff; white-space: nowrap; }
.hed-sel-handle { position: absolute; right: -8px; bottom: -8px; width: 16px; height: 16px; padding: 0; border: 2px solid #fff; background: #e8557a; cursor: nwse-resize; pointer-events: auto; touch-action: none; box-shadow: 0 0 0 1px #0006; }
.hed-sel-handle:focus-visible { outline: 3px solid var(--fire); }
.hed-crumbs { font-size: 12px; margin-bottom: 8px; overflow-wrap: anywhere; }
.hed-el-btns { margin-bottom: 8px; gap: 4px; }
.hed-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.hed-insp .field { margin-bottom: 6px; }
.hed-insp .field span { font-size: 12px; }
.hed-insp input, .hed-insp select { width: 100%; min-width: 0; }
.hed-h3 { font-size: 13px; margin: 12px 0 6px; color: var(--fire); }
.hed-colorpair { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 4px; }
.hed-colorpair input[type=color] { height: 32px; padding: 2px; }
.hed-outside { margin: 0; }
.hed-outside ul { max-height: 120px; overflow: auto; }
.hed-dlg { border: 1px solid var(--rule); background: var(--card); color: var(--ink); padding: 0; width: min(92vw, 520px); }
.hed-dlg::backdrop { background: #0008; }
.hed-dlg-form { padding: 16px 18px; display: grid; gap: 8px; }
.hed-dlg-form h2 { margin: 0 0 4px; font-size: 18px; }
.hed-dlg-btns { margin-top: 8px; }
.hed-plist { list-style: none; padding: 0; margin: 0; max-height: 50vh; overflow: auto; }
.hed-plist li { padding: 4px 0; border-bottom: 1px solid var(--rule); }
/* which panes each view shows */
.hed[data-view=visual] .hed-codepane, .hed[data-view=visual] .hed-prevpane,
.hed[data-view=split] .hed-prevpane,
.hed[data-view=code] .hed-visual, .hed[data-view=code] .hed-prevpane, .hed[data-view=code] .hed-insp,
.hed[data-view=preview] .hed-visual, .hed[data-view=preview] .hed-codepane, .hed[data-view=preview] .hed-insp,
.hed[data-view=code] .hed-fmt, .hed[data-view=preview] .hed-fmt { display: none; }
.hed[data-view=visual] .hed-work, .hed[data-view=code] .hed-work, .hed[data-view=preview] .hed-work { grid-template-columns: minmax(0, 1fr); }
.hed[data-view=code] .hed-main, .hed[data-view=preview] .hed-main { grid-template-columns: 180px minmax(0, 1fr); }
.hed.is-full { position: fixed; inset: 0; z-index: 50; margin: 0; overflow: auto; max-width: none; border: 0; }
.hed.is-full .hed-main { min-height: calc(100vh - 140px); }
.hed.is-full .hed-vwrap, .hed.is-full .hed-code { min-height: calc(100vh - 200px); }
body.hed-noscroll { overflow: hidden; }
@media (max-width: 1100px) {
  .hed-main { grid-template-columns: 160px minmax(0, 1fr); }
  .hed-insp { grid-column: 1 / -1; max-height: none; }
  .hed-insp #hed-insp-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 12px; }
  .hed-insp .hed-crumbs, .hed-insp .hed-el-btns, .hed-insp .hed-h3, .hed-insp .hed-styles + p { grid-column: 1 / -1; }
  .hed-insp .hed-styles { display: contents; }
}
@media (max-width: 860px) {
  .hed-main, .hed[data-view] .hed-main { grid-template-columns: minmax(0, 1fr); }
  .hed-work, .hed[data-view] .hed-work { grid-template-columns: minmax(0, 1fr); }
  .hed-files { max-height: 220px; }
  .hed-vwrap, .hed-code, .hed-codepane { min-height: 420px; }
  .hed-prevpane iframe { min-height: 480px; }
}

@media (max-width: 860px) {
  .gen-grid, .hp-grid { grid-template-columns: minmax(0, 1fr); }
  .hp-preview { position: static; }
  .hp-colors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .hp-looks { grid-template-columns: minmax(0, 1fr); }
  .tpl-dl { grid-template-columns: minmax(0, 1fr); }
  .cu-edit { width: 160px; height: 160px; }
  .sb-inner { width: 420px; }
}
