/* Meu Roteirista v5.8 — acabamento inspirado no iOS, mantendo legibilidade de campo. */
:root{
  --blue:#0a7aff;--blue-dark:#0067df;--blue-soft:#edf5ff;--blue-mid:#cfe3ff;
  --bg:#f2f2f7;--surface:#ffffff;--surface2:#f7f7fa;--text:#111318;--muted:#6c6c73;
  --border:rgba(60,60,67,.16);--shadow:0 1px 2px rgba(0,0,0,.03),0 8px 24px rgba(0,0,0,.055);
  --radius:18px;--header-h:84px;--nav-h:74px;
}
:root[data-theme="dark"]{
  --bg:#000;--surface:#1c1c1e;--surface2:#2c2c2e;--text:#f5f5f7;--muted:#a1a1a6;
  --border:rgba(235,235,245,.16);--blue:#0a84ff;--blue-dark:#58a6ff;--blue-soft:#102d4e;--blue-mid:#224d78;
  --shadow:none;
}
html,body{font-family:var(--font-family,-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",sans-serif);-webkit-font-smoothing:antialiased}
body.ios-shell-v58{background:var(--bg);letter-spacing:-.012em}
body.ios-shell-v58 button,body.ios-shell-v58 a{-webkit-tap-highlight-color:transparent}
body.ios-shell-v58 .header{
  background:color-mix(in srgb,var(--surface) 88%,transparent);backdrop-filter:saturate(180%) blur(22px);-webkit-backdrop-filter:saturate(180%) blur(22px);
  border-bottom:1px solid var(--border);box-shadow:none;padding-left:18px;padding-right:14px
}
body.ios-shell-v58 .logo{width:44px;height:44px;border-radius:12px;box-shadow:none;background:linear-gradient(155deg,#0a84ff,#2876e8)}
body.ios-shell-v58 .brand-copy strong{font-size:1.12rem;font-weight:760;letter-spacing:-.025em}
body.ios-shell-v58 .brand-copy span{font-size:.76rem;margin-top:3px}
body.ios-shell-v58 .header-user{border:0;background:transparent;padding:0}
body.ios-shell-v58 .avatar{width:38px;height:38px;border:0;background:#e7f0ff;font-weight:750}
body.ios-shell-v58 .main{max-width:760px;padding:15px 14px 34px}
body.ios-shell-v58 .page-title{margin:5px 2px 17px}
body.ios-shell-v58 .page-title h1{font-size:2rem;line-height:1.05;font-weight:800;letter-spacing:-.045em}
body.ios-shell-v58 .page-title p{font-size:.88rem;line-height:1.45;margin-top:7px}
body.ios-shell-v58 .card,body.ios-shell-v58 .home-primary-v57,body.ios-shell-v58 .home-last-v57,body.ios-shell-v58 .route-tools-v57,body.ios-shell-v58 .settings-more-v57{
  border:1px solid var(--border);border-radius:18px;background:var(--surface);box-shadow:none
}
body.ios-shell-v58 .card{padding:16px;margin-bottom:12px}
body.ios-shell-v58 .home-primary-v57{padding:14px}
body.ios-shell-v58 .home-primary-v57 .btn{min-height:58px;border-radius:15px;font-size:1rem}
body.ios-shell-v58 .home-welcome-v57 span{font-size:.69rem;letter-spacing:.1em}
body.ios-shell-v58 .home-welcome-v57 h1{font-size:2rem;font-weight:800;letter-spacing:-.045em}
body.ios-shell-v58 .btn{min-height:50px;border-radius:14px;box-shadow:none;font-weight:700;transition:transform .08s ease,opacity .08s ease}
body.ios-shell-v58 .btn:active{transform:scale(.985);opacity:.78}
body.ios-shell-v58 .btn-primary{background:#0a7aff;border-color:#0a7aff;box-shadow:none}
body.ios-shell-v58 .btn-soft{background:#eef5ff;border-color:transparent;color:#0869d9}
body.ios-shell-v58 .input,body.ios-shell-v58 .select,body.ios-shell-v58 .textarea{background:var(--surface2);border-color:transparent;border-radius:13px;min-height:48px}
body.ios-shell-v58 .input:focus,body.ios-shell-v58 .select:focus,body.ios-shell-v58 .textarea:focus{border-color:#0a7aff;box-shadow:0 0 0 1px #0a7aff}
body.ios-shell-v58 .list-item{border-color:var(--border);border-radius:14px;background:var(--surface);padding:13px 14px}
body.ios-shell-v58 .bottom-nav{
  background:color-mix(in srgb,var(--surface) 88%,transparent);backdrop-filter:saturate(180%) blur(24px);-webkit-backdrop-filter:saturate(180%) blur(24px);
  border-top:1px solid var(--border);box-shadow:none;padding:6px 12px env(safe-area-inset-bottom)
}
body.ios-shell-v58 .nav-btn{border-radius:12px;font-size:.68rem;font-weight:650;gap:3px;background:transparent!important}
body.ios-shell-v58 .nav-btn .ico{width:24px;height:24px;display:grid;place-items:center}
body.ios-shell-v58 .nav-btn .ico svg{width:23px;height:23px}
body.ios-shell-v58 .nav-btn.active{color:#0a7aff}
body.ios-shell-v58 .nav-btn.active .ico{transform:translateY(-1px)}
body.ios-shell-v58 .settings-menu{gap:0;background:var(--surface);border:1px solid var(--border);border-radius:18px;overflow:hidden}
body.ios-shell-v58 .settings-essential-v57{gap:0}
body.ios-shell-v58 .settings-item,body.ios-shell-v58 .ios-list-row-v58{border:0;border-bottom:1px solid var(--border);border-radius:0;background:var(--surface);box-shadow:none;min-height:68px}
body.ios-shell-v58 .settings-item:last-child,body.ios-shell-v58 .ios-list-row-v58:last-child{border-bottom:0}
body.ios-shell-v58 .settings-item .arrow,body.ios-shell-v58 .ios-chevron-v58{color:#c4c4c6;font-size:1.7rem;font-weight:400}
body.ios-shell-v58 .settings-icon,body.ios-shell-v58 .ios-list-icon-v58{width:34px;height:34px;border-radius:9px;background:#edf5ff;color:#0a7aff;display:grid;place-items:center;flex:0 0 auto}
body.ios-shell-v58 .settings-icon svg,body.ios-shell-v58 .ios-list-icon-v58 svg{width:20px;height:20px}
body.ios-shell-v58 .settings-more-v57{overflow:hidden}
body.ios-shell-v58 .settings-more-v57 summary{padding:15px 16px}
body.ios-shell-v58 .settings-more-v57 .settings-more-body-v57{padding:0;gap:0}
body.ios-shell-v58 .settings-panel>.settings-back,body.ios-shell-v58 .resource-back-v58{box-shadow:none;background:color-mix(in srgb,var(--surface) 92%,transparent);backdrop-filter:blur(18px);border:1px solid var(--border)}
body.ios-shell-v58 .modal-backdrop{background:rgba(0,0,0,.28);backdrop-filter:blur(2px)}
body.ios-shell-v58 .modal{border-radius:24px;border:1px solid var(--border);box-shadow:0 20px 60px rgba(0,0,0,.2)}
body.ios-shell-v58 .overlay-head{background:color-mix(in srgb,var(--surface) 90%,transparent);backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px)}
body.ios-shell-v58 .step{border:0;background:var(--surface2);border-radius:10px}
body.ios-shell-v58 .step.active{background:#0a7aff;color:#fff}
body.ios-shell-v58 .driver-head,body.ios-shell-v58 .driver-bottom{background:color-mix(in srgb,var(--surface) 92%,transparent);backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px);box-shadow:none}
body.ios-shell-v58 .driver-address{letter-spacing:-.04em}
body.ios-shell-v58 .driver-more-toggle-v57{border:0;background:var(--surface);color:#0a7aff;border-radius:14px}

/* Home continua simples; estes dois blocos só voltam quando explicitamente habilitados. */
body.ios-shell-v58.show-home-today-v58 #page-home>#todayHomeCard{display:block!important;order:4}
body.ios-shell-v58.show-home-recent-v58 #page-home>.card.flat:has(#homeRecent){display:block!important}

/* Recursos extras de Locais. */
body.ios-shell-v58.show-map-nearby-v58 #page-map #nearbySearchBtn,body.ios-shell-v58.show-map-nearby-v58 #page-map #addressHelpBtn{display:inline-flex!important}
body.ios-shell-v58.show-map-external-v58 #page-map .external-map-row{display:grid!important}
body.ios-shell-v58.show-map-external-v58 #page-map .map-provider-note{display:block!important}

/* Entradas para submenus funcionais. */
.ios-list-group-v58{background:var(--surface);border:1px solid var(--border);border-radius:18px;overflow:hidden;margin:12px 0}
.ios-list-row-v58{width:100%;display:flex;align-items:center;gap:12px;padding:12px 13px;text-align:left;color:var(--text)}
.ios-list-copy-v58{display:grid;gap:2px;min-width:0;flex:1}.ios-list-copy-v58 b{font-size:.92rem}.ios-list-copy-v58 small{font-size:.74rem;color:var(--muted);line-height:1.35}
.ios-list-meta-v58{font-size:.68rem;color:var(--muted);white-space:nowrap}.ios-chevron-v58{line-height:1}
.feature-entrances-v58:empty,.feature-entrances-v58[hidden]{display:none!important}

/* Subpáginas dos recursos opcionais. */
.resource-page-v58{padding-bottom:20px}
.resource-nav-v58{display:flex;align-items:flex-start;gap:10px;margin:3px 0 18px}
.resource-back-v58{width:42px;height:42px;border-radius:50%;font-size:2rem;line-height:1;border:1px solid var(--border);color:#0a7aff;display:grid;place-items:center;padding:0;flex:0 0 auto}
.resource-nav-v58 small{display:block;color:#0a7aff;font-size:.67rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;margin:2px 0 2px}.resource-nav-v58 h1{font-size:1.7rem;margin:0;letter-spacing:-.045em}.resource-nav-v58 p{margin:5px 0 0;color:var(--muted);font-size:.82rem;line-height:1.4}
.resource-stack-v58{display:grid;gap:12px}.resource-stack-v58>.optional-card-v58{margin:0!important;display:block!important}
.resource-empty-v58{padding:22px;border-radius:16px;background:var(--surface);border:1px solid var(--border);text-align:center;color:var(--muted);font-size:.82rem}.resource-empty-v58[hidden]{display:none}

/* Painel de parâmetros opcionais. */
.resource-settings-shell-v58{padding-top:58px;display:grid;gap:12px}
.resource-settings-title-v58{padding:2px 2px 4px}.resource-settings-title-v58 small{font-size:.67rem;color:#0a7aff;font-weight:800;letter-spacing:.1em}.resource-settings-title-v58 h1{font-size:1.9rem;margin:3px 0 5px;letter-spacing:-.05em}.resource-settings-title-v58 p{margin:0;color:var(--muted);font-size:.86rem;line-height:1.5}
.resource-group-v58{background:var(--surface);border:1px solid var(--border);border-radius:18px;overflow:hidden}
.resource-group-head-v58{padding:14px 15px 11px;display:flex;justify-content:space-between;gap:12px;border-bottom:1px solid var(--border)}
.resource-group-head-v58 h3{font-size:.95rem;margin:0}.resource-group-head-v58 p{font-size:.72rem;color:var(--muted);margin:4px 0 0;line-height:1.35}.resource-group-head-v58>span{font-size:.68rem;color:var(--muted);white-space:nowrap;padding-top:2px}
.resource-switch-v58{min-height:66px;padding:11px 14px;display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--border);cursor:pointer}.resource-switch-v58:last-child{border-bottom:0}.resource-switch-v58>span{display:grid;gap:3px;flex:1}.resource-switch-v58 b{font-size:.86rem}.resource-switch-v58 small{color:var(--muted);font-size:.7rem;line-height:1.35}.resource-switch-v58 input{position:absolute;opacity:0;pointer-events:none}.resource-switch-v58 i{width:49px;height:29px;border-radius:999px;background:#e9e9eb;position:relative;transition:.18s;flex:0 0 auto}.resource-switch-v58 i:after{content:'';position:absolute;width:25px;height:25px;border-radius:50%;background:#fff;left:2px;top:2px;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:.18s}.resource-switch-v58 input:checked+i{background:#34c759}.resource-switch-v58 input:checked+i:after{transform:translateX(20px)}
.resource-actions-v58{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:2px}.resource-actions-v58 .btn{min-height:54px}

/* Ajustes de densidade em cards antigos, quando reativados. */
.optional-card-v58 .section-head{margin-bottom:10px}.optional-card-v58 .section-head h2{font-size:1rem}.optional-card-v58 .card-sub{font-size:.78rem}.optional-card-v58 .button-row .btn{min-height:46px;font-size:.78rem}

@media(max-width:680px){
  body.ios-shell-v58 .main{padding-left:12px;padding-right:12px}
  body.ios-shell-v58 .header-user span{display:none}
  body.ios-shell-v58 .modal{position:fixed;left:8px;right:8px;bottom:calc(8px + env(safe-area-inset-bottom));max-height:82vh;overflow:auto;border-radius:24px;margin:0}
  .resource-actions-v58{grid-template-columns:1fr}
  .ios-list-meta-v58{display:none}
}

/* Login e retornos com linguagem visual de iPhone. */
body.ios-shell-v58 .settings-back.app-back-fixed{
  min-height:36px!important;padding:5px 8px!important;border:0!important;background:transparent!important;
  color:#0a7aff!important;font-size:.82rem!important;font-weight:650!important;box-shadow:none!important;border-radius:10px!important
}
body.ios-shell-v58 .auth-gate-v471{background:#f2f2f7}
body.ios-shell-v58 .auth-shell-v471{max-width:430px}
body.ios-shell-v58 .auth-brand-v471{padding-left:4px;padding-right:4px}
body.ios-shell-v58 .auth-logo-v471{border-radius:14px;background:linear-gradient(155deg,#0a84ff,#2876e8);box-shadow:none}
body.ios-shell-v58 .auth-panel-v471{border:1px solid rgba(60,60,67,.14);border-radius:24px;background:#fff;box-shadow:0 8px 32px rgba(0,0,0,.06)}
body.ios-shell-v58 .auth-heading-v471 span{color:#0a7aff;letter-spacing:.08em}
body.ios-shell-v58 .auth-heading-v471 h1{letter-spacing:-.045em}
body.ios-shell-v58 .auth-security-v471{background:#f2f8f4;border-color:rgba(52,199,89,.22);border-radius:16px}
body.ios-shell-v58 .auth-password-v471 button{background:transparent;border:0}

/* Ajustes finais de hierarquia visual. */
body.ios-shell-v58 #page-home>.page-footer{display:none!important}
body.ios-shell-v58 #page-settings:has(.settings-panel.active)>.page-title{display:none}
body.ios-shell-v58 #page-settings:has(.settings-panel.active){padding-top:2px}

/* v5.8 — dashboards opcionais entram como itens de menu, nunca como uma parede de painéis. */
.resource-stack-v58{display:block;background:var(--surface);border:1px solid var(--border);border-radius:18px;overflow:hidden}
.resource-stack-v58:empty{display:none}
.resource-stack-v58>.ios-list-row-v58{border-bottom:1px solid var(--border);border-radius:0;min-height:70px;background:var(--surface)}
.resource-stack-v58>.ios-list-row-v58:last-child{border-bottom:0}
.feature-detail-body-v58{display:block}
.feature-detail-body-v58>.optional-card-v58{margin:0!important;border:1px solid var(--border)!important;border-radius:20px!important;background:var(--surface)!important;box-shadow:none!important;padding:16px!important;overflow:hidden}
.feature-detail-actions-v58{margin:14px 0 4px;display:grid;grid-template-columns:1fr}
.feature-detail-actions-v58 .btn{min-height:48px}

/* Harmoniza módulos antigos quando o usuário decide trazê-los de volta. */
.feature-detail-v58 .optional-card-v58 h1,.feature-detail-v58 .optional-card-v58 h2,.feature-detail-v58 .optional-card-v58 h3{letter-spacing:-.025em!important}
.feature-detail-v58 .optional-card-v58 .card,.feature-detail-v58 .optional-card-v58 .mini-card,.feature-detail-v58 .optional-card-v58 .metric-card,.feature-detail-v58 .optional-card-v58 .panel{
  box-shadow:none!important;border-color:var(--border)!important;border-radius:15px!important;background:var(--surface2)!important
}
.feature-detail-v58 .optional-card-v58 .btn{box-shadow:none!important;border-radius:12px!important;min-height:44px!important}
.feature-detail-v58 .optional-card-v58 .btn:not(.btn-primary){background:var(--surface2)!important;border-color:var(--border)!important}
.feature-detail-v58 .optional-card-v58 .btn-primary{background:#0a7aff!important;border-color:#0a7aff!important}
.feature-detail-v58 .optional-card-v58 input,.feature-detail-v58 .optional-card-v58 select,.feature-detail-v58 .optional-card-v58 textarea{border-radius:12px!important;box-shadow:none!important}
.feature-detail-v58 .optional-card-v58 [style*="box-shadow"]{box-shadow:none!important}
.feature-detail-v58 .optional-card-v58 [style*="border-radius"]{border-radius:14px!important}

/* Home e menus mais próximos da hierarquia do iOS. */
body.ios-shell-v58 .home-welcome-v57{padding:6px 2px 3px}
body.ios-shell-v58 .home-welcome-v57 p{color:var(--muted);font-size:.94rem}
body.ios-shell-v58 .home-primary-v57{margin-top:10px;padding:12px}
body.ios-shell-v58 .routes-simple-head-v57 h1{letter-spacing:-.045em}
body.ios-shell-v58 .route-tools-v57 summary{font-size:.9rem;color:var(--text)}
body.ios-shell-v58 .route-tools-body-v57{padding:0 12px 12px}
body.ios-shell-v58 .route-tools-body-v57 .btn{background:var(--surface2);border-color:transparent;font-size:.82rem}
body.ios-shell-v58 .locals-saved-v57{gap:8px}
body.ios-shell-v58 .locals-saved-v57 .btn{min-height:48px}

@media(max-width:420px){
  .resource-nav-v58 h1{font-size:1.55rem}
  .resource-nav-v58 p{font-size:.78rem}
  .feature-detail-body-v58>.optional-card-v58{padding:13px!important;border-radius:18px!important}
}
.command-more-v58{border:1px solid var(--border);border-radius:14px;background:var(--surface2);overflow:hidden;margin-top:4px}
.command-more-v58 summary{padding:14px 15px;font-size:.84rem;font-weight:720;color:#0a7aff;cursor:pointer;list-style:none}
.command-more-v58 summary::-webkit-details-marker{display:none}.command-more-v58 summary:after{content:'+';float:right;font-size:1.1rem;font-weight:500}.command-more-v58[open] summary:after{content:'−'}
.command-more-body-v58{padding:0 10px 10px;display:grid;gap:7px}.command-more-body-v58 .btn{margin:0!important}
