/*
  CasaFort OS — tema visual.
  Vidro translúcido no estilo iOS, com custo baixo: o desfoque (backdrop-filter) só é usado na barra
  de navegação, na barra fixa do total no celular e nas janelas modais. Cartões usam transparência simples,
  e o fundo é um gradiente fixo, sem imagem e sem animação.
  Cores do logo: índigo (Casa) e laranja (Fort).
*/
@font-face {
  font-family: Inter;
  src: url('/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --brand: #3b3aa6;
  --brand-strong: #2c2b8a;
  --brand-soft: rgba(59, 58, 166, 0.09);
  --accent: #f28a1e;
  --accent-strong: #d9700a;
  --ink: #181a3d;
  --muted: #5c6286;
  --glass: rgba(255, 255, 255, 0.68);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --glass-edge: rgba(255, 255, 255, 0.75);
  --line: rgba(59, 58, 166, 0.14);
  --shadow: 0 10px 30px rgba(30, 28, 90, 0.08), 0 1px 2px rgba(30, 28, 90, 0.06);
  --radius: 18px;
  --radius-sm: 12px;
  --blur: blur(18px) saturate(170%);
  /* nomes usados pelas folhas de estilo anteriores */
  --navy: var(--ink);
  --blue: var(--brand);
  --orange: var(--accent);
  --action: var(--accent-strong);
  --border: var(--line);
  --green: var(--brand);
  color: var(--ink);
  background: #eef0fb;
  font-family: Inter, 'Segoe UI', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

/* Fundo: manchas suaves fixas em camada própria (não repinta ao rolar). */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60vmax 45vmax at 8% -10%, rgba(59, 58, 166, 0.22), transparent 60%),
    radial-gradient(50vmax 40vmax at 105% 10%, rgba(242, 138, 30, 0.18), transparent 60%),
    radial-gradient(55vmax 45vmax at 50% 115%, rgba(120, 118, 230, 0.16), transparent 60%),
    #eef0fb;
}
body, .quotes { background: transparent; }
.quotes { --ink: #181a3d; --sage: var(--brand-soft); --paper: var(--glass); }

/* Marca */
.brand { display: inline-flex; align-items: baseline; gap: 0; letter-spacing: -0.04em; font-weight: 800; text-decoration: none; }
.brand::before { content: none; }
.brand b { color: var(--brand); font-weight: 850; }
.brand i { color: var(--accent); font-style: normal; font-weight: 850; }
.brand span { color: var(--muted); font-weight: 500; margin-left: 0.3em; font-size: 0.78em; letter-spacing: 0; }

/* Navegação em vidro (um dos poucos elementos com desfoque). */
.topbar, .rail, .price-nav {
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-right: 1px solid var(--glass-edge);
  box-shadow: 1px 0 0 rgba(59, 58, 166, 0.06);
}
.topbar { border-right: 0; border-bottom: 1px solid var(--glass-edge); }
.access-intro { background: transparent; color: var(--ink); }
.access-intro p { color: var(--muted); }
.rail nav a, .price-nav a {
  color: var(--ink);
  border-radius: var(--radius-sm);
  font-weight: 560;
  transition: background-color 0.15s ease;
}
.rail nav a:hover, .price-nav a:hover { background: var(--brand-soft); }
.rail nav a[aria-current], .price-nav a[aria-current] {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 16px rgba(59, 58, 166, 0.28);
}
.rail-account { display: grid; gap: 0.5rem; margin-top: auto; }
.rail #account-name { color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.rail-logout { background: transparent; color: var(--brand); border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.9rem; }

/* Superfícies: transparência sem desfoque (barato). */
.box, .card, .metric, .summary, .product-section, .quotes .listing, #composition .items tr {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.quotes .listing { box-shadow: none; background: transparent; border: 0; }
.metric { border-bottom: 1px solid var(--glass-edge); }
.metric strong { color: var(--ink); letter-spacing: -0.03em; }
.quotes a.metric:hover, .quotes button.metric:hover { background: var(--glass-strong); }

.heading h1 { font-weight: 780; letter-spacing: -0.04em; color: var(--ink); }
.box h2, .summary h2 { color: var(--ink); letter-spacing: -0.02em; }
.hint, .quiet, .empty, .step-caption, .picker-header small { color: var(--muted); }
.crumb { border-color: var(--line); }
.crumb a { color: var(--muted); }

/* Botões */
button, .button {
  border-radius: 999px;
  background: var(--brand);
  border: 1px solid transparent;
  color: #fff;
  font-weight: 650;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
button:active:not(:disabled), .button:active { transform: scale(0.98); }
button:hover:not(:disabled) { filter: none; background: var(--brand-strong); }
.button, #save, #access-submit, #new-lead, #new-person, #edit-goals {
  background: linear-gradient(180deg, #f7992f, var(--accent-strong));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(217, 112, 10, 0.28);
}
.button:hover, #save:hover:not(:disabled), #access-submit:hover:not(:disabled), #new-lead:hover, #new-person:hover, #edit-goals:hover {
  background: linear-gradient(180deg, var(--accent), #c56408);
}
.quotes .light, button.light, .light {
  background: var(--glass-strong);
  color: var(--brand);
  border: 1px solid var(--line);
  box-shadow: none;
}
.quotes .light:hover:not(:disabled) { background: #fff; }
.quotes .subtle, .quotes .select-hint, #selector .picker-back { color: var(--brand) !important; }

/* Campos */
input, select, textarea, .quotes textarea {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(59, 58, 166, 0.18);
  border-radius: var(--radius-sm);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(59, 58, 166, 0.14); outline: none; }
:focus-visible { outline: 3px solid rgba(59, 58, 166, 0.55); outline-offset: 2px; }

/* Tabelas, selos e avisos */
th { background: var(--brand-soft); color: var(--muted); font-weight: 650; }
td, th { border-color: var(--line); }
.badge { background: var(--brand-soft); color: var(--brand-strong); border-radius: 999px; }
#notice:not(:empty) { background: var(--glass-strong); color: var(--brand-strong); border: 1px solid var(--glass-edge); border-radius: var(--radius-sm); }
#notice[data-error='true']:not(:empty), .message[data-error='true'] { background: #fff1ee; color: #9a2c1d; padding: 0.65rem; border-radius: var(--radius-sm); }
#save-state { color: var(--muted); }
#save-state[data-saved='true'] { color: #14704a; }

/* Catálogo guiado */
.category-chip { background: var(--glass-strong); border: 1px solid var(--line); border-radius: 999px; color: var(--ink); }
.category-chip:hover { background: #fff; }
#selector .picker-header { border-color: var(--line); }
#selector .picker-option, #selector .result, .model-choice {
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  border: 1px solid var(--glass-edge);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(30, 28, 90, 0.05);
}
#selector .picker-option:hover, #selector .result:hover, .model-choice:hover { background: #fff; border-color: rgba(59, 58, 166, 0.35); }
#selector .picker-option b { color: var(--brand) !important; }
#selector .picker-option:has(small) b, #selector .picker-option[data-choice] b { background: var(--accent-strong); color: #fff !important; border-radius: 8px; width: 1.65rem; text-align: center; }
#selector .option-price, #selector .picker-option small { font-weight: 650; color: var(--ink) !important; }
#selector .picker-option { width: 100%; }
.picker-header small { font-weight: 550; }
#products .model-choice { text-transform: none; overflow-wrap: anywhere; }

/* Resumo do orçamento */
.summary { border-top: 0; }
.summary .grand { background: linear-gradient(135deg, var(--brand), var(--brand-strong)); color: #fff; border: 0; border-radius: 14px; padding: 0.9rem; margin: 0.6rem 0; }
#grand-total { font-size: clamp(1.25rem, 1.7vw, 1.75rem); letter-spacing: -0.04em; }
table, .metric, .metric-line { font-variant-numeric: tabular-nums; }

/* Janelas modais em vidro */
.quotes dialog, dialog {
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(30, 28, 90, 0.25);
}
.quotes dialog::backdrop, dialog::backdrop { background: rgba(24, 26, 61, 0.35); }

/* Itens do orçamento (regras de layout preservadas do tema anterior) */
#composition .items { min-width: 0; }
#composition .items td:first-child { min-width: 9rem; }
#composition td small { display: block; color: var(--muted); line-height: 1.5; }
#composition td:nth-child(3), #composition td:nth-child(4) { white-space: nowrap; }
#composition .items details { margin: 0; }
#composition .items tr { background: transparent; box-shadow: none; border: 0; border-radius: 0; }

@media (max-width: 600px) {
  .quotes:has(.editor) main { padding-bottom: calc(10rem + env(safe-area-inset-bottom)); }
  .editor > .summary {
    position: fixed;
    inset: auto 0 0;
    background: rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border-radius: 22px 22px 0 0;
    border: 1px solid var(--glass-edge);
    box-shadow: 0 -10px 30px rgba(30, 28, 90, 0.12);
  }
  .summary #totals > :not(.grand) { display: none; }
  .summary .metric-line.grand { background: transparent; color: var(--ink); margin: 0; padding: 0 0 0.45rem; }
  #composition .items td:nth-child(n)::before { content: none; }
  #composition .items td:nth-child(n) { grid-column: auto; background: transparent; }
  #composition .items td:first-child, #composition .items td:last-child { grid-column: 1 / -1; }
  #composition .items td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 0.75rem; }
  #composition .items tr { border: 1px solid var(--line); border-radius: 14px; }
  .quotes .rail .brand { font-size: 1rem; }
  .rail-account { display: none; }
  .rail { border-right: 0; border-bottom: 1px solid var(--glass-edge); }
}

/* Acessibilidade e máquinas modestas: sem transparência ou sem movimento quando o sistema pedir. */
@media (prefers-reduced-transparency: reduce) {
  .topbar, .rail, .price-nav, dialog, .editor > .summary { -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; }
  .box, .card, .metric, .summary { background: #fff; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Aviso do cliente ocupa a linha inteira, logo abaixo de nome e WhatsApp. */
#ident #customer-detail { grid-column: 1 / -1; margin: -0.35rem 0 0.2rem; }

.brand img { width: 1.7em; height: auto; margin-right: 0.35em; align-self: center; }
.rail .brand { font-size: 1.2rem; white-space: nowrap; }

/* Acabamentos finos (boas práticas de interface) */
/* Altura dinâmica: no celular, 100vh ignora a barra do navegador; dvh acompanha. */
.quotes { min-height: 100vh; min-height: 100dvh; }
/* Só no computador a barra é lateral e ocupa a altura toda; no celular ela é a barra superior. */
@media (min-width: 801px) { .rail { height: 100vh; height: 100dvh; } }
/* Gradientes em OKLCH não acinzentam no meio da transição (a primeira linha é reserva para navegador antigo). */
.button, #save, #access-submit, #new-lead, #new-person, #edit-goals {
  background: linear-gradient(180deg, #f7992f, var(--accent-strong));
  background: linear-gradient(180deg in oklch, oklch(0.78 0.16 62), oklch(0.66 0.17 52));
}
.summary .grand {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  background: linear-gradient(135deg in oklch, oklch(0.45 0.17 278), oklch(0.36 0.15 278));
}
/* Cantos aninhados: raio interno = raio do cartão − espaçamento interno, para as curvas ficarem paralelas. */
.box, .card, .summary { --inner-radius: max(6px, calc(var(--radius) - 0.9rem)); }
.box #selector .picker-option, #selector .picker-option, #selector .result, .model-choice, .summary .grand, .quotes .light, .category-chip { border-radius: var(--inner-radius, 10px); }
/* Navegação que rola para o lado no celular: bordas esmaecidas indicam que há mais itens. */
@media (max-width: 800px) {
  .rail nav { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 28px), transparent); padding-inline: 8px 24px; }
}
/* Foto de produto com fundo branco "some" sobre o cartão translúcido. */
#selector .result img, .product-option img { mix-blend-mode: multiply; }

/* Pré-orçamento: edição na linha e prévia para o cliente */
#composition .line-input { width: 6.5rem; min-height: 40px; padding: 0.35rem 0.5rem; text-align: right; }
#composition input[data-qty] { width: 4.5rem; }
.badge.tag-custom { background: rgba(242, 138, 30, 0.14); color: #a3510a; margin-left: 0.4rem; }
.badge.tag-adjusted { background: rgba(229, 165, 10, 0.16); color: #7a5600; margin-left: 0.4rem; }
.preview-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: baseline; }
.preview-items { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.6rem; }
.preview-items li { display: grid; grid-template-columns: 1fr auto; gap: 0.1rem 1rem; }
.preview-items li span, .preview-items li small { color: var(--muted); grid-column: 1; }
.preview-items li b { grid-column: 2; grid-row: 1; text-align: right; }
.preview .grand { background: linear-gradient(135deg, var(--brand), var(--brand-strong)); color: #fff; border-radius: 14px; padding: 0.9rem; display: flex; justify-content: space-between; }
@media (max-width: 600px) { #composition .line-input { width: 100%; } }

/* Pós-venda */
.quotes .seg { display: flex; flex-wrap: nowrap; gap: 4px; padding: 4px; background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 999px; width: fit-content; max-width: 100%; overflow-x: auto; }
.quotes .seg-btn, .quotes .tab { background: transparent; color: var(--muted); border: 0; box-shadow: none; padding: 0.45rem 0.95rem; white-space: nowrap; }
.quotes .seg-btn.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(30, 28, 90, 0.12); }
.quotes .tabs { display: flex; gap: 0.25rem; margin: 0.8rem 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.quotes .tab { border-radius: 10px 10px 0 0; border-bottom: 2px solid transparent; }
.quotes .tab.on { color: var(--ink); border-bottom-color: var(--brand); }
.quotes .seg-btn:hover:not(:disabled), .quotes .tab:hover:not(:disabled) { background: rgba(255, 255, 255, 0.6); color: var(--ink); }
.quotes .count { background: #c92a2a; color: #fff; border-radius: 999px; padding: 0 0.45rem; font-size: 0.75rem; }
.quotes .pill { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.8rem; font-weight: 650; white-space: nowrap; }
.quotes .late { color: #c92a2a; font-weight: 650; }
.quotes .today { color: #b4530a; font-weight: 650; }
.quotes .prio-Urgente { color: #c92a2a; font-weight: 700; }
.quotes .prio-Alta { color: #b4530a; font-weight: 650; }
.quotes .prio-Baixa { color: var(--muted); }
.quotes tr.total td { font-weight: 700; }
.quotes button.att { display: flex; justify-content: space-between; gap: 1rem; width: 100%; text-align: left; background: rgba(255, 255, 255, 0.7); color: var(--ink); border: 1px solid var(--glass-edge); border-radius: var(--inner-radius, 12px); padding: 0.7rem 0.9rem; font: inherit; }
.quotes button.att small { display: block; }
.quotes .bars { display: grid; gap: 0.5rem; }
.quotes .bar { display: grid; grid-template-columns: minmax(120px, 160px) 1fr 2rem; gap: 0.6rem; align-items: center; font-size: 0.9rem; }
.quotes .bar .track { height: 8px; background: rgba(59, 58, 166, 0.08); border-radius: 999px; overflow: hidden; }
.quotes .bar .track .fill { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.quotes .bar b { text-align: right; }
.quotes .board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 0.75rem; overflow-x: auto; padding-bottom: 0.5rem; }
.quotes .board-col { background: rgba(255, 255, 255, 0.45); border: 1px solid var(--glass-edge); border-radius: var(--radius); padding: 0.6rem; min-height: 200px; }
.quotes .board-col h3 { display: flex; justify-content: space-between; font-size: 0.9rem; margin: 0.2rem 0.3rem 0.6rem; }
.quotes .board-card { display: grid; gap: 0.2rem; width: 100%; text-align: left; margin-bottom: 0.5rem; background: rgba(255, 255, 255, 0.85); color: var(--ink); border: 1px solid var(--glass-edge); border-radius: 12px; padding: 0.6rem 0.75rem; font: inherit; box-shadow: 0 2px 8px rgba(30, 28, 90, 0.05); }
.quotes .board-meta { display: flex; justify-content: space-between; gap: 0.4rem; font-size: 0.8rem; color: var(--muted); }
.pv-detail .info { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1rem; margin: 0; }
.pv-detail .info dt { font-size: 0.75rem; font-weight: 650; color: var(--muted); }
.pv-detail .info dd { margin: 0; }
.pv-detail .info .full { grid-column: 1 / -1; }
.pv-detail h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); margin: 0.4rem 0; }
.pv-detail .stars button { background: none; border: 0; box-shadow: none; color: #d1d5db; font-size: 1.5rem; padding: 0 0.1rem; }
.pv-detail .stars button.on { color: #f59f00; }
.pv-detail .evs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.5rem; margin-bottom: 0.5rem; }
.pv-detail .ev { margin: 0; }
.pv-detail .ev a { position: relative; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: #eef0f6; border: 1px solid var(--line); }
.pv-detail .ev img, .pv-detail .ev video { width: 100%; height: 100%; object-fit: cover; }
.pv-detail .ev .play { position: absolute; color: #fff; font-size: 1.6rem; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7); }
.pv-detail .ev .pdf { font-weight: 800; color: #c92a2a; }
.pv-detail .ev figcaption { font-size: 0.75rem; color: var(--muted); overflow-wrap: anywhere; }
.pv-detail .button-file { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1rem; border-radius: 999px; cursor: pointer; font-weight: 650; }
.pv-detail .wa-box { background: rgba(31, 157, 85, 0.07); border: 1px solid rgba(31, 157, 85, 0.25); border-radius: 14px; padding: 0.8rem; display: grid; gap: 0.5rem; }
.pv-detail .row-form { display: flex; gap: 0.5rem; align-items: flex-start; }
.pv-detail .row-form textarea { flex: 1; }
.pv-detail .hist { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; }
.pv-detail .hist li { display: grid; gap: 0.1rem; padding: 0.5rem 0; border-bottom: 1px dashed var(--line); font-size: 0.9rem; }
@media (max-width: 700px) { .pv-detail .info { grid-template-columns: 1fr; } .quotes .board { grid-template-columns: repeat(5, 78vw); } }

/* Cores de status do pós-venda (classes no lugar de style="…", bloqueado pela política de segurança). */
.quotes .pill.st-0 { color: #334155; background: #e2e8f0; }
.quotes .pill.st-1 { color: #9a5b00; background: #fff3bf; }
.quotes .pill.st-2 { color: #6741d9; background: #ece5ff; }
.quotes .pill.st-3 { color: #a61e4d; background: #ffe3ec; }
.quotes .pill.st-4 { color: #2b8a3e; background: #d3f9d8; }
.quotes .pill.st-5 { color: #6b7280; background: #f1f3f5; }
.quotes .bar .fill { width: 0; }
.quotes .bar .fill.st-0 { background: #334155; } .quotes .bar .fill.st-1 { background: #e5a50a; }
.quotes .bar .fill.st-2 { background: #6741d9; } .quotes .bar .fill.st-3 { background: #a61e4d; }
.quotes .progress-bar { width: 0; }
/* Seletor de lojas e abas: uma linha que rola para o lado, sem espremer nem sobrepor os botões. */
.quotes .seg-btn, .quotes .tabs .tab { flex: none; }
.quotes .tabs { scrollbar-width: thin; }

/* Respiro entre áreas: nenhum bloco encosta no outro (cartões, indicadores, seções e colunas). */
.quotes .metrics { gap: 0.9rem; margin: 1.1rem 0; }
.quotes #screen > * + *, .quotes .editor > .stack > * + *, .quotes .split, .quotes section.box + section.box,
.quotes section.box + .split, .quotes .hero + .metrics, .quotes .metrics + section.box { margin-top: 1.1rem; }
.quotes .split { gap: 1.1rem; }
.quotes .editor { gap: 1.1rem; }
@media (max-width: 600px) { .quotes .metrics { gap: 0.6rem; } }

/* Logos das lojas (Equipe) */
.quotes .store-logo { display: block; height: 34px; width: auto; max-width: 140px; object-fit: contain; margin-bottom: 0.3rem; mix-blend-mode: multiply; }
.quotes .store-logo-preview { max-width: 260px; max-height: 110px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; padding: 0.4rem; background: #fff; }

/* ===== CRM, confirmação de venda e Central de Pedidos ===== */
/* Painel lateral (detalhe) e janela ampla (conferência da venda); no celular ambos ocupam a tela toda. */
.quotes dialog[data-kind='drawer'] { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(640px, 100vw); border-radius: 22px 0 0 22px; }
.quotes dialog[data-kind='wide'] { width: min(1080px, 96vw); max-height: 94dvh; }
@media (max-width: 700px) {
  .quotes dialog[data-kind='drawer'], .quotes dialog[data-kind='wide'] { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; padding: 1rem; }
}
.quotes dialog[open] { animation: rise 0.18s ease-out; }
.quotes dialog[data-kind='drawer'][open] { animation: slide 0.2s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes slide { from { opacity: 0; transform: translateX(24px); } }

/* Kanban (CRM e logística): colunas com rolagem horizontal; no celular, uma coluna por tela com encaixe. */
/* min-width: 0 faz o quadro rolar dentro da própria caixa (sem isso ele estica a página inteira no celular). */
.quotes #results { min-width: 0; }
.quotes .kanban { min-width: 0; max-width: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 0.75rem; overflow-x: auto; padding-bottom: 0.6rem; scroll-snap-type: x proximity; }
.quotes .op-board { grid-auto-columns: minmax(235px, 1fr); }
.quotes .kanban-col { background: rgba(255, 255, 255, 0.42); border: 1px solid var(--glass-edge); border-radius: var(--radius); padding: 0.6rem; min-height: 220px; scroll-snap-align: start; transition: background-color 0.15s ease, box-shadow 0.15s ease; }
.quotes .kanban-col.over { background: rgba(59, 58, 166, 0.09); box-shadow: inset 0 0 0 2px rgba(59, 58, 166, 0.35); }
.quotes .kanban-col h3 { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.86rem; margin: 0.2rem 0.3rem 0.3rem; }
.quotes .col-total { margin: 0 0.3rem 0.5rem; font-size: 0.8rem; font-weight: 650; color: var(--brand-strong); }
.quotes .kanban-cards { display: grid; gap: 0.5rem; }
.quotes .empty-col { text-align: center; margin: 1rem 0; }
/* Encaixe suave (proximity): o "mandatory" puxava a rolagem de volta e atrapalhava o toque nas colunas seguintes. */
@media (max-width: 700px) { .quotes .kanban { grid-auto-columns: 84vw; } }

.quotes .crm-card, .quotes .op-card { background: rgba(255, 255, 255, 0.9); border: 1px solid var(--glass-edge); border-left: 4px solid var(--line); border-radius: 12px; box-shadow: 0 2px 8px rgba(30, 28, 90, 0.05); transition: transform 0.12s ease, box-shadow 0.12s ease; }
.quotes .crm-card:hover, .quotes .op-card:hover { box-shadow: 0 6px 18px rgba(30, 28, 90, 0.1); }
.quotes .crm-card[draggable='true'], .quotes .op-card[draggable='true'] { cursor: grab; }
.quotes .dragging { opacity: 0.5; transform: rotate(1deg); }
.quotes .crm-open, .quotes .op-open { display: grid; gap: 0.25rem; width: 100%; text-align: left; background: transparent; color: var(--ink); border: 0; box-shadow: none; padding: 0.65rem 0.75rem 0.4rem; font: inherit; border-radius: 12px 12px 0 0; }
.quotes .crm-open:hover:not(:disabled), .quotes .op-open:hover:not(:disabled) { background: transparent; }
.quotes .crm-value { font-weight: 700; color: var(--brand-strong); }
.quotes .crm-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.35rem 0.75rem 0.55rem; font-size: 0.8rem; }
.quotes .crm-card-foot .whatsapp { min-height: 36px; display: inline-flex; align-items: center; }
.quotes .tone-verde, .quotes .tone-ok { border-left-color: #2b8a3e; }
.quotes .tone-amarela { border-left-color: #e5a50a; }
.quotes .tone-vermelha { border-left-color: #c92a2a; }
.quotes .tone-closed { border-left-color: #adb5bd; }
.quotes .flag, .quotes .next, .quotes .mark, .quotes .tone { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.78rem; font-weight: 650; border-radius: 999px; padding: 0.1rem 0.5rem; width: fit-content; }
.quotes .flag-verde, .quotes .flag-ok { color: #1f6b30; background: #e3f6e7; }
.quotes .flag-amarela { color: #7a5600; background: #fff3bf; }
.quotes .flag-vermelha { color: #a1231a; background: #ffe3e0; }
.quotes .next-futura, .quotes .next-hoje { color: var(--brand-strong); background: var(--brand-soft); }
.quotes .next-hoje { color: #9a5b00; background: #fff3bf; }
.quotes .next-atrasada { color: #a1231a; background: #ffe3e0; }
.quotes .order-badge { background: rgba(242, 138, 30, 0.14); color: #a3510a; font-weight: 650; font-size: 0.78rem; }
.quotes .crm-detail .info, .quotes .op-detail .info { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1rem; margin: 0; }
.quotes .info dt { font-size: 0.75rem; font-weight: 650; color: var(--muted); }
.quotes .info dd { margin: 0; overflow-wrap: anywhere; }
.quotes .info .full { grid-column: 1 / -1; }
.quotes .crm-detail h3, .quotes .op-detail h3, .quotes .sale-sec h3 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 0.3rem 0; }
.quotes .crm-head, .quotes .op-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0; }
.quotes .deal-items { margin: 0.4rem 0 0; padding-left: 1.1rem; display: grid; gap: 0.3rem; }
.quotes .hist { list-style: none; padding: 0; margin: 0.4rem 0 0; display: grid; }
.quotes .hist li { display: grid; gap: 0.1rem; padding: 0.5rem 0; border-bottom: 1px dashed var(--line); font-size: 0.9rem; }
.quotes .row-form { display: flex; gap: 0.5rem; align-items: flex-start; }
.quotes .row-form > input, .quotes .row-form textarea { flex: 1; }
@media (max-width: 700px) { .quotes .info { grid-template-columns: 1fr; } }

/* Ação principal de venda: laranja da marca, grande e fácil de tocar. */
.quotes .sale-cta { min-height: 52px; font-size: 1rem; letter-spacing: 0.01em; background: linear-gradient(180deg, #f7992f, var(--accent-strong)); background: linear-gradient(180deg in oklch, oklch(0.78 0.16 62), oklch(0.66 0.17 52)); box-shadow: 0 8px 20px rgba(217, 112, 10, 0.3); }
.quotes .sale-cta:hover:not(:disabled) { background: linear-gradient(180deg, var(--accent), #c56408); }
.quotes .sale-cta:disabled { opacity: 0.55; cursor: not-allowed; }
.quotes .sale-form { gap: 1rem; }
.quotes .sale-sec { border: 1px solid var(--glass-edge); background: rgba(255, 255, 255, 0.62); border-radius: 16px; padding: 0.9rem; display: grid; gap: 0.7rem; }
.quotes .sale-sec h3 { display: flex; align-items: center; gap: 0.5rem; }
.quotes .sale-sec h3 > span:first-child { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--brand); color: #fff; font-size: 0.8rem; }
.quotes .sale-sec .inputs > span { display: contents; }
.quotes .sale-sec [hidden] { display: none !important; }
.quotes .sale-totals, .quotes .sale-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.5rem 1rem; margin: 0; }
.quotes .sale-totals dt, .quotes .sale-summary dt { font-size: 0.75rem; color: var(--muted); font-weight: 650; }
.quotes .sale-totals dd, .quotes .sale-summary dd { margin: 0; }
.quotes .sale-totals .grand { grid-column: 1 / -1; background: linear-gradient(135deg, var(--brand), var(--brand-strong)); color: #fff; border-radius: 12px; padding: 0.7rem 0.9rem; display: flex; justify-content: space-between; align-items: baseline; }
.quotes .sale-totals .grand dt { color: rgba(255, 255, 255, 0.85); }
.quotes .sale-totals .grand dd { font-size: 1.35rem; font-weight: 780; letter-spacing: -0.03em; }
.quotes .sale-summary .full { grid-column: 1 / -1; }
.quotes .sale-final { border-color: rgba(242, 138, 30, 0.45); background: rgba(255, 247, 237, 0.75); }
.quotes .confirm-check { font-weight: 650; align-self: start; }
.quotes .sale-actions { position: sticky; bottom: -1.3rem; justify-content: flex-end; padding: 0.7rem 0; background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.95) 30%); }
.quotes .field-error { color: #a1231a; font-weight: 600; font-size: 0.85rem; }
.quotes small.field-error.inline { display: block; margin-top: 0.25rem; }
.quotes [aria-invalid='true'] { border-color: #c92a2a !important; box-shadow: 0 0 0 3px rgba(201, 42, 42, 0.15) !important; }
.quotes .sale-items td, .quotes .sale-items th { font-size: 0.88rem; }

/* Central de pedidos */
.quotes .op-metrics { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.quotes .metric.on { background: #fff; box-shadow: inset 0 0 0 2px var(--brand), var(--shadow); }
.quotes .op-card.tone-green { border-left-color: #2b8a3e; }
.quotes .op-card.tone-yellow { border-left-color: #e5a50a; }
.quotes .op-card.tone-red { border-left-color: #c92a2a; }
.quotes .op-card.tone-gray { border-left-color: #adb5bd; opacity: 0.85; }
.quotes .op-top, .quotes .op-line { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.82rem; }
.quotes .op-client { font-weight: 650; }
.quotes .op-line { color: var(--muted); }
.quotes .op-marks { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.2rem; }
.quotes .store-chip { display: inline-block; font-size: 0.72rem; font-weight: 750; letter-spacing: 0.04em; padding: 0.05rem 0.45rem; border-radius: 6px; background: var(--brand-soft); color: var(--brand-strong); }
.quotes .tone-green.tone, .quotes .tone.tone-green { color: #1f6b30; background: #e3f6e7; }
.quotes .tone.tone-yellow { color: #7a5600; background: #fff3bf; }
.quotes .tone.tone-red { color: #a1231a; background: #ffe3e0; }
.quotes .tone.tone-gray { color: #495057; background: #f1f3f5; }
.quotes .mark { background: #f1f3f5; color: #343a40; }
.quotes .mark-bloqueado, .quotes .mark-atrasado { background: #ffe3e0; color: #a1231a; }
.quotes .mark-pendente { background: #fff3bf; color: #7a5600; }
.quotes .mark-posvenda { background: #ece5ff; color: #5f3dc4; }
.quotes .op-canceled { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 0.5rem; }
.quotes .op-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: end; padding: 0.7rem; border-radius: 14px; background: rgba(255, 255, 255, 0.6); border: 1px solid var(--glass-edge); }
.quotes .op-actions label { min-width: 11rem; }
.quotes .danger-text { color: #a1231a !important; }
.quotes button.danger { background: #c92a2a; }
.quotes button.danger:hover:not(:disabled) { background: #a1231a; }
.quotes .issue { border: 1px solid var(--glass-edge); border-left: 4px solid #e5a50a; border-radius: 12px; padding: 0.6rem 0.8rem; background: rgba(255, 255, 255, 0.75); margin: 0.5rem 0; }
.quotes .issue p { margin: 0.2rem 0; }
.quotes .issue-resolvida, .quotes .issue-cancelada { border-left-color: #2b8a3e; opacity: 0.85; }
.quotes .files { padding-left: 1.1rem; display: grid; gap: 0.35rem; }
.quotes button.sort { background: transparent; color: inherit; border: 0; box-shadow: none; padding: 0; font: inherit; font-weight: 650; }
.quotes .tone-row-red td:first-child { box-shadow: inset 4px 0 0 #c92a2a; }
.quotes .tone-row-yellow td:first-child { box-shadow: inset 4px 0 0 #e5a50a; }
.quotes .button-file { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1rem; border-radius: 999px; cursor: pointer; font-weight: 650; width: fit-content; }

/* Calendário */
.quotes .cal-head { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 0.5rem; text-transform: capitalize; }
.quotes .cal-legend { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; margin-bottom: 0.6rem; }
.quotes .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.quotes .cal-wd { font-size: 0.75rem; font-weight: 650; color: var(--muted); text-align: center; }
.quotes .cal-cell { min-height: 92px; background: rgba(255, 255, 255, 0.6); border: 1px solid var(--glass-edge); border-radius: 10px; padding: 0.3rem; display: grid; align-content: start; gap: 3px; }
.quotes .cal-empty { background: transparent; border: 0; }
.quotes .cal-today { box-shadow: inset 0 0 0 2px var(--brand); }
.quotes .cal-day { font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.quotes .cal-week { display: none; }
.quotes .cal-ev { display: block; width: 100%; text-align: left; font-size: 0.72rem; font-weight: 650; line-height: 1.25; padding: 0.2rem 0.35rem; border-radius: 6px; border: 0; box-shadow: none; color: var(--ink); background: var(--brand-soft); overflow: hidden; text-overflow: ellipsis; }
.quotes span.cal-ev { width: auto; display: inline-block; }
.quotes .cal-ev small { display: block; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quotes .cal-previsao { background: #e7f0ff; }
.quotes .cal-confirmado { background: #d0ebff; }
.quotes .cal-agendado { background: #fff3bf; }
.quotes .cal-entregue { background: #d3f9d8; }
.quotes .cal-late { box-shadow: inset 3px 0 0 #c92a2a; }
/* Celular: o mês vira uma lista de dias com eventos (dias vazios somem). */
@media (max-width: 700px) {
  .quotes .cal-grid { grid-template-columns: 1fr; }
  .quotes .cal-wd, .quotes .cal-empty, .quotes .cal-none { display: none; }
  .quotes .cal-cell { min-height: 0; }
  .quotes .cal-week { display: inline; font-weight: 500; }
  .quotes .cal-ev { font-size: 0.85rem; padding: 0.45rem 0.6rem; }
}

/* ===== Barra lateral recolhível ===== */
/* Computador: recolhida (só ícones) e abre por cima do conteúdo ao passar o mouse ou ao navegar pelo teclado.
   Abre quase na hora e fecha com uma pequena espera, para não "piscar" quando o mouse só cruza a lateral. */
.nav-ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail nav a { display: flex; align-items: center; gap: 0.55rem; }
.rail .brand-text { display: inline-flex; align-items: baseline; }
.rail-account .avatar, .rail-account .account-text small { display: none; }
@media (min-width: 801px) {
  .quotes { --rail-w: 72px; grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  .quotes > main { grid-column: 2; min-width: 0; }
  .quotes > .rail {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: var(--rail-w);
    height: 100dvh;
    padding: 1.1rem 0.75rem;
    gap: 1.4rem;
    overflow: hidden;
    transition: width 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) 0.18s, box-shadow 0.28s ease 0.18s;
  }
  .quotes > .rail:hover, .quotes > .rail:focus-within {
    width: 252px;
    box-shadow: 14px 0 44px rgba(30, 28, 90, 0.16);
    transition-delay: 0.06s;
  }
  .rail .brand { display: flex; align-items: center; padding: 0; font-size: 1.2rem; }
  .rail .brand img { width: 34px; height: auto; flex: none; margin: 0 0.6rem 0 7px; }
  .rail .brand-text, .rail .nav-label, .rail .account-text, .rail-logout .nav-label { opacity: 0; white-space: nowrap; transition: opacity 0.12s ease; }
  .rail:hover .brand-text, .rail:hover .nav-label, .rail:hover .account-text,
  .rail:focus-within .brand-text, .rail:focus-within .nav-label, .rail:focus-within .account-text { opacity: 1; transition-delay: 0.12s; }
  .rail nav { gap: 0.25rem; }
  .rail nav a { gap: 0.9rem; padding: 0.62rem 13px; min-height: 44px; white-space: nowrap; }
  .rail-account { display: flex; align-items: center; gap: 0.6rem; margin-top: auto; min-width: 0; }
  .rail-account .avatar { display: grid; place-items: center; flex: none; width: 36px; height: 36px; margin-left: 6px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 750; }
  .rail-account .account-text { display: grid; flex: 1; min-width: 0; }
  .rail-account .account-text small { display: block; color: var(--muted); font-size: 0.72rem; }
  .rail #account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; }
  .rail-logout { display: flex; align-items: center; gap: 0.35rem; flex: none; padding: 0.45rem 0.6rem; border-radius: 12px; }
  .rail-logout .nav-ico { width: 18px; height: 18px; }
}
/* Tablet sem mouse: barra estreita com o nome pequeno embaixo de cada ícone (sem depender de passar o mouse). */
@media (min-width: 801px) and (hover: none) {
  .quotes { --rail-w: 84px; }
  .quotes > .rail { padding-inline: 0.5rem; }
  .rail nav a { flex-direction: column; gap: 0.2rem; padding: 0.5rem 0.2rem; text-align: center; }
  .rail .nav-label { opacity: 1; white-space: normal; font-size: 0.62rem; line-height: 1.1; }
  .rail .brand img { margin-left: 0; }
  .rail-account { flex-direction: column; gap: 0.4rem; }
  .rail-account .avatar { margin-left: 0; }
  .rail-account .account-text, .rail-logout .nav-label { display: none; }
  .rail-logout { padding: 0.5rem; }
}
/* Celular: barra superior com ícone e nome. */
@media (max-width: 800px) {
  .rail nav a { gap: 0.35rem; }
  .rail .nav-ico { width: 18px; height: 18px; }
  .rail-logout .nav-ico { display: none; }
}

/* ===== Estoque ===== */
/* Cada operação com cor e ícone próprios: entrada (verde), saída (vermelho), transferência (índigo), interna (azul-acinzentado), ajuste (âmbar). */
.quotes { --op-in: #2b8a3e; --op-out: #c92a2a; --op-transfer: var(--brand); --op-internal: #3b6b8f; --op-adjust: #b4530a; }
.quotes .op-btn { color: #fff; border: 0; min-height: 44px; }
.quotes .op-btn.op-in, .quotes .seg-btn.op-in.on { background: var(--op-in); }
.quotes .op-btn.op-out, .quotes .seg-btn.op-out.on { background: var(--op-out); }
.quotes .op-btn.op-transfer, .quotes .seg-btn.op-transfer.on { background: var(--op-transfer); }
.quotes .op-btn.op-internal, .quotes .seg-btn.op-internal.on { background: var(--op-internal); }
.quotes .op-btn:hover:not(:disabled) { filter: brightness(0.92); }
.quotes .seg-btn.on.op-in, .quotes .seg-btn.on.op-out, .quotes .seg-btn.on.op-internal, .quotes .seg-btn.on.op-transfer { color: #fff; }
.quotes .launch { border-top: 6px solid var(--line); }
.quotes .launch.op-in { border-top-color: var(--op-in); }
.quotes .launch.op-out { border-top-color: var(--op-out); }
.quotes .launch.op-internal { border-top-color: var(--op-internal); }
.quotes .launch.op-transfer { border-top-color: var(--op-transfer); }
.quotes .launch-title { margin: 0; font-size: 1.15rem; }
.quotes .launch.op-in .launch-title { color: var(--op-in); }
.quotes .launch.op-out .launch-title { color: var(--op-out); }
.quotes .launch.op-internal .launch-title { color: var(--op-internal); }
.quotes .launch-actions { justify-content: flex-end; }
.quotes .launch-actions .op-btn { min-width: 14rem; font-size: 1rem; }
.quotes .launch-lines .line-input { width: 6rem; }
.quotes .launch-sum { margin: 0.3rem 0 0; color: var(--muted); }
.quotes tr.row-error td { background: #fff1ee !important; }
.quotes .op-tag { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 6px; background: #f1f3f5; color: #343a40; }
.quotes .op-tag.op-in { background: #d3f9d8; color: #1f6b30; }
.quotes .op-tag.op-out { background: #ffe3e0; color: #a1231a; }
.quotes .op-tag.op-transfer { background: var(--brand-soft); color: var(--brand-strong); }
.quotes .op-tag.op-internal { background: #e3eef7; color: #2c5470; }
.quotes .op-tag.op-adjust { background: #fff3bf; color: #7a5600; }
.quotes .qty { font-weight: 750; font-variant-numeric: tabular-nums; }
.quotes .qty-in { color: var(--op-in); }
.quotes .qty-out { color: var(--op-out); }
.quotes .store-pick { min-width: 12rem; }
.quotes label.mini { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; }
.quotes label.mini input { width: 4.5rem; min-height: 36px; }

/* Seletor de itens: busca instantânea com lista navegável pelo teclado. */
.quotes .picker { position: relative; }
.quotes .pick-input { width: 100%; min-height: 48px; font-size: 1rem; }
.quotes .pick-results { list-style: none; margin: 0.3rem 0 0; padding: 0; display: grid; gap: 4px; max-height: 18rem; overflow: auto; }
.quotes .pick-results:empty { display: none; }
.quotes .pick-results li { display: grid; gap: 0.1rem; padding: 0.55rem 0.75rem; border-radius: 10px; background: rgba(255, 255, 255, 0.9); border: 1px solid var(--glass-edge); cursor: pointer; }
.quotes .pick-results li small { color: var(--muted); }
.quotes .pick-results li[aria-selected='true'] { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.quotes .chips { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.quotes .chip { background: var(--glass-strong); color: var(--brand-strong); border: 1px solid var(--line); padding: 0.3rem 0.7rem; min-height: 36px; font-size: 0.85rem; }

.quotes .alert-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; max-height: 28rem; overflow: auto; }
.quotes .alert-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 0.6rem; align-items: center; padding: 0.5rem 0.7rem; border-radius: 10px; background: rgba(255, 255, 255, 0.75); border-left: 4px solid #e5a50a; }
.quotes .alert-list li.alert-zerado, .quotes .alert-list li.alert-falta_pedido, .quotes .alert-list li.alert-transferencia_atrasada, .quotes .alert-list li.alert-reserva_insuficiente { border-left-color: #c92a2a; }
.quotes .alert-list li.alert-parado { border-left-color: #adb5bd; }
.quotes .dup-box { border: 1px solid #f0c36d; background: #fff8e6; border-radius: 12px; padding: 0.7rem 0.9rem; }
.quotes .item-photo { max-width: 100%; max-height: 220px; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.quotes .outcomes { border: 1px solid var(--line); border-radius: 12px; padding: 0.5rem 0.8rem; display: grid; gap: 0.2rem; }
.quotes .stock-line p { margin: 0.25rem 0; }
.quotes .trf-divergencia { border-left-color: #c92a2a; }
.quotes .trf-concluida, .quotes .trf-cancelada { border-left-color: #2b8a3e; opacity: 0.85; }
.quotes table.report td, .quotes table.report th { font-size: 0.85rem; white-space: nowrap; }
@media (max-width: 700px) { .quotes .launch-actions .op-btn { width: 100%; min-width: 0; } }

/* Selo de disponibilidade no orçamento (orientativo). */
#composition .stock-hint { font-weight: 600; }
#composition .stock-hint[data-status='loja'] { color: #1f6b30; }
#composition .stock-hint[data-status='outra'] { color: #7a5600; }
#composition .stock-hint[data-status='encomenda'], #composition .stock-hint[data-status='nao_encontrado'] { color: var(--muted); }

/* Validade cabe inteira; títulos que recebem foco por programação (para leitor de tela) sem moldura visível. */
#ident select[name="validity"] { min-width: 10.5rem; }
#guide h3:focus, .picker-header h3:focus { outline: none; }

/* =====================================================================================================
   Acabamento iOS (2026-11-23) — limpo, leve e familiar. Camada final: redefine tokens e componentes.
   Base: fundo cinza do iOS (#f2f2f7), cartões brancos, separadores finos, campos preenchidos sem borda,
   controles segmentados, chaves no lugar de caixas de seleção, barra de abas embaixo no celular,
   avisos flutuantes que somem sozinhos e janelas que sobem de baixo no celular. Marca: índigo + laranja.
   ===================================================================================================== */
:root {
  --ios-bg: #f2f2f7;
  --ios-card: #ffffff;
  --ios-label: #1c1c1e;
  --ios-secondary: #6e6e73;
  --ios-tertiary: #aeaeb2;
  --ios-fill: rgba(118, 118, 128, 0.12);
  --ios-fill-soft: rgba(118, 118, 128, 0.08);
  --ios-sep: rgba(60, 60, 67, 0.13);
  --ios-green: #34c759;
  --ios-red: #ff3b30;
  --brand-tint: rgba(59, 58, 166, 0.1);
  --ink: var(--ios-label);
  --muted: var(--ios-secondary);
  --line: var(--ios-sep);
  --glass: var(--ios-card);
  --glass-strong: var(--ios-card);
  --glass-edge: rgba(60, 60, 67, 0.08);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 18px rgba(0, 0, 0, 0.04);
  --radius: 16px;
  --radius-sm: 10px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', Inter, 'Segoe UI', system-ui, sans-serif;
  letter-spacing: -0.01em;
  background: var(--ios-bg);
}
body::before { background: linear-gradient(180deg, rgba(59, 58, 166, 0.05), transparent 340px), var(--ios-bg); }
.quotes { --ink: var(--ios-label); --sage: var(--ios-fill-soft); --paper: var(--ios-card); color: var(--ios-label); }

/* Títulos grandes (Large Title) e navegação de volta discreta. */
.quotes .heading { margin: 0.6rem 0 1.2rem; }
.quotes .heading h1, #workspace h1 { font-size: clamp(1.85rem, 2.6vw, 2.35rem); font-weight: 750; letter-spacing: -0.03em; line-height: 1.1; }
.quotes .crumb { border: 0; padding: 0.15rem 0 0; font-size: 0.82rem; }
.quotes .crumb a { color: var(--brand); text-decoration: none; font-weight: 550; }
.quotes .crumb a::before { content: '‹ '; font-weight: 600; }
.box h2, .summary h2 { font-size: 1.05rem; font-weight: 650; letter-spacing: -0.015em; }
.quotes .hint, .quotes .quiet { color: var(--ios-secondary); }
.quotes .empty { color: var(--ios-secondary); text-align: center; padding: 1.6rem 0.5rem; }

/* Superfícies: cartões brancos, cantos generosos, sombra quase imperceptível. */
.box, .card, .summary, .metric, .product-section { background: var(--ios-card); border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.quotes .box { padding: clamp(0.95rem, 1.6vw, 1.35rem); }

/* Indicadores como "widgets": rótulo pequeno, número grande. */
.quotes .metrics { gap: 0.75rem; }
.quotes .metric { padding: 0.9rem 1rem; display: grid; gap: 0.15rem; align-content: start; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.quotes .metric > span:first-child { font-size: 0.8rem; font-weight: 550; color: var(--ios-secondary); }
.quotes .metric strong { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.quotes button.metric:hover, .quotes a.metric:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05), 0 10px 26px rgba(0, 0, 0, 0.07); background: var(--ios-card); outline: none; }
.quotes button.metric:focus-visible { outline: 3px solid rgba(59, 58, 166, 0.4); outline-offset: 2px; }
.quotes .metric.on { box-shadow: inset 0 0 0 2px var(--brand), var(--shadow); }
.quotes .metric-alert strong { color: #c2410c; }
.quotes .metric-danger strong { color: #d70015; }
.quotes a.metric { text-decoration: none; }

/* Campos: preenchidos, sem borda, foco com anel suave da marca. */
.quotes input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='range']),
.quotes select, .quotes textarea, input:not([type='checkbox']):not([type='radio']):not([type='file']), select, textarea {
  background: var(--ios-fill-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ios-label);
  min-height: 44px;
  font-size: 1rem;
  box-shadow: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.quotes textarea, textarea { padding: 0.65rem 0.8rem; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--ios-tertiary); }
input:not([type='checkbox']):not([type='radio']):focus, select:focus, textarea:focus {
  background: var(--ios-card); border-color: rgba(59, 58, 166, 0.45); box-shadow: 0 0 0 4px rgba(59, 58, 166, 0.12); outline: none;
}
.quotes [aria-invalid='true'] { background: #fff2f1 !important; border-color: var(--ios-red) !important; box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.12) !important; }
.quotes label { font-size: 0.8rem; font-weight: 600; color: var(--ios-secondary); }
.quotes .inputs > label:not(.check), .quotes .stack > label:not(.check), .quotes form > label:not(.check), .quotes .inputs > span > label:not(.check) { display: grid; gap: 0.35rem; }
.quotes label.check { display: flex; flex-direction: row; align-items: center; }
.quotes label > input, .quotes label > select, .quotes label > textarea { color: var(--ios-label); font-weight: 450; }

/* Chaves estilo iPhone no lugar das caixas de seleção. */
.quotes label.check { color: var(--ios-label); font-size: 0.9rem; font-weight: 500; gap: 0.65rem; cursor: pointer; }
.quotes label.check input[type='checkbox'] {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 46px; height: 28px; min-height: 0; margin: 0; padding: 0;
  border-radius: 999px; background: rgba(120, 120, 128, 0.22); border: 0; cursor: pointer; transition: background-color 0.2s ease;
}
.quotes label.check input[type='checkbox']::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18), 0 0 1px rgba(0, 0, 0, 0.12); transition: transform 0.22s cubic-bezier(0.3, 0.7, 0.4, 1.2);
}
.quotes label.check input[type='checkbox']:checked { background: var(--ios-green); }
.quotes label.check input[type='checkbox']:checked::after { transform: translateX(18px); }
.quotes label.check input[type='checkbox']:focus-visible { outline: 3px solid rgba(59, 58, 166, 0.45); outline-offset: 2px; }

/* Botões em cápsula: cheio (ação principal), tingido (secundário) e texto (terciário). */
.quotes button, .button, button {
  border-radius: 999px; font-weight: 600; letter-spacing: -0.01em; box-shadow: none; min-height: 44px;
  transition: background-color 0.15s ease, transform 0.12s ease, opacity 0.15s ease;
}
.quotes button:active:not(:disabled), .button:active { transform: scale(0.97); }
/* Botões que são cartões (indicadores, resultados do catálogo, eventos do calendário) mantêm cantos de cartão. */
.quotes button.metric { border-radius: var(--radius); }
.quotes button.result, .quotes button.model-choice, .quotes button.product-option { border-radius: 14px; }
.quotes button.cal-ev { border-radius: 6px; min-height: 0; }
.quotes button.crm-open, .quotes button.op-open, .quotes button.board-card { border-radius: 12px; }
.quotes .light, button.light, .light { background: var(--brand-tint); color: var(--brand); border: 0; box-shadow: none; }
.quotes .light:hover:not(:disabled), button.light:hover:not(:disabled) { background: rgba(59, 58, 166, 0.16); }
.quotes .subtle { background: transparent; color: var(--brand) !important; text-decoration: none; font-weight: 600; min-height: 36px; padding: 0.35rem 0.6rem; border-radius: 10px; }
.quotes .subtle:hover:not(:disabled) { background: var(--brand-tint); }
.button, #save, #access-submit, #new-lead, #new-person, #edit-goals, .quotes .sale-cta { box-shadow: 0 4px 14px rgba(217, 112, 10, 0.25); }
.quotes .whatsapp { border-radius: 999px; font-weight: 600; }
.quotes button:disabled { opacity: 0.45; }

/* Controle segmentado (iOS). */
.quotes .seg { background: var(--ios-fill); border: 0; border-radius: 10px; padding: 2px; gap: 2px; }
.quotes .seg-btn { border-radius: 8px; min-height: 34px; padding: 0.35rem 0.95rem; font-size: 0.88rem; font-weight: 550; color: var(--ios-label); }
.quotes .seg-btn.on { background: #fff; color: var(--ios-label); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.04); font-weight: 650; }
.quotes .seg-btn.on.op-in, .quotes .seg-btn.on.op-out, .quotes .seg-btn.on.op-internal, .quotes .seg-btn.on.op-transfer { color: #fff; }

/* Abas como pílulas roláveis. */
.quotes .tabs { border: 0; gap: 0.35rem; margin: 0.5rem 0 0.9rem; padding-bottom: 2px; }
.quotes .tab { border: 0; border-radius: 999px; min-height: 36px; padding: 0.4rem 0.95rem; color: var(--ios-secondary); font-weight: 600; font-size: 0.9rem; }
.quotes .tab.on { background: var(--brand); color: #fff; border: 0; }
.quotes .tab:hover:not(.on):not(:disabled) { background: var(--ios-fill-soft); color: var(--ios-label); }
.quotes .tab.on .count { background: #fff; color: var(--brand); }

/* Listas e tabelas: separadores finos, cabeçalho discreto. */
.quotes th, th { background: transparent; color: var(--ios-secondary); font-size: 0.72rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--ios-sep); }
.quotes td, td { border-color: var(--ios-sep); }
.quotes .listing tbody tr { transition: background-color 0.12s ease; }
.quotes .listing tbody tr:hover { background: rgba(118, 118, 128, 0.05); }
.quotes .listing tbody tr:last-child td { border-bottom: 0; }

/* Selos e etiquetas mais leves. */
.badge, .quotes .badge { background: var(--ios-fill); color: var(--ios-label); font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.6rem; }
.quotes .pill { font-weight: 600; }
.quotes details > summary { color: var(--brand); font-weight: 600; cursor: pointer; }

/* Barra lateral (computador): vidro claro com separador fino; item ativo preenchido como no iPadOS. */
.topbar, .rail, .price-nav { background: rgba(249, 249, 251, 0.82); border-right: 1px solid var(--ios-sep); box-shadow: none; }
.rail nav a { color: #3a3a3c; font-weight: 550; border-radius: 10px; }
.rail nav a:hover { background: var(--ios-fill-soft); }
.rail nav a[aria-current] { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(59, 58, 166, 0.25); }
@media (min-width: 801px) {
  .rail-account { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 0.55rem 0.6rem; }
  .rail-account .avatar { margin-left: 6px; }
  /* "Sair" alinhado aos itens: o ícone aparece mesmo com a barra recolhida. */
  .rail-logout { grid-column: 1 / -1; width: 100%; justify-content: flex-start; gap: 0.9rem; padding: 0.55rem 13px; min-height: 40px; background: transparent; color: var(--ios-secondary); border: 0; border-radius: 10px; overflow: hidden; white-space: nowrap; }
  .rail-logout:hover:not(:disabled) { background: rgba(255, 59, 48, 0.08); color: var(--ios-red); }
  .rail-logout .nav-ico { width: 22px; height: 22px; }
}

/* Kanban e cartões. */
.quotes .kanban-col { background: rgba(118, 118, 128, 0.07); border: 0; border-radius: 18px; }
.quotes .crm-card, .quotes .op-card { border: 0; border-left: 3px solid var(--ios-sep); border-radius: 14px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 10px rgba(0, 0, 0, 0.04); }
.quotes .crm-card:hover, .quotes .op-card:hover { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 10px 24px rgba(0, 0, 0, 0.08); transform: translateY(-1px); }
.quotes .crm-card-foot { border-top: 1px solid var(--ios-sep); margin: 0 0.75rem; padding: 0.45rem 0 0.55rem; }

/* Janelas (sheets): cantos grandes, fundo agrupado nos painéis, "Fechar" como texto da marca. */
.quotes dialog, dialog { background: var(--ios-card); border: 0; border-radius: 20px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22); -webkit-backdrop-filter: none; backdrop-filter: none; }
.quotes dialog::backdrop, dialog::backdrop { background: rgba(0, 0, 0, 0.28); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.quotes dialog[data-kind='drawer'], .quotes dialog[data-kind='wide'] { background: var(--ios-bg); }
.quotes dialog header { position: sticky; top: -1.3rem; z-index: 3; margin: -1.3rem -1.3rem 0.9rem; padding: 1rem 1.3rem 0.75rem; background: inherit; border-bottom: 1px solid var(--ios-sep); }
.quotes dialog header h2 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; }
#close-modal { background: transparent; color: var(--brand); border: 0; box-shadow: none; font-weight: 650; min-height: 36px; padding: 0.35rem 0.6rem; }
#close-modal:hover:not(:disabled) { background: var(--brand-tint); }
.quotes .crm-detail > section, .quotes .crm-detail > form, .quotes .crm-detail > details, .quotes .op-detail > section, .quotes .op-detail #tab-body, .quotes .op-detail > .issue {
  background: var(--ios-card); border-radius: 14px; padding: 0.8rem 0.95rem; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.quotes .op-detail #tab-body:empty { display: none; }
.quotes .op-actions { background: var(--ios-card); border: 0; }
.quotes .sale-sec { background: var(--ios-card); border: 0; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03); }
.quotes .issue { background: var(--ios-card); border: 0; border-left: 3px solid #ff9f0a; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03); }
.quotes .issue-resolvida, .quotes .issue-cancelada { border-left-color: var(--ios-green); }

/* Avisos flutuantes (toast): aparecem e somem sozinhos; erros ficam mais tempo. Não bloqueiam cliques. */
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px) scale(0.98); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 8px); visibility: hidden; } }
#notice:not(:empty), .quotes #notice:not(:empty) {
  position: fixed; left: 50%; bottom: calc(1.5rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70;
  width: max-content; max-width: min(92vw, 560px); margin: 0; padding: 0.75rem 1.1rem; border: 0; border-radius: 14px;
  background: rgba(28, 28, 30, 0.9); color: #fff; font-size: 0.92rem; font-weight: 550; line-height: 1.35;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
  pointer-events: none; animation: toast-in 0.25s ease, toast-out 0.35s ease 5s forwards;
}
#notice[data-error='true']:not(:empty) { background: rgba(215, 0, 21, 0.94); color: #fff; animation: toast-in 0.25s ease, toast-out 0.35s ease 9s forwards; }
.quotes #modal-error { color: var(--ios-red); font-weight: 600; }

/* Tela de entrada: cartão central com o símbolo da marca. */
.topbar { display: none; }
body:not(.quotes) > main { min-height: 100dvh; display: grid; place-items: center; margin: 0 auto; padding: 1.5rem 1rem; width: min(100%, 26rem); }
.access { display: block; margin: 0; max-width: none; width: 100%; }
.login-card { padding: 2rem 1.6rem 1.6rem !important; gap: 0.9rem; border-radius: 22px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04), 0 18px 50px rgba(30, 28, 90, 0.1); }
.login-head { display: grid; justify-items: center; text-align: center; gap: 0.25rem; margin-bottom: 0.4rem; }
.login-logo { width: 64px; height: auto; padding: 12px; box-sizing: content-box; border-radius: 22px; background: var(--ios-bg); }
.login-brand { margin: 0.3rem 0 0; font-size: 1.65rem; font-weight: 800; letter-spacing: -0.04em; }
.login-brand b { color: var(--brand); font-weight: 800; }
.login-brand i { color: var(--accent); font-style: normal; font-weight: 800; }
.login-brand span { color: var(--ios-secondary); font-weight: 500; font-size: 0.75em; }
.login-sub { color: var(--ios-secondary); font-size: 0.85rem; }
.login-card h2 { font-size: 1rem; font-weight: 650; color: var(--ios-secondary); text-align: center; }
.login-card label { color: var(--ios-secondary); font-size: 0.8rem; font-weight: 600; }
.login-card #access-submit { width: 100%; min-height: 50px; font-size: 1.02rem; margin-top: 0.3rem; }
body.signed-in > main { width: auto; max-width: 1650px; margin: 0; padding: 1.25rem clamp(0.85rem, 2.6vw, 2.75rem) 4rem; }
body.signed-in .card { box-shadow: var(--shadow); border: 0; }

/* Celular: barra de abas embaixo (como no iPhone), widgets em 2 colunas e janelas que sobem de baixo. */
@media (max-width: 800px) {
  .quotes > .rail {
    position: fixed; inset: auto 0 0 0; z-index: 45; height: auto; width: auto;
    display: flex; flex-direction: row; align-items: stretch; gap: 0;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    background: rgba(249, 249, 251, 0.88); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
    border: 0; border-top: 1px solid var(--ios-sep); box-shadow: none;
  }
  .rail .brand { display: none; }
  .rail nav { display: flex; flex: 1; gap: 0; overflow-x: auto; -webkit-mask-image: none; mask-image: none; padding: 0; scrollbar-width: none; }
  .rail nav a { flex: 1 0 66px; flex-direction: column; justify-content: center; gap: 3px; padding: 6px 2px; min-height: 52px; font-size: 0.64rem; font-weight: 550; color: #8e8e93; background: transparent !important; box-shadow: none !important; border-radius: 12px; text-align: center; white-space: nowrap; }
  .rail nav a[aria-current] { color: var(--brand); }
  .rail nav a[aria-current] .nav-ico { stroke-width: 2.2; }
  .rail .nav-ico { width: 24px; height: 24px; }
  .rail .nav-label { opacity: 1; }
  .rail-account { display: flex !important; align-items: center; flex: none; padding-left: 4px; border-left: 1px solid var(--ios-sep); }
  .rail-account .avatar, .rail-account .account-text { display: none !important; }
  .quotes .rail-logout { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; width: 56px; padding: 6px 2px; background: transparent; color: #8e8e93; border: 0; font-size: 0.64rem; font-weight: 550; }
  body.signed-in > main { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
  .rail-logout .nav-ico { display: block; width: 24px; height: 24px; }
  .rail-logout .nav-label { opacity: 1; display: block; }
  .quotes main, .quotes > main { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
  #notice:not(:empty), .quotes #notice:not(:empty) { bottom: calc(5.4rem + env(safe-area-inset-bottom)); }
  .quotes .metrics, .quotes .op-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quotes .heading { margin-top: 0.4rem; }
  .quotes .listing.cards tr { background: var(--ios-card); border: 0; border-radius: 14px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
  .quotes .listing.cards td:first-child { background: transparent; font-size: 1rem; }
}
@media (max-width: 600px) {
  .quotes:has(.editor) main { padding-bottom: calc(14rem + env(safe-area-inset-bottom)); }
  .editor > .summary { bottom: calc(60px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; }
}
@media (max-width: 700px) {
  @keyframes sheet-up { from { transform: translateY(40px); opacity: 0.4; } }
  .quotes dialog:not([data-kind='drawer']):not([data-kind='wide']) {
    margin: auto 0 0; width: 100vw; max-width: 100vw; max-height: 92dvh; border-radius: 22px 22px 0 0;
    padding-bottom: calc(1.3rem + env(safe-area-inset-bottom)); animation: sheet-up 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .quotes dialog:not([data-kind='drawer']):not([data-kind='wide'])::before {
    content: ''; display: block; width: 38px; height: 5px; margin: -0.6rem auto 0.6rem; border-radius: 3px; background: rgba(60, 60, 67, 0.25);
  }
}
@media (prefers-reduced-motion: reduce) {
  #notice:not(:empty) { animation: none; }
}

/* Segurança (Equipe) */
.quotes .security-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.75rem; }
.quotes .sec-card { background: var(--ios-bg); border-radius: 14px; padding: 0.9rem 1rem; display: grid; gap: 0.45rem; align-content: start; }
.quotes .sec-card h3 { margin: 0; font-size: 0.95rem; }
.quotes .sec-card p { margin: 0; }
.quotes .sec-card button { justify-self: start; }
.quotes .badge.badge-ok { background: rgba(52, 199, 89, 0.15); color: #1f7a35; }
.quotes code, .quotes .secret { font-family: ui-monospace, 'SF Mono', Consolas, monospace; background: var(--ios-fill-soft); padding: 0.1rem 0.4rem; border-radius: 6px; }
.quotes .secret { display: inline-block; font-size: 1.05rem; letter-spacing: 0.08em; padding: 0.4rem 0.6rem; margin-top: 0.3rem; user-select: all; }
.quotes ol.steps { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.5rem; }
#code-field input { letter-spacing: 0.3em; font-size: 1.3rem; text-align: center; }

/* Catálogo pela medida do vão (2026-11-24): tipo com foto → medida → cartões de família com foto e preço por cor.
   Tudo em alvos de toque de 44px ou mais; um toque no preço adiciona ao orçamento. */
#guide { display: grid; gap: 0.9rem; }
#guide .m-step { margin: 0.2rem 0 0; font-size: 1rem; font-weight: 700; }
#guide .m-step small { font-weight: 500; color: var(--ios-secondary); font-size: 0.82rem; margin-left: 0.3rem; }
#guide .m-materials { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border-radius: 12px; background: var(--ios-fill-soft); justify-self: start; max-width: 100%; }
#guide .m-materials button { min-height: 40px; padding: 0.3rem 0.9rem; border: 0; border-radius: 9px; background: transparent; color: var(--ios-label); font: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer; }
#guide .m-materials button[aria-pressed="true"] { background: var(--ios-card); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); color: var(--brand); }
#guide .m-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; }
#guide .m-kind {
  display: grid; grid-template-rows: 96px auto; gap: 0.45rem; align-items: center; justify-items: center; padding: 0.6rem 0.5rem 0.7rem;
  border: 0; border-radius: 14px; background: var(--ios-card); box-shadow: 0 0 0 1px var(--ios-sep); color: var(--ios-label);
  font: inherit; font-weight: 650; font-size: 0.92rem; line-height: 1.2; text-align: center; cursor: pointer; width: 100%; min-width: 0;
}
#guide .m-kind img, #guide .m-kind .m-noimg { width: 100%; height: 96px; object-fit: contain; }
#guide .m-noimg { display: block; background: var(--ios-fill-soft); border-radius: 10px; }
#guide .m-chosen { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.6rem; border-radius: 14px; background: var(--brand-tint); }
#guide .m-chosen img { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: #fff; }
#guide .m-chosen strong { flex: 1; font-size: 1.02rem; }
#guide .m-chosen button { min-height: 44px; }
#guide .m-typed { display: flex; align-items: flex-end; gap: 0.5rem; flex-wrap: wrap; }
#guide .m-typed label { display: grid; gap: 0.2rem; font-size: 0.78rem; color: var(--ios-secondary); font-weight: 600; }
#guide .m-typed input { width: 6.5rem; min-height: 48px; font-size: 1.15rem; font-weight: 650; text-align: center; font-variant-numeric: tabular-nums; }
#guide .m-typed > span { padding-bottom: 0.75rem; font-size: 1.2rem; color: var(--ios-secondary); }
#guide .m-typed button { min-height: 48px; padding: 0 1.2rem; background: var(--accent-strong); color: #fff; border: 0; }
#guide .m-sizes { display: grid; gap: 0.45rem; }
#guide .m-size-row { display: grid; grid-template-columns: 3.6rem 1fr; align-items: center; gap: 0.4rem; }
#guide .m-size-row > span { color: var(--ios-secondary); font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
#guide .m-size-row > div, #guide .m-near { display: flex; flex-wrap: wrap; gap: 0.4rem; }
#guide .m-size {
  min-width: 56px; min-height: 44px; padding: 0.3rem 0.8rem; border: 0; border-radius: 12px; background: var(--ios-fill-soft);
  color: var(--ios-label); font: inherit; font-weight: 650; font-variant-numeric: tabular-nums; cursor: pointer;
}
#guide .m-size[aria-pressed="true"] { background: var(--brand); color: #fff; }
#guide .m-hint { margin: 0.3rem 0 0; color: var(--ios-secondary); }
#guide .m-hint strong { color: var(--ios-label); }
#guide .m-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 0.75rem; align-items: start; margin-top: 0.6rem; }
#guide .m-card { display: grid; grid-template-columns: 112px 1fr; gap: 0.8rem; padding: 0.8rem; border-radius: 16px; background: var(--ios-card); box-shadow: 0 0 0 1px var(--ios-sep); }
#guide .m-card > img, #guide .m-card > .m-noimg { width: 112px; height: 140px; object-fit: contain; border-radius: 10px; background: #fafafa; }
#guide .m-card-body { display: grid; gap: 0.45rem; align-content: start; min-width: 0; }
#guide .m-card h4 { margin: 0; font-size: 1rem; line-height: 1.25; }
#guide .m-card-body > small { color: var(--ios-secondary); margin-top: -0.35rem; }
#guide .m-variant { display: grid; gap: 0.3rem; }
#guide .m-vname { font-size: 0.85rem; font-weight: 600; color: var(--ios-secondary); }
#guide .m-variant .option-note { color: #8a5a00; font-weight: 600; font-size: 0.78rem; }
#guide .m-buys { display: flex; flex-wrap: wrap; gap: 0.4rem; }
#guide .m-buy { display: inline-flex; align-items: stretch; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--ios-sep); }
#guide .m-buy.on { box-shadow: 0 0 0 2px var(--accent-strong); }
#guide .m-add {
  display: inline-flex; align-items: center; gap: 0.4rem; min-height: 46px; padding: 0.35rem 0.75rem; border: 0; border-radius: 0;
  background: var(--ios-card); color: var(--ios-label); font: inherit; font-size: 0.9rem; cursor: pointer;
}
#guide .m-add b { font-variant-numeric: tabular-nums; }
#guide .m-add em { font-style: normal; min-width: 1.5rem; height: 1.5rem; padding: 0 0.35rem; border-radius: 999px; background: var(--accent-strong); color: #fff; font-weight: 700; font-size: 0.8rem; display: inline-grid; place-items: center; }
#guide .m-dec { min-width: 46px; min-height: 46px; padding: 0; border: 0; border-left: 1px solid var(--ios-sep); border-radius: 0; background: var(--ios-fill-soft); color: var(--ios-label); font-size: 1.3rem; cursor: pointer; }
#guide .m-add:disabled, #guide .m-dec:disabled { opacity: 0.55; }
#guide .m-add i { width: 1.05rem; height: 1.05rem; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.2); flex: none; }
#guide [data-color] { background: #c9c9cf; }
#guide [data-color="Branco"] { background: #fff; }
#guide [data-color="Preto"] { background: #222; }
#guide [data-color="Brilhante"] { background: linear-gradient(130deg, #84928d, #f8faf9 50%, #8b9893); }
#guide [data-color="Cinza"] { background: #8e8e93; }
#guide [data-color="Azul"] { background: #2f5fa8; }
#guide [data-color="Amarelo"] { background: #f2c230; }
#guide :is([data-color="Madeiro"], [data-color="Amadeirado"]) { background: #9a6a3f; }
#guide [data-color="Cerejeira"] { background: #8b3e2a; }
#guide [data-color="Mogno"] { background: #5b2a1c; }
@media (hover: hover) {
  #guide .m-kind:hover, #guide .m-add:hover { background: var(--brand-tint); }
  #guide .m-size:not([aria-pressed="true"]):hover { background: var(--ios-fill); }
}
@media (max-width: 600px) {
  #guide .m-kinds { grid-template-columns: repeat(2, 1fr); }
  /* Celular: foto pequena ao lado do nome e os preços na largura toda do cartão. */
  #guide .m-card { grid-template-columns: 72px 1fr; column-gap: 0.75rem; row-gap: 0.5rem; padding: 0.7rem; }
  #guide .m-card > img, #guide .m-card > .m-noimg { width: 72px; height: 88px; grid-row: span 2; }
  #guide .m-card-body { display: contents; }
  #guide .m-card h4 { grid-column: 2; align-self: end; }
  #guide .m-card-body > small { grid-column: 2; align-self: start; margin-top: 0; }
  #guide .m-variant { grid-column: 1 / -1; }
  #guide .m-buys { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
  #guide .m-add b { margin-left: auto; white-space: nowrap; }
  #guide .m-buy { display: flex; }
  #guide .m-add { flex: 1; justify-content: flex-start; }
  #guide .m-typed input { width: 5.5rem; }
  #guide .m-typed button { flex: 1 0 100%; }
}
/* Aviso da busca de endereço pelo CEP (confirmação de venda). */
.cep-note { display: block; min-height: 1.1em; margin-top: 0.25rem; font-size: 0.78rem; color: var(--ios-secondary); font-weight: 500; }

/* Desconto e frete no painel Resumo financeiro (decididos pelo vendedor, 2026-11-24). */
.summary .summary-terms { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 0.2rem 0 0.8rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--ios-sep); }
.summary .summary-terms label { min-width: 0; }
.summary .summary-terms input, .summary .summary-terms select { width: 100%; min-height: 44px; }
.summary .summary-terms .hint { grid-column: 1 / -1; margin: 0; font-size: 0.76rem; }
@media (max-width: 600px) {
  .summary .summary-terms { gap: 0.4rem; margin: 0 0 0.5rem; padding-bottom: 0.5rem; }
  .summary .summary-terms .hint { display: none; }
  .summary .summary-terms label { font-size: 0.72rem; }
  .summary .summary-terms input, .summary .summary-terms select { min-height: 40px; padding-top: 0.3rem; padding-bottom: 0.3rem; }
  .quotes:has(.editor) main { padding-bottom: calc(19rem + env(safe-area-inset-bottom)); }
}
