/* ============================================================================
 * OJ HUB — MODO CARRO (mobile de rua)
 * Uma camada inteira que só existe quando o aparelho é de mão.
 * Regra: alvo de dedo >= 48px, texto de leitura >= 16px, nada de letra miúda.
 * Ativada pela classe .carro no <html> (auto por largura, ou escolha do oficial).
 * O desktop não muda em nada.
 * ========================================================================== */

/* ---------------------------------------------------------------- ESCALA */
html.carro{
  --fs-2xs:12px; --fs-xs:13.5px; --fs-sm:15px; --fs-base:16.5px; --fs-md:18px;
  --fs-lg:22px; --fs-xl:27px; --fs-2xl:36px; --fs-3xl:44px;
  --topbar-h:64px;
}

html.carro body{font-size:var(--fs-base);line-height:1.55;overflow-x:hidden}
html.carro .topbar-search{min-width:0}
html.carro .main{min-width:0;overflow-x:hidden}

/* ---------------------------------------------------------------- CASCA */
html.carro .app-shell{grid-template-columns:1fr}
html.carro .sidebar{position:fixed;left:0;top:0;bottom:0;width:min(320px,86vw);
  transform:translateX(-100%);transition:transform var(--t-base);
  box-shadow:var(--shadow-lg);z-index:calc(var(--z-sidebar) + 2)}
html.carro .sidebar.is-open{transform:translateX(0)}
html.carro .sidebar-brand{padding:18px 16px}
html.carro .sidebar-brand-mark{width:56px;height:56px}
html.carro .sidebar-brand-name{font-size:20px}
html.carro .sidebar-brand-sub{font-size:13px}
html.carro .nav-group-label{font-size:11.5px;letter-spacing:.1em;margin-bottom:6px}
html.carro .nav-item{padding:14px 14px;font-size:17px;gap:12px;border-radius:12px}
html.carro .nav-icon{width:24px;font-size:19px}
html.carro .nav-count{font-size:12px;padding:2px 8px}
html.carro .sidebar-foot .nav-item{font-size:16px;padding:14px}
html.carro .sidebar-meta{font-size:12.5px;padding:8px 14px 4px}

html.carro .topbar{height:var(--topbar-h);padding:0 14px;gap:10px;
  background:var(--bg-deep);backdrop-filter:none;-webkit-backdrop-filter:none}
html.carro .topbar-burger{display:inline-flex;width:46px;height:46px;
  align-items:center;justify-content:center;font-size:23px;flex:none;
  border-radius:12px;background:var(--bg-surface);border:1px solid var(--border-subtle)}
html.carro .topbar-search{flex:1}
html.carro .topbar-search input{height:46px;font-size:16px;padding-left:40px}
html.carro .topbar-search svg{width:18px;height:18px;left:13px}
html.carro .avatar{width:44px;height:44px;font-size:15px}

html.carro .view{padding:16px 14px 110px}
html.carro .view.is-active{animation:none}
html.carro .view-title{font-size:var(--fs-xl);line-height:1.2}
html.carro .view-sub{font-size:15px;line-height:1.5;max-width:none}
html.carro .view-head{margin-bottom:14px;gap:12px}
html.carro .view-actions{width:100%}
html.carro .view-actions .btn{flex:1}

/* ---------------------------------------------------------------- CONTROLES */
html.carro .btn{height:52px;padding:0 18px;font-size:16.5px;border-radius:14px;gap:8px}
html.carro .btn-sm{height:44px;font-size:15px;padding:0 14px;border-radius:12px}
html.carro .btn-xs{height:38px;font-size:14px;padding:0 12px;border-radius:10px}
html.carro .btn-lg{height:58px;font-size:18px;border-radius:16px}
html.carro .btn-icon{width:48px}
html.carro .btn-block{width:100%}
html.carro .input,html.carro .select{height:52px;font-size:16px;border-radius:14px}
html.carro .textarea{font-size:16px;border-radius:14px}
html.carro .check{font-size:16px;gap:12px}
html.carro .check input{width:24px;height:24px;margin-top:0}
html.carro .field-label{font-size:15px}
html.carro .field-hint{font-size:13.5px}

/* ---------------------------------------------------------------- NÚMEROS DO DIA */
html.carro .stat-card{padding:16px;border-radius:16px;min-height:104px;justify-content:center}
html.carro .stat-value{font-size:40px;letter-spacing:-.04em;line-height:1}
html.carro .stat-label{font-size:14.5px;color:var(--text-secondary);line-height:1.35}
html.carro .stat-hint{font-size:12.5px}

/* ---------------------------------------------------------------- CARTÕES DO MANDADO */
html.carro .fila{gap:12px}
html.carro .mandado{flex-direction:column;gap:12px;padding:16px;border-radius:16px}
html.carro .mandado-nome{font-size:18.5px;line-height:1.3}
html.carro .mandado-ender{font-size:15.5px;line-height:1.5}
html.carro .mandado-meta{font-size:13px;gap:10px}
html.carro .mandado-side{width:100%;flex-direction:row;align-items:center;
  justify-content:space-between;flex-wrap:wrap;gap:8px;
  border-top:1px solid var(--border-subtle);padding-top:12px}
html.carro .mandado-actions{justify-content:flex-start}
html.carro .mandado-top .badge{font-size:12px}
html.carro .badge{font-size:12px;padding:3px 10px}

/* ---------------------------------------------------------------- BLOCOS DA TELA INICIAL */
html.carro .tela-carro{display:flex;flex-direction:column;gap:16px}
html.carro .carro-ola{padding:2px 2px 0}
html.carro .carro-ola-nome{display:block;width:100%;font-size:27px;
  font-weight:var(--fw-semibold);letter-spacing:-.02em;line-height:1.2;
  white-space:normal;overflow:visible}
html.carro .carro-ola-sub{font-size:15px;color:var(--text-secondary);margin-top:4px;line-height:1.45}

html.carro .carro-grade{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
html.carro .carro-num{display:flex;flex-direction:column;justify-content:center;gap:2px;
  min-height:112px;padding:14px 16px;border-radius:18px;text-align:left;
  background:var(--bg-surface);border:1px solid var(--border-default);
  position:relative;overflow:hidden;transition:border-color var(--t-fast),background var(--t-fast)}
html.carro .carro-num:active{background:var(--bg-raised)}
html.carro .carro-num::before{content:'';position:absolute;left:0;top:0;bottom:0;width:5px;
  background:var(--border-default)}
html.carro .carro-num.is-danger::before{background:var(--danger)}
html.carro .carro-num.is-warning::before{background:var(--warning)}
html.carro .carro-num.is-accent::before{background:var(--accent)}
html.carro .carro-num.is-success::before{background:var(--success)}
html.carro .carro-num-v{font-size:42px;font-weight:var(--fw-bold);line-height:1;
  letter-spacing:-.04em;font-variant-numeric:tabular-nums}
html.carro .carro-num-l{font-size:14.5px;color:var(--text-secondary);line-height:1.3;margin-top:4px}
html.carro .carro-num-h{font-size:12.5px;color:var(--text-muted);margin-top:3px}

html.carro .carro-secao{display:flex;align-items:baseline;justify-content:space-between;gap:10px;
  padding:6px 2px 0}
html.carro .carro-secao-t{font-size:18px;font-weight:var(--fw-semibold);letter-spacing:-.01em}
html.carro .carro-secao-a{font-size:14px;color:var(--accent)}

/* o bloco que interessa no meio da rua: para onde eu vou agora */
html.carro .carro-agora{border-radius:20px;padding:18px;border:1px solid var(--accent-border);
  background:linear-gradient(160deg,rgba(47,129,247,.14),rgba(16,31,53,.9));
  display:flex;flex-direction:column;gap:12px}
html.carro .carro-agora-top{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
html.carro .carro-agora-nome{font-size:21px;font-weight:var(--fw-semibold);line-height:1.25}
html.carro .carro-agora-ender{font-size:16px;color:var(--text-secondary);line-height:1.5}
html.carro .carro-agora-acoes{display:grid;grid-template-columns:1fr 1fr;gap:10px}

/* blocos grandes — a "cara de aplicativo" que ele pediu */
html.carro .carro-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
html.carro .carro-tile{display:flex;flex-direction:column;justify-content:space-between;
  gap:12px;min-height:132px;padding:16px;border-radius:20px;text-align:left;
  background:var(--bg-surface);border:1px solid var(--border-default);
  transition:transform var(--t-fast),border-color var(--t-fast),background var(--t-fast)}
html.carro .carro-tile:active{transform:scale(.985);background:var(--bg-raised)}
html.carro .carro-tile-ico{width:58px;height:58px;border-radius:16px;display:grid;
  place-items:center;font-size:27px;background:var(--bg-raised);
  border:1px solid var(--border-subtle);flex:none}
html.carro .carro-tile-nome{font-size:18px;font-weight:var(--fw-semibold);line-height:1.25;
  letter-spacing:-.01em}
html.carro .carro-tile-sub{font-size:13px;color:var(--text-muted);line-height:1.35;margin-top:2px}
html.carro .carro-tile[data-acao='certidoes'] .carro-tile-ico{color:var(--gold);border-color:var(--gold-border);background:var(--gold-soft)}
html.carro .carro-tile[data-acao='mandados'] .carro-tile-ico{color:var(--accent);border-color:var(--accent-border);background:var(--accent-soft)}
html.carro .carro-tile[data-acao='rotas'] .carro-tile-ico{color:var(--success);border-color:var(--success-border);background:var(--success-soft)}
html.carro .carro-tile[data-acao='whatsapp'] .carro-tile-ico{color:#4ade80;border-color:rgba(74,222,128,.4);background:rgba(74,222,128,.12)}
html.carro .carro-tile[data-acao='autos'] .carro-tile-ico{color:var(--info);border-color:var(--info-border);background:var(--info-soft)}
html.carro .carro-tile[data-acao='adicionar'] .carro-tile-ico{color:var(--accent);border-color:var(--accent-border);background:var(--accent-soft)}
html.carro .carro-tile[data-acao='localizacao'] .carro-tile-ico{color:var(--warning);border-color:var(--warning-border);background:var(--warning-soft)}
html.carro .carro-tile[data-acao='jurisdicoes'] .carro-tile-ico{color:var(--text-secondary);border-color:var(--border-default);background:var(--bg-raised)}

/* ---------------------------------------------------------------- DEMAIS TELAS */
html.carro .card{padding:18px;border-radius:16px}
html.carro .card-title{font-size:18px}
html.carro .card-subtitle{font-size:14px}
html.carro .grid-2,html.carro .grid-3,html.carro .grid-4,
html.carro .grid-auto{grid-template-columns:1fr}
html.carro .toolbar{padding:12px;gap:10px;border-radius:16px}
html.carro .toolbar .input,html.carro .toolbar .select{width:100%;min-width:0;height:50px}
html.carro .toolbar-sep{display:none}
html.carro .toolbar-count{margin-left:0;font-size:13px}
html.carro .segmented{padding:4px;border-radius:14px;width:100%}
html.carro .segmented button{padding:12px 10px;font-size:15.5px;flex:1}
html.carro .tabs button{padding:14px 12px;font-size:15.5px}
html.carro .table{font-size:14px}
html.carro .table th{padding:12px 14px;font-size:11.5px}
html.carro .table td{padding:14px}
html.carro .modal{max-height:92vh;border-radius:20px}
html.carro .modal-body{padding:18px}
html.carro .modal-footer{padding:14px 18px}
html.carro .modal-footer .btn{flex:1}
html.carro .banner{font-size:15px;padding:14px;border-radius:14px}
html.carro .kv{font-size:15px;grid-template-columns:1fr;gap:2px 0}
html.carro .kv dt{font-size:12.5px;text-transform:uppercase;letter-spacing:.06em;margin-top:8px}
html.carro .pill{font-size:14px;padding:7px 12px}
html.carro .list-item{padding:14px 0}
html.carro .empty-state{padding:32px 18px}
html.carro .empty-state-title{font-size:17px}
html.carro .empty-state-desc{font-size:14.5px}
html.carro .chat-box{height:min(70vh,620px)}
html.carro .msg{font-size:16px;max-width:94%}
html.carro .chat-input .input{height:48px}
html.carro .rota-parada{padding:14px;border-radius:16px}
html.carro .rota-ordem{width:34px;height:34px;font-size:14px}
html.carro .rota-linha::before{left:33px}
html.carro .dropzone{padding:36px 18px;border-radius:18px}
html.carro .credito-num{font-size:24px}
html.carro .paper{padding:1.2cm 1cm 1cm 1.3cm;font-size:12pt}

/* O ORBE é o botão de voz: no carro ele é o maior alvo da tela */
html.carro .oj-orb{
  width:86px;height:86px;right:14px;bottom:88px;border-width:2px;
  box-shadow:0 0 0 8px rgba(201,162,39,.14),0 18px 46px rgba(0,0,0,.72)}
html.carro .oj-orb::before,html.carro .oj-orb::after{border-width:2px}
html.carro .oj-orb-cv{border-radius:50%}
html.carro .oj-orb-lbl{display:block;position:absolute;left:0;right:0;bottom:-21px;
  text-align:center;font-size:11.5px;font-weight:var(--fw-semibold);
  letter-spacing:.08em;text-transform:uppercase;color:var(--gold)}
html.carro .view{padding-bottom:132px}
html.carro .oj-orb-tip{display:none}

/* painel do Jarvis: tela quase cheia, microfone grande */
html.carro .oj-painel{left:0;right:0;bottom:0;top:auto;width:100%;max-width:100%;
  height:min(88vh,760px);border-radius:22px 22px 0 0;border-bottom:none}
html.carro .oj-p-top{padding:16px 16px 14px}
html.carro .oj-p-mini{width:42px;height:42px}
html.carro .oj-p-nome{font-size:18px}
html.carro .oj-p-sub{font-size:13px}
html.carro .oj-p-x{font-size:28px;padding:4px 10px}
html.carro .oj-p-msgs{padding:16px 14px;gap:12px}
html.carro .oj-p-msg{max-width:92%;font-size:16px;line-height:1.55;padding:12px 14px;border-radius:14px}
html.carro .oj-p-msg .meta{font-size:11px}
html.carro .oj-p-sug{padding:0 14px 10px;gap:8px}
html.carro .oj-p-sug button{font-size:14px;padding:9px 14px}
html.carro .oj-p-in{padding:12px 12px calc(12px + env(safe-area-inset-bottom,0px));gap:9px}
html.carro .oj-p-in input{height:54px;font-size:17px;border-radius:14px;padding:0 14px}
html.carro .oj-p-btn{width:54px;height:54px;border-radius:14px;font-size:22px}
html.carro .oj-p-foot{font-size:11.5px;padding:0 14px 10px}

/* botão de voz em largura total, no alto da home */
html.carro .carro-voz{display:flex;align-items:center;gap:14px;width:100%;
  padding:16px 18px;border-radius:20px;text-align:left;cursor:pointer;
  background:linear-gradient(135deg,rgba(201,162,39,.20),rgba(16,31,53,.92));
  border:1.5px solid var(--gold-border);
  box-shadow:0 10px 28px rgba(0,0,0,.35)}
html.carro .carro-voz:active{transform:scale(.99)}
html.carro .carro-voz-mic{width:64px;height:64px;border-radius:50%;flex:none;display:grid;
  place-items:center;font-size:29px;color:#1a1405;
  background:linear-gradient(180deg,#e5c65e,#c9a227);
  box-shadow:0 0 0 6px rgba(201,162,39,.16)}
html.carro .carro-voz-txt{min-width:0}
html.carro .carro-voz-t{font-size:20px;font-weight:var(--fw-semibold);line-height:1.2;
  letter-spacing:-.01em}
html.carro .carro-voz-s{font-size:13.5px;color:var(--text-secondary);margin-top:2px;line-height:1.35}
html.carro .carro-voz-seta{margin-left:auto;font-size:22px;color:var(--gold);flex:none}

/* rodapé fixo com a ação mais usada — some o "rolar até achar" */
html.carro .carro-barra{position:fixed;left:0;right:0;bottom:0;z-index:calc(var(--z-topbar) - 2);
  display:grid;grid-template-columns:repeat(4,1fr);gap:6px;
  padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px));
  background:rgba(7,17,31,.94);backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);border-top:1px solid var(--border-subtle)}
html.carro .carro-barra button{display:flex;flex-direction:column;align-items:center;
  justify-content:center;gap:3px;height:58px;border-radius:14px;padding:0 2px;
  font-size:11.5px;letter-spacing:0;font-weight:var(--fw-medium);color:var(--text-secondary);
  border:1px solid transparent}
html.carro .carro-barra button span:first-child{font-size:21px;line-height:1}
html.carro .carro-barra button.is-active{color:var(--accent);
  background:var(--accent-soft);border-color:var(--accent-border)}

/* ---------------------------------------------------------------- TELA DE ENTRADA (celular) */
@media(max-width:820px){
  .auth-form-wrap{padding:24px 20px 48px;align-items:start}
  .auth-form{max-width:none;padding-top:8px}
  .brand-row{margin-bottom:22px}
  .brand-mark{width:52px;height:52px}
  .auth-tabs{margin-bottom:22px}
  .auth-tabs button{font-size:17px;padding:14px 0}
  .auth .field-label{font-size:15px}
  .auth .field-hint{font-size:13.5px}
  .auth .input,.auth .select{height:54px;font-size:16px;border-radius:14px}
  .auth .btn{height:54px;font-size:17px;border-radius:14px}
  .auth .check{font-size:15.5px}
  .auth .check input{width:22px;height:22px}
  .perfil-grid{grid-template-columns:1fr;gap:8px}
  .perfil-card{padding:15px}
  .perfil-card strong{font-size:16.5px}
  .perfil-card span{font-size:13.5px}
}

/* ---------------------------------------------------------------- MARCA NA BARRA (só no carro) */
.topbar-brand-mobile{display:none}
.btn-busca-mobile{display:none}
html.carro .topbar-brand-mobile{display:flex;align-items:center;gap:9px;flex:none;
  height:46px;padding:0 12px 0 4px;border-radius:12px;color:var(--text-primary);
  text-decoration:none;font-size:17px;font-weight:var(--fw-semibold);letter-spacing:-.01em}
html.carro .topbar-brand-mobile img{width:38px;height:38px;border-radius:50%;
  border:1px solid var(--gold-border);box-shadow:0 0 0 3px var(--gold-soft);object-fit:cover}
html.carro .topbar-search{display:none;min-width:0}
html.carro .topbar-search.is-aberto{display:block;position:absolute;left:12px;right:12px;
  top:8px;z-index:3}
html.carro .topbar-search.is-aberto input{height:48px;box-shadow:var(--shadow-md)}
html.carro .btn-busca-mobile{display:inline-flex;width:46px;height:46px;align-items:center;
  justify-content:center;border-radius:12px;background:var(--bg-surface);
  border:1px solid var(--border-subtle);font-size:20px;flex:none;color:var(--text-secondary)}
