:root {
  --bg: #f5f4f2;
  --surface: #ffffff;
  --surface-2: #faf9f7;
  --line: #e7e4df;
  --line-2: #d8d3cc;
  --ink: #1f1c19;
  --ink-2: #57514a;
  --ink-3: #716a62;
  --primary: #1f1c19;
  --primary-ink: #ffffff;
  --accent: #8b5e3c;
  --ok: #2f7d4f;
  --ok-bg: #e8f4ec;
  --warn: #9a6400;
  --warn-bg: #fdf3dd;
  --err: #b42318;
  --err-bg: #fdecea;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(31, 28, 25, .05), 0 4px 16px -8px rgba(31, 28, 25, .12);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
[hidden] { display: none !important; }
.muted { color: var(--ink-3); }
.hint { color: var(--ink-3); font-size: 12.5px; margin: 4px 0 12px; }
.spacer { flex: 1; }

/* ------------------------------------------------ topo */
.imp-bar { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 8px 16px; background: #2d2418; color: #f6ead9; font-size: 13px; margin: 0; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 0 20px; height: 56px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; color: var(--ink); text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 13px; }
.brand-lg { font-size: 16px; margin-bottom: 20px; }
.nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; }
.nav a { padding: 7px 11px; border-radius: 8px; color: var(--ink-2); text-decoration: none; white-space: nowrap; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.on { background: #f0ece6; color: var(--ink); }
.nav a.has-dot { position: relative; }
.nav a.has-dot::after { content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: #d49a1f; }

/* ------------------------------------------------ botões e campos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-weight: 550; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--surface-2); border-color: #c9c2b8; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: #38322c; border-color: #38322c; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-light { background: #f6ead9; border-color: #f6ead9; color: #2d2418; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-danger-ghost { border-color: transparent; background: transparent; color: var(--err); }
.btn-danger-ghost:hover { background: var(--err-bg); border-color: transparent; }
.btn-dashed { border-style: dashed; color: var(--ink-2); height: 44px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }

.input, .field input, .field textarea, .field select, .prefix { width: 100%; border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 9px 12px; font: inherit; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
.field textarea { resize: vertical; min-height: 64px; }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus, .prefix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 94, 60, .14); }
.field { display: block; margin-bottom: 14px; }
.field > span { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; font-weight: 550; color: var(--ink-2); margin-bottom: 6px; }
.field > span small, .field small { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.field > small { display: block; margin-top: 5px; }
.prefix { display: flex; align-items: center; padding: 0 0 0 12px; }
.prefix em { font-style: normal; color: var(--ink-3); white-space: nowrap; }
.prefix input { border: 0 !important; box-shadow: none !important; padding-left: 2px; }
.pass-wrap { position: relative; display: block; }
.pass-wrap input { padding-right: 44px !important; }
.pass-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 32px; border: 0; background: none; color: var(--ink-3); cursor: pointer; border-radius: 8px; display: grid; place-items: center; }
.pass-eye:hover { color: var(--ink); background: var(--surface-2); }
.pass-eye svg { width: 18px; height: 18px; }
.check { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; cursor: pointer; color: var(--ink-2); }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }
/* ------------------------------------------------ editor: básico x avançado */
.more { border-top: 1px solid var(--line); margin-top: 8px; }
.more > summary { list-style: none; cursor: pointer; padding: 10px 0 6px; font-size: 12.5px; font-weight: 550; color: var(--ink-2); display: flex; align-items: center; gap: 7px; user-select: none; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::before { content: "+"; flex: none; width: 17px; height: 17px; border: 1px solid var(--line-2); border-radius: 5px; display: grid; place-items: center; font-size: 12px; line-height: 1; }
.more[open] > summary::before { content: "−"; }
.more > summary:hover { color: var(--ink); }
.more-body { padding: 6px 0 2px; }

/* cores em bolinhas */
.sw-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sw-row > span { font-size: 12.5px; color: var(--ink-2); font-weight: 550; flex: 1; min-width: 0; }
.swatches { display: flex; gap: 6px; flex: none; }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); padding: 2px; cursor: pointer; position: relative; }
.sw i { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.09); }
.sw:hover { border-color: var(--accent); }
.sw.is-open { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 94, 60, .18); }
.card-style .sw.is-own::after { content: ""; position: absolute; right: -2px; top: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }

.color-pop { position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 16px 40px -12px rgba(0,0,0,.3); padding: 12px; width: 226px; }
.color-pop > strong { display: block; font-size: 12.5px; margin-bottom: 8px; }
.color-pop-row { display: flex; gap: 8px; align-items: center; }
.color-pop .hex { flex: 1; width: auto; font-size: 13px; padding: 6px 8px; }
.color-pop .linkbtn { margin-top: 10px; font-size: 12px; }

/* controles dentro do recorte da foto */
.crop-wrap { display: flex; justify-content: center; margin-bottom: 14px; }
.crop-side { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; }
.crop-side button { width: 28px; height: 28px; border: 0; border-radius: 8px; background: rgba(20,18,16,.5); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; }
.crop-side button.on { background: var(--ink); box-shadow: 0 0 0 2px rgba(255,255,255,.75); }
.crop-zoom { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; align-items: center; gap: 7px; background: rgba(20,18,16,.5); border-radius: 99px; padding: 4px 10px; color: #fff; font-size: 12px; }
.crop-zoom input { flex: 1; accent-color: #fff; height: 14px; min-width: 0; }
.crop.is-dragging .crop-side, .crop.is-dragging .crop-zoom { opacity: .35; }

/* menu da barra */
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 16px 40px -12px rgba(0,0,0,.28); padding: 6px; min-width: 236px; }
.menu-pop button, .menu-pop a { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; border: 0; background: none; font: inherit; text-align: left; padding: 9px 10px; border-radius: 8px; color: var(--ink); cursor: pointer; text-decoration: none; }
.menu-pop button:hover, .menu-pop a:hover { background: var(--surface-2); }
.menu-pop button[disabled] { opacity: .4; cursor: default; }
.menu-pop button[disabled]:hover { background: none; }
.menu-pop small { color: var(--ink-3); font-size: 11px; }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.menu-pop .is-danger { color: var(--err); }

/* abas dentro do botão */
.ci-tabs { width: 100%; margin: 10px 0 12px; }
.ci-tabs button { flex: 1; border: 0; background: none; font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 8px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.ci-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.ci-pane { min-height: 40px; }

/* estilo do botão no painel da direita */
.st-ctx { font-size: 13px; color: var(--ink-2); margin: 14px 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.card-style .part:first-child { border-top: 0; padding-top: 0; }
.part h5 { font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 0 0 8px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 99px; padding: 5px 12px; font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.chip:hover { border-color: #c9c2b8; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.empty-filter { padding: 20px 4px; }

.thumb { flex: none; position: relative; width: 44px; height: 56px; border-radius: 9px; overflow: hidden; display: grid; place-items: center; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb em { font-style: normal; font-weight: 700; font-size: 18px; }
.thumb i { position: absolute; left: 5px; right: 5px; bottom: 5px; height: 11px; border-radius: 4px; display: flex; align-items: center; padding-left: 3px; }
.thumb i b { width: 6px; height: 6px; border-radius: 50%; }

.share-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.share-row span { grid-column: 1 / -1; font-size: 12px; color: var(--ink-3); }
.share-row code { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-box { display: grid; place-items: center; padding: 16px 0 8px; }
.qr-box canvas { border: 1px solid var(--line); border-radius: 12px; }

.add-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.add-row .btn { height: 44px; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ci-issue { font-size: 12px; color: var(--warn); background: var(--warn-bg); border-radius: 8px; padding: 7px 10px; margin: -4px 0 12px; }
.ci-flags { display: inline-flex; gap: 4px; align-items: center; }
.flag { font-style: normal; font-size: 10px; line-height: 1; padding: 3px 5px; border-radius: 6px; background: var(--surface-2); color: var(--ink-3); }
.flag-warn { background: var(--warn-bg); color: var(--warn); font-weight: 700; }
.flag-off { opacity: .6; text-decoration: line-through; }
.flag-badge { background: #efe7de; color: var(--accent); font-weight: 700; letter-spacing: .04em; }

.dialog-templates { width: min(620px, calc(100vw - 24px)); padding: 18px; }
.dialog-templates .icons-head { align-items: center; justify-content: space-between; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; max-height: 62vh; overflow-y: auto; padding: 2px; }
.tpl { display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px; cursor: pointer; font: inherit; }
.tpl:hover { border-color: var(--accent); background: #fdfaf7; }
.tpl-ic { flex: none; width: 38px; height: 38px; border-radius: 50%; background: #f3efe9; color: var(--accent); display: grid; place-items: center; }
.tpl-ic svg { width: 20px; height: 20px; }
.tpl-tx { display: flex; flex-direction: column; min-width: 0; }
.tpl-tx strong { font-weight: 600; font-size: 13.5px; }
.tpl-tx small { color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn-icon { width: 32px; padding: 0; font-size: 15px; line-height: 1; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 10px; font-size: 13px; z-index: 100; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

button.ed-status { border: 0; background: none; font: inherit; cursor: pointer; padding: 4px 6px; border-radius: 8px; text-align: left; }
button.ed-status:hover { background: var(--surface-2); }
.diff-pop { position: absolute; top: calc(100% - 4px); left: 0; z-index: 40; width: min(340px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 16px 40px -12px rgba(0,0,0,.28); padding: 12px 14px; font-size: 13px; }
.diff-pop strong { display: block; margin-bottom: 6px; }
.diff-pop ul { margin: 0; padding-left: 18px; color: var(--ink-2); max-height: 260px; overflow-y: auto; }
.diff-pop li { margin: 2px 0; }
.ed-bar { position: sticky; }

.is-target { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 10px; transition: outline-color .4s; }

.crop { position: relative; margin: 0 auto; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line-2); touch-action: none; cursor: grab; }
.crop.is-dragging { cursor: grabbing; }
.crop img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.crop:not(.has-img) img { display: none; }
.crop-hint { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 99px; pointer-events: none; opacity: 0; transition: opacity .15s; }
.crop:hover .crop-hint { opacity: 1; }
.crop.is-dragging .crop-hint { opacity: 0; }

.ci-grip { cursor: grab; color: var(--ink-3); font-size: 14px; line-height: 1; padding: 6px 2px; user-select: none; touch-action: none; }
.ci-grip:active { cursor: grabbing; }
.card-item.is-dragging { position: relative; z-index: 5; box-shadow: 0 12px 30px -10px rgba(0,0,0,.35); opacity: .97; }
body.dragging-card { user-select: none; }
.card-item { transition: transform .16s ease; }
.card-item.is-dragging { transition: none; }

.hex { width: 78px; flex: none; border: 1px solid var(--line-2); border-radius: 7px; padding: 3px 6px; font: inherit; font-size: 12px; color: var(--ink-2); background: var(--surface); text-transform: lowercase; }
.hex:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 94, 60, .14); }
.color-field { gap: 8px; }
.color-field span { flex: 1; min-width: 0; }
.color-opt { padding-right: 22px; }
.color-opt .hex { width: 70px; }
.color-opt span { flex: none; }

.num-wrap { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; font-weight: 500; color: var(--ink-3); }
.num-wrap em { font-style: normal; font-size: 12px; }
.field .num-wrap input.num, .op-opt input.num { width: 58px; padding: 3px 6px; border: 1px solid var(--line-2); border-radius: 7px; font: inherit; font-size: 12.5px; text-align: right; color: var(--ink); background: var(--surface); font-variant-numeric: tabular-nums; -moz-appearance: textfield; box-shadow: none; }
.num::-webkit-outer-spin-button, .num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num:focus { outline: none; border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(139, 94, 60, .14) !important; }
.range output { margin-left: auto; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.range input[type=range] { width: 100%; accent-color: var(--ink); padding: 0; border: 0; box-shadow: none !important; }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; margin: 4px 0 14px; }
.switch { position: relative; }
.switch input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.switch > span { flex: none; width: 36px; height: 20px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .15s; }
.switch > span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(139, 94, 60, .25); }
.switch small { font-weight: 400; color: var(--ink-3); }
.switch-text { font-style: normal; }
.switch-sm { margin: 0; }

.seg { display: inline-flex; background: #ebe7e1; padding: 3px; border-radius: 10px; gap: 2px; }
.seg a, .seg-input span { padding: 6px 12px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 500; cursor: pointer; display: block; }
.seg a.on, .seg-input input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg-input { display: flex; }
.seg-input label { flex: 1; text-align: center; position: relative; }
.seg-input input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }

.alert { padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-error { background: var(--err-bg); color: var(--err); }

.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; padding: 3px 9px; border-radius: 99px; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag-on { background: var(--ok-bg); color: var(--ok); }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.tag-draft { background: #eeebe7; color: var(--ink-2); }
.tag-off { background: var(--err-bg); color: var(--err); }

/* ------------------------------------------------ páginas */
.page { max-width: 1120px; margin: 0 auto; padding: 28px 20px 60px; }
.page-narrow { max-width: 560px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .muted { margin-top: 2px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.head-actions .input { width: 220px; height: 38px; padding: 0 12px; }
.panel-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel-box h2 { margin-bottom: 14px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px 28px; box-shadow: var(--shadow); }
.login-card h1 { margin-bottom: 20px; }

/* clientes */
.client-list { display: grid; gap: 10px; }
.client { display: grid; grid-template-columns: minmax(140px, 1.3fr) minmax(140px, 1.2fr) 150px 120px auto; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.client-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; background: #efe7de; color: var(--accent); display: grid; place-items: center; font-weight: 650; }
.client-id { display: flex; flex-direction: column; min-width: 0; }
.client-id strong, .client-id span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-urls { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.client-urls a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.client-urls a:hover { text-decoration: underline; }
.client-nums { display: flex; gap: 14px; color: var(--ink-3); font-size: 13px; }
.client-nums strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.client-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.client-actions form { margin: 0; }
.empty { text-align: center; padding: 60px 20px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty h2 { margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }
@media (max-width: 1200px) {
  .client { grid-template-columns: 1fr auto; }
  .client-urls, .client-nums { grid-column: 1 / -1; }
  .client-status { grid-row: 1; grid-column: 2; }
  .client-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* dialog */
.dialog { border: 0; border-radius: 16px; padding: 24px; width: min(460px, calc(100vw - 32px)); box-shadow: 0 24px 60px -12px rgba(0,0,0,.3); color: var(--ink); }
.dialog::backdrop { background: rgba(31, 28, 25, .45); }
.dialog h2 { font-size: 18px; margin-bottom: 18px; }
.dialog-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.dialog-actions:not(:has(.spacer)) { justify-content: flex-end; }

/* estatísticas */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.kpi span { color: var(--ink-2); font-weight: 550; font-size: 13px; }
.kpi strong { font-size: 28px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 4px 0 2px; }
.kpi small { color: var(--ink-3); font-size: 12px; }
.kpi .delta, .kpi > small { margin-top: 2px; }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, 1fr); } }

.chart { position: relative; padding-left: 0; }
.chart svg { display: block; width: 100%; height: 220px; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .bar path { transition: opacity .1s; }
.chart .b-views { fill: #a05a2c; }
.chart .b-clicks { fill: #3b6ea5; }
.box-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.box-head h2 { margin: 0; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.delta { font-size: 12px; font-weight: 550; }
.delta-up { color: var(--ok); }
.delta-down { color: var(--err); }
.delta-same { color: var(--ink-3); }
.two-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .two-panels { grid-template-columns: 1fr; } }
.hint code { background: var(--surface-2); border-radius: 5px; padding: 1px 5px; font-size: 12px; }

/* histórico de publicações */
.vers { display: grid; gap: 8px; max-height: 60vh; overflow-y: auto; }
.ver { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.ver strong { font-weight: 600; font-size: 13.5px; }
.ver small { display: block; color: var(--ink-3); font-size: 12px; }
.chart .bar .hit { fill: transparent; }
.chart:hover .bar path { opacity: .55; }
.chart .bar.on path { opacity: 1; }
.chart-y { position: absolute; left: 0; top: 0; height: calc(220px * (168 / 200)); margin-top: calc(220px * (8 / 200) - 7px); display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; pointer-events: none; }
.chart-y span { line-height: 14px; }
.chart-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); margin-top: -18px; padding-left: calc(34 / 720 * 100%); }
.tip { position: absolute; top: -8px; transform: translate(-50%, -100%); background: var(--ink); color: #fff; border-radius: 8px; padding: 7px 10px; font-size: 12px; white-space: nowrap; pointer-events: none; display: flex; flex-direction: column; box-shadow: 0 8px 20px -6px rgba(0,0,0,.35); }
.tip strong { font-weight: 600; }
.tip span { color: #d9d3cb; }
.table-toggle { margin-top: 16px; }
.table-toggle summary { cursor: pointer; color: var(--ink-2); font-weight: 500; font-size: 13px; }
.table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.table th, .table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.table th { color: var(--ink-3); font-weight: 550; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(120px, 220px) 1fr 90px; gap: 12px; align-items: center; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.hbar-track { height: 10px; background: var(--surface-2); border-radius: 0 4px 4px 0; }
.hbar-track i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.hbar-val { text-align: right; font-variant-numeric: tabular-nums; }
.hbar-val small { color: var(--ink-3); }
@media (max-width: 560px) { .hbar { grid-template-columns: 1fr 70px; } .hbar-track { grid-column: 1 / -1; grid-row: 2; } }

/* ------------------------------------------------ editor */
.page-editor { background: var(--bg); }
.editor { display: grid; grid-template-columns: minmax(380px, 500px) minmax(420px, 1fr) 330px; gap: 0; min-height: calc(100vh - 56px); }
.ed-form { padding: 0 20px 80px; border-right: 1px solid var(--line); background: var(--bg); }
.ed-bar { position: sticky; top: 56px; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 0; background: var(--bg); border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.ed-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ed-form, .ed-preview, .ed-style { min-width: 0; }
.ed-status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); min-width: 0; }
.ed-status span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-status i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.ed-status.is-live i { background: var(--ok); }
.ed-status.is-draft i, .ed-status.is-pending i { background: #d49a1f; }
.ed-status.is-saving i { background: var(--ink-3); animation: pulse 1s infinite; }
.ed-status.is-error i { background: var(--err); }
.ed-status.is-error { color: var(--err); }
@keyframes pulse { 50% { opacity: .3; } }

.sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; box-shadow: var(--shadow); }
.sec > summary { list-style: none; cursor: pointer; padding: 15px 18px; font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 6px; user-select: none; }
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg) translateY(-3px); transition: transform .15s; }
.sec[open] > summary::after { transform: rotate(-135deg) translate(-2px, -1px); }
.sec .count { color: var(--ink-3); font-weight: 500; }
.sec-body { padding: 4px 18px 18px; }
.sec-body h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 18px 0 10px; font-weight: 600; }
.sub { border-left: 2px solid var(--line); padding-left: 14px; margin: 4px 0 6px 2px; }

.upload { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.upload-thumb { flex: none; width: 76px; height: 96px; border-radius: 10px; background: var(--surface-2) center / cover no-repeat; border: 1px dashed var(--line-2); position: relative; }
.upload-sm .upload-thumb { width: 64px; height: 64px; background-size: contain; background-color: #f3efe9; }
.has-file .upload-thumb { border-style: solid; }
.is-loading .upload-thumb::after { content: "Enviando…"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.8); font-size: 11px; border-radius: 10px; }
.upload-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.upload-info small { color: var(--ink-3); font-size: 12px; }
.upload-btns { display: flex; gap: 6px; margin-top: 8px; }
.upload:not(.has-file) [data-remove] { display: none; }

.colors { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 6px; }
.color-field, .color-opt { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); min-width: 0; }
.color-field span, .color-opt span { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
input[type=color] { flex: none; width: 30px; height: 30px; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 8px; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 1px solid rgba(0,0,0,.12); border-radius: 8px; }
input[type=color]::-moz-color-swatch { border: 1px solid rgba(0,0,0,.12); border-radius: 8px; }
.colors-opt { grid-template-columns: repeat(3, 1fr); }
.color-opt { position: relative; padding-right: 24px; }
.color-opt:not(.is-set) input { opacity: .35; }
.color-opt button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--ink-3); font-size: 16px; cursor: pointer; width: 20px; height: 20px; line-height: 1; border-radius: 50%; }
.color-opt:not(.is-set) button { display: none; }
.color-opt button:hover { background: var(--surface-2); color: var(--ink); }

.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.preset { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 6px 10px 6px 6px; display: flex; align-items: center; gap: 8px; cursor: pointer; font: inherit; }
.preset:hover { border-color: var(--line-2); }
.preset > span { width: 26px; height: 26px; border-radius: 7px; border: 1px solid rgba(0,0,0,.1); position: relative; }
.preset i { position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; }
.preset small { font-size: 12.5px; color: var(--ink-2); }

.social-row { display: grid; grid-template-columns: 22px 92px 1fr; align-items: center; gap: 10px; margin-bottom: 8px; }
.social-ic { color: var(--ink-2); display: grid; }
.social-ic svg { width: 20px; height: 20px; }
.social-name { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.social-row input { width: 100%; border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 11px; font: inherit; outline: none; }
.social-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 94, 60, .14); }

/* cards no editor */
.card-item { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--surface); }
.card-item.is-open { border-color: var(--line-2); box-shadow: var(--shadow); }
.card-item.is-off .ci-head .ci-icon, .card-item.is-off .ci-title { opacity: .45; }
.ci-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 6px; }
.ci-move { display: flex; flex-direction: column; }
.ci-move button { border: 0; background: none; color: var(--ink-3); font-size: 9px; line-height: 1; padding: 3px 6px; cursor: pointer; border-radius: 4px; }
.ci-move button:hover { background: var(--surface-2); color: var(--ink); }
.ci-icon { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #f3efe9; color: var(--accent); display: grid; place-items: center; }
.ci-icon svg { width: 18px; height: 18px; }
.ci-title { flex: 1; min-width: 0; text-align: left; border: 0; background: none; font: inherit; font-weight: 550; color: var(--ink); cursor: pointer; padding: 8px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-body { padding: 6px 14px 12px; border-top: 1px solid var(--line); }
.ci-row { display: flex; gap: 12px; align-items: flex-end; margin-top: 10px; }
.ci-row .grow { flex: 1; min-width: 0; }
.icon-pick { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 1px dashed var(--line-2); background: var(--surface-2); border-radius: 10px; padding: 8px 10px; cursor: pointer; margin-bottom: 14px; font: inherit; }
.icon-pick .ci-icon { width: 40px; height: 40px; }
.icon-pick small { font-size: 11px; color: var(--ink-2); }
.icon-pick:hover { border-color: var(--accent); }
.part { border-top: 1px solid var(--line); padding: 12px 0 4px; }
.part .switch { margin-bottom: 10px; }
.colors-2 { grid-template-columns: repeat(2, 1fr); }
.op-opt { display: grid; grid-template-columns: auto 1fr auto 20px; align-items: center; gap: 10px; margin: 4px 0 10px; font-size: 12.5px; color: var(--ink-2); }
.op-opt input[type=range] { width: 100%; accent-color: var(--ink); }
.op-opt .num-wrap { margin-left: 0; }
.op-opt button { border: 0; background: none; color: var(--ink-3); font-size: 16px; cursor: pointer; width: 20px; height: 20px; line-height: 1; border-radius: 50%; }
.op-opt:not(.is-set) input { opacity: .45; }
.op-opt:not(.is-set) button { visibility: hidden; }
.st-group h5 { font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 12px 0 8px; }
.ci-foot { display: flex; justify-content: space-between; margin-top: 4px; }

/* seletor de ícones */
.dialog-icons { width: min(640px, calc(100vw - 24px)); padding: 16px; }
.icons-head { display: flex; gap: 8px; margin-bottom: 12px; }
.icons-head .input { flex: 1; }
.icons-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; max-height: 60vh; overflow-y: auto; padding: 2px; }
.icons-grid button { aspect-ratio: 1; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.icons-grid button:hover { border-color: var(--accent); background: #faf5ef; color: var(--accent); }
.icons-grid svg { width: 22px; height: 22px; }

/* coluna de cores e fontes */
.ed-style { position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; background: var(--surface); border-left: 1px solid var(--line); padding: 0 18px 40px; }
.st-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--surface); padding: 16px 0 12px; border-bottom: 1px solid var(--line); }
.st-head h2 { font-size: 16px; }
.st-back { display: none; }
.st-group { padding: 14px 0 6px; border-bottom: 1px solid var(--line); }
.st-group:last-child { border-bottom: 0; }
.st-group h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 0 0 10px; font-weight: 600; }
.ed-style .colors { grid-template-columns: 1fr; gap: 6px; }
.ed-style .color-field span { font-size: 12.5px; }
.ed-tabs { display: none; }
.ed-tabs button { border: 0; background: none; font: inherit; font-weight: 500; padding: 6px 12px; border-radius: 8px; color: var(--ink-2); cursor: pointer; }
.ed-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* seletor de fontes */
.font-pick { position: relative; }
.fp-btn { width: 100%; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 8px 34px 8px 12px; cursor: pointer; text-align: left; position: relative; font: inherit; color: var(--ink); }
.fp-btn::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: translateY(-70%) rotate(45deg); }
.font-pick.is-open .fp-btn { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 94, 60, .14); }
.fp-name { font-size: 19px; line-height: 1.3; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-cat { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.fp-list { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0; max-height: min(420px, 60vh); overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 16px 40px -12px rgba(0,0,0,.25); padding: 6px; }
.fp-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--ink-3); padding: 10px 10px 4px; }
.fp-opt { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; width: 100%; border: 0; background: none; padding: 7px 10px; border-radius: 8px; cursor: pointer; text-align: left; font-size: 19px; color: var(--ink); }
.fp-opt small { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.fp-opt:hover { background: var(--surface-2); }
.fp-opt.on { background: #f3ece4; }

.cards-empty { color: var(--ink-3); text-align: center; font-size: 13px; padding: 16px 12px; border: 1px dashed var(--line-2); border-radius: 12px; margin-bottom: 10px; }
.icons-sep { grid-column: 1 / -1; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--ink-3); padding: 6px 2px 0; }

/* prévia */
.ed-preview { position: sticky; top: 56px; height: calc(100vh - 56px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; background: radial-gradient(circle at 50% 40%, #ece8e3, #e2ddd6); }
.phone { position: relative; width: 390px; height: min(800px, calc(100vh - 140px)); border-radius: 46px; padding: 12px; background: #1b1a19; box-shadow: 0 0 0 2px #3a3835, 0 30px 60px -20px rgba(0,0,0,.45); flex: none; }
.phone iframe { width: 100%; height: 100%; border: 0; border-radius: 35px; background: #fff; display: block; }
.phone-notch { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); width: 96px; height: 26px; border-radius: 20px; background: #1b1a19; z-index: 2; pointer-events: none; }
.preview-url { font-size: 13px; color: var(--ink-2); text-decoration: none; }
.preview-url:hover { text-decoration: underline; }
.fab { display: none; }

@media (max-width: 1280px) {
  .editor { grid-template-columns: minmax(380px, 520px) 1fr; }
  .ed-form, .ed-style { grid-column: 1; grid-row: 1; }
  .ed-style { display: none; position: static; height: auto; overflow: visible; border-left: 0; border-right: 1px solid var(--line); }
  .st-head { top: 56px; }
  .st-back { display: inline-flex; }
  .ed-tabs { display: inline-flex; order: 3; width: 100%; }
  .ed-tabs button { flex: 1; }
  .tab-style .ed-form { display: none; }
  .tab-style .ed-style { display: block; }
}

@media (max-width: 980px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .ed-bar { align-items: flex-start; }
  .ed-actions { width: 100%; justify-content: flex-start; }
  .ed-style { border-right: 0; padding: 0 12px 90px; }
  .show-preview .ed-style { display: none; }
  .ed-form { border-right: 0; padding: 0 12px 90px; }
  .ed-preview { display: none; position: static; height: auto; min-height: calc(100vh - 56px); padding: 16px 0 90px; background: var(--bg); }
  .show-preview .ed-form { display: none; }
  .show-preview .ed-preview { display: flex; }
  .phone { width: min(390px, calc(100vw - 24px)); height: calc(100vh - 170px); border-radius: 40px; padding: 10px; }
  .phone iframe { border-radius: 31px; }
  .fab { display: inline-flex; position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 30; height: 46px; padding: 0 22px; border-radius: 99px; border: 0; background: var(--ink); color: #fff; font: inherit; font-weight: 600; box-shadow: 0 10px 24px -6px rgba(0,0,0,.4); cursor: pointer; }
  .topbar { padding: 0 12px; }
  .brand { font-size: 0; gap: 0; }
  .brand-mark { font-size: 13px; }
}
@media (max-width: 480px) {
  .colors-opt { grid-template-columns: 1fr; }
  .social-row { grid-template-columns: 22px 1fr; }
  .social-row .social-name { display: none; }
  .ed-bar { flex-wrap: wrap; }
}

/* QA: keyboard access to uploads, wrapping and touch targets. */
.model-page { max-width: 1280px; }
.model-page h1 { font-size: clamp(24px, 3vw, 36px); max-width: 700px; letter-spacing: -.04em; }
.model-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .12em; color: var(--ink-2); margin-bottom: 7px; text-transform: uppercase; }
.model-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 280px) auto; gap: 16px; align-items: end; margin: 28px 0 20px; }
.model-tools .field { margin: 0; }
.model-tools > p { padding-bottom: 10px; white-space: nowrap; }
.model-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.model-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; min-width: 0; }
.model-frame { position: relative; height: 340px; overflow: hidden; background: var(--surface-2); }
.model-frame iframe { display: block; width: 480px; height: 1400px; border: 0; transform: scale(.6); transform-origin: 0 0; pointer-events: none; }
.model-mini { background: linear-gradient(150deg, var(--mini-bg), var(--mini-bg2)); color: var(--mini-ink); padding: 22px 16px 16px; height: 280px; display: flex; flex-direction: column; align-items: center; gap: 7px; overflow: hidden; }
.model-monogram { display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; height: 34px; width: 34px; font-size: 13px; color: var(--mini-accent); }
.model-logo-placeholder { display: grid; place-items: center; border: 1px dashed currentColor; border-radius: 5px; height: 34px; width: 100px; font-size: 9px; font-weight: 600; letter-spacing: .1em; color: var(--mini-accent); }
.model-mini-name { font-size: 20px; font-weight: 400; line-height: 1.1; text-align: center; overflow-wrap: anywhere; }
.model-mini > small { font-size: 8px; letter-spacing: .1em; text-align: center; margin-bottom: 6px; }
.model-mini-link { display: flex; justify-content: space-between; gap: 6px; width: 100%; background: var(--mini-card); color: var(--mini-ink); font-size: 10px; padding: 9px 10px; border-radius: min(var(--mini-radius), 14px); }
.model-mini-link > span { color: var(--mini-accent); }
.model-card-body { padding: 16px; }
.model-card-body h2 { font-size: 15px; margin-bottom: 4px; }
.model-card-body .muted { font-size: 12px; }
.model-card-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.model-note { margin-top: 24px; max-width: 750px; }
.dialog-template-preview { width: min(500px, calc(100vw - 24px)); padding: 16px; }
.dialog-template-preview h2 { margin: 0; }
.dialog-template-preview iframe { display: block; width: 100%; height: min(620px, 62dvh); border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
@media (max-width: 1100px) { .model-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) { .model-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .model-tools { grid-template-columns: 1fr 1fr; } .model-tools > p { grid-column: 1 / -1; padding: 0; } }
@media (max-width: 520px) { .model-grid, .model-tools { grid-template-columns: minmax(0, 1fr); } .model-mini { height: 280px; padding-left: 26px; padding-right: 26px; } }
.upload-btns label { position: relative; }
.upload-file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-btns label:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.client-id, .client-urls, .preview-url { overflow-wrap: anywhere; min-width: 0; }
@media (pointer: coarse), (max-width: 980px) {
  .btn, .btn-sm, .btn-icon, .pass-eye, .chip, .sw, .crop-side button, .ci-move button, .seg button, .linkbtn, .nav a { min-width: 44px; min-height: 44px; }
  .swatches { gap: 2px; flex-wrap: wrap; }
  .sw { width: 44px; height: 44px; }
}
/* Four filters remain usable as the library grows. */
.model-tools{grid-template-columns:repeat(4,minmax(0,1fr))}.model-tools>p{grid-column:1/-1;padding:0;white-space:normal}.model-card[hidden]{display:none}#models-more{display:block;margin:24px auto;min-height:44px}#models-more[hidden]{display:none}
@media(max-width:800px){.model-tools{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.model-tools{grid-template-columns:minmax(0,1fr)}}

.model-mini{height:340px}

.model-tools input,.model-tools select,.model-card-actions .btn,.dialog-template-preview .btn{min-height:44px}

/* The three pilots get enough width to compare their art direction. */
.model-grid:has(.model-card[data-variant="pilot"]:not([hidden])){grid-template-columns:repeat(3,minmax(0,1fr))}
.model-card[data-variant="pilot"] .model-frame{height:630px}
@media(max-width:800px){.model-grid:has(.model-card[data-variant="pilot"]:not([hidden])){grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.model-grid:has(.model-card[data-variant="pilot"]:not([hidden])){grid-template-columns:minmax(0,1fr)}}

/* Three authored directions per group. */
.model-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.model-card[data-curated="1"] .model-frame{height:610px}
@media(max-width:800px){.model-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.model-grid{grid-template-columns:minmax(0,1fr)}}

.section-order-list{display:grid;gap:6px;margin-bottom:14px}.block-order-row{display:flex;align-items:center;gap:6px;border:1px solid var(--line);padding:6px;border-radius:8px}.block-order-name{flex:1;min-width:0;border:0;background:none;text-align:left;padding:6px;font:inherit;cursor:pointer}.block-order-name small{display:block;font-size:10px;opacity:.65}.block-order-row .btn{min-height:44px;min-width:44px}.card-photo-preview img{display:block;width:100%;height:140px;object-fit:cover;border-radius:8px;margin-bottom:12px}.card-media-editor .field{margin-top:12px}

.card-photo-preview{position:relative;max-width:100%;overflow:hidden;border:1px solid var(--line);border-radius:8px;touch-action:none;cursor:grab;margin:10px auto 12px;background:var(--panel,#eee)}.card-photo-preview:active{cursor:grabbing}.card-photo-preview img{width:100%;height:100%;margin:0;border-radius:0;user-select:none;pointer-events:none}
