/* Etiqueta Fácil — feito primeiro para celular/tablet, com botões grandes.
   No computador (≥ 900 px) o editor ganha painel lateral e barra de ferramentas, como no Canva. */
:root {
  --bg: #f3f4f7;
  --surface: #ffffff;
  --ink: #15171c;
  --muted: #5d6573;
  --line: #e0e3e9;
  --brand: #7c3aed;
  --brand-dark: #6425d0;
  --brand-soft: #f1ebff;
  --go: #0f9d58;
  --go-dark: #0b7d46;
  --danger: #c62828;
  --danger-soft: #fdecec;
  --warn-soft: #fff4e5;
  --warn-ink: #8a4b00;
  --desk: #e8e9ee;
  --radius: 16px;
  --bar-h: 64px;
  --shadow: 0 8px 28px rgba(15, 23, 42, 0.14);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.10);
  --listen: #d32f2f;
  --listen-soft: #ffebee;
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 1.125rem; line-height: 1.4;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { opacity: 0.35; cursor: default; }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, select:focus-visible {
  outline: 3px solid var(--brand); outline-offset: 2px;
}
.icon { flex: none; display: block; }
[hidden] { display: none !important; }

.loading { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; color: var(--muted); font-weight: 700; }

/* ---------- Telas ---------- */
.screen { display: none; min-height: 100dvh; }
.screen.active { display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 60px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.top-left { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; }
.top-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.15rem; min-width: 0; }
.brand .icon { color: var(--brand); }
.title-stack { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.title-kicker { font-size: 0.8rem; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-main { font-size: 1.1rem; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-input {
  font: inherit; font-size: 1.05rem; font-weight: 900; color: var(--ink); background: transparent;
  border: 1px solid transparent; border-radius: 8px; padding: 2px 6px; min-width: 0; width: 100%; max-width: 360px;
}
.title-input:hover { border-color: var(--line); }
.title-input:focus { border-color: var(--brand); outline: none; background: #fff; }
.save-state { font-size: 0.78rem; font-weight: 700; color: var(--muted); padding-left: 7px; white-space: nowrap; }
.save-state.saved { color: var(--go-dark); }
.save-state.offline, .save-state.error { color: var(--danger); }

.icon-btn {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: #f0f1f4; }
.icon-btn:active { background: var(--line); }
.top-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  padding: 8px 12px; border-radius: 12px; font-weight: 700; font-size: 0.95rem; white-space: nowrap;
}
.top-btn:hover { background: #f0f1f4; }
.top-btn-accent { background: var(--brand-soft); color: var(--brand); }
.top-btn-accent:hover { background: #e6dbff; }
.top-btn-go { background: var(--go); color: #fff; padding: 8px 16px; }
.top-btn-go:hover { background: var(--go-dark); }
.link-btn { color: var(--brand); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 4px; display: inline-flex; align-items: center; gap: 4px; }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; font-size: 0.82rem; font-weight: 700;
  background: #eef0f3; color: var(--muted); white-space: nowrap;
}
.status-pill .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.status-pill.online { background: #e3f6ec; color: var(--go-dark); }
.status-pill.offline { background: var(--danger-soft); color: var(--danger); }

/* ---------- Início: marcas e produtos ---------- */
.home-main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 16px 16px 48px; display: flex; flex-direction: column; gap: 18px; }
.search {
  display: flex; align-items: center; gap: 10px; padding: 0 16px; min-height: 54px;
  background: var(--surface); border: 2px solid var(--line); border-radius: 14px; color: var(--muted);
}
.search:focus-within { border-color: var(--brand); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; font-size: 1.05rem; background: transparent; color: var(--ink); }
#homeContent { display: flex; flex-direction: column; gap: 22px; }
.home-section { display: flex; flex-direction: column; gap: 12px; }
.section-head { font-size: 1.15rem; font-weight: 900; }

.recent-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.recent-card {
  flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; min-height: 76px; max-width: 260px;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-sm); border: 2px solid transparent; text-align: left;
}
.recent-card:hover { border-color: var(--brand); }
.recent-thumb { width: 52px; height: 60px; flex: none; display: flex; align-items: center; justify-content: center; background: #eceef2; border-radius: 8px; }
.recent-thumb img { max-width: 46px; max-height: 54px; background: #fff; box-shadow: var(--shadow-sm); }
.recent-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.recent-text strong { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-text small { color: var(--muted); font-weight: 700; font-size: 0.8rem; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.gallery-sm { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.gallery-sm .thumb { height: 150px; }
.card { position: relative; min-width: 0; }
.card-open {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  padding: 10px; border-radius: var(--radius); background: var(--surface); border: 2px solid transparent;
  box-shadow: var(--shadow-sm); text-align: center; transition: transform 0.12s, border-color 0.12s;
}
.card-open:hover { border-color: var(--brand); }
.card-open:active { transform: scale(0.97); }
.thumb { height: 180px; display: flex; align-items: center; justify-content: center; background: #eceef2; border-radius: 10px; padding: 10px; color: var(--muted); }
.thumb img { max-width: 100%; max-height: 100%; border-radius: 3px; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18); background: #fff; }
.card-title { font-weight: 800; font-size: 0.98rem; line-height: 1.25; overflow-wrap: anywhere; }
.card-subtitle { color: var(--muted); font-size: 0.82rem; font-weight: 700; margin-top: -4px; overflow-wrap: anywhere; }
.card-menu {
  position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.95); box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.card-add .card-open { border: 2px dashed #c5cad3; box-shadow: none; background: transparent; }
.card-add .thumb { background: transparent; color: var(--brand); }
.card-add .card-title { color: var(--brand); }
.card-brand .card-title { font-size: 1.1rem; }
.brand-letter { font-size: 3.4rem; font-weight: 900; color: var(--brand); }
.roll-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 0.92rem; }
.roll-line .icon { color: var(--brand); }
.empty-hint { padding: 20px; }

/* Dentro da marca: etiquetas externas × internas */
.kind-tabs {
  display: flex; gap: 4px; padding: 4px; background: #e6e8ed; border-radius: 14px;
  position: sticky; top: calc(60px + env(safe-area-inset-top)); z-index: 10;
}
.kind-tab {
  flex: 1 1 0; min-width: 0; min-height: 48px; padding: 6px 8px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 800; font-size: 1rem; color: var(--muted); white-space: nowrap;
}
.kind-tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.kind-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 24px; padding: 0 7px;
  border-radius: 99px; background: rgba(15, 23, 42, 0.08); font-size: 0.8rem; font-weight: 800; color: var(--muted);
}
.kind-tab.active .kind-count { background: var(--brand-soft); color: var(--brand); }
.kind-head { display: flex; flex-direction: column; gap: 2px; padding-left: 12px; border-left: 5px solid var(--line); }
.kind-head .section-head { display: flex; align-items: center; gap: 8px; }
.kind-desc { font-size: 0.9rem; font-weight: 600; }
.kind-outside .kind-head { border-left-color: var(--brand); }
.kind-inside .kind-head { border-left-color: var(--go); }
.thumb { position: relative; }
.kind-badge {
  position: absolute; left: 6px; top: 6px; padding: 3px 9px; border-radius: 99px;
  font-size: 0.75rem; font-weight: 800; color: #fff; box-shadow: var(--shadow-sm);
}
.kind-badge-outside { background: var(--brand); }
.kind-badge-inside { background: var(--go-dark); }
@media (max-width: 400px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

/* Lista de ações (menu "⋯") */
.action-list { display: flex; flex-direction: column; gap: 6px; }
.action-item {
  display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 10px 14px;
  border-radius: 12px; font-weight: 700; text-align: left; background: #f5f6f8;
}
.action-item .icon { color: var(--brand); }
.action-item:hover { background: var(--brand-soft); }
.action-item.danger, .action-item.danger .icon { color: var(--danger); }

/* ---------- Produto: imprimir ---------- */
.product-main {
  width: 100%; max-width: 1100px; margin: 0 auto; padding: 16px 16px 40px;
  display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start;
}
.pp-preview {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 220px; padding: 18px; background: var(--desk); border-radius: 18px;
}
.pp-preview-img { max-width: 100%; max-height: 46dvh; background: #fff; box-shadow: 0 4px 18px rgba(15, 23, 42, 0.2); border-radius: 3px; }
.pp-panel { background: var(--surface); border-radius: 18px; padding: 18px; box-shadow: var(--shadow-sm); }
.model-qty { display: flex; flex-direction: column; gap: 8px; }
.model-qty-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.model-qty-head .field-label { flex: 1; font-size: 1.1rem; }
.model-qty-row {
  display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 14px; border: 2px solid var(--line); cursor: pointer;
}
.model-qty-row.focus { border-color: var(--brand); background: var(--brand-soft); }
.model-qty-thumb { height: 58px; display: flex; align-items: center; justify-content: center; }
.model-qty-thumb img { max-width: 50px; max-height: 58px; background: #fff; box-shadow: var(--shadow-sm); }
.model-qty-name { font-weight: 900; font-size: 1.35rem; overflow-wrap: anywhere; }
.model-qty-row .stepper { gap: 8px; }
.model-qty-row .stepper-btn { width: 50px; height: 50px; font-size: 1.6rem; }
.model-qty-row .stepper-value { width: 76px; font-size: 1.6rem; }
.quick-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* Celular: prévia menor e o botão Imprimir grudado embaixo (acima da barra de impressão) */
.pp-go {
  position: sticky; bottom: calc(var(--print-bar-h, 0px) * var(--bar-on, 0) + 8px); z-index: 4;
  display: flex; flex-direction: column; gap: 8px;
  margin: 0 -10px; padding: 10px; border-radius: 18px; background: var(--surface);
  box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.10);
}
body.has-print-bar { --bar-on: 1; }
.pp-go .print-info { font-size: 0.95rem; }
@media (max-width: 899px) {
  .product-main { padding: 12px 12px 24px; gap: 12px; }
  .pp-preview { min-height: 0; padding: 12px; }
  .pp-preview-img { max-height: 28dvh; }
  .pp-panel { padding: 14px; }
}
@media (min-width: 900px) {
  .pp-go { position: static; margin: 0; padding: 0; box-shadow: none; }
  .product-main { grid-template-columns: minmax(0, 1fr) 460px; padding-top: 24px; }
  .pp-preview { position: sticky; top: 84px; min-height: 60dvh; }
  .pp-preview-img { max-height: 64dvh; }
}

/* ---------- Editor ---------- */
#screenEditor.active { height: 100dvh; overflow: hidden; }
.ed-top .title-stack { flex: 1; }
.models-bar {
  display: flex; align-items: center; gap: 8px; flex: none; overflow-x: auto; scrollbar-width: none;
  padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.models-bar::-webkit-scrollbar { display: none; }
.models-label { font-weight: 800; font-size: 0.9rem; color: var(--muted); flex: none; }
.models-bar .chip { min-width: 52px; min-height: 40px; padding: 6px 16px; }
.models-help { flex: none; font-size: 0.9rem; margin-left: 4px; }

.ed-body { flex: 1; min-height: 0; display: flex; }
.side-panel { display: none; }
.ed-center { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; background: var(--desk); }
.stage-wrap { flex: 1; min-height: 0; position: relative; overflow: hidden; touch-action: none; order: 1; }
.hint { order: 2; text-align: center; color: var(--muted); font-size: 0.95rem; padding: 0 16px 8px; }

/* Barra de propriedades: no celular embaixo (rola para o lado); no computador em cima, flutuando */
.props-bar {
  order: 3; display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: thin;
  padding: 6px 8px; background: var(--surface); border-top: 1px solid var(--line); min-height: 68px;
  animation: rise 0.16s ease-out;
}
.props-bar.empty { display: none; }
.pb-btn {
  flex: none; min-width: 64px; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 6px 8px; border-radius: 10px; font-size: 0.74rem; font-weight: 700; color: var(--ink);
}
.pb-btn:hover { background: #f0f1f4; }
.pb-btn.active { background: var(--brand-soft); color: var(--brand); }
.pb-btn.danger { color: var(--danger); }
.pb-sep { flex: none; width: 1px; align-self: stretch; margin: 6px 4px; background: var(--line); }
.pb-count { flex: none; padding: 6px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 0.85rem; }
.pb-empty { color: var(--muted); font-size: 0.9rem; padding: 0 8px; white-space: nowrap; }
.pb-font {
  flex: none; display: inline-flex; align-items: center; justify-content: space-between; gap: 6px;
  min-width: 132px; max-width: 170px; min-height: 42px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 0.95rem;
}
.pb-font span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-font:hover { border-color: var(--brand); }
.pb-sizebox { flex: none; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; min-height: 42px; }
.pb-mini { width: 36px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 9px; }
.pb-mini:hover { background: #f0f1f4; }
.pb-size { width: 54px; border: 0; text-align: center; font: inherit; font-size: 0.98rem; font-weight: 700; background: transparent; color: var(--ink); }
.pb-size:focus { outline: 2px solid var(--brand); border-radius: 6px; }

.zoom-ctl {
  position: absolute; right: 12px; bottom: 12px; z-index: 5; order: 4;
  display: none; align-items: center; gap: 2px; padding: 3px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-sm);
}
.zoom-ctl .icon-btn { width: 36px; height: 36px; }
.zoom-value { min-width: 56px; font-size: 0.85rem; font-weight: 800; padding: 6px; border-radius: 8px; }
.zoom-value:hover { background: #f0f1f4; }

.bottom-bar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  padding: 6px 8px; padding-bottom: max(6px, env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
}
.bar-btn {
  min-height: var(--bar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 14px; font-size: 0.82rem; font-weight: 700;
}
.bar-btn:active { background: #eef0f3; }

/* Escrever direto na etiqueta */
.inline-text {
  position: absolute; z-index: 6; margin: 0; border: 0; outline: 2px solid var(--brand); outline-offset: 2px;
  background: transparent; resize: none; overflow: hidden; transform-origin: center center;
  caret-color: var(--brand); white-space: pre; overflow-wrap: break-word; box-sizing: border-box;
}
.measure-badge {
  position: absolute; z-index: 7; pointer-events: none; padding: 4px 10px; border-radius: 8px;
  background: var(--ink); color: #fff; font-size: 0.8rem; font-weight: 700; white-space: nowrap;
}

/* Painel lateral (computador) */
.side-head { display: flex; align-items: center; gap: 6px; padding: 12px 14px 6px; }
.side-head h2 { font-size: 1.1rem; font-weight: 900; }
.side-body { padding: 6px 14px 24px; overflow-y: auto; flex: 1; }
.side-body .tile-grid { grid-template-columns: repeat(2, 1fr); }
.side-body .style-grid { grid-template-columns: repeat(2, 1fr); }
.side-body .tile { min-height: 92px; font-size: 0.85rem; }
.add-texts { display: flex; flex-direction: column; gap: 8px; }
.add-text {
  width: 100%; padding: 12px 14px; border-radius: 12px; background: #f5f6f8; border: 2px solid var(--line); text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.add-text:hover { border-color: var(--brand); }
.add-badges { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.add-badges .add-text { text-align: center; border-color: #000; }

@media (min-width: 900px) {
  .side-panel {
    display: flex; flex-direction: column; width: 320px; flex: none; background: var(--surface);
    border-right: 1px solid var(--line); overflow: hidden;
  }
  .props-bar {
    order: 0; align-self: center; margin: 10px 12px 0; padding: 4px 6px; min-height: 52px; max-width: calc(100% - 24px);
    border: 0; border-radius: 14px; box-shadow: var(--shadow-sm); gap: 2px; flex-wrap: nowrap;
  }
  .props-bar.empty { display: flex; background: transparent; box-shadow: none; }
  .pb-btn { flex-direction: row; min-width: 0; min-height: 40px; gap: 6px; padding: 6px 10px; font-size: 0.88rem; }
  .pb-btn.icon-only { padding: 6px 8px; }
  .pb-btn.icon-only .lbl { display: none; }
  .zoom-ctl { display: flex; }
  .bottom-bar { display: none; }
  .hint { display: none; }
}
@media (max-width: 899px) {
  .ed-top .hide-sm { display: none; }
}
@media (max-width: 520px) {
  .hide-sm { display: none !important; }
  .hide-xs { display: none; }
  .top-btn { padding: 8px 10px; }
  .topbar { padding-left: 10px; padding-right: 8px; gap: 4px; }
  .top-actions { gap: 2px; }
  .status-pill { padding: 6px 10px; }
}
.brand-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 400px) {
  .brand-text { display: none; }  /* só o ícone: sobra espaço para o aviso da impressora */
  /* Dentro de uma marca o nome dela tem prioridade: o aviso da impressora vira só a bolinha colorida */
  #screenHome:has(#homeBack:not([hidden])) .status-pill .txt { display: none; }
  #screenHome:has(#homeBack:not([hidden])) .status-pill { padding: 10px; }
}

/* ---------- Botões e campos ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips-wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  flex: none; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 0.95rem;
  background: var(--surface); border: 1px solid var(--line); min-height: 44px;
}
.chip:hover { border-color: var(--brand); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip-add { display: inline-flex; align-items: center; gap: 4px; border-style: dashed; color: var(--brand); border-color: #c9b5fb; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 12px 20px; border-radius: 14px; font-weight: 800; font-size: 1.05rem;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-light { background: #eef0f3; color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-print { background: var(--go); color: #fff; min-height: 68px; font-size: 1.3rem; }
.btn-print:hover:not(:disabled) { background: var(--go-dark); }

.big-input {
  width: 100%; font: inherit; font-size: 1.4rem; font-weight: 700; padding: 14px 16px;
  border: 2px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); resize: vertical;
}
.big-input:focus { border-color: var(--brand); outline: none; }
.price-row { display: flex; align-items: center; gap: 10px; }
.price-prefix { font-size: 1.6rem; font-weight: 900; }
.price-input { font-size: 2rem; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.muted { color: var(--muted); font-size: 0.95rem; }
.center { text-align: center; }
.field-label { font-weight: 800; }
.section-title { font-size: 0.85rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }
.error-text { color: var(--danger); font-weight: 700; background: var(--danger-soft); padding: 10px 12px; border-radius: 10px; }

.switch-row { display: flex; align-items: center; gap: 12px; font-weight: 700; min-height: 48px; cursor: pointer; }
.switch-row input { width: 24px; height: 24px; accent-color: var(--brand); flex: none; }
.varies-list { display: flex; flex-direction: column; gap: 4px; }
.varies-row { padding: 6px 12px; border-radius: 12px; background: #f5f6f8; }
.varies-row span { overflow-wrap: anywhere; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: #eef0f3; border-radius: 12px; }
.seg { min-height: 46px; border-radius: 9px; font-weight: 700; font-size: 0.95rem; }
.seg.active { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }

.slider-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.slider-row .field-label { grid-column: 1 / -1; font-size: 0.95rem; }
.slider { width: 100%; accent-color: var(--brand); }
.slider-value { font-weight: 800; min-width: 48px; text-align: right; }

.num-row { display: grid; grid-template-columns: 1fr 110px 36px; align-items: center; gap: 10px; font-weight: 700; }
.num-input { font: inherit; font-size: 1.2rem; font-weight: 700; padding: 10px; border: 2px solid var(--line); border-radius: 12px; width: 100%; text-align: center; }
.unit { color: var(--muted); }
.advanced summary { cursor: pointer; font-weight: 700; color: var(--muted); padding: 8px 0; }
.advanced[open] { display: flex; flex-direction: column; gap: 10px; }

.stepper { display: flex; align-items: center; justify-content: center; gap: 18px; }
.stepper-btn {
  width: 64px; height: 64px; border-radius: 50%; background: #eef0f3; font-size: 2rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.stepper-btn:active { background: var(--line); }
.stepper-value {
  width: 150px; text-align: center; font: inherit; font-size: 2.4rem; font-weight: 900; color: var(--ink);
  border: 2px solid transparent; border-radius: 12px; background: #f5f6f8; padding: 2px 6px;
}
.stepper-value:focus { border-color: var(--brand); outline: none; background: #fff; }

/* ---------- Painel de baixo ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, 0.45);
  opacity: 0; transition: opacity 0.2s;
}
.backdrop.open { opacity: 1; }
/* --vvh = altura visível da tela e --kb = altura do teclado do celular (ui.js trackViewport):
   o painel sobe junto com o teclado e nunca fica com a parte de baixo escondida. */
.sheet {
  position: fixed; left: 0; right: 0; bottom: var(--kb, 0px); z-index: 51;
  max-height: calc(var(--vvh, 100dvh) - max(16px, env(safe-area-inset-top))); display: flex; flex-direction: column;
  background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow);
  transform: translateY(100%); transition: transform 0.22s ease-out;
  max-width: 640px; margin: 0 auto;
}
.sheet-wide { max-width: 940px; }
.sheet.open { transform: translateY(0); }
/* Tela cheia no celular (conversa por voz): meio rola, embaixo fica fixo */
.sheet-full { height: calc(var(--vvh, 100dvh) - max(16px, env(safe-area-inset-top))); }
@media (min-width: 700px) { .sheet-full { height: min(820px, calc(var(--vvh, 100dvh) - 48px)); } }
.sheet-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 8px 20px; border-bottom: 1px solid transparent; }
.sheet-head h2 { font-size: 1.25rem; font-weight: 900; }
.sheet-close { width: 48px; height: 48px; flex: none; border-radius: 50%; background: #eef0f3; font-size: 1.2rem; font-weight: 800; }
.sheet-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 8px 20px; padding-bottom: max(20px, env(safe-area-inset-bottom));
}
.sheet-foot {
  flex: none; padding: 10px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--surface);
}
.sheet-foot ~ .sheet-body, .sheet-body:has(+ .sheet-foot) { padding-bottom: 16px; }
/* Painel aberto: a página de trás não rola junto */
body.sheet-open { overflow: hidden; }
body.sheet-open .print-bar { display: none; }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 104px; padding: 12px; border-radius: 16px; background: #f5f6f8; border: 2px solid var(--line);
  font-weight: 800; font-size: 0.92rem; text-align: center;
}
.tile .icon { color: var(--brand); }
.tile:hover { border-color: var(--brand); }
.tile:active { background: var(--brand-soft); border-color: var(--brand); }

/* Letra */
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.style-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px;
  border-radius: 14px; background: #f5f6f8; border: 2px solid var(--line); min-width: 0;
}
.style-card:hover { border-color: var(--brand); }
.style-sample { font-size: 1.4rem; line-height: 1.2; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.style-card.inverted .style-sample { background: #000; color: #fff; padding: 2px 10px; border-radius: 6px; }
.style-name { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.font-list { display: flex; flex-direction: column; gap: 6px; }
.font-item {
  display: grid; grid-template-columns: 1fr auto 24px; align-items: center; gap: 10px;
  padding: 8px 12px; min-height: 56px; border-radius: 12px; border: 2px solid var(--line); text-align: left;
}
.font-item:hover { border-color: #c9b5fb; }
.font-item.active { border-color: var(--brand); background: var(--brand-soft); }
.font-item .icon { color: var(--brand); }
.font-sample { font-size: 1.4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.font-name { font-size: 0.8rem; font-weight: 700; color: var(--muted); }

/* Tamanho */
.size-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.size-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px;
  border-radius: 16px; border: 2px solid var(--line); background: #fff; text-align: center;
}
.size-card:hover { border-color: #c9b5fb; }
.size-card.active { border-color: var(--brand); background: var(--brand-soft); }
.size-draw { height: 64px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.size-draw-label { position: relative; background: #fff; border: 2px solid var(--ink); border-radius: 3px; }
.size-draw-stub { position: absolute; left: 0; right: 0; bottom: 0; border-top: 2px dashed #f97316; }
.size-name { font-weight: 800; }
.size-desc { font-size: 0.8rem; color: var(--muted); }
.custom-preview { display: flex; justify-content: center; min-height: 64px; }

/* Imprimir */
.print-info { text-align: center; font-weight: 700; color: var(--muted); }
.print-status { padding: 10px 14px; border-radius: 12px; font-weight: 700; text-align: center; font-size: 0.95rem; }
.print-status.ok { background: #e3f6ec; color: var(--go-dark); }
.print-status.warn { background: var(--warn-soft); color: var(--warn-ink); }
.offset-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.offset-value { min-width: 84px; text-align: center; font-size: 1.3rem; font-weight: 900; }
.warn-text { color: var(--danger); font-weight: 700; }
.flip { display: inline-flex; transform: scaleX(-1); }

/* ---------- Janelas ---------- */
.dialog-overlay {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(15, 23, 42, 0.5);
}
.dialog {
  width: 100%; max-width: 440px; background: #fff; border-radius: 20px; padding: 22px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px;
}
.dialog-text { font-size: 1.15rem; font-weight: 700; }
.dialog .big-input { margin-top: 12px; }
.dialog-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.dialog-buttons .btn { flex: 1 1 140px; }

/* ---------- Aviso ---------- */
.toast {
  position: fixed; left: 50%; top: 16px; z-index: 100; transform: translate(-50%, -150%);
  width: max-content; max-width: calc(100% - 32px);
  padding: 14px 20px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 700;
  box-shadow: var(--shadow); transition: transform 0.25s;
}
.toast.show { transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }

/* ---------- Acessibilidade ---------- */
html.big-text { font-size: 19.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Botão "Nova etiqueta" (início) ---------- */
.new-label-btn {
  display: flex; align-items: center; gap: 16px; width: 100%; min-height: 92px; padding: 16px 20px;
  background: var(--brand); color: #fff; border-radius: 20px; text-align: left; box-shadow: 0 6px 18px rgba(124, 58, 237, 0.35);
}
.new-label-btn:hover { background: var(--brand-dark); }
.new-label-btn:active { transform: scale(0.99); }
.new-label-plus { width: 60px; height: 60px; flex: none; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; }
.new-label-plus .icon { width: 34px; height: 34px; }
.new-label-text { display: flex; flex-direction: column; line-height: 1.2; }
.agent-btn {
  display: flex; align-items: center; gap: 16px; width: 100%; min-height: 80px; padding: 14px 20px; margin-top: 12px;
  background: var(--surface); color: var(--brand); border: 3px solid var(--brand); border-radius: 20px; text-align: left;
}
.agent-btn[hidden] { display: none; }
.agent-btn:hover { background: var(--brand-soft); }
.agent-btn .new-label-plus { background: var(--brand-soft); }
.agent-btn small { color: var(--muted); font-weight: 600; }

/* ---------- Pedido por voz ---------- */
.ag-examples { font-size: 0.95rem; }
.ag-log { display: flex; flex-direction: column; gap: 8px; }
.ag-log:empty { display: none; }
.ag-msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-weight: 600; overflow-wrap: anywhere; }
.ag-user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.ag-bot { align-self: flex-start; background: #eef0f3; color: var(--ink); border-bottom-left-radius: 4px; }
.ag-thinking { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
.spinner.dark { width: 20px; height: 20px; border-color: rgba(0,0,0,0.15); border-top-color: var(--brand); }
.ag-voice-toggle { display: flex; align-items: center; gap: 8px; font-size: 1rem; color: var(--muted); min-height: 40px; }
.ag-voice-toggle input { width: 22px; height: 22px; accent-color: var(--brand); }

/* Parte fixa de baixo: [Imprimir][Cancelar] · microfone · campo de texto */
.ag-foot { display: flex; flex-direction: column; gap: 10px; }
.ag-actions { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 8px; }
.ag-actions .btn-print { min-height: 60px; font-size: 1.2rem; }
.ag-actions .btn-light { min-height: 60px; }
.ag-mic-wrap { display: flex; flex-direction: column; gap: 6px; }
.ag-mic { min-height: 60px; font-size: 1.2rem; }
.ag-heard { font-size: 1.05rem; font-weight: 700; text-align: center; color: var(--listen); overflow-wrap: anywhere; }
.ag-foot.typing .ag-mic-wrap { display: none; }  /* escrevendo: sobra espaço acima do teclado */
.ag-type { display: flex; gap: 8px; }
.ag-input { flex: 1; min-width: 0; font-size: 1.15rem; padding: 12px 14px; min-height: 54px; }
.ag-send { flex: none; width: 56px; min-height: 54px; padding: 0; }

/* Etiqueta para conferir: miniatura ao lado das informações, mesmo no celular */
.ag-card { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; padding: 12px; border: 2px solid var(--go); border-radius: 18px; background: var(--surface); }
.ag-card-wide { grid-column: 1 / -1; }
.ag-card-thumb { display: flex; align-items: flex-start; justify-content: center; }
.ag-card-thumb img { max-width: 100%; max-height: 130px; border-radius: 6px; box-shadow: var(--shadow-sm); }
.ag-card-title { display: block; font-size: 1.25rem; font-weight: 900; overflow-wrap: anywhere; }
.ag-qty { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 1.2rem; }
@media (min-width: 700px) {
  .ag-card { grid-template-columns: 140px minmax(0, 1fr); }
  .ag-card-thumb img { max-height: 200px; }
}
.new-label-text strong { font-size: 1.5rem; font-weight: 900; }
.new-label-text small { font-size: 1rem; opacity: 0.92; font-weight: 600; }

/* ---------- Nova etiqueta (perguntas) ---------- */
.wz-top-mid { display: flex; flex-direction: column; align-items: center; line-height: 1.15; text-align: center; }
.wz-top-mid strong { font-size: 1.05rem; font-weight: 900; }
.wz-step { font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.wz-top .top-left, .wz-top .top-actions { flex: 1; }
.wz-top .top-actions { justify-content: flex-end; }
.wz-progress { height: 6px; background: var(--line); }
.wz-progress span { display: block; height: 100%; width: 0; background: var(--brand); transition: width 0.25s; }
.wz-main { width: 100%; max-width: 680px; margin: 0 auto; padding: 22px 16px 48px; }
.wz-body { display: flex; flex-direction: column; gap: 18px; animation: rise 0.18s ease-out; }
.wz-q { display: flex; flex-direction: column; gap: 6px; }
.wz-title { font-size: 1.75rem; font-weight: 900; line-height: 1.2; }
.wz-hint { color: var(--muted); font-size: 1.05rem; font-weight: 600; }
.wz-options { display: flex; flex-direction: column; gap: 12px; }
.wz-option {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 84px; padding: 12px 16px;
  background: var(--surface); border: 3px solid var(--line); border-radius: 18px; text-align: left; box-shadow: var(--shadow-sm);
}
.wz-option:hover:not(:disabled), .wz-option.selected { border-color: var(--brand); background: var(--brand-soft); }
.wz-option > .icon { color: var(--brand); margin-left: auto; }
.wz-option-tall { min-height: 130px; }
.wz-option-thumb { width: 84px; height: 108px; flex: none; display: flex; align-items: center; justify-content: center; background: #eceef2; border-radius: 10px; color: var(--muted); }
.wz-option-thumb img { max-width: 76px; max-height: 100px; background: #fff; box-shadow: var(--shadow-sm); }
.wz-option-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wz-option-text strong { font-size: 1.3rem; font-weight: 900; }
.wz-option-text small { color: var(--muted); font-size: 0.98rem; font-weight: 600; }
.wz-note { color: var(--warn-ink) !important; }
.wz-field { display: flex; flex-direction: column; gap: 12px; }
.wz-input { font-size: 1.6rem; min-height: 68px; text-transform: uppercase; }
.wz-input::placeholder { text-transform: none; font-weight: 500; color: #8a919c; }
.wz-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.wz-next { width: 100%; min-height: 68px; font-size: 1.3rem; justify-content: space-between; padding: 12px 22px; }
.wz-next .icon { width: 26px; height: 26px; }
.btn-go { background: var(--go); color: #fff; }
.btn-go:hover:not(:disabled) { background: var(--go-dark); }
.wz-next.is-busy { justify-content: center; opacity: 1; }
.wz-big-alt { min-height: 64px; font-size: 1.15rem; }
.wz-warn { display: flex; gap: 10px; align-items: flex-start; color: var(--warn-ink); background: var(--warn-soft); border: 2px solid #f0c27a; padding: 12px 14px; border-radius: 12px; font-weight: 700; }
.wz-error { color: var(--danger); font-weight: 800; background: var(--danger-soft); padding: 12px 14px; border-radius: 12px; font-size: 1.05rem; }
.size-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.size-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 84px; min-height: 68px; padding: 8px 14px; border-radius: 16px;
  font-size: 1.5rem; font-weight: 900; background: var(--surface); border: 3px solid var(--line); color: var(--muted);
}
.size-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.wz-confirm { display: grid; gap: 18px; }
.wz-preview { display: flex; align-items: center; justify-content: center; min-height: 240px; padding: 16px; background: var(--desk); border-radius: 18px; }
.wz-preview img { max-width: 100%; max-height: 50dvh; background: #fff; box-shadow: 0 4px 18px rgba(15, 23, 42, 0.2); border-radius: 3px; }
.wz-review-row { display: flex; flex-direction: column; gap: 6px; }
.wz-review-label { font-weight: 800; color: var(--muted); font-size: 0.95rem; }
.wz-review-row .big-input { font-size: 1.25rem; }
.wz-sizes-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font-size: 1.25rem; font-weight: 900; text-align: left; }
@media (min-width: 760px) { .wz-confirm { grid-template-columns: 1fr 1fr; align-items: start; } .wz-main { max-width: 900px; } }

/* ---------- Barra de impressão (todas as telas) ---------- */
.print-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; /* abaixo dos painéis (50) */
  padding: 10px 12px max(10px, env(safe-area-inset-bottom)); color: #fff;
  box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.25);
}
.print-bar.printing { background: var(--brand); }
.print-bar.stopped { background: var(--listen); }
.print-bar.paused { background: #b45309; }
.print-bar-main { display: flex; align-items: center; gap: 10px; max-width: 1100px; margin: 0 auto; }
.print-bar-icon { flex: none; display: flex; }
.print-bar-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.print-bar-text strong { font-size: 1.05rem; font-weight: 900; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.print-bar-text span { font-size: 0.92rem; font-weight: 700; opacity: 0.95; }
.print-bar-text .print-bar-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 800; opacity: 1; }
.print-bar-btn { min-height: 50px; padding: 8px 14px; flex: none; background: #fff; color: var(--ink); }
.print-bar.printing .print-bar-btn { color: var(--listen); background: #fff; }
.print-bar .btn-go { background: #fff; color: var(--go-dark); }
.print-bar-close { color: #fff; width: 48px; height: 48px; margin-right: -6px; }
.print-bar-close:hover { background: rgba(255,255,255,0.15); }
.print-bar-progress { max-width: 1100px; margin: 8px auto 0; height: 6px; border-radius: 99px; background: rgba(255,255,255,0.3); overflow: hidden; }
.print-bar-progress span { display: block; height: 100%; background: #fff; border-radius: 99px; transition: width 0.4s; }
@media (max-width: 420px) {
  .print-bar { padding-left: 10px; padding-right: 10px; }
  .print-bar-main { gap: 8px; }
  .print-bar-icon { display: none; }
  .print-bar-btn { padding: 8px 12px; font-size: 1rem; gap: 6px; }
}
/* Espaço no fim da tela do tamanho real da barra (medido em queue.js) */
body.has-print-bar .screen.active { padding-bottom: calc(var(--print-bar-h, 110px) + 12px); }
body[data-screen="screenEditor"] .print-bar, body[data-screen="screenNew"] .print-bar { display: none; }
.print-bar-extra { max-width: 1100px; margin: 6px auto 0; }
.print-bar-link { color: #fff; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; padding: 4px 0; font-size: 0.98rem; }
.stuck-steps { display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 12px 34px; background: var(--danger-soft); color: #7f1d1d; border-radius: 12px; font-weight: 600; }
.btn-stop { background: var(--listen); color: #fff; }
.btn-stop:hover { background: #b71c1c; }

/* Continuar */
.resume-summary { font-size: 1.2rem; font-weight: 800; }
.resume-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px; border: 2px solid var(--line); border-radius: 16px; }
.resume-stepper { display: flex; align-items: center; gap: 10px; }
.resume-stepper .stepper-btn { width: 56px; height: 56px; font-size: 1.8rem; }
.resume-value { min-width: 96px; text-align: center; font-size: 1.8rem; font-weight: 900; }
.resume-left { font-weight: 800; font-size: 1.05rem; }
.resume-input { width: 120px; min-width: 0; padding: 6px 4px; border: 2px solid var(--line, #ccc); border-radius: 12px; background: transparent; color: inherit; font: inherit; font-size: 1.8rem; font-weight: 900; text-align: center; -moz-appearance: textfield; }
.resume-input::-webkit-outer-spin-button, .resume-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.resume-which { font-size: 1.05rem; }

/* ---------- Histórico ---------- */
.history-main { width: 100%; max-width: 820px; margin: 0 auto; padding: 16px 16px 48px; display: flex; flex-direction: column; gap: 18px; }
.job-card { background: var(--surface); border-radius: 18px; padding: 14px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px; border-left: 8px solid var(--line); }
.job-card.printing { border-left-color: var(--brand); }
.job-card.done { border-left-color: var(--go); }
.job-card.stopped { border-left-color: var(--listen); }
.job-card.paused { border-left-color: #d97706; }
.job-top { display: flex; gap: 12px; align-items: flex-start; }
.job-thumb { width: 96px; height: 72px; flex: none; display: flex; align-items: center; justify-content: center; background: #eceef2; border-radius: 10px; color: var(--muted); overflow: hidden; }
.job-thumb img { max-width: 92px; max-height: 68px; background: #fff; }
.job-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.job-title { font-size: 1.15rem; font-weight: 900; overflow-wrap: anywhere; }
.job-sub, .job-when { color: var(--muted); font-weight: 700; font-size: 0.92rem; }
.job-pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 4px 12px; border-radius: 99px; font-weight: 800; font-size: 0.9rem; }
.job-pill.printing { background: var(--brand-soft); color: var(--brand); }
.job-pill.done { background: #e3f6ec; color: var(--go-dark); }
.job-pill.stopped { background: var(--danger-soft); color: var(--danger); }
.job-pill.paused { background: var(--warn-soft); color: var(--warn-ink); }
.job-count { display: flex; flex-direction: column; gap: 2px; font-size: 1.05rem; }
.job-count strong { font-size: 1.4rem; font-weight: 900; }
.job-progress { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.job-progress span { display: block; height: 100%; background: var(--go); border-radius: 99px; }
.job-card.stopped .job-progress span { background: var(--listen); }
.job-card.paused .job-progress span { background: #d97706; }
.job-card.printing .job-progress span { background: var(--brand); }
.job-msg { color: var(--warn-ink); font-weight: 700; }
.job-card.stopped .job-msg { color: var(--danger); }
.job-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.job-actions .btn { flex: 1 1 200px; }
.job-delete { color: var(--danger); margin-left: auto; }

/* Ocupado (IA arrumando o texto) */
.spinner { width: 24px; height: 24px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.4); border-top-color: #fff; animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Microfone: desligado = contorno roxo com "Falar"; ouvindo = vermelho, pulsando, com "Parar" */
.mic-wrap { display: flex; flex-direction: column; gap: 10px; }
.mic-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; width: 100%;
  border-radius: 16px; border: 3px solid var(--brand); color: var(--brand); background: var(--surface);
  font-size: 1.25rem; font-weight: 900;
}
.mic-btn:hover { background: var(--brand-soft); }
.mic-btn.on { background: var(--listen); border-color: var(--listen); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.55); } 50% { box-shadow: 0 0 0 12px rgba(211, 47, 47, 0); } }
.listening-banner {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 12px; padding: 14px 16px;
  border-radius: 14px; background: var(--listen-soft); color: var(--listen); border: 2px solid var(--listen);
}
.listening-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--listen); grid-row: span 2; animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.listening-text { display: flex; flex-direction: column; }
.listening-text strong { font-size: 1.2rem; font-weight: 900; }
.listening-text small { font-size: 0.95rem; font-weight: 700; color: #8e1b1b; }
.listening-heard { grid-column: 2; font-size: 1.1rem; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.listening-heard:empty { display: none; }

/* Câmera lendo código */
.scan-overlay { position: fixed; inset: 0; z-index: 200; background: #000; display: flex; align-items: center; justify-content: center; }
.scan-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: relative; width: min(84vw, 420px); height: 34vw; max-height: 200px; border: 4px solid #fff; border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(0,0,0,0.45); overflow: hidden; }
.scan-line { position: absolute; left: 6%; right: 6%; top: 50%; height: 3px; background: #ff5252; box-shadow: 0 0 10px #ff5252; animation: scanline 1.6s ease-in-out infinite alternate; }
@keyframes scanline { from { top: 15%; } to { top: 85%; } }
.scan-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 16px max(18px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; align-items: center; background: linear-gradient(transparent, rgba(0,0,0,0.75)); }
.scan-status { color: #fff; font-size: 1.25rem; font-weight: 800; text-align: center; }
.scan-cancel { min-width: 220px; }

@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Instalar app (PWA) */
#installBtn[hidden] { display: none; }
.install-lead { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-weight: 600; }
.install-steps { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 12px; }
.install-step { display: flex; align-items: flex-start; gap: 12px; line-height: 1.4; }
.install-num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.install-ok { width: 100%; justify-content: center; }
