/* The web editor. Same paper and leather as the site; the card is the subject. */
.maker { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 460px); justify-content: center; gap: 72px; align-items: start; padding-bottom: 96px; }

/* ---------- the card ---------- */
.stage { position: sticky; top: 24px; display: grid; gap: 18px; }
.card { position: relative; width: 100%; aspect-ratio: 369 / 513; border-radius: 3.79% / 2.73%; container-type: inline-size; overflow: hidden; background: var(--print); box-shadow: 0 1px 2px rgb(52 38 29 / .12), 0 18px 40px -18px rgb(52 38 29 / .45); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.card canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.card-strip { position: absolute; left: 0; right: 0; bottom: 0; height: calc(85 / 513 * 100%); display: flex; align-items: center; padding: 0 calc(16 / 369 * 100cqw); pointer-events: none; }
.card[data-layout="full"] .card-strip { background: rgb(255 255 255 / .16); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); }
.card-caption { font: calc(20 / 369 * 100cqw) / 1.2 var(--mono); padding-top: calc(14 / 369 * 100cqw); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--caption, #1f1f1f); }
.card-empty { position: absolute; inset: calc(20 / 369 * 100cqw) calc(20 / 369 * 100cqw) calc(85 / 513 * 100%); display: grid; place-content: center; justify-items: center; gap: 10px; border: 0; background: var(--desk); color: var(--muted); font-size: 16px; font-weight: 600; }
.card[data-layout="full"] .card-empty { inset: 0 0 calc(85 / 513 * 100%); }
.card-empty svg { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.card.has-photo .card-empty { display: none; }
.card.reframing { touch-action: none; cursor: grab; outline: 3px solid var(--leather); outline-offset: 4px; }
.card.reframing:active { cursor: grabbing; }

.photo-actions, .reframe-bar { display: flex; justify-content: center; gap: 10px; }
.reframe-bar { align-items: center; gap: 16px; }
.zoom { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 280px; color: var(--muted); }
.zoom svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.zoom input { flex: 1; accent-color: var(--leather); }

.pill { min-height: 40px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--print); font-size: 15px; font-weight: 600; }
.pill.primary { background: var(--leather); border-color: var(--leather); color: #fff; }
.pill:disabled { opacity: .45; }

.filters { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter { flex: none; display: grid; gap: 6px; justify-items: center; scroll-snap-align: start; border: 0; background: none; padding: 0; font-size: 12px; color: var(--muted); }
.filter canvas { width: 64px; height: 64px; border-radius: 10px; outline: 2px solid transparent; outline-offset: 2px; }
.filter[aria-checked="true"] { color: var(--ink); font-weight: 600; }
.filter[aria-checked="true"] canvas { outline-color: var(--leather); }

/* ---------- the form ---------- */
.panel { display: grid; gap: 34px; padding-top: 6px; }
.group { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 10px; }
.group h2 { font-size: 13px; font-family: var(--sans); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hint { font-size: 14px; line-height: 1.45; color: var(--muted); }
.hint.above { margin-top: -4px; }

.fields { display: grid; background: var(--print); border-radius: 14px; box-shadow: 0 0 0 1px rgb(200 184 165 / .55); overflow: hidden; }
.fields:empty { display: none; }
.fields > * + * { border-top: 1px solid rgb(200 184 165 / .55); }
.fields input, .fields textarea, .fields select { width: 100%; border: 0; background: transparent; padding: 14px 16px; color: var(--ink); font: inherit; resize: vertical; }
.fields input::placeholder, .fields textarea::placeholder { color: #a8968a; }
.fields :is(input, textarea, select):focus-visible { outline: 2px solid var(--leather); outline-offset: -2px; }
.fields label { display: block; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; border-radius: 14px; background: var(--desk); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: grid; place-items: center; min-height: 48px; border-radius: 11px; font-weight: 600; color: var(--muted); cursor: pointer; }
.segmented input:checked + span { background: var(--print); color: var(--ink); box-shadow: 0 1px 3px rgb(52 38 29 / .12); }
.segmented input:focus-visible + span { outline: 3px solid var(--leather); outline-offset: 2px; }

.row { display: flex; align-items: center; gap: 8px; padding-right: 8px; }
.row > span { padding-left: 16px; white-space: nowrap; }
.row select { width: auto; padding-inline: 8px; }
.row .grow { flex: 1; }
.remove { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 22px; line-height: 1; }
.remove:hover { background: var(--desk); }
.place { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 10px 8px 0 16px; }
.place strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place input { grid-column: 1 / -1; padding: 4px 0 12px; font-size: 15px; }

.add-row { justify-self: start; display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 6px 2px; color: var(--leather); font-weight: 600; }
.add-row svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.place-search { display: grid; gap: 8px; }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--print); box-shadow: 0 0 0 1px var(--line); color: var(--ink); }
.link { justify-self: start; border: 0; background: none; padding: 4px 0; color: var(--leather); font-size: 15px; font-weight: 600; }
.results { list-style: none; margin: 0; padding: 0; display: grid; background: var(--print); border-radius: 14px; box-shadow: 0 0 0 1px rgb(200 184 165 / .55); overflow: hidden; }
.results:empty { display: none; }
.results li + li { border-top: 1px solid rgb(200 184 165 / .55); }
.results button { width: 100%; text-align: left; border: 0; background: none; padding: 11px 16px; display: grid; line-height: 1.35; }
.results button:hover { background: var(--desk); }
.results small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.add-bar { display: grid; gap: 10px; justify-items: center; }
.add { width: 100%; min-height: 54px; border: 0; border-radius: 14px; background: #000; color: #fff; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.add:disabled { opacity: .35; }
.handoff { width: 100%; display: grid; gap: 12px; padding: 16px; border-radius: 14px; background: var(--print); box-shadow: 0 0 0 1px rgb(200 184 165 / .55); text-align: center; font-size: 15px; line-height: 1.45; }
.handoff-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.handoff a.pill { display: inline-grid; place-items: center; text-decoration: none; }
.status { font-size: 15px; color: var(--muted); min-height: 1lh; text-align: center; }
.status.error { color: #a1321b; }

@media (max-width: 860px) {
  .maker { grid-template-columns: minmax(0, 420px); gap: 36px; }
  .stage { position: static; }
  .card { width: min(100%, 360px); justify-self: center; }
  .add-bar { position: sticky; bottom: 0; margin: 0 -24px; padding: 14px 24px calc(10px + env(safe-area-inset-bottom)); background: rgb(246 239 228 / .9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
}
@media (max-width: 760px) {
  .maker.page-width { width: calc(100% - 48px); }
}
#ready:not([hidden]) ~ #elsewhere { display: none; }
