:root {
    --navy: #0c2b57;
    --navy-2: #163e73;
    --bg: #f3f6f9;
    --card: #ffffff;
    --text: #17202a;
    --muted: #6d7885;
    --line: #dde4eb;
    --danger: #a12828;
    --success: #186a3b;
    --radius: 18px;
    --shadow: 0 10px 28px rgba(17, 38, 63, 0.08);
}

* { box-sizing: border-box; }

html {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

body {
    margin: 0;
    min-height: 100vh;
    padding-bottom: 82px;
}

a { color: inherit; text-decoration: none; }

.topbar {
    min-height: 72px;
    padding: max(10px, env(safe-area-inset-top)) 18px 10px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand img {
    display: block;
    width: 138px;
    max-height: 46px;
    object-fit: contain;
    object-position: left center;
}

.icon-button {
    border: 0;
    background: #edf2f7;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 22px;
}

.page {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 18px 16px 28px;
}

.auth-shell {
    min-height: calc(100vh - 140px);
    display: grid;
    align-items: center;
}

.card,
.hero-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
}

.hero-card {
    background: linear-gradient(145deg, var(--navy), var(--navy-2));
    color: #fff;
    margin-bottom: 16px;
}

.hero-card .muted { color: rgba(255,255,255,.78); }

h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(1.7rem, 7vw, 2.5rem); margin-bottom: 8px; }
h2 { font-size: 1.15rem; margin-bottom: 8px; }

.eyebrow {
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 800;
    opacity: .72;
    margin-bottom: 8px;
}

.muted {
    color: var(--muted);
    line-height: 1.45;
}

.stack {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 700;
    font-size: .94rem;
}

input, select {
    width: 100%;
    min-height: 50px;
    border: 1px solid #cfd8e1;
    background: #fff;
    border-radius: 12px;
    padding: 0 14px;
    font: inherit;
    font-size: 16px;
}

button,
.button-link {
    min-height: 50px;
    border-radius: 13px;
    border: 0;
    padding: 0 18px;
    font: inherit;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.primary {
    background: var(--navy);
    color: #fff;
}

.full { width: 100%; }

.stat-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 16px 0;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    display: grid;
    gap: 4px;
}

.stat-card span {
    font-size: 2rem;
    font-weight: 900;
    color: var(--navy);
}

.card-list,
.feature-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-head h1 { margin-bottom: 0; }

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

.chip {
    background: #edf3f8;
    color: var(--navy);
    padding: 7px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
}

.check-grid {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.check-card {
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.check-card input {
    width: 22px;
    min-height: 22px;
}

.compact-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.login-card { max-width: 520px; margin: 0 auto; }

.login-code {
    margin: 18px 0;
    padding: 18px;
    text-align: center;
    border-radius: 14px;
    background: #eef3f8;
    color: var(--navy);
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: .12em;
}

.messages {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.message {
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line);
}

.message.error { border-color: #efc3c3; color: var(--danger); }
.message.success { border-color: #b9dfca; color: var(--success); }

.bottom-nav {
    position: fixed;
    z-index: 30;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: rgba(255,255,255,.97);
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.bottom-nav a {
    min-height: 48px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: .74rem;
    font-weight: 800;
    color: var(--navy);
}

.sticky-action {
    position: sticky;
    bottom: 86px;
    box-shadow: 0 12px 26px rgba(12,43,87,.2);
}

@media (min-width: 720px) {
    body { padding-bottom: 30px; }
    .page { padding: 28px 24px 40px; }
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
    .check-grid { grid-template-columns: repeat(3, 1fr); }
    .bottom-nav {
        position: static;
        width: min(100% - 32px, 980px);
        margin: 0 auto 24px;
        border: 1px solid var(--line);
        border-radius: 18px;
    }
    .sticky-action { position: static; }
}


.secondary {
    background: #edf2f7;
    color: var(--navy);
    border: 1px solid var(--line);
}

.small-note {
    font-size: .82rem;
    margin: 14px 0 0;
}

.qr-wrap {
    display: grid;
    place-items: center;
    margin: 18px 0;
    padding: 16px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--line);
}

.qr-code {
    width: min(260px, 72vw);
    height: auto;
    image-rendering: pixelated;
}

.employee-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.employee-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.employee-actions form {
    flex: 1 1 140px;
}

.compact-button {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
}

.is-inactive {
    opacity: .68;
}

.status-badge {
    padding: 6px 9px;
    border-radius: 999px;
    background: #eceff3;
    color: #5c6772;
    font-size: .72rem;
    font-weight: 800;
}


.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-link {
    display: grid;
    place-items: center;
    text-decoration: none;
    color: var(--navy);
}

.settings-gap {
    margin-top: 14px;
}


.user-summary {
    min-width: 0;
    margin-left: auto;
    margin-right: 10px;
    text-align: right;
}

.user-summary-name {
    font-size: .9rem;
    font-weight: 900;
    color: var(--navy);
}

.user-summary-meta {
    max-width: 46vw;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: .7rem;
}

.identity-list {
    display: grid;
    gap: 8px;
    margin: 14px 0;
}

.identity-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,.10);
}

.identity-item span {
    color: rgba(255,255,255,.74);
    font-size: .8rem;
}

.identity-item strong {
    text-align: right;
    font-size: .84rem;
}

.pwa-install-button[hidden] {
    display: none;
}

.account-summary {
    margin-bottom: 14px;
}

@media (max-width: 520px) {
    .brand img {
        width: 92px;
    }

    .user-summary-meta {
        max-width: 38vw;
    }
}


.admin-lab-card {
    margin-bottom: 16px;
    border-style: dashed;
}

.warning-card {
    margin-bottom: 14px;
    border-color: #e5c07b;
    background: #fffaf0;
}

.test-row-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.test-appointment-card {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.test-appointment-card:first-child {
    border-top: 0;
}

.test-appointment-time {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--navy);
}

.test-appointment-main {
    display: grid;
    gap: 3px;
}

.test-appointment-main span {
    color: var(--muted);
    font-size: .84rem;
}


.danger {
    background: #fff0f0;
    color: var(--danger);
    border: 1px solid #efc3c3;
}


#enable-push-button,
#disable-push-button {
    margin-top: 12px;
}


[hidden] {
    display: none !important;
}

#test-local-notification-button {
    margin-top: 10px;
}


.quick-actions {
    margin: 16px 0;
}

.dispatch-day-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
}

.dispatch-day-nav .button-link:first-child {
    justify-self: stretch;
}

.dispatch-day-nav .button-link:last-child {
    justify-self: stretch;
}

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

.dispatch-route-card {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 5px 16px rgba(17, 38, 63, .05);
}

.dispatch-route-name {
    font-weight: 900;
    color: var(--navy);
    font-size: 1.05rem;
}

.dispatch-route-card select {
    min-height: 46px;
}

@media (max-width: 520px) {
    .dispatch-day-nav {
        grid-template-columns: 1fr 1fr;
    }

    .dispatch-day-nav strong {
        grid-column: 1 / -1;
        grid-row: 1;
        text-align: center;
    }

    .dispatch-day-nav .button-link:first-child {
        grid-column: 1;
        grid-row: 2;
    }

    .dispatch-day-nav .button-link:last-child {
        grid-column: 2;
        grid-row: 2;
    }

    .dispatch-route-card {
        grid-template-columns: 66px minmax(0, 1fr);
        padding: 10px 12px;
    }
}


.wave-heading {
    margin: 10px 0 2px;
    padding: 7px 2px;
    font-weight: 900;
    color: var(--navy);
    font-size: 1.05rem;
}

.summary-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.summary-card {
    box-shadow: none;
}

.summary-title {
    font-weight: 900;
    color: var(--navy);
}

.summary-number {
    font-size: 2rem;
    line-height: 1.05;
    font-weight: 900;
    margin: 4px 0;
}

.appointment-group {
    display: grid;
    grid-template-columns: 62px 1fr;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.appt-time {
    font-weight: 900;
    color: var(--navy);
    font-size: 1.05rem;
}

.appt-main {
    display: grid;
    gap: 5px;
}

.appt-main > span,
.shipment-list {
    font-size: .82rem;
    color: var(--muted);
}

.shipment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.shipment-list span {
    background: #edf3f8;
    border-radius: 999px;
    padding: 4px 8px;
}

.reassign-form {
    margin-top: 6px;
}

.reassign-form select {
    min-height: 42px;
}


.work-date-card {
    margin: 16px 0;
}

.work-date-form input {
    font-weight: 900;
    color: var(--navy);
}

.user-summary-date {
    margin-top: 2px;
    font-size: .68rem;
    font-weight: 800;
    color: var(--navy);
}

.route-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.route-postcodes {
    margin-top: 12px;
}

.postcode-row {
    align-items: flex-start;
}

.postcode-row .button-link {
    flex: 0 0 auto;
}

@media (max-width: 520px) {
    .postcode-row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .postcode-row .button-link {
        width: 100%;
        margin-top: 10px;
    }
}


.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 520px) {
    .two-col {
        grid-template-columns: 1fr;
    }
}


.recognition-warning {
    border-width: 2px;
}

.warning-box {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 193, 7, 0.14);
    font-size: 0.95rem;
}


.appointment-address-editor {
    margin-bottom: 4px;
}

.appointment-address-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    gap: 8px;
    align-items: baseline;
    flex-wrap: wrap;
}

.appointment-address-summary::-webkit-details-marker {
    display: none;
}

.appointment-address-summary strong {
    font-size: inherit;
}

.appointment-address-summary:hover strong {
    text-decoration: underline;
}

.edit-hint {
    font-size: 0.78rem;
    font-weight: 600;
    opacity: 0.58;
}

.appointment-edit-panel {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid rgba(20, 54, 99, 0.16);
    border-radius: 12px;
    background: rgba(20, 54, 99, 0.035);
}

.appointment-edit-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.45fr) minmax(0, 1fr);
    gap: 10px;
}

.appointment-edit-grid .wide {
    grid-column: 1 / -1;
}

@media (max-width: 640px) {
    .appointment-edit-grid {
        grid-template-columns: 1fr;
    }

    .appointment-edit-grid .wide {
        grid-column: auto;
    }
}


.morning-top-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.map-page-head {
  align-items: flex-start;
  gap: 14px;
}

.map-status-card {
  gap: 10px;
}

.map-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(20, 54, 99, 0.10);
}

.map-progress > span {
  display: block;
  width: 0;
  height: 100%;
  background: currentColor;
  opacity: 0.55;
  transition: width .2s ease;
}

.morning-map {
  height: min(68vh, 720px);
  min-height: 480px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(20, 54, 99, 0.13);
  background: #eef2f3;
}

.map-attribution-note {
  margin-top: 8px;
  font-size: .78rem;
}

.sps-tour-marker-wrap {
  background: transparent;
  border: 0;
}

.sps-tour-marker {
  min-width: 54px;
  height: 30px;
  padding: 0 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px 15px 15px 3px;
  background: #17365f;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 7px rgba(0,0,0,.32);
  font-weight: 800;
  font-size: .78rem;
  line-height: 1;
  white-space: nowrap;
  transform: rotate(-4deg);
}

.map-popup {
  min-width: 250px;
}

.map-popup-address {
  font-weight: 800;
  margin-bottom: 4px;
}

.map-popup-count {
  color: #617080;
  margin-bottom: 10px;
  font-size: .86rem;
}

.map-popup-appointment {
  padding: 9px 0;
  border-top: 1px solid rgba(20, 54, 99, .12);
}

.map-popup-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.map-popup-route {
  margin: 4px 0 7px;
  font-size: .86rem;
}

.map-manual-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(20, 54, 99, .10);
  font-size: .7rem;
  font-weight: 700;
}

.map-popup-form label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
}

.map-popup-form select {
  width: 100%;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .morning-top-actions {
    grid-template-columns: 1fr;
  }

  .morning-map {
    height: 68vh;
    min-height: 430px;
    border-radius: 12px;
  }

  .map-page-head {
    display: block;
  }

  .map-page-head .button-link {
    display: inline-block;
    margin-top: 8px;
  }
}

/* v0.12.1 map rendering guard */
.leaflet-container img.leaflet-tile {
    max-width: none !important;
    max-height: none !important;
}


/* v0.13 visual disposition map */

.sps-tour-marker-wrap {
    background: transparent !important;
    border: 0 !important;
    overflow: visible !important;
}

.sps-marker-shell {
    position: relative;
    width: 96px;
    height: 48px;
    display: grid;
    grid-template-columns: 22px 52px 22px;
    align-items: start;
    filter: drop-shadow(0 3px 4px rgba(0,0,0,.28));
}

.sps-tour-marker {
    height: 30px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tour-color);
    color: #fff;
    border-top: 2px solid #fff;
    border-bottom: 2px solid #fff;
    font-size: .78rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: .01em;
    white-space: nowrap;
}

.sps-marker-side {
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tour-color);
    color: #fff;
    border: 2px solid #fff;
    font-size: .7rem;
    font-weight: 900;
    line-height: 1;
}

.sps-marker-deadline {
    border-radius: 9px 0 0 9px;
    border-right-width: 1px;
}

.sps-marker-pieces {
    border-radius: 0 9px 9px 0;
    border-left-width: 1px;
}

.sps-marker-anchor {
    position: absolute;
    left: 42px;
    top: 29px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 15px solid var(--tour-color);
}

.sps-marker-anchor::after {
    content: "";
    position: absolute;
    left: -5px;
    top: -15px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 12px solid #fff;
    transform: translateY(-1px);
    z-index: -1;
}

.geo-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 800;
}

.geo-missing {
    background: rgba(166, 45, 45, .10);
    color: #9e2a2a;
    border: 1px solid rgba(166, 45, 45, .22);
}

.geo-manual {
    background: rgba(28, 104, 116, .10);
    color: #1c6874;
    border: 1px solid rgba(28, 104, 116, .22);
}

.unresolved-panel {
    padding: 14px;
}

.unresolved-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.unresolved-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid rgba(20, 54, 99, .10);
}

.unresolved-copy {
    display: grid;
    gap: 3px;
}

.unresolved-copy span {
    color: var(--muted);
    font-size: .8rem;
}

.unresolved-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pin-placement-banner {
    position: sticky;
    top: 8px;
    z-index: 1001;
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff8d8;
    border: 1px solid rgba(132, 103, 0, .25);
    box-shadow: 0 4px 16px rgba(0,0,0,.10);
}

.pin-placement-banner strong {
    display: block;
    margin-bottom: 2px;
}

.pin-placement-banner button {
    margin-top: 8px;
}

.pin-placement-active {
    cursor: crosshair;
    outline: 3px solid rgba(211, 157, 0, .35);
}

.map-popup-pin-actions {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(20,54,99,.10);
}

@media (max-width: 640px) {
    .unresolved-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .unresolved-actions {
        width: 100%;
    }

    .unresolved-actions .button-link,
    .unresolved-actions button {
        flex: 1 1 auto;
        text-align: center;
    }
}


/* v0.13.1 – compact rectangular "Ortsschild" markers */
.sps-marker-shell {
    width: 104px;
    height: 50px;
    grid-template-columns: 22px 60px 22px;
}

.sps-tour-marker {
    height: 30px;
    border: 2px solid #fff;
    border-left-width: 1px;
    border-right-width: 1px;
    border-radius: 5px;
    font-size: .80rem;
    transform: none;
}

.sps-marker-side {
    height: 26px;
    margin-top: 2px;
    border: 2px solid #fff;
    font-size: .68rem;
}

.sps-marker-deadline {
    border-radius: 6px 0 0 6px;
    border-right-width: 0;
}

.sps-marker-pieces {
    border-radius: 0 6px 6px 0;
    border-left-width: 0;
}

.sps-marker-side-empty {
    visibility: hidden;
}

.sps-marker-anchor {
    left: 46px;
    top: 29px;
    border-left-width: 6px;
    border-right-width: 6px;
    border-top-width: 17px;
}

.sps-marker-anchor::after {
    left: -4px;
    top: -17px;
    border-left-width: 4px;
    border-right-width: 4px;
    border-top-width: 13px;
}



/* v0.13.2 – sticky "Alle Termine" overlay above map */
.map-term-overlay {
    position: sticky;
    top: 8px;
    z-index: 1000;
    margin: 10px 0;
    border: 1px solid rgba(20, 54, 99, .15);
    border-radius: 14px;
    background: rgba(255,255,255,.97);
    box-shadow: 0 6px 20px rgba(0,0,0,.10);
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.map-term-overlay > summary {
    cursor: pointer;
    list-style: none;
    min-height: 50px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.map-term-overlay > summary::-webkit-details-marker {
    display: none;
}

.map-term-overlay > summary > span:first-child {
    display: grid;
    gap: 2px;
}

.overlay-chevron {
    font-size: 1.1rem;
    font-weight: 900;
    transition: transform .18s ease;
}

.map-term-overlay[open] .overlay-chevron {
    transform: rotate(180deg);
}

.map-term-overlay-body {
    border-top: 1px solid rgba(20, 54, 99, .10);
    max-height: min(54vh, 520px);
    overflow: auto;
}

.map-term-overlay-tools {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 10px;
    background: rgba(255,255,255,.98);
    border-bottom: 1px solid rgba(20, 54, 99, .08);
}

.map-term-overlay-tools input {
    width: 100%;
}

.map-term-list {
    display: grid;
}

.map-term-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-bottom: 1px solid rgba(20, 54, 99, .08);
}

.map-term-main {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    text-align: left;
    color: inherit;
    cursor: pointer;
    min-width: 0;
}

.map-term-topline {
    display: flex;
    gap: 7px;
    align-items: center;
    flex-wrap: wrap;
}

.map-term-address,
.map-term-meta {
    display: block;
    margin-top: 2px;
}

.map-term-address {
    font-size: .87rem;
    overflow-wrap: anywhere;
}

.map-term-meta {
    color: var(--muted);
    font-size: .76rem;
}

.geo-ok {
    background: rgba(34, 126, 75, .10);
    color: #247548;
    border: 1px solid rgba(34, 126, 75, .22);
}

.map-term-pin-btn {
    white-space: nowrap;
}

@media (max-width: 640px) {
    .map-term-overlay {
        top: 4px;
    }

    .map-term-overlay-body {
        max-height: 48vh;
    }

    .map-term-row {
        grid-template-columns: 1fr;
    }

    .map-term-pin-btn {
        width: 100%;
        text-align: center;
    }
}


/* v0.14 – morning push state + personal driver appointments */
.morning-push-state { display:grid; gap:10px; }
.change-alert { display:grid; gap:3px; padding:10px 12px; border-radius:12px; background:#fff6d8; border:1px solid rgba(150,110,0,.2); }
.driver-view-switch { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin:12px 0; padding:5px; border-radius:14px; background:#e8eef5; }
.driver-view-switch button { border:0; border-radius:10px; padding:10px; background:transparent; font-weight:800; }
.driver-view-switch button.active { background:#0c2b57; color:white; }
.driver-appt-card { display:grid; gap:7px; }
.driver-appt-head { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.driver-appt-head strong { font-size:1.2rem; color:#0c2b57; }
.driver-appt-head span { padding:3px 8px; border-radius:999px; background:#edf2f7; font-weight:800; font-size:.78rem; }
.driver-appt-card h2 { margin:0; font-size:1rem; }
.driver-appt-card p { margin:0; }
.driver-morning-map { height:min(68vh,650px); min-height:430px; border-radius:16px; overflow:hidden; border:1px solid rgba(20,54,99,.18); }
.driver-marker-wrap { background:transparent!important; border:0!important; overflow:visible!important; }
.driver-marker { position:relative; display:flex; align-items:center; justify-content:center; height:29px; min-width:66px; border-radius:6px; background:#0c2b57; border:2px solid white; color:white; box-shadow:0 2px 6px rgba(0,0,0,.3); }
.driver-marker span { padding:0 6px; font-size:.68rem; font-weight:900; border-right:1px solid rgba(255,255,255,.55); }
.driver-marker strong { padding:0 7px; font-size:.76rem; }
.driver-marker i { position:absolute; left:50%; top:27px; transform:translateX(-50%); width:0; height:0; border-left:6px solid transparent; border-right:6px solid transparent; border-top:13px solid #0c2b57; }


/* v0.14.1 – personal home integration */
.personal-morning-card {
    border: 1px solid rgba(12, 43, 87, .16);
}

.personal-morning-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.personal-morning-head h2 {
    margin-top: 2px;
}

.personal-morning-count {
    min-width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: #0c2b57;
    color: white;
    font-size: 1.55rem;
}

.personal-morning-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 10px 0;
}

.personal-morning-summary span {
    padding: 5px 9px;
    border-radius: 999px;
    background: #edf2f7;
    color: #0c2b57;
    font-size: .78rem;
    font-weight: 800;
}

.personal-morning-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.pending-push-alert {
    border-width: 2px;
}

@media (max-width: 640px) {
    .personal-morning-actions {
        grid-template-columns: 1fr;
    }
}


/* v0.14.2 – address correction directly on the map */
.unresolved-editable {
    align-items: start;
}

.map-inline-address-editor {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(20, 54, 99, .10);
}

.inline-address-grid {
    display: grid;
    grid-template-columns: 110px minmax(160px, .8fr) minmax(240px, 1.4fr) 110px;
    gap: 8px;
}

.inline-address-grid label {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.inline-address-grid label > span {
    font-size: .72rem;
    font-weight: 800;
    color: var(--muted);
}

.inline-address-grid input {
    width: 100%;
}

.inline-address-grid .wide {
    grid-column: span 2;
}

.inline-address-grid .street-field {
    grid-column: span 3;
}

.inline-address-grid .house-field {
    grid-column: span 1;
}

.inline-address-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.inline-memory-note {
    display: block;
    margin-top: 7px;
    font-size: .76rem;
}

@media (max-width: 700px) {
    .inline-address-grid {
        grid-template-columns: 1fr 110px;
    }

    .inline-address-grid .wide,
    .inline-address-grid .street-field {
        grid-column: 1 / -1;
    }

    .inline-address-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}


/* v0.14.3 – clean map address editor */
.unresolved-item.unresolved-editable {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
    align-items: start;
}

.unresolved-item .map-inline-address-editor {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    padding: 14px;
    border: 1px solid rgba(20,54,99,.12);
    border-radius: 12px;
    background: rgba(255,255,255,.72);
}

.inline-address-grid {
    display: grid;
    grid-template-columns: 120px minmax(180px, 1fr);
    gap: 10px;
}

.inline-address-grid label {
    display: grid;
    gap: 4px;
}

.inline-address-grid label > span {
    font-size: .74rem;
    font-weight: 800;
    color: var(--muted);
}

.inline-address-grid .wide,
.inline-address-grid .street-field {
    grid-column: 1 / -1;
}

.inline-address-grid .house-field {
    grid-column: auto;
}

.inline-address-grid .street-field {
    display: grid;
}

.inline-address-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 12px;
}

@media (min-width: 760px) {
    .inline-address-grid {
        grid-template-columns: 130px minmax(180px, .8fr) minmax(260px, 1.4fr) 120px;
    }

    .inline-address-grid .wide {
        grid-column: 3 / 5;
    }

    .inline-address-grid .street-field {
        grid-column: 1 / 4;
    }

    .inline-address-grid .house-field {
        grid-column: 4;
    }
}

@media (max-width: 620px) {
    .unresolved-item.unresolved-editable {
        grid-template-columns: 1fr;
    }

    .unresolved-actions {
        grid-column: 1;
    }

    .inline-address-grid {
        grid-template-columns: 1fr 92px;
    }

    .inline-address-grid label:nth-child(1),
    .inline-address-grid label:nth-child(2),
    .inline-address-grid .wide,
    .inline-address-grid .street-field {
        grid-column: 1 / -1;
    }

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


/* v0.15 – push receipt / operational delivery status */
.push-problem {
    display: grid;
    gap: 5px;
    padding: 11px 12px;
    border-radius: 12px;
    background: #fff6d8;
    border: 1px solid rgba(154,112,0,.20);
}

.push-problem-critical {
    background: #fff0f0;
    border-color: rgba(165,43,43,.22);
}

.push-problem summary,
.push-delivery-details summary {
    cursor: pointer;
    font-weight: 800;
    margin-top: 4px;
}

.push-problem-list {
    display: grid;
    gap: 4px;
    margin-top: 7px;
    color: var(--muted);
    font-size: .82rem;
}

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

.push-delivery-summary > div {
    display: grid;
    gap: 2px;
    padding: 10px;
    border-radius: 12px;
    background: #edf2f7;
}

.push-delivery-summary strong {
    font-size: 1.25rem;
    color: #0c2b57;
}

.push-delivery-summary span {
    color: var(--muted);
    font-size: .76rem;
}

.push-delivery-details {
    padding: 10px 0 0;
    border-top: 1px solid rgba(20,54,99,.10);
}

.push-driver-status-list {
    display: grid;
    gap: 7px;
    margin-top: 8px;
}

.push-driver-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    background: rgba(20,54,99,.035);
}

.push-driver-status > div {
    display: grid;
    gap: 2px;
}

.push-driver-status > div span {
    color: var(--muted);
    font-size: .76rem;
}

.push-state-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
    white-space: nowrap;
}

.push-state-ok {
    background: rgba(36,117,72,.11);
    color: #247548;
}

.push-state-wait {
    background: rgba(160,110,0,.11);
    color: #876000;
}

.push-state-error {
    background: rgba(160,40,40,.11);
    color: #9e2a2a;
}

.push-all-confirmed {
    padding: 9px 10px;
    border-radius: 10px;
    background: rgba(36,117,72,.09);
    color: #247548;
    font-weight: 800;
}

@media (max-width: 680px) {
    .push-delivery-summary {
        grid-template-columns: 1fr;
    }

    .push-driver-status {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* v0.16 reminder workflow */
.reminder-step-card { display:grid; gap:8px; }
.reminder-review-row.reminder-new {
  border:2px solid rgba(170,90,0,.28);
  background:#fff8e8;
}
.reminder-review-head {
  display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap;
  margin-bottom:10px;
}
.sps-marker-ghost {
  opacity:.24;
  filter:grayscale(.7);
}
.sps-marker-ghost:hover { opacity:.5; }

.reminder-known{border-left:5px solid rgba(20,130,70,.55)}
.reminder-needs-review{border:2px solid rgba(220,145,0,.45);background:rgba(255,245,215,.7)}
.reminder-new{border:2px solid rgba(190,70,45,.45);background:rgba(255,235,225,.75)}
.reminder-compare{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0 16px}
.reminder-compare>div{padding:12px;border-radius:12px;background:rgba(255,255,255,.65);border:1px solid rgba(0,0,0,.08)}
.reminder-compare p{margin:.2rem 0}.candidate-choice{display:flex;gap:8px;align-items:center;margin-top:10px;font-weight:700}
@media(max-width:720px){.reminder-compare{grid-template-columns:1fr}}

/* v0.17 reminder history + driver completion */
.snapshot-stats{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.status-good{font-weight:700;opacity:.8}
.status-warn{font-weight:700}
.snapshot-items{display:grid;gap:8px;margin-top:12px}
.snapshot-item{display:flex;flex-direction:column;padding:10px 12px;border-radius:10px;background:rgba(255,255,255,.55);border:1px solid rgba(0,0,0,.07)}
.driver-done-note{margin:8px 0;padding:8px 10px;border-radius:10px;background:rgba(0,0,0,.06);font-weight:700;opacity:.75}
.appointment-done{opacity:.48;filter:grayscale(.65)}

/* v0.17.1 09:00 reminder progress */
.progress-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.progress-metrics>div{display:flex;flex-direction:column;padding:10px;border-radius:10px;background:rgba(255,255,255,.55);border:1px solid rgba(0,0,0,.07)}
.progress-metrics strong{font-size:1.5rem;line-height:1}
.progress-metrics span{font-size:.82rem;opacity:.7;margin-top:5px}
@media(max-width:700px){.progress-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* v0.17.2: create genuinely new 09:00 appointment directly in review */
.new-appointment-choice{display:flex;align-items:center;gap:12px;margin-top:16px;padding:14px;border-radius:12px;border:2px solid rgba(20,120,70,.35);background:rgba(225,247,235,.72);cursor:pointer}
.new-appointment-choice input{width:24px;height:24px;flex:0 0 auto}
.new-appointment-choice span{display:flex;flex-direction:column;gap:3px}
.new-appointment-choice small{font-weight:400;opacity:.72}
