/* Website editor. The page is the editor: a large live preview on the canvas, and the fields for the part
   being changed in the side column (a bottom sheet on a phone). Tokens come from studio-tokens.css. */

/* ---------- Side column: Edit | Chat ---------- */
#studio .studio-chat.has-tabs { grid-template-rows: 72px auto minmax(0, 1fr) auto auto; }
#studio .side-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 16px 27px 0; padding: 4px; border-radius: 999px; background: rgba(40, 38, 34, .07); }
#studio .side-tabs button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: none; font: 600 14px/1 "DM Sans", sans-serif; color: var(--ep-ink-2); }
#studio .side-tabs button[aria-selected="true"] { background: #fff; color: var(--ep-ink); box-shadow: 0 1px 2px rgba(40, 38, 34, .14); }
#studio .side-dot { display: inline-block; width: 7px; height: 7px; margin-left: 7px; border-radius: 50%; background: #b8452c; vertical-align: 1px; }
#studio .studio-side { min-height: 0; overflow: auto; padding: 18px 27px 26px; scrollbar-gutter: stable; }
#studio .studio-chat.side-edit .studio-composer { margin-top: 0; box-shadow: 0 -10px 16px -6px #f7f6f2; }

/* ---------- Panel ---------- */
#studio .ed-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; min-width: 0; font: 400 14px/1.45 "DM Sans", sans-serif; color: var(--ep-ink); }
#studio .ed-panel svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#studio .ed-panel button { cursor: pointer; }
#studio .ed-label { margin: 8px 0 -4px; font: 600 12px/1 "DM Sans", sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--ep-ink-2); }
#studio .ed-help { margin: -6px 0 0; font-size: 13px; line-height: 1.4; color: var(--ep-ink-2); }

/* Page list */
#studio .ed-pages { list-style: none; margin: 0; padding: 0; border: 1px solid var(--ep-line); border-radius: var(--ep-r-md); background: #fff; overflow: hidden; }
#studio .ed-page { position: relative; display: flex; align-items: center; gap: 10px; padding-right: 10px; border-top: 1px solid var(--ep-line); }
#studio .ed-page:first-child { border-top: 0; }
#studio .ed-page:hover { background: var(--ep-neutral); }
#studio .ed-page .ed-pick { flex: 1; min-width: 0; display: grid; gap: 2px; min-height: 58px; padding: 10px 0 10px 14px; border: 0; border-radius: 0; background: none; text-align: left; color: inherit; }
#studio .ed-page .ed-pick::after { content: ""; position: absolute; inset: 0; }
#studio .ed-page .ed-pick b { font: 600 15px/1.25 "DM Sans", sans-serif; }
#studio .ed-page .ed-pick small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ep-ink-2); }
#studio .ed-page.is-off .ed-pick b { color: var(--ep-ink-2); }
#studio .ed-go { display: grid; color: rgba(40, 38, 34, .45); pointer-events: none; }

/* Switch */
#studio .ed-toggle { position: relative; z-index: 1; flex: none; width: 38px; height: 22px; min-height: 0; padding: 0; border: 0; border-radius: 999px; background: rgba(40, 38, 34, .24); transition: background .15s; }
#studio .ed-toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
#studio .ed-toggle[aria-checked="true"] { background: var(--ep-success); }
#studio .ed-toggle[aria-checked="true"]::after { transform: translateX(16px); }

/* Notes to check */
#studio .ed-review { display: flex; align-items: flex-start; gap: 10px; width: 100%; min-height: 0; margin: 0; padding: 12px 14px; border: 0; border-radius: 12px; background: var(--ep-warn-bg); color: var(--ep-warn); text-align: left; font: 400 13.5px/1.4 "DM Sans", sans-serif; }
#studio .ed-review b { display: block; font-weight: 600; }
#studio .ed-review svg { width: 18px; height: 18px; margin-top: 1px; }

/* One page */
#studio .ed-detail-head { display: grid; gap: 12px; }
#studio .ed-back { justify-self: start; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 14px 0 8px; border: 0; border-radius: 999px; background: rgba(40, 38, 34, .07); font: 600 13px/1 "DM Sans", sans-serif; color: var(--ep-ink); }
#studio .ed-back:hover { background: rgba(40, 38, 34, .12); }
#studio .ed-detail-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#studio .ed-detail-title h2 { margin: 0; min-width: 0; font: 400 28px/1.15 "Hedvig Letters Serif", Georgia, serif; letter-spacing: -.01em; overflow-wrap: anywhere; }
#studio .ed-show { display: inline-flex; align-items: center; gap: 8px; flex: none; font-size: 13px; color: var(--ep-ink-2); }
#studio .ed-block { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--ep-line); border-radius: var(--ep-r-md); background: #fff; }
#studio .ed-block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; }
#studio .ed-block-head h3 { margin: 0; font: 600 15px/1.2 "DM Sans", sans-serif; }

/* Fields */
#studio .ed-panel .ed-field { margin: 0; gap: 5px; }
#studio .ed-panel .ed-field :is(input:not([type=range]), textarea, select) { min-height: 42px; padding: 9px 12px; border-radius: 10px; background: #fff; font: 400 15px/1.4 "DM Sans", sans-serif; color: var(--ep-ink); }
#studio .ed-panel .ed-field textarea { resize: vertical; }
#studio .ed-panel .ed-field input[type=range] { width: 100%; accent-color: var(--ep-success); }
#studio .ed-panel .ed-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
#studio .ed-panel .ed-row--time { grid-template-columns: 104px minmax(0, 1fr); }

/* Folded lists */
#studio .ed-items { display: grid; grid-template-columns: minmax(0, 1fr); border: 1px solid var(--ep-line); border-radius: 12px; overflow: hidden; }
#studio .ed-items:empty { display: none; }
#studio .ed-item + .ed-item { border-top: 1px solid var(--ep-line); }
#studio .ed-item > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 46px; padding: 6px 12px 6px 14px; list-style: none; cursor: pointer; font-weight: 500; }
#studio .ed-item > summary::-webkit-details-marker { display: none; }
#studio .ed-item > summary:hover, #studio .ed-item[open] > summary { background: var(--ep-neutral); }
#studio .ed-item > summary svg { color: rgba(40, 38, 34, .45); transition: transform .15s; }
#studio .ed-item[open] > summary svg { transform: rotate(90deg); }
#studio .ed-item-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#studio .ed-item-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 14px; border-top: 1px solid var(--ep-line); }
#studio .ed-item-tools { display: flex; justify-content: flex-end; gap: 6px; }
#studio .ed-item-tools button { display: grid; place-items: center; width: 32px; height: 32px; min-height: 0; padding: 0; border: 1px solid var(--ep-line); border-radius: 8px; background: #fff; color: var(--ep-ink-2); }
#studio .ed-item-tools button:hover:not(:disabled) { border-color: var(--ep-line-strong); color: var(--ep-ink); }
#studio .ed-item-tools button.ed-remove:hover { border-color: #d9a69b; color: #a2392a; }
#studio .ed-item-tools button:disabled { opacity: .35; cursor: default; }

/* Buttons */
#studio .ed-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 16px; border: 1px solid var(--ep-line-strong); border-radius: 999px; background: var(--ep-surface); font: 600 13.5px/1 "DM Sans", sans-serif; color: var(--ep-ink); }
#studio .ed-btn:hover { background: var(--ep-neutral); }
#studio .ed-btn--quiet { border-color: transparent; background: none; color: var(--ep-ink-2); }
#studio .ed-btn-row { display: flex; flex-wrap: wrap; gap: 6px; }
#studio .ed-add { justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 16px 0 12px; border: 1px dashed var(--ep-line-strong); border-radius: 999px; background: none; font: 600 13.5px/1 "DM Sans", sans-serif; color: var(--ep-ink); }
#studio .ed-add:hover { border-style: solid; background: var(--ep-neutral); }
#studio .ed-add-block { display: grid; gap: 8px; padding-top: 4px; }
#studio .ed-add-block > span { font: 600 12px/1 "DM Sans", sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--ep-ink-2); }
#studio .ed-add-block > div { display: flex; flex-wrap: wrap; gap: 6px; }
#studio .ed-add-block button { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 13px 0 9px; border: 1px solid var(--ep-line); border-radius: 999px; background: #fff; font: 500 13px/1 "DM Sans", sans-serif; color: var(--ep-ink); }
#studio .ed-add-block button:hover { border-color: var(--ep-ink); }
#studio .ed-add-block button svg { width: 14px; height: 14px; }

/* Photos */
#studio .ed-photo { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; align-items: start; }
#studio .ed-photo img, #studio .ed-photo-empty { display: grid; place-items: center; width: 92px; height: 92px; object-fit: cover; border: 1px solid var(--ep-line); border-radius: 10px; background: var(--ep-neutral); color: rgba(40, 38, 34, .4); }
#studio .ed-photo-empty svg { width: 26px; height: 26px; stroke-width: 1.5; }
#studio .ed-photo-side { display: grid; gap: 10px; justify-items: start; min-width: 0; }
#studio .ed-photo-side .ed-field { width: 100%; }
#studio .ed-photo-side .ed-help { margin: 0; }
#studio .ed-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
#studio .ed-gallery figure { position: relative; margin: 0; aspect-ratio: 1; }
#studio .ed-gallery img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; }
#studio .ed-gallery figure button { position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 28px; height: 28px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: rgba(40, 38, 34, .78); color: #fff; }
#studio .ed-gallery figure button svg { width: 14px; height: 14px; }
#studio .ed-gallery-add { display: grid; place-content: center; justify-items: center; gap: 4px; aspect-ratio: 1; min-height: 0; padding: 0; border: 1px dashed var(--ep-line-strong); border-radius: 10px; background: none; font: 600 12px/1.2 "DM Sans", sans-serif; color: var(--ep-ink-2); }
#studio .ed-gallery-add:hover { border-style: solid; color: var(--ep-ink); }

/* Language and size switches */
#studio .ed-seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--ep-line); border-radius: 999px; background: var(--ep-neutral); }
#studio .ed-seg button { min-height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: none; font: 600 13px/1 "DM Sans", sans-serif; color: var(--ep-ink-2); cursor: pointer; }
#studio .ed-seg button[aria-pressed="true"] { background: var(--ep-ink); color: var(--ep-surface); }
#studio .ed-langs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#studio .ed-langs select { min-height: 40px; padding: 0 12px; border: 1px solid var(--ep-line-strong); border-radius: 999px; background: #fff; font: 600 13px/1 "DM Sans", sans-serif; color: var(--ep-ink); }

/* ---------- Canvas: the live page ---------- */
#studio .decision--editor { position: relative; }
#studio .decision--editor > p { margin-bottom: 14px; }
#studio .editor-v2 { display: block; }
#studio .ed-bar { position: absolute; top: 10px; right: 0; display: flex; align-items: center; gap: 8px; }
#studio .ed-stage { display: grid; height: max(320px, calc(100dvh - 288px)); border: 1px solid var(--ep-line); border-radius: 16px; background: #eceae4; overflow: hidden; }
#studio .editor-v2 .live-preview { display: block; width: 100%; height: 100%; min-height: 0; overflow: auto; border: 0; background: #fff; }
#studio .editor-v2.is-phone:not(.is-narrow) .ed-stage { place-items: center; padding: 20px 0; }
#studio .editor-v2.is-phone:not(.is-narrow) .live-preview { width: 392px; border: 1px solid var(--ep-line-strong); border-radius: 30px; box-shadow: 0 18px 44px rgba(40, 38, 34, .18); scrollbar-width: none; }

/* Narrow desktop: the switches drop below the title */
@media (min-width: 821px) and (max-width: 1260px) {
  #studio .editor-v2:not(.is-narrow) .ed-bar { position: static; margin: 0 0 12px; }
  #studio .editor-v2:not(.is-narrow) .ed-stage { height: max(300px, calc(100dvh - 340px)); }
}
@media (min-width: 1261px) and (max-width: 1420px) {
  #studio .nav-expanded .editor-v2:not(.is-narrow) .ed-bar { position: static; margin: 0 0 12px; }
  #studio .nav-expanded .editor-v2:not(.is-narrow) .ed-stage { height: max(300px, calc(100dvh - 340px)); }
}

/* ---------- Phone: the page fills the screen; fields open in a sheet ---------- */
#studio .editor-v2.is-narrow .ed-bar { position: sticky; top: 0; z-index: 3; justify-content: space-between; margin: 0 -16px 12px; padding: 8px 16px; border-bottom: 1px solid var(--ep-line); background: rgba(252, 252, 250, .94); backdrop-filter: blur(8px); }
#studio .editor-v2.is-narrow .ed-stage { height: auto; border-radius: 14px; }
#studio .editor-v2.is-narrow .live-preview { height: auto; overflow: visible; }
#studio .ed-pages-button { padding: 0 16px 0 12px; }
#studio .ed-pages-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
#studio .ed-sheet-shade { position: fixed; inset: 0; z-index: 40; background: rgba(40, 38, 34, .38); }
#studio .ed-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; height: 86dvh; overflow: auto; overscroll-behavior: contain; padding: 0 16px 32px; border-radius: 20px 20px 0 0; background: #f7f6f2; box-shadow: 0 -12px 40px rgba(0, 0, 0, .22); }
#studio .ed-sheet.is-new { animation: ed-sheet-in .24s cubic-bezier(.2, .8, .2, 1); }
#studio .ed-sheet-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: flex-end; min-height: 56px; margin: 0 -16px 6px; padding: 0 16px; background: #f7f6f2; }
#studio .ed-sheet-top i { position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: rgba(40, 38, 34, .2); }
#studio .ed-sheet-done { min-height: 36px; background: var(--ep-ink); border-color: var(--ep-ink); color: var(--ep-surface); }
#studio .ed-sheet .ed-field :is(input:not([type=range]), textarea, select) { font-size: 16px; } /* no zoom on focus in iOS */
#studio .ed-sheet .ed-item-tools button { width: 40px; height: 40px; }
@keyframes ed-sheet-in { from { transform: translateY(40%); opacity: .4; } }
@media (prefers-reduced-motion: reduce) { #studio .ed-sheet.is-new { animation: none; } #studio .ed-toggle, #studio .ed-toggle::after, #studio .ed-item > summary svg { transition: none; } }
@media (max-width: 820px) { #studio .decision--editor > p { margin-bottom: 10px; } }

/* Fonts: each choice shows the couple's names in that face */
.ed-fonts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: .4rem 0 .6rem; }
.ed-font { display: grid; gap: .2rem; justify-items: start; min-height: 4.2rem; padding: .7rem .8rem; border: 1px solid var(--line, #dcd9d2); border-radius: .7rem; background: #fff; color: inherit; text-align: left; cursor: pointer; }
.ed-font b { font-size: 1.2rem; font-weight: 400; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ed-font small { font-size: .78rem; opacity: .75; }
.ed-font[aria-pressed="true"] { border-color: #2f6b4f; box-shadow: inset 0 0 0 1px #2f6b4f; background: #f3f8f4; }
.ed-font:focus-visible { outline: 2px solid #2f6b4f; outline-offset: 2px; }
.ed-fonts-more summary { cursor: pointer; font-weight: 600; font-size: .9rem; padding: .3rem 0; }
.ed-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem .8rem; border: 1px solid var(--line, #dcd9d2); border-radius: .7rem; background: #fff; font-size: .92rem; }
/* Section blocks from docs/sections.md: hotels, moments, gift lists, gifts, cash funds, dress code. */
#studio .ed-sub { margin: 10px 0 0; font: 600 14px/1.3 "DM Sans", sans-serif; color: var(--ep-ink); }
#studio .ed-warn { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 12px 14px; border: 1px solid #e9d9a8; border-radius: 10px; background: #fffaf0; font: 400 14px/1.4 "DM Sans", sans-serif; color: var(--ep-ink); }
#studio .ed-warn .ed-btn { flex: none; }
#studio .ed-panel .ed-row--pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 36px; gap: 8px; align-items: end; padding: 8px 12px; }
#studio .ed-icon { display: grid; place-items: center; width: 36px; height: 42px; min-height: 0; padding: 0; border: 1px solid var(--ep-line); border-radius: 10px; background: #fff; color: var(--ep-ink-2); cursor: pointer; }
#studio .ed-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
#studio .ed-swatches { display: flex; align-items: center; gap: 10px; font: 600 13px/1 "DM Sans", sans-serif; color: var(--ep-ink-2); }
#studio .ed-swatches input[type=color] { width: 40px; height: 40px; padding: 2px; border: 1px solid var(--ep-line); border-radius: 10px; background: #fff; }
#studio .ed-more summary { cursor: pointer; font: 600 14px/1.3 "DM Sans", sans-serif; color: var(--ep-ink-2); }
#studio .ed-more[open] { display: grid; gap: 10px; }
#studio .reg-part { display: grid; gap: 12px; max-width: 972px; margin-bottom: 16px; }
#studio .reg-part .ws-btn { justify-self: start; }
#studio .reg-part-form.ed-panel { display: grid; gap: 12px; padding: 0; }
#studio .reg-part-title { max-width: 972px; margin: 22px 0 10px; font: 600 16px/1.3 "DM Sans", sans-serif; }
@media (max-width: 640px) { #studio .ed-panel .ed-row--pair { grid-template-columns: minmax(0, 1fr) 36px; } #studio .ed-panel .ed-row--pair > label:first-child { grid-column: 1 / -1; } }
#studio .reg-marks h3 { margin: 8px 0 6px; font: 600 14px/1.3 "DM Sans", sans-serif; }
#studio .reg-marks ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
#studio .reg-marks li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--ep-line); font: 400 14px/1.4 "DM Sans", sans-serif; }

/* ---------- Edit step gets the screen (Figma 06ab) ---------- */
#studio .studio-canvas:has(.decision--editor) { padding: 12px 24px; }
#studio .decision--editor .ed-stage { position: relative; height: max(320px, calc(100dvh - 73px - 52px - 24px)); }
#studio .bar-switches { display: flex; align-items: center; gap: 8px; margin-left: auto; }
#studio .bar-switches .ed-seg { padding: 2px; }
#studio .bar-switches .ed-seg button { min-height: 26px; padding: 0 10px; font-size: 12px; }
#studio .ed-tip { position: absolute; top: 12px; left: 12px; z-index: 2; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 24px); margin: 0; padding: 6px 6px 6px 12px; border-radius: 999px; background: rgba(40, 38, 34, .92); color: #fcfcfa; font: 400 13px/1.3 "DM Sans", sans-serif; pointer-events: auto; }
#studio .ed-tip button { width: 24px; height: 24px; min-height: 0; padding: 0; border: 0; border-radius: 999px; background: transparent; color: #fcfcfa; font: 600 15px/1 "DM Sans", sans-serif; cursor: pointer; }
/* Compact bottom bar */
#studio .studio-tools:has(> .tools-ed) { min-height: 52px; padding: 8px 24px; gap: 6px; flex-wrap: nowrap; }
#studio .studio-tools:has(> .tools-ed) .tools-left, #studio .studio-tools:has(> .tools-ed) .tools-right { display: flex; align-items: center; gap: 6px; }
#studio .studio-tools .tool-icon, #studio .studio-tools .tool-chip, #studio .studio-tools:has(> .tools-ed) [data-publish] { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; height: 36px; border: 1px solid var(--ep-line-strong); border-radius: 999px; background: var(--ep-surface); color: var(--ep-ink); font: 600 13px/1 "DM Sans", sans-serif; cursor: pointer; }
#studio .studio-tools .tool-icon { width: 36px; padding: 0; list-style: none; }
#studio .studio-tools .tool-icon::-webkit-details-marker { display: none; }
#studio .studio-tools .tool-chip { padding: 0 14px 0 12px; }
#studio .studio-tools:has(> .tools-ed) [data-publish] { padding: 0 18px; background: var(--ep-ink); border-color: var(--ep-ink); color: var(--ep-surface); }
#studio .studio-tools:has(> .tools-ed) button.ghost { min-height: 36px; }
#studio .studio-tools .tool-icon:disabled { opacity: .4; cursor: default; }
#studio .tools-more { position: relative; }
#studio .tools-more__menu { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 9; display: grid; min-width: 190px; padding: 6px; border: 1px solid var(--ep-line); border-radius: 12px; background: var(--ep-surface); box-shadow: 0 12px 32px rgb(40 38 34 / 16%); }
#studio .tools-more__menu button { display: block; min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--ep-ink); font: 400 14px "DM Sans", sans-serif; text-align: left; cursor: pointer; }
#studio .tools-more__menu button:hover { background: var(--ep-neutral, #f1efe9); }
#studio .studio-tools .tools-more__menu .tools-invite { display: block; color: var(--ep-ink); }
@media (max-width: 820px) {
  #studio .studio-canvas:has(.decision--editor) { padding: 8px 8px 0; }
  #studio .studio-tools:has(> .tools-ed) { padding: 8px 12px; justify-content: space-between; overflow: visible; }
  #studio .editor-v2.is-narrow .ed-bar { margin: 0 -8px 8px; padding: 4px 8px; }
}
#studio .ed-missing { position: absolute; left: 12px; bottom: 12px; z-index: 2; display: flex; align-items: center; gap: 10px; margin: 0; padding: 6px 6px 6px 12px; border: 1px solid var(--ep-line); border-radius: 999px; background: rgba(252, 252, 250, .96); color: var(--ep-ink-2, #64645f); font: 400 13px/1.3 "DM Sans", sans-serif; }
#studio .ed-missing button { min-height: 28px; padding: 0 12px; border: 1px solid var(--ep-line-strong); border-radius: 999px; background: var(--ep-surface); color: var(--ep-ink); font: 600 12px/1 "DM Sans", sans-serif; cursor: pointer; }

/* ---------- Edit step: chat on the left, everything on the page (Figma 06ae) ---------- */
#studio .studio-shell.is-editing { --chat-w: 380px; }
#studio .studio-shell.is-signed-in.is-editing { grid-template-columns: 68px var(--chat-w) minmax(0, 1fr); }
#studio .studio-shell.is-signed-in.nav-expanded.is-editing { grid-template-columns: 228px var(--chat-w) minmax(0, 1fr); }
#studio .studio-shell.is-anonymous.is-editing, #studio .studio-shell.is-editing:not(.is-signed-in) { grid-template-columns: var(--chat-w) minmax(0, 1fr); }
#studio .studio-shell.is-editing.chat-closed { --chat-w: 0px; }
#studio .studio-shell.is-editing.chat-closed .studio-chat { visibility: hidden; overflow: hidden; border: 0; }
#studio .studio-shell.is-resizing { user-select: none; cursor: col-resize; }
#studio .studio-shell.is-resizing.will-fold .studio-chat { opacity: .45; }
#studio .chat-handle { position: absolute; top: 0; right: -7px; z-index: 6; width: 14px; height: 100%; cursor: col-resize; touch-action: none; }
#studio .chat-handle::after { content: ""; position: absolute; top: 50%; left: 4px; width: 6px; height: 72px; margin-top: -36px; border-radius: 6px; background: var(--ep-line-strong, #c8c4bc); transition: background .15s; }
#studio .chat-handle:hover::after, #studio .chat-handle:focus-visible::after { background: var(--ep-ink, #282622); }
#studio .chat-handle:focus-visible { outline: none; }
#studio .chat-tab { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; margin-right: 10px; padding: 0 14px; border: 1px solid var(--ep-ink); border-radius: 999px; background: var(--ep-ink); color: var(--ep-surface); font: 600 13px/1 "DM Sans", sans-serif; cursor: pointer; }
#studio .pc-bar { display: inline-flex; flex-wrap: nowrap; gap: 4px; }
#studio .studio-shell.is-editing .studio-work__bar { gap: 10px; padding: 0 20px; }
#studio .studio-shell.is-editing .studio-work__bar > b.has-steps { display: none; }
#studio .bar-switches { flex-wrap: nowrap; }
#studio .pc-btn, #studio .tool-chip[data-pc] { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 11px; white-space: nowrap; border: 1px solid var(--ep-line-strong); border-radius: 999px; background: var(--ep-surface); color: var(--ep-ink); font: 600 12px/1 "DM Sans", sans-serif; cursor: pointer; }
#studio .pc-btn[aria-expanded="true"] { background: var(--ep-ink); color: var(--ep-surface); border-color: var(--ep-ink); }
#studio .studio-work__bar { position: relative; }
#studio .pc-pop { position: absolute; top: calc(100% + 6px); right: 24px; z-index: 30; display: grid; gap: 10px; width: min(380px, calc(100vw - 24px)); max-height: min(70dvh, 620px); overflow: auto; padding: 16px; border: 1px solid var(--ep-line); border-radius: 16px; background: var(--ep-surface); box-shadow: 0 16px 40px rgb(40 38 34 / 18%); color: var(--ep-ink); font: 400 14px/1.35 "DM Sans", sans-serif; }
#studio .pc-pop h3 { margin: 0; font: 600 16px/1.2 "DM Sans", sans-serif; }
#studio .pc-pop button { min-height: 36px; min-width: 36px; padding: 0 12px; border: 1px solid var(--ep-line-strong); border-radius: 999px; background: var(--ep-surface); color: var(--ep-ink); font: 600 13px/1 "DM Sans", sans-serif; cursor: pointer; }
#studio .pc-pop button[aria-pressed="true"], #studio .pc-pop .pc-go { background: var(--ep-ink); color: var(--ep-surface); border-color: var(--ep-ink); }
#studio .pc-pop button:disabled { opacity: .35; cursor: default; }
#studio .pc-pages { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
#studio .pc-page { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
#studio .pc-page.is-off .pc-name { color: var(--ep-ink-2, #64645f); text-decoration: line-through; }
#studio .pc-actions, #studio .pc-row { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
#studio .pc-rename, #studio .pc-add { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
#studio .pc-pop input, #studio .pc-pop select { min-height: 38px; padding: 0 10px; border: 1px solid var(--ep-line-strong); border-radius: 10px; background: #fff; font: 400 14px "DM Sans", sans-serif; color: var(--ep-ink); }
#studio .pc-field, #studio .pc-add label { display: grid; gap: 4px; font: 600 13px/1.2 "DM Sans", sans-serif; }
#studio .pc-note { margin: 0; color: var(--ep-ink-2, #64645f); font-size: 13px; }
#studio .studio-shell.is-editing .mobile-view-switch { display: none; }
@media (max-width: 820px) {
  #studio .studio-tools .pc-pop { position: fixed; top: auto; bottom: 60px; left: 8px; right: 8px; width: auto; }
  #studio .studio-shell.is-editing.chat-sheet .studio-work { display: block; }
  #studio .studio-shell.is-editing.chat-sheet.phone-design .studio-chat { display: none; }
  #studio .studio-shell.is-editing.chat-sheet.phone-chat .studio-chat { display: grid; position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 45; height: 58dvh; padding-top: 22px; border: 1px solid var(--ep-line); border-radius: 18px 18px 0 0; box-shadow: 0 -12px 36px rgb(40 38 34 / 22%); }
  #studio .studio-shell.is-editing.chat-sheet.sheet-full.phone-chat .studio-chat { height: 94dvh; }
  #studio .sheet-grab { position: absolute; top: 0; left: 0; right: 0; height: 26px; display: grid; place-items: center; cursor: grab; touch-action: none; }
  #studio .sheet-grab i { width: 44px; height: 5px; border-radius: 4px; background: var(--ep-line-strong, #c8c4bc); }
  #studio .studio-shell.is-editing.chat-sheet .studio-chat .studio-brand { display: none; }
  #studio .studio-shell.is-editing.chat-sheet.phone-chat .studio-chat { grid-template-rows: minmax(0, 1fr) auto auto; }   /* the thread grows, not the composer */
  #studio .studio-tools:has(> .tools-ed) .tool-chip { padding: 0 10px; }
  #studio .studio-tools:has(> .tools-ed) .tools-left, #studio .studio-tools:has(> .tools-ed) .tools-right { gap: 4px; }
  #studio .studio-tools:has(> .tools-ed) [data-publish] { padding: 0 14px; }
}

@media (min-width: 821px) and (max-width: 1360px) { #studio .pc-btn { padding: 0 9px; } #studio .pc-btn span + * {} }
