:root {
    --primary: #0B7A55;
    --success: #0B7A55;
    --deep: #064635;
    --teal: #0B7A55;
    --gold: #F5B700;
    --danger: #D92D20;
    --ink: #172033;
    --muted: #667085;
    --soft: #F4FAF6;
    --border: #D7EADF;
    --warning-bg: #fff7df;
    --warning-ink: #6d4c00;
}

body {
    background: var(--soft);
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
}

img,
svg {
    max-width: 100%;
}

.bg-primary,
.btn-primary,
.text-bg-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn-primary:hover,
.btn-success:hover {
    background-color: var(--deep) !important;
    border-color: var(--deep) !important;
}

.btn-success,
.text-bg-success {
    background-color: var(--success) !important;
    border-color: var(--success) !important;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
}

.navbar {
    background: linear-gradient(90deg, var(--deep), var(--primary)) !important;
}

.navbar .nav-link {
    font-weight: 600;
}

.navbar .container,
.navbar-brand {
    min-width: 0;
}

.navbar-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-seal {
    width: 54px;
    height: 54px;
    border-radius: 0;
    background: transparent;
    padding: 0;
    object-fit: contain;
}

.hero-section {
    min-height: calc(100vh - 72px);
    background:
        linear-gradient(135deg, rgba(7, 84, 63, 0.94), rgba(8, 127, 91, 0.88)),
        radial-gradient(circle at 75% 20%, rgba(242, 183, 5, 0.35), transparent 30%);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 48px 0 36px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: center;
}

.hero-copy h1 {
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.02;
}

.hero-seal {
    width: min(340px, 78vw);
    height: 150px;
    border-radius: 0;
    background: transparent;
    padding: 0;
    object-fit: contain;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.hero-text {
    max-width: 620px;
    color: rgba(255, 255, 255, 0.88);
}

.hero-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.nearest-stop-card {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.nearest-stop-card strong {
    font-size: 1.05rem;
}

.nearest-stop-card span,
.nearest-stop-card a:not(.btn) {
    color: rgba(255, 255, 255, 0.88);
}

.hero-map-panel {
    min-height: 420px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.16);
    box-shadow: 0 24px 60px rgba(3, 46, 34, 0.32);
    overflow: hidden;
}

.mini-map {
    width: 100%;
    height: 420px;
}

.fast-preview {
    position: relative;
    display: grid;
    align-content: end;
    min-height: 420px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08)),
        linear-gradient(0deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: auto, 54px 54px, 54px 54px;
}

.preview-map-grid {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.preview-route-line {
    position: absolute;
    left: 8%;
    right: 8%;
    top: 45%;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gold), #fff, var(--success));
    transform: rotate(-13deg);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.preview-bus-dot,
.preview-stop {
    position: absolute;
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.preview-bus-dot {
    display: grid;
    place-items: center;
    width: 68px;
    height: 44px;
    border: 3px solid #fff;
    background: var(--gold);
    color: #2d2300;
    font-size: 0.82rem;
    font-weight: 1000;
}

.preview-bus-dot.one {
    left: 20%;
    top: 49%;
}

.preview-bus-dot.two {
    right: 20%;
    top: 31%;
    background: #fff;
    color: var(--deep);
}

.preview-stop {
    width: 18px;
    height: 18px;
    border: 3px solid #fff;
    background: var(--success);
}

.preview-stop.a { left: 17%; top: 38%; }
.preview-stop.b { left: 48%; top: 45%; }
.preview-stop.c { right: 17%; top: 55%; }

.preview-copy {
    position: relative;
    z-index: 1;
    padding: 28px;
    color: #fff;
    background: linear-gradient(0deg, rgba(6, 70, 53, 0.9), rgba(6, 70, 53, 0));
}

.preview-copy h2 {
    max-width: 440px;
    font-size: 1.55rem;
    font-weight: 900;
    margin-bottom: 14px;
}

.section-pad {
    padding: 64px 0;
}

.compact-section {
    padding: 38px 0;
}

.page-header {
    background: #fff;
    padding: 56px 0 36px;
    border-bottom: 1px solid var(--border);
}

.page-seal,
.footer-seal {
    width: 86px;
    height: 86px;
    border-radius: 0;
    background: transparent;
    padding: 0;
    object-fit: contain;
    flex: 0 0 auto;
}

.footer-seal {
    width: 76px;
    height: 76px;
}

.dedication-text {
    color: #fff7cf;
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 14px;
}

.project-note {
    max-width: 660px;
    border-left: 4px solid var(--gold);
    background: rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.94);
    font-weight: 650;
    padding: 12px 14px;
}

.hero-service-status,
.page-service-status,
.map-service-status {
    display: grid;
    gap: 2px;
    border-radius: 8px;
    padding: 12px 14px;
    font-weight: 800;
}

.hero-service-status {
    max-width: 520px;
    margin-bottom: 14px;
}

.hero-service-status span,
.page-service-status span,
.map-service-status span {
    font-size: 0.9rem;
    font-weight: 700;
}

.hero-service-status.is-live,
.page-service-status.is-live,
.map-service-status.is-live {
    background: #EAF7F0;
    color: var(--deep);
    border: 1px solid #8bd8ae;
}

.hero-service-status.is-closed,
.page-service-status.is-closed,
.map-service-status.is-closed {
    background: var(--warning-bg);
    color: var(--warning-ink);
    border: 1px solid #f2d789;
}

.contact-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border: 1px solid var(--border);
    border-left: 6px solid var(--success);
    border-radius: 8px;
    padding: 24px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(7, 84, 63, 0.07);
}

.contact-band h2 {
    font-weight: 800;
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.footer {
    background: linear-gradient(90deg, var(--deep), var(--primary));
}

.service-advisory {
    position: sticky;
    top: 56px;
    z-index: 1075;
    background: var(--warning-bg);
    border-bottom: 1px solid #f2d789;
    color: var(--warning-ink);
    padding: 10px 0;
}

.service-advisory strong {
    margin-right: 6px;
}

.advisory-rotator-body {
    position: relative;
    min-height: 1.6rem;
    flex: 1 1 auto;
}

.advisory-slide {
    display: none;
    align-items: center;
    gap: 6px;
}

.advisory-slide.is-active {
    display: flex;
    animation: advisoryFade 0.24s ease;
}

.advisory-route-code {
    border-radius: 999px;
    background: rgba(109, 76, 0, 0.12);
    font-size: 0.76rem;
    font-weight: 900;
    padding: 2px 8px;
}

.admin-shortcut {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 1080;
    border-radius: 999px;
    background: var(--deep);
    color: #fff;
    box-shadow: 0 12px 30px rgba(6, 70, 53, 0.28);
    font-weight: 900;
    padding: 11px 16px;
    text-decoration: none;
}

.admin-shortcut:hover {
    color: #fff;
    background: var(--primary);
}

@keyframes advisoryFade {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.route-advisory-banner {
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 800;
}

.route-advisory-success {
    background: #EAF7F0;
    color: var(--deep);
    border: 1px solid #9bdcba;
}

.route-advisory-warning,
.route-advisory-info {
    background: var(--warning-bg);
    color: var(--warning-ink);
    border: 1px solid #f2d789;
}

.route-advisory-danger {
    background: #fff1f0;
    color: #8a1f11;
    border: 1px solid #ffb3aa;
}

.route-advisory-secondary {
    background: #f2f4f7;
    color: #475467;
    border: 1px solid #d0d5dd;
}

.direction-guide {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.direction-guide div {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--soft);
    padding: 10px;
}

.direction-guide span {
    display: block;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.direction-guide strong {
    display: block;
    line-height: 1.25;
}

.service-hours-card,
.service-hours-pill,
.service-hours-inline {
    border: 1px solid #f0d079;
    background: var(--warning-bg);
    color: var(--warning-ink);
    border-radius: 8px;
    font-weight: 800;
}

.service-hours-card {
    padding: 12px 14px;
}

.service-hours-card strong,
.service-hours-card span {
    display: block;
}

.service-hours-card span {
    font-size: 0.95rem;
}

.service-hours-pill,
.service-hours-inline {
    display: inline-flex;
    padding: 6px 10px;
    font-size: 0.84rem;
}

.page-header.compact {
    padding: 36px 0 24px;
}

.page-header h1,
.section-heading h2 {
    font-weight: 800;
}

.eyebrow {
    color: var(--success);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.feature-card,
.route-card,
.route-detail,
.driver-panel,
.assigned-driver-card,
.driver-stop-capture,
.admin-form,
.admin-card,
.stat-box,
.admin-table {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(7, 84, 63, 0.07);
}

.feature-card,
.route-card,
.route-detail,
.driver-panel,
.assigned-driver-card,
.driver-stop-capture,
.admin-form,
.admin-card,
.stat-box {
    padding: 22px;
}

.feature-card h2,
.route-card h3,
.route-detail h2 {
    font-size: 1.2rem;
    font-weight: 800;
}

.commuter-onboarding {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 22px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff, #eefaf4);
    padding: 24px;
}

.onboarding-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.onboarding-steps div {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: 14px;
}

.onboarding-steps span {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
    margin-bottom: 10px;
}

.onboarding-steps strong {
    display: block;
    color: var(--ink);
    font-weight: 900;
}

.onboarding-steps p {
    color: var(--muted);
    margin: 5px 0 0;
    font-weight: 700;
}

.assigned-driver-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.assigned-driver-card h2,
.driver-stop-capture h2 {
    font-size: 1.25rem;
    font-weight: 900;
    margin-bottom: 4px;
}

.driver-stop-list {
    display: grid;
    gap: 10px;
}

.driver-trip-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.driver-stop-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--soft);
    padding: 12px;
}

.coord-badge {
    display: inline-flex;
    margin-left: 6px;
    border-radius: 999px;
    background: #EAF7F0;
    color: var(--deep);
    font-size: 0.72rem;
    font-weight: 900;
    padding: 2px 8px;
}

.hero-search {
    max-width: 680px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.14);
    padding: 14px;
}

.hero-search .form-label {
    color: #fff;
    font-weight: 800;
}

.setup-checklist {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.setup-checklist a {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--soft);
    color: var(--ink);
    font-weight: 800;
    padding: 12px;
    text-decoration: none;
}

.setup-checklist span {
    border-radius: 999px;
    background: var(--success);
    color: #fff;
    font-size: 0.72rem;
    padding: 3px 8px;
}

.bottom-sheet-handle {
    display: none;
}

.route-directory {
    display: grid;
    gap: 22px;
}

.feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    margin-bottom: 16px;
}

.route-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
    flex: 0 0 18px;
}

.route-code {
    color: var(--primary);
    font-weight: 900;
}

.benefit-grid,
.future-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.benefit-grid div,
.future-list span {
    background: var(--soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    font-weight: 700;
}

.narrow {
    max-width: 860px;
}

.map-page {
    height: calc(100vh - 56px);
    display: grid;
    grid-template-columns: 440px minmax(0, 1fr);
}

.map-sidebar {
    background: #fff;
    padding: 22px;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    scrollbar-width: thin;
}

.selected-route-empty,
.selected-route-card,
.selected-bus-empty,
.selected-bus-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--soft);
    padding: 14px;
}

.selected-route-card,
.selected-bus-card {
    border-left: 6px solid var(--primary);
    background: #fff;
}

.selected-bus-card h2 {
    font-size: 1.2rem;
    font-weight: 900;
    margin: 0;
}

.where-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.where-grid div {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--soft);
    padding: 10px;
}

.where-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.where-grid strong {
    display: block;
    color: var(--ink);
    line-height: 1.25;
}

.live-control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.live-control-grid .btn {
    min-height: 46px;
    font-weight: 800;
}

.route-stop-scroll {
    max-height: 390px;
    overflow-y: auto;
    display: grid;
    gap: 14px;
}

.route-stop-scroll ol,
.stop-card ol {
    margin: 0;
    padding-left: 0;
    color: var(--ink);
    list-style: none;
}

.stop-card ol {
    counter-reset: stop-counter;
}

.stop-card li {
    counter-increment: stop-counter;
}

.stop-card li::before {
    content: counter(stop-counter) ". ";
    color: var(--muted);
    font-weight: 800;
}

.route-key-stop-grid {
    columns: 2;
    column-gap: 34px;
}

.route-key-stop-grid li {
    break-inside: avoid;
    margin-bottom: 8px;
}

.map-provider-note {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 8px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.stop-editor-map {
    width: 100%;
    height: 360px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.favorite-route {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--primary);
    font-weight: 800;
    padding: 8px 10px;
}

.service-status-label {
    display: inline-flex;
    border-radius: 999px;
    background: #EAF7F0;
    color: var(--deep);
    font-size: 0.78rem;
    font-weight: 900;
    padding: 4px 9px;
}

.capacity-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #fff;
    font-size: 0.76rem;
    font-weight: 900;
    padding: 4px 9px;
    white-space: nowrap;
}

.capacity-available,
.capacity-moderate { background: var(--success); }
.capacity-almost-full { background: var(--gold); color: #2f2400; }
.capacity-full { background: var(--danger); }
.capacity-offline,
.capacity-maintenance,
.capacity-no-recent-update { background: #667085; }

.capacity-meter {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e4ece8;
    overflow: hidden;
}

.capacity-meter div {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--success), var(--gold), var(--gold), var(--danger));
}

.capacity-public {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fffb;
    padding: 10px;
}

.capacity-route-card {
    height: 100%;
    border: 1px solid var(--border);
    border-left: 6px solid var(--success);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(7, 84, 63, 0.07);
    padding: 16px;
}

.hero-media-stack {
    display: grid;
    gap: 14px;
}

.intro-video-panel {
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: 0 18px 44px rgba(3, 46, 34, 0.26);
    overflow: hidden;
}

.intro-video-panel[data-size="small"] {
    max-width: 420px;
    justify-self: end;
}

.intro-video-panel[data-size="large"] {
    max-width: 100%;
}

.intro-video-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(6, 70, 53, 0.92);
    color: #fff;
    font-weight: 900;
}

.intro-video-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.intro-video-controls button {
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 900;
    padding: 4px 9px;
}

.intro-video {
    display: block;
    width: 100%;
    max-height: 340px;
    background: #000;
    object-fit: contain;
}

.capacity-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.capacity-summary-grid div {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--soft);
    padding: 10px;
}

.capacity-summary-grid span,
.capacity-big-count span {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.capacity-summary-grid strong {
    display: block;
    color: var(--ink);
    font-weight: 900;
    margin-top: 3px;
}

.capacity-actions,
.driver-capacity-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.capacity-token-box {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--soft);
    padding: 12px;
}

.driver-capacity-page {
    min-height: calc(100vh - 72px);
    display: grid;
    place-items: start center;
    padding: 18px 12px 96px;
    background: var(--soft);
}

.driver-capacity-card {
    width: min(100%, 560px);
    border: 1px solid var(--border);
    border-left: 6px solid var(--success);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 40px rgba(7, 84, 63, 0.12);
    padding: 18px;
}

.driver-capacity-card h1 {
    font-size: 1.8rem;
    font-weight: 900;
    margin: 0;
}

.capacity-big-count {
    border-radius: 8px;
    border: 1px solid #9ce7bd;
    background: #EAF7F0;
    padding: 18px;
}

.capacity-big-count strong {
    display: block;
    color: var(--ink);
    font-size: clamp(2.4rem, 12vw, 4rem);
    line-height: 1;
    font-weight: 1000;
    margin-top: 6px;
}

.capacity-big-count small {
    display: block;
    color: var(--deep);
    font-weight: 900;
    margin-top: 8px;
}

.loading-skeleton {
    background: linear-gradient(90deg, #eef7f1, #ffffff, #eef7f1);
    background-size: 220% 100%;
    animation: skeleton 1.2s ease-in-out infinite;
    min-height: 84px;
    border-radius: 8px;
}

@keyframes skeleton {
    from { background-position: 220% 0; }
    to { background-position: -220% 0; }
}

.route-stop-scroll li,
.stop-card li {
    margin-bottom: 4px;
}

.tracker-stop-list li {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 10px;
}

.tracker-stop-list li b {
    color: var(--muted);
    margin-right: 4px;
}

.tracker-stop-list li span {
    float: right;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 800;
}

.tracker-stop-list .current-stop {
    background: #EAF7F0;
    border-color: #81d8aa;
    box-shadow: inset 4px 0 0 var(--success);
    font-weight: 800;
}

.tracker-stop-list .current-stop span {
    background: var(--success);
    color: #fff;
}

.tracker-stop-list .next-stop {
    background: var(--warning-bg);
    border-color: #f3d77c;
}

.tracker-stop-list .next-stop span {
    background: var(--gold);
    color: #2c2300;
}

.tracker-stop-list .passed-stop {
    background: #eef4f1;
    color: #667085;
}

.tracker-stop-list .passed-stop span {
    background: #d5ded9;
    color: #4a5565;
}

.stop-card {
    background: var(--soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
    height: 100%;
}

.stop-card h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--deep);
}

.stop-card h3 span {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.stop-label {
    margin-bottom: 6px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.map-sidebar h1 {
    font-size: 1.55rem;
    font-weight: 800;
}

.bus-map {
    min-height: 520px;
    width: 100%;
    background: #eaf5ef;
}

.bus-list {
    display: grid;
    gap: 12px;
}

.bus-card {
    border: 1px solid var(--border);
    border-left: 6px solid var(--primary);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bus-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(7, 84, 63, 0.11);
}

.bus-card.is-selected {
    background: #EAF7F0;
    box-shadow: 0 10px 24px rgba(17, 148, 95, 0.18);
}

.unavailable-card,
.status-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(7, 84, 63, 0.06);
}

.status-panel h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.status-panel h3 {
    font-size: 1rem;
    font-weight: 800;
}

.status-list {
    display: grid;
    gap: 10px;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    background: var(--soft);
}

.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.service-alert {
    border-radius: 8px;
}

.clean-list {
    margin: 0;
    padding-left: 1.25rem;
}

.clean-list.numbered {
    display: grid;
    gap: 10px;
}

.advisory-list {
    display: grid;
    gap: 12px;
}

.advisory-card {
    border: 1px solid var(--border);
    border-left: 6px solid var(--primary);
    border-radius: 8px;
    background: #fff;
    padding: 16px;
}

.advisory-card h3 {
    margin-bottom: 6px;
    font-size: 1.15rem;
    font-weight: 900;
}

.advisory-card-warning {
    border-left-color: var(--gold);
}

.advisory-card-danger {
    border-left-color: var(--danger);
}

.advisory-card-success {
    border-left-color: var(--success);
}

.auth-page {
    min-height: calc(100vh - 220px);
    display: grid;
    place-items: center;
    padding: 56px 16px;
}

.auth-card,
.route-search {
    width: min(100%, 460px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 12px 36px rgba(7, 84, 63, 0.1);
    padding: 24px;
}

.auth-card h1 {
    font-weight: 800;
    margin-bottom: 18px;
}

.route-search {
    width: 100%;
}

.chat-support {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1080;
    display: grid;
    justify-items: end;
    gap: 10px;
}

.chat-toggle {
    border: 0;
    border-radius: 999px;
    background: var(--success);
    color: #fff;
    box-shadow: 0 12px 30px rgba(6, 70, 53, 0.28);
    font-weight: 800;
    padding: 12px 18px;
}

.chat-panel {
    width: min(320px, calc(100vw - 36px));
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 42px rgba(6, 70, 53, 0.25);
    padding: 16px;
}

.chat-panel strong {
    display: block;
    color: var(--deep);
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.chat-panel p {
    color: var(--muted);
    margin-bottom: 12px;
}

.chat-panel .form-label {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--deep);
    margin-bottom: 3px;
}

.alert-opt-in {
    position: fixed;
    right: 18px;
    bottom: 76px;
    z-index: 1079;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    background: var(--gold);
    color: #2f2400;
    box-shadow: 0 12px 30px rgba(6, 70, 53, 0.22);
    font-weight: 900;
    padding: 10px 15px;
}

.alert-opt-in[hidden] {
    display: none;
}

.chat-status {
    font-size: 0.88rem;
    font-weight: 700;
    margin-top: 10px;
}

.bus-card h3 {
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
}

.bus-meta {
    color: var(--muted);
    font-size: 0.92rem;
}

.live-now {
    background: #EAF7F0;
    border: 1px solid #b8e8cd;
    border-radius: 8px;
    padding: 10px;
}

.live-now span,
.eta-box span {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.live-now strong,
.eta-box strong {
    display: block;
    color: var(--ink);
    line-height: 1.25;
}

.eta-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 118px;
    gap: 8px;
}

.eta-box div {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px;
    background: var(--soft);
}

.gps-status {
    padding: 16px;
    border-radius: 8px;
    background: var(--soft);
    border: 1px solid var(--border);
    font-weight: 700;
}

.stat-box span {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.stat-box strong {
    display: block;
    font-size: 1.8rem;
}

.admin-table {
    padding: 8px;
}

.form-control,
.form-select,
.btn {
    border-radius: 8px;
}

.form-control,
.form-select {
    min-height: 46px;
}

.route-card,
.route-detail,
.admin-card,
.feature-card,
.driver-panel,
.assigned-driver-card,
.driver-stop-capture {
    overflow-wrap: anywhere;
}

.btn-lg {
    min-height: 48px;
}

.leaflet-popup-content strong {
    color: var(--ink);
}

.custom-bus-marker {
    background: transparent;
    border: 0;
}

.bus-marker-shell {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--bus-color) 18%, transparent);
}

.bus-marker-shell::before {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    border: 3px solid #fff;
    background: var(--bus-color);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.bus-marker-shell.is-selected {
    animation: busPulse 1.5s ease-in-out infinite;
}

.bus-marker-body {
    position: relative;
    z-index: 1;
    width: 30px;
    height: 22px;
    border-radius: 6px;
    background: #fff;
    color: var(--bus-color);
    display: grid;
    place-items: center;
    font-size: 0.58rem;
    font-weight: 1000;
    line-height: 1;
}

.bus-marker-label {
    position: absolute;
    z-index: 2;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    font-size: 0.62rem;
    font-weight: 900;
    padding: 1px 6px;
    white-space: nowrap;
}

@keyframes busPulse {
    0%, 100% { filter: drop-shadow(0 0 0 rgba(245, 183, 0, 0)); }
    50% { filter: drop-shadow(0 0 12px rgba(245, 183, 0, 0.95)); }
}

.active-route-line {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.28));
}

.route-stop-marker,
.nearest-stop-marker,
.user-location-marker {
    background: transparent;
    border: 0;
}

.route-stop-marker span,
.nearest-stop-marker span {
    display: grid;
    place-items: center;
    height: 26px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
    font-size: 0.72rem;
    font-weight: 900;
    padding: 0 8px;
}

.route-stop-marker.is-passed span {
    background: #98a2b3;
}

.route-stop-marker.is-current span {
    background: var(--success);
    min-width: 48px;
    animation: stopPulse 1.4s ease-in-out infinite;
}

.route-stop-marker.is-next span,
.nearest-stop-marker span {
    background: var(--gold);
    color: #2c2300;
}

@keyframes stopPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.user-location-dot {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(20, 112, 245, 0.2);
    display: grid;
    place-items: center;
}

.user-location-dot::before {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(20, 112, 245, 0.25);
}

.user-location-dot span {
    width: 14px;
    height: 14px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #1470f5;
    box-shadow: 0 4px 12px rgba(20, 112, 245, 0.42);
}

@media (max-width: 991px) {
    .navbar-brand .brand-seal {
        width: 50px;
        height: 50px;
    }

    .navbar-collapse {
        padding-top: 12px;
    }

    .navbar .nav-link,
    .navbar .btn {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .hero-section {
        min-height: auto;
        padding: 38px 0 28px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions-grid {
        grid-template-columns: 1fr;
    }

    .map-page {
        height: auto;
        grid-template-columns: 1fr;
    }

    .map-sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .bus-map {
        height: 70vh;
        min-height: 460px;
    }

    .contact-band {
        align-items: flex-start;
        flex-direction: column;
    }

    .assigned-driver-card,
    .driver-stop-row {
        align-items: stretch;
        flex-direction: column;
    }

    .contact-actions {
        justify-content: flex-start;
    }

    .setup-checklist {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-table table,
    .table-responsive table {
        min-width: 720px;
    }
}

@media (max-width: 575px) {
    html {
        font-size: 15px;
    }

    body:has(.map-page) {
        overflow: hidden;
    }

    .section-pad {
        padding: 34px 0;
    }

    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .navbar {
        min-height: 62px;
    }

    .navbar-brand {
        max-width: calc(100vw - 86px);
        gap: 8px !important;
    }

    .navbar-brand span {
        max-width: 145px;
        font-size: 0.98rem;
    }

    .navbar-brand .brand-seal {
        width: 44px;
        height: 44px;
    }

    .navbar-toggler {
        width: 44px;
        height: 40px;
        padding: 0;
    }

    .navbar-nav {
        gap: 4px;
        padding: 8px 0;
    }

    .navbar .nav-link {
        border-radius: 8px;
        padding: 10px 12px;
    }

    .navbar .nav-link:active,
    .navbar .nav-link:hover {
        background: rgba(255, 255, 255, 0.12);
    }

    .hero-section {
        padding: 26px 0 24px;
    }

    .hero-grid {
        gap: 22px;
    }

    .hero-copy > .d-flex.align-items-center {
        align-items: flex-start !important;
        flex-direction: column;
        gap: 10px !important;
    }

    .hero-seal {
        width: min(240px, 82vw);
        height: 104px;
        box-shadow: none;
    }

    .hero-copy h1 {
        font-size: 2.35rem;
    }

    .hero-copy .lead {
        font-size: 1.08rem;
    }

    .project-note {
        font-size: 0.92rem;
        padding: 12px;
    }

    .hero-search {
        padding: 12px;
    }

    .hero-map-panel,
    .mini-map {
        min-height: 320px;
        height: 320px;
    }

    .intro-video-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .intro-video-panel[data-size="small"] {
        max-width: 100%;
        justify-self: stretch;
    }

    .intro-video {
        max-height: 260px;
    }

    .fast-preview {
        min-height: 320px;
    }

    .preview-copy {
        padding: 20px;
    }

    .preview-copy h2 {
        font-size: 1.2rem;
    }

    .preview-bus-dot {
        width: 58px;
        height: 38px;
    }

    .page-header,
    .page-header.compact {
        padding: 24px 0 18px;
    }

    .page-header .d-flex.align-items-center {
        align-items: flex-start !important;
        flex-direction: column;
    }

    .page-header h1 {
        font-size: 1.8rem;
        line-height: 1.12;
    }

    .page-header .lead {
        font-size: 1rem;
    }

    .page-seal,
    .footer-seal {
        width: 72px;
        height: 72px;
    }

    .contact-band,
    .feature-card,
    .route-card,
    .route-detail,
    .driver-panel,
    .assigned-driver-card,
    .driver-stop-capture,
    .admin-form,
    .admin-card,
    .stat-box,
    .stop-card,
    .status-panel,
    .unavailable-card,
    .auth-card,
    .route-search {
        padding: 16px;
    }

    .route-card h3,
    .route-detail h2,
    .admin-card h2,
    .contact-band h2,
    .section-heading h2 {
        font-size: 1.25rem;
        line-height: 1.2;
    }

    .contact-actions,
    .route-card .d-flex.flex-wrap,
    .route-detail .d-flex.flex-column.gap-2 {
        width: 100%;
    }

    .contact-actions .btn,
    .route-card .btn,
    .route-detail .btn,
    .admin-card .btn,
    .driver-panel .btn,
    .assigned-driver-card .btn {
        width: 100%;
    }

    .benefit-grid,
    .future-list {
        grid-template-columns: 1fr;
    }

    .map-page {
        position: relative;
        height: calc(100dvh - 62px);
        display: block;
        overflow: hidden;
    }

    .map-sidebar {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 700;
        max-height: 44dvh;
        padding: 9px 14px max(16px, env(safe-area-inset-bottom));
        border-top-left-radius: 18px;
        border-top-right-radius: 18px;
        border-right: 0;
        border-bottom: 0;
        box-shadow: 0 -16px 42px rgba(6, 70, 53, 0.22);
        transition: max-height 0.24s ease;
    }

    .map-sidebar.is-expanded {
        max-height: 84dvh;
    }

    .bottom-sheet-handle {
        display: block;
        width: 48px;
        height: 5px;
        border-radius: 999px;
        background: #cfd8d3;
        margin: 0 auto 10px;
    }

    .bus-map {
        height: 100%;
        min-height: 100%;
    }

    .leaflet-control-container .leaflet-top {
        top: 8px;
    }

    .leaflet-control-container .leaflet-left {
        left: 8px;
    }

    .route-key-stop-grid {
        columns: 1;
    }

    .where-grid,
    .live-control-grid,
    .direction-guide,
    .commuter-onboarding,
    .onboarding-steps,
    .driver-trip-actions,
    .capacity-actions,
    .driver-capacity-actions,
    .capacity-summary-grid,
    .setup-checklist {
        grid-template-columns: 1fr;
    }

    .map-sidebar h1 {
        font-size: 1.15rem;
        margin-bottom: 0;
    }

    .route-stop-scroll {
        max-height: 230px;
    }

    .map-service-status,
    .service-hours-card,
    .selected-route-empty,
    .selected-route-card,
    .selected-bus-empty,
    .selected-bus-card,
    .bus-card {
        padding: 11px;
    }

    .selected-bus-card h2 {
        font-size: 1.05rem;
    }

    .bus-card h3 {
        font-size: 0.95rem;
    }

    .bus-meta {
        font-size: 0.86rem;
    }

    .eta-box {
        grid-template-columns: 1fr;
    }

    .tracker-stop-list li {
        padding: 8px;
    }

    .tracker-stop-list li span {
        float: none;
        display: inline-flex;
        margin-left: 6px;
        vertical-align: middle;
    }

    .live-control-grid .btn,
    #demoToggle,
    #refreshMap {
        min-height: 44px;
        font-size: 0.92rem;
        padding-left: 8px;
        padding-right: 8px;
    }

    .form-control-lg,
    .form-select-lg,
    .btn-lg {
        min-height: 46px;
        font-size: 1rem;
    }

    .driver-stop-row .btn {
        width: 100%;
    }

    .setup-checklist a {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-table {
        padding: 0;
        border: 0;
        box-shadow: none;
        background: transparent;
    }

    .table-responsive {
        border: 1px solid var(--border);
        border-radius: 8px;
        background: #fff;
    }

    .footer {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)) !important;
    }

    .footer .container {
        align-items: flex-start !important;
    }

    .chat-support {
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
    }

    .alert-opt-in {
        right: 12px;
        bottom: calc(66px + env(safe-area-inset-bottom));
        max-width: calc(100vw - 24px);
        font-size: 0.86rem;
    }

    body:has(.map-page) .chat-support {
        display: none;
    }

    .chat-toggle {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .chat-panel {
        width: calc(100vw - 24px);
        max-height: 72dvh;
        overflow-y: auto;
    }

    .advisory-slide.is-active {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-shortcut {
        left: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    body:has(.map-page) .admin-shortcut {
        display: none;
    }
}
