body.builder { background: var(--alt); height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.bar { display: flex; align-items: center; gap: 16px; padding: 0 20px; height: 60px; background: var(--bg); border-bottom: 1px solid var(--line); flex: none; }
.bar-title { color: var(--muted); font-weight: 500; }
.bar .btn { white-space: nowrap; }
.bar .btn-sm { padding: 8px 14px; font-size: .875rem; }
.panel summary { font-size: 1.0625rem; padding: 16px 0; letter-spacing: -.02em; }
.panel summary::after { width: 28px; height: 28px; background-size: 11px 2px, 2px 11px; }
.panel details { padding: 0 4px; }
.panel .body { padding: 2px 0 20px; }
.panel .btn { white-space: normal; }
@media (max-width: 520px) { .bar { gap: 8px; padding: 0 12px; } .bar .logo-lock { --w: 150px; } }
.bar-actions { margin-left: auto; display: flex; gap: 8px; }
.tabs { display: none; }
.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(360px, 460px) 1fr; }
.panel { overflow-y: auto; padding: 16px; background: var(--bg); border-right: 1px solid var(--line); }
.panel details { padding: 0; margin-bottom: 10px; }
.panel summary { padding: 14px 18px; font-weight: 700; }
.panel .body { padding: 2px 18px 18px; display: grid; gap: 12px; }
.panel label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
.panel input, .panel select, .panel textarea { font: 500 14.5px var(--ui); color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
.panel textarea { resize: vertical; }
.panel input:focus, .panel select:focus, .panel textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.panel fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; display: grid; gap: 10px; margin: 0; min-width: 0; }
.panel legend { font-weight: 700; font-size: 13px; padding: 0 6px; color: var(--ink); }
.panel code { background: var(--alt); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; width: 100%; }
[hidden] { display: none !important; }

.tpl-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tpl-pick button { border: 2px solid transparent; border-radius: 12px; padding: 0; background: none; cursor: pointer; text-align: center; font: 600 12px var(--ui); color: var(--ink); }
.tpl-pick button[aria-checked="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(58,48,16,.18); }
.tpl-pick .pk { aspect-ratio: 4/5; border-radius: 10px 10px 0 0; overflow: hidden; display: block; }
.tpl-pick .pk .mini { padding: 8px; }
.tpl-pick .pk .mini-frame { padding: 4px; }
.tpl-pick .pk .mini small { display: none; }
.tpl-pick .pk .mini strong { font-size: 18px; }
.tpl-pick .pk .mini em { font-size: 11px; }
.tpl-pick .pk .mini span { display: none; }
.tpl-pick .nm { display: block; padding: 6px 4px 8px; }

.guest-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.guest-links li { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13.5px; }
.guest-links li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.guest-links button, .guest-links a { border: 1px solid var(--line); background: var(--alt); border-radius: 8px; padding: 5px 10px; font: 600 12px var(--ui); cursor: pointer; text-decoration: none; color: var(--ink); }

.preview { display: flex; flex-direction: column; align-items: center; padding: 16px; min-height: 0; }
.pv-bar { display: flex; gap: 18px; align-items: center; margin-bottom: 12px; font-size: 14px; }
.pv-bar a { color: var(--brand); font-weight: 600; text-decoration: none; }
.check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.preview .phone { height: 100%; max-height: 780px; width: auto; aspect-ratio: 9 / 18.5; max-width: 100%; }

.toast-b { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 24px); background: #3A3010; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; opacity: 0; transition: .25s; pointer-events: none; z-index: 90; }
.toast-b.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
  body.builder { height: auto; overflow: auto; }
  .bar { position: sticky; top: 0; z-index: 30; }
  .bar-title { display: none; }
  .tabs { display: grid; grid-template-columns: 1fr 1fr; position: sticky; top: 60px; z-index: 29; background: var(--bg); border-bottom: 1px solid var(--line); }
  .tabs button { border: 0; background: none; padding: 13px; font: 700 14px var(--ui); color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; }
  .tabs button.on { color: var(--brand); border-color: var(--brand); }
  .layout { display: block; }
  .panel { border: 0; overflow: visible; }
  .preview { display: none; padding-bottom: 40px; }
  body.show-prev .panel { display: none; }
  body.show-prev .preview { display: flex; }
  .preview .phone { width: min(360px, 100%); height: auto; }
}
