/*!
 * "Personalizar" drawer (js/rv-customizer.js). Self-contained: every class is prefixed cz-, nothing depends on base.css.
 * Colours, radius and font come from the --rv-* tokens (with safe fallbacks), so the panel obeys the theme it edits.
 * Right drawer on desktop, bottom sheet at <= 600 px. The scrim is transparent on purpose: the page behind must keep its
 * real colours while you tune them.
 */

.cz-root, .cz-root *, .cz-root *::before, .cz-root *::after { box-sizing: border-box; }

.cz-root {
  --cz-bg: var(--rv-surface, #ffffff);
  --cz-bg-2: var(--rv-surface-2, #f8fafc);
  --cz-bg-3: var(--rv-surface-3, #eef2f7);
  --cz-text: var(--rv-text, #111827);
  --cz-dim: var(--rv-text-dim, #5b6577);
  --cz-faint: var(--rv-text-faint, #8a94a6);
  --cz-border: var(--rv-border, #e4e8f0);
  --cz-border-strong: var(--rv-border-strong, #cfd6e4);
  --cz-accent: var(--rv-accent, #2563eb);
  --cz-accent-2: var(--rv-accent-2, #f97316);
  --cz-accent-ink: var(--rv-accent-ink, #2461e5);
  --cz-accent-soft: var(--rv-accent-soft, #e5ecfd);
  --cz-on-accent: var(--rv-on-accent, #ffffff);
  --cz-focus: var(--rv-focus, #2563eb);
  --cz-danger: var(--rv-danger, #dc2626);
  --cz-danger-ink: var(--rv-danger-ink, #b91c1c);
  --cz-danger-soft: var(--rv-danger-soft, #fbe5e5);
  --cz-radius-sm: var(--rv-radius-sm, 8px);
  --cz-radius: var(--rv-radius, 12px);
  --cz-radius-lg: var(--rv-radius-lg, 18px);
  --cz-font: var(--rv-font, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif);
  --cz-mono: var(--rv-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  --cz-shadow: var(--rv-shadow-lg, 0 18px 40px rgba(16, 24, 40, .14));
  --cz-ease: var(--rv-ease, cubic-bezier(.2, .8, .2, 1));
  --cz-dur: var(--rv-dur-slow, .28s);

  position: fixed;
  inset: 0;
  z-index: var(--rv-z-modal, 1000);         /* above sticky headers and menus, below toasts (--rv-z-toast) */
  visibility: hidden;
  pointer-events: none;
  color: var(--cz-text);
  font-family: var(--cz-font);
  font-size: 1rem;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  transition: visibility 0s linear var(--cz-dur);
}
.cz-root.is-open { visibility: visible; transition-delay: 0s; }

/* resets use :where() (zero specificity) so every component class below can override them */
:where(.cz-root) button { font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0; cursor: pointer; text-align: inherit; border-radius: 0; -webkit-tap-highlight-color: transparent; }
:where(.cz-root) input, :where(.cz-root) textarea { font: inherit; color: inherit; margin: 0; }
:where(.cz-root) h2, :where(.cz-root) h3, :where(.cz-root) h4, :where(.cz-root) p, :where(.cz-root) ul, :where(.cz-root) dl, :where(.cz-root) dd { margin: 0; padding: 0; }
:where(.cz-root) svg { display: block; flex: none; }
/* css/base.css gives every heading the display face and a heavy weight: the panel keeps its own */
.cz-root :where(h2, h3, h4) { font-family: var(--cz-font); letter-spacing: normal; text-wrap: wrap; color: var(--cz-text); }
.cz-root :focus { outline: none; }
.cz-root :focus-visible { outline: 2px solid var(--cz-focus); outline-offset: 2px; }

/* visually hidden but focusable (native radios / checkboxes keep their keyboard behaviour) */
.cz-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; opacity: 0; }
.cz-vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ frame */
.cz-backdrop { position: absolute; inset: 0; background: transparent; pointer-events: none; }
.cz-root.is-open .cz-backdrop { pointer-events: auto; }

.cz-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(27rem, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--cz-bg);
  border-left: 1px solid var(--cz-border);
  box-shadow: var(--cz-shadow);
  transform: translateX(105%);
  transition: transform var(--cz-dur) var(--cz-ease);
  pointer-events: auto;
  overflow: hidden;
}
.cz-root.is-open .cz-panel { transform: none; }
.cz-panel::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--cz-accent), var(--cz-accent-2)); z-index: 3; }

.cz-head { position: relative; display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1rem .9rem 1.25rem; flex: none; }
.cz-head__icon { display: grid; place-items: center; flex: none; width: 2.5rem; height: 2.5rem; border-radius: var(--cz-radius); background: var(--cz-accent-soft); color: var(--cz-accent-ink); }
.cz-head__text { flex: 1; min-width: 0; }
.cz-head__title { font-size: 1.125rem; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; }
.cz-head__sub { margin-top: .1rem; font-size: .8125rem; color: var(--cz-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cz-iconbtn.cz-head__peek { display: none; }

.cz-iconbtn { display: inline-grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem; border-radius: var(--cz-radius); color: var(--cz-dim); transition: background .15s, color .15s; }
.cz-iconbtn:hover:not(:disabled) { background: var(--cz-bg-3); color: var(--cz-text); }
.cz-iconbtn[aria-pressed="true"] { background: var(--cz-accent-soft); color: var(--cz-accent-ink); }
.cz-iconbtn:disabled { opacity: .35; cursor: default; }

/* tabs */
.cz-tabs { display: flex; gap: .125rem; padding: 0 .75rem; border-bottom: 1px solid var(--cz-border); overflow-x: auto; scrollbar-width: none; flex: none; }
.cz-tabs::-webkit-scrollbar { display: none; }
.cz-tab { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.75rem; padding: 0 .85rem; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--cz-dim); font-size: .875rem; font-weight: 700; white-space: nowrap; transition: color .15s, border-color .15s; }
.cz-tab:hover { color: var(--cz-text); }
.cz-tab[aria-selected="true"] { color: var(--cz-text); border-bottom-color: var(--cz-accent); }
.cz-tab[aria-selected="true"] svg { color: var(--cz-accent-ink); }

.cz-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 1.25rem 1.5rem; scrollbar-width: thin; scrollbar-color: var(--cz-border-strong) transparent; }
.cz-pane[hidden] { display: none; }
.cz-pane:focus-visible { outline-offset: -2px; }

.cz-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 1rem .75rem 1.25rem; border-top: 1px solid var(--cz-border); background: var(--cz-bg); flex: none; }
.cz-foot__note { display: inline-flex; align-items: center; gap: .4rem; font-size: .8125rem; color: var(--cz-dim); min-width: 0; }
.cz-foot__note svg { color: var(--rv-success-ink, #15803d); }

/* ------------------------------------------------------------------ buttons */
.cz-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.75rem; padding: 0 1rem; border: 1px solid var(--cz-border-strong); border-radius: var(--cz-radius); background: var(--cz-bg); color: var(--cz-text); font-size: .875rem; font-weight: 700; text-align: center; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.cz-btn:hover:not(:disabled) { background: var(--cz-bg-3); }
.cz-btn:disabled { opacity: .45; cursor: default; }
.cz-btn--primary { background: var(--cz-accent); border-color: var(--cz-accent); color: var(--cz-on-accent); }
.cz-btn--primary:hover:not(:disabled) { background: var(--rv-accent-hover, var(--cz-accent)); border-color: var(--rv-accent-hover, var(--cz-accent)); }
.cz-btn--danger { color: var(--cz-danger-ink); border-color: var(--cz-danger); }
.cz-btn--danger:hover:not(:disabled) { background: var(--cz-danger-soft); }
/* the text-safe danger ink as the fill and the panel surface as the label: >= 4.5:1 in every scheme by construction */
.cz-btn--danger.is-solid { background: var(--cz-danger-ink); border-color: var(--cz-danger-ink); color: var(--cz-bg); }
.cz-btn--danger.is-solid:hover:not(:disabled) { background: var(--cz-danger-ink); filter: brightness(.93); }
.cz-btn--block { width: 100%; }
.cz-btn--sm { min-height: 2.5rem; padding: 0 .75rem; font-size: .8125rem; }
.cz-btns { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ------------------------------------------------------------------ sections */
.cz-sec { padding: 1.25rem 0; border-bottom: 1px solid var(--cz-border); }
.cz-sec:last-child { border-bottom: 0; }
.cz-sec__title { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; color: var(--cz-dim); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.cz-sec__title .cz-pill { margin-left: auto; }
.cz-sec__lead { margin: -.35rem 0 .85rem; color: var(--cz-dim); font-size: .8125rem; }
.cz-hint { margin-top: .65rem; color: var(--cz-dim); font-size: .8125rem; }
.cz-hint b { color: var(--cz-text); }
.cz-pill { display: inline-flex; align-items: center; padding: .15rem .55rem; border-radius: 999px; background: var(--cz-accent-soft); color: var(--cz-accent-ink); font-size: .6875rem; font-weight: 800; letter-spacing: .02em; text-transform: none; }

/* ------------------------------------------------------------------ segmented controls */
.cz-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .25rem; padding: .25rem; background: var(--cz-bg-3); border-radius: calc(var(--cz-radius) + .25rem); }
.cz-seg__opt { position: relative; display: block; min-width: 0; }
.cz-seg__btn { display: flex; align-items: center; justify-content: center; gap: .45rem; min-height: 2.75rem; padding: .35rem .4rem; border-radius: var(--cz-radius); color: var(--cz-dim); font-size: .8125rem; font-weight: 700; text-align: center; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.cz-seg__btn > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.cz-seg--stack .cz-seg__btn { flex-direction: column; gap: .3rem; padding: .55rem .25rem .5rem; font-size: .75rem; }
.cz-seg__opt:hover .cz-seg__btn { color: var(--cz-text); }
.cz-sr:checked + .cz-seg__btn { background: var(--cz-bg); color: var(--cz-text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--cz-border); }
.cz-sr:checked + .cz-seg__btn svg, .cz-sr:checked + .cz-seg__btn .cz-g { color: var(--cz-accent-ink); }
.cz-sr:focus-visible + .cz-seg__btn { outline: 2px solid var(--cz-focus); outline-offset: 2px; }

/* glyphs drawn with CSS (one per option) */
.cz-g { display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.25rem; color: var(--cz-dim); flex: none; transition: color .15s; }
.cz-g--radius { width: 1.1rem; height: 1.1rem; border-top: 2px solid currentColor; border-left: 2px solid currentColor; border-top-left-radius: var(--r, 0); margin: .1rem 0 0 .1rem; }
.cz-g--density { flex-direction: column; justify-content: center; gap: var(--gap, 4px); }
.cz-g--density i { display: block; width: 1.1rem; height: 2px; border-radius: 2px; background: currentColor; }
.cz-g--fs { font-weight: 800; font-size: var(--fs, 1rem); line-height: 1; width: 1.75rem; height: 1.5rem; }
.cz-g--container { position: relative; width: 1.75rem; height: 1.1rem; border: 1.5px solid currentColor; border-radius: 3px; }
.cz-g--container i { display: block; width: var(--w, 60%); height: 55%; border-radius: 1px; background: currentColor; opacity: .75; }
.cz-g--grid { gap: 2px; width: 1.75rem; }
.cz-g--grid i { display: block; flex: 1; height: .8rem; border-radius: 2px; background: currentColor; opacity: .75; }
.cz-g--ratio { width: auto; height: 1.2rem; }
.cz-g--ratio::before { content: ""; display: block; height: 1.1rem; aspect-ratio: var(--ar, 1 / 1); border: 2px solid currentColor; border-radius: 3px; }
.cz-g--header { position: relative; width: 1.75rem; height: 1.1rem; border: 1.5px solid currentColor; border-radius: 3px; }
.cz-g--header i { position: absolute; display: block; background: currentColor; border-radius: 1px; opacity: .8; }
.cz-g--header-classic i:nth-child(1) { left: 2px; top: 2px; width: 5px; height: 3px; }
.cz-g--header-classic i:nth-child(2) { left: 9px; top: 2px; width: 8px; height: 3px; opacity: .45; }
.cz-g--header-classic i:nth-child(3) { right: 2px; top: 2px; width: 3px; height: 3px; }
.cz-g--header-centered i:nth-child(1) { left: calc(50% - 3px); top: 2px; width: 6px; height: 3px; }
.cz-g--header-centered i:nth-child(2) { left: 4px; top: 7px; width: 14px; height: 2px; opacity: .45; }
.cz-g--header-centered i:nth-child(3) { display: none; }
.cz-g--header-compact { height: .7rem; margin: .2rem 0; }
.cz-g--header-compact i:nth-child(1) { left: 2px; top: 2px; width: 4px; height: 2px; }
.cz-g--header-compact i:nth-child(2) { left: 8px; top: 2px; width: 7px; height: 2px; opacity: .45; }
.cz-g--header-compact i:nth-child(3) { right: 2px; top: 2px; width: 3px; height: 2px; }

/* ------------------------------------------------------------------ mode + scheme cards */
.cz-schemes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.cz-scheme { position: relative; display: block; cursor: pointer; min-width: 0; }
.cz-scheme__card { display: block; padding: .4rem .4rem .5rem; border: 1px solid var(--cz-border); border-radius: calc(var(--cz-radius) + 2px); background: var(--cz-bg-2); transition: border-color .15s, box-shadow .15s, background .15s, transform .15s; }
.cz-scheme:hover .cz-scheme__card { border-color: var(--cz-border-strong); transform: translateY(-1px); }
.cz-sr:checked + .cz-scheme__card { border-color: var(--cz-accent); box-shadow: 0 0 0 1px var(--cz-accent); background: var(--cz-accent-soft); }
.cz-sr:focus-visible + .cz-scheme__card { outline: 2px solid var(--cz-focus); outline-offset: 2px; }
.cz-scheme__name { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin: .45rem .15rem 0; font-size: .8125rem; font-weight: 700; }
.cz-scheme__check { display: none; place-items: center; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: var(--cz-accent); color: var(--cz-on-accent); }
.cz-sr:checked + .cz-scheme__card .cz-scheme__check { display: grid; }

.cz-prev { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--cz-radius-sm); background: var(--p-bg); border: 1px solid var(--p-border); }
.cz-prev span { position: absolute; display: block; }
.cz-prev__top { left: 0; right: 0; top: 0; height: 7%; background: var(--p-topbar); }
.cz-prev__head { left: 0; right: 0; top: 7%; height: 17%; background: var(--p-header); border-bottom: 1px solid var(--p-border); }
.cz-prev__logo { left: 5%; top: calc(7% + 17% * .22); width: 8%; height: calc(17% * .56); border-radius: 28%; background: var(--p-accent); }
.cz-prev__nav { top: calc(7% + 17% * .41); height: calc(17% * .18); border-radius: 2px; background: var(--p-dim); opacity: .55; }
.cz-prev__nav--1 { left: 19%; width: 11%; }
.cz-prev__nav--2 { left: 33%; width: 11%; }
.cz-prev__nav--3 { left: 47%; width: 11%; }
.cz-prev__cta { right: 5%; top: calc(7% + 17% * .24); width: 13%; height: calc(17% * .52); border-radius: 22%; background: var(--p-accent); }
.cz-prev__hero { left: 5%; top: 30%; width: 54%; height: 48%; border-radius: 4px; background: var(--p-alt); border: 1px solid var(--p-border); }
.cz-prev__ln { left: 9%; height: 7%; border-radius: 2px; background: var(--p-text); }
.cz-prev__ln--1 { top: 38%; width: 34%; }
.cz-prev__ln--2 { top: 49%; width: 24%; background: var(--p-dim); opacity: .7; }
.cz-prev__btn { left: 9%; top: 61%; width: 16%; height: 9%; border-radius: 3px; background: var(--p-accent); }
.cz-prev__card { top: 30%; width: 14%; height: 48%; border-radius: 4px; background: var(--p-surface); border: 1px solid var(--p-border); }
.cz-prev__card--1 { left: 63%; }
.cz-prev__card--2 { left: 80%; }
.cz-prev__card::before { content: ""; position: absolute; left: 12%; right: 12%; top: 10%; height: 42%; border-radius: 2px; background: var(--p-alt); }
.cz-prev__card::after { content: ""; position: absolute; left: 12%; width: 58%; bottom: 14%; height: 8%; border-radius: 2px; background: var(--p-text); opacity: .75; }
.cz-prev__foot { left: 0; right: 0; bottom: 0; height: 12%; background: var(--p-footer); }

/* ------------------------------------------------------------------ colour swatches */
.cz-swatches { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .6rem .5rem; }
.cz-sw { position: relative; display: block; aspect-ratio: 1; cursor: pointer; min-width: 0; }
.cz-sw__dot { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; background: var(--sw); color: var(--sw-on, #fff); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); transition: transform .15s var(--cz-ease), box-shadow .15s; font-size: .6875rem; font-weight: 800; }
.cz-sw:hover .cz-sw__dot { transform: scale(1.1); }
.cz-sw__dot svg { opacity: 0; transform: scale(.5); transition: opacity .15s, transform .15s var(--cz-ease); }
.cz-sr:checked + .cz-sw__dot { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14), 0 0 0 2px var(--cz-bg), 0 0 0 4px var(--sw-ring, var(--sw)); }
.cz-sr:checked + .cz-sw__dot svg { opacity: 1; transform: none; }
.cz-sr:focus-visible + .cz-sw__dot { outline: 2px solid var(--cz-focus); outline-offset: 3px; }
.cz-sw--custom .cz-sw__dot { background: conic-gradient(from 90deg, #ef4444, #f59e0b, #eab308, #22c55e, #06b6d4, #3b82f6, #8b5cf6, #ec4899, #ef4444); }
.cz-sw--custom.is-on .cz-sw__dot { background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14), 0 0 0 2px var(--cz-bg), 0 0 0 4px var(--sw); }
.cz-sw--custom.is-on .cz-sw__dot svg { opacity: 1; transform: none; }
.cz-sw--custom .cz-sw__picker { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.cz-sw--custom:focus-within .cz-sw__dot { outline: 2px solid var(--cz-focus); outline-offset: 3px; }
.cz-sw--auto .cz-sw__dot { font-size: .625rem; letter-spacing: .02em; }

/* ------------------------------------------------------------------ fine-tune slots */
.cz-fine > summary { list-style: none; cursor: pointer; }
.cz-fine > summary::-webkit-details-marker { display: none; }
.cz-fine > summary .cz-chev { margin-left: auto; transition: transform .2s var(--cz-ease); }
.cz-fine[open] > summary .cz-chev { transform: rotate(180deg); }
.cz-slots { display: grid; gap: .5rem; list-style: none; }
.cz-slot { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) auto 2.75rem; align-items: center; gap: .65rem; padding: .5rem .5rem .5rem .6rem; border: 1px solid var(--cz-border); border-radius: var(--cz-radius); background: var(--cz-bg-2); }
.cz-slot.is-custom { box-shadow: inset 3px 0 0 var(--cz-accent); }
.cz-slot__color { position: relative; display: block; width: 2.75rem; height: 2.75rem; overflow: hidden; border-radius: var(--cz-radius-sm); cursor: pointer; }
.cz-slot__dot { position: absolute; inset: 0; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); border-radius: inherit; }
.cz-slot__picker { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.cz-slot__color:focus-within { outline: 2px solid var(--cz-focus); outline-offset: 2px; }
.cz-slot__label { display: block; font-size: .75rem; font-weight: 700; color: var(--cz-dim); line-height: 1.2; }
.cz-slot.is-custom .cz-slot__label::after { content: " · editado"; color: var(--cz-accent-ink); font-weight: 700; }
.cz-hex { display: block; width: 100%; min-width: 0; padding: .3rem 0; border: 0; border-bottom: 1px solid transparent; background: transparent; font-family: var(--cz-mono); font-size: .875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.cz-hex:hover { border-bottom-color: var(--cz-border-strong); }
.cz-hex:focus-visible { outline: none; border-bottom-color: var(--cz-focus); box-shadow: 0 1px 0 var(--cz-focus); }
.cz-hex[aria-invalid="true"] { color: var(--cz-danger-ink); border-bottom-color: var(--cz-danger); }

.cz-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .5rem; border-radius: 999px; font-size: .6875rem; font-weight: 800; white-space: nowrap; background: var(--rv-success-soft, #e3f4e9); color: var(--rv-success-ink, #15803d); }
.cz-badge small { font-size: .6875rem; font-weight: 600; opacity: .9; }
.cz-badge--aaa { background: var(--rv-success-soft, #e3f4e9); color: var(--rv-success-ink, #15803d); }
.cz-badge--aa { background: var(--rv-info-soft, #e0f0f8); color: var(--rv-info-ink, #0369a1); }
.cz-badge--large { background: var(--rv-warning-soft, #faefe1); color: var(--rv-warning-ink, #a55a05); }
.cz-badge--fail { background: var(--rv-danger-soft, #fbe5e5); color: var(--rv-danger-ink, #b91c1c); }

/* ------------------------------------------------------------------ option cards (font, card style) + switches */
.cz-opts { display: grid; gap: .5rem; }
.cz-opts--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cz-opt { position: relative; display: block; cursor: pointer; min-width: 0; }
.cz-opt__card { display: flex; align-items: center; gap: .75rem; min-height: 3.25rem; padding: .5rem .75rem; border: 1px solid var(--cz-border); border-radius: var(--cz-radius); background: var(--cz-bg-2); transition: border-color .15s, background .15s, box-shadow .15s; }
.cz-opt:hover .cz-opt__card { border-color: var(--cz-border-strong); }
.cz-sr:checked + .cz-opt__card { border-color: var(--cz-accent); background: var(--cz-accent-soft); box-shadow: 0 0 0 1px var(--cz-accent); }
.cz-sr:focus-visible + .cz-opt__card { outline: 2px solid var(--cz-focus); outline-offset: 2px; }
.cz-opt__aa { display: grid; place-items: center; flex: none; width: 2.5rem; height: 2.5rem; border-radius: var(--cz-radius-sm); background: var(--cz-bg); color: var(--cz-text); box-shadow: inset 0 0 0 1px var(--cz-border); font-size: 1.15rem; font-weight: 700; line-height: 1; }
.cz-opt__meta { display: block; flex: 1; min-width: 0; }
.cz-opt__meta b { display: block; font-size: .9375rem; font-weight: 700; line-height: 1.25; }
.cz-opt__meta small { display: block; color: var(--cz-dim); font-size: .75rem; line-height: 1.3; }
.cz-opt__tick { display: grid; place-items: center; flex: none; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--cz-accent); color: var(--cz-on-accent); opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s var(--cz-ease); }
.cz-sr:checked + .cz-opt__card .cz-opt__tick { opacity: 1; transform: none; }
.cz-opts--cards .cz-opt__card { flex-direction: column; align-items: stretch; gap: .5rem; padding: .6rem; }
.cz-opts--cards .cz-opt__meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.cz-opts--cards .cz-opt__meta b { font-size: .8125rem; }

.cz-cardprev { position: relative; display: grid; gap: .3rem; padding: .35rem; border-radius: var(--cz-radius-sm); background: var(--cz-bg-3); }
.cz-cardprev span { display: block; border-radius: 3px; }
.cz-cardprev__tile { display: grid; gap: 3px; padding: 4px; background: var(--cz-bg); border: 1px solid transparent; }
.cz-cardprev__tile::before { content: ""; display: block; aspect-ratio: 16 / 8; border-radius: 2px; background: var(--cz-bg-3); }
.cz-cardprev__tile::after { content: ""; display: block; height: 4px; width: 60%; border-radius: 2px; background: var(--cz-faint); }
.cz-cardprev { grid-template-columns: 1fr 1fr; }
.cz-cardprev--classic .cz-cardprev__tile { border-color: var(--cz-border); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.cz-cardprev--minimal .cz-cardprev__tile { background: transparent; }
.cz-cardprev--bordered .cz-cardprev__tile { border-color: var(--cz-border-strong); border-width: 1.5px; }
.cz-cardprev--elevated .cz-cardprev__tile { box-shadow: 0 4px 8px rgba(0, 0, 0, .18); }

.cz-stack { display: grid; gap: .5rem; }
.cz-switch { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem .85rem; border: 1px solid var(--cz-border); border-radius: var(--cz-radius); background: var(--cz-bg-2); cursor: pointer; }
.cz-switch__text { display: block; min-width: 0; }
.cz-switch__text b { display: block; font-size: .9375rem; font-weight: 700; }
.cz-switch__text small { display: block; color: var(--cz-dim); font-size: .75rem; }
.cz-switch__track { position: relative; flex: none; width: 2.6rem; height: 1.5rem; border-radius: 999px; background: var(--cz-dim); transition: background .18s; }
.cz-switch__track::after { content: ""; position: absolute; top: .1875rem; left: .1875rem; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: var(--cz-bg); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .18s var(--cz-ease), background .18s; }
.cz-sr:checked ~ .cz-switch__track { background: var(--cz-accent); }
.cz-sr:checked ~ .cz-switch__track::after { transform: translateX(1.1rem); background: var(--cz-on-accent); }
.cz-sr:focus-visible ~ .cz-switch__track { outline: 2px solid var(--cz-focus); outline-offset: 2px; }

/* ------------------------------------------------------------------ advanced tab */
.cz-card { padding: 1rem; border: 1px solid var(--cz-border); border-radius: var(--cz-radius); background: var(--cz-bg-2); }
.cz-card + .cz-card { margin-top: .75rem; }
.cz-card h4 { margin: 0 0 .25rem; font-size: .9375rem; font-weight: 800; }
.cz-card p { margin: 0 0 .75rem; color: var(--cz-dim); font-size: .8125rem; }
.cz-card--danger { background: var(--cz-danger-soft); border-color: transparent; }
.cz-details { margin-top: .75rem; }
.cz-details > summary { cursor: pointer; color: var(--cz-accent-ink); font-size: .8125rem; font-weight: 700; padding: .25rem 0; list-style: none; }
.cz-details > summary::-webkit-details-marker { display: none; }
.cz-details > summary::before { content: "+"; display: inline-block; width: 1rem; font-weight: 800; }
.cz-details[open] > summary::before { content: "−"; }
.cz-textarea { display: block; width: 100%; min-height: 7rem; margin: .5rem 0; padding: .65rem .75rem; border: 1px solid var(--cz-faint); border-radius: var(--cz-radius); background: var(--cz-bg); font-family: var(--cz-mono); font-size: .75rem; line-height: 1.5; resize: vertical; }
.cz-textarea:focus-visible { outline: 2px solid var(--cz-focus); outline-offset: 0; }
.cz-note { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .75rem; padding: .55rem .75rem; border-radius: var(--cz-radius); background: var(--cz-bg-3); color: var(--cz-text); font-size: .8125rem; }
.cz-note[hidden] { display: none; }
.cz-note--ok { background: var(--rv-success-soft, #e3f4e9); color: var(--rv-success-ink, #15803d); }
.cz-note--err { background: var(--rv-danger-soft, #fbe5e5); color: var(--rv-danger-ink, #b91c1c); }
.cz-note button { flex: none; font-weight: 800; text-decoration: underline; }
.cz-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3rem 1rem; font-size: .8125rem; }
.cz-kv dt { color: var(--cz-dim); }
.cz-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.cz-kv code { font-family: var(--cz-mono); font-size: .75rem; }

/* inline confirmation (reset everything) */
.cz-confirm { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 1.25rem; background: var(--rv-overlay, rgba(15, 23, 42, .5)); }
.cz-confirm[hidden] { display: none; }
.cz-confirm__card { width: 100%; max-width: 22rem; padding: 1.25rem; border: 1px solid var(--cz-border-strong); border-radius: var(--cz-radius-lg); background: var(--cz-bg); box-shadow: var(--cz-shadow); }
.cz-confirm__card h3 { margin: 0 0 .4rem; font-size: 1.0625rem; font-weight: 800; }
.cz-confirm__card p { margin: 0 0 1rem; color: var(--cz-dim); font-size: .875rem; }
.cz-confirm__card .cz-btns { justify-content: flex-end; }

.cz-app-empty { padding: 2rem 0; color: var(--cz-dim); text-align: center; }

/* ------------------------------------------------------------------ bottom sheet (<= 600 px) */
@media (max-width: 600px) {
  .cz-panel {
    top: auto; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: min(86vh, 42rem);
    height: min(86dvh, 42rem);
    border-left: 0;
    border-top: 1px solid var(--cz-border);
    border-radius: var(--cz-radius-lg) var(--cz-radius-lg) 0 0;
    transform: translateY(105%);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .cz-root.is-open .cz-panel { transform: none; }
  .cz-root.is-peek .cz-panel { transform: translateY(calc(100% - 5.25rem - env(safe-area-inset-bottom, 0px))); }
  .cz-root.is-peek .cz-backdrop { pointer-events: none; }
  .cz-head { padding-top: 1.35rem; }
  .cz-head::before { content: ""; position: absolute; top: .5rem; left: 50%; width: 2.5rem; height: .25rem; margin-left: -1.25rem; border-radius: 999px; background: var(--cz-border-strong); }
  .cz-iconbtn.cz-head__peek { display: inline-grid; }
  .cz-body { padding-left: 1rem; padding-right: 1rem; }
  .cz-foot { padding-left: 1rem; }
  .cz-swatches { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem .35rem; }
  .cz-slot { grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem; }
  .cz-slot__badge { grid-column: 2 / 4; grid-row: 2; justify-self: start; }
  .cz-seg__btn { font-size: .75rem; }
}
@media (max-width: 380px) {
  .cz-seg--stack .cz-seg__btn { font-size: .6875rem; padding-left: .1rem; padding-right: .1rem; }
  .cz-schemes { gap: .5rem; }
}

/* ------------------------------------------------------------------ forced colours (Windows high contrast): rings instead of shadows */
@media (forced-colors: active) {
  .cz-sr:checked + .cz-seg__btn, .cz-sr:checked + .cz-opt__card, .cz-sr:checked + .cz-scheme__card { outline: 2px solid Highlight; outline-offset: -2px; }
  .cz-sr:checked + .cz-sw__dot, .cz-sw--custom.is-on .cz-sw__dot { outline: 2px solid Highlight; outline-offset: 3px; }
  .cz-switch__track { border: 1px solid ButtonText; }
  .cz-sr:checked ~ .cz-switch__track { background: Highlight; }
  .cz-tab[aria-selected="true"] { border-bottom-color: Highlight; }
  .cz-slot__dot, .cz-sw__dot { forced-color-adjust: none; }
}

/* ------------------------------------------------------------------ motion + print */
@media (prefers-reduced-motion: reduce) {
  .cz-root, .cz-root *, .cz-root *::before, .cz-root *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation-duration: 0s !important; }
}
[data-motion="off"] .cz-root, [data-motion="off"] .cz-root *, [data-motion="off"] .cz-root *::before, [data-motion="off"] .cz-root *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation-duration: 0s !important; }
@media print { .cz-root { display: none !important; } }
