:root {
  --sun: #FFCE3A;
  --sun-deep: #F2A900;
  --sky: #1F8FD8;
  --sky-deep: #1673B3;
  --sky-soft: #E5F3FD;
  --sun-ink: #7A5500;
  --sun-soft: #FFF4CC;
  --sun-softer: #FFFAE8;
  --bg: #FFFCF2;
  --card: #FFFFFF;
  --ink: #2A2722;
  --ink-2: #5F5A50;
  --ink-3: #8D877B;
  --line: #EFE9DA;
  --line-2: #E4DCC6;
  --blue: #2F7DD1;
  --blue-soft: #E6F0FB;
  --green: #2E9B5F;
  --green-soft: #E3F5EA;
  --violet: #7A56C9;
  --violet-soft: #EFE9FB;
  --red: #C8453A;
  --red-soft: #FCE9E7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 45, 0, .05), 0 4px 14px rgba(60, 45, 0, .06);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Nunito', 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 800; }
h3 { font-size: 15px; font-weight: 700; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex-shrink: 0;
  background: #fff; border-right: 1px solid var(--line);
  padding: 20px 14px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 22px;
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.view { padding: 28px 32px 48px; max-width: 1180px; width: 100%; margin: 0 auto; }
.topbar { display: none; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 0 6px; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
  background: var(--sun) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='32' r='11' fill='%23fff'/%3E%3Cg stroke='%23fff' stroke-width='5' stroke-linecap='round'%3E%3Cpath d='M32 8v7M32 49v7M8 32h7M49 32h7M15 15l5 5M44 44l5 5M15 49l5-5M44 20l5-5'/%3E%3C/g%3E%3C/svg%3E") center/26px no-repeat;
  box-shadow: 0 2px 8px rgba(245, 183, 0, .35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--display); font-size: 19px; font-weight: 800; }
.brand-text small { font-size: 12px; color: var(--ink-2); font-weight: 500; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 500;
}
.nav a:hover { background: var(--sun-softer); color: var(--ink); }
.nav a.active { background: var(--sun-soft); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--sun); }
.nav a.active svg { color: var(--sun-deep); }
.nav svg, .tabbar svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav .count {
  margin-left: auto; background: var(--sun); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 99px; padding: 1px 7px;
}
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 0 6px; }
.demo-pill {
  font-size: 12px; font-weight: 600; color: var(--sun-ink); background: var(--sun-soft);
  border: 1px solid #F6E2A0; padding: 3px 10px; border-radius: 99px;
}
.link-btn { background: none; border: 0; padding: 0; color: var(--ink-3); font-size: 13px; cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--ink); }

.tabbar { display: none; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-2); background: #fff; color: var(--ink);
  padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 14px;
  cursor: pointer; text-decoration: none; white-space: nowrap; min-height: 40px;
}
.btn:hover { background: var(--sun-softer); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: linear-gradient(180deg, #FFD95C, #FFC21F); border-color: #F5B800; color: #4A3300; box-shadow: 0 2px 8px rgba(255, 190, 20, .35); }
.btn-primary:hover { background: linear-gradient(180deg, #FFE07A, #FFC838); }
.btn-dark { background: var(--sky); border-color: var(--sky); color: #fff; }
.btn-dark:hover { background: var(--sky-deep); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { color: var(--red); border-color: #F1CFCB; }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { padding: 5px 12px; min-height: 32px; font-size: 13px; border-radius: 999px; }
.btn-block { width: 100%; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 10px; }
.card-head a { font-size: 13px; font-weight: 600; color: var(--sky-deep); text-decoration: none; }
.card-head a:hover { text-decoration: underline; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3-1 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px 18px; text-decoration: none; display: block; }
.kpi:hover { border-color: var(--line-2); }
.kpi .label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.kpi .value { font-family: var(--display); font-size: 28px; font-weight: 800; margin-top: 4px; line-height: 1.1; }
.kpi .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.kpi.hero { background: linear-gradient(135deg, #FFE68A 0%, #FFCB33 100%); border-color: #FFD24D; }
.kpi.hero .label, .kpi.hero .sub { color: #5C4300; }

/* Hello banner */
.hello { background: radial-gradient(circle at 92% 10%, rgba(255,214,80,.45), transparent 45%), linear-gradient(135deg, #FFF6D6, #E9F5FD); border: 1px solid #F6E8B8; border-radius: 20px; padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.hello .date { color: var(--ink-2); margin-top: 2px; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px;
  border-top: 1px solid var(--line); text-decoration: none; color: inherit;
}
.row:first-child { border-top: 0; }
button.row { width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; cursor: pointer; }
.row.clickable { cursor: pointer; }
.row.clickable:hover, button.row:hover { background: var(--sun-softer); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-end { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.time-box {
  width: 58px; flex-shrink: 0; text-align: center; font-weight: 700; font-size: 13px;
  font-family: var(--display); color: var(--ink);
}
.time-box small { display: block; font-weight: 600; color: var(--ink-3); font-size: 11px; }
.empty { padding: 26px 18px; text-align: center; color: var(--ink-3); }

.avatar {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--sun-soft); color: var(--sun-ink); font-weight: 800; font-family: var(--display); font-size: 15px;
}
.avatar.com { background: var(--blue-soft); color: var(--blue); }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; border-radius: 16px; }

/* Chips / badges */
.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 99px; white-space: nowrap; line-height: 1.4;
}
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.plain::before { display: none; }
.st-scheduled { background: var(--blue-soft); color: var(--blue); }
.st-in_progress { background: var(--sun-soft); color: #A06F00; }
.st-done { background: var(--violet-soft); color: var(--violet); }
.st-paid { background: var(--green-soft); color: var(--green); }
.chip-freq { background: #F4F1EA; color: var(--ink-2); }
.chip-com { background: var(--blue-soft); color: var(--blue); }
.chip-warn { background: var(--red-soft); color: var(--red); }
.team-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }

/* Segmented / filter chips */
.seg { display: inline-flex; background: #F4F1EA; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 600;
  font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip {
  border: 1px solid var(--line-2); background: #fff; border-radius: 99px; padding: 6px 12px;
  font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.fchip.on { background: var(--sky); color: #fff; border-color: var(--sky); }

/* Search */
.search { position: relative; flex: 1; min-width: 200px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); }
.search input {
  width: 100%; padding: 10px 12px 10px 38px; border: 1px solid var(--line-2); border-radius: 10px;
  background: #fff; outline: none; min-height: 42px; font-size: 16px;
}
.search input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--sun); box-shadow: 0 0 0 3px rgba(245,183,0,.2); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------- Customer detail ---------- */
.backbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--sky-deep); text-decoration: none; font-weight: 600; font-size: 14px; padding: 6px 12px 6px 8px; border-radius: 999px; background: var(--sky-soft); }
.back:hover { background: #D5EBFB; }
.back svg { width: 18px; height: 18px; }
.cust-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cust-head .grow { flex: 1; min-width: 200px; }
.contact-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.contact-actions .btn { flex-direction: column; gap: 3px; padding: 10px 6px; font-size: 12.5px; min-height: 60px; border-radius: 14px; }
.contact-actions .btn svg { width: 20px; height: 20px; color: var(--sun-deep); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.note-box { background: var(--sun-softer); border: 1px dashed #F0D47A; border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.note-box strong { display: block; font-size: 13.5px; color: var(--sun-ink); margin-bottom: 4px; }
.stats-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: #FBF9F3; border-radius: 12px; padding: 10px 12px; }
.stat b { display: block; font-family: var(--display); font-size: 20px; }
.stat span { font-size: 12px; color: var(--ink-2); }

/* ---------- Week calendar ---------- */
.week-nav { display: flex; align-items: center; gap: 6px; }
.week-nav .label { font-weight: 700; font-family: var(--display); min-width: 150px; text-align: center; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff;
  display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
}
.icon-btn:hover { background: var(--sun-softer); }
.icon-btn svg { width: 18px; height: 18px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day-col { background: #fff; border: 1px solid var(--line); border-radius: 12px; min-height: 260px; display: flex; flex-direction: column; overflow: hidden; }
.day-col.today { border-color: var(--sun); box-shadow: 0 0 0 2px rgba(245,183,0,.25); }
.day-head { padding: 8px 10px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.day-head b { font-family: var(--display); font-size: 14px; }
.day-head span { font-size: 12px; color: var(--ink-3); }
.day-col.today .day-head { background: var(--sun-soft); }
.day-body { padding: 6px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.day-total { padding: 6px 10px; font-size: 12px; color: var(--ink-2); border-top: 1px solid var(--line); background: #FCFBF7; }
.jcard {
  text-align: left; border: 0; border-left: 3px solid var(--blue); background: var(--blue-soft);
  border-radius: 8px; padding: 6px 8px; cursor: pointer; font-size: 12.5px; line-height: 1.3; width: 100%;
}
.jcard:hover { filter: brightness(.97); }
.jcard b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jcard span { color: var(--ink-2); font-size: 11.5px; }
.jcard.s-in_progress { background: var(--sun-soft); border-color: var(--sun); }
.jcard.s-done { background: var(--violet-soft); border-color: var(--violet); }
.jcard.s-paid { background: var(--green-soft); border-color: var(--green); }
.add-in-day { border: 1px dashed var(--line-2); background: transparent; border-radius: 8px; padding: 4px; color: var(--ink-3); cursor: pointer; font-size: 12px; margin-top: auto; }
.add-in-day:hover { color: var(--ink); border-color: var(--sun); }

.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 12px; }

/* ---------- Route ---------- */
.day-picker { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.day-picker::-webkit-scrollbar { display: none; }
.dp {
  flex-shrink: 0; border: 1px solid var(--line-2); background: #fff; border-radius: 12px; padding: 8px 12px;
  text-align: center; cursor: pointer; min-width: 64px;
}
.dp b { display: block; font-family: var(--display); font-size: 17px; }
.dp span { font-size: 11.5px; color: var(--ink-2); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.dp small { display: block; font-size: 11px; color: var(--ink-3); }
.dp.on { background: var(--sky); border-color: var(--sky); color: #fff; }
.dp.on span, .dp.on small { color: #DCEEFB; }
.map-wrap { position: relative; }
#map { height: 460px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 0; }
.route-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.route-stats .stat b { font-size: 22px; }
.savings { background: var(--green-soft); color: #1F6B42; border-radius: 12px; padding: 10px 14px; font-size: 14px; font-weight: 500; }
.stop-num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--sun); color: #2A2000; display: grid; place-items: center;
  font-weight: 800; font-size: 13px; flex-shrink: 0; font-family: var(--display);
}
.stop-num.hq { background: var(--sky); color: #fff; font-size: 11px; }
.stop-num.eve { background: #3B3F6B; color: #fff; }
.leg { font-size: 12px; color: var(--ink-3); padding: 2px 18px 2px 58px; }
.pin {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--sun);
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); display: grid; place-items: center;
}
.pin span { transform: rotate(45deg); font-weight: 800; font-size: 13px; color: #2A2000; font-family: var(--display); }
.pin.hq { background: var(--sky); }
.pin.hq span { color: #fff; font-size: 11px; }
.pin.eve { background: #3B3F6B; }
.pin.eve span { color: #fff; }
.leaflet-div-icon { background: transparent; border: 0; }

/* ---------- Reminders ---------- */
.reminder-row .row-title { white-space: normal; }
.reminder-row .when { font-size: 12px; color: var(--ink-3); }
.sent-tag { font-size: 12px; font-weight: 600; color: var(--green); white-space: nowrap; }
.template textarea { min-height: 110px; }
.placeholders { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.placeholders code { background: #F4F1EA; border-radius: 6px; padding: 2px 6px; font-size: 12px; cursor: pointer; }
.phone-preview {
  background: #F2F2F7; border-radius: 22px; padding: 16px 14px 18px; max-width: 340px; margin: 0 auto;
  border: 1px solid #E2E2EA;
}
.phone-preview .from { text-align: center; font-size: 12px; color: #6E6E73; margin-bottom: 10px; }
.bubble {
  background: #E9E9EB; color: #111; border-radius: 18px; padding: 10px 14px; font-size: 15px; line-height: 1.35;
  max-width: 88%; white-space: pre-wrap; overflow-wrap: anywhere;
}
.email-preview { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.email-preview .eh { background: #FBF9F3; padding: 10px 14px; font-size: 13px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.email-preview .eh div { overflow-wrap: anywhere; }
.email-preview .eb { padding: 0; }
.email-banner { background: var(--sun); padding: 14px; text-align: center; font-family: var(--display); font-weight: 800; color: #2A2000; }
.email-body { padding: 16px; white-space: pre-wrap; font-size: 14.5px; overflow-wrap: anywhere; }
.email-foot { padding: 10px 16px 16px; font-size: 12px; color: var(--ink-3); }
.sim-note { font-size: 12.5px; color: var(--ink-3); text-align: center; margin-top: 10px; }

/* ---------- Forms / modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(30, 25, 10, .45); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .15s ease;
}
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 560px; max-height: calc(100vh - 40px);
  overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: pop .18s ease;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 11px; background: #fff; outline: none;
  width: 100%; min-height: 42px; font-size: 16px; min-width: 0;
}
.field textarea { resize: vertical; min-height: 80px; }
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 16px; }
.stepper button {
  border: 1px solid var(--line-2); background: #fff; border-radius: 10px; padding: 8px 4px; font-size: 12.5px;
  font-weight: 600; cursor: pointer; color: var(--ink-3);
}
.stepper button.past { color: var(--ink-2); background: #FBF9F3; }
.stepper button.cur { color: var(--ink); border-color: var(--sun); background: var(--sun-soft); box-shadow: 0 0 0 2px rgba(245,183,0,.2); }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--sky-deep); color: #fff; padding: 11px 18px; border-radius: 999px; font-weight: 500; font-size: 14px;
  transition: all .2s ease; z-index: 1100; max-width: calc(100vw - 32px); text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid-3-1 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .week { grid-template-columns: 1fr; }
  .day-col { min-height: 0; }
  .day-col.empty-day .day-body { display: none; }
  .add-in-day { margin-top: 0; }
}
@media (max-width: 760px) {
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; padding: 10px 16px;
    padding-top: max(10px, env(safe-area-inset-top));
    background: rgba(255,253,246,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 500; border-bottom: 1px solid var(--line);
  }
  .brand { padding: 0; }
  .brand-logo { width: 34px; height: 34px; background-size: 22px; }
  .brand-text strong { font-size: 17px; }
  .view { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  h1 { font-size: 23px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 600;
    background: rgba(255,255,255,.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none;
    font-size: 11px; font-weight: 600; color: var(--ink-3); padding: 4px 0; border-radius: 10px; position: relative;
  }
  .tabbar a.active { color: var(--ink); }
  .tabbar a.active svg { color: var(--sun-deep); }
  .tabbar .count {
    position: absolute; top: 0; left: 50%; margin-left: 6px; background: var(--sun); color: #2A2000;
    font-size: 10px; font-weight: 800; border-radius: 99px; padding: 0 5px; line-height: 16px;
  }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .kpis { gap: 10px; }
  .kpi { padding: 13px 14px; }
  .kpi .value { font-size: 24px; }
  .card-pad { padding: 15px; }
  .row { padding: 11px 14px; gap: 10px; }
  .card-head { padding: 14px 14px 8px; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .form-grid { grid-template-columns: 1fr; }
  #map { height: 340px; }
  .week-nav .label { min-width: 0; flex: 1; font-size: 14px; }
  .week-nav { flex: 1; }
  .toolbar .seg { order: -1; }
  .hide-sm { display: none !important; }
  .kv { grid-template-columns: 92px 1fr; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .leg { padding-left: 52px; }
}
@media (max-width: 400px) {
  .contact-actions .btn { font-size: 11.5px; }
  .kpi .value { font-size: 22px; }
  .route-stats .stat b { font-size: 19px; }
}
