/* Panel pages: nothing of the page shows before the panel is built and the data is in (see LoadGuard in partials.js). */
html.bk-loading .owner-main > * { visibility: hidden; }

/* Palette is scoped to the current shop and its own panels. */
[data-shop-theme] {
  --accent: var(--shop-primary); --copper: var(--shop-primary); --copper-deep: var(--shop-primary);
  --accent-hi: color-mix(in srgb, var(--shop-primary) 62%, var(--text, white));
  --copper-hi: var(--accent-hi);
  --gl-sel-fill: var(--shop-primary); --gl-sel-text: var(--shop-on-primary);
  --gl-on: var(--shop-primary); --gl-on-text: var(--shop-on-primary);
  --gl-focus: 0 0 0 3px rgba(var(--shop-primary-rgb), .28);
  --gl-gold: var(--shop-primary); --gl-gold-text: var(--accent-hi);
  --gl-gold-fill: rgba(var(--shop-primary-rgb), .16);
  --accent-text: var(--shop-on-primary); --accent-soft: rgba(var(--shop-primary-rgb), .14);
  --accent-gradient: linear-gradient(var(--shop-primary), var(--shop-primary));
  --btn-primary: var(--shop-primary); --btn-primary-hover: var(--shop-primary);
}
:is(html[data-shop-theme], body[data-shop-theme], body [data-shop-theme]) .btn.btn-primary,
:is(html[data-shop-theme], body[data-shop-theme], body [data-shop-theme]) .btn.btn-primary:hover,
:is(html[data-shop-theme], body[data-shop-theme], body [data-shop-theme]) .qb-chip.on,
:is(html[data-shop-theme], body[data-shop-theme], body [data-shop-theme]) .qb-steps button.on,
:is(html[data-shop-theme], body[data-shop-theme], body [data-shop-theme]) .qb-steps button.done b,
:is(html[data-shop-theme], body[data-shop-theme], body [data-shop-theme]) .qb-seg button.on {
  background: var(--shop-primary) !important; color: var(--shop-on-primary) !important; border-color: var(--shop-primary) !important;
  box-shadow: none;
}
:is(html[data-shop-theme], body[data-shop-theme], body [data-shop-theme]) .qb-card.on .ck svg { stroke: var(--shop-on-primary); }
/* inside the shop, accents that are text keep the platform's readable tone */
:root[data-shop-theme], :root body [data-shop-theme], :root body[data-shop-theme] { --copper-ink: var(--shop-primary); --btn-primary-text: var(--shop-on-primary); --btn-primary-edge: var(--shop-primary);
  --gs-gold: var(--shop-primary); --gs-gold-text: var(--shop-primary); --gs-sel-fill: var(--shop-primary); --gs-sel-text: var(--shop-on-primary); }
:root[data-theme] .mxs[data-shop-theme] :is(.mxs-act, .mxs-sec h3, .mxs-stat) svg { stroke: var(--shop-primary); }

/* Vitrine: "Personalize as cores", its own panel above the form, and the window that picks a color */
.vt-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.vt-brand { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.vt-brand h2 { margin: 0 0 4px; text-align: center; font-size: 1.25rem; }
.vt-pick { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; border-radius: 16px; border: 1.5px solid var(--border);
  background: rgba(var(--ink-rgb), .04); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.vt-pick:hover, .vt-pick:focus-visible { border-color: var(--accent); background: rgba(var(--ink-rgb), .07); }
.vt-pick-sw { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(var(--ink-rgb), .25); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .15); }
.vt-pick-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vt-pick-tx b { font-size: .98rem; }
.vt-pick-tx small { font-size: .8rem; color: var(--text-muted); line-height: 1.3; }
.vt-pick-val { flex: none; font-size: .74rem; font-family: ui-monospace, monospace; color: var(--text-muted); }
.vt-pick-go { flex: none; width: 18px; height: 18px; stroke: var(--text-muted); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.vt-reset { align-self: center; margin-top: 2px; padding: 6px 10px; border: 0; background: none; color: var(--accent-hi, var(--accent)); font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 420px) { .vt-pick-val { display: none; } }

.cm-win { width: min(440px, 100%); display: flex; flex-direction: column; gap: 10px; text-align: center; }
.cm-win .modal-head { justify-content: center; position: relative; margin-bottom: 2px; }
.cm-win .modal-head h2 { margin: 0; }
.cm-win .modal-head .modal-close { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.cm-prev { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 16px; border-radius: 16px; border: 1px solid rgba(var(--ink-rgb), .14); transition: background .2s ease, color .2s ease; }
.cm-prev-name { font-family: var(--font-display); font-size: 1.2rem; font-weight: 500; }
.cm-prev-row { display: flex; justify-content: space-between; width: 100%; max-width: 260px; font-size: .84rem; opacity: .8; }
.cm-prev-btn { margin-top: 4px; width: 100%; max-width: 260px; padding: 10px 0; border-radius: 99px; font-weight: 800; font-size: .92rem; transition: background .2s ease, color .2s ease; }
.cm-lbl { margin: 4px 0 0; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
/* all the ready-made colors at once, in centered rows: nothing scrolls, nothing is cut */
.cm-sw { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; padding: 5px; overflow: visible; }
.cm-sw button { justify-self: center; width: 100%; max-width: 36px; aspect-ratio: 1; height: auto; border-radius: 50%; border: 2px solid rgba(var(--ink-rgb), .22); cursor: pointer; padding: 0; transition: transform .12s ease; }
.cm-sw button:hover { transform: scale(1.08); }
@media (max-width: 480px) { .cm-sw { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; } }
.cm-sw button.on { box-shadow: 0 0 0 2px var(--bg-card, #1e1e1e), 0 0 0 4px var(--text); }
.cm-wheel-row { display: flex; align-items: center; justify-content: center; gap: 18px; }
.cm-wheel { position: relative; flex: none; width: 150px; height: 150px; border-radius: 50%; touch-action: none; cursor: crosshair; }
.cm-wheel canvas { width: 100%; height: 100%; border-radius: 50%; display: block; }
.cm-wheel i { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .5); pointer-events: none; }
.cm-side { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.cm-now { width: 56px; height: 56px; border-radius: 14px; border: 2px solid rgba(var(--ink-rgb), .25); }
.cm-hex { display: flex; flex-direction: column; align-items: center; gap: 3px; margin: 0; font-size: .72rem; font-weight: 700; color: var(--text-muted); }
.cm-hex input { width: 108px; min-height: 36px; padding: 6px 8px; border-radius: 10px; text-align: center; font-family: ui-monospace, monospace; font-weight: 800; font-size: .9rem; letter-spacing: .04em; text-transform: uppercase; }
.cm-hex input.bad { border-color: var(--danger) !important; }
.cm-light { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0; font-size: .74rem; font-weight: 700; color: var(--text-muted); }
.cm-light input { width: 110px; accent-color: var(--accent); }
@media (max-height: 760px) { .cm-wheel { width: 128px; height: 128px; } .cm-prev { padding: 10px 14px; } .cm-win { gap: 8px; } }

/* Vitrine: "Seu link de agendamento" and its windows (QR Code, choose the name) */
.vt-link { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0; text-align: center; }
.vt-link h2 { margin: 0; font-size: 1.25rem; }
.vt-link-url { margin: 0; max-width: 100%; padding: 10px 14px; border-radius: 12px; background: rgba(var(--ink-rgb), .06); border: 1px dashed var(--border);
  font-weight: 800; font-size: 1.02rem; color: var(--text); overflow-wrap: anywhere; user-select: all; }
.vt-link-acts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; }
.vt-link-acts:has(#linkShare[hidden]) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vt-link-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 62px; padding: 8px 4px; border-radius: 14px;
  border: 1.5px solid var(--border); background: rgba(var(--ink-rgb), .04); color: var(--text); font: inherit; font-size: .76rem; font-weight: 700; text-decoration: none; cursor: pointer; }
.vt-link-btn[hidden] { display: none; }
.vt-link-btn:hover, .vt-link-btn:focus-visible { border-color: var(--accent); }
.vt-link-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vt-link-btn.is-wa { color: #25D366; }
.vt-link-btn.is-wa span { color: var(--text); }
.lk-win { width: min(420px, 100%); display: flex; flex-direction: column; gap: 12px; text-align: center; }
.lk-win .modal-head { justify-content: center; position: relative; }
.lk-win .modal-head h2 { margin: 0; }
.lk-win .modal-head .modal-close { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.lk-qr { align-self: center; width: min(260px, 72vw); padding: 10px; border-radius: 16px; background: #fff; }
.lk-qr svg { display: block; width: 100%; height: auto; }
.lk-qr-url { margin: 0; font-weight: 800; overflow-wrap: anywhere; }
.lk-field { display: flex; align-items: center; margin: 0; padding: 0 0 0 14px; border-radius: 14px; border: 1.5px solid var(--border); background: rgba(var(--ink-rgb), .04); overflow: hidden; }
.lk-field span { flex: none; color: var(--text-muted); font-weight: 700; font-size: .92rem; }
.lk-field input { flex: 1; min-width: 0; border: 0 !important; background: none !important; box-shadow: none !important; padding: 12px 12px 12px 2px; font-weight: 800; font-size: .98rem; }
.lk-status { margin: 0; min-height: 1.3em; font-size: .86rem; font-weight: 700; color: var(--text-muted); }
.lk-status.ok { color: var(--st-done, #3fb950); }
.lk-status.bad { color: var(--danger); }
@media (max-width: 380px) { .vt-link-btn { font-size: .7rem; min-height: 58px; } }
