/* The profile editor (design round 3 draft) — product chrome on the Zen palette, on top of Bootstrap 5.3. */
:root { --zp-teal: #0F3D3A; --zp-teal-2: #145C57; --zp-teal-soft: #E3EFEC; --zp-cream: #F6F1E5; --zp-paper: #FFFDF8; --zp-charcoal: #1E2420; --zp-muted: #5F6B66; --zp-gold: #C9A227; --zp-line: #E3DED3; --zp-danger: #B3261E; --bs-body-bg: var(--zp-cream); --bs-body-color: var(--zp-charcoal); --bs-link-color: var(--zp-teal-2); --bs-border-color: var(--zp-line); }
body { font-family: Inter, system-ui, sans-serif; background: var(--zp-cream); color: var(--zp-charcoal); }
h1, h2, h3, .ed-brand { font-family: Fraunces, Georgia, serif; font-weight: 500; }

/* top bar */
.ed-top { position: sticky; top: 0; z-index: 20; background: var(--zp-teal); color: var(--zp-cream); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px clamp(16px, 3vw, 32px); }
.ed-brand { font-size: 1.3rem; color: #fff; text-decoration: none; display: inline-flex; align-items: baseline; gap: 10px; }
.ed-brand small { font-family: Inter, system-ui, sans-serif; font-size: .8rem; color: rgba(255,255,255,.7); }
.ed-top__right { margin-inline-start: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ed-top .btn-light { --bs-btn-bg: var(--zp-cream); --bs-btn-color: var(--zp-teal); --bs-btn-border-color: var(--zp-cream); font-weight: 600; }
.ed-top .btn-outline-light { --bs-btn-color: #fff; --bs-btn-border-color: rgba(255,255,255,.55); --bs-btn-hover-bg: rgba(255,255,255,.12); --bs-btn-hover-color: #fff; }
.ed-top .form-select-sm { width: auto; max-width: 220px; background-color: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.4); }
.ed-top .form-select-sm option { color: var(--zp-charcoal); }

/* layout */
/* full-width workbench: 10 % tree · 40 % editor · 50 % live preview on desktop (the preview column is added at 1200 px, below) */
.ed-layout { width: 100%; padding: 16px clamp(12px, 1.5vw, 24px) 64px; margin: 0; display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) { .ed-layout { grid-template-columns: minmax(150px, 10%) minmax(0, 1fr); } .ed-nav { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; scrollbar-width: thin; } }
.ed-nav { align-self: start; min-width: 0; }
.ed-nav h2 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--zp-muted); font-family: Inter, system-ui, sans-serif; font-weight: 600; margin: 0 0 8px; }
.ed-nav ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ed-nav a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; text-decoration: none; color: var(--zp-charcoal); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-nav a:hover { background: var(--zp-teal-soft); }
.ed-nav .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--zp-line); flex: none; }
.ed-nav .dot.on { background: var(--zp-teal); }
.ed-nav__note { font-size: .8rem; color: var(--zp-muted); margin: 14px 0 0; line-height: 1.45; }
.ed-main { display: grid; gap: 16px; min-width: 0; }
.ed-intro { background: var(--zp-teal-soft); border-radius: 14px; padding: 12px 18px; display: grid; gap: 2px; }
.ed-intro h1 { font-size: clamp(1.3rem, 2vw, 1.6rem); margin: 0; }
.ed-intro p { font-size: .9rem; }
.ed-intro p { margin: 0; color: var(--zp-muted); }

/* section cards */
.ed-card { background: var(--zp-paper); border: 1px solid var(--zp-line); border-radius: 14px; padding: clamp(16px, 2.5vw, 24px); display: grid; gap: 14px; scroll-margin-top: 80px; }
.ed-card__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; border-block-end: 1px solid var(--zp-line); padding-block-end: 12px; }
.ed-card__head h2 { font-size: 1.3rem; margin: 0; }
.ed-card__head .ed-hint { color: var(--zp-muted); font-size: .85rem; flex-basis: 100%; }
.ed-card__head .form-check { margin-inline-start: auto; margin-bottom: 0; }
.form-check-input:checked { background-color: var(--zp-teal); border-color: var(--zp-teal); }
.ed-card .form-label { font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.ed-card .form-text { color: var(--zp-muted); }
.ed-card .form-control, .ed-card .form-select { background: #fff; border-color: var(--zp-line); min-height: 42px; }
.ed-card .form-control:focus, .ed-card .form-select:focus { border-color: var(--zp-teal); box-shadow: 0 0 0 3px rgba(15,61,58,.15); }
.ed-grid { display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.ed-grid .span-all { grid-column: 1 / -1; }
.ed-prefix { display: flex; align-items: stretch; }
.ed-prefix span { padding: 0 10px; display: inline-flex; align-items: center; background: var(--zp-teal-soft); border: 1px solid var(--zp-line); border-inline-end: 0; border-radius: 8px 0 0 8px; color: var(--zp-muted); font-size: .9rem; white-space: nowrap; }
.ed-prefix .form-control { border-radius: 0 8px 8px 0; }
.ed-title-field { max-width: 360px; }

/* repeaters */
.ed-rows { display: grid; gap: 12px; }
.ed-row { border: 1px solid var(--zp-line); border-radius: 10px; padding: 14px; background: #fff; display: grid; gap: 12px; }
.ed-row__bar { display: flex; align-items: center; gap: 8px; }
.ed-row__bar strong { font-size: .8rem; color: var(--zp-muted); letter-spacing: .06em; text-transform: uppercase; }
.ed-row__bar .btn { --bs-btn-padding-y: .2rem; --bs-btn-padding-x: .55rem; --bs-btn-font-size: .8rem; }
.ed-row__bar .btn-remove { margin-inline-start: auto; --bs-btn-color: var(--zp-danger); --bs-btn-border-color: transparent; --bs-btn-hover-bg: #fbeae8; --bs-btn-hover-color: var(--zp-danger); }
.ed-add { justify-self: start; --bs-btn-color: var(--zp-teal); --bs-btn-border-color: var(--zp-teal); --bs-btn-hover-bg: var(--zp-teal); --bs-btn-hover-color: #fff; font-weight: 600; }
.ed-empty { color: var(--zp-muted); font-size: .9rem; margin: 0; }
.ed-rows:not(:empty) + .ed-empty { display: none; }

/* pills, level picker, visibility, images */
.ed-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ed-pills label { border: 1px solid var(--zp-line); border-radius: 999px; padding: 7px 14px; background: #fff; cursor: pointer; font-weight: 500; display: inline-flex; gap: 8px; align-items: center; }
.ed-pills input { margin: 0; }
.ed-pills label:has(input:checked) { background: var(--zp-teal); color: #fff; border-color: var(--zp-teal); }
.ed-level { display: inline-flex; gap: 4px; }
.ed-level label { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--zp-line); display: grid; place-items: center; font-size: .8rem; cursor: pointer; background: #fff; position: relative; }
.ed-level input { position: absolute; opacity: 0; width: 0; height: 0; }
.ed-level label:has(input:checked) { background: var(--zp-teal); color: #fff; border-color: var(--zp-teal); }
.ed-vis { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.ed-vis .form-check { margin: 0; }
.ed-image { display: grid; gap: 8px; grid-template-columns: 72px minmax(0, 1fr); align-items: center; }
.ed-image__thumb { width: 72px; height: 72px; border-radius: 10px; background: var(--zp-teal-soft); border: 1px dashed var(--zp-line); display: grid; place-items: center; color: var(--zp-muted); font-size: .72rem; text-align: center; overflow: hidden; }
.ed-image__thumb--wide { height: 48px; }

/* footer actions and the JSON drawer */
.ed-actions { position: sticky; bottom: 0; background: linear-gradient(to top, var(--zp-cream) 70%, transparent); padding: 16px 0 8px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ed-actions .btn-primary { --bs-btn-bg: var(--zp-teal); --bs-btn-border-color: var(--zp-teal); --bs-btn-hover-bg: var(--zp-teal-2); --bs-btn-hover-border-color: var(--zp-teal-2); font-weight: 600; }
.ed-actions .btn-outline-primary { --bs-btn-color: var(--zp-teal); --bs-btn-border-color: var(--zp-teal); --bs-btn-hover-bg: var(--zp-teal); font-weight: 600; }
.ed-saved { color: var(--zp-muted); font-size: .85rem; }
.ed-json { background: var(--zp-charcoal); color: #E8F0EC; border-radius: 12px; padding: 16px; font-family: ui-monospace, monospace; font-size: .8rem; line-height: 1.5; max-height: 70vh; overflow: auto; white-space: pre; margin: 0; }
.modal-content { border-radius: 14px; border: 0; }
.modal-header { background: var(--zp-teal); color: #fff; }
.modal-header .btn-close { filter: invert(1); }
.ed-note { font-size: .85rem; color: var(--zp-muted); }

/* ---------- live preview ---------- */
@media (min-width: 1200px) { .ed-layout { grid-template-columns: minmax(150px, 10fr) minmax(0, 40fr) minmax(0, 50fr); } .ed-preview { position: sticky; top: 76px; align-self: start; } .ed-fab { display: none; } }
.ed-preview { display: grid; gap: 10px; min-width: 0; }
.ed-preview__bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--zp-paper); border: 1px solid var(--zp-line); border-radius: 12px; padding: 8px 10px; font-size: .9rem; }
.ed-preview__bar .label { color: var(--zp-muted); }
.ed-preview__name { font-weight: 700; }
.ed-preview__bar .btn { --bs-btn-padding-y: .25rem; --bs-btn-padding-x: .6rem; --bs-btn-font-size: .85rem; }
.ed-preview__bar .btn-teal { --bs-btn-bg: var(--zp-teal); --bs-btn-border-color: var(--zp-teal); --bs-btn-color: #fff; --bs-btn-hover-bg: var(--zp-teal-2); --bs-btn-hover-border-color: var(--zp-teal-2); --bs-btn-hover-color: #fff; font-weight: 600; }
.ed-preview__bar .btn-outline-secondary.active { background: var(--zp-teal-soft); border-color: var(--zp-teal); color: var(--zp-teal); }
.ed-preview__bar .form-select-sm { width: auto; }
.ed-preview__frame { background: #fff; border: 1px solid var(--zp-line); border-radius: 14px; overflow: hidden; height: calc(100vh - 150px); min-height: 520px; transition: width .2s; }
.ed-preview__frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.ed-preview__frame--phone { width: 390px; max-width: 100%; margin: 0 auto; border: 8px solid #111; border-radius: 30px; }
.ed-preview__note { font-size: .78rem; color: var(--zp-muted); margin: 0; }
.ed-fab { position: fixed; right: 16px; bottom: 16px; z-index: 30; --bs-btn-bg: var(--zp-teal); --bs-btn-border-color: var(--zp-teal); --bs-btn-color: #fff; --bs-btn-hover-bg: var(--zp-teal-2); font-weight: 600; box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); }
.offcanvas.ed-offcanvas { width: min(100%, 560px); }
.offcanvas.ed-offcanvas .ed-preview__frame { height: calc(100vh - 140px); }

/* ---------- template picker ---------- */
.ed-tpl-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.ed-tpl-filters .btn { --bs-btn-padding-y: .25rem; --bs-btn-padding-x: .7rem; --bs-btn-font-size: .85rem; border-radius: 999px; }
.ed-tpl-filters .btn.active { background: var(--zp-teal); color: #fff; border-color: var(--zp-teal); }
.ed-tpl-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, 256px); justify-content: center; }
.ed-tpl { border: 1px solid var(--zp-line); border-radius: 12px; overflow: hidden; background: #fff; display: grid; grid-template-rows: auto 1fr auto; }
.ed-tpl--current { outline: 3px solid var(--zp-teal); outline-offset: 1px; }
.ed-tpl__frame { width: 256px; height: 320px; overflow: hidden; position: relative; background: var(--zp-teal-soft); }
.ed-tpl__frame iframe { width: 1280px; height: 1600px; transform: scale(.2); transform-origin: 0 0; border: 0; pointer-events: none; position: absolute; inset-inline-start: 0; top: 0; }
.ed-tpl__body { padding: 10px 12px; display: grid; gap: 4px; }
.ed-tpl__body strong { font-family: Fraunces, Georgia, serif; font-size: 1.05rem; font-weight: 500; }
.ed-tpl__body .cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--zp-muted); }
.ed-tpl__body .concept { font-size: .82rem; color: var(--zp-muted); line-height: 1.35; }
.ed-tpl__foot { display: flex; gap: 6px; padding: 0 12px 12px; }
.ed-tpl__foot .btn { --bs-btn-padding-y: .3rem; --bs-btn-font-size: .85rem; flex: 1; }
.ed-tpl__foot .btn-teal { --bs-btn-bg: var(--zp-teal); --bs-btn-border-color: var(--zp-teal); --bs-btn-color: #fff; --bs-btn-hover-bg: var(--zp-teal-2); --bs-btn-hover-color: #fff; font-weight: 600; }
