/* Editor page (/create). Uses ui.css tokens. */
.ed { display: grid; grid-template-columns: minmax(340px, 440px) minmax(0, 1fr); gap: 0; min-height: calc(100vh - 64px); padding-bottom: 84px; }
.ed-left { padding: 26px 24px 24px; border-right: 1px solid var(--line); display: grid; gap: 16px; align-content: start; min-width: 0; }
.ed-head h1 { margin: 0 0 4px; font: 700 28px/1.1 var(--display); letter-spacing: -.02em; }
.ed-head p { margin: 0; font-size: 14px; }
.ed-view { display: none; }

.tpl-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.template-heading { margin: 0; color: var(--m); font-size: 12px; font-weight: 600; }
.template-group { display: grid; grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); grid-auto-columns: unset; gap: 10px; overflow: visible; padding: 3px 3px 8px; scrollbar-width: thin; }
.tpl { position: relative; display: grid; gap: 6px; cursor: pointer; }
.tpl input { position: absolute; opacity: 0; pointer-events: none; }
.tpl .tpl-shot { width: 100%; height: 120px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--s2); }
.tpl .tpl-shot iframe { width: 480px; height: 600px; transform: scale(.2); transform-origin: 0 0; border: 0; pointer-events: none; }
.tpl span { font-size: 13px; color: var(--m); text-align: center; }
.tpl input:checked + .tpl-shot { border-color: #f7931a; box-shadow: 0 0 0 2px #f7931a; }
.tpl input:checked ~ span { color: var(--t); font-weight: 600; }
.tpl input:focus-visible + .tpl-shot { outline: 2px solid var(--acc); outline-offset: 2px; }

.ed-form { display: grid; gap: 14px; }
.links { display: grid; gap: 8px; margin-bottom: 10px; }
.link-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 32px; gap: 8px; align-items: center; }
.link-row input { min-height: 40px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--s2); font-size: 14px; width: 100%; }
.link-row button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--s3); color: var(--m); cursor: pointer; }
.link-row button:hover { color: var(--t); }
.more summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: "+"; float: right; color: var(--m); }
.more[open] summary::after { content: "–"; }
.more-body { margin-top: 14px; }
.more .row { display: flex; gap: 8px; }
.ed-aux { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.link-options, #link-editor, .blocks { display: grid; gap: 16px; min-width: 0; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle input { accent-color: var(--acc); width: 18px; height: 18px; }
.swatches { display: flex; gap: 12px; }
.swatch { width: 36px; height: 36px; border: 1px solid var(--line2); border-radius: 50%; cursor: pointer; }
.swatch[aria-pressed="true"] { outline: 2px solid var(--t); outline-offset: 3px; }
.social-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto 32px; gap: 4px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.social-row .field { margin: 0; min-width: 0; }
.social-row .field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.social-row .seg button, .social-row > button { padding: 6px; }
.social-row .seg { gap: 0; }
.platform-icon svg { width: 24px; height: 24px; fill: currentColor; }
.block-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 16px; }
.block-summary { cursor: pointer; min-height: 44px; }
.block-title { margin-left: 8px; overflow-wrap: anywhere; }
.block-count { display: block; color: var(--m); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.block-body { padding-top: 16px; }
.blocks > h3 { margin: 8px 0 0; }
.block-link, .bio-row { padding: 14px 0; border-top: 1px solid var(--line); }
.block-card .b { margin: 4px 4px 4px 0; }
.block-thumbnail { display: block; width: 64px; height: 64px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; }
.block-link .seg { width: fit-content; margin-block: 8px; }
.media-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.media-controls .block-thumbnail { margin: 0; }
.media-id { margin-block: 8px 16px; }
.media-id summary { cursor: pointer; min-height: 44px; display: list-item; align-content: center; font-size: 13px; color: var(--m); }
.editor-gallery { display: grid; grid-template-columns: repeat(auto-fill, 64px); gap: 16px; margin-block: 12px; }
.gallery-item { position: relative; }
.gallery-item .block-thumbnail { margin: 0; }
.gallery-actions { display: flex; position: absolute; bottom: 0; left: 0; opacity: 0; }
.gallery-item:hover .gallery-actions, .gallery-item:focus-within .gallery-actions { opacity: 1; }
.gallery-actions .b { width: 22px; min-height: 28px; padding: 0; margin: 0; background: var(--s2); }
#avatar-thumbs .thumb { width: auto; height: auto; display: flex; align-items: center; gap: 8px; overflow: visible; border: 0; }
#avatar-thumbs .thumb img { width: 64px; height: 64px; border-radius: 8px; }
#avatar-thumbs .thumb button { position: static; width: auto; height: auto; min-height: 44px; padding: 8px; border-radius: 8px; }
.ed-form :is(button, input, textarea, select, summary):focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }
@media (max-width: 600px), (hover: none) {
  .ed-form :is(button, input, select) { min-height: 44px; }
  .ed-form button { min-width: 44px; }
  .social-row { grid-template-columns: 20px minmax(0, 1fr) auto 44px; }
  .platform-icon svg { width: 20px; }
  .editor-gallery { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
  .gallery-item .block-thumbnail { margin-inline: auto; }
  .gallery-actions { position: static; opacity: 1; justify-content: center; }
  .gallery-actions .b { width: 44px; min-height: 44px; }
}
.address-prefill { padding: 16px 0; border-top: 1px solid var(--line); }
.address-prefill .row { display: flex; gap: 8px; align-items: center; }
.address-prefill input { min-width: 0; }

.ed-right { position: sticky; top: 64px; height: calc(100vh - 64px - 84px); display: grid; grid-template-rows: auto minmax(0, 1fr); background: var(--s1); min-width: 0; }
.pv-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.pv-frame { display: grid; place-items: center; padding: 18px; min-height: 0; }
.pv-frame iframe { width: 100%; height: 100%; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.pv-frame[data-width="mobile"] iframe { width: 390px; max-width: 100%; }

.pubbar { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 14px; padding: 14px 24px calc(14px + env(safe-area-inset-bottom, 0px)); background: rgba(14,14,14,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.pubbar-text { display: grid; min-width: 0; margin-right: auto; }
.pubbar-text #pub-target { font-weight: 600; overflow-wrap: anywhere; }
.pubbar-text #pub-estimate { font-size: 13.5px; }
.pub-names { width: auto; min-height: 40px; }
.pubbar .b { min-width: 140px; }
.d-link { overflow-wrap: anywhere; margin: 0; }
.d-more summary { cursor: pointer; margin-top: 6px; }
.d-more .breakdown { margin-top: 10px; }

@media (max-width: 900px) {
  .ed { grid-template-columns: minmax(0, 1fr); }
  .ed-left { border-right: 0; padding: 20px 16px; }
  .ed-view { display: inline-flex; justify-self: start; }
  .ed-right { position: static; height: 72vh; display: none; }
  .ed[data-view="preview"] .ed-right { display: grid; }
  .ed[data-view="preview"] .ed-form { display: none; }
  .pubbar { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .pubbar .b { min-width: 0; }
}
/* Grid children default to their content's width: keep every editor column inside the screen. */
.ed-left, .ed-form, .block-list, .block-card, .block-body { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.ed-form > *, .block-card > * { min-width: 0; }

.ed-left, .ed-form { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
body:has(#pubbar) .ui-foot { display: none; }
#bio, #link-about textarea { min-height: 9em; }
.field input[type=color] { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; }
.color-value { font-family: var(--mono); margin-left: 10px; }
.link-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 44px; }
.link-row button, .social-row > button { width: 44px; height: 44px; }
.toggle { min-height: 44px; }
.toggle input { width: 22px; height: 22px; }
#avatar-thumbs .thumb { display: flex; width: auto; height: auto; gap: 8px; align-items: center; overflow: visible; }
#avatar-thumbs .thumb img { width: 64px; height: 64px; border-radius: 8px; }
#avatar-thumbs .thumb button { position: static; min-width: 64px; height: 44px; }
.pv-frame { overflow: auto; align-items: start; }
.pv-frame iframe { min-height: 100%; height: 1100px; }
.pv-head .hint.mono { margin-left: auto; line-height: 36px; }
.pubbar { flex-wrap: nowrap; }
@media (hover: none) { .editor-gallery { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); } .gallery-actions { opacity: 1; position: static; display: flex; gap: 8px; } .gallery-actions .b { width: 44px; min-height: 44px; } }
@media (max-width: 520px) { .social-row { grid-template-columns: 1fr auto; } .social-row .field { grid-column: 1 / -1; } .pubbar-text { font-size: 13px; } .pubbar-text #pub-target { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .pubbar { gap: 8px; padding-inline: 12px; } .pubbar .b { padding-inline: 12px; font-size: 13px; } }
.launch-waitlist { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.launch-waitlist[hidden] { display: none; }
.launch-waitlist input { flex: 1; min-width: 180px; }
.launch-waitlist [role="status"] { flex-basis: 100%; font-size: 12px; overflow-wrap: anywhere; }
body:has(.launch-waitlist:not([hidden])) .ed { padding-bottom: 160px; }
@media (max-width: 640px) { .pubbar:has(.launch-waitlist:not([hidden])) { flex-wrap: wrap; } .launch-waitlist { width: 100%; } }
