:root {
    --navy: #08085f;
    --blue: #2456f6;
    --green: #158456;
    --red: #d5263f;
    --amber: #bd8200;
    --ink: #20242c;
    --muted: #687181;
    --line: #dce2ec;
    --soft: #f5f7fb;
    --panel: #ffffff;
    --teal: #087d8b;
    --shadow: 0 12px 28px rgba(13, 23, 42, .12);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--soft);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.app {
    min-height: 100vh;
    display: grid;
    grid-template-rows: 54px 1fr;
}

.topbar {
    position: sticky;
    z-index: 1000;
    top: 0;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 20px;
    color: #fff;
    background: var(--navy);
}

.sidebar-toggle {
    display: none;
    appearance: none;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 8px;
    padding: 0;
    color: #fff;
    background: rgba(255, 255, 255, .1);
}

.sidebar-toggle span,
.sidebar-toggle span::before,
.sidebar-toggle span::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.sidebar-toggle span {
    position: relative;
    margin: auto;
}

.sidebar-toggle span::before,
.sidebar-toggle span::after {
    content: "";
    position: absolute;
    left: 0;
}

.sidebar-toggle span::before {
    top: -6px;
}

.sidebar-toggle span::after {
    top: 6px;
}

.brand {
    font-size: 18px;
    font-weight: 900;
    white-space: nowrap;
}

.global-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.global-nav button {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, .28);
    min-height: 34px;
    border-radius: 7px;
    padding: 0 12px;
    color: rgba(255, 255, 255, .78);
    background: transparent;
    font-size: 13px;
    font-weight: 850;
    white-space: nowrap;
}

.global-nav button.active {
    color: var(--navy);
    background: #fff;
    border-color: #fff;
}

.top-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: rgba(255, 255, 255, .86);
    white-space: nowrap;
}

.account-button {
    appearance: none;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    display: inline-grid;
    place-items: center;
}

.person-icon {
    position: relative;
    width: 20px;
    height: 22px;
    display: inline-block;
}

.person-icon::before,
.person-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
}

.person-icon::before {
    top: 1px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.person-icon::after {
    bottom: 1px;
    width: 18px;
    height: 10px;
    border-radius: 10px 10px 4px 4px;
}

.workspace-shell {
    display: grid;
    grid-template-columns: 188px minmax(0, 1fr);
    min-width: 0;
    min-height: calc(100vh - 54px);
}

.workspace-shell > main {
    min-width: 0;
}

.sidebar {
    position: sticky;
    top: 54px;
    align-self: start;
    height: calc(100vh - 54px);
    overflow-y: auto;
    background: #fff;
    border-right: 1px solid var(--line);
}

.sidebar-workspace {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding: 16px 10px 12px;
}

.sidebar-label {
    margin: 0 9px 8px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .1em;
}

.sidebar-nav {
    display: grid;
    gap: 2px;
}

.sidebar-nav button,
.sidebar-account {
    appearance: none;
    width: 100%;
    min-height: 38px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 9px;
    color: var(--muted);
    background: transparent;
    font-size: 13px;
    font-weight: 780;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 9px;
}

.sidebar-nav svg,
.sidebar-account svg,
.mobile-bottom-nav svg,
.mobile-more-menu svg {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-nav button:hover,
.sidebar-nav button:focus-visible,
.sidebar-account:hover,
.sidebar-account:focus-visible {
    color: var(--navy);
    background: #f1f4fb;
    outline: none;
}

.sidebar-nav button:focus-visible,
.sidebar-account:focus-visible {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(36, 86, 246, .14);
}

.sidebar-nav button.active {
    color: var(--navy);
    background: #eaf0ff;
    font-weight: 850;
}

.sidebar-workspace[hidden],
.sidebar-backdrop[hidden],
.mobile-bottom-nav,
.mobile-more-menu[hidden] {
    display: none;
}

.sidebar-account {
    margin-top: auto;
    border-top-color: var(--line);
    border-radius: 0 0 8px 8px;
}

.nav-icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.sidebar-backdrop,
.mobile-more-menu {
    display: none;
}

.page {
    display: none;
    padding: 22px 24px 28px;
}

.page.active {
    display: block;
}

.app.login-mode {
    grid-template-rows: 1fr;
}

.app.login-mode .topbar {
    display: none;
}

.app.login-mode .workspace-shell,
.app.account-mode .workspace-shell {
    grid-template-columns: minmax(0, 1fr);
}

.app.login-mode .workspace-shell {
    min-height: 100vh;
}

.app.account-mode .sidebar,
.app.account-mode .sidebar-backdrop,
.app.account-mode .mobile-bottom-nav,
.app.account-mode .mobile-more-menu,
.app.account-mode .sidebar-toggle {
    display: none;
}

.page.login-page {
    display: none;
}

.page.login-page.active {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        linear-gradient(135deg, rgba(8, 8, 95, .94), rgba(36, 86, 246, .72)),
        #08085f;
}

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

.home-link-card {
    appearance: none;
    display: grid;
    gap: 7px;
    min-height: 112px;
    padding: 20px;
    color: var(--ink);
    text-align: left;
}

.home-link-card:hover,
.home-link-card:focus-visible {
    border-color: var(--blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(36, 86, 246, .12);
}

.home-link-card strong {
    color: var(--navy);
    font-size: 17px;
}

.home-link-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.login-card {
    width: min(430px, 100%);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 8px;
    padding: 28px;
    background: #fff;
    box-shadow: var(--shadow);
}

.login-brand {
    margin: 0 0 20px;
    color: var(--navy);
    font-size: 24px;
    font-weight: 950;
}

.page-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.page-title {
    margin: 0;
    color: var(--ink);
    font-size: 24px;
    font-weight: 900;
    line-height: 1.25;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.commercial-page-head {
    align-items: center;
    margin-bottom: 14px;
}

.page-switch-button {
    min-height: 36px;
    color: var(--navy);
    font-size: 13px;
}

.target-filter-toolbar {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 4px 14px rgba(13, 23, 42, .04);
}

.target-filter-primary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.target-search-field {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 280px;
    min-width: 220px;
}

.target-search-field > svg {
    position: absolute;
    left: 12px;
    width: 17px;
    height: 17px;
    fill: none;
    stroke: var(--muted);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.target-search-field .search {
    width: 100%;
    padding-left: 38px;
}

.target-filter-toolbar .filter-chips {
    gap: 6px;
}

.target-filter-toolbar .chip {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
}

.target-mode-row,
.coverage-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.coverage-filter-row[hidden],
[data-mansion-filter][hidden],
.coverage-map-note[hidden] {
    display: none;
}

.target-mode-switch button {
    min-width: 112px;
}

.coverage-filter-row {
    border-top: 1px solid var(--line);
    padding-top: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.bookmark-filter.active,
.bookmark-button.active {
    border-color: #d49a0a;
    color: #775300;
    background: #fff7d6;
}

.bookmark-button {
    white-space: nowrap;
}

.panel-caption {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.page-sub {
    margin: 6px 0 0;
    color: var(--muted);
    font-weight: 750;
}

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

.button,
.ghost,
.icon-button {
    appearance: none;
    border: 1px solid var(--line);
    min-height: 40px;
    border-radius: 8px;
    padding: 9px 12px;
    background: #fff;
    color: var(--ink);
    font-weight: 850;
}

.button {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

.icon-button {
    width: 40px;
    padding: 0;
}

.grid {
    display: grid;
    gap: 16px;
}

.cols-2 {
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
}

.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
    min-width: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 5px 16px rgba(13, 23, 42, .05);
    overflow: hidden;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.panel-title {
    margin: 0;
    font-size: 18px;
    font-weight: 900;
}

.panel-body {
    padding: 16px;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-chips,
.room-chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.search {
    min-width: 220px;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 12px;
    background: #fff;
    color: var(--ink);
    font-weight: 700;
}

.segmented {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.segmented button {
    appearance: none;
    border: 0;
    border-right: 1px solid var(--line);
    min-height: 38px;
    padding: 8px 11px;
    color: var(--muted);
    background: transparent;
    font-weight: 850;
}

.segmented button:last-child {
    border-right: 0;
}

.segmented button.active {
    color: #fff;
    background: var(--navy);
}

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

.badge.red { background: var(--red); }
.badge.blue { background: var(--blue); }
.badge.green { background: var(--green); }
.badge.amber { background: var(--amber); }
.badge.slate { background: #4d596b; }
.badge.teal { background: var(--teal); }
.badge.soft {
    color: var(--muted);
    background: #eef2f7;
}

.chip.active,
.chip-alert.active {
    border-color: var(--blue);
    color: var(--blue);
    background: #eef3ff;
}

.chip-alert {
    border-color: rgba(189, 130, 0, .42);
    color: #7a5600;
    background: #fff8e7;
}

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

.target-empty {
    padding: 14px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: #fff;
    font-size: 13px;
    font-weight: 800;
}

.target-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.target-row[data-center-target-id] .target-main {
    cursor: pointer;
}

.pin-dot {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-size: 12px;
    font-weight: 950;
    box-shadow: 0 4px 10px rgba(13, 23, 42, .18);
}

.pin-dot.red { background: var(--red); }
.pin-dot.blue { background: var(--blue); }
.pin-dot.green { background: var(--green); }
.pin-dot.slate { background: #4d596b; }

.badge.candidate,
.map-candidate-note,
.map-candidate-summary {
    color: #9a3f00;
    background: #fff0e4;
}

.badge.candidate {
    border-color: #f4a66f;
}

.external-candidate-filter.active {
    border-color: #f06f1a;
    color: #9a3f00;
    background: #fff0e4;
}

.atbb-candidate-row {
    display: grid;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

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

.atbb-candidate-head strong,
.atbb-candidate-head span {
    display: block;
}

.atbb-candidate-head > div:first-child > span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.atbb-candidate-head .actions {
    flex: 0 0 auto;
}

.atbb-candidate-facts {
    display: grid;
    grid-template-columns: minmax(180px, .8fr) minmax(180px, .8fr) minmax(260px, 1.4fr);
    gap: 8px;
    margin: 0;
}

.atbb-candidate-facts > div {
    min-width: 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8fafc;
}

.atbb-candidate-facts dt {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.atbb-candidate-facts dd {
    margin: 0;
    line-height: 1.6;
}

.atbb-sync-panel [data-atbb-snapshot-reload],
[data-p8-candidate-reload] {
    flex: 0 0 auto;
    white-space: nowrap;
}

.target-main {
    min-width: 0;
}

.target-name {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
    font-weight: 900;
}

.target-meta {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.45;
}

.target-tags {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.link-button {
    appearance: none;
    border: 0;
    padding: 0;
    color: var(--blue);
    background: transparent;
    font: inherit;
    font-weight: inherit;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.warning-banner {
    display: grid;
    gap: 4px;
    border: 1px solid rgba(213, 38, 63, .24);
    border-left: 5px solid var(--red);
    border-radius: 8px;
    padding: 12px 14px;
    color: #5f1120;
    background: #fff1f3;
}

.warning-banner[hidden] {
    display: none;
}

.warning-banner.compact {
    margin-bottom: 12px;
}

.warning-banner strong {
    font-weight: 950;
}

.warning-banner span,
.warning-banner p {
    margin: 0;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.45;
}

.mini-map,
#mvpMap {
    min-height: 440px;
    background: #e8eef5;
}

#mvpMap {
    height: 520px;
    width: 100%;
}

.map-shell-full #mvpMap {
    height: calc(100vh - 254px);
    min-height: 520px;
}

.map-shell {
    position: relative;
}

.map-overlay {
    position: absolute;
    z-index: 500;
    left: 12px;
    right: 12px;
    top: 12px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    pointer-events: none;
}

.map-overlay > * {
    pointer-events: auto;
}

.map-result-summary {
    position: absolute;
    z-index: 500;
    left: 14px;
    bottom: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(220, 226, 236, .92);
    border-radius: 10px;
    padding: 8px 9px 8px 13px;
    color: var(--muted);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 10px 30px rgba(13, 23, 42, .16);
    backdrop-filter: blur(8px);
    font-size: 12px;
    font-weight: 750;
}

.map-result-summary strong {
    margin-right: 3px;
    color: var(--navy);
    font-size: 14px;
}

.map-result-summary .ghost {
    min-height: 32px;
    padding: 6px 9px;
    color: var(--navy);
    font-size: 12px;
}

.coverage-map-note {
    position: absolute;
    z-index: 500;
    right: 14px;
    bottom: 14px;
    display: grid;
    max-width: min(380px, calc(100% - 28px));
    gap: 3px;
    border: 1px solid rgba(220, 226, 236, .92);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--muted);
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 10px 30px rgba(13, 23, 42, .14);
    backdrop-filter: blur(8px);
    font-size: 12px;
    font-weight: 750;
}

.coverage-map-note strong {
    color: var(--navy);
    font-size: 13px;
}

.coverage-map-note .coverage-unavailable {
    margin-top: 3px;
    border-radius: 6px;
    padding: 6px 8px;
    color: #71333b;
    background: #fff0f2;
    font-weight: 900;
}

.coverage-popup-status {
    display: inline-flex;
    margin-bottom: 5px;
    border-radius: 999px;
    padding: 2px 8px;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}

.coverage-popup-detail {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

.commercial-list-panel {
    overflow: visible;
}

.commercial-target-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

.commercial-target-list .target-row {
    min-height: 122px;
    border-radius: 10px;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.commercial-target-list .target-row:hover {
    border-color: #c4d1e7;
    box-shadow: 0 8px 20px rgba(13, 23, 42, .08);
    transform: translateY(-1px);
}

.commercial-target-list .target-row .actions {
    align-items: center;
    gap: 6px;
}

.commercial-target-list .target-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 32px;
    padding: 5px 8px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
}

.commercial-target-list .target-action svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.commercial-target-list .target-action-detail {
    border-color: #c4d1e7;
    color: #334563;
    background: #f7f9fc;
}

.commercial-target-list .target-action-detail:hover {
    border-color: #8da3c8;
    color: var(--navy);
    background: #eef3fb;
}

.commercial-target-list .target-action-record {
    box-shadow: 0 3px 8px rgba(36, 86, 246, .18);
}

.commercial-target-list .target-action-record:hover {
    border-color: #1647d7;
    background: #1647d7;
}

.commercial-target-list .target-action:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(36, 86, 246, .18);
}

[data-record-candidates] .record-candidate-action {
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
}

.location-consent-panel,
.location-filter-panel {
    margin-bottom: 16px;
}

.location-account-control {
    display: grid;
    gap: 14px;
}

.notification-settings {
    display: grid;
    gap: 16px;
}

.notification-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.notification-setting-row span {
    display: grid;
    gap: 4px;
}

.notification-setting-row small {
    color: var(--muted);
    line-height: 1.5;
}

.notification-setting-row input[role="switch"] {
    inline-size: 22px;
    block-size: 22px;
    flex: 0 0 auto;
}

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

.location-prompt {
    position: fixed;
    z-index: 1200;
    inset: auto 12px 12px auto;
    width: min(520px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    border: 0;
    border-radius: 12px;
    padding: 0;
    color: var(--ink);
    background: #fff;
    box-shadow: 0 24px 70px rgba(8, 8, 95, .28);
}

.location-prompt-card {
    display: grid;
    gap: 16px;
    padding: 20px;
}

.location-prompt-actions,
.location-requirement-control {
    display: flex;
    align-items: end;
    gap: 10px;
}

.location-requirement-control .field {
    min-width: 180px;
}

.location-caption,
.location-message,
.visit-location-option p,
.location-point-list p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.5;
}

.location-consent-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr);
    gap: 18px;
}

.location-policy ul {
    margin: 10px 0 12px;
    padding-left: 20px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.65;
}

.location-policy-text {
    margin: 0 0 12px;
    border-left: 4px solid var(--blue);
    padding: 10px 12px;
    color: var(--ink);
    background: #eef3ff;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.6;
}

.location-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 850;
    line-height: 1.45;
}

.location-check input {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    flex: 0 0 auto;
}

.location-live-state {
    display: grid;
    align-content: start;
    gap: 12px;
    border-left: 1px solid var(--line);
    padding-left: 18px;
}

.location-message[data-tone="error"] {
    color: var(--red);
}

.visit-location-option {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 13px;
    background: #f8fafc;
}

.location-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 240px));
    gap: 12px;
}

.location-manager-grid {
    display: grid;
    grid-template-columns: minmax(260px, .34fr) minmax(0, .66fr);
    gap: 16px;
    align-items: start;
}

.location-session-list,
.location-point-list,
.location-detail-summary {
    display: grid;
    gap: 8px;
}

.location-session-row {
    appearance: none;
    display: grid;
    gap: 4px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    color: var(--ink);
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.location-session-row:hover,
.location-session-row:focus-visible,
.location-session-row.selected {
    border-color: var(--blue);
    outline: none;
}

.location-session-row.selected {
    background: #eef3ff;
    box-shadow: inset 4px 0 0 var(--blue);
}

.location-manager-message {
    min-height: 20px;
    margin: -8px 0 12px;
    color: var(--red);
    font-size: 13px;
    font-weight: 800;
}

.location-session-row span,
.location-detail-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.location-load-more {
    padding-top: 0;
}

#managerLocationMap {
    width: 100%;
    height: 460px;
    background: #e8eef5;
}

.location-list-title {
    margin: 0 0 10px;
    font-size: 14px;
}

.location-point-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.sales-pin {
    position: relative;
    width: 34px;
    height: 42px;
    transform: translate(-17px, -39px);
}

.sales-pin::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 0;
    width: 24px;
    height: 24px;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    box-shadow: 0 5px 12px rgba(0, 0, 0, .32);
    transform: rotate(-45deg);
    background: var(--pin-color);
}

.sales-pin span {
    position: absolute;
    left: 7px;
    top: 4px;
    width: 26px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 950;
    line-height: 1;
}

.maplibregl-popup-content {
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 8px 24px rgba(13, 23, 42, .18);
    color: var(--ink);
    font-weight: 800;
    line-height: 1.55;
}

.maplibregl-popup-content button {
    appearance: none;
    border: 1px solid var(--line);
    border-radius: 7px;
    margin: 8px 6px 0 0;
    padding: 5px 9px;
    color: var(--navy);
    background: #fff;
    font-weight: 900;
}

.maplibregl-popup-content a {
    display: inline-block;
    margin-top: 8px;
    color: var(--blue);
    font-weight: 900;
    text-decoration: none;
}

.maplibregl-ctrl-attrib {
    font-size: 11px;
}

.stat-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

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

.stat strong {
    display: block;
    font-size: 22px;
    color: var(--navy);
}

.stat span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 16px;
    align-items: stretch;
}

.mini-map {
    appearance: none;
    display: block;
    width: 100%;
    min-height: 230px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0;
    background: #e8eef5;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.mini-map:focus-visible {
    outline: 3px solid rgba(36, 86, 246, .28);
    outline-offset: 3px;
}

.mini-map-canvas {
    display: block;
    position: absolute;
    inset: 0;
}

.kv {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 9px 12px;
    margin: 0;
    font-size: 14px;
}

.kv dt {
    color: var(--muted);
    font-weight: 850;
}

.kv dd {
    margin: 0;
    font-weight: 750;
    line-height: 1.45;
}

.room-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(72px, 1fr));
    gap: 8px;
}

.room {
    appearance: none;
    color: var(--ink);
    text-align: left;
    min-height: 64px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px;
    background: #fff;
}

.room.active {
    border-color: var(--blue);
    background: #eef3ff;
}

.room strong {
    display: block;
    font-size: 14px;
}

.room span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.room-history,
.save-choice,
.protected-confirm {
    display: grid;
    gap: 12px;
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #f8fafc;
}

.protected-confirm {
    border-color: rgba(213, 38, 63, .28);
    background: #fff7f8;
}

.save-choice {
    border-color: rgba(21, 132, 86, .28);
    background: #f0fbf6;
}

.save-choice.error {
    border-color: rgba(213, 38, 63, .28);
    background: #fff7f8;
}

.protected-confirm[hidden],
.save-choice[hidden],
.record-empty[hidden],
.return-panel[hidden],
.hold-panel[hidden] {
    display: none;
}

.room-history p,
.save-choice span,
.protected-confirm p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.45;
}

.record-layout {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr);
    gap: 16px;
}

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

.result-button,
.field-house-result-button {
    appearance: none;
    border: 2px solid var(--line);
    border-radius: 8px;
    min-height: 78px;
    padding: 10px;
    background: #fff;
    color: var(--ink);
    font-weight: 900;
    text-align: center;
}

.result-button.active,
.field-house-result-button.active {
    border-color: var(--blue);
    background: #eef3ff;
    color: var(--blue);
}

.field-house-dialog {
    --field-house-dialog-top-space: max(12px, env(safe-area-inset-top));
    --field-house-dialog-bottom-space: max(12px, env(safe-area-inset-bottom));
    position: fixed;
    z-index: 1300;
    inset: auto max(12px, env(safe-area-inset-right)) var(--field-house-dialog-bottom-space) auto;
    width: min(560px, calc(100vw - 24px));
    max-height: calc(100vh - var(--field-house-dialog-top-space) - var(--field-house-dialog-bottom-space));
    max-height: calc(100dvh - var(--field-house-dialog-top-space) - var(--field-house-dialog-bottom-space));
    overflow: auto;
    border: 0;
    border-radius: 12px;
    padding: 0;
    color: var(--ink);
    background: #fff;
    box-shadow: 0 24px 70px rgba(8, 8, 95, .28);
}

.field-house-dialog::backdrop {
    background: rgba(8, 8, 45, .36);
}

.field-house-sheet {
    display: grid;
}

.field-house-sheet .panel-head {
    position: sticky;
    z-index: 1;
    top: 0;
    background: #fff;
}

.field-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-weight: 800;
}

.field-house-result-button {
    min-height: 48px;
}

.field-house-feedback {
    margin: 0;
    border-radius: 8px;
    padding: 10px 12px;
    background: #eef6ff;
}

.field-house-feedback.error {
    color: var(--red);
    background: #fff0f2;
}

#mvpMap.field-house-registration-active {
    cursor: crosshair;
}

.field-grid {
    display: grid;
    gap: 12px;
}

.record-empty {
    margin-bottom: 16px;
}

.record-layout[hidden] {
    display: none;
}

.field label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.login-card .field + .field {
    margin-top: 14px;
}

.check-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 850;
}

.check-line input {
    width: 18px;
    height: 18px;
    accent-color: var(--blue);
}

.login-actions {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.account-grid {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr);
    gap: 16px;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 11px;
    color: var(--ink);
    background: #fff;
    font-weight: 750;
}

.room-rent-estimate {
    display: grid;
    gap: 4px;
    margin-top: 12px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.room-rent-estimate[data-state="available"] strong,
.room-rent-estimate[data-state="available"] p {
    color: var(--blue);
}

.room-rent-estimate p,
.room-rent-estimate small {
    margin: 0;
}

.room-rent-estimate small {
    color: var(--muted);
    font-weight: 700;
}

.field textarea {
    min-height: 92px;
    resize: vertical;
}

.form-message {
    margin: 6px 0 0;
    color: var(--red);
    font-size: 12px;
    font-weight: 850;
}

.assignment-feedback {
    margin-bottom: 16px;
    border: 1px solid rgba(21, 132, 86, .35);
    border-radius: 8px;
    padding: 12px 14px;
    color: #0d6842;
    background: #edf9f3;
    font-weight: 850;
}

.assignment-feedback.error {
    border-color: rgba(213, 38, 63, .35);
    color: var(--red);
    background: #fff0f2;
}

.assignment-mode-panel {
    margin-bottom: 16px;
}

.assignment-mode-body,
.assignment-create-row,
.assignment-add-member,
.assignment-team-fields {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(130px, auto) auto;
    gap: 10px;
    align-items: end;
}

.assignment-mode-body {
    grid-template-columns: minmax(220px, .55fr) minmax(280px, 1fr) auto;
}

.assignment-warning {
    border: 1px solid rgba(189, 130, 0, .42);
    border-radius: 8px;
    padding: 10px 12px;
    color: #6f4f00;
    background: #fff8e7;
    font-size: 13px;
}

.assignment-warning .check-line {
    margin-top: 8px;
}

.assignment-main-grid,
.assignment-list-head {
    margin-bottom: 16px;
}

.assignment-stack,
.assignment-memberships {
    display: grid;
    gap: 12px;
}

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

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

.assignment-team-fields {
    flex: 1 1 320px;
    grid-template-columns: minmax(160px, 1fr) minmax(110px, auto);
    align-items: center;
}

.assignment-team-fields input,
.assignment-team-fields select,
.assignment-add-member input,
.assignment-add-member select {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--ink);
    background: #fff;
    font-weight: 750;
}

.assignment-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(130px, 1fr));
    gap: 10px;
}

.assignment-form-grid.compact {
    grid-template-columns: minmax(170px, 1.4fr) minmax(120px, 1fr);
}

.assignment-readonly-target {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 10px;
    color: var(--muted);
    background: var(--soft);
    font-weight: 750;
}

.assignment-membership-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.assignment-membership-row > .actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
}

.assignment-add-member {
    grid-template-columns: minmax(180px, 1.4fr) minmax(120px, 1fr);
    margin-top: 12px;
    border-top: 1px dashed var(--line);
    padding-top: 12px;
}

.assignment-add-member .button {
    grid-column: 1 / -1;
    white-space: nowrap;
}

.assignment-form-grid.compact select,
.assignment-add-member select {
    min-width: 0;
    text-overflow: ellipsis;
}

.assignment-row-actions {
    justify-content: flex-end;
    margin-top: 12px;
}

.assignment-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--line);
}

.ghost.danger {
    border-color: rgba(213, 38, 63, .32);
    color: var(--red);
}

button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

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

.chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 10px;
    color: var(--ink);
    background: #fff;
    font-size: 13px;
    font-weight: 850;
}

.review-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.review-table th,
.review-table td {
    border-bottom: 1px solid var(--line);
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
}

.review-table th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    background: #f8fafc;
}

.data-table {
    display: grid;
    gap: 8px;
}

.data-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 120px 120px 120px auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
}

.data-row.header {
    color: var(--muted);
    background: #f8fafc;
    font-size: 12px;
    font-weight: 900;
}

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

.import-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 13px;
    background: #fff;
}

.import-item strong {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
}

.import-item span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.attention-panel {
    border-color: rgba(213, 38, 63, .2);
}

.return-panel,
.hold-panel {
    margin-top: 16px;
}

.phase5-feedback {
    margin-bottom: 16px;
    border: 1px solid rgba(36, 86, 246, .2);
    border-radius: 8px;
    padding: 11px 13px;
    color: var(--navy);
    background: #eef4ff;
    font-size: 14px;
    font-weight: 800;
}

.phase5-feedback[data-tone="error"] {
    border-color: rgba(213, 38, 63, .25);
    color: var(--red);
    background: #fff1f3;
}

.phase5-feedback[data-tone="success"] {
    border-color: rgba(21, 132, 86, .25);
    color: #0d6b45;
    background: #edfdf5;
}

.phase5-feedback[data-tone="warning"] {
    border-color: rgba(245, 158, 11, .3);
    color: #92400e;
    background: #fffbeb;
}

.phase5-panel-head,
.phase5-filter,
.phase5-pagination,
.phase5-export-row,
.phase5-history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.phase6-referral-row {
    display: grid;
    grid-template-columns: minmax(240px, 1.4fr) minmax(170px, .8fr) minmax(170px, .8fr) auto;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
    font-size: 13px;
}

.phase6-referral-row p,
.phase6-import-detail-row p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.phase6-referral-actions {
    display: grid;
    min-width: 230px;
    gap: 6px;
}

.phase6-referral-actions .actions {
    flex-wrap: nowrap;
}

.phase6-referral-actions input {
    min-width: 0;
}

.phase6-import-workbench {
    margin-top: 16px;
}

.phase6-mapping-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 10px;
}

.phase6-mapping-item {
    display: grid;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #f8fafc;
}

.phase6-mapping-item strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

.phase6-duplicate-ack {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #92400e;
    font-size: 13px;
    font-weight: 850;
}

.phase6-row-editor {
    display: grid;
    min-width: 420px;
    gap: 6px;
}

.phase6-row-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    gap: 6px;
}

.phase6-row-fields label {
    display: grid;
    gap: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.phase6-row-fields input {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 12px;
}

.phase6-import-detail-row {
    display: grid;
    grid-template-columns: 90px 1fr 140px;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
    font-size: 13px;
}

.phase7-master-grid {
    align-items: start;
}

.phase7-search-row {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 12px;
    padding-bottom: 12px;
}

.phase7-search-row .field {
    flex: 1 1 220px;
}

.phase7-master-row {
    display: grid;
    grid-template-columns: minmax(120px, 1.2fr) minmax(90px, .8fr) auto;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
}

.phase7-master-row > div {
    min-width: 0;
}

.phase7-master-row strong,
.phase7-master-row span {
    display: block;
}

.phase7-master-row span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.phase7-master-row .actions {
    justify-content: flex-end;
}

[data-p6-import-mapping-panel][hidden],
[data-p6-import-detail-panel][hidden],
[data-p6-import-sheet-field][hidden],
[data-p6-import-duplicate-ack-row][hidden] {
    display: none;
}

.phase5-filter {
    justify-content: flex-end;
}

.phase5-filter .search {
    width: min(360px, 42vw);
}

.phase5-table-wrap {
    overflow-x: auto;
}

.phase5-target-list {
    min-width: 820px;
}

.phase5-data-row {
    display: grid;
    grid-template-columns: minmax(240px, 1.6fr) 110px minmax(140px, 1fr) 100px 76px;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding: 12px 4px;
    font-size: 13px;
}

.phase5-data-row > div:first-child span,
.phase5-user-row > div:first-child span,
.phase5-history-row > div span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.phase5-data-head {
    color: var(--muted);
    background: #f8fafc;
    font-size: 12px;
    font-weight: 900;
}

.phase5-editor {
    margin-top: 16px;
}

.phase5-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.phase5-span-2 {
    grid-column: span 2;
}

.phase5-span-3 {
    grid-column: 1 / -1;
}

.phase5-tag-fieldset {
    min-width: 0;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

.phase5-tag-fieldset legend {
    padding: 0 6px;
    font-size: 13px;
    font-weight: 900;
}

.phase5-stack {
    display: grid;
    gap: 12px;
}

.phase5-inline-form,
.phase5-tag-row {
    display: grid;
    grid-template-columns: minmax(140px, .8fr) minmax(180px, 1.2fr) 100px auto;
    gap: 10px;
    align-items: center;
}

.phase5-tag-row {
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.button.danger {
    border-color: var(--red);
    background: var(--red);
}

.phase5-data-grid {
    margin-bottom: 16px;
}

.phase5-export-row + .phase5-export-row {
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.phase5-export-row p {
    margin: 4px 0 0;
}

.phase5-date-range {
    display: grid;
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    gap: 10px;
}

.phase5-preview-table td:last-child {
    min-width: 220px;
}

.phase5-error-text {
    color: var(--red);
    font-weight: 800;
}

.phase5-history-row {
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
    font-size: 13px;
}

.phase5-user-invite {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(220px, 1.3fr) 150px minmax(180px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.phase5-user-row {
    display: grid;
    grid-template-columns: minmax(200px, 1.3fr) 150px 120px minmax(180px, 1fr) auto;
    gap: 10px;
    align-items: center;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.phase5-user-row select[multiple],
.phase5-user-invite select[multiple] {
    min-height: 76px;
}

@media (max-width: 1023px) {
    .app:not(.login-mode) {
        grid-template-rows: 58px 1fr;
    }

    .workspace-shell {
        grid-template-columns: minmax(0, 1fr);
        min-height: calc(100vh - 58px);
    }

    .sidebar-toggle {
        display: inline-grid;
        place-items: center;
    }

    .sidebar {
        position: fixed;
        z-index: 950;
        top: 58px;
        bottom: 0;
        left: 0;
        width: min(248px, calc(100vw - 48px));
        height: auto;
        transform: translateX(-105%);
        transition: transform .18s ease;
        box-shadow: 18px 0 42px rgba(13, 23, 42, .18);
    }

    .app.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop:not([hidden]) {
        position: fixed;
        z-index: 940;
        inset: 58px 0 0;
        display: block;
        width: 100%;
        border: 0;
        padding: 0;
        background: rgba(8, 8, 32, .42);
    }
}

@media (max-width: 1199px) {
    .commercial-target-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .app:not(.login-mode) {
        grid-template-rows: 58px 1fr;
    }

    .topbar {
        gap: 10px;
        padding: 0 14px;
        overflow: hidden;
    }

    .brand {
        font-size: 18px;
    }

    .global-nav {
        flex: 1 1 0;
        gap: 4px;
        min-width: 0;
        overflow-x: auto;
    }

    .global-nav button {
        min-height: 36px;
        padding: 0 10px;
    }

    .top-actions {
        display: flex;
        margin-left: 0;
    }

    .account-button {
        width: 36px;
        height: 36px;
    }

    .search {
        min-width: 0;
        width: 100%;
    }

    .toolbar,
    .segmented {
        max-width: 100%;
    }

    .page {
        padding: 14px 10px 20px;
    }

    .page-head,
    .detail-hero,
    .account-grid,
    .record-layout,
    .cols-2 {
        grid-template-columns: 1fr;
    }

    .location-consent-grid,
    .location-manager-grid,
    .location-filters {
        grid-template-columns: 1fr;
    }

    .location-live-state {
        border-top: 1px solid var(--line);
        border-left: 0;
        padding-top: 16px;
        padding-left: 0;
    }

    #managerLocationMap {
        height: 380px;
    }

    .page-head {
        display: grid;
    }

    .cols-3,
    .stat-strip,
    .import-grid {
        grid-template-columns: 1fr;
    }

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

    .toolbar,
    .filter-chips,
    .room-chip-row,
    .actions {
        align-items: stretch;
    }

    .filter-chips .chip,
    .room-chip-row .chip {
        flex: 1 1 auto;
    }

    .target-row {
        grid-template-columns: auto 1fr;
    }

    [data-record-candidates] .target-row {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .target-row .actions {
        grid-column: 1 / -1;
    }

    .assignment-mode-body,
    .assignment-create-row,
    .assignment-add-member,
    .assignment-form-grid,
    .assignment-form-grid.compact,
    .assignment-membership-row {
        grid-template-columns: 1fr;
        grid-auto-rows: max-content;
        align-content: start;
        align-items: stretch;
    }

    .assignment-card-head,
    .assignment-list-head {
        align-items: stretch;
        flex-direction: column;
    }

    .assignment-team-fields {
        flex: 0 0 auto;
        width: 100%;
        min-height: 0;
        grid-template-columns: 1fr;
        grid-auto-rows: max-content;
        align-content: start;
        align-items: stretch;
    }

    .assignment-card-head > .actions,
    .assignment-membership-row > .actions,
    .assignment-add-member .button {
        width: 100%;
    }

    .phase5-panel-head,
    .phase5-filter,
    .phase5-export-row,
    .phase5-history-row {
        align-items: stretch;
        flex-direction: column;
    }

    .atbb-candidate-head {
        align-items: stretch;
        flex-direction: column;
    }

    .atbb-candidate-head .actions {
        width: 100%;
    }

    .atbb-candidate-facts {
        grid-template-columns: 1fr;
    }

    .phase5-filter .search {
        width: 100%;
    }

    .phase5-form-grid,
    .phase5-inline-form,
    .phase5-tag-row,
    .phase5-user-invite,
    .phase5-user-row {
        grid-template-columns: 1fr;
    }

    .phase6-referral-row,
    .phase6-mapping-grid,
    .phase6-import-detail-row,
    .phase7-master-row {
        grid-template-columns: 1fr;
    }

    .phase7-search-row {
        align-items: stretch;
    }

    .phase7-search-row .field,
    .phase7-search-row .ghost {
        flex: 1 1 100%;
    }

    .phase6-referral-actions,
    .phase6-row-editor {
        min-width: 0;
    }

    .phase5-span-2,
    .phase5-span-3 {
        grid-column: auto;
    }

    .phase5-user-row .actions,
    .phase5-tag-row .actions,
    .phase5-export-row .ghost {
        width: 100%;
    }

    #mvpMap {
        height: 430px;
    }

    .map-shell-full #mvpMap {
        height: calc(100vh - 310px);
        min-height: 460px;
    }

    .map-overlay {
        display: grid;
    }

    .target-filter-primary {
        align-items: stretch;
    }

    .target-search-field {
        flex-basis: 100%;
    }

    .data-row,
    .data-row.header {
        grid-template-columns: 1fr;
    }

    .table-scroll {
        overflow-x: auto;
    }
}

@media (max-width: 767px) {
    .app.section-sales .sidebar,
    .app.section-sales .sidebar-toggle {
        display: none;
    }

    .app.section-sales:not(.account-mode) .workspace-shell > main {
        padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }

    .mobile-bottom-nav:not([hidden]) {
        position: fixed;
        z-index: 900;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        min-height: 60px;
        padding-bottom: env(safe-area-inset-bottom);
        border-top: 1px solid var(--line);
        background: #fff;
        box-shadow: 0 -8px 24px rgba(13, 23, 42, .1);
    }

    .mobile-bottom-nav button {
        appearance: none;
        min-width: 0;
        border: 0;
        border-top: 3px solid transparent;
        display: grid;
        place-items: center;
        gap: 3px;
        padding: 7px 4px 6px;
        color: var(--muted);
        background: transparent;
        font-size: 12px;
        font-weight: 900;
    }

    .mobile-bottom-nav svg {
        width: 19px;
        height: 19px;
    }

    .mobile-bottom-nav button:hover,
    .mobile-bottom-nav button:focus-visible,
    .mobile-bottom-nav button.active {
        color: var(--navy);
        border-top-color: var(--blue);
        outline: none;
        background: #f5f7ff;
    }

    .mobile-more-menu:not([hidden]) {
        position: fixed;
        z-index: 910;
        right: 10px;
        bottom: calc(68px + env(safe-area-inset-bottom));
        display: grid;
        width: min(240px, calc(100vw - 20px));
        gap: 4px;
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 8px;
        background: #fff;
        box-shadow: var(--shadow);
    }

    .mobile-more-menu button {
        appearance: none;
        min-height: 44px;
        border: 0;
        border-radius: 7px;
        padding: 10px 12px;
        color: var(--ink);
        background: transparent;
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 13px;
        font-weight: 850;
        text-align: left;
    }

    .mobile-more-menu button:hover,
    .mobile-more-menu button:focus-visible,
    .mobile-more-menu button.active {
        color: var(--navy);
        outline: none;
        background: #eef3ff;
    }

    .app.section-sales .location-prompt {
        bottom: calc(68px + env(safe-area-inset-bottom));
    }

    .home-link-grid {
        grid-template-columns: 1fr;
    }

    .commercial-page-head {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .map-result-summary {
        right: 10px;
        bottom: 10px;
        left: 10px;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .topbar {
        gap: 6px;
        padding: 0 8px;
    }

    .brand {
        flex: 0 0 auto;
        font-size: 14px;
    }

    .global-nav {
        flex: 1 1 auto;
        gap: 4px;
        overflow: visible;
    }

    .global-nav button {
        min-height: 34px;
        padding: 0 7px;
        font-size: 13px;
    }

    .top-actions,
    .account-button {
        flex: 0 0 36px;
    }

    .commercial-page-head {
        grid-template-columns: 1fr;
    }

    .page-switch-button {
        width: 100%;
    }

    .target-filter-toolbar {
        padding: 10px;
    }

    .target-filter-toolbar .segmented {
        width: 100%;
    }

    .target-filter-toolbar .segmented button {
        flex: 1 1 0;
        padding-inline: 6px;
        font-size: 12px;
    }

    .target-mode-row,
    .coverage-filter-row {
        align-items: stretch;
        flex-direction: column;
    }

    .target-mode-row > *,
    .coverage-filter-row .segmented {
        width: 100%;
    }

    .coverage-map-note {
        right: 10px;
        bottom: 66px;
        left: 10px;
        max-width: none;
    }

    .map-shell-full #mvpMap {
        height: calc(100vh - 390px);
        min-height: 420px;
    }

}

.coaching-page {
    --coaching-soft: #f4f7ff;
    --coaching-line: #dbe3f4;
}

.coaching-section {
    margin-top: 16px;
}

.coaching-two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.coaching-panel-head,
.coaching-filter-row,
.coaching-card-head,
.coaching-decision-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.coaching-filter-row {
    flex-wrap: wrap;
}

.coaching-filter-row .field {
    min-width: min(100%, 260px);
}

.coaching-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.coaching-stat {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--coaching-line);
    border-radius: 12px;
    background: var(--coaching-soft);
}

.coaching-stat strong {
    display: block;
    color: var(--navy);
    font-size: 28px;
    line-height: 1.1;
}

.coaching-stat span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.coaching-stack {
    display: grid;
    gap: 12px;
}

.coaching-card,
.coaching-form {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--coaching-line);
    border-radius: 12px;
    background: #fff;
}

.coaching-card-title {
    margin: 0;
    color: var(--navy);
    font-size: 16px;
}

.coaching-meta,
.coaching-fact-notice {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.coaching-fact-notice {
    padding: 10px 12px;
    border-left: 3px solid var(--teal);
    background: #f0faf8;
    color: #195e54;
}

.coaching-inline-fields {
    display: grid;
    grid-template-columns: minmax(90px, 0.35fr) minmax(0, 1fr);
    gap: 10px;
}

.coaching-progress-list {
    display: grid;
    gap: 8px;
}

.coaching-progress-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--coaching-line);
}

.coaching-progress-row:first-child {
    padding-top: 0;
    border-top: 0;
}

.coaching-progress-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.coaching-progress-actions button,
.coaching-decision-actions button {
    min-height: 38px;
}

.coaching-feedback {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #eef6ff;
    color: #164a7b;
}

.coaching-feedback.error {
    background: #fff0f2;
    color: #a21d36;
}

.coaching-card.is-overdue {
    border-color: #efadba;
}

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

.coaching-evaluation-grid .field {
    min-width: 0;
}

@media (max-width: 980px) {
    .coaching-two-column {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .coaching-stat-grid,
    .coaching-inline-fields,
    .coaching-evaluation-grid {
        grid-template-columns: 1fr;
    }

    .coaching-panel-head,
    .coaching-filter-row,
    .coaching-card-head,
    .coaching-decision-actions,
    .coaching-progress-row {
        align-items: stretch;
        flex-direction: column;
        grid-template-columns: 1fr;
    }

    .coaching-progress-actions,
    .coaching-decision-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .coaching-progress-actions button,
    .coaching-decision-actions button,
    .coaching-form .button,
    .coaching-form .ghost {
        width: 100%;
    }
}
