:root {
  color-scheme: light;
  --pine: #1b4d20;
  --pine-dark: #133a17;
  --green: #2E7D32;
  --orange: #FF9800;
  --light-green: #81C784;
  --green-soft: #e8f5e9;
  --mint: #c8e6c9;
  --leaf: #81C784;
  --orange-dark: #e65100;
  --orange-bg: #fff3e0;
  --canvas: #f5f7f4;
  --surface: #fff;
  --ink: #1d2b1f;
  --muted: #66756a;
  --line: #e2e9e2;
  --amber: #a46b13;
  --amber-bg: #fff5df;
  --red: #ae4141;
  --red-bg: #fff0ef;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: inherit; }
.auth-screen { min-height: 100svh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(ellipse at 20% 10%, rgba(26,138,100,.13), transparent 35%),
  linear-gradient(140deg, #eff7f2, #f8faf8 55%, #e7f1eb); }
.auth-card { width: min(100%, 440px); padding: 38px; border-radius: 22px; background: white; border: 1px solid #e3ece6; box-shadow: 0 24px 70px rgba(15,56,43,.10); }
.auth-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 30px; }
.auth-logo { display: block; width: 188px; max-width: 75%; height: auto; }
.topbar-brand { width: 30px; height: 30px; flex: 0 0 auto; }
.page-brand { width: 38px; height: 34px; object-fit: contain; vertical-align: middle; margin-right: 8px; }
.import-address { display: block; white-space: normal; min-width: 130px; overflow-wrap: anywhere; margin-top: 5px; }
.import-toolbar { flex-wrap: wrap; }
.import-toolbar .btn { min-height: 46px; }
#client-import-form input, #client-import-form select { font-size: 16px; min-width: 0; width: 100%; }
#client-import-file { white-space: normal; overflow: hidden; }
.auth-brand-label { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .23em; }
.brand-mark { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 13px; background: var(--green); color: white; font-weight: 800; font-size: 21px; }
.auth-brand strong { display: block; color: var(--pine); font-size: 12px; letter-spacing: .16em; }
.auth-brand small { display: block; color: var(--muted); font-size: 10px; letter-spacing: .22em; margin-top: 3px; }
.auth-card h1 { margin: 0; font-size: 28px; letter-spacing: -.04em; color: var(--pine-dark); }
.auth-card .auth-subtitle { color: var(--muted); line-height: 1.55; margin: 9px 0 26px; font-size: 14px; }
.auth-note { font-size: 12px; line-height: 1.5; color: var(--muted); background: #f5f8f6; border-radius: 12px; padding: 12px 14px; margin-top: 18px; }
.auth-footer { text-align: center; font-size: 11px; color: #98a49d; margin-top: 25px; }

.app-shell { display: flex; min-height: 100svh; }
.sidebar { width: 250px; position: fixed; inset: 0 auto 0 0; z-index: 10; display: flex; flex-direction: column; padding: 22px 15px 16px; background: var(--pine); color: white; }
.brand { display: flex; align-items: center; justify-content: center; padding: 9px 8px; margin: 0 2px 22px; border-radius: 13px; background: white; text-decoration: none; }
.brand-lockup { display: grid; justify-items: center; gap: 2px; }
.brand-logo { display: block; width: 158px; max-width: 100%; height: auto; }
.brand-lockup small { color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .24em; }
.brand .brand-mark { width: 38px; height: 38px; border-radius: 12px; color: var(--pine); background: var(--mint); font-size: 19px; }
.brand strong { display: block; font-size: 11px; letter-spacing: .14em; }
.brand small { display: block; color: #a9cabc; margin-top: 3px; font-size: 9px; letter-spacing: .23em; }
.side-label { padding: 6px 12px 9px; color: #93b3a6; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.side-nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; padding: 11px 12px; border-radius: 10px; color: #d7e6df; background: transparent; text-align: left; font-size: 13px; transition: background .15s ease, color .15s ease; }
.nav-item:hover { background: rgba(255,255,255,.09); color: white; }
.nav-item.active { background: #23654d; color: white; box-shadow: inset 3px 0 0 #8ed3b4; }
.nav-icon { width: 20px; text-align: center; font-size: 16px; opacity: .9; }
.nav-icon svg { display: block; width: 100%; height: 100%; }
.side-nav .nav-icon { height: 20px; }
.nav-item:focus-visible { outline: 3px solid #b45309; outline-offset: -3px; }
.side-bottom { margin-top: auto; border-top: 1px solid rgba(255,255,255,.14); padding-top: 15px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 5px; }
.avatar, .topbar-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--pine); background: var(--mint); font-size: 12px; font-weight: 800; }
.user-chip-copy { flex: 1; min-width: 0; }
.user-chip-copy strong, .user-chip-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-copy strong { font-size: 12px; }
.user-chip-copy small { margin-top: 3px; color: #aec7bb; font-size: 10px; }
.icon-button { border: 0; background: transparent; color: #bcd2c8; padding: 7px; border-radius: 8px; }
.icon-button:hover { background: rgba(255,255,255,.1); color: white; }

.main-area { width: calc(100% - 250px); min-height: 100svh; margin-left: 250px; }
.topbar { height: 64px; position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: 0 36px; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: #8a9890; font-size: 12px; }
.breadcrumb b { color: #c1ccc6; font-weight: 400; }
.breadcrumb strong { color: var(--ink); font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.secure-pill { display: flex; align-items: center; gap: 7px; color: #75847b; font-size: 11px; }
.secure-pill i { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #37a778; box-shadow: 0 0 0 3px #e5f5ed; }
.topbar-avatar { width: 31px; height: 31px; background: #e6f2eb; }
.page-content { max-width: 1500px; padding: 31px 36px 44px; margin: 0 auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.eyebrow { color: var(--green); text-transform: uppercase; font-size: 10px; font-weight: 800; letter-spacing: .14em; margin-bottom: 8px; }
.page-heading h1 { margin: 0; font-size: clamp(25px, 3vw, 32px); line-height: 1.1; color: var(--pine-dark); letter-spacing: -.04em; }
.page-heading p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.heading-actions { display: flex; gap: 9px; align-items: center; }
.heading-actions { flex-wrap: wrap; min-width: 0; }
.page-heading > div { min-width: 0; }
.day-route-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 18px; margin-bottom: 18px; }
.day-route-help { flex-basis: 100%; }
.day-route-card h2 { margin: 0; }
.day-route-card p { margin: 6px 0 0; }
.route-return { display: flex; align-items: center; gap: 10px; min-height: 46px; }
.route-return input { width: 22px; height: 22px; }
.day-route-open, .day-route-segments .btn { min-height: 46px; white-space: normal; }
.day-route-segments { display: grid; gap: 10px; margin-top: 12px; }
.day-route-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.day-stop-list { padding-left: 24px; }
.day-stop-list li { margin: 9px 0; overflow-wrap: anywhere; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 15px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font-size: 12px; font-weight: 700; transition: all .15s ease; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #bfd7ca; background: #f9fcfa; }
.btn-primary { color: white; border-color: var(--green); background: var(--green); box-shadow: 0 4px 10px rgba(26,138,100,.13); }
.btn-primary:hover { background: #256529; border-color: #256529; }
.btn-danger { color: var(--red); border-color: #f0d3d1; background: white; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn-small { min-height: 32px; padding: 0 10px; font-size: 11px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { padding: 18px; min-height: 123px; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: 0 4px 14px rgba(24,73,54,.025); }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 700; }
.stat-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; background: #eff7f2; color: var(--green); font-size: 15px; }
.stat-number { margin-top: 11px; color: var(--pine-dark); font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.stat-note { margin-top: 7px; color: #97a39c; font-size: 10px; }
.panel { background: white; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 4px 14px rgba(24,73,54,.025); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 19px; border-bottom: 1px solid #edf1ee; }
.panel-head h2 { margin: 0; font-size: 14px; color: var(--pine-dark); }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.panel-body { padding: 16px 19px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(270px,.85fr); gap: 15px; }
.visit-list { display: grid; }
.visit-row { display: grid; grid-template-columns: 58px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid #f0f3f1; }
.visit-row:last-child { border-bottom: 0; }
.visit-time { color: var(--green); font-size: 12px; font-weight: 800; }
.visit-info { min-width: 0; }
.visit-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.visit-info small { display: block; color: var(--muted); margin-top: 4px; font-size: 10px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 20px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.pill.planned { color: #88611b; background: var(--amber-bg); }
.pill.in_progress { color: #126c4d; background: var(--green-soft); }
.pill.completed { color: #56675e; background: #edf1ee; }
.pill.cancelled { color: #a04444; background: #fff0ef; }
.pill.active { color: #126c4d; background: var(--green-soft); }
.pill.inactive { color: #6d7771; background: #f0f2f1; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.clients-filter { align-items: flex-end; }
#route-import-form input, #route-import-form select { min-height: 46px; min-width: 0; width: 100%; font-size: 16px; }
#route-import-preview { min-width: 0; overflow-wrap: anywhere; }
#route-import-preview .field { margin-bottom: 14px; }
#manual-route-form input, #manual-route-form select { min-width: 0; width: 100%; min-height: 46px; font-size: 16px; }
.manual-route-stop { padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.manual-route-stop .btn { min-width: 46px; min-height: 46px; }
.clients-filter .field { margin: 0; }
.clients-filter .search-field input, .clients-filter .field select { min-height: 46px; }
.clients-filter .users-badge { margin-bottom: 14px; }
.sync-mobile { display: none; }
#sync-app-menu { min-height: 46px; }
.visits-filter .field { margin: 0; }
.visits-filter .field input, .visits-filter > .btn { min-height: 46px; }
.visits-filter .users-badge { margin-bottom: 14px; }
.search-field { position: relative; flex: 1; min-width: 180px; }
.search-field input { padding-left: 35px; }
.search-symbol { position: absolute; left: 12px; top: 10px; color: #93a097; pointer-events: none; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { color: #5d6c63; font-size: 11px; font-weight: 700; }
.field input, .field select, .field textarea, .search-field input, .toolbar select, .toolbar input { width: 100%; min-height: 40px; padding: 9px 11px; color: var(--ink); border: 1px solid #dce6df; border-radius: 9px; outline: none; background: white; font-size: 12px; }
.field textarea { min-height: 82px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .search-field input:focus, .toolbar select:focus, .toolbar input:focus { border-color: #55a987; box-shadow: 0 0 0 3px rgba(26,138,100,.1); }
.field-help { color: #89978f; font-size: 10px; line-height: 1.45; }
.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 650px; }
.data-table th { padding: 11px 13px; color: #829087; background: #f9fbfa; text-align: left; font-size: 9px; text-transform: uppercase; letter-spacing: .07em; border-bottom: 1px solid var(--line); }
.data-table td { padding: 13px; color: #43584d; font-size: 11px; border-bottom: 1px solid #eef2ef; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td strong { color: var(--ink); font-size: 11px; }
.table-actions { display: flex; align-items: center; gap: 5px; }
.empty-state { text-align: center; padding: 40px 18px; color: var(--muted); }
.empty-icon { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 14px; color: var(--green); background: #eff8f3; font-size: 20px; }
.empty-state strong { display: block; color: var(--ink); font-size: 13px; }
.empty-state p { margin: 6px auto 15px; max-width: 310px; font-size: 11px; line-height: 1.5; }

.visit-card-list { display: grid; gap: 11px; }
.visit-card { padding: 16px; }
.visit-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.visit-card-title { margin: 0; color: var(--pine-dark); font-size: 14px; }
.visit-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 7px; color: var(--muted); font-size: 10px; }
.visit-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #eef2ef; }
.visit-card-instructions { margin-top: 11px; color: #596a60; font-size: 11px; line-height: 1.5; }
.visit-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.followup-card { padding: 14px 15px; display: flex; align-items: flex-start; gap: 10px; border-radius: 11px; background: #fff8e9; border: 1px solid #f5e8c9; margin-bottom: 8px; }
.followup-card:last-child { margin-bottom: 0; }
.followup-date { min-width: 43px; color: #a36a12; font-size: 10px; font-weight: 800; }
.followup-copy strong { display: block; color: #514326; font-size: 11px; }
.followup-copy small { display: block; margin-top: 3px; color: #917e5b; font-size: 10px; }

.modal { width: min(620px, calc(100vw - 24px)); max-height: min(90svh, 850px); padding: 0; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 24px 80px rgba(12,40,29,.26); color: var(--ink); }
.modal::backdrop { background: rgba(12,32,24,.45); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 21px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; color: var(--pine-dark); font-size: 17px; }
.modal-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.modal-close { width: 31px; height: 31px; border: 0; border-radius: 8px; color: #718078; background: #f2f6f3; font-size: 18px; }
.modal-body { max-height: calc(90svh - 132px); overflow: auto; padding: 19px 21px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.field-full { grid-column: 1 / -1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 21px; border-top: 1px solid var(--line); background: #fbfcfb; }
.notice { display: flex; gap: 9px; align-items: flex-start; padding: 11px 12px; border: 1px solid #f1e4c5; border-radius: 10px; background: #fff9ec; color: #766238; font-size: 10px; line-height: 1.5; }
.gps-box { display: flex; align-items: flex-start; gap: 10px; padding: 11px; border-radius: 10px; border: 1px solid var(--line); background: #f9fbfa; }
.gps-dot { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: #d6dfd9; }
.gps-box.ok { border-color: #cde8d7; background: #f0faf4; }
.gps-box.ok .gps-dot { background: var(--green); box-shadow: 0 0 0 3px #d8f0e2; }
.gps-box strong { display: block; color: var(--ink); font-size: 11px; }
.gps-box small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
.camera-wrap { position: relative; min-height: 145px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: #0e1c16; }
.camera-wrap video, .camera-wrap img { width: 100%; max-height: 280px; object-fit: cover; }
.camera-placeholder { color: #d3e5dc; text-align: center; padding: 20px; font-size: 11px; }
.camera-placeholder strong { display: block; margin-bottom: 4px; font-size: 12px; }
.camera-captured { color: #147754; background: #eaf7ef; border: 1px solid #d2ebdb; border-radius: 9px; padding: 9px 11px; font-size: 10px; }
.modal-stack { display: grid; gap: 13px; }
.modal-stack .btn, .modal-foot .btn { min-height: 46px; }
.checkin-distance-warning { color: #a65300; font-weight: 700; }
.modal-section-title { margin: 0 0 -3px; color: var(--pine-dark); font-size: 12px; }
.result-extra[hidden] { display: none; }
.loading { padding: 34px; color: var(--muted); text-align: center; font-size: 12px; }
.toast-region { position: fixed; z-index: 50; right: 18px; bottom: 18px; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); }
.toast { padding: 12px 14px; border: 1px solid #cce7d6; border-radius: 11px; color: #155d42; background: white; box-shadow: 0 8px 28px rgba(20,73,51,.15); font-size: 12px; animation: rise .2s ease-out; }
.toast.error { color: #8d3131; border-color: #efd0cd; }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.install-hint { color: #829087; font-size: 10px; line-height: 1.5; }
.install-panel { margin-top: 14px; padding: 12px; border-radius: 10px; background: #f6f9f7; }
.install-panel .install-hint { margin: 0 0 9px; }
.map-link { color: #177955; font-weight: 700; font-size: 10px; text-decoration: none; }
.map-link:hover { text-decoration: underline; }
.visits-filter { display: flex; gap: 8px; align-items: flex-end; }
.users-badge { padding: 4px 8px; border-radius: 8px; background: #edf6f0; color: #287654; font-size: 10px; font-weight: 700; }

.mobile-nav { display: none; }

@media (max-width: 1100px) {
  .sidebar { width: 220px; }
  .main-area { width: calc(100% - 220px); margin-left: 220px; }
  .topbar { padding: 0 25px; }
  .page-content { padding: 27px 25px 40px; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 740px) {
  .sync-mobile { display: inline-flex; min-height: 46px; margin-right: 8px; }
  .btn, .btn-small, .icon-button, .modal-close { min-height: 46px; }
  .modal-close { min-width: 46px; }
  .field input, .field select, .field textarea { font-size: 16px; }
  .sidebar { display: none; }
  .main-area { width: 100%; margin-left: 0; padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  .topbar { height: 55px; padding: 0 16px; }
  .breadcrumb { font-size: 11px; gap: 7px; }
  .secure-pill { display: none; }
  .topbar-right { gap: 0; }
  .page-content { padding: 22px 15px 24px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 18px; gap: 13px; }
  .page-heading h1 { font-size: 27px; }
  .page-heading p { font-size: 12px; }
  .heading-actions { width: 100%; display: grid; grid-template-columns: minmax(0,1fr); gap: 9px; }
  .heading-actions .btn { width: 100%; min-width: 0; min-height: 46px; white-space: normal; text-align: center; }
  .page-content, .visit-card, .visit-meta { min-width: 0; max-width: 100%; }
  .visit-card { overflow-wrap: anywhere; }
  .day-route-card { flex-direction: column; align-items: stretch; }
  .day-route-card .btn { width: 100%; min-height: 46px; }
  .day-route-card select, #day-origin { font-size: 16px; min-height: 46px; }
  .day-route-open { display: flex; width: 100%; }
  .visit-card-bottom .visit-meta { width: 100%; overflow-wrap: anywhere; }
  .visits-filter { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; }
  .visits-filter .field { min-width: 0; }
  .visits-filter > .btn { width: auto; min-width: 72px; }
  .visits-filter .users-badge { grid-column: 1 / -1; justify-self: start; margin-bottom: 0; }
  .stats-grid { gap: 9px; margin-bottom: 13px; }
  .stat-card { min-height: 105px; padding: 13px; border-radius: 12px; }
  .stat-top { font-size: 9px; }
  .stat-icon { width: 27px; height: 27px; }
  .stat-number { font-size: 25px; margin-top: 9px; }
  .stat-note { font-size: 9px; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 12px; }
  .panel-head { padding: 14px; }
  .panel-body { padding: 13px; }
  .visit-row { grid-template-columns: 45px minmax(0,1fr); gap: 8px; }
  .visit-row > .pill, .visit-row > .btn { grid-column: 2; justify-self: start; }
  .toolbar { gap: 7px; }
  .toolbar > .btn { width: 100%; }
  .visit-card { padding: 13px; }
  .visit-card-top { flex-direction: column; }
  .visit-card-bottom { align-items: flex-start; flex-direction: column; }
  .visit-actions { justify-content: flex-start; width: 100%; }
  .visit-actions .btn { flex: 1; }
  .modal { width: calc(100vw - 14px); max-height: calc(100svh - 16px); border-radius: 14px; }
  .modal-body { max-height: calc(100svh - 125px); padding: 15px; }
  .modal-head { padding: 15px; }
  .modal-foot { padding: 11px 15px; }
  .form-grid { grid-template-columns: 1fr; gap: 11px; }
  .field-full { grid-column: auto; }
  .mobile-nav { position: fixed; z-index: 8; inset: auto 0 0; display: flex; justify-content: space-around; padding: 7px 5px calc(7px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.97); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
  .mobile-nav .nav-item { display: grid; justify-items: center; align-content: center; gap: 5px; width: 25%; min-width: 48px; min-height: 64px; padding: 6px 2px; color: #405b48; border-radius: 9px; font-size: 12px; line-height: 1.25; }
  .mobile-nav .nav-item.active { color: var(--green); background: #eef8f2; box-shadow: none; }
  .mobile-nav .nav-icon { display: grid; place-items: center; width: 28px; height: 28px; opacity: 1; }
  .auth-card { padding: 27px 22px; border-radius: 18px; }
  .auth-card h1 { font-size: 25px; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

.quick-action { padding: 11px 0 14px; border-bottom: 1px solid #eff3f0; }
.quick-action:last-of-type { border-bottom: 0; }
.quick-action strong { color: var(--pine-dark); font-size: 12px; }
.quick-action p { margin: 5px 0 9px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.install-hint { margin-top: 14px; padding: 10px; border-radius: 9px; background: #f6f9f7; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: 15px; min-height: auto; accent-color: var(--green); }
.auth-retry { width: 100%; margin-top: 18px; }

.import-toolbar { justify-content: flex-end; margin: -4px 0 12px; }
.route-planner, .route-existing, .route-output { margin-bottom: 14px; }
.route-form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.route-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.route-result { scroll-margin-top: 20px; }
.route-plan-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.route-plan-row:last-child { border-bottom: 0; }
.route-plan-row small, .route-stop-list small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.route-stop-list { list-style: none; margin: 0; padding: 0; }
.route-stop-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.route-sequence { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--green-soft); color: var(--pine); font-weight: 800; flex: 0 0 auto; }
.route-disclaimer, .route-warning { line-height: 1.55; margin: 10px 0 16px; }
.route-warning { margin: 16px 0 0; }
.route-output { scroll-margin-top: 18px; }
.import-preview { max-height: 45vh; overflow: auto; margin: 14px 0; }
.import-summary { padding: 12px; background: var(--canvas); border-radius: 10px; }
.empty-copy { color: var(--muted); font-size: 13px; }
@media (max-width: 760px) {
  .route-form-grid { grid-template-columns: 1fr; }
  .route-actions { width: 100%; justify-content: stretch; }
  .route-actions .btn { flex: 1; }
  .mobile-nav .nav-item { width: 20%; }
  .import-toolbar { justify-content: stretch; }
  .import-toolbar .btn { flex: 1; }
}

/* Identidade v2 do RAR, após os estilos base para manter a prioridade. */
.sidebar { background: linear-gradient(180deg, #1b4d20 0%, #133a17 100%); }
.nav-item.active { box-shadow: inset 3px 0 0 var(--orange); }
.eyebrow { color: var(--orange-dark); }



/* Conta acessível no desktop e no celular. */
.account-button { border: 0; padding: 0; cursor: pointer; min-width: 46px; min-height: 46px; flex-shrink: 0; overflow: hidden; }
.account-button:focus-visible { outline: 3px solid var(--pine); outline-offset: 3px; }
.account-button img, .account-photo img { width: 100%; height: 100%; object-fit: cover; }
.account-summary { display: flex; align-items: center; gap: 16px; overflow-wrap: anywhere; margin-bottom: 24px; }
.account-summary p { margin: 6px 0; }
.account-photo { width: 80px; height: 80px; flex-shrink: 0; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--mint); color: var(--pine); font-size: 26px; font-weight: 800; }
#account-photo-form input { width: 100%; min-width: 0; }
#account-logout { width: 100%; min-height: 46px; }
