/* Website builder: control panel on the left, a live preview at real breakpoints on the right. */

.ws-body { --tabs-h: 54px; }
.ws-body .build-tabs { margin: 10px auto 0; }
/* the builder fills the screen under the nav and the Build tabs; the site footer is one scroll below */
.ws {
  display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 12px; padding: 12px;
  height: calc(100vh - var(--nav-h) - var(--tabs-h)); height: calc(100dvh - var(--nav-h) - var(--tabs-h));
}
.ws-side, .ws-stage { background: #111113; border: 1px solid var(--line); border-radius: 16px; min-height: 0; min-width: 0; }
.ws-side { display: flex; flex-direction: column; overflow: hidden; }
.ws-stage { display: flex; flex-direction: column; overflow: hidden; position: relative; }

/* tabs */
.ws-tabs { display: flex; gap: 16px; padding: 14px 18px 0; border-bottom: 1px solid var(--line); flex: none; overflow-x: auto; scrollbar-width: none; }
.ws-tabs button { background: none; border: 0; padding: 4px 0 12px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ws-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.ws-tabs button:hover { color: var(--text); }
.ws-panel { flex: 1; min-height: 0; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; scrollbar-color: #333 transparent; }
.ws-panel > * { flex-shrink: 0; }

/* create */
.ws-hero { padding: 4px 2px 6px; }
.ws-eyebrow { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 2px; }
.ws-eyebrow .badge-new { margin: 0 6px 0 0; }
.ws-hero h1 { margin: 0; font-size: 40px; }
.ws-hero h1 em { font-style: normal; color: var(--accent); }
.ws-sub { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.ws-field { padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.ws-field:focus-within { border-color: rgba(255, 191, 47, 0.5); }
.ws-f-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.ws-f-head label { color: var(--muted); }
.ws-f-head output { color: var(--text); font-weight: 600; }
.ws-field textarea, .ws-field input[type="text"], .ws-field input[type="url"], .ws-field input[type="email"], .ws-field input:not([type]) {
  width: 100%; border: 0; background: transparent; color: var(--text); font-size: 14px; line-height: 1.5; outline: none; resize: vertical; padding: 0;
}
.ws-field textarea { min-height: 64px; }
#prompt { min-height: 96px; }
.ws-hint { font-size: 11.5px; color: var(--dim); }
.ws-group { border: 0; padding: 0; margin: 0; }
.ws-group legend, .ws-group-h { font-size: 12.5px; color: var(--muted); font-weight: 600; margin: 4px 0 8px; padding: 0; }
.ws-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-chips button { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; }
.ws-chips button:hover { color: var(--text); background: var(--surface-2); }
.ws-chips button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ws-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ws-style { position: relative; display: grid; gap: 6px; text-align: left; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.ws-style:hover { background: var(--surface-2); }
.ws-style[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ws-swatch { position: relative; height: 54px; border-radius: 8px; overflow: hidden; display: flex; align-items: flex-end; padding: 6px 8px; gap: 6px; }
.ws-swatch b { font-size: 26px; line-height: 1; font-weight: 600; }
.ws-swatch i { width: 12px; height: 12px; border-radius: 50%; display: block; margin-left: auto; margin-bottom: 4px; }
.ws-style strong { font-size: 13px; }
.ws-style small { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.ws-check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.ws-check input { margin-top: 3px; accent-color: var(--accent); }
.ws-check strong { display: block; font-size: 13.5px; }
.ws-check small { display: block; font-size: 12px; color: var(--muted); }
.ws-check.sm { padding: 6px 0; background: none; border: 0; font-size: 13px; color: var(--muted); }
.ws-go {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; border: 0; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink); font: 800 19px/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase;
  box-shadow: 0 10px 30px rgba(255, 191, 47, 0.18); transition: background 0.15s;
}
.ws-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.ws-go:hover { background: var(--accent-hi); }
.ws-go:disabled { opacity: 0.6; cursor: progress; }
.ws-fill { padding: 12px; border-radius: 12px; border: 1px dashed rgba(255, 191, 47, 0.45); background: rgba(255, 191, 47, 0.05); font-size: 13px; color: var(--muted); }
.ws-fill p { margin: 0 0 10px; }
.ws-fill strong { color: var(--text); }
.btn-ghost.wide, .btn-accent.wide { width: 100%; }
.ws-h2 { margin: 0; font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: 0.01em; }
.ws-h3 { margin: 18px 0 8px; font-size: 14px; font-weight: 700; }
.ws-note { margin: 0; font-size: 12.5px; color: var(--muted); }
.ws-sites { display: grid; gap: 6px; margin-top: 6px; }
.ws-site-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.ws-site { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px; padding: 8px 8px 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.ws-site.on { border-color: rgba(255, 191, 47, 0.5); }
.ws-site button.open { all: unset; cursor: pointer; display: grid; gap: 2px; min-width: 0; }
.ws-site button.open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.ws-site strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-site small { font-size: 11.5px; color: var(--muted); }

/* page panel */
.ws-row-head { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.ws-mini { height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 600; }
.ws-mini:hover { background: var(--surface-3); }
.ws-mini.danger:hover { background: rgba(255, 79, 109, 0.15); border-color: var(--hot); }
.ws-pagelist { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ws-pagelist button { height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 500; }
.ws-pagelist button[aria-current="true"] { color: var(--text); border-color: var(--accent); background: rgba(255, 191, 47, 0.07); }
.ws-seclist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ws-sec { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 5px 6px 5px 8px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.ws-sec.sel { border-color: #3b82f6; background: rgba(59, 130, 246, 0.08); }
.ws-sec.hid { opacity: 0.55; }
.ws-sec.drag-over { border-color: var(--accent); }
.ws-sec .grip { color: var(--dim); cursor: grab; font-size: 14px; line-height: 1; text-align: center; user-select: none; }
.ws-sec .pick { all: unset; cursor: pointer; display: grid; gap: 1px; min-width: 0; padding: 3px 0; }
.ws-sec .pick:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }
.ws-sec .pick strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-sec .pick small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-sec .ctl { display: flex; gap: 1px; }
.ws-sec .ctl button, .ws-item-ctl button { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; border: 0; background: transparent; color: var(--muted); padding: 0; }
.ws-sec .ctl button:hover:not(:disabled), .ws-item-ctl button:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.ws-sec .ctl button:disabled, .ws-item-ctl button:disabled { opacity: 0.25; }
.ws-sec svg, .ws-item-ctl svg, .ws-icon svg, .ws-pill svg, .ws-bps svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* inspector */
.ws-inspector { display: grid; gap: 10px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.ws-inspector:empty { display: none; }
.ws-insp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ws-insp-head h2 { margin: 0; font: 900 24px/1 var(--display); text-transform: uppercase; }
.ws-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ws-sel { position: relative; display: grid; gap: 1px; padding: 7px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.ws-sel small { font-size: 11.5px; color: var(--muted); }
.ws-sel select { appearance: none; -webkit-appearance: none; background: transparent; border: 0; padding: 0 16px 0 0; font-size: 13.5px; font-weight: 600; width: 100%; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 7px) 55%, calc(100% - 2px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.ws-sel select:focus { outline: none; }
.ws-sel:focus-within { border-color: var(--accent); }
.ws-sel option { background: #1b1b1e; }
.ws-fieldset { display: grid; gap: 8px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); }
.ws-fieldset > .ws-f-head { margin: 0; }
.ws-items { display: grid; gap: 6px; }
.ws-item { border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.ws-item > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; cursor: pointer; list-style: none; font-size: 13px; }
.ws-item > summary::-webkit-details-marker { display: none; }
.ws-item > summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.ws-item > summary span.ph { color: #f5c046; }
.ws-item-body { display: grid; gap: 8px; padding: 4px 8px 10px; }
.ws-item-ctl { display: flex; gap: 1px; }
.ws-img-field { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.ws-thumb { width: 64px; height: 48px; border-radius: 8px; background: linear-gradient(135deg, #2a2a30, #19191c); overflow: hidden; display: grid; place-items: center; color: var(--dim); font-size: 11px; }
.ws-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ws-img-field small { display: block; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-img-field .ws-mini { margin-top: 4px; }
.ws-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.ws-toggle input { accent-color: var(--accent); }

/* theme panel */
.ws-seg { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.ws-seg button { flex: 1; height: 30px; border-radius: 7px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; }
.ws-seg button[aria-checked="true"], .ws-seg button[aria-selected="true"] { background: var(--surface-3); color: var(--text); }
.ws-palettes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ws-pal { height: 40px; border-radius: 9px; border: 1px solid var(--line); padding: 0; overflow: hidden; display: grid; grid-template-columns: 2fr 1fr; }
.ws-pal[aria-checked="true"] { box-shadow: 0 0 0 2px var(--accent); }
.ws-pal span { display: block; }
.ws-inline { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.ws-inline label { flex: 1; color: var(--muted); }
.ws-inline input[type="color"] { width: 38px; height: 28px; border: 0; padding: 0; background: none; cursor: pointer; }
.ws-inline output { font-variant-numeric: tabular-nums; color: var(--text); font-size: 12.5px; }
.ws-range { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.ws-range span { display: flex; justify-content: space-between; }
.ws-range output { color: var(--text); font-weight: 600; }
.ws-range input { accent-color: var(--accent); }
.ws-details { border-radius: 12px; background: var(--surface); border: 1px solid var(--line); padding: 10px 12px; font-size: 13px; }
.ws-details summary { cursor: pointer; font-weight: 600; }
.ws-contrast { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.ws-contrast li { display: flex; justify-content: space-between; gap: 8px; }
.ws-contrast b { color: #6ee7a8; font-variant-numeric: tabular-nums; }
.ws-contrast b.bad { color: var(--hot); }

/* stage */
.ws-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; flex: none; }
.ws-bps { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.ws-bps button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 7px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; }
.ws-bps button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.ws-page-select { height: 36px; padding: 0 30px 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; max-width: 220px; }
.ws-page-select option { background: #1b1b1e; }
.ws-acts { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.ws-icon { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); display: grid; place-items: center; padding: 0; }
.ws-icon:hover:not(:disabled) { background: var(--surface-3); }
.ws-icon:disabled { opacity: 0.35; cursor: default; }
.ws-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; }
.ws-pill:hover { background: var(--surface-3); }
.ws-pill.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ws-pill.accent:hover { background: var(--accent-hi); }
.ws-saved { font-size: 12px; color: var(--dim); margin: 0 4px; min-width: 40px; }
.ws-canvas { position: relative; flex: 1; min-height: 0; overflow: hidden; background: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.06) 1px, transparent 0) 0 0 / 22px 22px, #0c0c0e; }
.ws-frame { position: absolute; top: 16px; left: 50%; transform-origin: top center; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 30px 80px rgba(0, 0, 0, 0.6); }
.ws-frame.phone { border-radius: 26px; box-shadow: 0 0 0 8px #1b1b1f, 0 0 0 9px rgba(255, 255, 255, 0.1), 0 30px 80px rgba(0, 0, 0, 0.6); }
.ws-frame iframe { display: block; border: 0; width: 100%; height: 100%; background: #fff; }
.ws-status { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(460px, calc(100% - 32px)); background: rgba(16, 16, 18, 0.94); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; text-align: center; z-index: 5; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); }
.ws-status p { margin: 8px 0 0; font-size: 13px; }
.ws-status .ws-mini { margin-top: 8px; }
.ws-meter { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.ws-meter i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.ws-meter.indeterminate i { width: 30%; animation: ws-sweep 1.2s ease-in-out infinite; }
@keyframes ws-sweep { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

/* dialogs */
.ws-dialog { width: min(760px, calc(100vw - 24px)); }
.ws-dialog.wide { width: min(1040px, calc(100vw - 24px)); }
.ws-dialog p { font-size: 14px; }
.ws-lib { display: grid; gap: 16px; max-height: 70vh; overflow: auto; }
.ws-lib h3 { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.ws-lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.ws-lib-grid button { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; text-align: left; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
.ws-lib-grid button:hover { border-color: var(--accent); }
.ws-lib-grid .ico { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-3); display: grid; place-items: center; color: var(--accent); }
.ws-lib-grid .ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ws-lib-grid strong { display: block; font-size: 13.5px; }
.ws-lib-grid small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.ws-img-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
.ws-img-prev { border-radius: 12px; overflow: hidden; background: #000; min-height: 260px; display: grid; place-items: center; color: var(--dim); font-size: 13px; }
.ws-img-prev img { width: 100%; height: 100%; max-height: 60vh; object-fit: contain; }
.ws-img-side { display: grid; gap: 10px; align-content: start; }
.ws-up { cursor: pointer; }
.ws-img-acts { display: flex; gap: 8px; justify-content: space-between; }
.ws-checklist { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.ws-checklist li { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); color: var(--text); }
.ws-checklist li::before { content: '•'; color: var(--muted); }
.ws-checklist li.warn::before { content: '!'; color: #1c1400; background: #f5c046; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.ws-checklist li.ok::before { content: '✓'; color: #6ee7a8; }
.ws-export-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ws-hosts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-top: 12px; }
.ws-host { padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.ws-host h3 { margin: 0 0 8px; font: 900 24px/1 var(--display); text-transform: uppercase; }
.ws-host ol { margin: 0 0 10px; padding-left: 18px; font-size: 13.5px; display: grid; gap: 6px; color: var(--text); }
.ws-host a { color: var(--accent); }
.ws-host code, .ws-dialog code { font-size: 12px; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
.ws-share { display: flex; gap: 8px; }
.ws-share input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font-size: 13px; }

/* publish */
.ws-dialog.pub { width: min(520px, calc(100vw - 24px)); }
.pub-addr { display: flex; align-items: center; height: 44px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); overflow: hidden; margin-top: 6px; }
.pub-addr:focus-within { border-color: var(--accent); }
.pub-addr input { flex: 1; min-width: 0; height: 100%; padding: 0 4px 0 12px; border: 0; background: transparent; color: var(--text); font-size: 15px; outline: none; text-align: right; }
.pub-addr span { padding: 0 12px 0 0; color: var(--muted); font-size: 15px; white-space: nowrap; }
.pub-check { min-height: 1.5em; margin-top: 8px; }
.pub-check[data-state="ok"] { color: #6ee7a8; }
.pub-check[data-state="bad"] { color: #f5a3a3; }
.pub-link { display: flex; align-items: center; gap: 10px; margin: 4px 0 6px; font-size: 18px !important; font-weight: 700; word-break: break-all; }
.pub-link a { color: var(--text); }
.pub-dot { width: 9px; height: 9px; border-radius: 50%; background: #6ee7a8; box-shadow: 0 0 0 4px rgba(110, 231, 168, 0.15); flex: none; }
#pub-live .ws-share { margin-top: 12px; }
#pub-live .ws-export-acts, #pub-new .ws-export-acts { align-items: center; }
.pub-msg { margin-top: 12px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.pub-msg.ok { color: #6ee7a8; }
.pub-msg.error, .pub-msg.warn { color: #f5c046; }
.pub-fine { margin-top: 16px; }
.pub-fine a { color: var(--muted); }

/* narrow screens: preview on top, controls below */
@media (max-width: 980px) {
  .ws { grid-template-columns: minmax(0, 1fr); height: auto; padding: 8px; }
  .ws-stage { order: -1; height: 78vh; height: 78dvh; }
  .ws-side { max-height: none; }
  .ws-panel { overflow: visible; }
  .ws-bps span { display: none; }
  .ws-pill span { display: none; }
  .ws-img-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .ws-acts { margin-left: 0; width: 100%; }
  .ws-pill { padding: 0 9px; }
  .ws-hero h1 { font-size: 34px; }
  .ws-saved { display: none; }
}
/* narrow desktops: the stage bar's Export button is enough, and the nav keeps its room */
@media (min-width: 761px) and (max-width: 1000px) { .ws-body #nav-export { display: none; } }

/* templates: a scrolling strip in Create and a full grid in a dialog */
.ws-tpl-wrap { display: grid; gap: 8px; }
.ws-tpls { display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; scrollbar-color: #333 transparent; }
.ws-tpl { display: grid; align-content: start; gap: 4px; padding: 6px 6px 10px; text-align: left; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); scroll-snap-align: start; cursor: pointer; }
.ws-tpl:hover { background: var(--surface-2); }
.ws-tpl:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ws-tpl[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ws-tpl-img { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: #1c1c1f; margin-bottom: 4px; }
.ws-tpl-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.ws-tpl-new { position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 6px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); }
.ws-tpl-preview { position: absolute; bottom: 7px; right: 7px; padding: 5px 8px; border: 1px solid rgba(255,255,255,.22); border-radius: 6px; background: rgba(12,12,14,.88); color: #fff; font-size: 10px; font-weight: 600; }
.ws-tpl strong { font-size: 13px; padding: 0 2px; }
.ws-tpl small { font-size: 11.5px; line-height: 1.35; color: var(--muted); padding: 0 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ws-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 14px; max-height: min(70vh, 760px); overflow: auto; padding: 2px; }
.ws-tpl.big small { -webkit-line-clamp: 3; }
.ws-dialog.ws-tpl-detail { width: min(1120px, calc(100vw - 24px)); max-height: 90vh; max-height: 90dvh; overflow: auto; }
.ws-tpl-detail .sheet-head { align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.ws-tpl-detail .sheet-head h2 { font-size: clamp(28px, 4vw, 42px); }
.ws-tpl-detail .ws-eyebrow { margin: 0 0 8px; color: var(--accent); }
.ws-tpl-detail-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(240px, 1fr); gap: 26px; align-items: start; }
.ws-tpl-detail-media { min-width: 0; }
.ws-tpl-detail-media video { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: contain; border-radius: 14px; background: #080809; border: 1px solid var(--line-2); }
.ws-tpl-detail-media video:focus-visible, .ws-tpl-detail button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.ws-tpl-detail-media .ws-note { margin: 10px 2px 0; }
.ws-tpl-detail-info { display: grid; gap: 16px; }
.ws-tpl-detail-info > p { margin: 0; line-height: 1.65; }
.ws-tpl-detail-info h3 { margin: 8px 0 -5px; font-size: 14px; color: var(--text); }
.ws-tpl-detail-info ul { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; color: var(--muted); font-size: 13px; }
.ws-tpl-detail-info li { display: flex; gap: 9px; align-items: baseline; }
.ws-tpl-detail-info li::before { content: '✓'; color: var(--accent); }
.ws-tpl-detail-action { display: grid; gap: 12px; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 4px; }
.ws-tpl-detail-action button { min-height: 46px; justify-content: center; }
.ws-tpl-detail-action button:disabled { opacity: .65; cursor: wait; }
.ws-tpl-detail-action p { margin: 0; }
.ws-tpl-detail #tpl-detail-error { color: #f5c046; font-size: 13px; line-height: 1.5; }
@media (max-width: 760px) {
  .ws-tpl-detail-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .ws-tpl-detail-info ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) { .ws-tpl-detail-info ul { grid-template-columns: minmax(0, 1fr); } }

/* A short path from a complete design to a personal site. */
.ws-journey { display: grid; gap: 7px; list-style: none; padding: 0; margin: 0; }
.ws-journey button { width: 100%; display: grid; grid-template-columns: 36px 1fr; column-gap: 9px; text-align: left; background: #1a1a1c; color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; }
.ws-journey button:hover { border-color: var(--accent); background: #24221b; }
.ws-journey button:focus-visible, .ws-template-goals button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ws-journey span { grid-row: span 2; color: var(--accent); align-self: center; font-size: 18px; font-weight: 600; }
.ws-journey strong { font-size: 14px; }
.ws-journey small { color: var(--muted); font-size: 12px; }
.ws-template-search { display: grid; gap: 7px; margin: 18px 0 12px; }
.ws-template-search label { font-size: 13px; color: var(--muted); }
.ws-template-search input { width: 100%; min-height: 46px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--text); padding: 10px 14px; font: inherit; }
.ws-template-search input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.ws-template-goals { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.ws-template-goals button { padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 99px; background: transparent; color: var(--muted); font-size: 12px; }
.ws-template-goals button[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
#tpl-dialog { max-height: 90dvh; overflow: auto; }
#tpl-dialog .ws-tpl-grid { max-height: none; overflow: visible; }
.ws-empty-designs { grid-column: 1 / -1; padding: 32px 16px; border: 1px dashed var(--line-2); border-radius: 12px; text-align: center; color: var(--muted); }
.ws-personalize { display: grid; gap: 12px; }
.ws-review-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
#personalize-error { color: #f5c046; }
@media (max-width: 560px) { .ws-template-goals { flex-wrap: nowrap; overflow-x: auto; padding: 3px 3px 8px; } .ws-template-goals button { flex: none; } .ws-tpl-grid { grid-template-columns: 1fr; } }

/* The assistant proposes bounded changes; applying remains an editor action. */
.ws-ai{margin-top:28px;padding:22px 18px;border:1px solid #51452c;border-radius:18px;background:linear-gradient(145deg,#242016,#141416)}.ws-ai h2{font-size:26px;line-height:1.15;letter-spacing:-.035em;margin:12px 0}.ws-ai>label{font-size:13px}.ws-ai textarea{width:100%;box-sizing:border-box;background:#101113;color:#f5f4ef;border:1px solid #434044;border-radius:10px;padding:12px;font:inherit;font-size:14px;line-height:1.6;margin:10px 0;resize:vertical}.ws-ai-ideas{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:15px}.ws-ai-ideas button{background:#282724;color:#e0d4b5;border:1px solid #494233;border-radius:99px;font:inherit;font-size:11px;padding:8px 10px;cursor:pointer}.ws-ai .ws-ai-consent{display:flex;gap:10px;align-items:start;font-size:12px;line-height:1.6;margin:15px 0;color:#c7c6c2}.ws-ai-consent input{margin-top:4px;flex:none}.ws-ai-consent a{color:#e6c57c}.ws-ai .ws-sel[hidden]{display:none}#ai-status{font-size:13px;line-height:1.6;color:#e5d1a4;overflow-wrap:anywhere}#ai-diff{list-style:none;margin:16px 0;padding:0;max-height:360px;overflow:auto}#ai-diff li{padding:12px 0;border-top:1px solid #46423b;font-size:12px;line-height:1.6}#ai-diff strong,#ai-diff del,#ai-diff ins{display:block;overflow-wrap:anywhere}#ai-diff del{color:#b9aaa6;margin:7px 0}#ai-diff ins{color:#c6e0bc;text-decoration:none}#ai-result>p{font-size:13px;line-height:1.6}#ai-result .btn-accent,#ai-result .btn-ghost{font-size:13px;margin:4px 0}.ws-ai :focus-visible{outline:2px solid #ffc329;outline-offset:3px}
