/* ===================================
   GENERAL
=================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 20px;
    background: #f4f4f4;
    color: #222;
    font-family: Arial, sans-serif;
    transition: background 0.2s, color 0.2s;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.top-bar {
    position: relative;
    min-height: 55px;
}

h1 {
    text-align: center;
    color: #00539f;
    margin: 0 0 20px;
}

h2 {
    margin-top: 0;
    color: #00539f;
}

/* ===================================
   THEME
=================================== */

.theme-corner {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 8px 10px;
    font-weight: bold;
    z-index: 10;
}

.theme-corner select {
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background: white;
    color: #222;
}

/* ===================================
   FORM CONTROLS
=================================== */

#pdfFile,
#searchBox,
#merchGroupSelect {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: white;
    color: #222;
    font-size: 16px;
}

button {
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    background: #00539f;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

button:hover {
    opacity: 0.9;
}

/* ===================================
   STORE HEADER + FILES
=================================== */

.store-header,
.files-panel,
.panel-card,
.toolbar {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
}

#storeNumber,
#storeName,
#storeAddress {
    margin-bottom: 6px;
    font-weight: bold;
}

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

.file-pill {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background: #f8f8f8;
    font-weight: bold;
}

.file-pill.good {
    border-color: #169447;
}

.file-pill.missing {
    opacity: 0.75;
}

.file-pill small {
    display: block;
    margin-top: 4px;
    font-weight: normal;
    color: #666;
}

/* ===================================
   TABS
=================================== */

.tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.tab-btn {
    background: white;
    color: #00539f;
    border: 1px solid #00539f;
}

.tab-btn.active {
    background: #00539f;
    color: white;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ===================================
   TOOLBAR + SWITCH
=================================== */

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.toolbar-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    display: none;
}

.slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 34px;
    cursor: pointer;
}

.slider:before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 4px;
    top: 4px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

input:checked + .slider {
    background: #00539f;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* ===================================
   STATS
=================================== */

.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.stat-card {
    background: white;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #ddd;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #00539f;
}

.stat-label {
    font-size: 12px;
    color: #666;
}



.stat-extra {
    margin-top: 4px;
    font-size: 11px;
    color: #777;
    line-height: 1.25;
}

.stat-wide-card {
    grid-column: 1 / -1;
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.stat-wide-card summary {
    cursor: pointer;
    font-weight: 900;
    color: #00539f;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.merch-group-count-list {
    margin-top: 10px;
    display: grid;
    gap: 6px;
    max-height: 320px;
    overflow: auto;
    padding-right: 4px;
}

.merch-group-count-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f7f9fb;
    border: 1px solid #e4e9ef;
    font-size: 13px;
}

.merch-group-count-row span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.merch-group-count-row strong {
    color: #00539f;
    font-size: 16px;
}

@media (max-width: 640px) {
    .stats-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat-card {
        padding: 10px 8px;
    }

    .stat-number {
        font-size: 22px;
    }

    .stat-label {
        font-size: 11px;
    }

    .merch-group-count-row {
        font-size: 12px;
        padding: 8px;
    }
}

/* ===================================
   ZONES + GROUPS
=================================== */

.zone-section {
    margin-top: 25px;
    margin-bottom: 15px;
}

.zone-header {
    margin-bottom: 10px;
    padding: 14px;
    border-radius: 10px;
    font-size: 22px;
    font-weight: bold;
    background: #00539f;
    color: white;
    cursor: pointer;
    user-select: none;
}

.zone-content,
.group-content {
    display: none;
}

.zone-content.open,
.group-content.open {
    display: block;
}

.group-section {
    margin-bottom: 15px;
}

.group-title {
    background: #00539f;
    color: white;
    padding: 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    user-select: none;
    transition: 0.2s;
}

.group-title:hover,
.zone-header:hover {
    opacity: 0.9;
}

/* ===================================
   MOD CARDS
=================================== */

.mods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.mod-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    transition: 0.2s;
}

.mod-card:hover {
    transform: translateY(-2px);
}

.mod-header {
    font-weight: bold;
    color: #00539f;
    margin-bottom: 8px;
}

.mod-detail {
    margin-bottom: 7px;
    font-weight: bold;
}

.height-list {
    margin-top: 10px;
}

.height-item {
    min-height: 28px;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.height-item:last-child {
    border-bottom: none;
}

.height-value {
    font-weight: bold;
}

.height-badges {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.badge {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
    white-space: nowrap;
}

.badge-slope {
    background: #ffe8cc;
    color: #9a4b00;
}

.badge-grill {
    background: #e6f0ff;
    color: #00539f;
}

.badge-drawer {
    background: #efe6ff;
    color: #4b168f;
}

.badge-capping {
    background: #e7f8ec;
    color: #16723b;
}

.badge-extension {
    background: #ffe3e3;
    color: #a40000;
}

.special-row {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mod-actions {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.mod-actions button {
    font-size: 12px;
    padding: 8px;
}

.mod-actions button.active {
    background: #169447;
}

.view-pdf-btn {
    width: 100%;
    margin-top: 8px;
}

.count {
    margin-top: 10px;
    font-weight: bold;
    color: #333;
}

/* ===================================
   LAYOUT VIEWER
=================================== */

.layout-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.layout-viewer {
    position: relative;
    width: 100%;
    overflow: auto;
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 10px;
    min-height: 250px;
}

#layoutCanvas {
    display: block;
    max-width: 100%;
}

.layout-overlay {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
}

.layout-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    padding: 2px 5px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}

.marker-zpanel {
    background: #dff0ff;
    color: #00539f;
    border: 1px solid #00539f;
}

.marker-drawer {
    background: #f2e5ff;
    color: #6b1fb1;
    border: 1px solid #6b1fb1;
}

.marker-capping {
    background: #e7f8ec;
    color: #16723b;
    border: 1px solid #16723b;
}

.marker-graphic {
    background: rgba(255, 243, 205, 0.96);
    color: #795100;
    border: 1px solid #b88900;
    font-size: 9px;
    padding: 2px 4px;
}

.marker-infill,
.marker-lid {
    background: #eeeeee;
    color: #333;
    border: 1px solid #666;
}

/* ===================================
   HIGHLIGHTS + WIDTHS
=================================== */

.highlight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.highlight-card {
    border: 1px solid #ddd;
    background: #f8f8f8;
    border-radius: 10px;
    padding: 12px;
}

.highlight-number {
    font-size: 24px;
    font-weight: bold;
    color: #00539f;
}

.marker-list,
.width-list {
    display: grid;
    gap: 8px;
}

.marker-item,
.width-item {
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    font-weight: bold;
}

/* ===================================
   PDF MODAL
=================================== */

.pdf-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    overflow: auto;
}

.pdf-modal-inner {
    background: white;
    margin: 20px auto;
    padding: 10px;
    max-width: 900px;
    border-radius: 10px;
}

#pdfCanvas {
    width: 100%;
    margin-top: 10px;
}

/* ===================================
   DARK MODE
=================================== */

body.dark-mode {
    background: #121212;
    color: #f1f1f1;
}

body.dark-mode h1,
body.dark-mode h2 {
    color: #69b7ff;
}

body.dark-mode .store-header,
body.dark-mode .files-panel,
body.dark-mode .panel-card,
body.dark-mode .toolbar,
body.dark-mode .stat-card,
body.dark-mode .mod-card,
body.dark-mode .pdf-modal-inner,
body.dark-mode .theme-corner {
    background: #1e1e1e;
    border-color: #333;
    color: #f1f1f1;
}

body.dark-mode #pdfFile,
body.dark-mode #searchBox,
body.dark-mode #merchGroupSelect,
body.dark-mode .theme-corner select {
    background: #222;
    border-color: #444;
    color: #f1f1f1;
}

body.dark-mode .file-pill,
body.dark-mode .highlight-card,
body.dark-mode .marker-item,
body.dark-mode .width-item,
body.dark-mode .layout-viewer {
    background: #181818;
    border-color: #333;
}

body.dark-mode .stat-number,
body.dark-mode .mod-header,
body.dark-mode .highlight-number {
    color: #69b7ff;
}

body.dark-mode .stat-label,
body.dark-mode .file-pill small {
    color: #bbb;
}

body.dark-mode .height-item {
    border-bottom-color: #333;
}

body.dark-mode .count {
    color: #f1f1f1;
}

body.dark-mode .tab-btn {
    background: #222;
    color: #69b7ff;
    border-color: #0074d9;
}

body.dark-mode .tab-btn.active,
body.dark-mode button,
body.dark-mode .group-title,
body.dark-mode .zone-header {
    background: #0074d9;
    color: white;
}

/* ===================================
   MOBILE
=================================== */

@media (max-width: 700px) {

    body {
        padding: 10px;
    }

    .top-bar {
        min-height: 0;
    }

    h1 {
        text-align: left;
        margin-bottom: 12px;
    }

    .theme-corner {
        position: static;
        margin-bottom: 12px;
        justify-content: space-between;
    }

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

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

    .group-title {
        font-size: 14px;
    }

    .height-item {
        align-items: flex-start;
    }
}



/* ===================================
   ADDED BRAND HEADER / NEW LOOK
=================================== */

:root {
    --tesco-red: #e30613;
    --tesco-red-dark: #b9000b;
    --tesco-blue: #00539f;
    --tesco-blue-dark: #003f7a;
    --tesco-blue-bright: #0074d9;
    --page-bg: #f2f3f5;
    --card-bg: #ffffff;
    --text-main: #161616;
    --text-soft: #606875;
    --border-soft: #d9dee8;
    --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.08);
    --shadow-small: 0 3px 10px rgba(0, 0, 0, 0.08);
}

body {
    padding: 0;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.95), rgba(242, 243, 245, 1) 55%),
        var(--page-bg);
}

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

.container {
    padding: 0 18px 24px;
}

.brand-header {
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 18px 0;
}

.top-strip {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.menu-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: white;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-small);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.menu-icon span {
    width: 22px;
    height: 3px;
    background: var(--tesco-blue);
    border-radius: 999px;
}

.theme-corner {
    position: static !important;
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 8px 10px;
    font-weight: bold;
    box-shadow: var(--shadow-small);
    z-index: 10;
}

.theme-corner label {
    color: var(--tesco-blue);
}

.theme-corner select {
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    background: #f8fafc;
    color: var(--text-main);
    font-weight: bold;
}

.brand-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 247, 249, 0.98)),
        white;
    border: 1px solid var(--border-soft);
    border-radius: 26px;
    box-shadow: var(--shadow-soft);
    padding: 28px 18px 26px;
    margin-bottom: 18px;
    text-align: center;
    overflow: hidden;
    position: relative;
}

.brand-card::before,
.brand-card::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    opacity: 0.08;
    pointer-events: none;
}

.brand-card::before {
    width: 260px;
    height: 260px;
    background: var(--tesco-blue);
    right: -120px;
    top: -130px;
}

.brand-card::after {
    width: 200px;
    height: 200px;
    background: var(--tesco-red);
    left: -100px;
    bottom: -120px;
}

.brand-main {
    position: relative;
    z-index: 1;
}

.brand-word {
    color: var(--tesco-red);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(38px, 8vw, 88px);
    line-height: 0.9;
    font-weight: 900;
    letter-spacing: 4px;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.04);
}

.blue-stripes {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 14px auto 0;
}

.blue-stripes span {
    display: block;
    width: clamp(36px, 7vw, 82px);
    height: clamp(10px, 2vw, 18px);
    background: linear-gradient(135deg, var(--tesco-blue), var(--tesco-blue-bright));
    border-radius: 999px 4px 999px 4px;
    transform: skewX(-22deg);
}

.brand-helper {
    margin-top: -4px;
    color: var(--tesco-blue);
    font-size: clamp(42px, 9vw, 92px);
    line-height: 0.9;
    font-weight: 700;
    font-family: "Brush Script MT", "Segoe Script", "Comic Sans MS", cursive;
}

.brand-tagline {
    position: relative;
    z-index: 1;
    margin-top: 12px;
    font-size: clamp(24px, 5vw, 46px);
    line-height: 1;
    color: #111;
    font-family: "Brush Script MT", "Segoe Script", "Comic Sans MS", cursive;
}

.tagline-dash {
    display: inline-block;
    width: 22px;
    height: 6px;
    margin-left: 8px;
    background: var(--tesco-red);
    border-radius: 999px 4px 999px 4px;
    transform: skewX(-20deg) translateY(-2px);
}

.upload-card {
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-soft);
}

.upload-drop {
    border: 2px dashed var(--tesco-blue-bright);
    border-radius: 16px;
    padding: 18px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.upload-drop:hover {
    background: #eef6ff;
}

.upload-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--tesco-blue);
    border: 2px solid var(--tesco-blue);
    font-size: 34px;
    font-weight: bold;
    line-height: 1;
}

.upload-text strong {
    display: block;
    color: var(--tesco-blue);
    font-size: 20px;
    margin-bottom: 4px;
}

.upload-text span {
    color: var(--text-soft);
}

.upload-button {
    background: linear-gradient(135deg, var(--tesco-blue), var(--tesco-blue-dark));
    color: white;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: bold;
    box-shadow: var(--shadow-small);
    white-space: nowrap;
}

.upload-note {
    margin-top: 10px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: bold;
}

#pdfFile {
    display: none !important;
}

.section-title {
    color: var(--tesco-blue);
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 14px;
}

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

.store-info-block {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 10px;
    padding: 12px;
    border: 1px solid #edf0f5;
    background: #fbfcfe;
    border-radius: 14px;
    min-width: 0;
}

.store-icon {
    width: 36px;
    height: 36px;
    border: 2px solid var(--tesco-blue);
    border-radius: 10px;
    color: var(--tesco-blue);
    font-weight: 900;
    display: grid;
    place-items: center;
}

.store-info-block small {
    display: block;
    color: var(--text-soft);
    font-weight: bold;
    margin-bottom: 3px;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--tesco-red), var(--tesco-red-dark));
    color: white;
    border-color: var(--tesco-red);
}

#allGroups .zone-section:nth-child(1) .zone-header {
    background: linear-gradient(135deg, var(--tesco-red), var(--tesco-red-dark));
}

#allGroups .zone-section:nth-child(2) .zone-header {
    background: linear-gradient(135deg, var(--tesco-blue-bright), var(--tesco-blue));
}

#allGroups .zone-section:nth-child(3) .zone-header {
    background: linear-gradient(135deg, var(--tesco-blue), var(--tesco-blue-dark));
}

body.dark-mode {
    background:
        radial-gradient(circle at top, rgba(17, 28, 44, 1), rgba(13, 13, 13, 1) 55%),
        #121212;
}

body.dark-mode .brand-card {
    background:
        linear-gradient(180deg, rgba(30, 30, 30, 0.98), rgba(20, 20, 20, 0.98)),
        #1e1e1e;
    border-color: #333;
}

body.dark-mode .brand-tagline {
    color: #f1f1f1;
}

body.dark-mode .menu-icon,
body.dark-mode .upload-card,
body.dark-mode .store-info-block {
    background: #1e1e1e;
    border-color: #333;
    color: #f1f1f1;
}

body.dark-mode .upload-drop {
    background: #181818;
    border-color: #0074d9;
}

body.dark-mode .upload-drop:hover {
    background: #202020;
}

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

@media (max-width: 700px) {
    body {
        padding: 0;
    }

    .brand-header {
        padding: 10px 10px 0;
    }

    .container {
        padding: 0 10px 18px;
    }

    .top-strip {
        min-height: 42px;
    }

    .menu-icon {
        width: 40px;
        height: 40px;
    }

    .theme-corner {
        margin-bottom: 0 !important;
        padding: 7px 8px;
        font-size: 13px;
    }

    .theme-corner select {
        padding: 7px;
    }

    .brand-card {
        border-radius: 20px;
        padding: 22px 12px 20px;
        margin-bottom: 14px;
    }

    .brand-word {
        letter-spacing: 2px;
    }

    .blue-stripes {
        gap: 5px;
        margin-top: 10px;
    }

    .brand-helper {
        margin-top: 2px;
    }

    .upload-drop {
        grid-template-columns: auto 1fr;
    }

    .upload-button {
        grid-column: 1 / -1;
        text-align: center;
    }
}


/* ===================================
   ALL CHANGES ADDITIONS
=================================== */

.store-extra-details {
    margin-top: 12px;
    border: 1px solid var(--border-soft, #d9dee8);
    border-radius: 14px;
    overflow: hidden;
    background: #fbfcfe;
}

.store-extra-details summary {
    padding: 12px 14px;
    cursor: pointer;
    font-weight: 900;
    color: var(--tesco-blue, #00539f);
    user-select: none;
}

.store-extra-details summary:hover {
    background: #eef6ff;
}

.store-hours,
.store-link {
    padding: 12px 14px;
    border-top: 1px solid var(--border-soft, #d9dee8);
    line-height: 1.5;
}

.store-link a {
    color: var(--tesco-blue, #00539f);
    font-weight: bold;
}

.highlight-filter-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.highlight-filter-panel label {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-soft, #d9dee8);
    background: #fbfcfe;
    border-radius: 14px;
    padding: 12px;
    font-weight: 900;
    cursor: pointer;
}

.highlight-filter-panel input {
    width: 18px;
    height: 18px;
    accent-color: var(--tesco-blue, #00539f);
}

.marker-aisle-width {
    background: rgba(227, 6, 19, 0.92);
    color: white;
    border: 2px solid white;
    font-size: 12px;
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.25), 0 2px 8px rgba(0, 0, 0, 0.35);
}

.aisle-layout-viewer {
    margin-bottom: 14px;
}

#aisleCanvas {
    display: block;
    max-width: 100%;
}

.sub-heading {
    margin: 14px 0 10px;
    color: var(--tesco-blue, #00539f);
}

.mod-actions.single-action {
    grid-template-columns: 1fr;
}

body.dark-mode .store-extra-details,
body.dark-mode .highlight-filter-panel label {
    background: #181818;
    border-color: #333;
}

body.dark-mode .store-extra-details summary {
    color: #69b7ff;
}

body.dark-mode .store-extra-details summary:hover {
    background: #222;
}

body.dark-mode .store-hours,
body.dark-mode .store-link {
    border-top-color: #333;
}

body.dark-mode .store-link a,
body.dark-mode .sub-heading {
    color: #69b7ff;
}


/* ===================================
   BASE DRAWER / CAPPING FIXES
=================================== */

.base-drawer-row .height-value {
    color: #4b168f;
}

.capping-shelf-row .height-value {
    color: #16723b;
}

.marker-aisle-width {
    background: rgba(227, 6, 19, 0.86);
    color: white;
    border: 1px solid white;
    font-size: 11px;
    box-shadow: 0 0 0 2px rgba(227, 6, 19, 0.18), 0 2px 7px rgba(0, 0, 0, 0.28);
}


/* ===================================
   FIX2: DRAWER / CAPPING / MOBILE ZOOM
=================================== */

.layout-viewer {
    touch-action: pan-x pan-y pinch-zoom;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

#layoutCanvas,
#aisleCanvas {
    max-width: none;
}

.base-drawer-row .height-value {
    color: #4b168f;
}

.capping-shelf-row .height-value {
    color: #16723b;
}

.marker-aisle-width {
    background: rgba(227, 6, 19, 0.86);
    color: white;
    border: 1px solid white;
    font-size: 11px;
    box-shadow: 0 0 0 2px rgba(227, 6, 19, 0.18), 0 2px 7px rgba(0, 0, 0, 0.28);
}


/* ===================================
   FIX4: LAYOUT TAB CHECKBOXES
=================================== */

.layout-filter-title {
    margin: 12px 0 8px;
    font-weight: 900;
    color: var(--tesco-blue, #00539f);
}

body.dark-mode .layout-filter-title {
    color: #69b7ff;
}


/* ===================================
   FIX6: STORE NUMBER VALIDATION
=================================== */

.upload-error {
    background: #fff3f3;
    border: 2px solid #e30613;
    border-radius: 16px;
    padding: 16px;
    margin: 16px 0;
    color: #161616;
}

.upload-error h3 {
    margin: 0 0 8px;
    color: #e30613;
}

.upload-error-list {
    display: grid;
    gap: 8px;
    margin: 12px 0;
}

.upload-error-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
    background: white;
    border: 1px solid #ffd0d0;
    border-radius: 10px;
    padding: 10px;
}

body.dark-mode .upload-error {
    background: #2a1111;
    border-color: #ff5c5c;
    color: #f1f1f1;
}

body.dark-mode .upload-error h3 {
    color: #ff8a8a;
}

body.dark-mode .upload-error-row {
    background: #1e1e1e;
    border-color: #663333;
}

@media (max-width: 700px) {
    .upload-error-row {
        grid-template-columns: 1fr;
    }
}


/* ===================================
   FIX7: HIGH QUALITY SMOOTH MAPS
=================================== */

.layout-viewer {
    position: relative;
    overflow: auto;
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    background: #f8f8f8;
}

.map-surface {
    position: relative;
    display: inline-block;
    transform-origin: 0 0;
    will-change: width, height;
}

#layoutCanvas,
#aisleCanvas {
    display: block;
    max-width: none !important;
    image-rendering: auto;
}

.layout-overlay {
    position: absolute;
    inset: 0 auto auto 0;
    pointer-events: none;
    transform-origin: 0 0;
    will-change: transform;
}

.layout-marker {
    will-change: left, top, transform;
    backface-visibility: hidden;
}


/* ===================================
   FIX8: CLEANER LAYOUT HIGHLIGHTS
=================================== */

.highlight-filter-panel .filter-chip {
    font-weight: 900;
}

.highlight-filter-panel .chip-zpanel {
    background: rgba(255, 105, 180, 0.10);
    border-color: #ff4fb2;
    color: #b10067;
}

.highlight-filter-panel .chip-zpanel input {
    accent-color: #ff4fb2;
}

.highlight-filter-panel .chip-graphic {
    background: rgba(255, 213, 79, 0.18);
    border-color: #d3a219;
    color: #6f5200;
}

.highlight-filter-panel .chip-graphic input {
    accent-color: #d3a219;
}

.highlight-filter-panel .chip-drawer {
    background: rgba(140, 82, 255, 0.10);
    border-color: #7c3aed;
    color: #5b21b6;
}

.highlight-filter-panel .chip-drawer input {
    accent-color: #7c3aed;
}

.highlight-filter-panel .chip-capping {
    background: rgba(22, 163, 74, 0.10);
    border-color: #16a34a;
    color: #166534;
}

.highlight-filter-panel .chip-capping input {
    accent-color: #16a34a;
}

.layout-marker.marker-shape-only {
    padding: 0;
    white-space: normal;
    background: transparent;
    color: transparent;
    transform: none;
    transform-origin: top left;
    box-shadow: none;
}

.layout-marker.marker-zpanel-oval {
    border: 3px solid rgba(255, 79, 178, 0.92);
    border-radius: 999px;
    background: rgba(255, 79, 178, 0.05);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.92);
}

.layout-marker.marker-mod-fill {
    border-radius: 6px;
    border-width: 2px;
    border-style: solid;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.layout-marker.marker-drawer-fill {
    background: rgba(124, 58, 237, 0.12);
    border-color: rgba(124, 58, 237, 0.85);
}

.layout-marker.marker-capping-fill {
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.85);
}

body.dark-mode .highlight-filter-panel .chip-zpanel {
    background: rgba(255, 79, 178, 0.16);
}

body.dark-mode .highlight-filter-panel .chip-graphic {
    background: rgba(255, 213, 79, 0.18);
}

body.dark-mode .highlight-filter-panel .chip-drawer {
    background: rgba(124, 58, 237, 0.18);
}

body.dark-mode .highlight-filter-panel .chip-capping {
    background: rgba(22, 163, 74, 0.18);
}


/* ===================================
   FIX11: MISMATCH WARNING ACTIONS
=================================== */

.upload-warning-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.upload-warning-actions button {
    min-width: 180px;
}

.secondary-btn {
    background: #ffffff;
    color: #00539f;
    border: 2px solid #00539f;
}

body.dark-mode .secondary-btn {
    background: #1e1e1e;
    color: #69b7ff;
    border-color: #69b7ff;
}


/* ===================================
   FIX14: MULTI MAP SELECTORS
=================================== */

.map-select-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 900;
}

.map-select {
    min-width: 220px;
    max-width: min(70vw, 420px);
    padding: 8px 10px;
    border: 1px solid var(--border-soft, #d9dee8);
    border-radius: 10px;
    font-weight: 800;
    background: #ffffff;
    color: #111111;
}

.map-select:disabled {
    opacity: 0.70;
}

body.dark-mode .map-select {
    background: #1e1e1e;
    color: #f1f1f1;
    border-color: #3a3a3a;
}

@media (max-width: 700px) {
    .layout-controls {
        align-items: stretch;
    }

    .map-select-label {
        width: 100%;
        justify-content: space-between;
    }

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


/* ===================================
   FIX15: ZIP FOLDER UPLOAD
=================================== */

#folderFile {
    margin-top: 8px;
}

.upload-error small {
    display: block;
    margin-top: 6px;
    opacity: 0.8;
}


/* ===================================
   FIX16: REVIEW SCREEN AND REPORTS
=================================== */

.upload-review {
    background: #f7fbff;
    border: 2px solid #00539f;
    border-radius: 16px;
    padding: 16px;
    margin: 16px 0;
}

.upload-review h3 {
    margin-top: 0;
    color: #00539f;
}

.review-warning {
    background: #fff3cd;
    border: 1px solid #e3b341;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 12px;
}

.review-count-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.review-count-grid div {
    background: #ffffff;
    border: 1px solid #d9dee8;
    border-radius: 12px;
    padding: 10px;
}

.review-count-grid strong {
    display: block;
    font-size: 22px;
    color: #e30613;
}

.review-count-grid span {
    font-size: 12px;
    font-weight: 900;
}

.review-note {
    margin-bottom: 12px;
    font-weight: 800;
}

.upload-review-list {
    display: grid;
    gap: 8px;
}

.upload-review-row {
    display: grid;
    grid-template-columns: 1.6fr auto auto minmax(160px, 220px);
    gap: 10px;
    align-items: center;
    background: white;
    border: 1px solid #d9dee8;
    border-radius: 12px;
    padding: 10px;
}

.upload-review-row select {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
}

.review-details {
    margin-top: 12px;
}

.layout-source-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.layout-source-row span {
    background: rgba(0, 83, 159, 0.08);
    border: 1px solid rgba(0, 83, 159, 0.22);
    color: #00539f;
    border-radius: 999px;
    padding: 5px 8px;
    font-size: 12px;
    font-weight: 900;
}

.badge-zpanel {
    background: rgba(255, 79, 178, 0.16);
    color: #9b0058;
}

.badge-graphic {
    background: rgba(255, 213, 79, 0.28);
    color: #6f5200;
}

.stat-action-card {
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-action-card button {
    width: 100%;
}

.layout-marker {
    pointer-events: auto;
    cursor: pointer;
}

@media (max-width: 800px) {
    .upload-review-row {
        grid-template-columns: 1fr;
    }
}

body.dark-mode .upload-review {
    background: #0f1720;
    border-color: #69b7ff;
}

body.dark-mode .upload-review h3 {
    color: #69b7ff;
}

body.dark-mode .upload-review-row,
body.dark-mode .review-count-grid div {
    background: #1e1e1e;
    border-color: #3a3a3a;
}

body.dark-mode .layout-source-row span {
    background: rgba(105, 183, 255, 0.12);
    color: #69b7ff;
    border-color: rgba(105, 183, 255, 0.35);
}


/* ===================================
   FIX17: UNKNOWN ONLY REVIEW
=================================== */

.detected-type-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 900;
    border: 1px solid transparent;
}

.type-planograms {
    background: rgba(0, 83, 159, 0.10);
    color: #00539f;
    border-color: rgba(0, 83, 159, 0.25);
}

.type-layout {
    background: rgba(22, 163, 74, 0.10);
    color: #166534;
    border-color: rgba(22, 163, 74, 0.25);
}

.type-merch {
    background: rgba(227, 6, 19, 0.10);
    color: #a00000;
    border-color: rgba(227, 6, 19, 0.25);
}

.type-ignore,
.type-unknown {
    background: #eeeeee;
    color: #333333;
    border-color: #cccccc;
}

.upload-review-row.needs-type-choice {
    border-color: #e3b341;
    background: #fffdf4;
}

.upload-review-row.auto-detected-row {
    background: #ffffff;
}

#continueReviewedUploadBtn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

body.dark-mode .upload-review-row.needs-type-choice {
    background: #2a2411;
    border-color: #8c6d20;
}

body.dark-mode .upload-review-row.auto-detected-row {
    background: #1e1e1e;
}

body.dark-mode .type-ignore,
body.dark-mode .type-unknown {
    background: #333333;
    color: #f1f1f1;
    border-color: #555555;
}


/* ===================================
   FIX18: BASE DRAWER MARKER LIST
=================================== */

.base-drawer-list {
    background: rgba(147, 51, 234, 0.08);
    border: 1px solid rgba(147, 51, 234, 0.22);
    border-radius: 12px;
    padding: 10px 12px;
    margin-top: 10px;
}

.base-drawer-list summary {
    cursor: pointer;
    font-weight: 900;
    color: #6b21a8;
}

.base-drawer-list ul {
    margin: 8px 0 0 20px;
    padding: 0;
}

.base-drawer-list li {
    margin: 4px 0;
    font-weight: 800;
}

body.dark-mode .base-drawer-list {
    background: rgba(192, 132, 252, 0.12);
    border-color: rgba(192, 132, 252, 0.35);
}

body.dark-mode .base-drawer-list summary {
    color: #c084fc;
}


/* ===================================
   FIX19: SMOOTHER ZOOM PAN
=================================== */

.layout-viewer {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scroll-behavior: auto;
    touch-action: pan-x pan-y pinch-zoom;
}

.layout-viewer.is-pinching-map {
    cursor: zoom-in;
    user-select: none;
}

.layout-viewer.is-pinching-map .map-surface {
    will-change: transform;
}

.map-surface {
    contain: layout paint;
}

#layoutCanvas,
#aisleCanvas {
    transform: translateZ(0);
}


/* ===================================
   FIX20: RAMS VIEWER
=================================== */

.rams-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.rams-open-btn {
    border: 1px solid rgba(0, 83, 159, 0.25);
    background: rgba(0, 83, 159, 0.08);
    color: #00539f;
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 900;
    cursor: pointer;
}

.rams-open-btn:hover {
    background: rgba(0, 83, 159, 0.14);
}

.rams-viewer {
    min-height: 260px;
    padding: 10px;
}

#ramsCanvas {
    display: block;
    max-width: none;
    margin: 0 auto;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}

body.dark-mode .rams-open-btn {
    border-color: rgba(105, 183, 255, 0.35);
    background: rgba(105, 183, 255, 0.12);
    color: #69b7ff;
}


/* ===================================
   FIX21: OTHER FILES VIEWER
=================================== */

.other-files-list {
    display: grid;
    gap: 8px;
    margin: 12px 0;
}

.other-file-btn {
    text-align: left;
    border: 1px solid rgba(0, 83, 159, 0.20);
    background: rgba(0, 83, 159, 0.06);
    color: #00539f;
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 900;
    cursor: pointer;
}

.other-file-btn small {
    display: block;
    margin-top: 4px;
    color: #555;
    font-weight: 700;
}

.other-file-viewer {
    border: 1px solid #d9dee8;
    border-radius: 14px;
    background: #f8f8f8;
    padding: 10px;
    min-height: 220px;
    overflow: auto;
}

.other-file-preview {
    overflow: auto;
    text-align: center;
}

.other-preview-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    background: white;
}

.other-preview-text {
    max-height: 70vh;
    overflow: auto;
    text-align: left;
    white-space: pre-wrap;
    background: white;
    color: #111;
    border-radius: 10px;
    padding: 12px;
}

.other-preview-empty {
    background: white;
    border-radius: 10px;
    padding: 20px;
    font-weight: 800;
}

.other-pdf-canvas {
    display: block;
    margin: 0 auto;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}

.open-file-link {
    display: inline-block;
    border: 1px solid rgba(0, 83, 159, 0.25);
    background: white;
    color: #00539f;
    border-radius: 999px;
    padding: 7px 10px;
    font-weight: 900;
    text-decoration: none;
}

.type-view-only {
    background: rgba(99, 102, 241, 0.10);
    color: #3730a3;
    border-color: rgba(99, 102, 241, 0.25);
}

body.dark-mode .other-file-viewer,
body.dark-mode .other-preview-empty,
body.dark-mode .other-preview-text {
    background: #1e1e1e;
    color: #f1f1f1;
    border-color: #3a3a3a;
}

body.dark-mode .other-file-btn {
    background: rgba(105, 183, 255, 0.12);
    border-color: rgba(105, 183, 255, 0.35);
    color: #69b7ff;
}

body.dark-mode .other-file-btn small {
    color: #cfcfcf;
}

body.dark-mode .open-file-link {
    background: #222;
    color: #69b7ff;
    border-color: rgba(105, 183, 255, 0.35);
}


/* ===================================
   FIX23: RAMS ALSO IN OTHER FILES
=================================== */

.other-file-btn small::before {
    content: "View-only: ";
}


/* ===================================
   FIX24: RAMS FILL SIGN
=================================== */

.rams-form-tools {
    margin: 12px 0;
}

.rams-fill-panel {
    border: 1px solid rgba(0, 83, 159, 0.22);
    background: rgba(0, 83, 159, 0.05);
    border-radius: 14px;
    padding: 10px 12px;
}

.rams-fill-panel summary {
    cursor: pointer;
    font-weight: 900;
    color: #00539f;
}

.rams-form-note {
    margin: 8px 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: #444;
}

.rams-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin: 10px 0;
}

.rams-field-grid label {
    display: grid;
    gap: 5px;
    font-weight: 900;
}

.rams-field-grid input {
    border: 1px solid #ccd3df;
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 1rem;
}

.rams-signature-wrap {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(240px, 520px) auto;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

#ramsSignaturePad {
    width: 100%;
    max-width: 520px;
    height: 120px;
    background: #fff;
    border: 2px dashed rgba(0, 83, 159, 0.35);
    border-radius: 12px;
    touch-action: none;
}

.rams-tool-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.rams-tool-row button,
.rams-fill-panel button {
    border: 1px solid rgba(0, 83, 159, 0.25);
    background: #ffffff;
    color: #00539f;
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 900;
    cursor: pointer;
}

.rams-tool-row button:hover,
.rams-fill-panel button:hover {
    background: rgba(0, 83, 159, 0.10);
}

.rams-tool-row .active-tool {
    background: #00539f;
    color: #fff;
}

.rams-fill-panel .secondary-btn {
    background: rgba(0,0,0,0.04);
    color: #333;
}

#ramsCanvas {
    cursor: crosshair;
}

body.dark-mode .rams-fill-panel {
    background: rgba(105, 183, 255, 0.10);
    border-color: rgba(105, 183, 255, 0.35);
}

body.dark-mode .rams-fill-panel summary,
body.dark-mode .rams-tool-row button,
body.dark-mode .rams-fill-panel button {
    color: #69b7ff;
}

body.dark-mode .rams-tool-row .active-tool {
    background: #69b7ff;
    color: #041323;
}

body.dark-mode .rams-form-note {
    color: #d0d0d0;
}

@media (max-width: 700px) {
    .rams-signature-wrap {
        grid-template-columns: 1fr;
    }

    #ramsSignaturePad {
        max-width: 100%;
    }
}


/* ===================================
   FIX25: FIND RAMS SIGN PAGE
=================================== */

.rams-sign-page-status {
    display: inline-block;
    margin-bottom: 5px;
    color: #00539f;
    font-weight: 900;
}

body.dark-mode .rams-sign-page-status {
    color: #69b7ff;
}


/* ===================================
   FIX26: PLANOGRAM DETECTION FIX
=================================== */

button.open-file-link {
    cursor: pointer;
    font-family: inherit;
}


/* ===================================
   FIX27: AISLE WIDTHS IN LAYOUT
=================================== */

.highlight-filter-panel .chip-aisle {
    background: rgba(227, 6, 19, 0.10);
    border-color: #e30613;
    color: #a9000b;
}

.highlight-filter-panel .chip-aisle input {
    accent-color: #e30613;
}

.aisle-width-summary summary {
    color: #a9000b;
}

body.dark-mode .highlight-filter-panel .chip-aisle {
    background: rgba(255, 106, 114, 0.12);
    border-color: rgba(255, 106, 114, 0.45);
    color: #ff8b91;
}

body.dark-mode .aisle-width-summary summary {
    color: #ff8b91;
}


/* FIX28 - smaller, more precise layout highlights */
.layout-overlay .marker-aisle-width {
    font-size: 9px;
    padding: 2px 4px;
}


/* ===================================
   FIX29: SINGLE CLEAN UPLOAD BOX
=================================== */

#pdfFile,
#folderFile {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.upload-note {
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: 800;
    color: #4b5563;
}

body.dark-mode .upload-note {
    color: #cfcfcf;
}


/* ===================================
   FIX30: ROBUST UPLOAD BUTTON
=================================== */

.upload-drop {
    user-select: none;
}

.upload-drop:focus-visible {
    outline: 3px solid rgba(0, 83, 159, 0.35);
    outline-offset: 3px;
}

.upload-drop.drag-over {
    background: #e8f3ff;
    border-color: #e30613;
    box-shadow: 0 0 0 4px rgba(227, 6, 19, 0.10);
}

body.dark-mode .upload-drop.drag-over {
    background: rgba(105, 183, 255, 0.12);
}


/* ===================================
   FIX31: PDF LOADING BAR
=================================== */

.upload-progress {
    margin-top: 12px;
    border: 1px solid rgba(0, 83, 159, 0.18);
    background: rgba(0, 83, 159, 0.05);
    border-radius: 14px;
    padding: 10px;
}

.upload-progress[hidden] {
    display: none !important;
}

.upload-progress-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 900;
    color: #00539f;
    margin-bottom: 8px;
}

.upload-progress-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(0, 83, 159, 0.12);
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #00539f, #e30613);
    transition: width 0.22s ease;
}

body.dark-mode .upload-progress {
    border-color: rgba(105, 183, 255, 0.25);
    background: rgba(105, 183, 255, 0.10);
}

body.dark-mode .upload-progress-top {
    color: #69b7ff;
}

body.dark-mode .upload-progress-track {
    background: rgba(105, 183, 255, 0.14);
}


/* ===================================
   FIX33: STORE INFO FIX
=================================== */

.store-extra-details {
    margin-top: 8px;
    border-top: 1px solid rgba(0, 83, 159, 0.14);
    padding-top: 6px;
}

.store-extra-details summary {
    cursor: pointer;
    color: #00539f;
    font-weight: 900;
}

.store-hours,
.store-link {
    margin-top: 6px;
    font-size: 0.92rem;
}

.store-link a {
    color: #00539f;
    font-weight: 900;
}


/* ===================================
   FIX34: PLAIN LAYOUT + HIGHLIGHTS MAP
=================================== */

#plainLayoutOverlay {
    pointer-events: none;
}

#plainLayoutOverlay:empty {
    display: none;
}

#highlightsTab .layout-filter-title {
    margin-top: 14px;
}


/* ===================================
   FIX35: DEEP PDF TYPE SCAN
=================================== */

.upload-review .detected-type-pill.type-ignore,
.upload-review .detected-type-pill.type-view-only {
    background: rgba(107, 114, 128, 0.12);
    color: #374151;
    border-color: rgba(107, 114, 128, 0.25);
}


/* ===================================
   FIX36: PLANOGRAM + HIGHLIGHT ACCURACY
=================================== */

.layout-marker.marker-shape-only {
    transform: none !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.layout-marker.marker-zpanel-oval {
    border-width: 2px !important;
    background: rgba(255, 79, 178, 0.035) !important;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.80) !important;
}

.layout-marker.marker-mod-fill {
    border-radius: 5px !important;
    border-width: 2px !important;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.60) !important;
}

.layout-marker.marker-drawer-fill {
    background: rgba(124, 58, 237, 0.08) !important;
    border-color: rgba(124, 58, 237, 0.78) !important;
}

.layout-marker.marker-capping-fill {
    background: rgba(22, 163, 74, 0.08) !important;
    border-color: rgba(22, 163, 74, 0.78) !important;
}

.marker-graphic {
    font-size: 8px !important;
    padding: 1px 3px !important;
    transform: translate(-50%, -50%) !important;
}


/* ===================================
   FIX37: SORT BY EXCLUSION + PRECISE DOT HIGHLIGHTS
=================================== */

.layout-marker.marker-precise-dot {
    width: 14px !important;
    height: 14px !important;
    border-radius: 999px !important;
    transform: translate(-50%, -50%) !important;
    padding: 0 !important;
    background: rgba(255,255,255,0.86) !important;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.92), 0 1px 3px rgba(0,0,0,0.18) !important;
}

.layout-marker.marker-zpanel-dot {
    border: 3px solid rgba(255, 79, 178, 0.95) !important;
}

.layout-marker.marker-drawer-dot {
    border: 3px solid rgba(124, 58, 237, 0.95) !important;
}

.layout-marker.marker-capping-dot {
    border: 3px solid rgba(22, 163, 74, 0.95) !important;
}

.marker-graphic {
    font-size: 8px !important;
    padding: 1px 3px !important;
}


/* ===================================
   FIX38: FORCE PLANOGRAM CONTENT
=================================== */

.type-planograms,
.detected-type-pill.type-planograms {
    font-weight: 900;
}


/* ===================================
   FIX39: NO FOLDER RAMS SORT
=================================== */

.upload-review .review-help {
    font-weight: 800;
}


/* ===================================
   FIX40: NO UPLOAD CHECK / NO OTHER TAB
=================================== */

.upload-note {
    color: #00539f;
}


/* ===================================
   FIX41: RESTORE PLANOGRAM MAP LOAD
=================================== */

.file-pill.good small {
    word-break: break-word;
}


/* ===================================
   FIX42: LAYOUT NOT RAMS
=================================== */

.file-pill.good {
    border-color: #16a34a;
}


/* ===================================
   FIX43: MOD CARD SPECIALS TESTED
=================================== */

.layout-source-row {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.layout-source-row span {
    font-size: 0.72rem;
    font-weight: 800;
    color: #4b5563;
    background: rgba(0, 83, 159, 0.07);
    border: 1px solid rgba(0, 83, 159, 0.16);
    border-radius: 999px;
    padding: 3px 7px;
}

body.dark-mode .layout-source-row span {
    color: #d1d5db;
    background: rgba(105, 183, 255, 0.12);
    border-color: rgba(105, 183, 255, 0.25);
}


/* ===================================
   FIX44: REMOVE BAD TRAY BADGE
=================================== */

.badge-hidden {
    display: none !important;
}


/* ===================================
   FIX45: STRICT DRAWERS CAPPING
=================================== */

.base-drawer-row .height-value {
    font-weight: 900;
}

.capping-shelf-row .height-value {
    font-weight: 900;
}


/* ===================================
   FIX46: GRILL TO RISER
=================================== */

.badge-grill {
    font-weight: 900;
}


/* ===================================
   FIX47: COMPACT HEADER
=================================== */

.store-header,
.files-panel {
    padding: 10px 14px !important;
    margin-bottom: 10px !important;
    border-radius: 12px !important;
}

.store-header .section-title {
    font-size: 16px !important;
    margin-bottom: 8px !important;
    line-height: 1.1 !important;
}

.store-grid {
    grid-template-columns: 0.65fr 1fr 1.25fr !important;
    gap: 8px !important;
}

.store-info-block {
    min-height: 0 !important;
    padding: 8px 10px !important;
    gap: 8px !important;
    border-radius: 11px !important;
    align-items: center !important;
}

.store-icon {
    width: 28px !important;
    height: 28px !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    border-width: 2px !important;
}

.store-info-block small {
    font-size: 11px !important;
    margin-bottom: 1px !important;
    line-height: 1.05 !important;
}

#storeNumber,
#storeName,
#storeAddress {
    margin-bottom: 0 !important;
    font-size: 13px !important;
    line-height: 1.18 !important;
    font-weight: 900 !important;
}

.store-extra-details {
    margin-top: 5px !important;
    padding-top: 4px !important;
}

.store-extra-details summary {
    font-size: 12px !important;
    line-height: 1.1 !important;
}

.store-hours,
.store-link {
    margin-top: 4px !important;
    font-size: 11px !important;
}

.files-list {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 8px !important;
}

.file-pill {
    padding: 8px 10px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    line-height: 1.1 !important;
    min-height: 0 !important;
}

.file-pill small {
    margin-top: 4px !important;
    font-size: 11px !important;
    line-height: 1.15 !important;
    max-height: 2.4em;
    overflow: hidden;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

@media (max-width: 850px) {
    .store-grid {
        grid-template-columns: 1fr !important;
    }

    .files-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 520px) {
    .files-list {
        grid-template-columns: 1fr !important;
    }
}


/* ===================================
   FIX48: REMOVE EXPORT AND JUMP
=================================== */

#exportReportBtn,
#merchGroupSelect {
    display: none !important;
}


/* ===================================
   FIX49: NULL GUARDS + PDF MODAL RESTORE
=================================== */

#closePdfBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 8px 14px;
    margin-bottom: 8px;
}


/* ===================================
   FIX50: SHAPED LAYOUT HIGHLIGHTS
=================================== */

.layout-marker.marker-shape-only,
.layout-marker.marker-area,
.layout-marker.marker-aisle-width-box {
    transform: none !important;
    padding: 0 !important;
    font-size: 0 !important;
    box-sizing: border-box !important;
    pointer-events: auto;
}

.layout-marker.marker-zpanel-oval {
    border: 4px solid rgba(236, 0, 219, 0.95) !important;
    border-radius: 999px !important;
    background: rgba(236, 0, 219, 0.04) !important;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.82) !important;
}

.layout-marker.marker-capping-strip {
    border: 5px solid rgba(0, 210, 0, 0.96) !important;
    border-radius: 3px !important;
    background: rgba(0, 210, 0, 0.06) !important;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.72) !important;
}

.layout-marker.marker-drawer-label {
    border: 3px solid rgba(0, 82, 204, 0.92) !important;
    border-radius: 4px !important;
    background: rgba(0, 82, 204, 0.05) !important;
}

.layout-marker.marker-area.marker-drawer {
    border: 7px solid rgba(0, 82, 204, 0.97) !important;
    border-radius: 8px !important;
    background: rgba(32, 150, 255, 0.14) !important;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.85) !important;
}

.layout-marker.marker-aisle-width-box {
    border: 3px solid rgba(220, 38, 38, 0.75) !important;
    border-radius: 7px !important;
    background: rgba(220, 38, 38, 0.06) !important;
    color: rgba(220, 38, 38, 0.95) !important;
    font-size: 18px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.marker-graphic {
    font-size: 8px !important;
    padding: 1px 3px !important;
    transform: translate(-50%, -50%) !important;
}


/* ===================================
   FIX51: CLEAN SHAPED HIGHLIGHTS FINAL OVERRIDES
=================================== */

.layout-marker.marker-precise-dot {
    display: none !important;
}

.layout-marker.marker-shape-only,
.layout-marker.marker-area,
.layout-marker.marker-aisle-width-box {
    transform: none !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.layout-marker.marker-zpanel-oval {
    border: 4px solid rgba(236, 0, 219, 0.96) !important;
    border-radius: 999px !important;
    background: rgba(236, 0, 219, 0.045) !important;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.85) !important;
}

.layout-marker.marker-capping-strip {
    border: 5px solid rgba(0, 210, 0, 0.98) !important;
    border-radius: 3px !important;
    background: rgba(0, 210, 0, 0.065) !important;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.78) !important;
}

.layout-marker.marker-area.marker-drawer {
    border: 7px solid rgba(0, 82, 204, 0.98) !important;
    border-radius: 8px !important;
    background: rgba(32, 150, 255, 0.15) !important;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.86) !important;
}

.layout-marker.marker-aisle-width-box {
    border: 3px solid rgba(220, 38, 38, 0.75) !important;
    border-radius: 7px !important;
    background: rgba(220, 38, 38, 0.06) !important;
    color: rgba(220, 38, 38, 0.96) !important;
    font-size: 18px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.marker-graphic {
    font-size: 8px !important;
    padding: 1px 3px !important;
    transform: translate(-50%, -50%) !important;
}


/* ===================================
   FIX52: DRAWER STRIP HIGHLIGHTS
=================================== */

.layout-marker.marker-area.marker-drawer {
    display: none !important;
}

.layout-marker.marker-drawer-strip {
    border: 4px solid rgba(0, 82, 204, 0.98) !important;
    border-radius: 5px !important;
    background: rgba(0, 82, 204, 0.06) !important;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.84) !important;
}

.layout-marker.marker-shape-only,
.layout-marker.marker-aisle-width-box {
    transform: none !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.layout-marker.marker-zpanel-oval {
    border: 4px solid rgba(236, 0, 219, 0.96) !important;
    border-radius: 999px !important;
    background: rgba(236, 0, 219, 0.045) !important;
}

.layout-marker.marker-capping-strip {
    border: 5px solid rgba(0, 210, 0, 0.98) !important;
    border-radius: 3px !important;
    background: rgba(0, 210, 0, 0.065) !important;
}

.layout-marker.marker-aisle-width-box {
    border: 3px solid rgba(220, 38, 38, 0.75) !important;
    border-radius: 7px !important;
    background: rgba(220, 38, 38, 0.06) !important;
    color: rgba(220, 38, 38, 0.96) !important;
    font-size: 18px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}


/* FIX53: Aisle widths as red text + arrows, no boxes */

.layout-marker.marker-aisle-width-inline {
    position: absolute;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #dc2626 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    padding: 0 !important;
    min-width: 88px;
    min-height: 24px;
    white-space: nowrap;
    transform: none !important;
    pointer-events: none;
    text-shadow: 0 0 1px rgba(255,255,255,0.95), 0 0 3px rgba(255,255,255,0.85);
}

.layout-marker.marker-aisle-width-inline .aisle-arrow,
.layout-marker.marker-aisle-width-inline .aisle-width-text {
    color: #dc2626 !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
}

.layout-marker.marker-aisle-width-inline .aisle-arrow {
    letter-spacing: -1px;
}

.layout-marker.marker-aisle-width-box { border: none !important; background: transparent !important; box-shadow: none !important; }


/* FIX54: aisle width measurements red only */
.layout-marker.marker-aisle-width-text-only {
    position: absolute;
    display: inline-block !important;
    color: #dc2626 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: auto !important;
    min-height: auto !important;
    transform: none !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    pointer-events: none;
    text-shadow: 0 0 1px rgba(255,255,255,0.98), 0 0 3px rgba(255,255,255,0.95);
}

.layout-marker.marker-aisle-width-inline,
.layout-marker.marker-aisle-width-box {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #dc2626 !important;
}


/* FIX55: recolor original aisle-width text in place */
.layout-marker.marker-aisle-width-recolor {
    position: absolute;
    display: flex !important;
    align-items: flex-start;
    justify-content: flex-start;
    color: #dc2626 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: auto !important;
    min-height: auto !important;
    transform: none !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    pointer-events: none;
    text-shadow: 0 0 1px rgba(255,255,255,0.99), 0 0 2px rgba(255,255,255,0.98), 0 0 3px rgba(255,255,255,0.95);
}

.layout-marker.marker-aisle-width-text-only,
.layout-marker.marker-aisle-width-inline,
.layout-marker.marker-aisle-width-box {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}


/* FIX56: replace original aisle-width number with red in the same spot */
.layout-marker.marker-aisle-width-cover {
    position: absolute;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #dc2626 !important;
    background: #ffffff !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: auto !important;
    min-height: auto !important;
    transform: none !important;
    font-size: var(--aisle-font-size, 10px) !important;
    line-height: var(--aisle-line-height, 10px) !important;
    font-weight: 800 !important;
    font-family: Arial, Helvetica, sans-serif !important;
    white-space: nowrap !important;
    pointer-events: none;
    text-shadow: none !important;
}

.layout-marker.marker-aisle-width-recolor,
.layout-marker.marker-aisle-width-text-only,
.layout-marker.marker-aisle-width-inline,
.layout-marker.marker-aisle-width-box {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}


/* FIX58: aisle widths are recoloured directly on canvas, not by overlay */
.layout-marker.marker-aisle-width-disabled,
.layout-marker.marker-aisle-width-cover,
.layout-marker.marker-aisle-width-recolor,
.layout-marker.marker-aisle-width-text-only,
.layout-marker.marker-aisle-width-inline,
.layout-marker.marker-aisle-width-box {
    display: none !important;
}


/* FIX59: separate highlight maps */
.highlight-map-title {
    width: 100%;
    font-size: 12px;
    font-weight: 900;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.highlight-map-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.highlight-map-btn {
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.highlight-map-btn.active {
    background: var(--tesco-blue);
    color: #fff;
    border-color: var(--tesco-blue);
}

.layout-marker.marker-shape-only,
.layout-marker.marker-area,
.layout-marker.marker-aisle-width-disabled,
.layout-marker.marker-aisle-width-cover,
.layout-marker.marker-aisle-width-recolor,
.layout-marker.marker-aisle-width-text-only,
.layout-marker.marker-aisle-width-inline,
.layout-marker.marker-aisle-width-box {
    display: none !important;
}


/* FIX60: smaller, neater map selector and highlights */
.highlight-map-buttons {
    gap: 6px !important;
}

.highlight-map-btn {
    padding: 6px 10px !important;
    font-size: 11px !important;
    border-radius: 999px !important;
}

.highlight-map-title {
    font-size: 11px !important;
    margin-bottom: 5px !important;
}


/* FIX61: full-screen image map viewer */
.clickable-map-canvas {
    cursor: zoom-in;
}

.map-fullscreen-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    flex-direction: column;
    background: rgba(10, 14, 20, 0.94);
}

.map-fullscreen-modal.open {
    display: flex;
}

.fullscreen-map-open {
    overflow: hidden !important;
}

.map-fullscreen-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.map-fullscreen-title {
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.2;
}

.map-fullscreen-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.map-fullscreen-actions button {
    min-height: 34px;
    border: none;
    border-radius: 10px;
    padding: 7px 10px;
    background: #fff;
    color: #003b73;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.map-fullscreen-viewport {
    position: relative;
    flex: 1;
    overflow: hidden;
    background: #0f172a;
    touch-action: none;
}

.map-fullscreen-image {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: none;
    max-height: none;
    transform: translate(-50%, -50%) scale(1);
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
    cursor: grab;
    touch-action: none;
}

.map-fullscreen-image.dragging {
    cursor: grabbing;
}

@media (max-width: 768px) {
    .map-fullscreen-topbar {
        align-items: flex-start;
        padding: 8px;
    }

    .map-fullscreen-title {
        font-size: 12px;
    }

    .map-fullscreen-actions button {
        min-height: 32px;
        padding: 6px 8px;
        font-size: 12px;
    }
}


/* FIX62: high quality fullscreen map display */
.map-fullscreen-image {
    image-rendering: auto;
}


/* FIX68: MOD card cleanup */
.layout-source-row {
    display: none !important;
}


body.dark-mode .stat-wide-card,
body.dark-mode .merch-group-count-row {
    background: #1e1e1e;
    border-color: #3a3a3a;
}

body.dark-mode .stat-wide-card summary,
body.dark-mode .merch-group-count-row strong {
    color: #69b7ff;
}

body.dark-mode .stat-extra {
    color: #aaa;
}


.ambient-stats-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.ambient-stats-title strong {
    color: #00539f;
    font-size: 18px;
}

.ambient-stats-title span {
    color: #666;
    font-size: 13px;
    font-weight: 800;
}

body.dark-mode .ambient-stats-title strong {
    color: #69b7ff;
}

body.dark-mode .ambient-stats-title span {
    color: #aaa;
}


.special-fixture-counts-card .merch-group-count-row strong {
    white-space: nowrap;
    font-size: 14px;
}

@media (max-width: 640px) {
    .special-fixture-counts-card .merch-group-count-row {
        grid-template-columns: 1fr;
    }

    .special-fixture-counts-card .merch-group-count-row strong {
        justify-self: start;
    }
}

/* FIX81 special fixture unit count display */

/* FIX82: hanging bar badge */
.badge-bar {
    background: #fff1d6;
    color: #7a4a00;
}

/* ===================================
   FIX83: PLANOGRAM PRO PROFESSIONAL BRANDING
=================================== */
:root {
    --pro-navy: #06103a;
    --pro-blue: #075fe8;
    --pro-blue-soft: #eaf2ff;
    --pro-red: #e50914;
    --pro-red-soft: #fff0f1;
    --pro-silver: #e9eef5;
}

body {
    background:
        radial-gradient(circle at 5% 0%, rgba(7, 95, 232, 0.10), transparent 30%),
        radial-gradient(circle at 100% 12%, rgba(229, 9, 20, 0.07), transparent 28%),
        linear-gradient(180deg, #f9fbff 0%, #f1f5fb 100%);
}

.professional-brand {
    max-width: 1400px;
}

.pro-top-strip {
    min-height: 58px;
    gap: 14px;
}

.pro-header-logo-wrap {
    display: flex;
    align-items: center;
    min-width: 0;
}

.pro-header-logo {
    display: block;
    width: min(520px, 62vw);
    max-height: 64px;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 8px 18px rgba(6, 16, 58, 0.10));
}

.pro-brand-card {
    padding: clamp(18px, 3.5vw, 38px);
    border-radius: 30px;
    text-align: left;
    overflow: hidden;
    border: 1px solid rgba(7, 95, 232, 0.12);
    box-shadow: 0 24px 70px rgba(6, 16, 58, 0.13);
    background:
        radial-gradient(circle at 90% 20%, rgba(7, 95, 232, 0.12), transparent 30%),
        radial-gradient(circle at 0% 100%, rgba(229, 9, 20, 0.11), transparent 28%),
        linear-gradient(135deg, rgba(255,255,255,0.98), rgba(240,246,255,0.96));
}

.pro-brand-card::before,
.pro-brand-card::after {
    opacity: 0.05;
}

.pro-brand-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    align-items: center;
    justify-items: start;
}

.pro-master-logo {
    display: block;
    width: min(620px, 100%);
    height: auto;
    margin: 0;
    filter: drop-shadow(0 18px 22px rgba(6, 16, 58, 0.11));
}

.pro-tagline {
    margin: 4px 0 0;
    color: #17213f;
    font-size: clamp(18px, 2.8vw, 32px);
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.pro-feature-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.pro-feature-row span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--pro-navy);
    background: rgba(255,255,255,0.86);
    border: 1px solid rgba(7, 95, 232, 0.12);
    box-shadow: 0 8px 22px rgba(6, 16, 58, 0.08);
    font-weight: 800;
    font-size: 13px;
}

.app-footer {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 18px 28px;
    display: grid;
    gap: 8px;
    justify-items: center;
    color: #4b5563;
    font-weight: 700;
}

.footer-logo {
    width: min(720px, 100%);
    max-height: 104px;
    object-fit: contain;
    border-radius: 18px;
    box-shadow: 0 18px 44px rgba(6, 16, 58, 0.15);
}

.footer-copy {
    font-size: 13px;
    letter-spacing: 0.01em;
    text-align: center;
}

body.dark-mode {
    background:
        radial-gradient(circle at 5% 0%, rgba(7, 95, 232, 0.18), transparent 30%),
        radial-gradient(circle at 100% 12%, rgba(229, 9, 20, 0.12), transparent 28%),
        linear-gradient(180deg, #050817 0%, #090f24 100%);
}

body.dark-mode .pro-brand-card {
    background:
        radial-gradient(circle at 90% 20%, rgba(7, 95, 232, 0.20), transparent 30%),
        radial-gradient(circle at 0% 100%, rgba(229, 9, 20, 0.16), transparent 28%),
        linear-gradient(135deg, rgba(14,24,52,0.98), rgba(9,16,36,0.98));
    border-color: rgba(255,255,255,0.10);
}

body.dark-mode .pro-tagline,
body.dark-mode .footer-copy {
    color: #eaf2ff;
}

body.dark-mode .pro-feature-row span {
    color: #ffffff;
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.12);
}

body.dark-mode .theme-corner {
    background: #111827;
    border-color: rgba(255,255,255,0.12);
}

body.dark-mode .theme-corner label {
    color: #ffffff;
}

@media (max-width: 700px) {
    .pro-top-strip {
        min-height: 52px;
    }

    .pro-header-logo {
        width: min(270px, 58vw);
        max-height: 48px;
    }

    .pro-brand-card {
        border-radius: 22px;
        padding: 18px 14px 20px;
    }

    .pro-master-logo {
        width: 100%;
        max-width: 420px;
    }

    .pro-feature-row {
        gap: 6px;
    }

    .pro-feature-row span {
        font-size: 12px;
        padding: 7px 10px;
    }

    .footer-logo {
        max-height: 72px;
    }
}

/* ===================================
   FIX86 MODERN WORKSPACE POLISH
=================================== */

.brand-header.professional-brand {
    padding-bottom: 0;
}

.top-strip.pro-top-strip {
    border-radius: 0 0 22px 22px;
    box-shadow: 0 14px 35px rgba(6, 16, 58, 0.14);
}

.upload-card,
.store-header,
.panel-card,
.stat-card,
.stat-wide-card,
.kpi-card {
    border-radius: 18px;
}

.upload-drop {
    align-items: center;
}

.upload-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.demo-pack-btn {
    border: 0;
    border-radius: 999px;
    padding: 11px 16px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--tesco-red), var(--tesco-red-dark));
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(227, 30, 36, 0.2);
}

.demo-pack-btn:hover {
    transform: translateY(-1px);
}

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

.kpi-card {
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(0,83,159,0.12);
    padding: 16px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
    min-width: 0;
}

.kpi-value {
    font-size: clamp(24px, 4vw, 38px);
    line-height: 1;
    font-weight: 950;
    color: var(--tesco-blue);
}

.kpi-label {
    margin-top: 6px;
    font-weight: 950;
    color: var(--text-main);
}

.kpi-extra {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-soft);
}

.kpi-empty {
    grid-column: 1 / -1;
}

.tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
    margin: 14px 0 18px;
    border-radius: 999px;
    background: rgba(0, 83, 159, 0.08);
    border: 1px solid rgba(0, 83, 159, 0.12);
}

.tab-btn {
    border: 0;
    border-radius: 999px;
    padding: 12px 10px;
    background: transparent;
    color: var(--tesco-blue);
    font-weight: 950;
}

.tab-btn.active {
    background: #fff;
    color: var(--tesco-blue-dark);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.stats-panel {
    gap: 12px;
}

.stat-card,
.stat-wide-card {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.055);
    border-color: rgba(0, 83, 159, 0.12);
}

.app-footer {
    opacity: 0.86;
}

.app-footer .footer-logo {
    max-width: 150px;
}

body.dark-mode .tabs {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.1);
}

body.dark-mode .tab-btn {
    color: #dfe8ff;
}

body.dark-mode .tab-btn.active,
body.dark-mode .kpi-card {
    background: rgba(20, 26, 39, 0.96);
    color: #fff;
}

body.dark-mode .kpi-value {
    color: #8dbbff;
}

body.dark-mode .demo-pack-btn {
    box-shadow: none;
}

@media (max-width: 820px) {
    .kpi-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tabs {
        border-radius: 18px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .upload-actions {
        justify-content: stretch;
    }

    .upload-actions > * {
        width: 100%;
        text-align: center;
    }
}


/* ===================================
   FIX86 COMPACT PLANOGRAM WORKSPACE
=================================== */
.zone-chip-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 18px;
    padding: 10px;
    background: rgba(0, 83, 159, 0.08);
    border: 1px solid rgba(0, 83, 159, 0.15);
    border-radius: 18px;
}

.zone-chip {
    border: 1px solid rgba(0, 83, 159, 0.22);
    background: #fff;
    color: var(--tesco-blue, #00539f);
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 120px;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 83, 159, 0.08);
}

.zone-chip span {
    background: rgba(0, 83, 159, 0.1);
    color: var(--tesco-blue, #00539f);
    border-radius: 999px;
    padding: 2px 8px;
}

.zone-chip.active {
    background: linear-gradient(135deg, var(--tesco-blue, #00539f), #0071ce);
    color: #fff;
}

.zone-chip.active span {
    background: rgba(255,255,255,0.22);
    color: #fff;
}

.compact-zone { display: none; margin-top: 0; }
.compact-zone.active { display: block; }

.compact-group {
    background: #fff;
    border: 1px solid rgba(0, 83, 159, 0.12);
    border-radius: 16px;
    margin: 12px 0;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 83, 159, 0.06);
}

.compact-group-title {
    list-style: none;
    background: linear-gradient(135deg, #00539f, #0071ce);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
}

.compact-group-title::-webkit-details-marker { display: none; }
.compact-group[open] .compact-group-title { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

.group-title-main { font-size: 15px; font-weight: 900; }
.group-title-meta { font-size: 12px; opacity: 0.9; white-space: nowrap; }

.compact-mods-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
    padding: 12px;
}

.compact-mod-card {
    padding: 12px;
    border-radius: 14px;
    border: 1px solid #dfe8f2;
    box-shadow: none;
    min-height: 0;
}

.compact-mod-card:hover { transform: none; border-color: #b8d1ea; }

.compact-mod-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.compact-mod-card .mod-header { margin-bottom: 2px; font-size: 15px; }
.compact-size { font-size: 12px; color: #2b3d4f; margin: 0; font-weight: 800; }
.compact-mod-meta { margin: 8px 0; color: #536579; font-size: 12px; font-weight: 800; }

.compact-count {
    min-width: 58px;
    text-align: center;
    border-radius: 12px;
    padding: 6px 8px;
    background: rgba(0, 83, 159, 0.08);
    color: var(--tesco-blue, #00539f);
}

.compact-count strong { display: block; font-size: 20px; line-height: 1; }
.compact-count span { display: block; font-size: 10px; font-weight: 900; text-transform: uppercase; }

.shelf-details {
    margin-top: 8px;
    border-top: 1px solid #eef2f6;
    padding-top: 8px;
}

.shelf-details summary {
    cursor: pointer;
    color: var(--tesco-blue, #00539f);
    font-weight: 900;
    font-size: 12px;
}

.compact-open-btn {
    width: 100%;
    margin-top: 10px;
    padding: 9px 10px;
    border-radius: 10px;
}

body.dark-mode .zone-chip-bar,
body.dark-mode .compact-group,
body.dark-mode .compact-mod-card {
    background: #1f1f1f;
    border-color: #333;
}

body.dark-mode .zone-chip { background: #262626; color: #d9ecff; border-color: #3a5570; }
body.dark-mode .compact-size,
body.dark-mode .compact-mod-meta { color: #c7d3df; }
body.dark-mode .shelf-details { border-top-color: #333; }

@media (max-width: 760px) {
    .compact-group-title { align-items: flex-start; flex-direction: column; gap: 4px; }
    .group-title-meta { white-space: normal; }
    .zone-chip { flex: 1 1 calc(50% - 10px); min-width: 0; }
}

/* ===================================
   FIX89 SINGLE HEADER / NO DUPLICATE HERO
=================================== */
.brand-header.professional-brand {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 18px 8px;
}

.top-strip.pro-top-strip {
    min-height: 54px;
    margin-bottom: 0;
    padding: 8px 12px;
    border-radius: 18px;
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(7,95,232,0.12);
    box-shadow: 0 10px 28px rgba(6, 16, 58, 0.10);
    backdrop-filter: blur(14px);
}

.pro-header-logo {
    width: min(300px, 48vw);
    max-height: 44px;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 5px 12px rgba(6, 16, 58, 0.08));
}

.container {
    padding-top: 0;
}

/* The large promotional hero has been removed in markup; keep it suppressed if any stale cache injects it. */
.pro-brand-card,
.brand-card.pro-brand-card {
    display: none !important;
}

.theme-corner {
    padding: 6px 8px;
    border-radius: 12px;
}

.theme-corner select {
    padding: 6px 8px;
}

@media (max-width: 700px) {
    .brand-header.professional-brand {
        padding: 8px 12px 6px;
    }
    .top-strip.pro-top-strip {
        min-height: 48px;
        border-radius: 14px;
    }
    .pro-header-logo {
        width: min(220px, 55vw);
        max-height: 38px;
    }
}

body.dark-mode .top-strip.pro-top-strip {
    background: rgba(12, 20, 42, 0.90);
    border-color: rgba(255,255,255,0.12);
}

.badge-bread-tray { background: #fff4d6; color: #6f4a00; border: 1px solid #f0cf7a; }
body.dark-mode .badge-bread-tray { background: #40320f; color: #ffe3a1; border-color: #7a5f1b; }

/* ===================================
   FIX91: TESCO-STYLE COMPACT UI REFRESH
   - no giant hero
   - compact store/files area
   - stats only in Stats tab
   - stronger red/blue visual hierarchy
=================================== */
:root {
    --pp-blue: #00539f;
    --pp-blue-dark: #003f7d;
    --pp-red: #e30613;
    --pp-green: #169447;
    --pp-soft-blue: #eef6ff;
    --pp-border: #d6e3f3;
    --pp-navy: #06103a;
}

.app-shell {
    background:
        radial-gradient(circle at 0% 0%, rgba(0,83,159,0.12), transparent 32%),
        radial-gradient(circle at 100% 0%, rgba(227,6,19,0.08), transparent 30%),
        linear-gradient(180deg, #f7fbff 0%, #ffffff 70%);
}

.brand-header {
    max-width: 1400px;
    margin: 0 auto 8px !important;
    padding: 10px 18px 0 !important;
}

.top-strip.pro-top-strip {
    min-height: 54px !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid rgba(0,83,159,0.12);
}

.pro-header-logo {
    width: min(310px, 58vw) !important;
    max-height: 54px !important;
}

.pro-brand-card,
.brand-card.pro-brand-card,
.pro-brand-copy,
.pro-master-logo,
.pro-tagline,
.pro-feature-row {
    display: none !important;
}

.container {
    padding-top: 8px !important;
}

.upload-card {
    padding: 10px 14px !important;
    margin-bottom: 10px !important;
    border-radius: 14px !important;
    border: 1px solid var(--pp-border) !important;
    background: rgba(255,255,255,0.92) !important;
}

.upload-drop {
    min-height: 48px !important;
    padding: 8px 12px !important;
    border-radius: 12px !important;
    border: 2px dashed rgba(0,83,159,0.35) !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.upload-icon {
    width: 36px !important;
    height: 36px !important;
    font-size: 22px !important;
    flex: 0 0 36px !important;
}

.upload-text strong {
    color: var(--pp-blue) !important;
    font-size: 15px !important;
}

.upload-text span,
.upload-note {
    font-size: 12px !important;
    color: #4b5563 !important;
}

.upload-button {
    margin-left: auto !important;
    background: var(--pp-blue) !important;
    border-radius: 10px !important;
    padding: 9px 14px !important;
    min-width: 126px !important;
    text-align: center !important;
}

.store-header {
    padding: 10px 14px !important;
    margin-bottom: 8px !important;
    border-radius: 14px !important;
    border: 1px solid var(--pp-border) !important;
    background: rgba(255,255,255,0.96) !important;
}

.store-header .section-title {
    color: var(--pp-blue) !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    margin-bottom: 8px !important;
}

.store-grid {
    display: grid !important;
    grid-template-columns: 0.55fr 0.9fr 1.65fr !important;
    gap: 8px !important;
}

.store-info-block {
    min-height: 44px !important;
    padding: 7px 9px !important;
    border-radius: 11px !important;
    background: #fbfdff !important;
    border: 1px solid #e4edf7 !important;
    box-shadow: none !important;
}

.store-icon {
    width: 26px !important;
    height: 26px !important;
    font-size: 15px !important;
    border-radius: 8px !important;
    border-color: var(--pp-blue) !important;
    color: var(--pp-blue) !important;
}

.store-info-block small {
    font-size: 10px !important;
    color: #5b6574 !important;
}

#storeNumber,
#storeName,
#storeAddress {
    font-size: 13px !important;
    line-height: 1.15 !important;
    color: #111827 !important;
    margin: 0 !important;
}

.files-panel {
    padding: 8px !important;
    margin-bottom: 10px !important;
    border-radius: 14px !important;
    background: rgba(255,255,255,0.96) !important;
    border: 1px solid var(--pp-border) !important;
}

.files-list {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 8px !important;
}

.file-pill {
    min-height: 42px !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    background: #fbfffc !important;
    border: 1.5px solid var(--pp-green) !important;
    color: #111827 !important;
    font-size: 13px !important;
    line-height: 1.1 !important;
}

.file-pill small {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 11px !important;
    color: #374151 !important;
}

.kpi-panel,
.stats-only-kpi {
    display: none !important;
}

.tabs {
    margin: 10px 0 12px !important;
    padding: 4px !important;
    border-radius: 18px !important;
    background: #e8f2ff !important;
    border: 1px solid #c9ddf4 !important;
    grid-template-columns: repeat(5, 1fr) !important;
}

.tab-btn {
    border: 0 !important;
    border-radius: 14px !important;
    background: transparent !important;
    color: var(--pp-blue) !important;
    font-weight: 900 !important;
}

.tab-btn.active {
    background: #ffffff !important;
    color: var(--pp-blue-dark) !important;
    box-shadow: 0 4px 14px rgba(0,83,159,0.14) !important;
}

.stats-panel {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(120px, 1fr)) !important;
    gap: 10px !important;
}

.stat-wide-card.stats-section-title {
    grid-column: 1 / -1 !important;
    border-radius: 12px !important;
    padding: 10px 12px !important;
    background: #ffffff !important;
    border: 1px solid var(--pp-border) !important;
}

.stats-overview-title strong,
.ambient-stats-title strong {
    color: var(--pp-blue) !important;
}

.special-stats-title strong {
    color: var(--pp-red) !important;
}

.stat-card {
    border-radius: 14px !important;
    border: 1px solid #d9e7f6 !important;
    background: #ffffff !important;
    box-shadow: 0 8px 22px rgba(0,83,159,0.06) !important;
    min-height: 88px !important;
}

.stat-number {
    color: var(--pp-blue) !important;
    font-size: 28px !important;
}

.zone-chip-bar {
    border-radius: 14px !important;
    padding: 6px !important;
    background: #e8f2ff !important;
    border: 1px solid #c9ddf4 !important;
}
.zone-chip.active { background: var(--pp-blue) !important; color: #fff !important; }
.zone-chip.active span { background: rgba(255,255,255,0.18) !important; color: #fff !important; }

/* Bring back stronger red/blue category feeling without huge bars */
.zone-chip[data-zone="ambient"].active { background: var(--pp-red) !important; }
.zone-chip[data-zone="special-fixtures-ladder-racks"].active { background: var(--pp-blue) !important; }

.badge-graphic { display: none !important; }
.badge-bread-tray { background: #fff1d6 !important; color: #925400 !important; border-color: #ffc46b !important; }

.app-footer {
    padding-bottom: 20px !important;
}
.app-footer .footer-logo,
.footer-logo {
    width: 138px !important;
    max-height: 42px !important;
    box-shadow: none !important;
    border-radius: 10px !important;
}
.footer-copy { font-size: 12px !important; }

@media (max-width: 760px) {
    .store-grid { grid-template-columns: 1fr !important; }
    .files-list { grid-template-columns: 1fr 1fr !important; }
    .upload-drop { align-items: flex-start !important; }
    .upload-button { width: 100% !important; margin-left: 0 !important; }
    .stats-panel { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .tabs { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
    .tab-btn { padding: 8px 4px !important; font-size: 12px !important; }
}

body.dark-mode .app-shell {
    background: linear-gradient(180deg, #050817 0%, #090f24 100%) !important;
}
body.dark-mode .store-header,
body.dark-mode .files-panel,
body.dark-mode .upload-card,
body.dark-mode .stat-card,
body.dark-mode .stat-wide-card.stats-section-title {
    background: #111827 !important;
    border-color: #26384f !important;
}
body.dark-mode #storeNumber,
body.dark-mode #storeName,
body.dark-mode #storeAddress,
body.dark-mode .file-pill,
body.dark-mode .file-pill small {
    color: #eaf2ff !important;
}
body.dark-mode .store-info-block,
body.dark-mode .file-pill {
    background: #0b1222 !important;
    border-color: #27415e !important;
}

/* ===================================
   FIX91: screen-fit and compact polish
=================================== */
html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

.app-shell {
    min-width: 0 !important;
    overflow-x: hidden !important;
}

.brand-header,
.container {
    width: 100% !important;
    max-width: min(1280px, calc(100vw - 16px)) !important;
    box-sizing: border-box !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
}

.top-strip.pro-top-strip {
    min-width: 0 !important;
}

.pro-header-logo {
    width: min(245px, 52vw) !important;
    max-height: 44px !important;
}

.store-header,
.files-panel,
.upload-card,
.tab-panel,
.compact-group,
.compact-mod-card,
.stats-panel,
.layout-viewer-card,
.rams-viewer-card {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.store-header {
    padding: 8px 10px !important;
}

.store-grid {
    grid-template-columns: minmax(90px, 0.55fr) minmax(160px, 0.9fr) minmax(220px, 1.65fr) !important;
}

.files-list {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.file-pill {
    min-width: 0 !important;
}

.tabs {
    display: grid !important;
    width: 100% !important;
    overflow-x: auto !important;
    scrollbar-width: thin;
}

.compact-mods-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    width: 100% !important;
}

.height-item {
    min-width: 0 !important;
}

@media (max-width: 900px) {
    .store-grid { grid-template-columns: 1fr !important; }
    .files-list { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .stats-panel { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 520px) {
    .brand-header,
    .container {
        max-width: calc(100vw - 8px) !important;
        padding-left: 4px !important;
        padding-right: 4px !important;
    }
    .upload-card,
    .store-header,
    .files-panel {
        border-radius: 12px !important;
    }
    .files-list { grid-template-columns: 1fr !important; }
    .compact-mods-grid { grid-template-columns: 1fr !important; padding: 8px !important; }
    .tabs { grid-template-columns: repeat(5, minmax(74px, 1fr)) !important; }
    .tab-btn { white-space: nowrap !important; }
}

/* ===================================
   FIX104 PRIVATE LOGIN
=================================== */

.auth-locked {
    display: none !important;
}

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        radial-gradient(circle at top left, rgba(230, 0, 18, 0.10), transparent 28%),
        radial-gradient(circle at bottom right, rgba(0, 83, 159, 0.16), transparent 32%),
        #eef3fb;
}

.login-screen[hidden] {
    display: none !important;
}

.login-card {
    width: min(420px, 100%);
    background: #fff;
    border: 1px solid rgba(0, 83, 159, 0.14);
    border-radius: 22px;
    padding: 28px;
    box-shadow: 0 18px 50px rgba(6, 16, 58, 0.16);
    text-align: center;
}

.login-logo {
    width: 210px;
    max-width: 80%;
    height: auto;
    display: block;
    margin: 0 auto 12px;
}

.login-card h1 {
    margin: 8px 0 6px;
    color: #00539f;
    font-size: 26px;
}

.login-card p {
    margin: 0 0 20px;
    color: #5c667a;
}

.login-form {
    display: grid;
    gap: 10px;
    text-align: left;
}

.login-form label {
    font-weight: 800;
    color: #06103a;
    font-size: 13px;
}

.login-form select,
.login-form input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 16px;
    background: #fff;
}

.login-form button {
    margin-top: 8px;
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 13px 16px;
    font-weight: 900;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #00539f, #06103a);
    box-shadow: 0 10px 20px rgba(0, 83, 159, 0.22);
}

.login-error {
    min-height: 20px;
    color: #e60012;
    font-weight: 800;
    text-align: center;
}

.login-note {
    margin-top: 12px;
    color: #7a8497;
    font-size: 12px;
}

.current-user-badge {
    font-size: 12px;
    font-weight: 800;
    color: #00539f;
    white-space: nowrap;
}

.logout-btn {
    border: 1px solid #d7dfeb;
    border-radius: 999px;
    padding: 7px 10px;
    font-weight: 800;
    background: #fff;
    color: #06103a;
    cursor: pointer;
}

.logout-btn:hover {
    border-color: #e60012;
    color: #e60012;
}

@media (max-width: 640px) {
    .theme-corner {
        position: static;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .current-user-badge {
        width: 100%;
        text-align: right;
    }
}


/* =========================
   FIX104: CLEAN MANUAL START + MOBILE FIT
========================= */
.login-logo-text,
.pro-header-logo-text,
.footer-logo-text {
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #06103a;
}
.login-logo-text { font-size: 1.6rem; text-align: center; margin-bottom: 0.25rem; }
.login-logo-text span { color: #e30613; }
.pro-header-logo-text { font-size: 1.5rem; margin-left: 0.4rem; white-space: nowrap; }
.pro-header-logo-text b { color: #e30613; }
.footer-logo-text { font-size: 1.25rem; color: #6b7280; }

.upload-card { margin-top: 0.75rem; }
.upload-drop { min-height: 96px; }
.upload-text strong { color: #00539f; }
.upload-button { background: linear-gradient(135deg, #00539f, #06103a); color: white; }

.tab-buttons, .tabs, .tab-row, .workspace-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.tab-buttons button, .tabs button, .tab-row button, .workspace-tabs button {
    flex: 0 0 auto;
    min-width: max-content;
}

body { overflow-x: hidden; }
.container { max-width: 1500px; width: min(100%, 1500px); }
.brand-header, .container, .footer { box-sizing: border-box; }

@media (max-width: 720px) {
    body { font-size: 15px; }
    .app-shell { width: 100%; overflow-x: hidden; }
    .container { padding: 10px; }
    .professional-brand, .brand-header { margin: 0; padding: 10px; border-radius: 0 0 18px 18px; }
    .top-strip, .pro-top-strip { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
    .pro-header-logo { max-width: 170px; height: auto; }
    .theme-corner { transform: none; position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-items: center; font-size: 0.82rem; }
    .theme-corner select { max-width: 100px; }
    .current-user-badge { grid-column: 1 / -1; text-align: right; font-size: 0.78rem; }
    .logout-btn { padding: 8px 10px; }

    .upload-card, .store-card, .files-card, .stats-panel, .content-card, .footer { border-radius: 16px; }
    .upload-drop { padding: 14px; min-height: 86px; display: grid; grid-template-columns: 52px 1fr; gap: 12px; }
    .upload-icon { width: 46px; height: 46px; font-size: 1.6rem; }
    .upload-button { grid-column: 1 / -1; width: 100%; text-align: center; padding: 12px; border-radius: 14px; }
    .upload-note { font-size: 0.9rem; }

    .store-card { padding: 14px; }
    .store-card h2, .section-title { font-size: 1.35rem; margin-bottom: 10px; }
    .store-grid, .store-detail-grid, .files-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
    .store-info-card, .file-status-card { min-height: unset; padding: 12px; }

    .tab-buttons, .tabs, .tab-row, .workspace-tabs { display: flex; gap: 8px; padding: 8px; border-radius: 16px; }
    .tab-buttons button, .tabs button, .tab-row button, .workspace-tabs button { padding: 10px 18px; border-radius: 14px; }

    .mod-grid { grid-template-columns: 1fr !important; }
    .summary-grid, .kpi-grid, .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)) !important; gap: 10px; }
}


/* ===================================
   FIX104 HORIZONTAL MOD ROWS + EXPAND FIX
   Merch groups collapse/expand; MOD cards scroll horizontally within each group.
   Shelf heights remain expanded inside each opened card.
=================================== */

.compact-mods-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    gap: 12px !important;
    padding: 12px !important;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.compact-mods-grid::after {
    content: "";
    flex: 0 0 1px;
}

.compact-mod-card {
    flex: 0 0 245px !important;
    width: 245px;
    max-width: 245px;
    scroll-snap-align: start;
}

.compact-group {
    overflow: hidden;
}

.compact-group[open] {
    overflow: hidden;
}

.compact-group-title {
    position: sticky;
    left: 0;
    z-index: 1;
}

.compact-group-title::after {
    content: "▾";
    font-weight: 900;
    margin-left: auto;
    transition: transform 0.15s ease;
}

.compact-group:not([open]) .compact-group-title::after {
    transform: rotate(-90deg);
}

.shelf-details[open] summary {
    margin-bottom: 6px;
}

.tab-nav,
.pro-tabs,
.tabs {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 760px) {
    .compact-mods-grid {
        padding: 10px !important;
        gap: 10px !important;
    }

    .compact-mod-card {
        flex-basis: min(82vw, 285px) !important;
        width: min(82vw, 285px);
        max-width: min(82vw, 285px);
    }

    .height-item {
        min-height: 24px;
        padding: 4px 0;
    }

    .compact-open-btn {
        position: sticky;
        bottom: 0;
    }
}

@media (min-width: 1100px) {
    .compact-mod-card {
        flex-basis: 230px !important;
        width: 230px;
        max-width: 230px;
    }
}


/* ===================================
   FIX104 TESCO STORE LOOKUP FALLBACK
=================================== */
.store-lookup-fallback {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(0, 83, 159, 0.08);
    border: 1px solid rgba(0, 83, 159, 0.18);
    display: grid;
    gap: 4px;
    font-size: 12px;
}

.lookup-title {
    font-weight: 900;
    color: var(--tesco-blue, #00539f);
}

.lookup-copy {
    color: #445;
}

.lookup-link {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 6px 10px;
    background: var(--tesco-blue, #00539f);
    color: #fff !important;
    font-weight: 900;
    text-decoration: none;
}

.lookup-cache {
    display: grid;
    gap: 2px;
    color: #334;
}

body.dark-mode .store-lookup-fallback {
    background: rgba(0, 113, 206, 0.12);
    border-color: rgba(140, 190, 240, 0.25);
}

body.dark-mode .lookup-copy,
body.dark-mode .lookup-cache {
    color: #d6e4f2;
}


/* ===================================
   FIX104 MAP BOUNDS / NO EMPTY PAN AREA
=================================== */
body.fullscreen-map-open {
    overflow: hidden;
}

.map-fullscreen-viewport,
#mapFullscreenViewport {
    overflow: hidden !important;
    touch-action: none;
    overscroll-behavior: contain;
    background: #0f1720;
}

#mapFullscreenImage {
    will-change: transform;
    max-width: none;
    max-height: none;
    user-select: none;
    -webkit-user-drag: none;
}


/* ===================================
   FIX104 COMPACT HOME / STORE / FILES
=================================== */
.container {
    max-width: 1280px;
}

.brand-header.professional-brand,
.brand-header {
    padding-top: 8px;
    padding-bottom: 8px;
}

.top-strip.pro-top-strip,
.top-strip {
    min-height: 64px;
    padding: 10px 14px;
    overflow: hidden;
}

.pro-header-logo,
.brand-logo,
.top-strip img {
    max-width: min(310px, 52vw);
    max-height: 48px;
    object-fit: contain;
}

.theme-corner {
    flex-shrink: 0;
}

.upload-card {
    padding: 12px 14px !important;
    margin-bottom: 14px !important;
}

.upload-drop {
    min-height: 76px !important;
    padding: 14px 18px !important;
    display: grid !important;
    grid-template-columns: 54px minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 16px !important;
}

.upload-icon {
    width: 50px !important;
    height: 50px !important;
    font-size: 1.65rem !important;
}

.upload-text strong {
    font-size: 1.05rem !important;
    line-height: 1.15;
}

.upload-text span {
    font-size: 0.9rem !important;
    line-height: 1.25;
}

.upload-button {
    padding: 12px 18px !important;
    border-radius: 14px !important;
    white-space: nowrap;
}

.upload-note {
    margin-top: 8px !important;
    font-size: 0.9rem !important;
    line-height: 1.25 !important;
}

.store-header {
    padding: 14px 16px !important;
    margin-bottom: 14px !important;
}

.store-header .section-title,
.section-title {
    font-size: 1.45rem !important;
    margin-bottom: 12px !important;
}

.store-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0 !important;
    border: 1px solid #dbe7f3;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.store-info-block {
    border: 0 !important;
    border-radius: 0 !important;
    min-height: 72px !important;
    padding: 12px 14px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    box-shadow: none !important;
    background: #fff !important;
}

.store-info-block + .store-info-block {
    border-left: 1px solid #dbe7f3 !important;
}

.store-icon {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #00539f, #075fe8) !important;
    color: #fff !important;
    border: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.store-info-block small {
    font-size: 0.78rem !important;
    color: #5b6570;
    font-weight: 800;
}

#storeNumber,
#storeName,
#storeAddress {
    font-size: 1rem !important;
    font-weight: 900 !important;
    line-height: 1.2;
}

.store-lookup-fallback {
    margin-top: 8px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    display: block !important;
}

.store-lookup-fallback .lookup-title,
.store-lookup-fallback .lookup-copy,
.store-lookup-fallback .lookup-cache {
    display: none !important;
}

.store-lookup-fallback .lookup-link {
    background: transparent !important;
    color: var(--tesco-blue, #00539f) !important;
    padding: 6px 0 !important;
    font-weight: 900;
    box-shadow: none !important;
}

.store-lookup-fallback .lookup-link::before {
    content: "🔎 ";
}

.compact-files-card {
    padding: 14px 16px;
    margin: 0 0 14px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(0, 83, 159, 0.14);
    box-shadow: 0 8px 24px rgba(0, 83, 159, 0.055);
}

.compact-files-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
    margin-bottom: 10px;
}

.compact-files-head strong {
    color: var(--tesco-blue, #00539f);
    font-size: 1.2rem;
}

.compact-files-head span {
    color: #5b6570;
    font-weight: 800;
    font-size: 0.88rem;
}

.compact-files-list {
    display: grid;
    gap: 8px;
}

.compact-file-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid #dbe7f3;
    border-radius: 14px;
    background: #fbfdff;
}

.compact-file-icon {
    display: inline-flex;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    align-items: center;
    justify-content: center;
    background: #e60012;
    color: #fff;
    font-weight: 900;
    font-size: 0.7rem;
}

.compact-file-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 900;
}

.compact-file-status {
    color: #138a43;
    background: #e7f7ed;
    border-radius: 999px;
    padding: 5px 9px;
    font-weight: 900;
    font-size: 0.78rem;
}

.compact-file-error .compact-file-status {
    color: #b00020;
    background: #ffe8e8;
}

.compact-file-more {
    color: #536579;
    font-weight: 800;
    padding: 4px 2px;
}

.compact-file-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.compact-status-pill {
    border: 1px solid #dbe7f3;
    border-radius: 999px;
    padding: 5px 9px;
    font-weight: 900;
    font-size: 0.78rem;
    color: #627083;
    background: #f8fbff;
}

.compact-status-pill.good {
    color: #138a43;
    background: #eaf8ef;
    border-color: #b7e5c7;
}

.compact-status-pill.missing {
    color: #718096;
}

.files-list {
    display: none !important;
}

@media (max-width: 760px) {
    .top-strip.pro-top-strip,
    .top-strip {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        gap: 10px !important;
        align-items: center !important;
    }

    .pro-header-logo,
    .brand-logo,
    .top-strip img {
        max-width: 210px !important;
        max-height: 44px !important;
    }

    .theme-corner {
        display: grid !important;
        grid-template-columns: auto auto !important;
        gap: 6px !important;
        padding: 8px !important;
        border-radius: 14px !important;
    }

    .current-user-badge {
        grid-column: 1 / -1;
        text-align: right;
        font-size: 0.78rem;
    }

    .theme-corner label {
        display: none;
    }

    .theme-corner select {
        max-width: 95px;
    }

    .upload-drop {
        grid-template-columns: 46px minmax(0, 1fr) !important;
        gap: 12px !important;
        padding: 12px !important;
    }

    .upload-icon {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.45rem !important;
    }

    .upload-button {
        grid-column: 1 / -1;
        width: 100%;
        padding: 11px !important;
    }

    .store-grid {
        grid-template-columns: 1fr !important;
    }

    .store-info-block {
        min-height: 58px !important;
        padding: 10px 12px !important;
    }

    .store-info-block + .store-info-block {
        border-left: 0 !important;
        border-top: 1px solid #dbe7f3 !important;
    }

    .store-address-block {
        align-items: flex-start !important;
    }

    .compact-file-row {
        grid-template-columns: 36px minmax(0, 1fr);
    }

    .compact-file-status {
        grid-column: 2;
        width: fit-content;
    }

    .compact-files-head {
        display: block;
    }

    .compact-files-head span {
        display: block;
        margin-top: 2px;
    }
}

body.dark-mode .store-grid,
body.dark-mode .store-info-block,
body.dark-mode .compact-files-card,
body.dark-mode .compact-file-row {
    background: #1f1f1f !important;
    border-color: #333 !important;
}

body.dark-mode .compact-files-head span,
body.dark-mode .compact-file-more {
    color: #c7d3df;
}


/* ===================================
   FIX104 ULTRA COMPACT FILES + MOBILE SHRINK
=================================== */

.files-mini-card {
    padding: 10px 12px;
    margin: 0 0 10px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(0, 83, 159, 0.14);
    box-shadow: 0 6px 18px rgba(0,83,159,0.045);
}

.files-mini-top {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.files-mini-top strong {
    color: var(--tesco-blue, #00539f);
    font-size: 1.05rem;
    white-space: nowrap;
}

.files-mini-types,
.files-mini-names {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.files-mini-types {
    justify-content: flex-end;
}

.files-mini-names {
    margin-top: 8px;
}

.mini-type-pill,
.file-name-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    border-radius: 999px;
    padding: 5px 8px;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.1;
    white-space: nowrap;
}

.mini-type-pill.good {
    color: #138a43;
    background: #eaf8ef;
    border: 1px solid #b7e5c7;
}

.mini-type-pill.missing {
    color: #718096;
    background: #f3f6f9;
    border: 1px solid #dbe3eb;
}

.file-name-chip {
    color: #1f2937;
    background: #f8fbff;
    border: 1px solid #dbe7f3;
    max-width: min(290px, 100%);
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-name-chip.more {
    color: var(--tesco-blue, #00539f);
    background: #eaf4ff;
    border-color: #bdd8f5;
}

.file-name-chip.error {
    color: #b00020;
    background: #ffe8e8;
    border-color: #ffc5c5;
}

.compact-files-card {
    display: none !important;
}

@media (max-width: 760px) {
    .upload-card {
        padding: 10px 12px !important;
        margin-bottom: 10px !important;
    }

    .upload-drop {
        min-height: 62px !important;
        padding: 10px !important;
        grid-template-columns: 40px minmax(0, 1fr) !important;
        gap: 10px !important;
    }

    .upload-icon {
        width: 38px !important;
        height: 38px !important;
        font-size: 1.25rem !important;
    }

    .upload-text strong {
        font-size: 0.98rem !important;
    }

    .upload-text span {
        font-size: 0.8rem !important;
    }

    .upload-button {
        padding: 9px 10px !important;
        font-size: 0.92rem !important;
    }

    .upload-note {
        font-size: 0.78rem !important;
        margin-top: 6px !important;
    }

    .store-header {
        padding: 10px 12px !important;
        margin-bottom: 10px !important;
    }

    .store-header .section-title,
    .section-title {
        font-size: 1.25rem !important;
        margin-bottom: 8px !important;
    }

    .store-info-block {
        min-height: 48px !important;
        padding: 8px 10px !important;
        gap: 10px !important;
    }

    .store-icon {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        border-radius: 10px !important;
        font-size: 0.9rem !important;
    }

    .store-info-block small {
        font-size: 0.7rem !important;
    }

    #storeNumber,
    #storeName,
    #storeAddress {
        font-size: 0.92rem !important;
    }

    .store-extra-details {
        margin-top: 4px !important;
    }

    .store-extra-details summary {
        padding: 6px 8px !important;
        font-size: 0.78rem !important;
    }

    .files-mini-card {
        padding: 9px 10px;
        margin-bottom: 10px;
    }

    .files-mini-top {
        align-items: flex-start;
    }

    .files-mini-top strong {
        font-size: 1rem;
    }

    .files-mini-types {
        justify-content: flex-start;
        width: 100%;
    }

    .mini-type-pill,
    .file-name-chip {
        font-size: 0.72rem;
        padding: 4px 7px;
    }

    .files-mini-names {
        gap: 5px;
        margin-top: 6px;
    }
}

body.dark-mode .files-mini-card {
    background: #1f1f1f;
    border-color: #333;
}

body.dark-mode .file-name-chip {
    color: #e6eef7;
    background: #252a30;
    border-color: #374151;
}


/* ===================================
   FIX104 COMPACT MAP / ANALYSIS / MOBILE CARDS
=================================== */

.panel-card {
    padding: 14px 16px !important;
}

.panel-card h2 {
    font-size: 1.55rem !important;
    margin: 0 0 8px !important;
}

.compact-map-status,
#plainLayoutStatus,
#layoutStatus {
    margin: 0 0 10px !important;
    font-size: 0.92rem !important;
    line-height: 1.25 !important;
    color: #536579;
}

.layout-controls {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto auto !important;
    gap: 8px !important;
    align-items: center !important;
    margin: 8px 0 10px !important;
}

.map-select-label {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    gap: 8px !important;
    align-items: center !important;
    min-width: 0;
}

.map-select-label .map-select,
.map-select {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    text-overflow: ellipsis;
}

.layout-controls button {
    padding: 8px 10px !important;
    border-radius: 10px !important;
    font-size: 0.85rem !important;
    white-space: nowrap;
}

#plainLayoutPageInfo,
#layoutPageInfo {
    font-weight: 900;
    color: #1f2937;
    white-space: nowrap;
    font-size: 0.88rem;
}

.layout-filter-title,
.highlight-map-title {
    display: none !important;
}

.highlight-filter-panel {
    margin: 6px 0 10px !important;
}

.highlight-map-buttons,
.compact-overlay-buttons {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
}

.highlight-map-btn {
    padding: 7px 10px !important;
    border-radius: 999px !important;
    font-size: 0.78rem !important;
    line-height: 1 !important;
}

.highlight-grid,
.marker-list {
    display: none !important;
}

.layout-viewer {
    max-height: min(72vh, 780px);
    overflow: auto !important;
    border-radius: 14px !important;
    background: #fff !important;
    overscroll-behavior: contain;
}

.map-surface {
    margin: 0 auto !important;
}

#plainLayoutCanvas,
#layoutCanvas {
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto !important;
}

.compact-group {
    margin: 8px 0 !important;
    border-radius: 13px !important;
}

.compact-group-title {
    padding: 10px 12px !important;
}

.group-title-main {
    font-size: 0.95rem !important;
}

.group-title-meta {
    font-size: 0.72rem !important;
}

.compact-mods-grid {
    padding: 9px !important;
    gap: 8px !important;
}

.compact-mod-card {
    flex-basis: 218px !important;
    width: 218px !important;
    max-width: 218px !important;
    padding: 9px !important;
    border-radius: 12px !important;
}

.compact-mod-card .mod-header {
    font-size: 0.9rem !important;
}

.compact-size,
.compact-mod-meta {
    font-size: 0.72rem !important;
}

.compact-count {
    min-width: 48px !important;
    padding: 5px 6px !important;
}

.compact-count strong {
    font-size: 1.05rem !important;
}

.compact-count span {
    font-size: 0.58rem !important;
}

.shelf-details summary {
    font-size: 0.72rem !important;
}

.height-item {
    min-height: 20px !important;
    padding: 3px 0 !important;
}

.height-value,
.count {
    font-size: 0.78rem !important;
}

.compact-open-btn {
    padding: 7px 8px !important;
    font-size: 0.78rem !important;
    margin-top: 7px !important;
}

@media (max-width: 760px) {
    .panel-card {
        padding: 12px !important;
        border-radius: 16px !important;
    }

    .panel-card h2 {
        font-size: 1.35rem !important;
    }

    .layout-controls {
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 7px !important;
    }

    .map-select-label {
        grid-column: 1 / -1;
    }

    #plainLayoutPageInfo,
    #layoutPageInfo {
        text-align: center;
        font-size: 0.8rem;
    }

    .layout-controls button {
        padding: 8px 9px !important;
        font-size: 0.8rem !important;
    }

    .layout-viewer {
        max-height: 68vh;
    }

    .highlight-map-btn {
        font-size: 0.72rem !important;
        padding: 7px 9px !important;
    }

    .compact-mod-card {
        flex-basis: min(72vw, 245px) !important;
        width: min(72vw, 245px) !important;
        max-width: min(72vw, 245px) !important;
    }
}

body.dark-mode .layout-viewer {
    background: #111 !important;
}


/* ===================================
   FIX104 FULL WIDTH HEADER LOGO / COMPACT USER CONTROLS
=================================== */

.brand-header.professional-brand,
.brand-header {
    max-width: 1280px;
    margin: 0 auto;
    padding: 8px 12px 6px !important;
}

.top-strip.pro-top-strip,
.top-strip {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 12px !important;
    min-height: 68px !important;
    padding: 8px 12px !important;
    overflow: hidden !important;
}

.pro-header-logo-wrap {
    min-width: 0 !important;
    width: 100% !important;
    overflow: hidden !important;
}

.pro-header-logo {
    width: min(620px, 100%) !important;
    max-width: 100% !important;
    max-height: 62px !important;
    height: auto !important;
    object-fit: contain !important;
    object-position: left center !important;
    display: block;
}

.pro-header-logo-text {
    font-size: clamp(1.9rem, 5vw, 3.1rem) !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

.theme-corner {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.current-user-badge {
    color: var(--tesco-blue, #00539f) !important;
    font-weight: 900 !important;
    font-size: 0.85rem !important;
    white-space: nowrap;
}

.logout-btn,
.theme-corner select {
    min-height: 34px !important;
    padding: 7px 11px !important;
    border-radius: 999px !important;
    font-size: 0.82rem !important;
    font-weight: 900 !important;
}

.theme-corner label {
    font-size: 0.78rem !important;
    margin: 0 !important;
    color: var(--tesco-blue, #00539f) !important;
    font-weight: 900 !important;
}

@media (max-width: 760px) {
    .top-strip.pro-top-strip,
    .top-strip {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
        min-height: 0 !important;
        padding: 8px 10px !important;
    }

    .pro-header-logo-wrap {
        width: 100% !important;
    }

    .pro-header-logo {
        width: 100% !important;
        max-height: 58px !important;
        object-fit: contain !important;
        object-position: left center !important;
    }

    .pro-header-logo-text {
        font-size: clamp(2rem, 10vw, 3rem) !important;
        width: 100%;
    }

    .theme-corner {
        width: 100% !important;
        display: flex !important;
        justify-content: flex-start !important;
        gap: 6px !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }

    .current-user-badge {
        font-size: 0.74rem !important;
        margin-right: auto;
        text-align: left !important;
    }

    .theme-corner label {
        display: none !important;
    }

    .logout-btn,
    .theme-corner select {
        min-height: 30px !important;
        padding: 5px 9px !important;
        font-size: 0.74rem !important;
    }
}


/* ===================================
   FIX104 SOFT RED / BLUE APP STYLE
   Restores the warmer Planogram Pro look while keeping compact FIX104 layout.
=================================== */

:root {
    --pp-blue: #00539f;
    --pp-blue-2: #0071ce;
    --pp-red: #e60012;
    --pp-bg: #f5f8fc;
    --pp-card: rgba(255,255,255,0.94);
    --pp-border: rgba(0,83,159,0.12);
    --pp-shadow: 0 14px 36px rgba(0,83,159,0.08);
}

body {
    background:
        radial-gradient(circle at 0% 0%, rgba(0,83,159,0.14), transparent 34rem),
        radial-gradient(circle at 100% 4%, rgba(230,0,18,0.09), transparent 28rem),
        linear-gradient(180deg, #f7faff 0%, #f3f6fa 42%, #f7f8fb 100%) !important;
    color: #102033;
}

.container {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.32), rgba(255,255,255,0)) !important;
}

.brand-header.professional-brand,
.brand-header {
    background:
        linear-gradient(90deg, rgba(0,83,159,0.08), rgba(230,0,18,0.045)),
        rgba(255,255,255,0.32) !important;
    border-radius: 0 0 26px 26px;
}

.top-strip.pro-top-strip,
.top-strip {
    background: rgba(255,255,255,0.82) !important;
    border: 1px solid rgba(0,83,159,0.13) !important;
    box-shadow: 0 16px 40px rgba(0,83,159,0.11) !important;
    backdrop-filter: blur(16px);
}

.upload-card,
.store-header,
.files-mini-card,
.panel-card,
.compact-group,
.mod-card,
.compact-mod-card,
.stats-panel,
.stat-card,
.content-card,
.app-footer,
footer {
    background: var(--pp-card) !important;
    border-color: var(--pp-border) !important;
    box-shadow: var(--pp-shadow) !important;
    backdrop-filter: blur(12px);
}

.upload-card {
    border-top: 4px solid var(--pp-red) !important;
}

.upload-drop {
    background:
        linear-gradient(135deg, rgba(0,83,159,0.065), rgba(230,0,18,0.035)),
        #fff !important;
    border: 1px dashed rgba(0,83,159,0.28) !important;
}

.upload-drop:hover {
    border-color: var(--pp-red) !important;
    box-shadow: 0 12px 28px rgba(230,0,18,0.08);
}

.upload-icon {
    background: linear-gradient(135deg, var(--pp-blue), var(--pp-blue-2)) !important;
    color: #fff !important;
}

.upload-button,
button:not(.tab-btn):not(.zone-chip):not(.highlight-map-btn):not(.logout-btn) {
    background: linear-gradient(135deg, var(--pp-blue), var(--pp-blue-2)) !important;
    color: #fff !important;
    border: 0 !important;
    box-shadow: 0 8px 18px rgba(0,83,159,0.16);
}

.logout-btn {
    background: #fff !important;
    color: var(--pp-red) !important;
    border: 1px solid rgba(230,0,18,0.22) !important;
}

.logout-btn:hover {
    background: rgba(230,0,18,0.07) !important;
}

.store-header {
    border-left: 5px solid var(--pp-blue) !important;
}

.store-grid {
    border-color: rgba(0,83,159,0.13) !important;
}

.store-info-block {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,251,255,0.95)) !important;
}

.store-info-block:nth-child(1) .store-icon {
    background: linear-gradient(135deg, var(--pp-blue), var(--pp-blue-2)) !important;
}

.store-info-block:nth-child(2) .store-icon {
    background: linear-gradient(135deg, #163b63, var(--pp-blue)) !important;
}

.store-info-block:nth-child(3) .store-icon {
    background: linear-gradient(135deg, var(--pp-red), #ff5a64) !important;
}

.files-mini-card {
    border-left: 5px solid var(--pp-red) !important;
}

.files-mini-top strong,
.section-title,
.panel-card h2,
.compact-files-head strong {
    color: var(--pp-blue) !important;
}

.file-name-chip {
    background: rgba(0,83,159,0.06) !important;
    border-color: rgba(0,83,159,0.16) !important;
}

.file-name-chip.more {
    background: rgba(230,0,18,0.07) !important;
    color: var(--pp-red) !important;
    border-color: rgba(230,0,18,0.18) !important;
}

.tabs {
    background: rgba(255,255,255,0.72) !important;
    border: 1px solid rgba(0,83,159,0.12) !important;
    box-shadow: 0 10px 26px rgba(0,83,159,0.07);
    backdrop-filter: blur(12px);
}

.tab-btn {
    background: transparent !important;
    color: var(--pp-blue) !important;
    border: 1px solid transparent !important;
    font-weight: 900 !important;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--pp-blue), var(--pp-blue-2)) !important;
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(0,83,159,0.18);
}

.tab-btn:hover:not(.active) {
    background: rgba(0,83,159,0.08) !important;
    border-color: rgba(0,83,159,0.12) !important;
}

.zone-chip-bar {
    background: linear-gradient(135deg, rgba(0,83,159,0.08), rgba(230,0,18,0.04)) !important;
    border-color: rgba(0,83,159,0.16) !important;
}

.zone-chip {
    background: #fff !important;
    border-color: rgba(0,83,159,0.18) !important;
}

.zone-chip.active {
    background: linear-gradient(135deg, var(--pp-red), #ff4450) !important;
    color: #fff !important;
    box-shadow: 0 10px 22px rgba(230,0,18,0.16);
}

.compact-group-title {
    background: linear-gradient(135deg, var(--pp-blue), #006cc4) !important;
}

.compact-group:nth-of-type(2n) .compact-group-title {
    background: linear-gradient(135deg, #003f78, var(--pp-blue)) !important;
}

.compact-mod-card {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(249,252,255,0.96)) !important;
}

.compact-mod-card:hover {
    border-color: rgba(230,0,18,0.24) !important;
    box-shadow: 0 10px 24px rgba(230,0,18,0.06) !important;
}

.compact-count {
    background: rgba(0,83,159,0.09) !important;
    color: var(--pp-blue) !important;
}

.layout-viewer,
.rams-viewer {
    background:
        radial-gradient(circle at top left, rgba(0,83,159,0.05), transparent 26rem),
        #ffffff !important;
    border: 1px solid rgba(0,83,159,0.14) !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.55), 0 12px 28px rgba(0,83,159,0.06);
}

.highlight-map-btn {
    background: #fff !important;
    color: var(--pp-blue) !important;
    border: 1px solid rgba(0,83,159,0.18) !important;
}

.highlight-map-btn.active {
    background: linear-gradient(135deg, var(--pp-red), #ff4652) !important;
    color: #fff !important;
    border-color: transparent !important;
}

.stat-card,
.highlight-card {
    background:
        linear-gradient(180deg, #fff, rgba(247,251,255,0.96)) !important;
    border: 1px solid rgba(0,83,159,0.11) !important;
}

.stat-card:nth-child(4n+1) {
    border-top: 4px solid var(--pp-blue) !important;
}

.stat-card:nth-child(4n+2) {
    border-top: 4px solid var(--pp-red) !important;
}

.stat-card:nth-child(4n+3) {
    border-top: 4px solid #138a43 !important;
}

.stat-card:nth-child(4n+4) {
    border-top: 4px solid #f59e0b !important;
}

.badge-zpanel,
.badge-capping,
.badge-drawer,
.badge-graphic,
.badge-bread-tray {
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.45);
}

.app-footer,
footer {
    background:
        linear-gradient(135deg, rgba(0,83,159,0.08), rgba(230,0,18,0.05)),
        rgba(255,255,255,0.9) !important;
}

body.dark-mode {
    background:
        radial-gradient(circle at 0% 0%, rgba(0,113,206,0.18), transparent 34rem),
        radial-gradient(circle at 100% 4%, rgba(230,0,18,0.12), transparent 28rem),
        #111827 !important;
}

body.dark-mode .top-strip.pro-top-strip,
body.dark-mode .top-strip,
body.dark-mode .upload-card,
body.dark-mode .store-header,
body.dark-mode .files-mini-card,
body.dark-mode .panel-card,
body.dark-mode .compact-group,
body.dark-mode .mod-card,
body.dark-mode .compact-mod-card,
body.dark-mode .stat-card,
body.dark-mode footer {
    background: rgba(31,41,55,0.92) !important;
    border-color: rgba(148,163,184,0.22) !important;
}

body.dark-mode .store-info-block,
body.dark-mode .compact-mod-card,
body.dark-mode .stat-card {
    background: linear-gradient(180deg, rgba(31,41,55,0.98), rgba(17,24,39,0.96)) !important;
}

body.dark-mode .tabs,
body.dark-mode .zone-chip-bar {
    background: rgba(17,24,39,0.72) !important;
}

body.dark-mode .zone-chip,
body.dark-mode .highlight-map-btn,
body.dark-mode .logout-btn {
    background: rgba(31,41,55,0.95) !important;
    color: #dbeafe !important;
}

body.dark-mode .file-name-chip {
    background: rgba(0,113,206,0.15) !important;
    color: #e5eef8 !important;
}

@media (max-width: 760px) {
    body {
        background:
            radial-gradient(circle at -10% 0%, rgba(0,83,159,0.16), transparent 22rem),
            radial-gradient(circle at 110% 0%, rgba(230,0,18,0.10), transparent 20rem),
            #f5f8fc !important;
    }

    .brand-header.professional-brand,
    .brand-header {
        border-radius: 0 0 20px 20px;
    }

    .tabs {
        margin-top: 8px;
    }
}


/* ===================================
   FIX104 COMPACT LOGIN SCREEN
=================================== */

.login-screen {
    background:
        radial-gradient(circle at 0% 0%, rgba(0,83,159,0.16), transparent 28rem),
        radial-gradient(circle at 100% 0%, rgba(230,0,18,0.10), transparent 24rem),
        linear-gradient(180deg, #f7faff, #edf5ff) !important;
}

.login-card.compact-login-card,
.login-card {
    max-width: 430px !important;
    padding: 28px 24px !important;
    border-radius: 26px !important;
    background: rgba(255,255,255,0.94) !important;
    border: 1px solid rgba(0,83,159,0.13) !important;
    box-shadow: 0 22px 58px rgba(0,83,159,0.15) !important;
    backdrop-filter: blur(14px);
}

.login-logo {
    display: block !important;
    width: min(330px, 84%) !important;
    max-height: 86px !important;
    object-fit: contain !important;
    margin: 0 auto 14px !important;
}

.login-logo-text,
.login-card h1 {
    display: none !important;
}

.login-subtitle,
.login-card > p {
    margin: 0 0 18px !important;
    text-align: center !important;
    font-size: 1rem !important;
    color: #5b6570 !important;
}

.login-form {
    display: grid;
    gap: 10px;
}

.login-form label {
    font-size: 0.82rem !important;
    color: #06103a !important;
    font-weight: 900 !important;
    margin: 0 !important;
}

.login-form input,
.login-form select {
    width: 100% !important;
    min-height: 48px !important;
    border-radius: 14px !important;
    border: 1px solid #cfd8e3 !important;
    padding: 10px 14px !important;
    font-size: 1rem !important;
    background: #fff !important;
}

.login-form input:focus {
    border-color: #00539f !important;
    box-shadow: 0 0 0 3px rgba(0,83,159,0.13) !important;
    outline: none !important;
}

.login-form button {
    margin-top: 8px !important;
    min-height: 50px !important;
    border-radius: 15px !important;
}

.login-note {
    margin-top: 18px !important;
    font-size: 0.82rem !important;
    color: #7b8794 !important;
}

.login-error {
    min-height: 18px;
    color: #b00020 !important;
    font-weight: 900 !important;
    text-align: center;
}

@media (max-width: 760px) {
    .login-card.compact-login-card,
    .login-card {
        width: min(88vw, 430px) !important;
        padding: 24px 20px !important;
    }

    .login-logo {
        width: min(300px, 88%) !important;
        max-height: 76px !important;
    }
}


/* ===================================
   FIX104 ROBUST LOGIN VISIBILITY
=================================== */
#loginScreen[hidden] {
    display: none !important;
}

#appShell.auth-locked {
    display: none !important;
}

#loginError:not(:empty) {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(230,0,18,0.08);
    border: 1px solid rgba(230,0,18,0.18);
}


/* FIX108: full-width branded bars and safer mobile logo sizing */
.brand-header.professional-brand,
.brand-header {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.top-strip.pro-top-strip {
    width: 100% !important;
    border-radius: 0 !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    box-sizing: border-box !important;
}
.pro-header-logo-wrap {
    flex: 1 1 auto !important;
    overflow: hidden !important;
}
.pro-header-logo {
    width: min(360px, 64vw) !important;
    max-width: 100% !important;
    object-fit: contain !important;
}
.pro-header-logo-text {
    display: none !important;
}
.app-footer {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}
.footer-logo {
    max-width: min(360px, 72vw) !important;
    object-fit: contain !important;
}
@media (max-width: 700px) {
    .top-strip.pro-top-strip {
        gap: 8px !important;
    }
    .pro-header-logo {
        width: min(315px, 62vw) !important;
        max-height: 50px !important;
    }
}



/* =========================
   FIX108 BRAND + MOBILE FINAL PASS
========================= */
:root {
    --pp-blue: #00539f;
    --pp-navy: #06103a;
    --pp-red: #e30613;
}
body {
    background:
        radial-gradient(circle at 0 0, rgba(0,83,159,.10), transparent 30%),
        radial-gradient(circle at 100% 12%, rgba(227,6,19,.08), transparent 28%),
        #f3f7fc !important;
}
.brand-header.professional-brand,
.brand-header {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    border-radius: 0 !important;
    background: linear-gradient(90deg, #ffffff 0%, #f8fbff 62%, #fff3f4 100%) !important;
    border-bottom: 4px solid var(--pp-red) !important;
    box-shadow: 0 6px 24px rgba(6,16,58,.10) !important;
    overflow: hidden !important;
}
.pro-top-strip,
.top-strip {
    width: 100% !important;
    max-width: 1160px !important;
    margin: 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
}
.pro-header-logo-wrap {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
}
.pro-header-logo {
    display: block !important;
    width: min(560px, 100%) !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 76px !important;
    object-fit: contain !important;
    object-position: left center !important;
}
.pro-header-logo-text { display: none !important; }
.theme-corner {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}
.current-user-badge::before { content: ""; }
.current-user-badge { color: var(--pp-blue) !important; font-size: 14px !important; }
.container {
    width: min(1160px, 100%) !important;
    max-width: 1160px !important;
    margin: 0 auto !important;
    padding: 14px 10px 10px !important;
}
.app-footer {
    width: 100% !important;
    max-width: none !important;
    margin: 14px 0 0 !important;
    padding: 18px 10px 22px !important;
    border-radius: 0 !important;
    background: linear-gradient(90deg, #06103a, #0a2f66) !important;
    color: white !important;
    text-align: center !important;
    border-top: 4px solid var(--pp-red) !important;
}
.footer-logo {
    display: block !important;
    width: min(360px, 84vw) !important;
    height: auto !important;
    max-height: 60px !important;
    object-fit: contain !important;
    margin: 0 auto 8px !important;
    background: white !important;
    border-radius: 14px !important;
    padding: 6px 10px !important;
}
.footer-logo-text { display: none !important; }
.footer-copy { color: rgba(255,255,255,.84) !important; font-weight: 800 !important; }
.login-card.compact-login-card {
    width: min(440px, calc(100vw - 28px)) !important;
    padding: 22px !important;
}
.login-logo {
    width: min(340px, 92%) !important;
    max-height: 210px !important;
    object-fit: contain !important;
}
.files-mini-names {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
}
.file-name-chip { max-width: min(520px, 86vw) !important; }
.highlight-map-buttons.compact-overlay-buttons {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 7px !important;
    margin: 8px 0 10px !important;
}
.highlight-map-btn {
    min-height: 36px !important;
    border-radius: 999px !important;
    padding: 7px 12px !important;
    font-weight: 900 !important;
}
.layout-viewer {
    overflow: hidden !important;
    touch-action: manipulation !important;
}
.map-surface { margin: 0 auto !important; }
.layout-overlay .marker,
.layout-marker,
.highlight-marker {
    filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 3px #fff) !important;
}
body.dark-mode .brand-header.professional-brand,
body.dark-mode .brand-header {
    background: linear-gradient(90deg, #111827, #0b1736) !important;
    border-bottom-color: var(--pp-red) !important;
}
body.dark-mode .current-user-badge { color: #7cc4ff !important; }
@media (max-width: 640px) {
    .brand-header.professional-brand,
    .brand-header { padding: 8px 8px !important; }
    .pro-top-strip,
    .top-strip {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
    }
    .pro-header-logo { width: 100% !important; max-height: 64px !important; object-position: left center !important; }
    .theme-corner { justify-content: flex-start !important; flex-wrap: wrap !important; }
    .current-user-badge { width: 100% !important; text-align: left !important; }
    .upload-card, .store-header, .files-mini-card, .panel-card { margin-left: 0 !important; margin-right: 0 !important; }
    .layout-controls { grid-template-columns: 1fr 1fr 1fr !important; gap: 8px !important; }
    .map-select-label { grid-column: 1 / -1 !important; }
    .tabs { position: sticky; top: 0; z-index: 5; }
}

/* FIX112: map dropdown removed from Layout/Analysis; pagers are JS-hidden on single-page maps. */
#layoutTab .map-select-label, #analysisTab .map-select-label { display: none !important; }


/* ===================================
   FIX112: FULL-PAGE-WIDTH HEADER BRAND IMAGE
   Use the wide Planogram Pro logo as the full header image.
   Prevent duplicate text/logo rendering and avoid mobile cropping.
=================================== */
.brand-header.professional-brand {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.top-strip.pro-top-strip {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    padding: clamp(8px, 2vw, 14px) clamp(12px, 4vw, 34px) !important;
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    align-items: center !important;
    gap: 12px !important;
    background: rgba(255,255,255,0.96) !important;
    box-shadow: 0 8px 28px rgba(6,16,58,0.10) !important;
}

.pro-header-logo-wrap {
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

.pro-header-logo {
    display: block !important;
    width: 100% !important;
    max-width: min(980px, 100%) !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: left center !important;
    filter: drop-shadow(0 6px 14px rgba(6, 16, 58, 0.10)) !important;
}

.pro-header-logo-text {
    display: none !important;
}

.theme-corner {
    justify-self: end !important;
    white-space: nowrap !important;
}

@media (max-width: 700px) {
    .top-strip.pro-top-strip {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding: 10px 12px !important;
    }
    .pro-header-logo {
        width: 100% !important;
        max-width: 100% !important;
    }
    .theme-corner {
        justify-self: start !important;
        width: auto !important;
        padding: 4px 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }
}

/* FIX112: compact Store Details + Files row */
.store-files-row {
    display: grid !important;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) !important;
    gap: 10px !important;
    align-items: stretch !important;
    margin: 10px 0 12px !important;
}
.store-files-row .store-header,
.store-files-row .files-panel {
    margin: 0 !important;
    min-width: 0 !important;
}
.store-files-row .section-title {
    font-size: 12px !important;
    margin-bottom: 7px !important;
}
.compact-store-card .store-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 6px !important;
}
.compact-store-card .store-info-block {
    padding: 7px 8px !important;
    gap: 6px !important;
    min-height: 0 !important;
}
.compact-store-card .store-icon {
    width: 24px !important;
    height: 24px !important;
    font-size: 12px !important;
}
.compact-store-card small {
    font-size: 9px !important;
}
.compact-store-card #storeNumber,
.compact-store-card #storeName,
.compact-store-card #storeAddress {
    font-size: 12px !important;
    line-height: 1.15 !important;
}
.compact-store-card .store-address-block {
    display: none !important;
}
.compact-files-sidecard .files-list,
.compact-files-sidecard .files-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
}
.compact-files-sidecard .file-name-chip,
.compact-files-sidecard .file-chip,
.compact-files-sidecard .badge {
    font-size: 10px !important;
    padding: 4px 7px !important;
    border-radius: 999px !important;
}
@media (max-width: 359px) {
    .store-files-row { grid-template-columns: 1fr !important; }
    .compact-store-card .store-address-block { display: flex !important; }
}

/* FIX112: grouped map filters and high-contrast marker legend */
.highlight-filter-groups {
    display: grid !important;
    gap: 9px !important;
}
.highlight-filter-group {
    border: 1px solid var(--border) !important;
    border-radius: 14px !important;
    padding: 8px !important;
    background: rgba(255,255,255,0.74) !important;
}
body.dark-mode .highlight-filter-group {
    background: rgba(15,23,42,0.74) !important;
}
.map-marker-legend {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    color: var(--muted) !important;
}
.map-marker-legend span {
    border: 1px solid var(--border) !important;
    border-radius: 999px !important;
    padding: 4px 7px !important;
    background: var(--card) !important;
}
.map-marker-legend b {
    color: var(--tesco-blue) !important;
}


/* FIX113: marker coverage + compact test UI */
.highlight-map-btn .filter-count {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 20px !important;
    height: 20px !important;
    margin-left: 5px !important;
    padding: 0 5px !important;
    border-radius: 999px !important;
    background: rgba(6, 16, 58, 0.10) !important;
    color: inherit !important;
    font-size: 0.78em !important;
}
.highlight-map-btn.active .filter-count {
    background: rgba(255,255,255,.25) !important;
}
.current-user-badge::before { content: "" !important; }
.files-mini-names {
    max-height: 82px !important;
    overflow-y: auto !important;
}
.compact-files-sidecard .file-name-chip {
    max-width: 100% !important;
}
@media (max-width: 640px) {
    .highlight-filter-group {
        padding: 6px !important;
    }
    .highlight-map-buttons.compact-overlay-buttons {
        gap: 5px !important;
    }
    .highlight-map-btn {
        min-height: 32px !important;
        padding: 6px 9px !important;
        font-size: 12px !important;
    }
    .map-marker-legend span {
        padding: 3px 5px !important;
    }
}

/* ===================================
   FIX114: Tesco-soft background, final header polish, compact filters
=================================== */
:root {
    --pp-navy: #06103a;
    --pp-blue: #00539f;
    --pp-sky: #eaf5ff;
    --pp-soft-blue: #f3f9ff;
    --pp-red: #e30613;
    --pp-red-soft: rgba(227, 6, 19, 0.12);
}

html, body {
    min-height: 100% !important;
    background:
        radial-gradient(circle at 0% 6%, rgba(0, 83, 159, 0.16), transparent 34%),
        radial-gradient(circle at 100% 12%, rgba(227, 6, 19, 0.10), transparent 28%),
        linear-gradient(180deg, #f4f9ff 0%, #ffffff 42%, #f8fbff 100%) !important;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(0,83,159,.055) 1px, transparent 1px),
        linear-gradient(180deg, rgba(0,83,159,.045) 1px, transparent 1px);
    background-size: 38px 38px;
    opacity: .34;
    z-index: -1;
}

body.dark-mode {
    background:
        radial-gradient(circle at 0% 6%, rgba(0, 134, 214, 0.20), transparent 34%),
        radial-gradient(circle at 100% 12%, rgba(227, 6, 19, 0.15), transparent 30%),
        linear-gradient(180deg, #081120 0%, #111827 62%, #0b1220 100%) !important;
}

.brand-header.professional-brand {
    background: linear-gradient(90deg, var(--pp-navy), #0b4f96 58%, var(--pp-red)) !important;
    border-bottom: 5px solid var(--pp-red) !important;
    box-shadow: 0 10px 28px rgba(6,16,58,.18) !important;
}

.top-strip.pro-top-strip {
    min-height: 84px !important;
    background:
        linear-gradient(90deg, rgba(255,255,255,.98) 0%, rgba(255,255,255,.96) 60%, rgba(245,249,255,.92) 100%) !important;
}

.pro-header-logo-wrap {
    display: flex !important;
    align-items: center !important;
    min-height: 52px !important;
}

.pro-header-logo {
    max-height: 76px !important;
    object-fit: contain !important;
    object-position: left center !important;
}

.current-user-badge {
    color: var(--pp-blue) !important;
    font-weight: 900 !important;
}
.current-user-badge::before { content: none !important; }

.upload-card,
.store-header,
.files-panel,
.panel,
.stats-card,
.tab-card,
.analysis-panel,
.layout-panel {
    background:
        linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.90)) !important;
    border: 1px solid rgba(0,83,159,.14) !important;
    box-shadow: 0 12px 30px rgba(0,83,159,.08) !important;
}

.upload-card::before,
.store-header::before,
.files-panel::before,
.panel::before {
    background: linear-gradient(90deg, var(--pp-red), var(--pp-blue)) !important;
}

.store-files-row {
    grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr) !important;
}

.compact-files-sidecard .status-chips,
.compact-files-sidecard .file-type-chips {
    gap: 4px !important;
}

.compact-files-sidecard .file-name-chip {
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.highlight-filter-groups {
    gap: 7px !important;
}

.highlight-filter-group {
    padding: 0 !important;
    overflow: hidden !important;
    background: rgba(255,255,255,.82) !important;
}

.highlight-filter-group > summary.highlight-map-title {
    list-style: none !important;
    cursor: pointer !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 7px 9px !important;
    color: var(--pp-blue) !important;
    font-weight: 900 !important;
}
.highlight-filter-group > summary.highlight-map-title::-webkit-details-marker { display: none !important; }
.highlight-filter-group > summary.highlight-map-title::after {
    content: "⌄";
    font-weight: 900;
    color: var(--pp-red);
}
.highlight-filter-group:not([open]) > summary.highlight-map-title::after { content: "›"; }
.highlight-filter-group > summary.highlight-map-title span {
    background: rgba(0,83,159,.10) !important;
    border-radius: 999px !important;
    padding: 2px 7px !important;
    color: var(--pp-navy) !important;
}

.highlight-filter-group .highlight-map-buttons {
    padding: 0 7px 8px !important;
}

.compact-marker-legend {
    padding: 5px 0 0 !important;
    gap: 5px !important;
}
.compact-marker-legend span {
    width: auto !important;
    min-width: 34px !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 4px 6px !important;
    border: 2px solid rgba(6,16,58,.12) !important;
}
.compact-marker-legend span:nth-child(1) { background: #fff36b !important; }
.compact-marker-legend span:nth-child(2) { background: #55f0ff !important; }
.compact-marker-legend span:nth-child(3) { background: #ff5cff !important; }
.compact-marker-legend span:nth-child(4) { background: #ffb13b !important; }
.compact-marker-legend span:nth-child(5) { background: #9cff4d !important; }
.compact-marker-legend span:nth-child(6) { background: #ff3b4f !important; color: #fff !important; }
.compact-marker-legend span:nth-child(6) b { color: #fff !important; }

.tabs {
    background: rgba(255,255,255,.90) !important;
    border: 1px solid rgba(0,83,159,.16) !important;
    box-shadow: 0 8px 22px rgba(0,83,159,.08) !important;
}
.tabs button.active {
    background: linear-gradient(135deg, var(--pp-blue), #0088d8) !important;
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(0,83,159,.25) !important;
}

.footer {
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    border-radius: 0 !important;
    background: linear-gradient(90deg, var(--pp-navy), #073f7f 60%, var(--pp-red)) !important;
    color: #fff !important;
    border-top: 4px solid var(--pp-red) !important;
}
.footer * { color: inherit !important; }

@media (max-width: 700px) {
    .top-strip.pro-top-strip {
        min-height: 0 !important;
        padding: 8px 10px 10px !important;
    }
    .pro-header-logo-wrap { min-height: 42px !important; }
    .pro-header-logo { max-height: 58px !important; }
    .theme-corner {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        align-items: center !important;
    }
    .store-files-row {
        grid-template-columns: minmax(0, .70fr) minmax(0, 1.30fr) !important;
        gap: 8px !important;
    }
    .compact-store-card .section-title,
    .compact-files-sidecard .section-title { font-size: 11px !important; }
    .compact-files-sidecard .file-name-chip { font-size: 9px !important; }
    .highlight-filter-group > summary.highlight-map-title { padding: 6px 8px !important; font-size: 12px !important; }
}

@media (max-width: 420px) {
    .pro-header-logo { max-height: 52px !important; }
    .theme-corner select,
    .theme-corner button { min-height: 32px !important; padding: 5px 9px !important; }
}
