/* CARD3D Flow: the studio's paper-and-ink look, kept quiet so the ornament is the loudest thing on the page. */
[hidden] { display: none !important; }
:root {
  --paper: #FBF8F3; --sheet: #FFFFFF;
  --ink: #102B45; --ink-soft: #52627A; --ink-faint: #8A95A5;
  --teal: #0E7C7B; --teal-deep: #0A5F5E; --teal-wash: #E3F1F0;
  --gold: #E3C262; --gold-wash: #FBF3D8; --ember-wash: #FBEADB;
  --crease: #CFC7B9; --crease-soft: #E6E0D5; --danger: #B23A3A;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --radius: 8px; --maxw: 1120px;
}
* { box-sizing: border-box; }
html, body { background: var(--paper); color: var(--ink); }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.5; min-height: 100vh; overflow-x: hidden; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.1; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.15rem; color: var(--ink-soft); margin-top: 1.2rem; }
p { margin: 0 0 1rem; max-width: 62ch; }
a { color: var(--teal-deep); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* top bar */
.topbar { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; max-width: var(--maxw); margin: 0 auto; border-bottom: 1px dashed var(--crease); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { border-radius: 50%; }
.brand-name { font-family: var(--serif); font-size: 1.3rem; }
.brand-name em { color: var(--teal-deep); }
.top-right { display: flex; align-items: center; gap: 10px; }
.who, .saved { color: var(--ink-faint); font-size: .85rem; }
@media (max-width: 640px) { .who { display: none; } }
.burger { width: 42px; height: 42px; border: 1px solid var(--crease); border-radius: 50%; background: var(--sheet); display: grid; place-content: center; gap: 4px; cursor: pointer; }
.burger span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; }
.menu { position: absolute; right: 16px; top: 60px; z-index: 30; width: min(320px, calc(100vw - 32px)); background: var(--sheet); border: 1px solid var(--crease); border-radius: 12px; box-shadow: 0 18px 40px rgba(16,43,69,.16); padding: 6px; display: flex; flex-direction: column; }
.menu hr { border: 0; border-top: 1px dashed var(--crease); margin: 4px 8px; width: auto; }
.menu-item { display: flex; flex-direction: column; text-align: left; gap: 0; padding: 10px 12px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-decoration: none; color: var(--ink); }
.menu-item:hover:not(:disabled) { background: var(--teal-wash); }
.menu-item:disabled { opacity: .4; cursor: default; }
.menu-item span { font-size: .85rem; color: var(--ink-soft); }

/* step trail */
.steps { list-style: none; display: flex; gap: 4px; margin: 0 auto; padding: 10px 16px 0; max-width: var(--maxw); overflow-x: auto; scrollbar-width: none; font-size: .8rem; color: var(--ink-faint); }
.steps li { white-space: nowrap; padding: 3px 10px; border-radius: 999px; }
.steps li.done { color: var(--ink-soft); }
.steps li.on { background: var(--ink); color: #fff; }
.steps li { padding: 0; }
.steps li > span, .step-link { display: inline-block; padding: 3px 10px; border-radius: 999px; }
.step-link { border: 0; background: none; font: inherit; color: var(--teal-deep); cursor: pointer; text-decoration: underline; text-decoration-color: rgba(10,95,94,.3); text-underline-offset: 3px; }
.step-link:hover { background: var(--teal-wash); text-decoration-color: currentColor; }
.steps li + li::before { content: ""; }

.view { max-width: var(--maxw); margin: 0 auto; padding: 22px 16px 72px; }
.lede { color: var(--ink-soft); font-size: 1.05rem; }
.muted { color: var(--ink-soft); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: var(--teal-deep); margin: 0 0 .3rem; font-weight: 600; }
.label { font-size: .85rem; font-weight: 600; color: var(--ink-soft); margin: 1rem 0 .4rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--ink); background: var(--sheet); color: var(--ink); cursor: pointer; text-decoration: none; font-weight: 500; }
.btn:hover { background: var(--teal-wash); }
.btn.teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.teal:hover { background: var(--teal-deep); }
.btn.secondary { border-color: var(--teal); color: var(--teal-deep); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ink-soft); }
.btn.quiet:hover { background: var(--crease-soft); }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: .9rem; }
.linkish { border: 0; background: none; color: var(--teal-deep); text-decoration: underline; cursor: pointer; padding: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.4rem; }
.tool-row { display: flex; flex-wrap: wrap; gap: 8px; margin: .6rem 0; }

/* occasions */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 1.2rem 0 .4rem; }
.tab { border: 1px solid var(--crease); background: var(--sheet); border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.tab.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--crease); background: var(--sheet); border-radius: 999px; padding: 9px 16px; cursor: pointer; }
.chip:hover { border-color: var(--teal); background: var(--teal-wash); }
.chip.on { border-color: var(--teal); background: var(--teal-wash); }
.chip.small { padding: 6px 12px; font-size: .88rem; }
.quiet-row { margin-top: 1.6rem; }
/* occasion top level: four picture tiles (2026-10-28) */
.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 1.4rem 0 .4rem; }
@media (max-width: 860px) { .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cat-holidays { --tint: #FBEADB; --hue: #A8462A; }
.cat-events { --tint: #FBF3D8; --hue: #8A6D1D; }
.cat-sentiments { --tint: #FBE3E8; --hue: #A8325E; }
.cat-other { --tint: var(--teal-wash); --hue: var(--teal-deep); }
.cat-tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 22px 14px 18px; border: 1px solid var(--crease-soft); border-radius: 16px; background: var(--sheet); cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.cat-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16,43,69,.10); border-color: var(--hue); }
.cat-tile.on { border-color: var(--hue); box-shadow: 0 0 0 2px var(--hue); }
.cat-icon { display: grid; place-items: center; flex: none; width: 72px; height: 72px; border-radius: 50%; background: var(--tint, var(--teal-wash)); color: var(--hue, var(--teal-deep)); }
.cat-icon svg { width: 40px; height: 40px; }
.cat-name { font-family: var(--serif); font-size: 1.5rem; line-height: 1.1; }
.cat-blurb { font-size: .85rem; color: var(--ink-soft); }
@media (max-width: 640px) {
  .cat-grid { gap: 10px; }
  .cat-tile { padding: 16px 10px 14px; }
  .cat-icon { width: 60px; height: 60px; }
  .cat-icon svg { width: 34px; height: 34px; }
  .cat-name { font-size: 1.3rem; }
  .cat-blurb { font-size: .78rem; }
}
/* the tabs carry the same pictures, small */
.tab { display: inline-flex; align-items: center; gap: 8px; }
.tab .cat-icon { width: 22px; height: 22px; background: none; color: inherit; }
.tab .cat-icon svg { width: 20px; height: 20px; }
.crumb { border: 0; background: none; color: var(--teal-deep); cursor: pointer; padding: 4px 0; margin: 0 0 .6rem; font-size: .92rem; }
.crumb:hover { text-decoration: underline; }
/* phone: the chosen group, then its headings one per row */
.cat-head { display: flex; align-items: center; gap: 12px; margin-bottom: .6rem; }
.cat-head .cat-icon { width: 52px; height: 52px; }
.cat-head .cat-icon svg { width: 30px; height: 30px; }
.cat-head h1, .cat-head .eyebrow { margin: 0; }
.sub-list { display: flex; flex-direction: column; gap: 10px; margin-top: 1rem; }
.sub-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 12px 16px; border: 1px solid var(--crease-soft); border-radius: 12px; background: var(--sheet); cursor: pointer; text-align: left; }
.sub-row:hover, .sub-row.on { border-color: var(--teal); background: var(--teal-wash); }
.sub-name { flex: 1; font-size: 1.05rem; font-weight: 500; }
.sub-peek { display: block; font-size: .8rem; font-weight: 400; color: var(--ink-soft); }
.sub-go { font-size: 1.5rem; line-height: 1; color: var(--ink-faint); }
.chips.roomy { gap: 10px; margin-top: .4rem; }
.chips.roomy .chip { padding: 11px 18px; }
.resume { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 16px; background: var(--gold-wash); border-radius: var(--radius); margin: .6rem 0 1rem; }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-top: 1rem; }
.g-card { display: flex; flex-direction: column; align-items: stretch; text-align: left; padding: 8px 8px 12px; border: 1px solid var(--crease-soft); border-radius: 12px; background: var(--sheet); cursor: pointer; transition: transform .15s, box-shadow .15s; }
.g-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16,43,69,.10); }
.g-card.on { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal); }
.g-img { aspect-ratio: 1; border-radius: 8px; background: radial-gradient(circle at 50% 40%, #fff, var(--paper)); display: grid; place-items: center; overflow: hidden; margin-bottom: 8px; }
.g-img img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: 50% 50%; margin: 0 auto; }
.g-img { justify-items: center; justify-content: center; }
.g-name { font-family: var(--serif); font-size: 1.2rem; padding: 0 4px; }
.g-shape { font-size: .82rem; color: var(--ink-soft); padding: 0 4px; }
.gallery-detail:empty { display: none; }
.detail-card { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: center; background: var(--sheet); border: 1px solid var(--crease-soft); border-radius: 14px; padding: 16px; margin: 1rem 0 1.4rem; }
@media (max-width: 760px) { .detail-card { grid-template-columns: 1fr; } }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 38px; height: 38px; border-radius: 50%; cursor: pointer; border: 2px solid var(--sheet); box-shadow: 0 0 0 1px var(--crease); background: conic-gradient(var(--a) 0 50%, var(--b) 50% 80%, var(--c) 80% 100%); }
.swatch.solid { background: var(--a); }
.swatch.on { box-shadow: 0 0 0 2px var(--teal); }
.swatches.small .swatch { width: 30px; height: 30px; }

/* 3D stage */
.stage-wrap { position: relative; aspect-ratio: 1; width: 100%; max-height: 72vh; border-radius: 14px; background: radial-gradient(circle at 50% 38%, #fff 0, #fff 30%, var(--paper) 78%); touch-action: none; cursor: grab; user-select: none; overflow: hidden; }
.stage-wrap:active { cursor: grabbing; }
.stage-wrap.pickable { cursor: pointer; }
.stage { position: absolute; inset: 0; }
.stage.pick { opacity: 0; pointer-events: none; }
.stage-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font-size: .78rem; color: var(--ink-faint); background: rgba(255,255,255,.8); padding: 2px 10px; border-radius: 999px; pointer-events: none; white-space: nowrap; }
.stage-hint.static { position: static; transform: none; display: inline-block; margin-top: 8px; }
.snap-stage { position: fixed; left: -10000px; top: 0; width: 360px; height: 360px; }

/* work layout: picture left, controls right */
.work { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr); gap: 28px; align-items: start; }
@media (max-width: 820px) { .work { grid-template-columns: 1fr; gap: 16px; } }
.work-side { padding-top: 6px; }
.note { padding: 10px 14px; border-radius: var(--radius); background: var(--teal-wash); transition: background .2s; }
.note.warn { background: var(--ember-wash); }
.warn-soft { background: var(--gold-wash); }
.face-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* 2D face */
.face-wrap { text-align: center; }
.face-stack { position: relative; display: inline-block; width: 100%; max-width: 560px; }
.face-canvas { display: block; width: 100%; max-width: 560px; margin: 0 auto; border-radius: 6px; box-shadow: 0 12px 30px rgba(16,43,69,.14); touch-action: none; cursor: grab; background: #fff; }
.face-canvas.solo { border-radius: 2px; box-shadow: 0 0 0 1px rgba(16,43,69,.12), 0 14px 34px rgba(16,43,69,.18); }
.face-canvas.grabbing, .face-overlay.grabbing { cursor: grabbing; }
/* editing a face on the 3D ornament (2026-10-28): it holds still; the holder takes the drags */
.face-holder { position: relative; touch-action: none; }
.face-holder .face-overlay { pointer-events: none; }
.stage-wrap.frozen, .stage-wrap.frozen:active { cursor: default; }
.face-holder.photo-edit .stage-wrap, .face-holder.photo-edit .face-canvas { cursor: grab; }
.face-holder.grabbing, .face-holder.grabbing * { cursor: grabbing !important; }
.face-holder:not(.ready) .stage-hint { opacity: 0; }
.stage-hint { transition: opacity .3s; }
/* photo editor fits the window (2026-10-28): title and Done on one line, tighter spacing, no tall gaps */
.view:has(> .fit-page) { padding-top: 14px; padding-bottom: 16px; }
.fit-page .stage-wrap { max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); }
.work-side.compact { padding-top: 0; }
.side-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.side-head h1 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); margin: 0; }
.side-head .eyebrow { margin-bottom: .15rem; }
.side-head .btn { flex: none; }
.compact .edit-tools { margin-top: .7rem; }
.compact .tool { min-height: 38px; padding: 6px; }
.compact .tool-body { min-height: 0; padding: 10px 2px 2px; }
.compact .tool-body .small-note { margin-top: .15rem; }
.compact .tool-row { margin: .4rem 0; }
.compact .field { margin: .3rem 0; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: .7rem 0 .3rem; }
.label-row .label { margin: 0; }
.view > .side-head { align-items: center; margin-bottom: .5rem; }
.view > .side-head h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
.label-btns { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.label-row .btn.small { min-height: 30px; padding: 4px 10px; font-size: .85rem; }
.compact .strip { padding: 2px 2px 6px; }
.compact .strip-item { flex-basis: 64px; height: 64px; }
.compact .strip-arrow { top: calc(2px + 32px); width: 30px; height: 30px; }
.compact .strip-wrap.more-left::before, .compact .strip-wrap.more-right::after { top: 2px; bottom: 14px; }
.face-overlay { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.edit-tools { margin-top: .6rem; }
.range { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 10px; margin: .5rem 0; font-size: .9rem; color: var(--ink-soft); }
.range input { width: 100%; accent-color: var(--teal); }
.field { display: flex; flex-direction: column; gap: 4px; margin: .6rem 0; font-size: .9rem; color: var(--ink-soft); }
.field input, .field textarea, .field select { padding: 10px 12px; border: 1px solid var(--crease); border-radius: var(--radius); background: var(--sheet); color: var(--ink); font-size: 1rem; width: 100%; }
.field textarea { resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: inline-flex; border: 1px solid var(--crease); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: var(--sheet); padding: 9px 10px; cursor: pointer; font-size: .85rem; flex: 1; }
.seg button.on { background: var(--ink); color: #fff; }
/* every photo in view at once: they wrap into rows (scrolling only past about four rows) */
/* one sideways row; the scroll bar always shows, and arrows appear at either end while photos are out of view */
.strip-wrap { position: relative; }
.strip { display: flex; gap: 8px; overflow-x: scroll; padding: 4px 2px 8px; scrollbar-width: thin; scrollbar-color: var(--ink-faint) var(--crease-soft); }
.strip::-webkit-scrollbar { height: 8px; }
.strip::-webkit-scrollbar-track { background: var(--crease-soft); border-radius: 4px; }
.strip::-webkit-scrollbar-thumb { background: var(--ink-faint); border-radius: 4px; }
.strip-wrap.more-left::before, .strip-wrap.more-right::after { content: ""; position: absolute; top: 4px; bottom: 16px; width: 36px; pointer-events: none; z-index: 1; }
.strip-wrap.more-left::before { left: 0; background: linear-gradient(to right, var(--paper), rgba(251,248,243,0)); }
.strip-wrap.more-right::after { right: 0; background: linear-gradient(to left, var(--paper), rgba(251,248,243,0)); }
.strip-arrow { position: absolute; top: calc(4px + 36px); transform: translateY(-50%); z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--crease); background: var(--sheet); color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; box-shadow: 0 4px 12px rgba(16,43,69,.18); display: grid; place-items: center; padding: 0 0 3px; }
.strip-arrow:hover { border-color: var(--teal); color: var(--teal-deep); }
.strip-arrow.left { left: -4px; }
.strip-arrow.right { right: -4px; }
.strip-item { position: relative; flex: 0 0 72px; height: 72px; border-radius: 8px; border: 2px solid transparent; padding: 0; overflow: hidden; background: var(--crease-soft); cursor: pointer; }
.strip-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.strip-item.on { border-color: var(--teal); }
.strip-item.used img { opacity: .75; }
.strip-item.add { font-size: 1.8rem; color: var(--ink-soft); border: 1px dashed var(--crease); background: var(--sheet); }
.strip-tag { position: absolute; left: 0; right: 0; bottom: 0; font-size: .62rem; background: rgba(16,43,69,.72); color: #fff; padding: 1px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* photo library */
.count { margin-top: -.4rem; }
.library { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.ph-card { position: relative; background: var(--sheet); border: 1px solid var(--crease-soft); border-radius: 10px; padding: 6px; cursor: grab; }
.ph-card.used { border-color: var(--teal); }
.ph-card.dragging { opacity: .4; }
.ph-card.over { box-shadow: 0 0 0 2px var(--gold); }
.ph-img { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--crease-soft); display: grid; place-items: center; color: var(--ink-faint); font-size: .85rem; }
.ph-img img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ph-num { position: absolute; top: 6px; left: 6px; min-width: 24px; height: 24px; border-radius: 12px; background: var(--teal); color: #fff; font-size: .8rem; font-weight: 600; display: grid; place-items: center; padding: 0 6px; }
.ph-moves { display: flex; justify-content: space-between; margin-top: 6px; }
.mini { width: 34px; height: 30px; border-radius: 6px; border: 1px solid var(--crease); background: var(--sheet); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.mini:disabled { opacity: .3; cursor: default; }
.ph-cap { display: block; font-size: .75rem; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.ph-card.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 160px; border: 2px dashed var(--crease); background: transparent; cursor: pointer; color: var(--teal-deep); font-weight: 500; }
.ph-card.add:hover { background: var(--teal-wash); }
.plus { font-size: 2.2rem; line-height: 1; }

/* inside message */
.inside-card { background: var(--paper); border-radius: 8px; box-shadow: 0 12px 30px rgba(16,43,69,.14); padding: 0; overflow: hidden; }
.inside-preview { display: block; width: 100%; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: .92rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); text-align: center; z-index: 40; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* photo tools: four buttons, one panel open at a time (2026-10-25) */
.toolbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.toolbar.six { grid-template-columns: repeat(3, 1fr); }
.tool { min-height: 42px; padding: 8px 6px; border: 1px solid var(--crease); border-radius: 10px; background: var(--sheet); cursor: pointer; font-size: .9rem; font-weight: 500; }
.tool:hover:not(:disabled) { border-color: var(--teal); }
.tool.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tool:disabled { opacity: .4; cursor: default; }
.tool-body { min-height: 64px; padding: 12px 2px 4px; }
.hint-line { margin: 4px 0 0; }
.small-note { font-size: .82rem; margin: .3rem 0 0; }
.xy { display: flex; gap: 12px; flex-wrap: wrap; }
.field.inline { flex-direction: row; align-items: center; gap: 6px; margin: .3rem 0; }
.field.inline span { min-width: 1.2em; font-weight: 600; color: var(--ink); }
.field.inline em { font-style: normal; color: var(--ink-faint); }
.num { width: 84px; padding: 8px 10px; border: 1px solid var(--crease); border-radius: var(--radius); background: var(--sheet); font-size: 1rem; }
/* (2026-10-28) number boxes stay narrow (the general .field input rule made them full width), so X and Y sit side by side */
.field.inline input.num { width: 76px; flex: none; padding: 6px 8px; }
.xy { flex-wrap: nowrap; gap: 18px; align-items: center; }
.xy .field.inline { margin: .2rem 0; }
.range-num { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.range-num input[type=range] { width: 100%; accent-color: var(--teal); }
.btn.toggle.on { background: var(--teal); border-color: var(--teal); color: #fff; }

/* any color: the browser's color picker inside the last circle (2026-10-25) */
.swatch.picker { position: relative; overflow: hidden; display: inline-block; background: conic-gradient(#e53935, #fdd835, #43a047, #1e88e5, #8e24aa, #e53935); }
.swatch.picker.on { background: var(--a); }
.swatch.picker::after { content: "+"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 600; text-shadow: 0 0 3px rgba(0,0,0,.5); pointer-events: none; }
.swatch.picker.on::after { content: ""; }
.swatch.picker input { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); opacity: 0; cursor: pointer; border: 0; padding: 0; }
.color-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.color-code { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; color: var(--ink-soft); }

/* words matching a part of the ornament (2026-10-25) */
.label.first { margin-top: 0; }
.match-row { display: flex; flex-wrap: wrap; gap: 8px; }
.match { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border: 1px solid var(--crease); border-radius: 999px; background: var(--sheet); cursor: pointer; font-size: .9rem; }
.match:hover { border-color: var(--teal); }
.match.on { border-color: var(--teal); background: var(--teal-wash); box-shadow: 0 0 0 1px var(--teal); }
.match .dot { width: 24px; height: 24px; border-radius: 50%; background: var(--a); box-shadow: inset 0 0 0 1px rgba(16,43,69,.18); }

/* details (2026-10-25) */
.sub-tabs { margin: .4rem 0 .8rem; }
.sub-tabs .tab { padding: 6px 14px; font-size: .92rem; }
.scope { margin: .8rem 0 1rem; }
.scope .chips { gap: 6px; }
.scope-line { margin: .2rem 0 0; }
.toolbar.one { grid-template-columns: 1fr; max-width: 200px; }
.toolbar.two-up { grid-template-columns: repeat(2, 1fr); max-width: 340px; }
.seg.wrap { flex-wrap: wrap; border-radius: 14px; }
.seg.wrap button { flex: 0 1 auto; padding: 9px 14px; }

/* choose your ornament: three parts, Shape → Elements → Palette (2026-10-28) */
.parts-list { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0; margin: 1rem 0 .4rem; }
.part { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--crease); border-radius: 12px; background: var(--sheet); color: var(--ink); font: 600 1rem var(--sans); cursor: pointer; transition: box-shadow .15s, background .15s; }
.part:hover:not(:disabled) { box-shadow: 0 6px 16px rgba(16,43,69,.08); }
.part-num { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; background: var(--paper); border: 1px solid var(--crease); color: var(--ink-soft); }
.part.on { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal); background: var(--teal-wash); }
.part.on .part-num { background: var(--teal); border-color: var(--teal); color: #fff; }
.part.done .part-num { background: var(--teal-wash); border-color: var(--teal); color: var(--teal-deep); }
.part:disabled { opacity: .45; cursor: not-allowed; }
.part-title { font-family: var(--serif); font-weight: 400; font-size: 1.6rem; margin: 1.2rem 0 .1rem; }
.summary { list-style: none; padding: 0; margin: .4rem 0 1rem; display: grid; gap: 6px; }
.summary li { display: flex; gap: 10px; font-size: .95rem; }
.summary b { min-width: 76px; color: var(--ink-soft); font-weight: 600; }
.g-desc { font-size: .8rem; color: var(--ink-soft); padding: 2px 4px 0; line-height: 1.35; }
.fine { margin-top: 1.4rem; padding: 4px 16px 14px; border: 1px dashed var(--crease); border-radius: 12px; }
.fine .label.first { margin-top: .8rem; }
.palettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 1rem; }
.palette { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--crease-soft); border-radius: 12px; background: var(--sheet); color: var(--ink); font: 500 .95rem var(--sans); text-align: left; cursor: pointer; }
.palette.on { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal); }
.palette-dots { display: flex; flex: none; padding-left: 6px; }
.palette-dots span { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--sheet); box-shadow: 0 0 0 1px var(--crease); margin-left: -6px; }
@media (max-width: 520px) {
  .part { flex-direction: column; gap: 4px; padding: 10px 6px; font-size: .9rem; }
}

/* design gallery with three filters (2026-10-28) */
.filters { margin: 1.2rem 0 .4rem; }
.filter-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
/* (2026-10-29) a fourth button, Select decorations, for occasions that have them */
.filter-row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .filter-row.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.decor-ico { width: 26px; height: 26px; object-fit: contain; margin: -4px 0; }
.decor-switch { display: grid; gap: 8px; margin: .2rem 0 .8rem; }
.filter-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 10px; border: 1px solid var(--crease); border-radius: 12px; background: var(--sheet); color: var(--ink); cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.filter-btn:hover { border-color: var(--teal); box-shadow: 0 6px 16px rgba(16,43,69,.08); }
.filter-name { font-weight: 600; }
.filter-value { font-size: .82rem; color: var(--ink-soft); }
.filter-btn.set { border-color: var(--teal); background: var(--teal-wash); }
.filter-btn.set .filter-value { color: var(--teal-deep); font-weight: 600; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--crease); border-radius: 999px; background: var(--sheet); color: var(--ink); cursor: pointer; font-size: .95rem; }
.opt:hover { border-color: var(--teal); }
.opt.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.opt.on .palette-dots span { border-color: var(--teal); }
.opt.back { border-color: transparent; background: transparent; color: var(--teal-deep); }
.opt.back:hover { background: var(--teal-wash); }
.gallery.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .gallery.six { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .filter-row { gap: 6px; } .filter-btn { padding: 10px 6px; } .filter-name { font-size: .88rem; } }
.more-row { display: flex; justify-content: center; margin-top: 1.4rem; }
.pal-line { display: inline-flex; align-items: center; gap: 10px; }
.pal-line .palette-dots span { width: 18px; height: 18px; }
.detail-side h2 { margin-bottom: .3rem; }

/* the gallery fits on one screen (2026-10-28): each card is sized from the screen's width and height */
.gal-lede { margin-bottom: .6rem; }
.gallery.six {
  --cols: 3; --rows: 2; --gap: 12px; --chrome: 440px; --text: 62px;
  --cell: min(calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)), calc((100svh - var(--chrome) - (var(--rows) - 1) * var(--gap)) / var(--rows) - var(--text)));
  grid-template-columns: repeat(var(--cols), max(110px, var(--cell)));
  justify-content: center; gap: var(--gap); margin-top: .8rem;
}
.gallery.six .g-name, .gallery.six .g-shape { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* wide, landscape screens: all six in one row */
@media (min-width: 900px) and (min-aspect-ratio: 3/2) { .gallery.six { --cols: 6; --rows: 1; } }
@media (max-width: 640px) {
  .gal-lede { display: none; }
  .gallery.six { --cols: 3; --rows: 2; --gap: 8px; --chrome: 360px; --text: 44px; grid-template-columns: repeat(3, max(80px, var(--cell))); }
  .gallery.six .g-card { padding: 5px 5px 8px; }
  .gallery.six .g-img { margin-bottom: 5px; }
  .gallery.six .g-name { font-size: .95rem; padding: 0 2px; }
  .gallery.six .g-shape { font-size: .72rem; padding: 0 2px; }
}
.more-row { margin-top: .9rem; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-count { font-size: .85rem; color: var(--ink-soft); }

/* bigger ornaments in the gallery (2026-10-28): small header and text, the cards sized by fitGallery in flow.js */
.snap-stage { width: 560px; height: 560px; }
.gal-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin-bottom: .2rem; }
.gal-head h1 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin: 0; }
.gal-head .eyebrow { margin: 0; }
.filters { margin: .6rem 0 0; }
.filter-btn { flex-direction: row; justify-content: center; flex-wrap: wrap; gap: 2px 8px; padding: 7px 10px; }
.filter-name { font-size: .9rem; }
.filter-value { font-size: .78rem; }
.opts { gap: 6px; }
.opt { min-height: 36px; padding: 5px 13px; font-size: .88rem; }
.gallery.six {
  grid-template-columns: repeat(var(--cols, 3), var(--cell, minmax(0, 1fr)));
  gap: var(--gap, 12px); justify-content: center; margin-top: .7rem;
  width: min(100vw - 40px, 1600px); margin-left: calc(50% - min(50vw - 20px, 800px));
}
.gallery.six .g-card { padding: 4px 4px 6px; border-radius: 10px; }
.gallery.six .g-img { margin-bottom: 3px; border-radius: 7px; }
.gallery.six .g-name { font-family: var(--sans); font-size: .8rem; font-weight: 600; line-height: 1.25; padding: 0 3px; }
.gallery.six .g-shape { font-size: .7rem; line-height: 1.25; padding: 0 3px; }
.more-row { margin-top: .6rem; }
@media (max-width: 640px) {
  .gallery.six { width: calc(100vw - 24px); margin-left: calc(50% - (50vw - 12px)); }
  .gallery.six .g-card { padding: 3px 3px 5px; }
  .gallery.six .g-name { font-size: .74rem; }
  .gallery.six .g-shape { font-size: .64rem; }
  .filter-btn { padding: 6px 4px; }
}

/* ---------- one column (phones), 2026-10-28 ----------
   Each 3D / face step fits the screen with no page scrolling: the ornament takes at most about 40% of the
   height, the panel below fills the rest, and its title and Done / Next buttons come first and stay put
   (anything longer scrolls inside the panel, under them). Pages without the ornament keep their buttons
   pinned to the bottom of the screen instead. */
@media (max-width: 820px) {
  .view:has(> .work) { padding: 8px 12px 0; }
  .work { height: calc(100vh - var(--chrome-top, 96px) - 10px); height: calc(100dvh - var(--chrome-top, 96px) - 10px);
    grid-template-rows: auto minmax(0, 1fr); gap: 10px; }
  .work .stage-wrap { max-height: 40vh; max-height: 40dvh; border-radius: 10px; }
  .work .stage-hint { font-size: .72rem; bottom: 6px; }
  .work .stage-hint.static { display: none; }
  .work .face-stack { width: auto; max-width: 100%; }
  .work .face-canvas { width: auto; max-width: 100%; max-height: 40vh; max-height: 40dvh; }
  .work .inside-card { max-height: 34vh; max-height: 34dvh; overflow: hidden; display: flex; justify-content: center; }
  .work .inside-preview { width: auto; max-width: 100%; max-height: 34vh; max-height: 34dvh; }
  .work-side { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 0 12px; }
  .work-side > .eyebrow, .work-side > h1, .work-side > .side-head { order: -2; }
  .work-side > h1 { font-size: 1.45rem; margin-bottom: .3rem; }
  .work-side > .eyebrow { margin-bottom: .1rem; }
  .work-side > .actions { order: -1; position: sticky; top: 0; z-index: 3; margin: 0 0 .5rem; padding: 4px 0 6px; gap: 8px;
    background: var(--paper); box-shadow: 0 6px 8px -8px rgba(16,43,69,.25); }
  .work-side > .actions .btn { min-height: 40px; padding: 8px 14px; }
  .work-side > .side-head { position: sticky; top: 0; z-index: 3; background: var(--paper); padding-bottom: 4px; }
  .side-head h1 { font-size: 1.4rem; }
  .work-side .lede { font-size: .95rem; margin: 0 0 .4rem; }
  .work-side .note { margin: 0 0 .4rem; }
  .compact .edit-tools, .work-side .edit-tools { margin-top: .4rem; }
  /* pages without the ornament: the main buttons stay pinned to the bottom of the screen */
  .view > .actions { position: sticky; bottom: 0; z-index: 3; margin: 1rem -12px 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: var(--paper); box-shadow: 0 -6px 10px -8px rgba(16,43,69,.25); }
  .view:has(> .actions) { padding-bottom: 0; }
}
@media (max-width: 760px) {
  /* the design's info under the gallery: Select this design / Back to gallery stay on screen */
  .detail-card .stage-wrap { max-height: 42vh; max-height: 42dvh; }
  .detail-side .actions { position: sticky; bottom: 0; z-index: 3; margin: .8rem 0 0; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: var(--paper); }
}

/* "that face can't be chosen" pop-up (2026-10-28) */
dialog.msg-pop { border: 0; border-radius: 14px; padding: 22px 22px 18px; width: min(420px, calc(100vw - 32px)); background: var(--sheet); color: var(--ink); box-shadow: 0 20px 60px rgba(16,43,69,.3); }
dialog.msg-pop::backdrop { background: rgba(16,43,69,.35); }
.msg-text { margin: 0 0 14px; font-size: 1.02rem; line-height: 1.45; }
.msg-off { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--ink-soft); cursor: pointer; }
.msg-off input { width: 18px; height: 18px; accent-color: var(--teal); margin: 0; }
.msg-btns { display: flex; justify-content: flex-end; margin-top: 16px; }
.msg-btns .btn { min-width: 96px; }
.menu-item[aria-pressed] strong { font-weight: 600; }

/* warnings over the 3D ornament, fading away (2026-10-28) */
.stage-flash { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; width: max-content; max-width: min(340px, calc(100% - 32px));
  padding: 12px 16px; border-radius: 10px; background: rgba(16,43,69,.9); color: #fff; font-size: .95rem; line-height: 1.4; text-align: center;
  box-shadow: 0 10px 30px rgba(16,43,69,.3); pointer-events: none; animation: flash-in .2s ease-out; transition: opacity .8s ease; }
.stage-flash.fade { opacity: 0; }
@keyframes flash-in { from { opacity: 0; transform: translate(-50%, -46%); } }
@media (prefers-reduced-motion: reduce) { .stage-flash { animation: none; } }

/* Done in the top right corner of the ornament's space (2026-10-28) */
.face-holder .stage-done { position: absolute; top: 10px; right: 10px; z-index: 6; min-height: 40px; padding: 8px 20px; box-shadow: 0 4px 14px rgba(16,43,69,.22); cursor: pointer !important; }
@media (max-width: 820px) { .face-holder .stage-done { top: 8px; right: 8px; min-height: 36px; padding: 6px 16px; } }
.xy .btn.small { margin-left: auto; flex: none; }
@media (max-width: 400px) { .xy { gap: 10px; } .xy .btn.small { padding: 6px 10px; } }

/* (2026-10-29) titles sit higher on every page: less space above the content and the side panel */
.view { padding-top: 8px; }
.view:has(> .fit-page) { padding-top: 8px; }
.work-side, .work-side.compact { padding-top: 0; }
.view > h1:first-child, .work-side > h1:first-child, .work-side > .eyebrow:first-child, .side-head h1, .gal-head h1, .cat-head h1 { margin-top: -.12em; }
.work { margin-top: 0; }
/* Details: the faces to change, with All first */
.face-pick { margin: .5rem 0 .2rem; gap: 6px; }
.face-pick .chip.all { font-weight: 600; }
.sub-tabs { margin-bottom: .2rem; }

/* Details color choosers (2026-10-29): the palette's colors first, set apart in their own band */
.color-pick .pal-name { font-weight: 400; color: var(--ink-soft); }
.color-pick .pal-swatches { padding: 8px 10px; border: 1px solid var(--crease); border-radius: 12px; background: var(--sheet); width: fit-content; max-width: 100%; }

/* Finish page checklist (2026-10-29): what is done and what isn't, from the steps before it */
.finish-side h2 { font-size: 1.25rem; margin: 1rem 0 .4rem; }
.finish-side h3 { font-family: var(--sans); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--teal-deep); margin: .9rem 0 .2rem; }
.ck-progress { height: 8px; border-radius: 999px; background: var(--crease-soft); overflow: hidden; margin: .2rem 0 .35rem; }
.ck-progress > span { display: block; height: 100%; background: var(--teal); border-radius: 999px; transition: width .4s; }
.ck-count { font-size: .9rem; color: var(--ink-soft); margin: 0 0 .6rem; }
.ck-list { list-style: none; margin: 0; padding: 0; }
.ck-item { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--crease-soft); }
.ck-item:last-child { border-bottom: 0; }
.ck-mark { width: 20px; height: 20px; margin-top: 2px; border-radius: 5px; border: 1.5px solid var(--crease); display: grid; place-items: center; font-size: .8rem; font-weight: 700; line-height: 1; }
.ck-item.ok .ck-mark { background: var(--teal); border-color: var(--teal); color: #fff; }
.ck-item.need .ck-mark { border-color: var(--danger); }
.ck-title { font-weight: 500; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.ck-item.ok .ck-title { color: var(--ink-soft); font-weight: 400; }
.ck-step { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); flex-basis: 100%; }
.ck-tag { font-size: .7rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--crease-soft); color: var(--ink-soft); }
.ck-tag.need { background: var(--ember-wash); color: var(--danger); }
.ck-note { font-size: .88rem; color: var(--ink-soft); }
.ck-fix { display: flex; flex-wrap: wrap; gap: 6px; margin-top: .4rem; }
.ck-go { font-size: .85rem; margin-top: .15rem; }
.ck-open { background: var(--gold-wash); border-radius: var(--radius); padding: 2px 14px 6px; margin-bottom: .8rem; }
.ck-open h2 { margin-top: .6rem; }
.ck-unvisited { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink-faint); margin-left: 8px; }
.ck-all { margin-top: .4rem; }

/* Choose a design: the instructions, then their ? tooltip (2026-11-02) */
.gal-hint { font-size: .9rem; color: var(--ink-soft); line-height: 1.3; }
.gal-tip { position: relative; align-self: center; width: 22px; height: 22px; padding: 0; border: 1px solid var(--crease); border-radius: 50%; background: var(--sheet); color: var(--ink-soft); font-size: .8rem; line-height: 1; cursor: help; }
.gal-tip-text { display: none; position: absolute; left: 0; top: calc(100% + 6px); z-index: 20; width: min(280px, 70vw); padding: 8px 10px; background: var(--ink); color: #fff; border-radius: 8px; font-size: .85rem; line-height: 1.35; text-align: left; font-weight: 400; }
.gal-tip:hover .gal-tip-text, .gal-tip.open .gal-tip-text { display: block; }
@media (max-width: 640px) {
  .more-row { gap: 6px; }
  .more-row .page-count { display: none; }
  .more-row .btn.small { padding: 6px 10px; font-size: .8rem; white-space: nowrap; }
}
