/* ============================================================
   VIBRA — base + componentes (botão, card, input, stepper, selo, tabela, modal, abas, dica, toast)
   Tudo lê os tokens semânticos definidos por superfície em tokens.css.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--banner-h) + 76px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-text); font-size: var(--fs-base); line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  padding-bottom: var(--sticky-bottom, 0px);
}
body.has-modal { overflow: hidden; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: var(--lh-snug); letter-spacing: -.015em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-spacing: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.mono { font-family: var(--font-mono); }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding-left: var(--gutter, 16px); padding-right: var(--gutter, 16px); }
:root { --gutter: 16px; }
@media (min-width: 768px) { :root { --gutter: 24px; } }
@media (min-width: 1200px) { :root { --gutter: 32px; } }

/* foco visível: anel Electric Violet (versão clara sobre fundos escuros, para manter contraste) */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
:where(input, select, textarea):focus-visible { outline-offset: 0; border-color: var(--focus); }
#main:focus { outline: none; }
.skip-link {
  position: absolute; left: 8px; top: -80px; z-index: 3000; background: var(--primary-bg); color: var(--primary-fg);
  padding: 12px 16px; border-radius: var(--r-md); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: calc(var(--banner-h) + 8px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ============================================================
   FAIXA DO PROTÓTIPO + MENU DE DEMO (sempre visíveis)
   ============================================================ */
.proto-banner {
  position: sticky; top: 0; z-index: 4000; background: #231036; color: #EBD9FF;
  font-size: 12px; font-weight: 600; letter-spacing: .01em; line-height: 1.3; text-align: center;
  padding: 7px 12px; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 32px; box-sizing: border-box;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
html.sem-faixa { --banner-h: 0px; }
.sem-faixa .proto-banner { display: none; }
.proto-banner__dot { width: 8px; height: 8px; border-radius: 50%; background: #FFC400; flex: none; }
.demo-fab {
  position: fixed; right: 12px; bottom: calc(var(--sticky-bottom, 0px) + 12px); z-index: 1900;
  min-height: 48px; padding: 0 16px 0 14px; border-radius: var(--r-pill); border: 1.5px solid rgba(255, 255, 255, .28);
  background: #231036; color: #fff; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  box-shadow: var(--shadow-md);
}
.demo-fab:hover { background: #33174F; }
@media (max-width: 480px) { .demo-fab { width: 48px; padding: 0; justify-content: center; right: 10px; } .demo-fab__t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
.demo-fab:focus-visible { outline-color: #A964FF; }
.demo-panel {
  position: fixed; right: 12px; bottom: calc(var(--sticky-bottom, 0px) + 68px); z-index: 1950; width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - var(--banner-h) - var(--sticky-bottom, 0px) - 88px); overflow: auto;
  background: #16091F; color: #F3EAFB; border: 1px solid rgba(255, 255, 255, .18); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 16px;
  color-scheme: dark; --focus: #A964FF; --text: #F3EAFB; --text-muted: #C9B8DE; --line: rgba(255, 255, 255, .16); --line-strong: #8D7AA6; --field-line: #9B88B5;
  --surface: #221232; --surface-2: #1B0E29; --primary-bg: #fff; --primary-fg: #000;
}
.demo-panel h2 { font-size: 15px; letter-spacing: 0; margin-bottom: 4px; }
.demo-panel .demo-sec { padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, .12); display: grid; gap: 10px; }
.demo-panel .demo-sec:first-of-type { border-top: 0; padding-top: 4px; }
.demo-panel .demo-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #C9B8DE; }
.demo-personas { display: grid; gap: 6px; }
.demo-persona {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; border-radius: var(--r-md); border: 1.5px solid rgba(255, 255, 255, .16);
  background: transparent; color: inherit; cursor: pointer; text-align: left; font-weight: 600;
}
.demo-persona small { display: block; font-weight: 400; font-size: 12px; color: #C9B8DE; }
.demo-persona.is-active { background: var(--violet); border-color: var(--violet); color: #fff; }
.demo-persona.is-active small { color: #EBD9FF; }
.demo-legend { display: flex; flex-wrap: wrap; gap: 6px; }

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--hit); padding: 0 20px;
  border-radius: var(--r-md); border: 1.5px solid transparent; font-family: var(--font-text); font-weight: 700; font-size: 14px; line-height: 1.1; letter-spacing: .02em;
  cursor: pointer; text-decoration: none; text-align: center; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:active:not([disabled]) { transform: translateY(1px); }
.btn--primary, .btn--accent, .btn--danger { text-transform: uppercase; letter-spacing: .05em; }
.btn--primary { background: var(--primary-bg); color: var(--primary-fg); }
.btn--primary:hover:not([disabled]) { background: var(--primary-hover); }
.btn--accent { background: var(--accent); color: var(--accent-fg); }
.btn--accent:hover:not([disabled]) { background: var(--accent-hover); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--field-line, var(--line-strong)); }
.btn--ghost:hover:not([disabled]) { background: var(--surface-3); }
.btn--danger { background: #C4161C; color: #fff; }
.btn--danger:hover:not([disabled]) { background: #A81016; }
.btn--text { background: transparent; color: var(--accent-text); padding: 0 8px; min-height: var(--hit); text-decoration: underline; text-underline-offset: 3px; }
.btn--sm { min-height: 40px; padding: 0 14px; font-size: 13px; border-radius: var(--r-sm); }
.btn--lg { min-height: var(--hit-ops); padding: 0 24px; font-size: 15px; }
.btn--xl { min-height: 72px; padding: 0 28px; font-size: 18px; border-radius: var(--r-lg); }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn--planejado { border-style: dashed; gap: 10px; }
.btn--planejado .badge { margin-left: 2px; }
.icon-btn {
  display: inline-grid; place-items: center; width: var(--hit); height: var(--hit); border-radius: var(--r-md); border: 0; background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); }
.icon { flex: none; }

/* ============================================================
   SELOS
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 2px 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; line-height: 1.2; letter-spacing: .01em;
  border: 1px solid var(--line-strong); color: var(--text); background: transparent; white-space: nowrap;
}
.badge--neutro { background: var(--surface-3); border-color: var(--line); color: var(--text-muted); }
.badge--ok { background: var(--ok-soft); border-color: var(--ok-edge); color: var(--ok-fg); }
.badge--erro { background: var(--erro-soft); border-color: var(--erro-edge); color: var(--erro-fg); }
.badge--alerta { background: var(--alerta-soft); border-color: var(--alerta-edge); color: var(--alerta-fg); }
.badge--destaque { background: var(--accent-tint); border-color: transparent; color: var(--accent-text); }
.badge--solid { background: var(--primary-bg); color: var(--primary-fg); border-color: transparent; }
.badge--planejado { border-style: dashed; color: var(--text-muted); background: transparent; font-weight: 600; }
.badge--simulado { background: var(--alerta-soft); border-color: var(--alerta-edge); color: var(--alerta-fg); }
.badge--exemplo { background: var(--accent-tint); border-color: transparent; color: var(--accent-text); }
.badge--pendente { background: var(--alerta-soft); border-color: var(--alerta-edge); color: var(--alerta-fg); }

/* ============================================================
   CARDS, CAIXAS, AVISOS
   ============================================================ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card--pad { padding: var(--sp-5); }
.card__title { font-size: var(--fs-md); margin-bottom: var(--sp-3); }
.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); font-size: 14px; line-height: 1.45;
  background: var(--surface-3); border: 1px solid var(--line); color: var(--text);
}
.notice .icon { margin-top: 2px; }
.notice--ok { background: var(--ok-soft); border-color: var(--ok-edge); }
.notice--ok .icon { color: var(--ok-fg); }
.notice--erro { background: var(--erro-soft); border-color: var(--erro-edge); }
.notice--erro .icon { color: var(--erro-fg); }
.notice--alerta { background: var(--alerta-soft); border-color: var(--alerta-edge); }
.notice--alerta .icon { color: var(--alerta-fg); }
.notice--info .icon { color: var(--accent-text); }
.notice strong { font-weight: 700; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: var(--sp-4) 0; }

/* ============================================================
   FORMULÁRIOS
   ============================================================ */
.field { display: grid; gap: 6px; }
.field > label, .field > .label { font-weight: 600; font-size: 14px; }
.field .opt { font-weight: 400; color: var(--text-muted); }
.input, .select, .textarea {
  width: 100%; min-height: var(--hit); padding: 0 14px; background: var(--surface-2); color: var(--text);
  border: 1.5px solid var(--field-line, var(--line-strong)); border-radius: var(--r-md); font-size: 16px;
}
.textarea { padding: 12px 14px; min-height: 110px; resize: vertical; line-height: 1.45; }
.select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.input::placeholder, .textarea::placeholder { color: var(--text-muted); opacity: .75; }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--erro-fg); }
.hint { font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.field-error { font-size: 13px; color: var(--erro-fg); font-weight: 600; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; min-width: 0; }
.check { display: flex; gap: 12px; align-items: flex-start; min-height: var(--hit); padding: 10px 0; cursor: pointer; font-size: 14px; line-height: 1.4; }
.check input { width: 24px; height: 24px; flex: none; margin: 0; accent-color: var(--violet); cursor: pointer; }
.radio-card {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--field-line, var(--line-strong)); border-radius: var(--r-md); cursor: pointer; background: var(--surface);
}
.radio-card input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--violet); }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.radio-card:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.radio-card__t { font-weight: 700; display: block; }
.radio-card__d { font-size: 13px; color: var(--text-muted); display: block; margin-top: 2px; }
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: var(--hit); cursor: pointer; font-weight: 600; background: none; border: 0; padding: 0; }
.switch__track { width: 48px; height: 28px; border-radius: var(--r-pill); background: var(--surface-3); border: 1.5px solid var(--field-line, var(--line-strong)); position: relative; transition: background var(--dur); flex: none; }
.switch__track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: var(--text); transition: transform var(--dur) var(--ease); }
.switch[aria-checked="true"] .switch__track { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"] .switch__track::after { transform: translateX(20px); background: #fff; }

/* ============================================================
   STEPPER DE QUANTIDADE
   ============================================================ */
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--field-line, var(--line-strong)); border-radius: var(--r-md); background: var(--surface-2); }
.stepper button {
  width: var(--hit); height: var(--hit); display: grid; place-items: center; border: 0; background: transparent; color: var(--text); cursor: pointer; border-radius: var(--r-md);
}
.stepper button:hover:not([disabled]) { background: var(--surface-3); }
.stepper button[disabled] { opacity: .35; cursor: not-allowed; }
.stepper output { min-width: 36px; text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.stepper--lg button { width: var(--hit-ops); height: var(--hit-ops); }
.stepper--lg output { min-width: 48px; font-size: 24px; }

/* ============================================================
   ABAS E CHIPS
   ============================================================ */
.tabs { display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; --scroll-size: 8px; scrollbar-width: thin; border-bottom: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--hit); padding: 0 16px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--text-muted);
  font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--accent); }
.tab__n { font-size: 12px; background: var(--surface-3); padding: 1px 7px; border-radius: var(--r-pill); color: var(--text-muted); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--hit); padding: 0 18px; border-radius: var(--r-pill); border: 1.5px solid var(--field-line, var(--line-strong));
  background: transparent; color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.chip:hover { background: var(--surface-3); }
.chip[aria-pressed="true"] { background: var(--primary-bg); color: var(--primary-fg); border-color: var(--primary-bg); }

/* ============================================================
   TABELAS
   ============================================================ */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted);
  padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:hover { background: var(--surface-2); }
.table .t-strong { font-weight: 700; }
.table .t-sub { display: block; font-size: 12px; color: var(--text-muted); }
.table tfoot td { font-weight: 700; background: var(--surface-2); }

/* ============================================================
   MODAL, TOAST, DICA
   ============================================================ */
.modal-root { position: fixed; inset: var(--banner-h) 0 0 0; z-index: 2500; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .66); }
.modal {
  position: relative; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
}
.modal--sm { max-width: 440px; } .modal--lg { max-width: 720px; } .modal--full { max-width: 560px; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 12px 8px 20px; }
.modal__title { font-size: var(--fs-lg); }
.modal__body { padding: 4px 20px 16px; overflow: auto; display: grid; gap: 14px; }
.modal__foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 20px 20px; flex-wrap: wrap; }
.modal__foot .btn { flex: 1 1 140px; }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--sticky-bottom, 0px) + 76px); z-index: 3000; display: grid; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
.toast {
  display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: var(--r-md); background: #F7F7F4; color: #111; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-md);
  animation: toast-in 220ms var(--ease); border-left: 5px solid #6B6B65;
}
.toast--ok { border-left-color: #0A7A3F; } .toast--erro { border-left-color: #B3141B; }
.toast.is-out { opacity: 0; transform: translateY(8px); transition: opacity 240ms, transform 240ms; }
@keyframes toast-in { from { transform: translateY(10px); } to { transform: none; } }

.tip { position: relative; display: inline-flex; vertical-align: middle; }
.tip__btn { display: inline-grid; place-items: center; width: 28px; height: 28px; margin: -4px 0; border-radius: 50%; border: 0; background: transparent; color: var(--text-muted); cursor: help; padding: 0; }
.tip__btn:hover, .tip__btn[aria-expanded="true"] { color: var(--text); }
.tip__bubble {
  position: absolute; z-index: 60; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); width: max-content; max-width: min(260px, 70vw);
  padding: 10px 12px; border-radius: var(--r-md); background: #111; color: #fff; font-size: 13px; font-weight: 500; line-height: 1.4; text-align: left; letter-spacing: 0; text-transform: none;
  box-shadow: var(--shadow-md); border: 1px solid rgba(255, 255, 255, .2); visibility: hidden; opacity: 0; transition: opacity var(--dur);
}
.tip__btn:hover + .tip__bubble, .tip__btn:focus-visible + .tip__bubble, .tip__btn[aria-expanded="true"] + .tip__bubble { visibility: visible; opacity: 1; }

/* ============================================================
   CAPAS ABSTRATAS E QR
   ============================================================ */
.cover { position: relative; overflow: hidden; background: #111; isolation: isolate; }
.cover__svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.qr { width: 100%; height: auto; aspect-ratio: 1; border-radius: 8px; background: #fff; }

/* ============================================================
   CASCA — PÚBLICO (escuro)
   ============================================================ */
.pub-header { position: sticky; top: var(--banner-h); z-index: 100; background: var(--header-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.pub-header__in { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.pub-brand { display: inline-flex; align-items: center; padding: 9px 4px; color: #fff; text-decoration: none; margin-left: -4px; }
.pub-brand__full { display: none; } .pub-brand__sym { display: block; }
.pub-city { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-left: auto; white-space: nowrap; }
.pub-search { display: none; position: relative; align-items: center; flex: 1 1 280px; min-width: 160px; max-width: 440px; margin-left: 12px; }
.pub-search__ico { position: absolute; left: 14px; color: var(--text-muted); pointer-events: none; }
.pub-search__in { width: 100%; min-height: var(--hit); padding: 0 16px 0 42px; border-radius: var(--r-pill); border: 1.5px solid var(--field-line, var(--line-strong)); background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; }
.pub-search__in::placeholder { color: var(--text-muted); opacity: 1; }
.pub-search__in:hover { background: var(--surface-3); }
.pub-search__in:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.pub-nav { display: none; gap: 4px; }
.pub-nav a { display: inline-flex; align-items: center; gap: 8px; min-height: var(--hit); padding: 0 14px; border-radius: var(--r-pill); text-decoration: none; font-weight: 600; font-size: 14px; color: var(--text-muted); }
.pub-nav a:hover { color: var(--text); background: var(--surface-2); }
.pub-nav a.is-active { color: var(--text); background: var(--surface-3); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--violet); color: #fff; font-size: 12px; font-weight: 700; }
.pub-main { min-height: 60vh; padding-bottom: 96px; }
.pub-footer { border-top: 1px solid var(--line); padding: 32px 0 120px; color: var(--text-muted); font-size: 14px; }
.pub-footer__lead { color: var(--text); font-weight: 600; margin-bottom: 8px; max-width: 60ch; }
.pub-footer__small { max-width: 70ch; }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: grid; grid-template-columns: 1fr 1fr; background: rgba(0, 0, 0, .94); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a { display: grid; justify-items: center; gap: 2px; padding: 8px 0 6px; min-height: 56px; text-decoration: none; color: var(--text-muted); font-size: 12px; font-weight: 600; position: relative; }
.bottom-nav a.is-active { color: var(--text); }
.bottom-nav a.is-active::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; background: var(--violet); border-radius: 0 0 3px 3px; }
.bottom-nav .count { position: absolute; top: 4px; left: calc(50% + 8px); }
@media (min-width: 768px) {
  .pub-brand__sym { display: none; } .pub-brand__full { display: block; }
  .pub-nav { display: flex; } .pub-search { display: flex; }
  .pub-nav { margin-left: 8px; }
  .bottom-nav { display: none; }
  .pub-main { padding-bottom: 64px; } .pub-footer { padding-bottom: 64px; }
}

/* ============================================================
   CASCA — PAINEL DO ORGANIZADOR (claro)
   ============================================================ */
.panel { display: block; min-height: calc(100vh - var(--banner-h)); }
.panel-side { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: var(--banner-h); z-index: 80; }
.panel-side__in { display: flex; align-items: center; gap: 8px; padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: none; }
.panel-side__in::-webkit-scrollbar { display: none; }
.panel-brand { display: inline-flex; align-items: center; gap: 8px; padding: 16px 8px 16px 0; color: #000; text-decoration: none; flex: none; }
.panel-brand__tag { font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; border: 1.5px solid #000; border-radius: 6px; padding: 1px 6px; }
.side-nav { display: flex; gap: 2px; margin-left: 8px; }
.side-link { display: inline-flex; align-items: center; gap: 8px; min-height: var(--hit); padding: 0 14px; border-radius: var(--r-md); text-decoration: none; font-weight: 600; font-size: 14px; color: var(--text-muted); white-space: nowrap; }
.side-link:hover { background: var(--surface-3); color: var(--text); }
.side-link.is-active { background: #000; color: #fff; }
.side-link .badge { font-size: 11px; min-height: 20px; padding: 0 7px; }
.side-org { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; padding-left: 12px; }
.side-org__label { font-size: 12px; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.side-org .select { min-width: 180px; }
.side-cta { width: auto; flex: none; margin-left: 8px; }
.panel-main { min-width: 0; }
.panel-content { padding: 24px var(--gutter) 96px; max-width: 1280px; margin: 0 auto; }
@media (min-width: 1024px) {
  .panel { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
  .panel-side { position: sticky; top: var(--banner-h); height: calc(100vh - var(--banner-h)); border-bottom: 0; border-right: 1px solid var(--line); align-self: start; }
  .panel-side__in { flex-direction: column; align-items: stretch; gap: 4px; padding: 16px 16px 20px; height: 100%; overflow: auto; }
  .panel-brand { padding: 6px 8px 20px; }
  .side-nav { flex-direction: column; margin: 0; }
  .side-org { margin: auto 0 0; flex-direction: column; align-items: stretch; padding: 16px 0 8px; gap: 6px; border-top: 1px solid var(--line); }
  .side-org .select { min-width: 0; }
  .side-cta { width: 100%; margin: 0; }
  .panel-content { padding: 32px 40px 96px; }
}
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head__crumb { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.page-head__crumb a { color: inherit; }
.page-head__title { font-size: clamp(24px, 3vw, 34px); line-height: 1.1; }
.page-head__sub { color: var(--text-muted); margin-top: 6px; max-width: 70ch; }
.page-head__acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   CASCAS — SCAN e POS
   ============================================================ */
.scan-app { min-height: calc(100vh - var(--banner-h)); background: var(--bg); }
.scan-main { max-width: 560px; margin: 0 auto; min-height: calc(100vh - var(--banner-h)); display: flex; flex-direction: column; }
.pos-app { min-height: calc(100vh - var(--banner-h)); background: var(--bg); }
.pos-main { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter) 96px; }

/* ---------- barra de progresso / estoque ---------- */
.bar { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 8px; background: var(--accent); transition: width .4s var(--ease); }
.bar--ok > span { background: var(--ok-fg); } .bar--alerta > span { background: var(--alerta-fg); } .bar--erro > span { background: var(--erro-fg); }
.bar--lg { height: 12px; }


/* ============================================================
   BARRAS DE ROLAGEM
   · Chrome, Edge, Safari: ::-webkit-scrollbar (largura, polegar arredondado, hover violeta).
   · Firefox: scrollbar-width/scrollbar-color. Não se declara scrollbar-color nos navegadores WebKit/Blink porque,
     no Chrome 121+, ele desativa o ::-webkit-scrollbar.
   · As áreas que escondem a barra de propósito (chips, carrosséis, navegação) continuam sem barra.
   ============================================================ */
@supports selector(::-webkit-scrollbar) {
  *::-webkit-scrollbar { width: var(--scroll-size, 12px); height: var(--scroll-size, 12px); }
  *::-webkit-scrollbar-track { background: var(--scroll-track, transparent); }
  *::-webkit-scrollbar-thumb {
    background-color: var(--scroll-thumb, #777); border: 3px solid transparent; background-clip: padding-box; border-radius: 999px;
    min-height: 48px; min-width: 48px;
  }
  *::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-thumb-hover, var(--violet)); }
  *::-webkit-scrollbar-thumb:active { background-color: var(--violet-600); }
  *::-webkit-scrollbar-button { display: none; width: 0; height: 0; } /* sem setas nas pontas */
  *::-webkit-scrollbar-corner { background: var(--scroll-track, transparent); }
}
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb, #777) var(--scroll-track, transparent); }
}
/* contêineres com tema próprio */
.demo-panel { --scroll-track: transparent; --scroll-thumb: #8D7AA6; --scroll-thumb-hover: #C79BFF; --scroll-size: 10px; }
.modal { --scroll-size: 10px; }
.modal--qr { --scroll-track: #F1F1ED; --scroll-thumb: #82827C; --scroll-thumb-hover: var(--violet); }
.rs, .sy { --scroll-track: transparent; --scroll-thumb: rgba(0, 0, 0, .5); --scroll-thumb-hover: rgba(0, 0, 0, .78); }
.sy { --scroll-thumb: #6E6E69; --scroll-thumb-hover: var(--violet-400); }
.table-wrap { --scroll-size: 10px; --scroll-track: var(--surface-2); }
.textarea { --scroll-size: 10px; --scroll-track: transparent; }
.pass__foot, .tg__list { --scroll-size: 10px; }
