/* Card page studio (app-card.html). Loads after app-cv.css: all editor chrome (.cx-*) is the CV studio's.
   This file only adds the card page canvas (.cb-*), the block / design / publish panels and a few overrides. Needs p1-1.css for the pc-* blocks. */

/* ---------- toolbar bits ---------- */
.cb .cx-dl { justify-content: center; }
@media (min-width: 1241px) { .cb .cx-dl { min-width: 120px; } }
.cb .cb-device button { padding: 0 9px; }
.cb .cb-device .qq-ic { width: 17px; height: 17px; }
.cb-pill { display: inline-flex; align-items: center; gap: 6px; }
.cb-pill[hidden] { display: none; }
.cb-spin { animation: cb-spin 1s linear infinite; }
@keyframes cb-spin { to { transform: rotate(360deg); } }
.cx-sec h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cb-reset { height: 24px; padding: 0 8px; font-size: .72rem; text-transform: none; letter-spacing: 0; }

/* ---------- stage + page ---------- */
.cb .cx-stage .cvb-scale { margin: 0 auto; }
.cb-page {
  --cb-bg: #f4f4f5; --surface: #ffffff; --text: #0a0a0a; --text-2: #52525b; --line: #e7e7e9; --line-2: #d4d4d8;
  --ink: #0a0a0a; --on-ink: #ffffff; --accent: #166534; --on-accent: #ffffff; --pill: 999px; --cb-r: 18px;
  --surface-2: color-mix(in srgb, var(--surface) 93%, var(--text)); --surface-3: color-mix(in srgb, var(--surface) 86%, var(--text));
  --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--surface)); --accent-line: color-mix(in srgb, var(--accent) 38%, var(--surface));
  --sh-1: 0 1px 2px rgba(0,0,0,.08); --sh-2: 0 8px 24px -10px rgba(0,0,0,.28);
  position: relative; box-sizing: border-box; transform-origin: 0 0; background: var(--cb-bg); color: var(--text);
  font-family: var(--cb-font, inherit); font-size: 16px; line-height: 1.5;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.35), 0 0 0 1px rgba(0,0,0,.08);
}
.cb-page[data-device="phone"] { width: 390px; min-height: 780px; padding: 16px 14px 36px; border-radius: 34px; }
.cb-page[data-device="desktop"] { width: 1000px; min-height: 640px; padding: 28px 20px 56px; border-radius: 10px; }
.cb-page[data-cb-theme="meadow"] { --cb-bg: #e8f3ec; --surface: #f8fbf9; --line: #d3e6da; --line-2: #b7d4c2; --ink: #166534; --accent: #166534; }
.cb-page[data-cb-theme="midnight"] { --cb-bg: #0f1115; --surface: #1b1e24; --text: #f3f2f1; --text-2: #b9b7b4; --line: #2e323a; --line-2: #3d424d; --ink: #f3f2f1; --on-ink: #101216; --accent: #6fcf97; --on-accent: #10261a; --sh-2: 0 8px 24px -10px rgba(0,0,0,.7); color-scheme: dark; }
.cb-page[data-cb-theme="ocean"] { --cb-bg: #e6eefb; --surface: #f8fbff; --line: #d5e1f5; --line-2: #b6c9ef; --ink: #1d4ed8; --accent: #1d4ed8; }
.cb-page[data-bgk="gradient"] { background: linear-gradient(165deg, var(--cb-bg), color-mix(in srgb, var(--cb-bg) 55%, var(--accent))); }
.cb-page[data-bgk="pattern"] { background-color: var(--cb-bg); background-image: radial-gradient(color-mix(in srgb, var(--text) 20%, transparent) 1.3px, transparent 1.3px); background-size: 18px 18px; }
.cb-page[data-bgk="image"] { background: var(--cb-bg) var(--cb-bg-img, none) center / cover; }
.cb-page[data-device="phone"] { --cb-pad: 18px; }
.cb-card { max-width: 680px; margin: 0 auto; grid-template-columns: minmax(0, 1fr); padding-bottom: 26px; min-height: 120px; }
.cb-page[data-device="phone"] .cb-card { padding-bottom: 22px; }
.cb-page .pc-card { background: var(--surface); }

/* the same responsive rules the public page applies under 560 px, driven by the preview width */
.cb-page[data-device="phone"] .pc-prof, .cb-page[data-device="phone"] .pc-sec { padding-left: 18px; padding-right: 18px; }
.cb-page[data-device="phone"] .pc-div { margin: 20px 18px 0; }
.cb-page[data-device="phone"] .pc-socials { grid-template-columns: repeat(2, 1fr); }
.cb-page[data-device="phone"] .pc-contact { grid-template-columns: 1fr; }
.cb-page[data-device="phone"] .pc-gal { grid-template-columns: 1fr 1fr; }
.cb-page[data-device="phone"] .pc-prof h1 { font-size: 2.4rem; }
.cb-page[data-device="desktop"] .pc-prof h1 { font-size: 3.4rem; }
.cb-page[data-device="desktop"] .pc-contact { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.cb-page[data-fnt="1"] .pc-prof h1 { font-family: var(--cb-font); text-transform: none; letter-spacing: -.02em; line-height: 1.1; }
.cb-page .pc-sec:last-child { padding-bottom: 0; }
.cb-page .pc-link, .cb-page .pc-socials a { border-radius: var(--cb-r); }
.cb-page .pc-link:hover, .cb-page .pc-socials a:hover { transform: none; }
.cb-page[data-sh="round"] { --pill: 14px; --cb-r: 14px; }
.cb-page[data-sh="square"] { --pill: 4px; --cb-r: 4px; }
.cb-page .pc-socials a .cb-plain { font-style: normal; }
.cb-page .qq-btn--dark { color: var(--on-ink); }
.cb-page[data-bs="outline"] .qq-btn--dark { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.cb-page[data-bs="outline"] .pc-link, .cb-page[data-bs="outline"] .pc-socials a { border: 2px solid var(--ink); }
.cb-page[data-bs="soft"] .qq-btn--dark { background: var(--accent-soft); color: var(--ink); box-shadow: none; }
.cb-page[data-bs="soft"] .pc-link, .cb-page[data-bs="soft"] .pc-socials a { background: var(--accent-soft); border-color: transparent; }

/* ---------- blocks ---------- */
.cb-block { position: relative; padding-top: var(--sp, 0); padding-bottom: var(--sp, 0); border-radius: 6px; cursor: pointer; outline: 2px solid transparent; outline-offset: -2px; transition: outline-color .12s, background .12s; }
.cb-block.has-bg { border-radius: 18px; margin: 6px 10px 0; }
.cb-block:hover { outline: 1.5px dashed rgba(31, 157, 85, .6); }
.cb-block.is-sel, .cb-block.is-sel:hover { outline: 2px solid #1f9d55; }
.cb-block.is-hidden { display: none; }
.cb-block.is-locked { cursor: not-allowed; }
.cb-block.is-drag { opacity: .4; }
.cb-block[data-kind="divider"] { padding-block: calc(8px + var(--sp, 0px)); }
.cb-block[data-font] .pc-prof h1 { font-family: inherit; text-transform: none; letter-spacing: -.02em; line-height: 1.1; }
.cb-block[data-align] .pc-prof { text-align: var(--al); justify-items: var(--ji); }
.cb-block[data-align] :is(.pc-sec h2, .pc-text, .cb-cap, .pc-map__tx) { text-align: var(--al); }
.cb-block[data-align="left"] { --al: left; --ji: start; }
.cb-block[data-align="center"] { --al: center; --ji: center; }
.cb-block[data-align="right"] { --al: right; --ji: end; }
.cb-block [contenteditable="true"] { outline: 2px solid var(--accent-line); border-radius: 4px; cursor: text; min-width: 12px; }
.cb-page.is-preview .cb-block { outline-color: transparent; cursor: default; }
.cb-page.is-preview .cb-tools { display: none; }
.cb-page.is-preview .pc-link, .cb-page.is-preview .qq-btn { cursor: pointer; }
.cb-page.is-preview .pc-link:hover { transform: translateY(-1px); }
.cb-tools { position: absolute; top: 6px; right: 6px; z-index: 6; display: flex; gap: 1px; padding: 3px; border-radius: 10px; background: #0a0a0a; box-shadow: 0 6px 16px -4px rgba(0,0,0,.45); }
.cb-tools button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: none; color: #fff; cursor: pointer; }
.cb-tools button:hover { background: rgba(255,255,255,.2); }
.cb-tools .qq-ic { width: 15px; height: 15px; }
.cb-tools [data-tool="drag"] { cursor: grab; touch-action: none; }
.cb-block.is-drop-before::before, .cb-block.is-drop-after::after { content: ""; position: absolute; left: 10px; right: 10px; z-index: 7; height: 4px; border-radius: 2px; background: #1f9d55; pointer-events: none; }
.cb-block.is-drop-before::before { top: 0; }
.cb-block.is-drop-after::after { bottom: 0; }
body.cb-sorting, body.cb-sorting * { cursor: grabbing !important; user-select: none; }
.cb-av { overflow: hidden; }
.cb-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cb-vcard { width: 100%; }
.cb-cap { margin: 0; color: var(--text-2); font-size: .9rem; }
.cb-gimg { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--cb-r); border: 1px solid var(--line); background: var(--surface-2); }
.cb-gimg img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cb-gal--1 { grid-template-columns: 1fr !important; }
.cb-gal--1 .cb-gimg { aspect-ratio: 16 / 10; }
.pc-gal__it { display: block; }
.cb-video { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 16px; color: #fff; background: linear-gradient(135deg, color-mix(in srgb, var(--ink) 80%, #000), color-mix(in srgb, var(--accent) 55%, #000)); }
.cb-video__play { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; background: rgba(255,255,255,.94); color: #0a0a0a; box-shadow: 0 8px 24px -6px rgba(0,0,0,.5); }
.cb-video__play .qq-ic { width: 26px; height: 26px; margin-left: 3px; }
.cb-video__src { position: absolute; left: 12px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.55); font-size: .78rem; font-weight: 600; }
.cb-video__src .qq-ic { width: 14px; height: 14px; }
.cb-qr { justify-items: center; text-align: center; }
.cb-qr h2 { justify-self: stretch; }
.cb-qr .pc-qrbox svg { width: 160px; }
.cb-div--dots { border-top: 3px dotted var(--line-2); }
.cb-div--space { border-top-color: transparent; margin-top: 18px; }

/* ---------- left panel ---------- */
.cb-dots { grid-template-columns: repeat(4, 1fr); }
.cb-dots em { display: block; }
.cb-dots span { width: 38px; height: 38px; }
.cb-addgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cb-addtile { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 8px; align-items: center; padding: 7px 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font: inherit; color: var(--text); text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.cb-addtile:hover { border-color: var(--ink); background: var(--surface-2); }
.cb-addtile > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.cb-addtile .qq-ic { width: 17px; height: 17px; }
.cb-addtile b { font-size: .8rem; line-height: 1.2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-order li, .cb-layers li { position: relative; }
.cb-order li { cursor: pointer; }
.cb-order li.is-on { border-color: var(--ink); background: var(--accent-soft); }
.cb-order b { display: grid; gap: 1px; }
.cb-order b small { color: var(--text-2); font-size: .72rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-order b small:empty { display: none; }
.cb-order .cx-lx { opacity: 0; transition: opacity .15s; width: 28px; height: 28px; }
.cb-order li:hover .cx-lx, .cb-order li.is-on .cx-lx, .cb-order li:focus-within .cx-lx { opacity: 1; }
@media (hover: none) { .cb-order .cx-lx { opacity: 1; } }
.cb-order li.is-hidden b { text-decoration: line-through; color: var(--text-2); }
.cb-grip { display: inline-flex; flex: none; color: var(--text-2); cursor: grab; touch-action: none; padding: 4px 2px; }
.cb-grip .qq-ic { width: 16px; height: 16px; }
.cb-kic { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 9px; background: var(--surface-2); }
.cb-kic .qq-ic { width: 15px; height: 15px; }
.cb-order li.is-drag, .cb-layers li.is-drag { opacity: .4; }
.cb-order li.is-drop-before::before, .cb-order li.is-drop-after::after, .cb-layers li.is-drop-before::before, .cb-layers li.is-drop-after::after { content: ""; position: absolute; left: 6px; right: 6px; height: 3px; border-radius: 2px; background: #1f9d55; pointer-events: none; }
.cb-order li.is-drop-before::before, .cb-layers li.is-drop-before::before { top: -3px; }
.cb-order li.is-drop-after::after, .cb-layers li.is-drop-after::after { bottom: -3px; }
.cx-link { text-decoration: none; }
.cx-hint { margin: 0; color: var(--text-2); font-size: .76rem; }

/* theme tiles */
.cb-tp { display: grid; gap: 5px; align-content: center; width: 100%; aspect-ratio: 210 / 130; padding: 10px 24%; border-radius: 8px; background: var(--p); border: 1px solid var(--line); }
.cb-tp i { display: block; height: 9px; border-radius: 4px; background: var(--c); border: 1px solid rgba(0,0,0,.08); }
.cb-tp i:first-child { height: 14px; width: 60%; margin: 0 auto; border-radius: 7px; background: var(--k); border: 0; }
.cb-tp i:last-child { background: var(--k); border: 0; width: 70%; margin: 0 auto; }
.cb-tp--paper { --p: #f4f4f5; --c: #fff; --k: #0a0a0a; }
.cb-tp--meadow { --p: #e8f3ec; --c: #f8fbf9; --k: #166534; }
.cb-tp--midnight { --p: #0f1115; --c: #2a2e36; --k: #f3f2f1; }
.cb-tp--ocean { --p: #e6eefb; --c: #f8fbff; --k: #1d4ed8; }
.cb-bgthumb { border-radius: 10px; background: var(--surface-2) center / cover no-repeat; }

/* publish */
.cb-status { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); }
.cb-status__ic { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 11px; background: var(--surface-2); color: var(--text-2); }
.cb-status__ic .qq-ic { width: 19px; height: 19px; }
.cb-status b { display: block; font-size: .95rem; } .cb-status small { color: var(--text-2); font-size: .8rem; }
.cb-status.is-live { border-color: var(--accent-line); background: var(--accent-soft); }
.cb-status.is-live .cb-status__ic { background: var(--accent); color: var(--on-accent); }
.cb-pre { color: var(--text-2); font-size: .86rem; font-weight: 600; white-space: nowrap; }
.cb-avail { display: flex; align-items: center; gap: 7px; margin: -4px 0 0; font-size: .82rem; font-weight: 600; }
.cb-avail .qq-ic { width: 16px; height: 16px; flex: none; }
.cb-avail[data-state="ok"] { color: var(--accent); }
.cb-avail[data-state="bad"] { color: #c2321f; }
.cb-avail[data-state="busy"] { color: var(--text-2); }
.cb-pubbtns { display: grid; gap: 8px; }
.cb-pubbtns .qq-btn { justify-content: center; }
.cb-pubbtns .qq-btn:disabled { opacity: .45; pointer-events: none; }
.cb-pubbtns [hidden] { display: none; }
.cb-sharestate { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--bg-2); color: var(--text-2); font-size: .84rem; font-weight: 600; }
.cb-sharestate .qq-ic { width: 16px; height: 16px; flex: none; }
.cb-sharestate.is-live { background: var(--accent-soft); color: var(--accent); }
.cb-qrbtns { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- inspector content ---------- */
.cb-content { display: grid; gap: 10px; min-width: 0; }
.cb-item { display: grid; gap: 10px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); }
.cb-item__hd { display: flex; align-items: center; gap: 2px; }
.cb-item__n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: .72rem; font-weight: 700; }
.cb-item__sp { flex: 1; }
.cb-item .cx-ib { width: 28px; height: 28px; } .cb-item .cx-ib .qq-ic { width: 14px; height: 14px; }
.cb-thumb { border-radius: 10px; }
.cx-dd--rich .cx-dd__btn > .qq-ic:first-child { width: 17px; height: 17px; color: var(--text); }
.cx-dd--rich .cx-dd__pop { max-height: 232px; overflow-y: auto; }
.cx-dd--rich .cx-dd__pop button { justify-content: flex-start; gap: 10px; text-transform: capitalize; }
.cx-dd--rich .cx-dd__pop button .qq-ic:first-child { width: 17px; height: 17px; flex: none; }
.cx-dd--rich .cx-dd__pop button span { flex: 1; }
.cx-dd--rich .cx-dd__ok { margin-left: auto; }
.cx-dd__pop .qq-ic { flex: none; }
.cx-switch { position: relative; }
.cx-addrow { width: 100%; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .cb .cb-device, .cb .cx-seg[data-cv-mode] { display: none; }
  .cb-dots em { font-size: .6rem; }
  .cb-page[data-device="phone"] { min-height: 700px; }
}

/* undo / redo stay in the toolbar on tablets and phones (the CV studio hides them there) */
@media (max-width: 1180px) { .cb .cx-bar .cx-hist { display: flex; } }
@media (max-width: 900px) { .cb .cx-hist { padding-left: 2px; margin-left: 0; border-left: 0; } .cb .cx-grp { padding-left: 0; margin-left: 0; border-left: 0; } .cb .cx-bar { gap: 4px; } .cb .cx-name { max-width: 120px; } }

/* property header: name keeps room next to four small buttons */
.cb .cx-ph { gap: 4px; }
.cb .cx-ph .cx-ib { width: 28px; height: 28px; }
.cb .cx-ph .cx-ib .qq-ic { width: 16px; height: 16px; }
/* block list rows never push the panel wider */
.cb-order, .cb-layers { min-width: 0; }
.cb-order li, .cb-layers li { min-width: 0; }
.cb-order b { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-order b small { display: block; }
.cb .cx-f > .cx-f__l em { font-style: normal; }

/* toolbar: it carries two more controls than the CV studio (width switch, undo/redo on small screens) */
@media (max-width: 1240px) { .cb .cx-name { max-width: 120px; } .cb .cx-bar { gap: 6px; } }
@media (max-width: 1400px) { .cb .cx-seg[data-cv-mode] span { display: none; } .cb .cx-seg[data-cv-mode] button { padding: 0 9px; } }
@media (max-width: 1320px) { .cb .cx-zoom [data-zoom-out], .cb .cx-zoom [data-zoom-in] { display: none; } .cb .cx-name { max-width: 150px; } }
@media (max-width: 1180px) { .cb .cx-grp { padding-left: 2px; margin-left: 0; } }
@media (max-width: 480px) { .cb .cx-name { max-width: 84px; } .cb .cx-bar { padding: 8px 6px; } }

/* image fit + position dropdowns (profile photo, gallery images) */
.cb-fitpos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.cb-fitpos .cx-dd { min-width: 0; }
.cb-fitpos .cx-dd__btn { padding-left: 8px; padding-right: 8px; gap: 6px; }
.cb-fitpos .cx-dd__btn [data-dd-label] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* publish + unpublish confirm windows */
.cb-pubbox { text-align: left; width: min(480px, 100%); }
.cb-pubbox h2 { padding-right: 36px; }
.cb-pubbox .cb-pubbtns { grid-template-columns: 1fr 1fr; }
.cb-pubsum { display: grid; gap: 0; margin: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--bg-2); }
.cb-pubsum div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; font-size: .86rem; }
.cb-pubsum div + div { border-top: 1px solid var(--line); }
.cb-pubsum dt { color: var(--text-2); font-weight: 600; flex: none; }
.cb-pubsum dd { margin: 0; font-weight: 700; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.cb-pubqr { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; }
.cb-pubqr .cx-switch { flex: 1; min-width: 0; line-height: 1.3; }
.cb-pubqr__pv { display: block; width: 56px; height: 56px; flex: none; padding: 4px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: #0a0a0a; transition: opacity .2s; }
.cb-pubqr__pv svg { display: block; width: 100%; height: 100%; }
.cb-pubqr__hint { margin: -6px 0 0; }
/* bot-protection slot, same shape as the Turnstile widget (placeholder, no key, no external script) */
.cb-ts { display: flex; align-items: center; gap: 12px; height: 65px; padding: 0 12px; border: 1px dashed var(--line-2); border-radius: 6px; background: var(--bg-2); }
.cb-ts__box { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); color: var(--text-2); }
.cb-ts__box .qq-ic { width: 16px; height: 16px; }
.cb-ts__tx { flex: 1; min-width: 0; display: grid; }
.cb-ts__tx b { font-size: .9rem; } .cb-ts__tx small, .cb-ts__by small { color: var(--text-2); font-size: .7rem; }
.cb-ts__by { display: grid; text-align: right; font-size: .72rem; line-height: 1.2; }
.cb-noqr { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px dashed var(--line-2); border-radius: 14px; }
.cb-noqr[hidden] { display: none; }
.cb-noqr p { margin: 0; font-size: .86rem; text-align: left; }
@media (max-width: 480px) { .cb-pubbox .cb-pubbtns { grid-template-columns: 1fr; } .cb-noqr { flex-direction: column; align-items: stretch; } .cb-noqr .qq-btn { justify-content: center; } }
