:root {
    --ink: #17221e;
    --muted: #68746f;
    --muted-strong: #4b5752;
    --line: #d9dfdc;
    --line-strong: #c6cfca;
    --surface: #ffffff;
    --surface-soft: #f5f7f5;
    --canvas: #eef1ee;
    --brand: #173f35;
    --brand-hover: #205545;
    --brand-soft: #dfebe5;
    --accent: #d88a32;
    --danger: #b43d3d;
    --danger-soft: #fff1ef;
    --success: #257a5b;
    --shadow: 0 18px 42px rgb(25 42 35 / 10%);
    --bottom-nav-height: 58px;
    --font: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--canvas);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body.modal-open {
    overflow: hidden;
}

button,
input,
textarea {
    font: inherit;
}

input,
textarea,
[contenteditable="true"] {
    -webkit-user-select: text;
    user-select: text;
}

button {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

[hidden] {
    display: none !important;
}

.icon-sprite {
    display: none;
}

.eyebrow {
    margin: 0 0 10px;
    color: #7b8782;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.14em;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.brand-lockup .brand-name {
    white-space: nowrap;
}

.cloud-storage {
    margin-left: 4px;
    padding-left: 10px;
    overflow: hidden;
    color: var(--muted);
    border-left: 1px solid var(--line);
    font-size: 11px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-lockup.light {
    color: #ffffff;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: #ffffff;
    border-radius: 8px;
    background: var(--brand);
}

.brand-lockup.light .brand-mark {
    color: var(--brand);
    background: #ffffff;
}

.brand-mark svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.7;
}

.button,
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.button {
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
}

.button svg {
    width: 17px;
    height: 17px;
}

.button.primary {
    color: #ffffff;
    border-color: var(--brand);
    background: var(--brand);
}

.button.primary:hover:not(:disabled) {
    border-color: var(--brand-hover);
    background: var(--brand-hover);
}

.button.secondary {
    color: #33403b;
    border-color: var(--line);
    background: #ffffff;
}

.button.secondary:hover:not(:disabled) {
    border-color: var(--line-strong);
    background: var(--surface-soft);
}

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

.button.danger:hover:not(:disabled) {
    border-color: #943131;
    background: #943131;
}

.button.compact {
    min-height: 36px;
    padding: 0 12px;
}

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

.button:active:not(:disabled),
.icon-button:active:not(:disabled) {
    transform: translateY(1px);
}

.icon-button {
    width: 38px;
    height: 38px;
    padding: 0;
    color: var(--muted-strong);
    border-radius: 7px;
    background: transparent;
}

.icon-button:hover {
    color: var(--ink);
    background: var(--surface-soft);
}

.icon-button.danger {
    color: var(--danger);
}

.icon-button.danger:hover {
    background: var(--danger-soft);
}

.button:focus-visible,
.icon-button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.customer-item:focus-visible,
.photo-card:focus-visible {
    outline: 3px solid rgb(45 139 110 / 20%);
    outline-offset: 2px;
}

.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgb(255 255 255 / 35%);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.spinner.dark {
    display: inline-block;
    border-color: #cad3cf;
    border-top-color: var(--brand);
}

.is-loading .spinner {
    display: inline-block;
}

.form-alert {
    padding: 11px 13px;
    color: var(--danger);
    border: 1px solid #efc8c3;
    border-radius: 7px;
    background: var(--danger-soft);
    font-size: 13px;
    line-height: 1.55;
}

.form-alert[data-tone="success"] {
    color: #28664e;
    border-color: #c7dfd3;
    background: #f0f8f4;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field > span {
    color: #34413b;
    font-size: 13px;
    font-weight: 600;
}

.field b {
    color: var(--danger);
}

.field input,
.field textarea {
    width: 100%;
    color: var(--ink);
    font-size: 13px;
    border: 1px solid var(--line);
    border-radius: 7px;
    outline: none;
    background: #fbfcfb;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.field input {
    height: 44px;
    padding: 0 12px;
}

.field select {
    width: 100%;
    height: 44px;
    padding: 0 34px 0 12px;
    color: var(--ink);
    font-size: 13px;
    border: 1px solid var(--line);
    border-radius: 7px;
    outline: none;
    background: #fbfcfb;
    font: inherit;
}

.field select:focus {
    border-color: #39866e;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgb(45 139 110 / 11%);
}

.field textarea {
    min-height: 86px;
    padding: 11px 12px;
    line-height: 1.6;
    resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #9ca6a2;
}

.field input:focus,
.field textarea:focus {
    border-color: #39866e;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgb(45 139 110 / 11%);
}

.field input[readonly] {
    color: var(--muted-strong);
    background: var(--surface-soft);
    cursor: default;
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
    border-color: var(--danger);
}

/* Authentication */
.auth-view {
    display: grid;
    place-items: center;
    min-height: 100vh;
    background: var(--surface);
}

.auth-form-panel {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 100vh;
    padding: 44px 24px;
    background: var(--surface);
}

.auth-form-wrap {
    width: 100%;
    max-width: 420px;
}

.mobile-brand {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    font-weight: 700;
}

.auth-tabs {
    display: inline-flex;
    gap: 3px;
    margin-bottom: 30px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.auth-tabs[hidden] {
    display: none;
}

.auth-tab {
    min-width: 76px;
    height: 34px;
    padding: 0 14px;
    color: var(--muted);
    border: 0;
    border-radius: 6px;
    background: transparent;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

.auth-tab.active {
    color: var(--ink);
    background: #ffffff;
    box-shadow: 0 1px 4px rgb(28 44 37 / 10%);
}

.auth-form-wrap h2 {
    margin: 0;
    font-size: clamp(28px, 3vw, 36px);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.auth-description {
    margin: 10px 0 28px;
    color: var(--muted);
    font-size: 14px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 17px;
}

.auth-forgot-button {
    align-self: flex-end;
    margin-top: -9px;
    padding: 2px 0;
    color: var(--brand);
    border: 0;
    background: transparent;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}

.auth-forgot-button:hover {
    text-decoration: underline;
}

.auth-form-note {
    margin: 0;
    padding: 10px 12px;
    color: #426458;
    border: 1px solid #c8d8d0;
    border-radius: 7px;
    background: #f2f8f4;
    font-size: 12px;
    line-height: 1.6;
}

.auth-back-button {
    align-self: center;
    padding: 4px 12px;
    color: var(--muted);
    border: 0;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.auth-back-button:hover {
    color: var(--brand);
}

.auth-captcha-card {
    padding: 12px 13px;
    border: 1px solid #c8d8d0;
    border-radius: 8px;
    background: #f2f8f4;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.auth-captcha-heading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-captcha-heading > div {
    min-width: 0;
}

.auth-captcha-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    color: var(--brand);
    border: 1px solid #c8d8d0;
    border-radius: 8px;
    background: #ffffff;
}

.auth-captcha-icon svg {
    width: 19px;
    height: 19px;
}

.auth-captcha-heading strong {
    display: block;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.35;
}

.auth-captcha-heading p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.auth-captcha-card.loading {
    border-style: dashed;
}

.auth-captcha-card.verified {
    border-color: #a9cebd;
    background: #eaf5ee;
}

.auth-captcha-card.verified .auth-captcha-icon {
    color: var(--success);
    border-color: #b9d7c8;
}

.auth-captcha-card.error {
    border-color: #e3b8b2;
    background: var(--danger-soft);
}

.auth-captcha-card.error .auth-captcha-icon,
.auth-captcha-card.error .auth-captcha-heading strong {
    color: var(--danger);
}

.aliyun-captcha-element {
    width: 100%;
}

.auth-submit {
    width: 100%;
    min-height: 46px;
    margin-top: 5px;
}

/* Main application */
.app-view {
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    background: var(--canvas);
}

.app-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 66px;
    padding: 0 24px;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 30;
}

.header-left,
.header-user {
    display: flex;
    align-items: center;
}

.header-left {
    gap: 10px;
}

.header-user {
    justify-content: flex-end;
    gap: 9px;
    min-width: 0;
}

.whitelist-admin-button {
    min-height: 34px;
    padding: 0 10px;
    gap: 6px;
    font-size: 12px;
}

.whitelist-admin-button svg {
    width: 15px;
    height: 15px;
}

.system-log-button {
    min-height: 34px;
    padding: 0 10px;
    gap: 6px;
    font-size: 12px;
}

.system-log-button svg {
    width: 15px;
    height: 15px;
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    color: #ffffff;
    border-radius: 50%;
    background: #49685d;
    font-size: 12px;
    font-weight: 700;
}

.user-name {
    max-width: 150px;
    overflow: hidden;
    color: var(--muted-strong);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-menu-button {
    display: none;
}

.workspace {
    display: grid;
    grid-template-columns: 286px minmax(0, 1fr);
    height: calc(100vh - 66px);
    min-height: 0;
    overflow: hidden;
}

.bottom-nav {
    display: none;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: min(100%, 540px);
    height: var(--bottom-nav-height);
    padding: 5px 8px max(5px, env(safe-area-inset-bottom));
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    background: rgb(255 255 255 / 98%);
    box-shadow: 0 -8px 24px rgb(24 43 35 / 9%);
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    margin-inline: auto;
    z-index: 60;
}

.bottom-nav-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    padding: 0 10px;
    color: var(--muted);
    border: 0;
    border-radius: 7px;
    background: transparent;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}

.bottom-nav-tab.active {
    color: var(--brand);
    background: var(--brand-soft);
}

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

.bottom-nav-icon-wrap {
    display: inline-flex;
    position: relative;
}

.bottom-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: var(--danger);
    font-size: 9px;
    line-height: 1;
    position: absolute;
    top: -8px;
    right: -10px;
}

.rectification-view {
    width: min(100%, 980px);
    margin: 0 auto;
}

.system-log-view {
    width: min(100%, 1120px);
    margin: 0 auto;
}

.system-log-page-head {
    margin-bottom: 18px;
}

.system-log-page-head h1 {
    margin: 10px 0 4px;
    font-size: 28px;
}

.system-log-page-head p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.system-log-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    color: var(--brand);
    border: 0;
    background: transparent;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.system-log-back svg {
    width: 15px;
    height: 15px;
}

.system-log-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(130px, 180px)) auto;
    align-items: end;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.system-log-filter {
    display: grid;
    gap: 5px;
    color: var(--muted-strong);
    font-size: 10px;
    font-weight: 650;
}

.system-log-filter select {
    width: 100%;
    height: 36px;
    padding: 0 28px 0 9px;
    color: var(--ink);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: #ffffff;
    font: inherit;
    font-size: 12px;
}

.system-log-refresh {
    min-height: 36px;
    font-size: 11px;
}

.system-log-list {
    display: grid;
    gap: 8px;
}

.system-log-item {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.system-log-item-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.system-log-item-head strong {
    color: var(--ink);
    font-size: 12px;
}

.system-log-item-head time {
    margin-left: auto;
    color: var(--muted);
    font-size: 10px;
    white-space: nowrap;
}

.system-log-category {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 20px;
    padding: 0 6px;
    color: var(--brand);
    border: 1px solid #bfd6cb;
    border-radius: 999px;
    background: #edf6f1;
    font-size: 9px;
    font-weight: 750;
}

.system-log-category.auth {
    color: #315f95;
    border-color: #c5d7e9;
    background: #eef5fc;
}

.system-log-category.modify {
    color: #8b5b18;
    border-color: #e5d0ae;
    background: #fff8eb;
}

.system-log-category.browse {
    color: #52635b;
    border-color: #d3ddd8;
    background: #f2f6f4;
}

.system-log-actor-meta {
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.system-log-item-body {
    margin-top: 8px;
}

.system-log-item-body strong {
    color: var(--ink);
    font-size: 13px;
}

.system-log-item-body p {
    margin: 4px 0 0;
    color: var(--muted-strong);
    font-size: 11px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.system-log-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 14px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 9.5px;
}

.system-log-agent {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.system-log-empty {
    padding: 54px 20px;
    color: var(--muted);
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    background: var(--surface-soft);
    text-align: center;
    font-size: 12px;
}

.system-log-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.system-log-page-status {
    color: var(--muted);
    font-size: 11px;
}

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

.rectification-page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.rectification-create-entry {
    min-height: 34px;
    padding: 0 10px;
    gap: 6px;
    font-size: 12px;
}

.rectification-create-entry svg {
    width: 15px;
    height: 15px;
}

.rectification-page-leading {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.rectification-back-customers {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 34px;
    gap: 5px;
    padding: 0 10px;
    color: var(--brand);
    border: 1px solid #bfd3ca;
    border-radius: 7px;
    background: #ffffff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.rectification-back-customers svg {
    width: 15px;
    height: 15px;
}

.overview-big-store-button,
.overview-map-button,
.overview-representative-stats-button,
.overview-rectification-button {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 34px;
    gap: 6px;
    padding: 0 10px;
    color: var(--brand);
    border: 1px solid #bfd3ca;
    border-radius: 7px;
    background: #ffffff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.overview-big-store-button svg,
.overview-map-button svg,
.overview-representative-stats-button svg,
.overview-rectification-button svg {
    width: 16px;
    height: 16px;
}

.overview-representative-stats-button.active {
    color: var(--brand-hover);
    border-color: #adc2b9;
    background: var(--brand-soft);
}

.overview-rectification-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    color: #ffffff;
    border-radius: 999px;
    background: var(--danger);
    font-size: 9px;
}

.rectification-page-head h1 {
    margin: 0;
    font-size: 24px;
}

.rectification-page-head p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.rectification-unread-summary {
    padding: 5px 9px;
    color: var(--danger);
    border: 1px solid #e7c0ba;
    border-radius: 999px;
    background: var(--danger-soft);
    font-size: 11px;
    font-weight: 700;
}

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

.rectification-list-empty {
    grid-column: 1 / -1;
    padding: 42px 20px;
    color: var(--muted);
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    background: #f8faf8;
    font-size: 13px;
    text-align: center;
}

.rectification-card {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    text-align: left;
}

.rectification-card.unread {
    border-color: #b8d5c8;
    box-shadow: inset 3px 0 0 var(--brand);
}

.rectification-card-cover {
    width: 88px;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 6px;
    background: #e4ebe7;
}

.rectification-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    transition: opacity 120ms ease;
}

.rectification-card-cover img[data-rectification-filename]:not([data-rectification-loaded]),
.rectification-photo img[data-rectification-filename]:not([data-rectification-loaded]) {
    opacity: 0.3;
}

.rectification-card-cover img.is-error,
.rectification-photo img.is-error {
    opacity: 0;
}

.rectification-card-copy {
    min-width: 0;
}

.rectification-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.rectification-card-heading strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rectification-card p {
    display: -webkit-box;
    overflow: hidden;
    margin: 8px 0 0;
    color: var(--muted-strong);
    font-size: 11px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.rectification-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 9px;
    color: var(--muted);
    font-size: 10px;
}

.rectification-status {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 7px;
    color: #765619;
    border: 1px solid #e7d6ad;
    border-radius: 999px;
    background: #fff8e8;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.rectification-status.corrected {
    color: #216449;
    border-color: #b8d8c9;
    background: #eaf6ef;
}

.rectification-modal-panel {
    width: min(100%, 760px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#rectification-detail-modal.is-detail-fullscreen {
    display: grid;
    place-items: stretch;
    padding: 0;
}

#rectification-detail-modal.is-detail-fullscreen .rectification-modal-panel {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

#rectification-detail-modal.is-detail-fullscreen .modal-header {
    padding-right: max(24px, env(safe-area-inset-right));
    padding-left: max(24px, env(safe-area-inset-left));
}

#rectification-detail-modal.is-detail-fullscreen .rectification-detail-scroll {
    padding-right: max(24px, env(safe-area-inset-right));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    padding-left: max(24px, env(safe-area-inset-left));
}

#rectification-detail-modal.is-detail-fullscreen .rectification-photo {
    aspect-ratio: 4 / 3;
    background: #eef1ee;
}

#rectification-detail-modal.is-detail-fullscreen .rectification-photo img {
    object-fit: contain;
}

#rectification-detail-modal.is-detail-fullscreen
    .rectification-photo-grid.compare-photo-grid {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.rectification-modal-subtitle {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.rectification-detail-heading {
    min-width: 0;
}

.rectification-detail-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
}

.rectification-detail-title-row h2 {
    margin: 0;
}

.rectification-form {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.rectification-form-scroll,
.rectification-detail-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 24px;
}

.rectification-assignment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.rectification-customer-picker {
    position: relative;
}

.rectification-customer-results {
    max-height: 220px;
    overflow-y: auto;
    padding: 5px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgb(20 38 31 / 16%);
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    z-index: 5;
}

.rectification-customer-option {
    display: block;
    width: 100%;
    padding: 8px 9px;
    color: var(--ink);
    border: 0;
    border-radius: 5px;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.rectification-customer-option:hover,
.rectification-customer-option:focus-visible {
    background: var(--brand-soft);
    outline: none;
}

.rectification-customer-option strong,
.rectification-customer-option span {
    display: block;
}

.rectification-customer-option strong {
    font-size: 12px;
}

.rectification-customer-option span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.rectification-customer-empty {
    padding: 14px 10px;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.rectification-responsible-display {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #f4f7f5;
    font-size: 12px;
    line-height: 1.45;
}

.rectification-responsible-display.matched {
    color: var(--brand);
    border-color: #b9d1c6;
    background: #edf6f1;
    font-weight: 650;
}

.rectification-responsible-display.missing {
    color: var(--danger);
    border-color: #e6c1bb;
    background: var(--danger-soft);
}

.rectification-upload-section,
.rectification-detail-block {
    margin-top: 16px;
}

.rectification-detail-block:first-child {
    margin-top: 0;
}

.rectification-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
    font-size: 13px;
}

.rectification-section-heading span,
.rectification-detail-block > h3 {
    color: var(--muted);
    font-size: 12px;
}

.rectification-detail-block > h3 {
    margin: 0 0 9px;
    color: var(--ink);
    font-size: 14px;
}

.rectification-detail-block > p {
    margin: 0;
    color: var(--muted-strong);
    font-size: 13px;
    line-height: 1.7;
}

.rectification-compare-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
}

.rectification-compare-column {
    min-width: 0;
}

.rectification-compare-copy h3 {
    margin: 0 0 9px;
    color: var(--ink);
    font-size: 13px;
}

.rectification-compare-description {
    display: none;
}

.rectification-compare-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-height: 100%;
}

.rectification-compare-symbol {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: var(--brand);
    border: 1px solid #bfd6cb;
    border-radius: 50%;
    background: var(--brand-soft);
}

.rectification-compare-symbol svg {
    width: 17px;
    height: 17px;
}

.rectification-photo-grid.compare-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rectification-photo-grid.compare-photo-grid .rectification-photo {
    aspect-ratio: 4 / 3;
    background: #eef1ee;
}

.rectification-photo-grid.compare-photo-grid .rectification-photo img {
    object-fit: contain;
}

.rectification-photo-add {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    gap: 7px;
    color: var(--muted-strong);
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    background: #f8faf9;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}

.rectification-photo-add:hover {
    color: var(--brand);
    border-color: #9bbeb0;
    background: var(--brand-soft);
}

.rectification-photo-add svg {
    width: 17px;
    height: 17px;
}

.rectification-photo-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-top: 9px;
}

.rectification-photo-grid:empty {
    display: none;
}

.rectification-photo {
    aspect-ratio: 1;
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
    cursor: zoom-in;
    position: relative;
}

.rectification-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rectification-modal-actions {
    flex: 0 0 auto;
    margin: 0;
    padding: 14px 24px;
    border-top: 1px solid var(--line);
    background: #ffffff;
}

.rectification-fix-upload {
    margin-top: 12px;
}

.customer-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 22px 16px 18px;
    border-right: 1px solid var(--line);
    background: #f9faf9;
}

.sidebar-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 4px 18px;
}

.sidebar-header .eyebrow {
    margin-bottom: 4px;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.15;
}

.search-field {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    margin: 0;
    padding: 0 10px;
    color: #8b9691;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #ffffff;
}

.search-field svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.search-field input {
    width: 100%;
    min-width: 0;
    padding: 0;
    color: var(--ink);
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 12px;
}

.search-field input::placeholder {
    color: #a2aba7;
}

.sidebar-search {
    height: 52px;
    padding: 0 14px;
    gap: 10px;
    border-radius: 8px;
}

.sidebar-search svg {
    width: 20px;
    height: 20px;
}

.sidebar-search input {
    font-size: 14px;
}

.customer-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    margin-top: 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
    scrollbar-color: #b7c5be transparent;
    scrollbar-width: thin;
}

.customer-list::-webkit-scrollbar,
.content-area::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.customer-list::-webkit-scrollbar-track,
.content-area::-webkit-scrollbar-track {
    background: transparent;
}

.customer-list::-webkit-scrollbar-thumb,
.content-area::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: #b7c5be;
    background-clip: padding-box;
}

.customer-list::-webkit-scrollbar-thumb:hover,
.content-area::-webkit-scrollbar-thumb:hover {
    background: #93a79d;
    background-clip: padding-box;
}

.customer-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px;
    color: var(--ink);
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.customer-item:hover {
    border-color: var(--line);
    background: #ffffff;
}

.customer-item.active {
    border-color: #cddbd4;
    background: #ffffff;
    box-shadow: 0 7px 20px rgb(31 54 44 / 7%);
}

.customer-thumb {
    width: 44px;
    height: 44px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--brand-soft);
}

.customer-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.customer-thumb.empty {
    display: grid;
    place-items: center;
    color: #789186;
}

.customer-thumb.empty svg {
    width: 18px;
    height: 18px;
}

.customer-item-copy {
    min-width: 0;
}

.customer-item-name {
    display: block;
    overflow: hidden;
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-item-meta {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-list-empty {
    padding: 30px 16px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
    text-align: center;
}

.content-area {
    height: 100%;
    min-width: 0;
    padding: clamp(18px, 2.2vw, 30px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: #b7c5be transparent;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
}

.initial-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 70vh;
    color: var(--muted);
    font-size: 13px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 72vh;
    text-align: center;
}

.empty-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    color: var(--brand);
    border: 1px solid #cbd9d2;
    border-radius: 8px;
    background: var(--brand-soft);
}

.empty-icon svg {
    width: 28px;
    height: 28px;
}

.empty-state h2 {
    margin: 0;
    font-size: 28px;
}

.empty-state > p:not(.eyebrow) {
    margin: 10px 0 24px;
    color: var(--muted);
    font-size: 13px;
}

.customer-overview {
    max-width: 1600px;
    margin: 0 auto;
}

.overview-sticky-head {
    margin-top: calc(-1 * clamp(18px, 2.2vw, 30px));
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
    background: var(--canvas);
    position: sticky;
    top: calc(-1 * clamp(18px, 2.2vw, 30px));
    z-index: 20;
}

.overview-heading-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 14px;
    min-width: 0;
    padding-right: 390px;
    position: relative;
}

.overview-heading-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    top: 0;
    right: 0;
}

.overview-search-toggle {
    display: none;
}

.overview-search-toggle[aria-expanded="true"] .filter-chevron {
    transform: rotate(180deg);
}

.overview-heading-row h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.overview-new-customer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 12px;
    color: var(--brand);
    border: 1px solid #cbd7d1;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgb(20 45 36 / 6%);
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
    cursor: pointer;
    transition: color 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.overview-new-customer svg {
    width: 16px;
    height: 16px;
}

.overview-new-customer:hover {
    color: var(--brand-hover);
    border-color: #adc2b9;
    background: var(--brand-soft);
    box-shadow: 0 3px 9px rgb(20 45 36 / 9%);
}

.overview-new-customer:focus-visible {
    outline: 3px solid rgb(45 139 110 / 20%);
    outline-offset: 2px;
}

.overview-toolbar-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.overview-toolbar-row .button {
    justify-self: start;
}

.representative-stats-panel {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgb(27 48 40 / 8%);
}

.representative-stats-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.representative-stats-heading strong {
    color: #213c33;
    font-size: 14px;
}

.representative-stats-heading p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.representative-stats-scroll {
    overflow: auto;
    border: 1px solid #e2e9e5;
    border-radius: 6px;
}

.representative-stats-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: 12px;
}

.representative-stats-table th,
.representative-stats-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #e7ece9;
    text-align: right;
    white-space: nowrap;
}

.representative-stats-table th:first-child,
.representative-stats-table td:first-child {
    text-align: left;
}

.representative-stats-table th {
    color: #52635b;
    background: #f5f8f6;
    font-weight: 650;
}

.representative-stats-table tbody tr:last-child td {
    border-bottom: 0;
}

.representative-stats-rate {
    color: var(--brand-hover);
    font-weight: 700;
}

.overview-summary {
    flex: 0 0 auto;
    min-width: max-content;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    white-space: nowrap;
    overflow: visible;
}

.overview-search {
    width: min(100%, 480px);
    margin: 0;
}

.overview-heading-row > .overview-search {
    flex: 0 1 432px;
    width: 432px;
    min-width: 198px;
    max-width: 432px;
}

.overview-filter-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 0;
    min-width: 0;
}

.overview-filter-group .filter-button {
    min-width: 128px;
}

.overview-photo-filter {
    margin-left: 0;
    justify-content: center;
    gap: 5px;
    border-left: 0;
    border-radius: 0 7px 7px 0;
}

.overview-photo-filter svg {
    width: 15px;
    height: 15px;
}

.channel-filter .filter-button {
    border-radius: 7px 0 0 7px;
}

.representative-filter:not(.channel-filter):not(.district-filter):not(.monthly-pickup-filter):not(.annual-sales-filter):not(.display-stand-filter) .filter-button {
    border-left: 0;
    border-radius: 0;
}

.district-filter .filter-button {
    border-left: 0;
    border-radius: 0;
}

.monthly-pickup-filter .filter-button {
    border-left: 0;
    border-radius: 0;
}

.annual-sales-filter .filter-button {
    min-width: 148px;
    border-left: 0;
    border-radius: 0;
}

.display-stand-filter .filter-button {
    min-width: 120px;
    border-left: 0;
    border-radius: 0;
}

.overview-filter-group.without-photo-filter .monthly-pickup-filter .filter-button {
    border-radius: 0 7px 7px 0;
}

.overview-bulk-delete {
    margin-left: auto;
    white-space: nowrap;
}

.overview-bulk-delete svg {
    width: 15px;
    height: 15px;
}

.representative-filter {
    position: relative;
}

.filter-button {
    min-width: 168px;
    min-height: 40px;
    padding: 0 12px;
    justify-content: space-between;
}

.overview-filter-group .overview-photo-filter {
    justify-content: center;
    gap: 5px;
}

.filter-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    transition: transform 160ms ease;
}

.filter-chevron svg {
    width: 14px;
    height: 14px;
}

.filter-button[aria-expanded="true"] .filter-chevron {
    transform: rotate(180deg);
}

.filter-button.active {
    color: #ffffff;
    border-color: var(--brand);
    background: var(--brand);
}

.button.filter-button.active:hover:not(:disabled),
.button.filter-button.active:focus-visible {
    color: #ffffff;
    border-color: var(--brand);
    background: var(--brand);
}

.filter-popover {
    width: min(250px, calc(100vw - 28px));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 38px rgb(25 42 35 / 16%);
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 40;
}

.filter-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
}

.filter-popover-header strong {
    font-size: 12px;
}

.filter-search-field {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 10px 10px 6px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
}

.filter-search-field svg {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    color: var(--muted);
}

.filter-search-field input {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 12px;
}

.filter-clear {
    padding: 0;
    color: var(--brand);
    border: 0;
    background: transparent;
    font-size: 10px;
    cursor: pointer;
}

.filter-clear:hover {
    text-decoration: underline;
}

.filter-options {
    max-height: 250px;
    overflow-y: auto;
    padding: 5px;
    overscroll-behavior: contain;
}

.filter-amount-custom {
    padding: 10px 12px 12px;
    border-top: 1px solid var(--line);
    background: var(--surface-soft);
}

.filter-amount-custom > label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted-strong);
    font-size: 11px;
    font-weight: 650;
}

.filter-amount-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
}

.filter-amount-control input {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 0 9px;
    color: var(--ink);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: #ffffff;
    font: inherit;
    font-size: 12px;
}

.filter-amount-control > span {
    color: var(--muted);
    font-size: 11px;
}

.filter-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 36px;
    padding: 0 9px;
    color: var(--muted-strong);
    border: 0;
    border-radius: 6px;
    background: transparent;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
}

.filter-option:hover {
    color: var(--ink);
    background: var(--surface-soft);
}

.filter-option.active {
    color: var(--brand);
    background: var(--brand-soft);
    font-weight: 700;
}

.filter-option-count {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
}

.filter-empty {
    padding: 20px 12px;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.customer-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 128px;
    gap: 14px;
}

.overview-card-shell {
    min-width: 0;
    height: 128px;
    position: relative;
}

.overview-card-shell .customer-overview-card {
    width: 100%;
    height: 100%;
}

.overview-card-map {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    gap: 3px;
    padding: 0 6px;
    color: var(--brand);
    border: 1px solid #bfd3ca;
    border-radius: 5px;
    background: rgb(255 255 255 / 96%);
    box-shadow: 0 2px 7px rgb(20 45 36 / 12%);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 2;
}

.overview-card-map:hover {
    border-color: #8fb4a5;
    background: var(--brand-soft);
}

.overview-card-map svg {
    width: 12px;
    height: 12px;
}

.customer-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0 8px;
}

.customer-page-nav {
    min-height: 36px;
    padding: 0 11px;
    gap: 5px;
    font-size: 12px;
}

.customer-page-nav svg {
    width: 15px;
    height: 15px;
}

.customer-page-status {
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.customer-overview-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    align-items: stretch;
    min-width: 0;
    height: 128px;
    min-height: 128px;
    max-height: 128px;
    overflow: hidden;
    padding: 0;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    text-align: left;
    cursor: pointer;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.customer-overview-card:hover {
    border-color: #bdcbc4;
    box-shadow: 0 14px 30px rgb(27 48 39 / 9%);
    transform: translateY(-2px);
}

.customer-overview-card.channel-jd {
    border-color: #ead1a7;
    background: #fff8ea;
    box-shadow: inset 3px 0 0 #c97a24;
}

.customer-overview-card.channel-tmall {
    border-color: #bdd6f3;
    background: #eff6ff;
    box-shadow: inset 3px 0 0 #1f7ae0;
}

.customer-overview-card.channel-other {
    border-color: #c4dacd;
    background: #f0f8f3;
    box-shadow: inset 3px 0 0 #397b62;
}

.customer-overview-card.channel-unassigned {
    border-color: #d6dcda;
    background: #f6f7f6;
    box-shadow: inset 3px 0 0 #89938e;
}

.customer-overview-card.channel-jd:hover {
    border-color: #d7aa63;
    box-shadow:
        inset 3px 0 0 #c97a24,
        0 14px 30px rgb(120 76 24 / 13%);
}

.customer-overview-card.channel-tmall:hover {
    border-color: #79aee7;
    box-shadow:
        inset 3px 0 0 #1f7ae0,
        0 14px 30px rgb(31 91 155 / 13%);
}

.customer-overview-card.channel-other:hover {
    border-color: #83b29c;
    box-shadow:
        inset 3px 0 0 #397b62,
        0 14px 30px rgb(39 96 74 / 12%);
}

.customer-overview-card.channel-unassigned:hover {
    border-color: #b8c1bd;
    box-shadow:
        inset 3px 0 0 #89938e,
        0 14px 30px rgb(57 69 64 / 10%);
}

.overview-cover {
    min-height: 0;
    overflow: hidden;
    background: #dfe7e3;
    position: relative;
}

.overview-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 220ms ease;
}

.customer-overview-card:hover .overview-cover img {
    transform: scale(1.025);
}

.overview-cover.placeholder {
    display: grid;
    place-items: center;
    color: #789186;
    background: var(--brand-soft);
}

.overview-cover.placeholder svg {
    width: 32px;
    height: 32px;
}

.overview-photo-count {
    padding: 5px 8px;
    color: #ffffff;
    border-radius: 999px;
    background: rgb(18 30 25 / 70%);
    font-size: 10px;
    font-weight: 700;
    position: absolute;
    top: 9px;
    left: 9px;
}

.overview-photo-count.incomplete {
    background: rgb(150 65 48 / 82%);
}

.overview-card-body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
    padding: 12px 13px;
}

.overview-card-body h2 {
    margin: 0;
    overflow: visible;
    font-size: 14px;
    line-height: 1.3;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
}

.overview-card-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.overview-card-title-row h2 {
    min-width: 0;
    flex: 1 1 auto;
}

.overview-card-name {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1 1 auto;
    gap: 5px;
}

.overview-card-name h2 {
    min-width: 0;
}

.customer-store-badges {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 4px;
}

.store-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 18px;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.3;
    white-space: nowrap;
}

.store-type-badge.v11 {
    color: #176247;
    border: 1px solid #b8d9ca;
    background: #e8f5ef;
}

.store-type-badge.a2000 {
    color: #93540d;
    border: 1px solid #ead0ad;
    background: #fff5e8;
}

.overview-card-representative {
    max-width: none;
    flex: 0 0 auto;
    overflow: visible;
    padding: 2px 6px;
    color: var(--brand);
    border: 1px solid #cfded7;
    border-radius: 4px;
    background: #eef6f2;
    font-size: 10px;
    font-weight: 650;
    line-height: 1.35;
    text-align: right;
    text-overflow: clip;
    white-space: nowrap;
}

.overview-card-meta {
    margin: 5px 0 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overview-card-owner {
    margin: 7px 0 0;
    overflow: hidden;
    color: var(--muted-strong);
    font-size: 11px;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overview-card-updated {
    align-self: flex-end;
    margin: auto 0 0;
    padding-right: 51px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.4;
    text-align: right;
    white-space: nowrap;
}

.overview-no-results {
    grid-column: 1 / -1;
    padding: 50px 20px;
    color: var(--muted);
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    background: #f8faf8;
    font-size: 13px;
    text-align: center;
}

.customer-detail {
    max-width: 1260px;
    margin: 0 auto;
}

.detail-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    margin-top: calc(-1 * clamp(22px, 3vw, 40px));
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    background: var(--canvas);
    position: sticky;
    top: calc(-1 * clamp(22px, 3vw, 40px));
    z-index: 20;
}

.detail-topbar h1 {
    min-width: 0;
    flex: 1 1 auto;
    margin: 0;
    overflow: hidden;
    font-size: 21px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-topbar .photo-count-badge {
    flex: 0 0 auto;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
    align-items: start;
    gap: 18px;
    margin-top: 12px;
}

.customer-profile,
.photo-workspace {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.customer-profile {
    position: sticky;
    top: 28px;
}

.back-to-overview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    margin: 0;
    padding: 0 13px;
    color: #ffffff;
    border: 1px solid var(--brand);
    border-radius: 7px;
    background: var(--brand);
    box-shadow: 0 7px 16px rgb(23 63 53 / 18%);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.back-to-overview:hover {
    color: #ffffff;
    border-color: var(--brand-hover);
    background: var(--brand-hover);
    box-shadow: 0 9px 20px rgb(23 63 53 / 24%);
}

.back-to-overview:active {
    transform: translateY(1px);
}

.back-to-overview svg {
    width: 17px;
    height: 17px;
}

.profile-actions-bar {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--line);
}

.profile-actions-bar > strong {
    font-size: 14px;
}

.profile-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.profile-title-row strong {
    font-size: 14px;
}

.profile-title-row .icon-button {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
}

.profile-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.detail-map-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    min-height: 34px;
    gap: 5px;
    padding: 0 9px;
    color: var(--brand);
    border: 1px solid #bfd3ca;
    border-radius: 6px;
    background: #ffffff;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.detail-map-link:hover {
    border-color: #8fb4a5;
    background: var(--brand-soft);
}

.detail-map-link svg {
    width: 14px;
    height: 14px;
}

.photo-count-badge {
    padding: 4px 9px;
    color: var(--muted-strong);
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font-size: 11px;
    font-weight: 650;
}

.photo-count-badge.complete {
    color: var(--success);
    border-color: #cfe1d8;
    background: #edf6f1;
}

.detail-notes {
    max-width: 720px;
    margin: 13px 0 0;
    color: var(--muted-strong);
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
}

.customer-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 4px;
}

.customer-info-item {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.customer-info-item:last-child {
    border-bottom: 0;
}

.customer-info-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 34px;
    margin: 4px 0;
    padding: 0 8px;
    color: var(--brand);
    border: 1px solid #c8dad1;
    border-radius: 6px;
    background: var(--brand-soft);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.customer-info-toggle svg {
    width: 15px;
    height: 15px;
    transition: transform 160ms ease;
}

.customer-info-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.customer-info-label {
    display: block;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.45;
}

.customer-info-value {
    display: block;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}

.customer-info-value-row {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    min-width: 0;
}

.customer-info-value-row .customer-info-value {
    min-width: 0;
    flex: 1 1 auto;
}

.customer-info-item.contact {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
}

.customer-info-item.contact .customer-info-value-row {
    align-items: center;
    gap: 8px;
}

.customer-info-item.contact .customer-info-value {
    overflow-wrap: normal;
    word-break: normal;
}

.customer-info-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 27px;
    width: 27px;
    height: 27px;
    margin-top: -4px;
    padding: 0;
    color: var(--muted-strong);
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.customer-info-copy:hover {
    color: var(--primary);
    background: #edf5f1;
}

.customer-info-copy:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.customer-info-copy:disabled {
    cursor: wait;
    opacity: 0.55;
}

.customer-info-copy svg {
    width: 15px;
    height: 15px;
    stroke-width: 1.75;
}

.customer-info-value.empty {
    color: #9aa49f;
    font-weight: 500;
}

.detail-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.customer-profile .detail-actions {
    width: auto;
}

.customer-profile .detail-actions .button {
    flex: 0 0 auto;
    height: 34px;
    min-height: 34px;
}

.photo-workspace {
    min-height: 420px;
}

.gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 0 18px;
}

.gallery-toolbar h2 {
    margin: 0;
    font-size: 18px;
}

.gallery-hint {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

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

.photo-grid.reordering {
    touch-action: none;
}

.photo-tile {
    min-width: 0;
    position: relative;
    transition: opacity 140ms ease, transform 140ms ease;
}

.photo-tile.is-dragging {
    opacity: 0.55;
    transform: scale(0.97);
    z-index: 3;
}

.photo-card {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #dfe6e2;
    cursor: zoom-in;
    position: relative;
    touch-action: pan-y;
    user-select: none;
    -webkit-touch-callout: none;
}

.photo-grid.reordering .photo-card {
    cursor: grabbing;
    touch-action: none;
}

.photo-delete {
    width: 30px;
    height: 30px;
    color: #ffffff;
    background: rgb(20 30 26 / 68%);
    position: absolute;
    top: 7px;
    right: 7px;
    z-index: 2;
}

.photo-delete:hover {
    color: #ffffff;
    background: var(--danger);
}

.photo-delete:disabled {
    cursor: not-allowed;
    opacity: 0.38;
}

.photo-delete svg {
    width: 15px;
    height: 15px;
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 220ms ease;
}

.photo-card:hover img {
    transform: scale(1.025);
}

.photo-card::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 34%;
    background: rgb(16 26 22 / 12%);
    pointer-events: none;
}

.photo-index {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 1;
    min-width: 25px;
    padding: 3px 6px;
    color: #ffffff;
    border-radius: 999px;
    background: rgb(20 30 26 / 68%);
    font-size: 10px;
    font-weight: 650;
    text-align: center;
}

.photo-upload-time {
    max-width: calc(100% - 48px);
    overflow: hidden;
    padding: 3px 6px;
    color: #ffffff;
    border-radius: 4px;
    background: rgb(20 30 26 / 68%);
    font-size: 9px;
    font-weight: 600;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
    position: absolute;
    top: 7px;
    left: 7px;
    z-index: 1;
}

.photo-grid-empty {
    grid-column: 1 / -1;
    padding: 44px 20px;
    color: var(--muted);
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    background: #f8faf8;
    font-size: 13px;
    text-align: center;
}

/* Modals */
.modal-shell {
    display: grid;
    place-items: center;
    padding: 22px;
    position: fixed;
    inset: 0;
    z-index: 100;
}

#confirm-modal {
    z-index: 180;
}

.modal-backdrop {
    background: rgb(16 25 21 / 55%);
    position: absolute;
    inset: 0;
}

.modal {
    width: min(100%, 620px);
    max-height: calc(100vh - 44px);
    overflow: auto;
    border: 1px solid #d4dcd8;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1;
}

.customer-modal-panel {
    width: min(100%, 760px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.whitelist-modal-panel {
    width: min(100%, 860px);
}

.whitelist-admin-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    min-height: 420px;
}

.whitelist-create-panel,
.whitelist-list-panel {
    min-width: 0;
    padding: 22px 24px;
}

.whitelist-create-panel {
    border-right: 1px solid var(--line);
    background: #f8faf8;
}

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

.whitelist-section-heading h3 {
    margin: 0;
    font-size: 15px;
}

.whitelist-section-heading span {
    color: var(--muted);
    font-size: 12px;
}

.whitelist-user-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.whitelist-user-form .button {
    justify-content: center;
    min-height: 42px;
    margin-top: 2px;
}

.whitelist-user-list {
    max-height: min(54vh, 520px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.whitelist-user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 62px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}

.whitelist-user-item:last-child {
    border-bottom: 0;
}

.whitelist-user-copy {
    min-width: 0;
}

.whitelist-user-copy strong,
.whitelist-user-copy span {
    display: block;
}

.whitelist-user-copy strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.whitelist-user-copy span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.whitelist-user-actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 7px;
}

.whitelist-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 7px;
    color: #356a58;
    border: 1px solid #c7ddd2;
    border-radius: 999px;
    background: #eff8f3;
    font-size: 10px;
    font-weight: 650;
    white-space: nowrap;
}

.whitelist-status.pending {
    color: #786435;
    border-color: #ded1a9;
    background: #fbf8ec;
}

.whitelist-status.admin {
    color: #174b3d;
    border-color: #9fc6b7;
    background: #e3f3eb;
}

.whitelist-role-select {
    min-width: 76px;
    height: 29px;
    padding: 0 22px 0 8px;
    color: var(--muted-strong);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: #ffffff;
    font-size: 11px;
    font-weight: 650;
    cursor: pointer;
}

.whitelist-role-select:focus {
    border-color: #6f9d8a;
    outline: none;
    box-shadow: 0 0 0 3px rgb(45 139 110 / 11%);
}

.whitelist-user-actions .icon-button {
    width: 30px;
    height: 30px;
}

.whitelist-empty {
    padding: 28px 16px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--line);
}

.modal-header-actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 8px;
}

.whitelist-add-toggle {
    display: none;
    min-height: 34px;
    padding: 0 10px;
    gap: 6px;
    font-size: 12px;
}

.whitelist-add-toggle svg {
    width: 15px;
    height: 15px;
}

.modal-header .eyebrow {
    margin-bottom: 5px;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.customer-form {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.customer-form-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 22px 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.full-width {
    grid-column: 1 / -1;
}

.photo-category-block {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfb;
}

.photo-category-block:first-of-type {
    border-color: #c9d9d1;
    background: #f6faf7;
}

.photo-category-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.photo-category-heading h3 {
    margin: 0;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.35;
}

.photo-category-heading h3 b {
    color: var(--danger);
}

.photo-category-heading div > span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.modal-photo-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 11px;
}

.modal-photo-grid.category-photo-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 0;
}

.modal-photo {
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-soft);
    position: relative;
}

.modal-photo.empty {
    display: grid;
    place-items: center;
    padding: 8px;
    color: var(--muted);
    border-style: dashed;
    background: #fafcfb;
    text-align: center;
}

button.modal-photo-add {
    width: 100%;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

button.modal-photo-add:hover,
button.modal-photo-add:focus-visible {
    color: var(--brand);
    border-color: #9bbeb0;
    background: var(--brand-soft);
    outline: none;
}

.photo-slot-add {
    color: currentColor;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
}

.modal-photo.door-slot.empty {
    color: var(--danger);
    border-color: #d8a29b;
    background: var(--danger-soft);
}

.modal-photo .photo-slot-label {
    max-width: calc(100% - 10px);
    overflow: hidden;
    color: #ffffff;
    border-radius: 4px;
    background: rgb(20 31 26 / 72%);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
    position: absolute;
    left: 5px;
    bottom: 5px;
    padding: 2px 6px;
}

.modal-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-photo-preview-open {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    position: absolute;
    inset: 0;
}

.modal-photo-preview-open:focus-visible {
    outline: 3px solid rgb(45 139 110 / 30%);
    outline-offset: -3px;
}

.modal-photo-remove {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    color: #ffffff;
    border: 0;
    border-radius: 50%;
    background: rgb(29 39 35 / 72%);
    cursor: pointer;
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 2;
}

.modal-photo-remove:hover {
    background: var(--danger);
}

.modal-photo-remove svg {
    width: 13px;
    height: 13px;
}

.upload-progress {
    margin-top: 12px;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8faf9;
}

.upload-progress-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--ink);
    font-size: 12px;
}

.upload-progress-heading span {
    color: var(--brand);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.upload-progress-track {
    height: 8px;
    margin-top: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #e3eae6;
}

.upload-progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--brand);
    transition: width 160ms ease;
}

.upload-progress p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
}

.upload-progress.error {
    border-color: #efc8c3;
    background: var(--danger-soft);
}

.upload-progress.error .upload-progress-heading,
.upload-progress.error .upload-progress-heading span {
    color: var(--danger);
}

.upload-progress.error .upload-progress-track span {
    background: var(--danger);
}

.customer-form.is-uploading .modal-photo-remove {
    pointer-events: none;
    opacity: 0.52;
}

.customer-modal-panel .customer-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    flex: 0 0 auto;
    width: 100%;
    margin: 0;
    padding: 14px 24px;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
    position: static;
}

.customer-form-scroll > .form-alert {
    margin-top: 14px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.modal-footer.centered {
    justify-content: center;
}

.confirm-panel {
    width: min(100%, 420px);
    padding: 26px;
    text-align: center;
}

.confirm-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin: 0 auto 14px;
    color: var(--danger);
    border-radius: 8px;
    background: var(--danger-soft);
}

.confirm-icon svg {
    width: 23px;
    height: 23px;
}

.confirm-panel h2 {
    margin: 0;
    font-size: 21px;
}

.confirm-panel > p {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

/* Lightbox */
.lightbox {
    display: grid;
    place-items: center;
    padding: 52px 64px 14px;
    overflow: hidden;
    position: fixed;
    inset: 0;
    z-index: 120;
    background: rgb(10 15 13 / 94%);
    touch-action: none;
}

.lightbox.is-fullscreen {
    padding: 0;
}

.lightbox.is-fullscreen .lightbox-figure {
    width: 100%;
    height: 100%;
    position: relative;
}

.lightbox.is-fullscreen .lightbox-viewport {
    width: 100%;
    height: 100%;
}

.lightbox.is-fullscreen .lightbox-image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    object-fit: contain;
}

.lightbox.is-fullscreen .lightbox-figure figcaption {
    width: min(88vw, 760px);
    overflow: hidden;
    padding: 7px 12px;
    color: #ffffff;
    border-radius: 6px;
    background: rgb(10 15 13 / 66%);
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
    position: absolute;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
}

.lightbox.is-fullscreen .lightbox-nav {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
}

.lightbox-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-width: none;
    max-height: none;
    margin: 0;
}

.lightbox-viewport {
    display: grid;
    place-items: center;
    width: 100%;
    height: calc(100% - 28px);
    min-height: 0;
    max-width: none;
    max-height: none;
    overflow: hidden;
    position: relative;
}

.lightbox-image {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 4px;
    touch-action: none;
    user-select: none;
    -webkit-user-drag: none;
    will-change: transform, opacity, scale, translate;
    backface-visibility: hidden;
    transform-origin: center;
    transition:
        scale 190ms cubic-bezier(0.22, 0.74, 0.24, 1),
        translate 190ms cubic-bezier(0.22, 0.74, 0.24, 1);
    cursor: zoom-in;
}

.lightbox-image.is-zoomed {
    cursor: zoom-out;
}

.lightbox-image.is-pinching {
    transition: none;
}

.lightbox-image.incoming {
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

.lightbox-viewport.is-animating {
    pointer-events: none;
}

.lightbox-figure figcaption {
    flex: 0 0 auto;
    margin-top: 8px;
    color: #d8e1dd;
    font-size: 12px;
}

.lightbox-close {
    color: #ffffff;
    position: absolute;
    top: 16px;
    right: 18px;
}

.lightbox-close:hover {
    color: #ffffff;
    background: rgb(255 255 255 / 12%);
}

.lightbox-zoom {
    width: 38px;
    height: 38px;
    color: #ffffff;
    font-size: 22px;
    line-height: 1;
    position: absolute;
    top: 16px;
    right: 70px;
}

.lightbox-zoom:hover {
    color: #ffffff;
    background: rgb(255 255 255 / 12%);
}

.lightbox-nav {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    color: #ffffff;
    border: 1px solid rgb(255 255 255 / 18%);
    border-radius: 50%;
    background: rgb(255 255 255 / 6%);
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-nav:hover {
    background: rgb(255 255 255 / 13%);
}

.lightbox-nav.previous {
    left: 18px;
}

.lightbox-nav.next {
    right: 18px;
}

/* Toasts */
.toast-region {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    width: min(92vw, 390px);
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 200;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    width: fit-content;
    max-width: 100%;
    padding: 11px 13px;
    color: #ffffff;
    border-radius: 7px;
    background: #24352e;
    box-shadow: 0 12px 30px rgb(20 34 28 / 24%);
    font-size: 12px;
    line-height: 1.55;
    animation: toast-in 180ms ease-out both;
    pointer-events: auto;
}

.toast.error {
    background: #7e3030;
}

.toast svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    margin-top: 1px;
}

.sidebar-backdrop {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.workspace.map-workspace {
    display: block;
}

.workspace.map-workspace .customer-sidebar,
.workspace.map-workspace .sidebar-backdrop {
    display: none;
}

.content-area.map-mode {
    padding: 0;
    overflow: hidden;
    scrollbar-gutter: auto;
}

.customer-map-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #e8ede9;
}

.map-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    flex: 0 0 auto;
    gap: 18px;
    min-height: 74px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
}

.map-page-heading {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 16px;
}

.map-page-heading h1 {
    margin: 0;
    font-size: 23px;
    line-height: 1.2;
}

.map-page-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.map-back-overview {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 36px;
    gap: 5px;
    padding: 0 11px;
    color: var(--brand);
    border: 1px solid #bfd3ca;
    border-radius: 7px;
    background: #ffffff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.map-back-overview svg,
.map-fit-button svg {
    width: 16px;
    height: 16px;
}

.map-fit-button {
    flex: 0 0 auto;
    min-height: 36px;
    font-size: 12px;
}

.map-page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.map-filter-row {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
}

.map-admin-filters {
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-select-field {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.map-select-field select {
    min-width: 118px;
    height: 36px;
    padding: 0 32px 0 10px;
    color: var(--ink);
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    outline: none;
    background: #ffffff;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}

.map-select-field select:focus {
    border-color: #39866e;
    box-shadow: 0 0 0 3px rgb(45 139 110 / 11%);
}

.map-district-filter {
    position: relative;
}

.map-filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    min-width: 118px;
    height: 36px;
    gap: 8px;
    padding: 0 10px;
    color: var(--ink);
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: #ffffff;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}

.map-filter-button[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.map-filter-button.active {
    color: #ffffff;
    border-color: var(--brand);
    background: var(--brand);
}

.map-filter-button svg {
    width: 13px;
    height: 13px;
    transition: transform 160ms ease;
}

.map-district-filter-popover {
    width: min(270px, calc(100vw - 28px));
}

.map-canvas-wrap {
    min-height: 0;
    flex: 1 1 auto;
    position: relative;
    z-index: 0;
    isolation: isolate;
}

.map-current-location-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    color: var(--brand);
    border: 1px solid #bfd3ca;
    border-radius: 7px;
    background: rgb(255 255 255 / 96%);
    box-shadow: 0 8px 24px rgb(23 56 43 / 16%);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    position: absolute;
    bottom: 18px;
    left: 18px;
    z-index: 6;
}

.map-current-location-button svg {
    width: 17px;
    height: 17px;
}

.map-current-location-dot {
    display: block;
    width: 18px;
    height: 18px;
    border: 4px solid #ffffff;
    border-radius: 50%;
    background: #1f7ae0;
    box-shadow:
        0 0 0 7px rgb(31 122 224 / 18%),
        0 3px 10px rgb(15 58 112 / 30%);
}

.customer-map-canvas,
.map-picker-canvas {
    width: 100%;
    height: 100%;
    background:
        linear-gradient(135deg, #edf2ee 25%, transparent 25%) 0 0 / 24px 24px,
        linear-gradient(315deg, #edf2ee 25%, #e5ebe7 25%) 0 0 / 24px 24px;
}

.map-administrative-outside-mask {
    width: 100%;
    height: 100%;
    pointer-events: none;
    position: absolute;
    inset: 0;
    z-index: 20;
}

.map-administrative-boundary-lines {
    fill: none;
    stroke: #285e49;
    stroke-width: 0.8;
    stroke-linejoin: round;
    stroke-linecap: round;
    opacity: 0.92;
}

.map-customer-marker-name {
    display: block;
    width: max-content;
    max-width: 160px;
    overflow: hidden;
    padding: 2px 5px;
    color: #333333;
    border: 1px solid rgb(0 0 0 / 10%);
    border-radius: 5px;
    background: rgb(255 255 255 / 97%);
    box-shadow: 0 3px 10px rgb(24 39 33 / 16%);
    font-family: var(--font);
    font-size: 9px;
    font-weight: 600;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.map-customer-cluster {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    border: 1.5px solid #ffffff;
    border-radius: 50%;
    background: #e53935;
    box-shadow:
        0 0 0 1px rgb(229 57 53 / 22%),
        0 3px 7px rgb(90 20 18 / 30%);
    font-family: var(--font);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.map-customer-cluster-count {
    pointer-events: none;
}

.map-customer-cluster-tip {
    width: max-content;
    max-width: 260px;
    padding: 5px 8px;
    color: #333333;
    border: 1px solid rgb(0 0 0 / 9%);
    border-radius: 5px;
    background: rgb(255 255 255 / 98%);
    box-shadow: 0 5px 16px rgb(24 39 33 / 22%);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
    white-space: normal;
    pointer-events: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    z-index: 30;
    opacity: 0;
    transform: translate(-50%, 4px);
    transition:
        opacity 120ms ease,
        transform 120ms ease;
}

.map-customer-cluster:hover .map-customer-cluster-tip {
    opacity: 1;
    transform: translate(-50%, 0);
}

.amap-marker-label {
    padding: 0;
    border: 0 !important;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.map-status-card {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    width: min(90%, 420px);
    padding: 22px;
    color: var(--muted-strong);
    border: 1px solid rgb(198 211 204 / 90%);
    border-radius: 8px;
    background: rgb(255 255 255 / 96%);
    box-shadow: 0 16px 45px rgb(31 53 44 / 13%);
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.map-status-card svg {
    width: 28px;
    height: 28px;
    color: var(--muted);
}

.map-status-card strong {
    color: var(--ink);
    font-size: 14px;
}

.map-status-card p {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
}

.map-status-card.empty {
    background: rgb(255 255 255 / 94%);
}

.map-status-card.error {
    color: var(--danger);
    border-color: #e5c6c1;
    background: rgb(255 248 246 / 97%);
}

.map-customer-drawer {
    position: fixed;
    inset: 0;
    z-index: 90;
    isolation: isolate;
}

.map-customer-backdrop {
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgb(14 27 21 / 34%);
    position: absolute;
    inset: 0;
    animation: mapBackdropFadeIn 240ms ease-out both;
}

.map-customer-sheet {
    display: flex;
    flex-direction: column;
    width: min(430px, 92vw);
    height: 100%;
    margin-left: auto;
    background: #ffffff;
    box-shadow: -20px 0 55px rgb(15 36 27 / 22%);
    position: relative;
    animation: mapDrawerSlideInRight 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
    will-change: transform, opacity;
}

@keyframes mapBackdropFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes mapDrawerSlideInRight {
    from {
        opacity: 0.75;
        transform: translateX(36px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes mapDrawerSlideInUp {
    from {
        opacity: 0.75;
        transform: translateY(48px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .map-customer-backdrop,
    .map-customer-sheet {
        animation: none;
    }
}

.map-customer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex: 0 0 auto;
    gap: 16px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--line);
}

.map-customer-head h2 {
    margin: 2px 0 0;
    font-size: 20px;
    line-height: 1.35;
}

.map-customer-head p:last-child {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.map-customer-eyebrow {
    margin: 0;
    color: var(--success);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0;
}

.map-customer-scroll {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 18px 20px 24px;
}

.map-customer-details {
    display: grid;
    gap: 0;
    margin: 0;
}

.map-customer-details > div {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.map-customer-details dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.map-customer-details dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.55;
}

.map-customer-photos {
    margin-top: 22px;
}

.map-section-title,
.map-photo-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.map-section-title {
    margin-bottom: 14px;
}

.map-section-title strong {
    font-size: 14px;
}

.map-section-title span,
.map-photo-heading span {
    color: var(--muted);
    font-size: 11px;
}

.map-photo-group + .map-photo-group {
    margin-top: 17px;
}

.map-photo-heading {
    margin-bottom: 8px;
}

.map-photo-heading strong {
    font-size: 12px;
}

.map-photo-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.map-photo-tile {
    min-width: 0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
    cursor: pointer;
}

.map-photo-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-photo-tile:hover img {
    transform: scale(1.025);
}

.map-photo-empty {
    margin: 0;
    padding: 18px;
    color: var(--muted);
    border: 1px dashed var(--line-strong);
    border-radius: 7px;
    background: var(--surface-soft);
    font-size: 12px;
    text-align: center;
}

.map-customer-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    flex: 0 0 auto;
    padding: 12px 20px max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: #ffffff;
}

.map-customer-actions.has-admin-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.map-customer-actions .button {
    width: 100%;
}

.map-customer-delete {
    color: var(--danger);
    border-color: #e2beb8;
}

.map-customer-delete:hover {
    color: #932d2d;
    border-color: #d49a92;
    background: var(--danger-soft);
}

.map-location-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 6px 8px 6px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fbfcfb;
}

.map-location-status {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 600;
}

.map-location-status.empty {
    color: var(--muted);
    font-weight: 500;
}

.map-location-status.invalid {
    color: var(--danger);
}

.map-location-button {
    min-height: 34px;
    gap: 5px;
    padding: 0 10px;
    font-size: 11px;
}

.map-location-button svg {
    width: 15px;
    height: 15px;
}

.map-location-clear {
    min-height: 32px;
    padding: 0 7px;
    color: var(--muted);
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}

.map-location-clear:disabled {
    cursor: default;
    opacity: 0.45;
}

.map-picker-panel {
    display: flex;
    flex-direction: column;
    width: min(96vw, 940px);
    height: min(90vh, 760px);
    overflow: hidden;
}

.map-picker-panel > .modal-header,
.map-picker-panel > .map-picker-actions {
    flex: 0 0 auto;
}

.map-picker-subtitle {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.map-picker-body {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
}

.map-picker-search-shell {
    flex: 0 0 auto;
    position: relative;
    z-index: 12;
}

.map-picker-search-field {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 12px;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.map-picker-search-field:focus-within {
    color: var(--brand);
    border-color: #39866e;
    box-shadow: 0 0 0 3px rgb(45 139 110 / 11%);
}

.map-picker-search-field svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
}

.map-picker-search-field input {
    min-width: 0;
    flex: 1 1 auto;
    color: var(--ink);
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 13px;
}

.map-picker-search-field input::placeholder {
    color: #9ca6a2;
}

.map-picker-search-results {
    max-height: 230px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgb(20 43 33 / 18%);
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 20;
}

.map-picker-search-option {
    display: flex;
    align-items: flex-start;
    width: 100%;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    color: var(--ink);
    border: 0;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
    text-align: left;
    cursor: pointer;
}

.map-picker-search-option:last-child {
    border-bottom: 0;
}

.map-picker-search-option:hover,
.map-picker-search-option:focus-visible {
    background: var(--brand-soft);
}

.map-picker-search-option strong {
    width: 100%;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-picker-search-option span {
    width: 100%;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-picker-search-loading,
.map-picker-search-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 15px 12px;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.map-picker-canvas-wrap {
    min-height: 280px;
    flex: 1 1 auto;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #edf2ee;
    position: relative;
}

.map-picker-canvas {
    min-height: 280px;
}

.map-picker-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    color: var(--muted-strong);
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgb(255 255 255 / 95%);
    box-shadow: 0 9px 24px rgb(23 43 34 / 11%);
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.map-picker-state svg {
    width: 18px;
    height: 18px;
}

.map-picker-selection {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 8px 10px 8px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.map-picker-selection > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.map-picker-selection span {
    color: var(--muted);
    font-size: 10px;
}

.map-picker-selection strong {
    overflow-wrap: anywhere;
    font-size: 12px;
}

.map-locate-button {
    flex: 0 0 auto;
    min-height: 34px;
    gap: 5px;
    padding: 0 10px;
    font-size: 11px;
}

.map-locate-button svg {
    width: 15px;
    height: 15px;
}

.map-picker-actions {
    gap: 8px;
}

@media (max-width: 1120px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .customer-profile {
        position: static;
    }

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

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

@media (max-width: 900px) {
    .auth-form-panel {
        min-height: 100vh;
        padding: 32px 22px;
    }

    .auth-captcha-card {
        padding: 11px 12px;
    }

    .mobile-brand {
        display: flex;
    }

    .whitelist-admin-layout {
        grid-template-columns: 1fr;
        flex: 1;
        min-height: 0;
    }

    .whitelist-modal-panel {
        display: flex;
        flex-direction: column;
        height: min(84vh, 760px);
        height: min(84svh, 760px);
        max-height: calc(100vh - 18px);
        max-height: calc(100dvh - 18px);
        overflow: hidden;
    }

    .whitelist-modal-panel .modal-header {
        flex: 0 0 auto;
    }

    .whitelist-add-toggle {
        display: inline-flex;
    }

    .whitelist-modal-panel:not(.is-adding) .whitelist-create-panel,
    .whitelist-modal-panel.is-adding .whitelist-list-panel {
        display: none;
    }

    .whitelist-create-panel {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .whitelist-list-panel {
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    .whitelist-modal-panel.is-adding .whitelist-create-panel {
        overflow-y: auto;
    }

    .whitelist-user-list {
        flex: 1;
        min-height: 0;
        max-height: none;
    }

    .app-header {
        grid-template-columns: 1fr auto;
        padding: 0 14px;
    }

    .mobile-menu-button {
        display: inline-flex;
    }

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

    .workspace {
        display: block;
        height: calc(100vh - 66px - var(--bottom-nav-height));
        min-height: calc(100vh - 66px - var(--bottom-nav-height));
    }

    .customer-sidebar {
        width: min(86vw, 310px);
        height: calc(100vh - 66px - var(--bottom-nav-height));
        border-right: 1px solid var(--line);
        position: fixed;
        top: 66px;
        left: 0;
        z-index: 50;
        transform: translateX(-102%);
        transition: transform 180ms ease;
    }

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

    .sidebar-backdrop {
        display: block;
        background: rgb(20 31 26 / 45%);
        position: fixed;
        inset: 66px 0 0;
        z-index: 40;
    }

    .content-area {
        padding: 24px 18px 38px;
    }

    .detail-topbar {
        top: -24px;
        margin-top: -24px;
    }

    .overview-sticky-head {
        top: -24px;
        margin-top: -24px;
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .customer-profile {
        position: static;
    }

    .detail-actions {
        width: 100%;
    }

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

}

@media (max-width: 640px) {
    .whitelist-admin-label {
        display: none;
    }

    .whitelist-admin-button {
        width: 34px;
        padding: 0;
        justify-content: center;
    }

    .system-log-label {
        display: none;
    }

    .system-log-button {
        width: 34px;
        padding: 0;
        justify-content: center;
    }

    .header-user > .overview-new-customer {
        width: 34px;
        min-width: 34px;
        min-height: 34px;
        padding: 0;
        gap: 0;
        border-radius: 6px;
    }

    .header-user > .overview-new-customer span {
        display: none;
    }

    .header-user > .overview-new-customer svg {
        width: 16px;
        height: 16px;
    }

    .whitelist-create-panel,
    .whitelist-list-panel {
        padding: 16px 18px;
    }

    .whitelist-admin-layout {
        min-height: 0;
    }

    .whitelist-modal-panel {
        height: min(86vh, 760px);
        height: min(86svh, 760px);
        max-height: calc(100dvh - 12px);
    }

    .app-header {
        min-height: 60px;
    }

    .header-left .brand-lockup > .brand-name {
        display: none;
    }

    .cloud-storage {
        max-width: 148px;
        margin-left: 0;
        padding-left: 8px;
        font-size: 10px;
    }

    .user-name {
        display: none;
    }

    .mobile-menu-button,
    .customer-sidebar {
        display: none;
    }

    .sidebar-backdrop {
        display: none !important;
    }

    .workspace {
        height: calc(100vh - 60px - var(--bottom-nav-height));
        min-height: calc(100vh - 60px - var(--bottom-nav-height));
    }

    .customer-sidebar {
        top: 60px;
        height: calc(100vh - 60px - var(--bottom-nav-height));
    }

    .sidebar-backdrop {
        inset: 60px 0 0;
    }

    .content-area {
        padding: 20px 14px 32px;
    }

    .detail-topbar {
        top: -20px;
        min-height: 46px;
        margin-top: -20px;
        gap: 7px;
    }

    .detail-topbar h1 {
        overflow: visible;
        font-size: 15px;
        line-height: 1.3;
        overflow-wrap: anywhere;
        text-overflow: clip;
        white-space: normal;
    }

    .detail-topbar .photo-count-badge {
        display: none;
    }

    .back-to-overview {
        flex: 0 0 auto;
        min-height: 32px;
        gap: 3px;
        padding: 0 8px;
        border-radius: 6px;
        box-shadow: none;
        font-size: 11px;
    }

    .back-to-overview svg {
        width: 14px;
        height: 14px;
    }

    .overview-sticky-head {
        top: -20px;
        margin-top: -20px;
    }

    .overview-heading-row h1 {
        font-size: 26px;
    }

    .overview-heading-row {
        padding-right: 0;
    }

    .overview-heading-row > .overview-search-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        gap: 4px;
        min-height: 40px;
        padding: 0 8px;
        color: var(--muted-strong);
        border: 1px solid var(--line);
        border-radius: 7px;
        background: #ffffff;
        font-size: 10px;
        font-weight: 650;
        cursor: pointer;
    }

    .overview-heading-row > .overview-search-toggle[aria-expanded="true"] {
        color: var(--brand);
        border-color: #adc2b9;
        background: var(--brand-soft);
    }

    .overview-heading-row > .overview-search-toggle svg {
        width: 14px;
        height: 14px;
    }

    .overview-heading-row > .overview-search-toggle .filter-chevron svg {
        width: 12px;
        height: 12px;
    }

    .overview-summary {
        font-size: 10.4px;
        line-height: 1.4;
    }

    .overview-new-customer {
        min-height: 21px;
        gap: 3px;
        padding: 0 7px;
        border-radius: 4px;
        font-size: 8px;
    }

    .overview-new-customer svg {
        width: 10px;
        height: 10px;
    }

    .overview-toolbar-row {
        gap: 6px;
    }

    .overview-heading-row > .overview-search {
        flex: 1 1 150px;
        width: auto;
        min-width: 0;
        max-width: none;
    }

    .overview-filter-group {
        width: 100%;
        flex: 1 1 auto;
    }

    .channel-filter,
    .representative-filter {
        width: auto;
        min-width: 0;
        flex: 1 1 0;
    }

    .overview-toolbar-row .button {
        min-height: 40px;
        padding-right: 12px;
        padding-left: 12px;
    }

    .overview-filter-group .filter-button {
        width: 100%;
        min-width: 0;
        max-width: none;
        padding: 0 3px;
        gap: 2px;
        font-size: 8px;
    }

    .overview-filter-group .filter-chevron {
        display: inline-flex;
    }

    .overview-photo-filter {
        width: auto;
        min-width: 0;
        flex: 1 1 0;
        gap: 3px;
    }

    .overview-filter-group .overview-photo-filter {
        justify-content: center;
        gap: 3px;
    }

    .filter-button-label {
        min-width: 0;
        max-width: none;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .overview-search {
        min-width: 0;
    }

    .customer-overview-grid {
        grid-template-columns: 1fr;
    }

    .system-log-page-head h1 {
        font-size: 22px;
    }

    .system-log-toolbar {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 10px;
    }

    .system-log-filter:first-child {
        grid-column: 1 / -1;
    }

    .system-log-refresh {
        grid-column: 1 / -1;
    }

    .system-log-item {
        padding: 11px 12px;
    }

    .system-log-item-head {
        flex-wrap: wrap;
    }

    .system-log-item-head time {
        flex-basis: 100%;
        margin-left: 0;
    }

    .system-log-pagination {
        flex-wrap: wrap;
    }

    .system-log-page-status {
        flex-basis: 100%;
        order: -1;
        text-align: center;
    }

    .customer-page-status {
        flex-basis: 100%;
        order: -1;
        font-size: 11px;
    }

    .customer-page-nav {
        min-height: 34px;
        font-size: 11px;
    }

    .overview-card-title-row {
        gap: 6px;
    }

    .overview-card-body h2 {
        font-size: 12px;
        line-height: 1.25;
    }

    .overview-card-representative {
        max-width: none;
        flex: 0 0 auto;
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
    }

    .gallery-toolbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .gallery-toolbar .button {
        width: 100%;
    }

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

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

    .full-width {
        grid-column: auto;
    }

    .modal-shell {
        align-items: end;
        padding: 0;
    }

    .modal {
        width: 100%;
        max-height: 92vh;
        border-radius: 8px 8px 0 0;
    }

    .modal-header,
    .customer-form-scroll {
        padding-right: 18px;
        padding-left: 18px;
    }

    .customer-modal-panel .customer-modal-actions {
        padding-right: 18px;
        padding-left: 18px;
    }

    .modal-photo-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .photo-category-block {
        padding: 10px;
    }

    .photo-category-heading h3 {
        font-size: 13px;
    }

    .modal-photo-grid.category-photo-grid {
        gap: 6px;
    }

    .lightbox {
        padding: 48px 8px 58px;
    }

    .lightbox-viewport {
        width: 100%;
        height: calc(100% - 28px);
    }

    .lightbox-nav {
        width: 38px;
        height: 38px;
        top: auto;
        bottom: 18px;
        transform: none;
    }

    .lightbox-nav.previous {
        left: 14px;
    }

    .lightbox-nav.next {
        right: 14px;
    }

}

@media (max-width: 900px) {
    .rectification-list {
        grid-template-columns: 1fr;
    }

    .bottom-nav {
        display: grid;
    }

    .overview-big-store-button,
    .overview-map-button,
    .overview-representative-stats-button,
    .overview-rectification-button,
    .rectification-back-customers {
        display: none;
    }

    .overview-heading-row {
        padding-right: 94px;
    }
}

@media (max-width: 640px) {
    .desktop-sales-filter,
    .overview-bulk-delete {
        display: none !important;
    }

    .overview-heading-row {
        padding-right: 0;
    }

    .bottom-nav {
        width: 100%;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .rectification-page-head h1 {
        font-size: 20px;
    }

    .rectification-page-actions {
        align-items: flex-end;
        flex-direction: column;
    }

    .rectification-create-entry {
        min-height: 30px;
        font-size: 11px;
    }

    .rectification-assignment-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .rectification-card {
        grid-template-columns: 76px minmax(0, 1fr);
        padding: 10px;
    }

    .rectification-card-cover {
        width: 76px;
    }

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

    .rectification-compare-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .rectification-compare-icon {
        width: 100%;
        min-height: 34px;
    }

    .rectification-compare-icon svg {
        transform: rotate(90deg);
    }

    .rectification-photo-grid.compare-photo-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    #rectification-issue-summary-block {
        display: none;
    }

    .rectification-compare-column {
        display: block;
        position: relative;
    }

    .rectification-compare-copy {
        width: 82px;
        max-height: calc(100% - 16px);
        overflow-y: auto;
        padding: 6px 7px;
        color: #ffffff;
        border-radius: 6px;
        background: rgb(16 26 22 / 68%);
        position: absolute;
        top: 8px;
        left: 8px;
        z-index: 2;
    }

    .rectification-compare-copy h3 {
        margin: 0;
        color: #ffffff;
        font-size: 11px;
        line-height: 1.4;
    }

    .rectification-compare-column .compare-photo-grid {
        width: 100%;
        margin: 0;
    }

    .rectification-compare-description {
        display: block;
        margin: 5px 0 0;
        padding: 0;
        color: #e9efec;
        border: 0;
        font-size: 9px;
        line-height: 1.45;
        overflow-wrap: anywhere;
        white-space: pre-wrap;
    }

    .rectification-fix-upload {
        margin-top: 6px;
    }

    .rectification-photo-grid.compare-photo-grid .rectification-photo {
        width: 100%;
        height: auto;
        aspect-ratio: auto;
        background: #eef1ee;
    }

    .rectification-photo-grid.compare-photo-grid .rectification-photo img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    #rectification-detail-modal {
        align-items: stretch;
        padding: 0;
    }

    #rectification-detail-modal .rectification-modal-panel {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
    }

    #rectification-detail-modal .rectification-detail-scroll {
        padding: 10px 4px 20px;
    }

    .rectification-detail-header {
        align-items: flex-start;
        gap: 8px;
        padding-top: 14px;
        padding-bottom: 12px;
    }

    .rectification-detail-heading {
        flex: 1;
    }

    .rectification-detail-title-row {
        gap: 6px;
    }

    .rectification-detail-title-row h2 {
        max-width: 100%;
        overflow: hidden;
        font-size: 15px;
        line-height: 1.25;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .rectification-detail-title-row .rectification-status {
        min-height: 20px;
        padding: 0 6px;
        font-size: 9px;
    }

    .rectification-detail-header .rectification-modal-subtitle {
        margin-top: 5px;
        font-size: 10px;
        line-height: 1.5;
    }

    .rectification-form-scroll,
    .rectification-detail-scroll {
        padding: 16px 18px;
    }

    .rectification-modal-actions {
        padding-right: 18px;
        padding-left: 18px;
    }
}

@media (max-width: 900px) {
    .map-customer-drawer {
        display: flex;
        align-items: stretch;
    }

    .map-customer-sheet {
        width: 100%;
        height: calc(100dvh - 12px);
        max-height: 100dvh;
        margin: 12px 0 0;
        border-radius: 12px 12px 0 0;
        box-shadow: 0 -10px 34px rgb(15 36 27 / 18%);
        animation-name: mapDrawerSlideInUp;
    }

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

    .map-picker-panel {
        width: 100%;
        height: min(94dvh, 900px);
        max-height: calc(100dvh - 8px);
        border-radius: 12px 12px 0 0;
    }

    .map-picker-body {
        padding: 14px 16px;
    }

    .map-picker-search-field {
        height: 40px;
    }

    .map-picker-search-results {
        max-height: 200px;
    }
}

@media (max-width: 640px) {
    .map-page-head {
        align-items: flex-start;
        min-height: 0;
        padding: 10px 12px;
    }

    .map-page-heading {
        align-items: flex-start;
        gap: 8px;
    }

    .map-page-heading h1 {
        font-size: 18px;
    }

    .map-page-heading p {
        max-width: 210px;
        margin-top: 2px;
        font-size: 9px;
        line-height: 1.4;
    }

    .map-page-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 6px;
    }

    .map-filter-row {
        min-width: 0;
        flex: 1 1 auto;
        gap: 4px;
    }

    .map-admin-filters {
        display: contents;
    }

    .map-select-field {
        min-width: 0;
        flex: 1 1 0;
        display: block;
    }

    .map-select-field > span {
        display: none;
    }

    .map-select-field select {
        width: 100%;
        min-width: 0;
        height: 31px;
        padding-right: 22px;
        padding-left: 7px;
        font-size: 10px;
    }

    .map-filter-button {
        width: 100%;
        min-width: 0;
        height: 31px;
        padding-right: 7px;
        padding-left: 7px;
        font-size: 10px;
    }

    .map-back-overview {
        min-height: 30px;
        padding: 0 7px;
        font-size: 10px;
    }

    .map-back-overview svg,
    .map-fit-button svg {
        width: 13px;
        height: 13px;
    }

    .map-fit-button {
        flex: 0 0 30px;
        width: 30px;
        min-width: 30px;
        min-height: 28px;
        padding: 0;
    }

    .map-fit-button span {
        display: none;
    }

    .map-current-location-button {
        bottom: 12px;
        left: 12px;
        width: 34px;
        height: 34px;
        padding: 0;
    }

    .map-current-location-button svg {
        width: 15px;
        height: 15px;
    }

    .map-status-card {
        width: min(92%, 320px);
        padding: 16px;
    }

    .map-customer-head {
        padding: 16px 16px 13px;
    }

    .map-customer-head h2 {
        font-size: 18px;
    }

    .map-customer-scroll {
        padding: 14px 16px 20px;
    }

    .map-customer-actions {
        grid-template-columns: 1fr;
        padding: 10px 16px max(10px, env(safe-area-inset-bottom));
    }

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

    .map-location-control {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
        padding: 7px 8px 7px 10px;
    }

    .map-location-clear {
        grid-column: 1 / -1;
        justify-self: end;
        min-height: 24px;
        padding: 0;
    }

    .map-picker-selection {
        align-items: flex-start;
        flex-direction: column;
    }

    .map-locate-button {
        width: 100%;
        justify-content: center;
    }

    .map-picker-actions {
        padding-right: 16px;
        padding-left: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
