* { box-sizing:border-box; }
:root {
  --constructor-paper:#fff;
  --constructor-ink:#17252b;
  --constructor-muted:#4c6264;
  --constructor-line:#c5d5d4;
  --constructor-panel:var(--wl-bg,#f0f6f4);
  --constructor-soft:var(--wl-soft,#e3efea);
  --constructor-ring:var(--wl-link-light,#285f59);
  color-scheme:light;
}
:root[data-theme="dark"] {
  --constructor-paper:#192529;
  --constructor-ink:#f3f7f6;
  --constructor-muted:#becdcd;
  --constructor-line:#51666a;
  --constructor-panel:#101b1f;
  --constructor-soft:#283a3b;
  --constructor-ring:var(--wl-dark-link,#89c3b6);
  color-scheme:dark;
}
[hidden] { display:none !important; }
body.constructor-shell {
  height:100dvh;
  margin:0;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  overflow:hidden;
  background:var(--constructor-panel) var(--wl-background-light,none) center / cover;
  color:var(--constructor-ink);
  font:15px/1.4 var(--wl-org-font,"Segoe UI",Arial,sans-serif);
  --paper:var(--constructor-paper);
  --ink:var(--constructor-ink);
  --line:var(--constructor-line);
  --focus:var(--constructor-ring);
}
:root[data-theme="dark"] body.constructor-shell {
  background-image:var(--wl-background-dark,none);
}
button,input,select,summary { font:inherit; }
button,summary { cursor:pointer; }
button:disabled { cursor:default; opacity:.58; }
:focus-visible { outline:3px solid var(--constructor-ring); outline-offset:2px; }
.constructor-top,.constructor-bottom {
  background:var(--constructor-paper);
  display:flex;
  align-items:center;
  gap:10px;
  padding:9px clamp(10px,2.5vw,24px);
}
.constructor-top { display:grid; row-gap:8px; border-bottom:1px solid var(--constructor-line); min-height:62px; }
.constructor-titlebar {
  display:grid; grid-template-columns:minmax(84px,1fr) minmax(0,2fr) minmax(84px,1fr);
  align-items:center; gap:8px; min-width:0;
}
.constructor-back-slot { display:flex; justify-content:flex-start; }
.constructor-help-slot { display:flex; justify-content:flex-end; }
.constructor-help-slot .crm-help-slot > .crm-help-button {
  border:1px solid var(--constructor-line); border-radius:9px; background:var(--constructor-paper); color:var(--constructor-ink);
}
.constructor-top-actions { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:8px; }
.constructor-top-actions > :is(a,button):not(.primary) { background:var(--constructor-panel); }
.constructor-bottom { justify-content:flex-end; border-top:1px solid var(--constructor-line); }
#constructor-company {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-width:0;
  text-align:center;
  color:var(--constructor-ink);
  overflow-wrap:anywhere;
}
#constructor-company img { width:36px; height:32px; object-fit:contain; }
.constructor-button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--constructor-line);
  border-radius:10px;
  padding:7px 12px;
  min-height:42px;
  max-width:100%;
  color:var(--constructor-ink);
  background:var(--constructor-paper);
  font:inherit;
  font-weight:650;
  line-height:1.16;
  text-align:center;
  text-decoration:none;
}
.constructor-button:hover { border-color:var(--constructor-ring); }
.constructor-button.primary {
  border-color:var(--accent,#285f59);
  background:var(--accent,#285f59);
  color:var(--wl-accent-ink,#fff);
}
.constructor-bottom .primary { min-width:min(160px,100%); }
.constructor-workspace {
  display:grid;
  grid-template-columns:minmax(180px,225px) minmax(0,1fr);
  min-height:0;
}
.constructor-sidebar {
  color:#f8fbfa;
  background:var(--wl-navigation,#182c37);
  padding:15px 11px;
  overflow:auto;
  min-width:0;
}
.constructor-sidebar :focus-visible { outline-color:#fff; }
#constructor-menu {
  width:100%;
  padding:7px 8px;
  border:0;
  color:inherit;
  background:transparent;
  font-weight:700;
  text-align:start;
  cursor:default;
}
#constructor-nav { display:grid; gap:6px; margin-top:8px; }
.constructor-nav-row {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  color:inherit;
  border-radius:8px;
}
.constructor-nav-name {
  display:grid;
  place-items:center;
  min-height:44px;
  padding:7px 8px;
  min-width:0;
  color:inherit;
  font:inherit;
  text-align:center;
  overflow-wrap:anywhere;
}
.constructor-nav-row button {
  border:1px solid #ffffff55; border-radius:8px; background:transparent; color:inherit;
}
.constructor-nav-row button:hover:not([aria-current="page"]) { background:#ffffff20; }
.constructor-nav-row [aria-current="page"] {
  background:var(--accent,#285f59);
  color:var(--wl-accent-ink,#fff);
  border-color:var(--accent,#285f59);
  font-weight:650;
}
.constructor-nav-edit { padding:6px; font:inherit; font-size:.75rem; }
.constructor-main { min-width:0; min-height:0; overflow:auto; }
.constructor-panel {
  margin:clamp(12px,3vw,27px) auto;
  width:min(84ch,calc(100% - clamp(24px,6vw,54px)));
  padding:clamp(14px,3vw,25px);
  border:1px solid var(--constructor-line);
  border-radius:15px;
  background:var(--constructor-paper);
}
.constructor-panel h1 {
  margin:0 0 17px;
  font-size:clamp(23px,4.6vw,35px);
  line-height:1.15;
  overflow-wrap:anywhere;
}
.constructor-progress { display:block; margin-bottom:7px; color:var(--constructor-muted); font-weight:600; }
.constructor-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.constructor-choice {
  min-height:50px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border:1px solid var(--constructor-line);
  border-radius:10px;
  background:var(--constructor-paper);
  color:var(--constructor-ink);
  cursor:pointer;
  font-weight:640;
  overflow-wrap:anywhere;
}
.constructor-choice:has(:checked) { border-color:var(--constructor-ring); background:var(--constructor-soft); }
.constructor-choice input { flex:none; width:18px; height:18px; margin:0; accent-color:var(--accent,#285f59); }
.constructor-panel .wl-brand-layout { display:block; }
.constructor-panel .wl-brand-fields {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:11px 14px;
  max-height:none;
  overflow:visible;
}
.constructor-panel .wl-brand-fields > fieldset,
.constructor-panel .wl-brand-fields > details { grid-column:1/-1; }
.constructor-panel .wl-brand-fields :is(input:not([type=radio],[type=checkbox]),select),.constructor-field input {
  min-height:42px;
  padding:8px 9px;
  min-width:0;
  width:100%;
  background:var(--constructor-paper);
  color:var(--constructor-ink);
  border:1px solid var(--constructor-line);
  border-radius:8px;
}
.constructor-panel .wl-brand-fields .field { align-content:start; gap:5px; }
.constructor-panel .wl-color-inputs { display:block; }
.constructor-panel .wl-brand-fields input[type=color] { width:56px; min-width:56px; padding:4px; cursor:pointer; }
.constructor-panel .wl-palettes { grid-template-columns:repeat(6,minmax(0,1fr)); gap:7px; }
.constructor-panel .wl-palettes legend,.constructor-mode legend { margin-bottom:5px; font-weight:650; }
.constructor-panel .wl-palette { font-size:.79rem; overflow-wrap:anywhere; gap:5px; }
.constructor-panel .wl-palette-sample { height:29px; }
.constructor-panel .wl-palette-sample b { top:5px; height:5px; }
.constructor-panel .wl-palette-sample em { height:8px; bottom:4px; }
.constructor-mode { padding:0; border:0; margin:0; }
.constructor-mode div { display:flex; gap:7px; flex-wrap:wrap; }
.constructor-mode button {
  min-height:38px;
  padding:6px 12px;
  border:1px solid var(--constructor-line);
  border-radius:8px;
  color:var(--constructor-ink);
  background:var(--constructor-paper);
}
.constructor-mode button[aria-pressed="true"] {
  background:var(--constructor-soft);
  border-color:var(--constructor-ring);
  font-weight:650;
}
.constructor-brand-more { border:1px solid var(--constructor-line); border-radius:8px; padding:8px 11px; }
.constructor-brand-more summary { font-weight:650; }
.constructor-brand-more[open] > :not(summary) { margin-top:10px; min-width:0; }
.constructor-panel .wl-background-picker h3 { margin-block:6px; }
.constructor-field { display:grid; gap:5px; }
.constructor-edit-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.constructor-remove { color:#961d32; }
:root[data-theme="dark"] .constructor-remove { color:#ffb6c1; }
#constructor-error,#constructor-edit-error,.wl-brand-error:not(:empty) { color:var(--constructor-ink); border:1px solid #c26876; padding:8px; border-radius:8px; background:var(--constructor-paper); }
#constructor-error { margin:10px; }
.constructor-preview {
  min-height:100%;
  height:100%;
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
}
.constructor-preview-heading {
  display:flex;
  align-items:center;
  gap:10px;
  padding:7px 12px;
  flex-wrap:wrap;
  background:var(--constructor-paper);
  border-bottom:1px solid var(--constructor-line);
}
.constructor-preview-heading h1 { flex:1; min-width:0; margin:0; font-size:1.12rem; overflow-wrap:anywhere; }
#constructor-frame { display:block; width:100%; height:100%; min-height:0; border:0; }
.constructor-bottom .constructor-add {
  min-width:min(254px,100%);
  min-height:44px;
  color:var(--constructor-ink);
  background:var(--constructor-soft);
  border-color:var(--constructor-ring);
}
@media(max-width:720px) {
  body.constructor-shell[data-step="preview"] {
    height:auto;
    min-height:100dvh;
    grid-template-rows:auto 1fr auto;
    overflow:visible;
  }
  [data-step="preview"] .constructor-main { overflow:visible; }
  [data-step="preview"] .constructor-preview { grid-template-rows:auto minmax(24rem,1fr); }
  .constructor-top-actions > :is(a,button) { flex:1 1 calc(50% - 4px); min-width:0; }
  .constructor-workspace { grid-template-columns:1fr; grid-template-rows:auto minmax(0,1fr); }
  .constructor-sidebar { grid-row:1; padding:3px 9px; }
  .constructor-main { grid-row:2; }
  body:not([data-step="preview"]) .constructor-sidebar { display:none; }
  #constructor-menu {
    min-height:44px; cursor:pointer; border:1px solid #ffffff55;
    border-radius:8px; text-align:center;
  }
  #constructor-menu::after { content:"▾"; margin-inline-start:7px; }
  #constructor-menu[aria-expanded="false"] + #constructor-nav { display:none; }
  #constructor-nav { grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; margin:1px 0 6px; }
  .constructor-nav-edit { min-height:40px; }
}
@media(max-width:440px) {
  .constructor-bottom .constructor-button { width:100%; }
  .constructor-top { gap:6px; }
  .constructor-top .constructor-button { min-height:44px; padding-inline:8px; font-size:.85rem; }
  #constructor-company { font-size:1rem; }
  #constructor-company img { width:22px; height:22px; }
  .constructor-choice { min-height:45px; padding:6px; font-size:.86rem; }
  .constructor-panel .wl-palettes { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .constructor-panel .wl-brand-fields { gap:8px; }
  .constructor-preview-heading .constructor-button { min-height:38px; }
  .constructor-preview-heading { padding:4px 9px; }
}
@media(max-width:360px) {
  #constructor-nav { grid-template-columns:minmax(0,1fr); }
}


.wl-brand-error:empty,.wl-brand-status:empty { margin:0; }

.constructor-bottom:not(:has(.constructor-button:not([hidden]))) { display:none; }
[data-step="preview"] .constructor-bottom {
  display:grid;
  grid-template-columns:1fr auto 1fr;
}
[data-step="preview"] .constructor-bottom:not(:has(.constructor-button:not([hidden]))) { display:none; }
[data-step="preview"] #constructor-add { grid-column:2; justify-self:center; }
[data-step="preview"] #constructor-buy { grid-column:3; justify-self:end; min-width:0; }
@media(max-width:720px) {
  [data-step="preview"] .constructor-bottom { grid-template-columns:minmax(0,1fr); }
  [data-step="preview"] #constructor-add, [data-step="preview"] #constructor-buy { grid-column:1; justify-self:center; }
}


.constructor-top-actions:has(> :nth-child(2)),.constructor-edit-actions:has(> :nth-child(2)){
  display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,8.5rem),1fr));grid-auto-rows:1fr;align-items:stretch;
}
:is(.constructor-top-actions,.constructor-edit-actions)>:is(button,a){margin:0;min-width:0;min-height:44px;align-content:center;text-align:center}

.constructor-config-actions {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,12rem),1fr));
  grid-auto-rows:1fr; gap:6px; margin-block:8px;
}
.constructor-config-actions .constructor-button {width:100%; min-width:0; min-height:44px; text-align:center; justify-content:center}
@media(min-width:721px) {
  body.constructor-shell {height:auto;min-height:100dvh;overflow:visible;grid-template-rows:auto 1fr auto}
  .constructor-main,.constructor-sidebar {overflow:visible}
  .constructor-preview {height:auto;min-height:65dvh;grid-template-rows:auto minmax(24rem,1fr)}
}
