:root {
  --accent: #ed4c87;
  --accent-dark: #d53d78;
  --line: #e6e6ec;
  --muted: #6f7280;
  --panel: #ffffff;
  --bg: #f4f4f6;
  --text: #22232b;
  --shadow: 0 18px 45px rgb(0 0 0 / .16);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, input, select { font: inherit; }
button, select, input {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--text);
  min-height: 34px;
}
button { cursor: pointer; padding: 0 14px; }
button:hover { border-color: var(--accent); }
button.secondary { width: 100%; color: var(--muted); }
input, select { width: 100%; padding: 6px 11px; }
input:focus, select:focus { outline: 2px solid rgb(237 76 135 / .22); border-color: var(--accent); }

.constructor-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 330px minmax(620px, 1fr) 285px;
}
.left-panel, .right-panel {
  height: 100vh;
  overflow: auto;
  background: var(--panel);
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
}
.right-panel { border-right: 0; border-left: 1px solid var(--line); padding: 15px 16px 32px; }
.left-panel { padding: 16px 17px 34px; }
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: clamp(26px, 2.4vw, 38px);
  font-weight: 850;
  letter-spacing: -1.7px;
  margin-bottom: 23px;
  white-space: nowrap;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #101117;
  color: #fff;
  font-size: 20px;
  flex: 0 0 auto;
}
.control-group { margin: 0 0 18px; }
.control-group h3, .right-panel h3 {
  margin: 0 0 10px;
  text-transform: uppercase;
  text-align: center;
  font-size: clamp(11px, 1vw, 14px);
  letter-spacing: .4px;
  color: var(--accent);
  white-space: nowrap;
}
.field-label, label span { display: block; font-size: 11px; color: var(--muted); margin: 0 0 4px 8px; }
.compact input { margin-bottom: 8px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.field-row label input { margin-bottom: 0; }
.hint { margin: 4px 8px 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.toggle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.toggle-grid label, .pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 31px;
  border: 1px solid #e2e2e2;
  border-radius: 17px;
  background: #f0f0f1;
  font-size: 12px;
  color: #333;
  cursor: pointer;
  user-select: none;
}
.toggle-grid input, .pill input { width: auto; min-height: auto; accent-color: var(--accent); }
.toggle-grid label:has(input:checked), .pill:has(input:checked) { border-color: var(--accent); background: #fff1f6; }
.shape-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; }
.shape-button {
  height: 52px;
  border-radius: 8px;
  padding: 0;
  display: grid;
  place-items: center;
}
.shape-button svg { width: 35px; height: 35px; fill: #8f98a0; }
.shape-button.is-active { border-color: var(--accent); background: #fff4f8; }
.two-buttons button, .two-buttons label { width: 100%; }
.preview-panel { min-width: 0; display: grid; grid-template-rows: auto 1fr auto; height: 100vh; }
.preview-toolbar {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 9px 14px;
}
.preview-toolbar select { max-width: 280px; }
.preview-stage { overflow: auto; display: grid; place-items: center; padding: 26px 34px 50px; }
.preview-card { width: min(560px, 78vh); max-width: 100%; box-shadow: var(--shadow); background: #fff; }
.preview-card svg { display: block; width: 100%; height: auto; }
.status-line { border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; padding: 8px 18px; min-height: 32px; }
.template-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.template-button {
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  border: 2px solid transparent;
  box-shadow: 0 1px 4px rgb(0 0 0 / .08);
}
.template-button.is-active { border-color: var(--accent); }
.template-thumb {
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .4px;
  text-align: center;
  padding: 8px;
}
.template-title { padding: 6px 5px 7px; font-size: 11px; line-height: 1.2; background: #fff; }

@media (max-width: 1100px) {
  .constructor-shell { grid-template-columns: 300px minmax(420px, 1fr); }
  .right-panel { display: none; }
}
@media (max-width: 760px) {
  .constructor-shell { display: block; }
  .left-panel, .right-panel, .preview-panel { height: auto; min-height: auto; }
  .preview-stage { padding: 16px; }
  .preview-card { width: min(100%, 420px); }
}

.place-autocomplete { position: relative; }
.place-suggestions {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% - 4px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 35px rgb(0 0 0 / .16);
  overflow: hidden;
  max-height: 310px;
  overflow-y: auto;
}
.place-suggestion {
  width: 100%;
  min-height: auto;
  display: block;
  text-align: left;
  border: 0;
  border-radius: 0;
  padding: 9px 12px;
  background: #fff;
}
.place-suggestion:hover { background: #fff4f8; }
.place-suggestion strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
  color: var(--text);
}
.place-suggestion span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.25;
  color: var(--muted);
}
.place-suggestion.muted {
  color: var(--muted);
  cursor: default;
}
