:root {
    --footer-height: 64px;
    --sheet-title-bar-height: 48px;
    --sheet-header-height-offset: 0px;
    --navigation-height: 48px;
    --header-height: 80px;
    --mobile-scale: 1; /* JS sets <1 on mobile to fit table to 100vw */
    --mobile-nav-top: 0px;

    /* Core Palette */
    --chrome-900: #2a2a2a;
    --chrome-800: #3a3a3a;
    --chrome-700: #4b4b4b;
    --surface-000: #ffffff;
    --surface-100: #f3f3f3;
    --surface-200: #dddddd;
    --surface-300: #c5c5c5;
    --surface-400: #ebebeb;
    --surface-500: #d3d3d3;
    --accent-500: #ad2326;
    --accent-600: #86191c;
    --border-500: #4a4a4a;
    --border-300: #b8b8b8;
    --text-900: #171717;
    --text-700: #545454;
    --text-100: #f2f2f2;
    --text-300: #d5d5d5;
    --panel-shadow: rgba(0,0,0,0.16);

    /* Background Colors */
    --site-header-bg: var(--chrome-800);
    --nav-bg: var(--chrome-900);
    --nav-button-bg: var(--accent-500);
    --nav-button-hover-bg: var(--accent-600);
    --nav-toggle-btn-bg: var(--chrome-700);
    --sheet-title-bg: var(--surface-200);
    --sheet-header-bg: var(--surface-300);
    --sub-header-bg: var(--surface-400);
    --cell-bg: var(--surface-000);
    --loader-overlay-bg: rgba(0,0,0,0.4);
    --footer-bg: var(--chrome-900);
    --modal-backdrop-bg: rgba(0,0,0,0.5);
    --modal-bg: var(--surface-100);
    --prm-bg: var(--surface-400);

    /* Border Coloring */
    --nav-border: #151515;
    --cell-border: var(--border-500);
    --separator-color: var(--border-500);
    --sheet-header-border: #777777;
    --loader: var(--accent-500);

    /* Font Colors */
    --site-header-color: #d43a3d;
    --nav-color: var(--text-100);
    --sheet-title-color: #b4282b;
    --sheet-header-color: var(--text-900);
    --sub-header-color: #972023;
    --footer-color: var(--text-300);
    --footer-link-color: #b4282b;
    --modal-color: var(--text-900);
    --prm-text: #00B050;
    --icon-btn-bg: var(--surface-200);
    --icon-btn-bg-hover: var(--surface-500);
    --icon-btn-border: var(--border-500);
    --icon-btn-color: var(--text-900);
    --icon-line-color: var(--text-900);
}
html { font-size: 14px; }
html, body {
    margin: 0;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: scroll;
    overflow-y: scroll;
    width: fit-content;
}
/* Hide scrollbars across common browsers without disabling scroll */
html, body {
    -ms-overflow-style: none; /* IE/Edge (legacy) */
    scrollbar-width: none;    /* Firefox */
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 0;
    height: 0;
}
.body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

/* ### Header & Title Bar ### */
.header-wrapper {
    position: sticky;
    top: 0;
    left: 0;
    width: 100vw;
    z-index: 6;
    box-sizing: border-box;
}
.header {
    background-color: var(--site-header-bg);
    padding: 10px;
    justify-content: flex-start;
    align-items: center;
    display: flex;
    position: relative;
     /* thin black stroke to help visually separate header from content and add contrast for header text */
}
.print-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    width: 30px;
    border-radius: 5px;
    border: 2px solid var(--icon-btn-border);
    background: var(--icon-btn-bg);
    color: var(--icon-btn-color);
    cursor: pointer;
}
.print-btn:hover,
.print-btn:focus-visible {
    background: var(--icon-btn-bg-hover);
}

.header-title {
    font-family: "UT-Nickel", "Russo One", sans-serif;
    padding-left: 10px;
    font-size: 4rem;
    color: var(--site-header-color);
    -webkit-text-stroke: #000 0.01px;
    text-shadow: 1px 1px 2px black;
    margin: 0px;
}
.header-title-link {
    color: inherit;
    text-decoration: none;
    text-shadow: inherit;
    -webkit-text-stroke-width: inherit;
    -webkit-text-stroke-color: inherit;
}
.header-title-link:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}
.header-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.site-search-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    width: 30px;
    border-radius: 5px;
    border: 2px solid var(--icon-btn-border);
    background: var(--icon-btn-bg);
    color: var(--icon-btn-color);
    text-decoration: none;
    cursor: pointer;
}
.site-search-link:hover,
.site-search-link:focus-visible {
    background: var(--icon-btn-bg-hover);
}
.site-search-link svg,
.print-btn svg {
    width: 24px;
    height: 24px;
}

/* Mobile View Dropdown Menu */
.nav-wrapper-mobile {
    font-family: "Roboto", sans-serif;
    display: none;
    flex-direction: column;
    position: sticky;
    top: var(--mobile-nav-top);
    left: 0;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    background: var(--nav-bg);
    border-top: 0;
    border-bottom: 2px solid var(--nav-border);
    box-shadow: 0 10px 24px rgba(0,0,0,0.2);
    z-index: 5;
}

.drop-down-toggle {
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--nav-button-bg);
    border: none;
    border-top: 1px solid var(--nav-border);
    box-sizing: border-box;
    color: var(--nav-color);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 6px 16px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.drop-down-toggle:hover,
.drop-down-toggle:focus-visible,
.nav-wrapper-mobile.is-open .drop-down-toggle {
    background: var(--nav-button-hover-bg);
}

.drop-down-toggle.is-force-base,
.drop-down-toggle.is-force-base:hover,
.drop-down-toggle.is-force-base:focus-visible {
    background: var(--nav-button-bg);
}

.drop-down-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -2px;
}

.drop-down-toggle .nav-label {
    flex: 1 1 auto;
    min-width: 0;
}

.drop-down-toggle .nav-label-chevron {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    transform: rotate(-90deg);
    transform-origin: center center;
    transition: transform 0.22s ease;
}

.nav-wrapper-mobile.is-open .drop-down-toggle .nav-label-chevron {
    transform: rotate(0deg);
}

body.inventory-search-results-view #inventory-search-link {
    display: none;
}

body.inventory-search-results-view .navigation .buttons > button[data-url] {
    display: none;
}

body.inventory-search-results-view .navigation .filtered-results-back-button:not([hidden]) {
    display: inline-block;
}

body.inventory-search-results-view .nav-wrapper-mobile.is-back-link-mode .drop-down-toggle {
    background: var(--nav-button-bg);
}

body.inventory-search-results-view .nav-wrapper-mobile.is-back-link-mode .drop-down-toggle:hover,
body.inventory-search-results-view .nav-wrapper-mobile.is-back-link-mode .drop-down-toggle:focus-visible {
    background: var(--nav-button-hover-bg);
}

body.inventory-search-results-view .nav-wrapper-mobile.is-back-link-mode .drop-down-toggle .nav-label-chevron {
    transform: rotate(-90deg);
    transition: none;
}

body.inventory-search-results-view .nav-wrapper-mobile.is-back-link-mode .drop-down-menu {
    display: none;
}

.drop-down-menu {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform-origin: top center;
    transition:
        max-height 0.34s cubic-bezier(0.22, 1, 0.36, 1) 0.2s,
        opacity 0.18s ease 0.2s,
        visibility 0s linear 0.54s;
}

.nav-wrapper-mobile.is-open .drop-down-menu {
    max-height: 420px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
        max-height 0.34s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.2s ease,
        visibility 0s linear 0s;
}

.drop-down-menu .menu-item {
    display: block;
    box-sizing: border-box;
    padding: 11px 16px;
    color: var(--nav-color);
    text-decoration: none;
    font-size: 1rem;
    border-top: 1px solid var(--nav-border);
    width: 100%;
    text-align: left;
    background: var(--nav-bg);
    opacity: 0;
    transform: translateY(-8px);
    transition:
        opacity 0.18s ease 0.2s,
        transform 0.22s ease 0.2s,
        background-color 0.16s ease,
        filter 0.16s ease;
}

.nav-wrapper-mobile.is-open .drop-down-menu .menu-item {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0s, 0s, 0s, 0s;
}

.drop-down-menu .menu-item:hover,
.drop-down-menu .menu-item:focus-visible {
    background: var(--nav-button-bg);
}

.drop-down-menu .menu-item:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -2px;
}

.drop-down-menu .menu-item.is-active {
    background: var(--nav-button-hover-bg);
    font-weight: 600;
}

.drop-down-menu .menu-item.is-closing-selection,
.drop-down-menu .menu-item.is-active.is-closing-selection {
    background: var(--nav-button-hover-bg);
}

.drop-down-menu .menu-item.is-transition-muted,
.drop-down-menu .menu-item.is-active.is-transition-muted {
    background: var(--nav-bg);
}

.drop-down-menu .menu-item.is-pulsing {
    animation: menu-item-pulse 260ms ease;
}

@keyframes menu-item-pulse {
    0% { filter: brightness(1); }
    45% { filter: brightness(0.72); }
    100% { filter: brightness(1); }
}
/* shared button styles for navigation and mobile menu */
.navigation button{
    background-color: var(--nav-button-bg);
    color: var(--nav-color);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
    transition: background 0.2s ease;
}

/* ### Navigation Bar ### */
.navigation {
    margin: 0px;
    padding: 0 5px;
    background-color: var(--nav-bg);
    border-top: 4px solid var(--nav-border);
    border-bottom: 4px solid var(--nav-border);
    width: calc(100vw - 10px);
    position: sticky;
    left: 0;
}
.navigation .buttons {
    display: flex;
    justify-content: left;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}

.navigation button {
    font-family: "Roboto", sans-serif;
    font-weight: 650;
    width: 120px;
    padding: 10px 0;
    font-size: 1rem;
    box-sizing: border-box;
    margin: 5px;
    text-align: center;
    cursor: pointer;
    background-color: var(--nav-button-bg);
    color: var(--nav-color);
    border: none;
    border-radius: 5px;
    transition: background 0.4s ease;
}

.navigation .filtered-results-back-button {
    display: none;
    width: 132px;
}

.navigation button:hover {
    background-color: var(--nav-button-hover-bg);
}

/* ### Main Body Content ### */
/* Loading Icon */
.excel-content .overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--loader-overlay-bg);
    backdrop-filter: blur(4px);
    display: flex;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 999;
}
.excel-content .loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid transparent;
    border-top: 4px solid var(--loader);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}
.excel-content.loading .overlay,
.excel-content.loading .loader {
    opacity: 1;
    pointer-events: all;
}
@keyframes spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}
/* ───────────────────────────────────────────────────────────────────────────── */
/*                              Base table styling                               */
/* ───────────────────────────────────────────────────────────────────────────── */
.excel-content {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

body.landing-body {
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

body.error-body {
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

.landing-page {
    flex: 1 1 auto;
    width: 100%;
    box-sizing: border-box;
    padding: 32px 16px 48px;
    font-family: "Roboto", sans-serif;
}

.landing-card {
    width: min(720px, 100%);
    margin: 0 auto;
    padding: 24px 20px;
    border: 1px solid var(--border-300);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--surface-100) 0%, var(--surface-400) 100%);
    box-shadow: 0 16px 32px var(--panel-shadow);
    box-sizing: border-box;
}

.landing-kicker {
    margin: 0 0 8px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-700);
}

.landing-heading {
    margin: 0 0 10px;
    font-family: "Russo One", sans-serif;
    font-size: clamp(1.6rem, 2vw + 1rem, 2.5rem);
    color: var(--text-900);
}

.landing-copy {
    margin: 0 0 20px;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    font-size: 1rem;
    line-height: 1.45;
    color: var(--text-700);
}

.landing-copy-secondary {
    margin-bottom: 12px;
}

.landing-copy-secondary:last-child {
    margin-bottom: 0;
}

.landing-sheet-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.landing-sheet-links .menu-item {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    border-radius: 6px;
    background: var(--nav-button-bg);
    color: var(--nav-color);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
    transition: background-color 0.18s ease, transform 0.18s ease;
    border: 2px #650000 solid;
}

.landing-sheet-links .menu-item:hover,
.landing-sheet-links .menu-item:focus-visible {
    background: var(--nav-button-hover-bg);
    transform: translateX(2px);
}

.landing-sheet-links .menu-item:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.landing-action-link {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 14px;
    padding: 12px 16px;
    border: 1px solid color-mix(in srgb, var(--footer-link-color) 56%, var(--border-300));
    border-radius: 6px;
    background: color-mix(in srgb, var(--footer-link-color) 16%, transparent);
    color: var(--footer-link-color);
    font-size: 1.05rem;
    font-weight: 700;
    font-style: italic;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.landing-action-link:hover,
.landing-action-link:focus-visible {
    background: color-mix(in srgb, var(--footer-link-color) 24%, transparent);
    border-color: color-mix(in srgb, var(--footer-link-color) 72%, var(--border-300));
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.landing-action-link:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--footer-link-color) 55%, white);
    outline-offset: 2px;
}

.landing-inline-link {
    color: var(--footer-link-color);
}

.error-page {
    flex: 1 1 auto;
    width: 100%;
    box-sizing: border-box;
    padding: 40px 16px 56px;
    font-family: "Roboto", sans-serif;
}

.error-card {
    width: min(680px, 100%);
    margin: 0 auto;
    padding: 24px 20px;
    border: 1px solid var(--border-300);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--surface-100) 0%, var(--surface-400) 100%);
    box-shadow: 0 16px 32px var(--panel-shadow);
    box-sizing: border-box;
}

.landing-section + .landing-section {
    margin-top: 22px;
}

.landing-section-secondary {
    padding-top: 18px;
    border-top: 1px solid var(--border-300);
}

.error-kicker {
    margin: 0 0 8px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-700);
}

.error-code {
    margin: 0 0 10px;
    font-family: "Russo One", sans-serif;
    font-size: clamp(3.2rem, 5vw + 1rem, 5rem);
    line-height: 0.95;
    color: var(--sheet-title-color);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.14);
}

.error-title {
    margin: 0 0 10px;
    font-family: "Russo One", sans-serif;
    font-size: clamp(1.7rem, 2vw + 1rem, 2.4rem);
    color: var(--text-900);
}

.error-copy {
    margin: 0 0 20px;
    max-width: 58ch;
    font-size: 1rem;
    line-height: 1.45;
    white-space: pre-line;
    color: var(--text-700);
}

.error-email-link {
    color: var(--footer-link-color);
    font-style: italic;
    text-decoration: none;
}

.error-email-link:hover,
.error-email-link:focus-visible {
    color: var(--accent-600);
    text-decoration: underline;
}

.error-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.error-actions .menu-item {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    border-radius: 6px;
    background: var(--nav-button-bg);
    color: var(--nav-color);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.error-actions .menu-item:hover,
.error-actions .menu-item:focus-visible {
    background: var(--nav-button-hover-bg);
    transform: translateX(2px);
}

.error-actions .menu-item:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ### Site Search Page ### */
body.search-body {
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}
.search-page {
    flex: 1 1 auto;
    width: 100vw;
    box-sizing: border-box;
    padding: 24px 16px 40px;
    font-family: "Roboto", sans-serif;
}
.search-hero {
    max-width: 900px;
    margin: 0 auto;
}
.search-title {
    margin: 0 0 4px;
    font-family: "Russo One", sans-serif;
    font-size: 1.6rem;
    color: var(--text-900);
}
.search-sub-title,
.search-subtitle {
    margin: 0 0 14px;
    font-family: "Roboto", sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.01em;
    color: var(--text-700);
}
.search-input-row {
    display: flex;
    align-items: center;
    gap: 0;
}
.search-input {
    flex: 1 1 auto;
    height: 36px;
    padding: 6px 10px;
    font-size: 1rem;
    border: 1px solid var(--border-300);
    border-radius: 6px 0 0 6px;
    background: var(--surface-000);
    color: var(--text-900);
}
.search-input:focus {
    outline: none;
}
.search-clear-btn {
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-300);
    border-left: 0;
    border-radius: 0 6px 6px 0;
    background: var(--surface-200);
    color: var(--text-900);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.search-clear-btn:hover,
.search-clear-btn:focus-visible {
    background: var(--surface-500);
}
.search-clear-btn.is-pressed {
    animation: search-clear-press 180ms ease;
    transform-origin: center center;
}
@keyframes search-clear-press {
    0% {
        transform: scaleY(1);
    }
    45% {
        transform: scaleY(0.9);
    }
    100% {
        transform: scaleY(1);
    }
}
.search-input-row:focus-within .search-input,
.search-input-row:focus-within .search-clear-btn {
    border-color: var(--accent-500);
}
.search-status {
    margin-top: 8px;
    min-height: 1.2em;
    font-size: 0.9rem;
    color: var(--text-700);
}
.search-results {
    max-width: 1600px;
    margin: 16px auto 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.search-section {
    border: 1px solid var(--border-300);
    border-radius: 8px;
    background: var(--surface-100);
    padding: 12px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.search-section.is-clickable {
    cursor: pointer;
}
.search-section.is-clickable:hover {
    border-color: var(--accent-500);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}
.search-section.is-clickable:focus-visible {
    outline: 2px solid var(--accent-500);
    outline-offset: 2px;
}
.search-section-title {
    margin: 0 0 8px;
    font-family: "Russo One", sans-serif;
    font-size: 1.1rem;
    color: var(--sheet-title-color);
}
.search-row {
    padding: 6px 8px;
    border-top: 1px dashed var(--border-300);
}
.search-row:first-child {
    border-top: none;
}
.search-row-meta {
    font-size: 0.8rem;
    color: var(--text-700);
    margin-bottom: 2px;
}
.search-row-text {
    font-size: 0.95rem;
    color: var(--text-900);
    word-break: break-word;
    overflow-x: auto;
}
.search-row-text::-webkit-scrollbar:vertical {
    width: 0;
}
.search-row-text::-webkit-scrollbar:horizontal {
    height: 8px;
}
.search-table-scale {
    position: relative;
    width: 100%;
}
.search-table-scale::-webkit-scrollbar:vertical {
    width: 0;
}
.search-table-scale::-webkit-scrollbar:horizontal {
    height: 8px;
}
.search-row-text .search-result-table {
    width: 100%;
    border-collapse: collapse;
    font-family: "Roboto", sans-serif;
    transform-origin: top left;
}
.search-row-text .search-result-table td {
    border: 1px solid var(--cell-border);
    padding: 6px 8px;
    text-align: left;
    white-space: nowrap;
    background-clip: padding-box;
}
.search-row-text .search-result-table td[data-type="price"] {
    text-align: right;
}
.search-row-text .search-result-table td[data-align="left"] {
    text-align: left;
}
.search-row-text .search-result-table td[data-align="right"] {
    text-align: right;
}
.search-row-text .search-result-table td[data-align="center"] {
    text-align: center;
}
.search-row-text .search-result-table th {
    border: 1px solid var(--cell-border);
    padding: 6px 8px;
    text-align: left;
    white-space: nowrap;
    background: var(--sheet-header-bg);
    color: var(--sheet-header-color);
    font-weight: bold;
}
.search-row-text .search-result-table .search-row-meta-row td {
    background: var(--surface-200);
    color: var(--text-700);
    font-size: 0.8rem;
    font-style: italic;
    border: 1px solid var(--border-300);
}
/* ────────── Mobile Scale Wrapper ────────── */
.excel.content .table-scale {
    position: relative;
    width: 100vw;
}

/* ────────── Sheet Title Bar ────────── */
.sheet-title-bar {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--sheet-title-bar-height);
    padding: 6px 10px;
    border-bottom: 1px solid var(--sheet-header-border);
    background: var(--sheet-title-bg);
    left: 0;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
}
.sheet-title {
    margin: 0;
    position: sticky;
    left: 10px;
    z-index: 5;
    background: var(--sheet-title-bg);
    padding-right: 8px;
}
.sheet-title .sheet-title-sticky {
    color: var(--sheet-title-color);
    font-family: "Russo One", sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    -webkit-text-stroke-width: 0.3px;
    -webkit-text-stroke-color: black;
    text-shadow: 0.5px 0.5px 1.5px black;
    display: inline-block;
}
.sheet-title-back-link {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 14px;
    border-radius: 6px;
    background: var(--nav-button-bg);
    color: var(--nav-color);
    font-family: "Roboto", sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.18s ease;
}
.sheet-title-back-link:hover,
.sheet-title-back-link:focus-visible {
    background: var(--nav-button-hover-bg);
}
body.inventory-search-results-view .sheet-title-back-link:not([hidden]) {
    display: inline-flex;
}
.sheet-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.sheet-actions .print-btn {
    margin-left: 0;
}
.sheet-search-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    height: 28px;
    width: 28px;
    border-radius: 4px;
    border: 1px solid var(--border-300);
    background: var(--surface-200);
    color: var(--text-900);
    cursor: pointer;
}
.sheet-search-toggle:hover,
.sheet-search-toggle:focus-visible {
    background: var(--surface-500);
}
.sheet-search-panel {
    display: flex;
    align-items: center;
    gap: 6px;
}
.sheet-search-input {
    height: 28px;
    padding: 4px 8px;
    font-size: 0.9rem;
    border: 1px solid var(--border-300);
    border-radius: 4px;
    background: var(--surface-100);
    color: var(--text-900);
    min-width: 140px;
    max-width: 38vw;
}
.sheet-search-input::placeholder {
    color: var(--text-700);
}
.sheet-search-close {
    display: none;
    height: 28px;
    padding: 0 8px;
    border-radius: 4px;
    border: 1px solid var(--border-300);
    background: var(--surface-200);
    color: var(--text-900);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    align-items: center;
    justify-content: center;
}
.sheet-search-close:hover,
.sheet-search-close:focus-visible {
    background: var(--surface-500);
}
.sheet-search-backdrop {
    display: none;
}

/* ────────── Print Header Style - Sheet Title ────────── */
.print-header {
    display: none;  /* Shown Only in Print */
    font-family: "Russo One", sans-serif;
    font-size: 1.5rem;
    margin: 0 0 12px 0;
    color: #000;
}

/* ────────── Table Styling ────────── */
.excel-content #excel-output {
	flex: 0 1 auto;     /* fill remaining space under the title bar */
	min-height: auto;   /* allow scroll container to shrink */
	height: auto;       /* no fixed height math */
}
.excel-content .excel-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
}

/* ────────── Sticky Sheet Header ────────── */
.excel-content .excel-table thead {
    position: static;
    top: auto;
    z-index: auto;
}

/* ────────── Font Definition for Table ────────── */
.excel-content .excel-table,
.excel-content .excel-table th,
.excel-content .excel-table td {
    font-family: "Roboto", sans-serif;
}

/* ────────── not sure ────────── */
.excel-content .excel-table col {
    vertical-align: top;
}

.excel-content .excel-table th,
.excel-content .excel-table td {
    border: 1px solid var(--cell-border);
    padding: 6px 8px;
    text-align: left;
    white-space: nowrap;
    background-clip: padding-box;
	vertical-align: top;
}

/* Clip long content ONLY when we explicitly set a width/max-width from JS */
.excel-cell-wrap {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Price column hook (via data-type="price") */
.excel-content .excel-table td[data-type="price"] {
	text-align: right;
}

/* Column hook for align-left */
.excel-content .excel-table td[data-align="left"] {
	text-align: left;
}
/* Column hook for align-right */
.excel-content .excel-table td[data-align="right"] {
	text-align: right;
}
/* Column hook for align-center */
.excel-content .excel-table td[data-align="center"] {
    text-align: center;
}

/* Separator row styling */
.excel-content .excel-table tbody tr.separator td {
    border: none;
    border-top: 1px solid var(--separator-color);
    height: 0;
    padding: 0;
    background: transparent;
}

/* Highlight Header Titles */
.excel-content .excel-table thead tr:nth-child(1) {
    font-weight: bold;
    background: var(--sheet-header-bg);
    color: var(--sheet-header-color);
}

/* Sub Headers */
.excel-content .excel-table tbody tr.sub-header td {
    position: relative;
    background-color: var(--sub-header-bg);
    text-shadow: 1px 1px 2px black;
    font-weight: bold;
    padding: 8px;
    color: var(--sub-header-color);
    font-family: "Russo One", sans-serif;
    font-size: 1.1rem;
}
.excel-content .excel-table tbody tr.sub-header .sub-header-sticky {
    position: sticky;
    left: 9px;
    z-index: 2;                 /* above scrolling cells */
    padding-right: 8px;
    display: inline-block;
    -webkit-text-stroke-color: black;
    -webkit-text-stroke-width: 0.15px;
}

/* Conditional color hooks using data attributes set in JS */
[data-condition="Used C"] { color: #f00; font-weight: 500; }
[data-condition="Used"] { color: #f00; }
[data-condition="Very Good"] { color: #2c9631; }
[data-condition="Like New"] { color: #00bd09; }
[data-condition="Brand New"] { color: #00ff11; font-weight: 600; }

/* Short date format (DD-MMM) */
.excel-content .excel-table td[data-date="short"] {
    color: #8f8f8f;
    font-size: 0.9em;
}

/* Keyword text colors for when data-color is set */
[data-color="black"] { color: #000; font-weight: bold; }
[data-color="blue"] { color: #1565c0; font-weight: bold; }
[data-color="red"] { color: #df1a1a; font-weight: bold; }
[data-color="green"] { color: #2d9632; font-weight: bold; }
[data-color="gray"] { color: #616161; font-weight: bold; }
[data-color="dark gray"] { color: #333333; font-weight: bold; }
[data-color="light gray"] { color: #8f8f8f; font-weight: bold; }
[data-color="orange"] { color: #ef6c00; font-weight: bold; }
[data-color="yellow"] { color: #f9d925; font-weight: bold; }
[data-color="purple"] { color: #6a1b9a; font-weight: bold; }
[data-color="teal"] { color: #00bda7; font-weight: bold; }
[data-color="camo"] { color: #667441; font-weight: bold; }
[data-color="kit"] { color: #ff8c00; font-family: "Russo One", sans-serif; font-style: italic; font-weight: bold; text-decoration: underline; }
[data-color="default"] { color: #333; font-style: italic; font-size: 0.95em; }

/* Keyword text colors for when data-color is set (Clothing Sizes) */
td:is([data-col="MEN" i],[data-col="WOMEN" i])[data-color="S"] { color: #494529 }
td:is([data-col="MEN" i],[data-col="WOMEN" i])[data-color="M"] { color: #c00 }
td:is([data-col="MEN" i],[data-col="WOMEN" i])[data-color="L"] { color: #974706 }
td:is([data-col="MEN" i],[data-col="WOMEN" i])[data-color="XL"] { color: #07c }
td:is([data-col="MEN" i],[data-col="WOMEN" i])[data-color="2X"] { color: #8064a2 }
td:is([data-col="MEN" i],[data-col="WOMEN" i])[data-color="3X"] { color: #f00 }
td:is([data-col="MEN" i],[data-col="WOMEN" i])[data-color="4X"] { color: #f00 }

/* Theme-driven highlight for prm meta */
.search-row-text .search-result-table td[data-prm="1"],
.excel-content .excel-table td[data-prm="1"] {
    background: var(--prm-bg);
    color: var(--prm-text);
}

/* ### Footer ### */
footer {
    min-height: var(--footer-height);
    height: auto;
    position: sticky;
    left: 0;
    width: 100vw;
    box-sizing: border-box;
    border-top: 3px solid #000;
    box-shadow: 0 -8px 20px rgba(0,0,0,0.18);
    background: linear-gradient(
        180deg,
        var(--footer-bg) 0%,
        color-mix(in srgb, var(--footer-bg) 84%, black) 100%
    );
    color: var(--footer-color);
    padding: 10px 8px calc(10px + env(safe-area-inset-bottom, 0px));
    font-size: 0.75rem;
    z-index: 50;
    margin-top: auto;
    text-align: center;
}
footer a {
    color: var(--footer-link-color);
    text-decoration: none;
}
footer .footer-box {
    position: static;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 960px;
    margin: 0 auto;
}
footer .footer-box > small {
    flex: 1 0 100%;
}
footer br {
    display: none;
}
.footer-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    min-width: 108px;
    padding: 2px 8px;
    border: 1px solid color-mix(in srgb, var(--footer-link-color) 55%, transparent);
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    color: var(--footer-link-color);
    text-decoration: none;
    line-height: 1.1;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.footer-link-btn:hover,
.footer-link-btn:focus-visible {
    background: color-mix(in srgb, var(--footer-link-color) 12%, transparent);
    border-color: color-mix(in srgb, var(--footer-link-color) 80%, transparent);
    color: var(--text-100);
}
.footer-link-btn:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--footer-link-color) 35%, transparent);
    outline-offset: 2px;
}

/* ### Modal ### */
/* Modal backdrop + container */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    padding-bottom: var(--footer-height);
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 210;
}

/* When active, allow clicks and fade in */
.modal.active {
    opacity: 1;
    pointer-events: auto;
}

/* Modal content wrapper */
.modal-card {
    background: var(--modal-bg);
    color: var(--modal-color);
    max-width: 500px;
    width: 90%;
    max-height: 85%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 6px;
    position: relative;
    font-family: "Roboto", sans-serif;
    font-size: 1rem;
    transform: translateY(-10px);
    transition: transform 0.3s ease;
}
.modal.active .modal-card {
    transform: translateY(0);
}
.modal-content {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px;
}
.modal-content h2 {
    text-align: center;
}
.modal-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: var(--modal-backdrop-bg);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 200;
}
.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-close {
    flex-shrink: 0;
    display: block;
    width: 100%;
    padding: 12px 16px;
    background-color: var(--nav-button-bg);
    color: var(--nav-color);
    border: none;
    border-top: 1px solid rgba(0,0,0,0.08);
    border-radius: 0 0 6px 6px;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s ease;
}
.modal-close:hover,
.modal-close:focus-visible {
    background-color: var(--nav-button-hover-bg);
}

/* --- Markdown content inside the modal --- */
.modal-content h1, .modal-content h2, .modal-content h3 { margin: 0.3em 0 0.4em; }
.modal-content h4 {margin: 0.7em 0;}
.modal-content p { margin: 0.25em 0; line-height: 1.2; }
.modal-content ul, .modal-content ol { margin: 0.25em 0; padding-left: 2ch; }
.modal-content li { margin: 0; line-height: 1.25; }
.modal-content hr { border: none; border-top: 1px solid #ccc; margin: 12px 0; }

/* Font-size utilities used by the editor component */
.modal-content .fs-sm { font-size: 0.9rem; }
.modal-content .fs-md { font-size: 1rem; }   /* default */
.modal-content .fs-lg { font-size: 1.15rem; }
.modal-content .fs-xl { font-size: 1.3rem; }

/* Responsive Format and Layout */
@media (max-width: 398px) {
    :root {
        --header-height: 24px;
        --sheet-title-bar-height: 36px;
    }
    html { font-size: clamp(10px , 2.5vw + 10px, 14px); }
    body {
        overflow: auto;
        min-height: 100dvh;
    }
    .header-wrapper {
        position: sticky !important;
        width: 100vw !important; /* ignore scrollbar width on wide screens */
    }
    .header-title {
        font-size: 1.5rem;
    }
    .site-search-link {
        height: 24px;
        width: 24px;
    }
    .print-btn {
        height: 24px;
        width: 24px;
    }
    .header {
        height: var(--header-height) !important;
    }
    .navigation {
        display: none !important;
    }
    .search-body .hamburger-wrapper,
    .search-body .mobile-menu {
        display: none !important;
    }
    .search-body .navigation {
        display: block !important;
    }
    .search-body .navigation .buttons {
        justify-content: flex-start;
    }
    .search-body .navigation #search-nav-button {
        display: inline-block;
        width: 132px;
    }
    .hamburger-wrapper {
        display: flex;
        height: 34px;
        width: 34px;
    }
    .hamburger {
        --hamburger-line-width: 70%;
        --hamburger-line-height: 2px;
        --hamburger-line-offset: 9px;
    }
    .nav-wrapper-mobile {
        display: flex;
    }
    .sheet-title-bar {
        height: var(--sheet-title-bar-height);
    }
    .sheet-title-bar.search-open {
        z-index: 120;
    }
    .sheet-title #sheet-title{
        font-size: 0.75rem;
    }
    .sheet-title-back-link {
        display: none !important;
    }
    .sheet-search-toggle {
        display: inline-flex;
        height: 22px;
        width: 22px;
    }
    .sheet-search-panel {
        display: none;
    }
    .sheet-search-panel.active {
        display: flex;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: fit-content;
        max-width: calc(100vw - 24px);
        padding: 8px;
        background: var(--surface-100);
        border-radius: 6px;
        box-shadow: 0 10px 24px rgba(0,0,0,0.35);
        z-index: 130;
    }
    .sheet-search-input {
        flex: 0 0 auto;
        min-width: 0;
        width: min(64vw, 240px);
        font-size: 0.8rem;
        height: 22px;
    }
    .sheet-search-close {
        display: inline-flex;
        height: 22px;
        font-size: 0.75rem;
    }
    .sheet-search-backdrop.active {
        display: block;
        position: fixed;
        inset: 0;
        background: transparent;
        z-index: 110;
    }
    .excel-content .excel-table {
        transform: scale(var(--mobile-scale, 1));
        transform-origin: top left;
        will-change: transform;
    }
    .excel-content .excel-table thead {
        position: static;
        top: auto;
        z-index: auto;
    }
    .search-page {
        padding: 18px 12px 32px;
    }
    .search-title {
        font-size: 1.3rem;
    }
    .search-input {
        height: 30px;
        font-size: 0.9rem;
    }
    .search-clear-btn {
        height: 30px;
        font-size: 0.82rem;
    }
    .search-row-text {
        overflow-x: hidden;
    }
    footer {
        padding-inline: 6px;
    }
    footer .footer-box {
        gap: 6px;
    }
    .footer-link-btn {
        min-height: 22px;
        min-width: 96px;
        padding: 2px 7px;
        font-size: 0.72rem;
    }
}
@media (399px <= width <= 934px) {
    :root {
        --header-height: 24px;
        --sheet-title-bar-height: 40px;
    }
    html { font-size: clamp(10px , 2.5vw + 10px, 14px); }
    body {
        overflow: auto;
        overflow-x: hidden;
        width: 100vw;
        min-height: 100dvh;
    }
    .header-wrapper {
        position: sticky !important;
        width: 100vw !important; /* ignore scrollbar width on wide screens */
    }
    .header-title {
        font-size: 2rem;
        height: var(--header-height);
    }
    .site-search-link {
        height: 34px;
        width: 34px;
    }
    .print-btn {
        height: 34px;
        width: 34px;
    }
    .navigation {
        display: none !important;
    }
    .search-body .hamburger-wrapper,
    .search-body .mobile-menu {
        display: none !important;
    }
    .search-body .navigation {
        display: block !important;
    }
    .search-body .navigation .buttons {
        justify-content: flex-start;
    }
    .search-body .navigation #search-nav-button {
        display: inline-block;
        width: 132px;
    }
    .hamburger-wrapper {
        display: flex;
        height: 34px;
        width: 34px;
    }
    .hamburger {
        --hamburger-line-width: 70%;
        --hamburger-line-height: 2px;
        --hamburger-line-offset: 9px;
    }
    .nav-wrapper-mobile {
        display: flex;
    }
    .sheet-title-bar {
        height: var(--sheet-title-bar-height);
    }
    .sheet-title-bar.search-open {
        z-index: 120;
    }
    .sheet-title #sheet-title{
        font-size: 1rem;
    }
    .sheet-title-back-link {
        display: none !important;
    }
    .sheet-search-toggle {
        display: inline-flex;
        height: 24px;
        width: 24px;
    }
    .sheet-search-panel {
        display: none;
    }
    .sheet-search-panel.active {
        display: flex;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: fit-content;
        max-width: calc(100vw - 32px);
        padding: 10px;
        background: var(--surface-100);
        border-radius: 6px;
        box-shadow: 0 10px 24px rgba(0,0,0,0.35);
        z-index: 130;
    }
    .sheet-search-input {
        flex: 0 0 auto;
        min-width: 0;
        width: min(60vw, 280px);
        font-size: 0.85rem;
        height: 24px;
    }
    .sheet-search-close {
        display: inline-flex;
        height: 24px;
        font-size: 0.8rem;
    }
    .sheet-search-backdrop.active {
        display: block;
        position: fixed;
        inset: 0;
        background: transparent;
        z-index: 110;
    }
    .excel-content .excel-table {
        transform: scale(var(--mobile-scale, 1));
        transform-origin: top left;
        will-change: transform;
    }
    .excel-content .excel-table thead {
        position: static;
        top: auto;
        z-index: auto;
    }
    .search-page {
        padding: 20px 14px 36px;
    }
    .search-title {
        font-size: 1.4rem;
    }
    .search-input {
        height: 32px;
        font-size: 0.95rem;
    }
    .search-clear-btn {
        height: 32px;
        font-size: 0.86rem;
    }
    .search-row-text {
        overflow-x: hidden;
    }
    footer {
        padding-inline: 8px;
    }
    footer .footer-box {
        gap: 7px;
    }
    .footer-link-btn {
        min-height: 23px;
        min-width: 102px;
        padding: 2px 8px;
        font-size: 0.74rem;
    }
}
@media (min-width: 935px) {
    .nav-wrapper-mobile {
        display: none !important;
    }
    .mobile-menu {
        display: none !important;
    }
    .header-actions {
        position: absolute;
        top: 8px;
        right: 10px;
        margin-left: 0;
    }
    .site-search-link,
    .print-btn {
        height: 34px;
        width: 34px;
    }
}

/* --- Dark Mode --- */
@media (prefers-color-scheme: dark) {
    :root {
        --chrome-900: #161616;
        --chrome-800: #262626;
        --chrome-700: #373737;
        --surface-000: #171717;
        --surface-100: #1f1f1f;
        --surface-200: #2b2b2b;
        --surface-300: #3a3a3a;
        --surface-400: #242424;
        --surface-500: #313131;
        --accent-500: #bd0003;
        --accent-600: #9b0003;
        --border-500: #4a4a4a;
        --border-300: #5a5a5a;
        --text-900: #e6e6e6;
        --text-700: #bdbdbd;
        --text-100: #f2f2f2;
        --text-300: #d1d1d1;
        --panel-shadow: rgba(0,0,0,0.35);
        --site-header-bg: var(--chrome-800);
        --nav-bg: var(--chrome-900);
        --nav-button-bg: var(--accent-500);
        --nav-button-hover-bg: var(--accent-600);
        --nav-toggle-btn-bg: var(--chrome-700);
        --sheet-title-bg: var(--surface-200);
        --sheet-header-bg: var(--surface-300);
        --sub-header-bg: var(--surface-400);
        --cell-bg: var(--surface-000);
        --footer-bg: var(--chrome-900);
        --modal-backdrop-bg: rgba(0,0,0,0.6);
        --modal-bg: var(--surface-100);
        --prm-bg: #1c1c1c;
        --nav-border: #0d0d0d;
        --cell-border: var(--border-500);
        --separator-color: var(--border-500);
        --sheet-header-border: var(--border-500);
        --loader: var(--accent-500);
        --site-header-color: #dd0004;
        --nav-color: var(--text-100);
        --sheet-title-color: #c40007;
        --sheet-header-color: var(--text-900);
        --sub-header-color: #c20006;
        --footer-color: var(--text-300);
        --footer-link-color: #e30008;
        --modal-color: var(--text-900);
        --prm-text: #24d26a;
        --icon-btn-bg: var(--surface-200);
        --icon-btn-bg-hover: var(--surface-500);
        --icon-btn-border: var(--border-500);
        --icon-btn-color: var(--text-100);
        --icon-line-color: var(--text-100);
    }

    [data-color="default"] { color: #a9a9a9; font-style: italic; font-size: 0.95em; }
    [data-color="black"] { color: #e2e2e2; font-weight: bold;}
    [data-color="dark gray"] { color: #727272; font-weight: bold;}

    body {
        background: #101010;
        color: var(--text-900);
    }

    .landing-card {
        border-color: var(--border-500);
        background: linear-gradient(180deg, var(--surface-100) 0%, var(--surface-400) 100%);
        box-shadow: 0 16px 32px var(--panel-shadow);
    }

    .landing-kicker {
        color: var(--text-700);
    }

    .landing-heading,
    .landing-copy {
        color: var(--text-900);
    }

    .search-title,
    .search-subtitle,
    .search-row-text,
    .search-status {
        color: var(--text-900);
    }
    
    .search-section-title {
        color: var(--sheet-title-color);
    }

    .search-section {
        background: var(--surface-100);
        border-color: var(--border-500);
    }

    .search-row {
        border-top-color: var(--border-500);
    }

    .search-row-meta {
        color: var(--text-700);
    }

    .search-row-text .search-result-table .search-row-meta-row td {
        background: var(--surface-200);
        color: var(--text-700);
        border-color: var(--border-500);
    }

    .sheet-search-toggle,
    .sheet-search-close {
        border-color: var(--border-500);
        background: var(--surface-200);
        color: var(--text-900);
    }

    .sheet-search-toggle:hover,
    .sheet-search-toggle:focus-visible,
    .sheet-search-close:hover,
    .sheet-search-close:focus-visible {
        background: var(--surface-500);
    }

    .sheet-search-input,
    .search-input,
    .search-clear-btn {
        border-color: var(--border-500);
        background: var(--surface-100);
        color: var(--text-900);
    }

    .sheet-search-input:not(:placeholder-shown),
    .search-input:not(:placeholder-shown) {
        background: var(--surface-200);
    }

    .sheet-search-input:-webkit-autofill,
    .sheet-search-input:-webkit-autofill:hover,
    .sheet-search-input:-webkit-autofill:focus,
    .search-input:-webkit-autofill,
    .search-input:-webkit-autofill:hover,
    .search-input:-webkit-autofill:focus {
        -webkit-text-fill-color: var(--text-900);
        box-shadow: 0 0 0 1000px var(--surface-200) inset;
        transition: background-color 9999s ease-out 0s;
        caret-color: var(--text-900);
    }

    .sheet-search-input::placeholder,
    .search-input::placeholder {
        color: var(--text-700);
    }

    .sheet-search-panel.active {
        background: var(--surface-100);
    }

    .search-clear-btn:hover,
    .search-clear-btn:focus-visible {
        background: var(--surface-500);
    }

    .modal-content hr {
        border-top-color: var(--border-500);
    }
}

/* ───────────────────────────────────────────────────────────────────────── */
/* PRINT LAYOUT                                                              */
/* - 8mm physical margins                                                    */
/* - Show a simple print header with the sheet title                         */
/* - Disable sticky & colored backgrounds that can cause odd print shifts    */
/* - Keep cells nowrap, center the table, and scale to fit page width        */
/* ───────────────────────────────────────────────────────────────────────── */
@page {
    margin: 8mm; /* exact physical margin around the page */
}
@media print {
    :root { --mobile-scale: 1 !important; } /* Neutralize mobile Scaling */
    /* Kill any layout side-effects that add phantom margins/heights */
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        min-height: auto !important;
        width: auto !important;
        overflow: visible !important;
    }
    body {
        display: block !important;       /* avoid flex in print */
        width: auto !important;          /* ignore fit-content on screen */
    }
    /* Hard reset margins/padding on printable elements so @page(8mm) is the ONLY margin. */
    body, .excel-content, #excel-output, table, thead, tbody, tr, th, td, h1, h2 {
        margin: 0 !important;
        padding: 0 !important;
    }
    .excel-content .table-scale { height: auto !important; width: auto !important; }
    .excel-content .excel-table { transform: none !important; }
    /* Restore the intended cell padding after the reset */
    .excel-content .excel-table th,
    .excel-content .excel-table td {
        padding: 6px 8px !important;
    }

    /* Hide all non-print chrome so only table + print-header remain */
    .header-wrapper,
    .navigation,
    .nav-wrapper-mobile,
    footer,
    .modal,
    .modal-backdrop,
    #overlay,
    #loader,
    .sheet-actions {
        display: none !important;
    }

    /* Minimal print header (title injected by JS), no extra spacing */
    .print-header {
        display: block !important;
        background: none !important;
        color: #000 !important;
        text-shadow: none !important;
        margin: 0 0 4mm 0 !important;    /* small gap to table; no top padding */
        padding: 0 !important;
        text-align: center;
    }

    /* Nix sticky + colored bars that can skew top/bottom spacing */
    .sheet-title-bar,
    .sheet-title,
    .sheet-title .sheet-title-sticky {
        position: static !important;
        background: none !important;
        color: #000 !important;
        text-shadow: none !important;
        -webkit-text-stroke: 0 !important;
    }
    .sheet-title-bar { display: none !important; }

    /* Header row should not be sticky when printing */
    .excel-content .excel-table thead {
        position: static !important;
        top: auto !important;
        z-index: auto !important;
        background: none !important;
        color: #000 !important;
    }

    /* Sub-headers: keep font/weight, remove backgrounds/colors */
    .excel-content .excel-table tbody tr.sub-header td,
    .excel-content .excel-table tbody tr.sub-header .sub-header-sticky {
        position: static !important;
        background: none !important;
        color: #000 !important;
        text-shadow: none !important;
        padding-right: 0 !important;
    }

    /* Zero out any container padding/margins; center the table block */
    .excel-content,
    .excel-content #excel-output {
        margin: 0 !important;
        padding: 0 !important;
    }
    /* Use zoom on the whole print tree for better mobile consistency */
    body {
        zoom: var(--print-zoom, 1); /* JS sets --print-zoom; keeps physical 8mm margins exact */
    }
    .excel-content .excel-table {
        margin: 0 auto !important;   /* center horizontally */
        table-layout: auto !important;
        border-collapse: collapse;
        border-spacing: 0;
        border: 0.5px solid #000 !important; /* thin black border around table */
    }
    /* Never wrap cells; let scale handle fit */
    .excel-content .excel-table th,
    .excel-content .excel-table td {
        white-space: nowrap !important;
        border: 0.5px solid #000 !important; /* thin black border for print */
    }
    .excel-content .excel-table tbody tr.separator td {
        border-top: 0.5px solid #000 !important;
        padding: 0 !important;
    }
}

/* Font Family Declarations */
@font-face {
    font-family: "UT-Nickel";
    src: url(/assets/fonts/UT-Nickel.otf);
    font-weight: normal;
    font-style: normal;
    font-variation-settings: 
        "wdth" 100;
}
