/* ===== Builder shell (not part of the client's landing) ===== */
:root {
  --ui-bg: #EEEDEA;
  --ui-panel: #FFFFFF;
  --ui-line: #E3E1DC;
  --ui-text: #1C1C1A;
  --ui-muted: #74726C;
  --ui-accent: #1C1C1A;
  --ui-focus: #2F6FEB;
  --panel-w: 320px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--ui-text);
  background: var(--ui-bg);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 2px; }

.app { display: flex; height: 100vh; height: 100dvh; }

/* ----- Panel ----- */
.panel {
  width: var(--panel-w); flex: 0 0 var(--panel-w);
  background: var(--ui-panel); border-right: 1px solid var(--ui-line);
  display: flex; flex-direction: column; min-height: 0; z-index: 30;
}
.panel__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--ui-line); }
.brand { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.brand span { color: var(--ui-muted); font-weight: 400; }
.panel__close { display: none; border: 0; background: none; font-size: 26px; line-height: 1; padding: 0 4px; }
.panel__body { flex: 1; overflow-y: auto; padding: 4px 20px 20px; }
.panel__foot { padding: 14px 20px; border-top: 1px solid var(--ui-line); }

.pgroup { padding: 18px 0; border-bottom: 1px solid var(--ui-line); }
.pgroup:last-child { border-bottom: 0; }
.pgroup__title { margin: 0 0 12px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ui-muted); }
.pgroup__hint { margin: -4px 0 12px; color: var(--ui-muted); font-size: 12.5px; line-height: 1.45; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--ui-line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.chip.is-on { background: var(--ui-accent); border-color: var(--ui-accent); color: #fff; }

.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.swatch { border: 1px solid var(--ui-line); background: #fff; border-radius: 10px; padding: 8px; text-align: left; font-size: 12px; }
.swatch__dots { display: flex; gap: 0; margin-bottom: 6px; height: 22px; border-radius: 6px; overflow: hidden; }
.swatch__dots i { flex: 1; }
.swatch.is-on { border-color: var(--ui-accent); box-shadow: 0 0 0 1px var(--ui-accent); }

.fontlist { display: grid; gap: 6px; }
.fontopt { display: flex; align-items: baseline; gap: 12px; border: 1px solid var(--ui-line); background: #fff; border-radius: 10px; padding: 9px 12px; text-align: left; }
.fontopt b { font-size: 22px; font-weight: 500; line-height: 1; min-width: 34px; }
.fontopt span { font-size: 12.5px; color: var(--ui-muted); }
.fontopt.is-on { border-color: var(--ui-accent); box-shadow: 0 0 0 1px var(--ui-accent); }

.prow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.prow:last-child { margin-bottom: 0; }
.prow > span { color: var(--ui-muted); font-size: 13px; }
.seg { display: inline-flex; background: #F2F1EE; border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: none; padding: 5px 9px; border-radius: 6px; font-size: 12.5px; color: var(--ui-muted); }
.seg button.is-on { background: #fff; color: var(--ui-text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg--dark { background: rgba(255,255,255,.08); }
.seg--dark button { color: rgba(255,255,255,.7); }
.seg--dark button.is-on { background: #fff; color: #1C1C1A; }

.seclist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.secrow { display: flex; align-items: center; gap: 8px; padding: 6px 4px 6px 8px; border-radius: 8px; }
.secrow:hover { background: #F6F5F2; }
.secrow__name { flex: 1; font-size: 13.5px; border: 0; background: none; text-align: left; padding: 0; }
.secrow.is-off .secrow__name { color: var(--ui-muted); text-decoration: line-through; }
.stepper { display: inline-flex; align-items: center; gap: 2px; }
.stepper button { width: 24px; height: 24px; border: 1px solid var(--ui-line); background: #fff; border-radius: 6px; line-height: 1; padding: 0; }
.stepper span { min-width: 30px; text-align: center; font-size: 12px; color: var(--ui-muted); font-variant-numeric: tabular-nums; }
.secrow.is-off .stepper { opacity: .35; pointer-events: none; }
.switch { position: relative; width: 30px; height: 18px; border: 0; border-radius: 999px; background: #D6D4CE; padding: 0; flex: 0 0 auto; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch.is-on { background: var(--ui-accent); }
.switch.is-on::after { transform: translateX(12px); }
.switch--locked { visibility: hidden; }

.btn-app { width: 100%; border: 0; border-radius: 10px; background: var(--ui-accent); color: #fff; padding: 12px 16px; font-weight: 600; }
.btn-app:hover { background: #000; }
.btn-app--big { width: auto; padding: 14px 28px; font-size: 15px; }

/* ----- Stage ----- */
.stage { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #2A2A28; }
.toolbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: #fff; }
.toolbar__settings { display: none; border: 1px solid rgba(255,255,255,.25); background: none; color: #fff; border-radius: 8px; padding: 6px 12px; }
.toolbar__send { margin-left: auto; border: 0; background: #fff; color: #1C1C1A; border-radius: 8px; padding: 7px 14px; font-weight: 600; }
.canvas { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.frame { margin: 0 auto; width: 100%; transition: width .25s ease; background: #fff; }
.frame.is-mobile { width: 390px; margin-top: 16px; border-radius: 22px; overflow: hidden; box-shadow: 0 0 0 10px #111, 0 20px 50px rgba(0,0,0,.5); margin-bottom: 26px; }

/* Section switcher overlay */
.sec { position: relative; }
.secbar {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 20;
  display: flex; align-items: center; gap: 2px; padding: 3px;
  background: rgba(20,20,18,.86); color: #fff; border-radius: 999px;
  font: 500 12.5px/1 "Inter", system-ui, sans-serif; letter-spacing: 0;
  opacity: 0; transition: opacity .15s; backdrop-filter: blur(6px);
  white-space: nowrap;
}
.sec:hover > .secbar, .sec:focus-within > .secbar, .is-touch .secbar { opacity: 1; }
.secbar button { border: 0; background: none; color: #fff; width: 30px; height: 30px; border-radius: 999px; font-size: 16px; line-height: 1; padding: 0; }
.secbar button:hover { background: rgba(255,255,255,.16); }
.secbar__label { padding: 0 8px; }
.secbar__label small { opacity: .6; margin-left: 4px; font-size: 12px; }
.secbar .secbar__hide { width: auto; padding: 0 10px; font-size: 12px; opacity: .75; border-left: 1px solid rgba(255,255,255,.2); border-radius: 0 999px 999px 0; }

/* Hidden section: a slim strip in the preview to bring it back */
.sec-off { display: flex; justify-content: center; padding: 8px; background: repeating-linear-gradient(-45deg, #ECEBE7 0 8px, #E4E3DE 8px 16px); }
.sec-off button {
  border: 1px dashed #9A988F; background: #fff; color: #44443F;
  border-radius: 999px; padding: 6px 14px; font: 500 12.5px/1.2 "Inter", system-ui, sans-serif;
}
.sec-off button:hover { border-style: solid; color: #000; }

.sec.is-flash { animation: flash .5s ease; }
@keyframes flash { from { opacity: .4; } to { opacity: 1; } }

/* Privacy: the preview is for looking, not copying */
.lp { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.lp img { -webkit-user-drag: none; pointer-events: none; }

/* ----- Request form ----- */
/* Clear break between the client's preview and the builder's own form */
.preview-end { display: flex; align-items: center; gap: 16px; padding: 28px 32px; background: #2A2A28; color: rgba(255,255,255,.55); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.preview-end::before, .preview-end::after { content: ""; flex: 1; height: 1px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.3) 0 6px, transparent 6px 12px); }
.request { background: #1C1C1A; color: #fff; }
.request__inner { max-width: 1100px; margin: 0 auto; padding: 72px 32px 88px; display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: start; }
.request h2 { font-size: 32px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 16px; font-weight: 600; color: #fff; }
.request__intro > p { color: rgba(255,255,255,.68); line-height: 1.6; margin: 0; }
.request .rform { background: #fff; color: var(--ui-text); padding: 32px; border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.summary { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13px; padding: 16px; background: #fff; border-radius: 12px; border: 1px solid var(--ui-line); }
.summary dt { color: var(--ui-muted); }
.summary dd { margin: 0; }
.rform { display: grid; gap: 14px; align-content: start; }
.rform__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rform label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; }
.rform input, .rform textarea { font: inherit; font-weight: 400; padding: 11px 12px; border: 1px solid #D6D4CE; border-radius: 8px; background: #fff; color: var(--ui-text); width: 100%; }
.rform textarea { resize: vertical; }
.rform .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--ui-muted); }
.rform .check input { width: auto; margin-top: 2px; }
.rform .hp { position: absolute; left: -9999px; }
.rform .is-invalid { border-color: #C2412D; }
.rform__status { margin: 0; min-height: 20px; font-size: 13.5px; }
.rform__status.is-ok { color: #2E7D4F; }
.rform__status.is-err { color: #C2412D; }

.admin-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); background: #2F6FEB; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.25); }

/* ----- Small screens: panel becomes a drawer ----- */
@media (max-width: 900px) {
  .panel { position: fixed; inset: auto 0 0 0; width: auto; height: 78dvh; border-right: 0; border-radius: 16px 16px 0 0; transform: translateY(105%); transition: transform .25s ease; box-shadow: 0 -10px 40px rgba(0,0,0,.25); }
  .app.panel-open .panel { transform: none; }
  .panel__close { display: block; }
  .toolbar__settings { display: inline-block; }
  #deviceSeg { display: none; }
  .request__inner { grid-template-columns: 1fr; gap: 32px; padding: 40px 16px 56px; }
  .rform__row { grid-template-columns: 1fr; }
  .request .rform { padding: 22px 18px; }
  .preview-end { padding: 22px 16px; font-size: 11px; }
  .secbar { opacity: 1; top: 8px; }
}

/* Background (zebra) toggle — preview bar */
.secbar .secbar__bg { width: auto; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; font-size: 12px; border-left: 1px solid rgba(255,255,255,.2); border-radius: 0; }
.secbar .secbar__bg:last-child { border-radius: 0 999px 999px 0; }
.bgmini { position: relative; width: 24px; height: 14px; border-radius: 999px; background: rgba(255,255,255,.28); transition: background .15s; }
.bgmini::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #fff; transition: transform .15s; }
.bgmini.is-on { background: #6DD49A; }
.bgmini.is-on::after { transform: translateX(10px); }

/* Background toggle — panel row (small square: filled = colored background) */
.bgtog { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #B9B7B0; background: #fff; padding: 0; flex: 0 0 auto; }
.bgtog.is-on { background: repeating-linear-gradient(-45deg, #C9C7C0 0 3px, #E7E6E1 3px 6px); border-color: #8E8C85; }
.bgtog--none { visibility: hidden; }
.secrow.is-off .bgtog { opacity: .35; pointer-events: none; }

/* Collapsible panel groups */
.pgroup > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; margin: 0; padding: 2px 0; user-select: none; }
.pgroup > summary::-webkit-details-marker { display: none; }
.pgroup > summary h2 { margin: 0; font: inherit; letter-spacing: inherit; }
.pgroup > summary::after { content: ""; width: 7px; height: 7px; margin-left: 4px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s; flex: 0 0 auto; }
.pgroup:not([open]) > summary::after { transform: rotate(-45deg); }
.pgroup__val { margin-left: auto; font-size: 12.5px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ui-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.pgroup[open] .pgroup__val { opacity: .55; }
.pgroup > summary:hover { color: var(--ui-text); }
.pgroup[open] > summary { margin-bottom: 12px; }
.pgroup:not([open]) { padding: 14px 0; }
