/* THE VESSEL CODE — STORE tab (IMPA catalog) */
#tab-store .sheet-head h2 {
    margin: 0;
}

.store-loading,
.store-empty {
    color: #718096;
    font-size: 0.9375rem;
    padding: 12px 4px;
}

.store-error {
    color: #c53030;
    font-size: 0.9375rem;
    padding: 12px 4px;
}

.store-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 20px 16px;
}

.store-search {
    flex: 1;
    min-width: 180px;
    padding: 10px 14px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    background: #fff;
    color: #2d3748;
    font-size: 0.9375rem;
}

.store-search:focus {
    outline: 2px solid #3182ce;
    outline-offset: 1px;
}

.store-count {
    align-self: center;
    font-size: 0.8125rem;
    color: #718096;
    font-weight: 600;
}

.store-import-btn {
    align-self: center;
    white-space: nowrap;
}

.store-import-panel {
    margin: 0 20px 12px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #edf2f7;
    border: 1px solid #cbd5e0;
}

.store-import-panel.hidden {
    display: none;
}

.store-import-progress-track {
    height: 10px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.store-import-progress-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #2b6cb0, #1a365d);
    transition: width 0.15s ease;
}

.store-import-progress-label {
    margin: 8px 0 0;
    font-size: 0.8125rem;
    color: #4a5568;
}

.store-cap-note {
    margin: 0 20px 10px;
    font-size: 0.8125rem;
    color: #718096;
}

.store-table-wrap,
.store-vl-wrap {
    margin: 0 20px 24px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.store-vl-head {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr) 132px 64px;
    gap: 8px;
    padding: 12px 14px;
    background: #edf2f7;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #4a5568;
    border-bottom: 1px solid #e2e8f0;
}

.store-vl-scroll {
    height: min(62vh, 560px);
    min-height: 320px;
    position: relative;
}

.store-vl-scroll .vl-inner {
    width: 100%;
}

.store-vl-scroll .vl-row {
    left: 0;
    right: 0;
    border-bottom: none;
}

.store-vl-row {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr) 132px 64px;
    gap: 8px;
    align-items: center;
    height: 100%;
    padding: 0 14px;
    font-size: 0.875rem;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    box-sizing: border-box;
}

.store-vl-row:hover {
    background: #f7fafc;
}

.store-vl-cell {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.store-vl-name {
    color: #2d3748;
}

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

.store-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.store-table th,
.store-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.store-table th {
    background: #edf2f7;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #4a5568;
    white-space: nowrap;
}

.store-table tr:last-child td {
    border-bottom: none;
}

.store-table tbody tr:hover {
    background: #f7fafc;
}

.store-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 600;
}

.store-code-link {
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 600;
    color: #2b6cb0;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.store-code-link:hover {
    color: #2c5282;
}

.store-cart-pill {
    align-self: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #2d3748;
    padding: 6px 12px;
    border-radius: 999px;
    background: #edf2f7;
    border: 1px solid #e2e8f0;
}

.store-cart-count {
    display: inline-block;
    min-width: 1.25rem;
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 999px;
    background: #2b6cb0;
    color: #fff;
    font-size: 0.75rem;
    text-align: center;
}

.store-cart-count.hidden {
    display: none;
}

/* ── IMPA detail modal (centered overlay + scrollable body) ── */
.impa-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(10, 16, 30, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.impa-detail-modal.hidden {
    display: none !important;
}

.impa-detail-box,
.impa-modal-container {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 580px;
    max-height: 85vh;
    max-height: 85dvh;
    padding: 0;
    overflow: hidden;
    background: #fff;
    border: 2px solid #1a365d;
    border-radius: 14px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

.impa-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    padding: 14px 18px;
    background: linear-gradient(135deg, #1a365d 0%, #2b6cb0 100%);
    color: #fff;
    border-bottom: 1px solid #1e2d4d;
}

.impa-detail-close-btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

.impa-detail-close-float,
#modalCloseBtn {
    position: static;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: 8px;
    background: #1e293b;
    color: #fff;
    border: 1px solid #334155;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.impa-detail-close-float:hover,
.impa-detail-close-float:active,
#modalCloseBtn:hover,
#modalCloseBtn:active {
    background: #334155;
    color: #fff;
}

.modal-body,
.impa-detail-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 18px;
    background: #f7fafc;
}

.impa-detail-plate-section {
    padding: 0 0 8px;
    background: linear-gradient(180deg, #ebe4d4 0%, #f0ebe0 100%);
    border-bottom: 2px solid #1a365d;
    margin: 0 -18px 16px;
    padding: 16px 18px 8px;
}

.impa-detail-plate-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.impa-detail-plate-caption {
    margin: 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #2d3748;
    font-weight: 700;
}

.impa-detail-zoom-btn {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #2b6cb0;
    background: #fff;
    color: #1a365d;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.impa-detail-zoom-btn:hover,
.impa-detail-zoom-btn:active {
    background: #ebf8ff;
}

.impa-detail-plate-viewport {
    position: relative;
    height: min(48vh, 420px);
    min-height: 220px;
    overflow: hidden;
    touch-action: none;
    border: 2px solid #1a365d;
    background: #f8f4ea;
    box-shadow: inset 0 0 0 1px #cbd5e0, 4px 4px 0 rgba(26, 54, 93, 0.1);
    cursor: grab;
}

.impa-detail-plate-viewport.is-zoomed {
    cursor: move;
}

.impa-detail-plate-stage {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    will-change: transform;
}

.impa-detail-plate-img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.impa-detail-plate-viewport.has-photo {
    background: #0f172a;
}

.impa-detail-plate-viewport.has-photo .impa-detail-plate-img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
}

.impa-plate-fullscreen-viewport.has-photo .impa-plate-fullscreen-img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
}

.impa-detail-plate-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 16px;
    box-sizing: border-box;
}

.impa-plate-placeholder-svg {
    display: block;
    width: min(100%, 360px);
    height: auto;
}

.impa-plate-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    color: #4a5568;
}

.impa-plate-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #cbd5e0;
    border-top-color: #2b6cb0;
    border-radius: 50%;
    animation: impa-plate-spin 0.8s linear infinite;
}

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

.impa-plate-loading-text {
    margin: 0;
    font-size: 0.8125rem;
    text-align: center;
}

.impa-plate-loading-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #2b6cb0;
}

.impa-detail-plate-viewport.is-loading {
    background: #edf2f7;
}

.impa-detail-plate-fallback-msg {
    margin: 10px 0 0;
    font-size: 0.8125rem;
    color: #718096;
    text-align: center;
}

.impa-detail-plate-hint {
    margin: 8px 0 0;
    font-size: 0.6875rem;
    color: #718096;
    text-align: center;
}

.impa-detail-spec-section {
    padding: 0;
    background: transparent;
}

.impa-detail-rob-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    background: linear-gradient(90deg, #ebf8ff 0%, #e6fffa 100%);
    border: 1px solid #90cdf4;
}

.impa-detail-rob-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #2c5282;
}

.impa-detail-rob-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a365d;
}

.impa-detail-footer {
    position: sticky;
    bottom: 0;
    z-index: 11;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(247, 250, 252, 0) 0%, #f7fafc 24%, #fff 100%);
    border-top: 1px solid #e2e8f0;
}

.impa-detail-close-bottom {
    width: 100%;
    min-height: 48px;
    padding: 12px 20px;
    border-radius: 10px;
    border: 1px solid #cbd5e0;
    background: #fff;
    color: #2d3748;
    font-size: 0.9375rem;
    font-weight: 600;
}

.impa-detail-close-bottom:hover,
.impa-detail-close-bottom:active {
    background: #edf2f7;
    border-color: #a0aec0;
}

.impa-detail-box.modal-box,
.impa-modal-container.modal-box {
    padding: 0;
    overflow: hidden;
    max-width: 580px;
}

.impa-detail-head-main {
    flex: 1;
    min-width: 0;
    padding-right: 4px;
}

.impa-detail-badge {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8125rem;
    letter-spacing: 0.06em;
}

.impa-detail-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
}

.impa-detail-specs-title {
    margin: 0 0 10px;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #4a5568;
}

.impa-detail-spec-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 16px;
}

.impa-detail-spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.impa-detail-spec-table th,
.impa-detail-spec-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
}

.impa-detail-spec-table tr:last-child th,
.impa-detail-spec-table tr:last-child td {
    border-bottom: none;
}

.impa-detail-spec-table th {
    width: 42%;
    font-weight: 600;
    color: #4a5568;
    background: #f7fafc;
}

.impa-detail-spec-table td {
    color: #1a202c;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8125rem;
}

.impa-detail-cart {
    padding-top: 4px;
    border-top: 1px solid #e2e8f0;
}

.impa-detail-qty-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #4a5568;
}

.impa-detail-cart-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.impa-detail-qty {
    width: 96px;
    padding: 10px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 0.9375rem;
}

.impa-detail-cart-btn {
    flex: 1;
    min-width: 180px;
    padding: 12px 16px;
    background: #1a365d;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.impa-detail-cart-btn:hover {
    background: #2b6cb0;
}

.impa-detail-cart-msg {
    margin: 10px 0 0;
    font-size: 0.8125rem;
    color: #2f855a;
    min-height: 1.2em;
}

.impa-detail-public-cta {
    margin-top: 16px;
    padding: 0;
}

.impa-detail-public-footer {
    flex-shrink: 0;
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, #f7fafc 0%, #edf2f7 100%);
    border-top: 2px solid #2b6cb0;
    box-shadow: 0 -8px 24px rgba(26, 54, 93, 0.14);
}

.impa-detail-public-banner-text {
    margin: 0 0 12px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #2d3748;
    font-weight: 500;
    text-align: center;
}

.impa-detail-public-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.impa-lead-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.impa-lead-btn-primary {
    background: linear-gradient(135deg, #1a365d 0%, #2b6cb0 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(26, 54, 93, 0.28);
}

.impa-lead-btn-secondary {
    background: #fff;
    color: #1a365d;
    border: 2px solid #2b6cb0;
}

.impa-lead-btn:hover,
.impa-lead-btn:focus-visible {
    transform: translateY(-1px);
    outline: 2px solid #90cdf4;
    outline-offset: 2px;
}

.impa-detail-locked-preview {
    padding: 14px 16px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.impa-detail-locked-preview.hidden {
    display: none;
}

.impa-detail-locked-title {
    margin: 0 0 10px;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #4a5568;
}

.impa-locked-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    width: 100%;
    margin: 0 0 8px;
    padding: 12px 14px;
    border: 1px dashed #a0aec0;
    border-radius: 10px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.impa-locked-row:last-child {
    margin-bottom: 0;
}

.impa-locked-row:hover,
.impa-locked-row:focus-visible {
    border-color: #2b6cb0;
    box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.2);
    outline: none;
}

.impa-locked-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1a365d;
}

.impa-locked-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: #718096;
    white-space: nowrap;
}

.impa-detail-public-footer.hidden {
    display: none;
}

.impa-detail-modal-public .impa-detail-box,
.impa-detail-modal-public .impa-modal-container {
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    max-height: 85dvh;
    padding-bottom: 0;
    background: #0d1527;
    border: 1px solid #1e293b;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.impa-detail-modal-public .impa-detail-head {
    background: #131e36;
    border-bottom: 1px solid #1e2d4d;
    color: #f8fafc;
}

.impa-detail-modal-public .modal-body,
.impa-detail-modal-public .impa-detail-scroll {
    flex: 1 1 auto;
    min-height: 0;
    background: #0d1527;
    color: #e2e8f0;
}

.impa-detail-modal-public .impa-detail-footer {
    display: none;
}

.impa-detail-public-cta-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1a365d 0%, #2b6cb0 100%);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(26, 54, 93, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.impa-detail-public-cta-lead {
    font-size: 0.875rem;
    font-weight: 600;
}

.impa-detail-public-cta-action {
    font-size: 1rem;
    font-weight: 700;
}

.impa-detail-public-cta-link:hover,
.impa-detail-public-cta-link:focus-visible {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(26, 54, 93, 0.35);
    outline: 2px solid #90cdf4;
    outline-offset: 2px;
}

.store-public-mode .impa-detail-head {
    flex-shrink: 0;
}

.store-public-mode .impa-detail-rob-banner,
.store-public-mode .impa-detail-cart {
    display: none !important;
}

/* Fullscreen plate zoom overlay */
.impa-plate-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 10200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.impa-plate-fullscreen.hidden {
    display: none;
}

.impa-plate-fullscreen-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.82);
}

.impa-plate-fullscreen-panel {
    position: relative;
    z-index: 1;
    width: min(96vw, 900px);
    max-height: min(92vh, 100dvh - 24px);
    display: flex;
    flex-direction: column;
    background: #f8f4ea;
    border: 2px solid #1a365d;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.impa-plate-fullscreen-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: #1a365d;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
}

.impa-plate-fullscreen-close {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
}

.impa-plate-fullscreen-viewport {
    flex: 1;
    min-height: 280px;
    height: min(72vh, 640px);
    overflow: hidden;
    touch-action: none;
    background: #ebe4d4;
}

.impa-plate-fullscreen-stage {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    will-change: transform;
}

.impa-plate-fullscreen-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
}

.store-category {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #edf2f7;
    font-size: 0.75rem;
    color: #4a5568;
}

@media (max-width: 768px) {
    .impa-detail-modal {
        padding: 16px;
        padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
        align-items: center;
        justify-content: center;
    }

    .impa-detail-box,
    .impa-modal-container {
        width: 100%;
        max-width: 580px;
        max-height: 85vh;
        max-height: 85dvh;
        border-radius: 14px;
    }

    .impa-detail-head {
        padding: 14px 18px;
    }

    .impa-detail-plate-viewport {
        height: min(38vh, 280px);
        min-height: 180px;
    }

    .impa-plate-fullscreen {
        padding: 16px;
        align-items: center;
        justify-content: center;
    }

    .impa-plate-fullscreen-panel {
        width: 100%;
        max-width: 580px;
        max-height: 85dvh;
        border-radius: 14px;
    }

    .store-toolbar,
    .store-table-wrap,
    .store-vl-wrap,
    .store-import-panel,
    .store-cap-note {
        margin-left: 12px;
        margin-right: 12px;
    }

    .store-table th:nth-child(4),
    .store-table td:nth-child(4),
    .store-vl-unit,
    .store-vl-unit-head {
        display: none;
    }

    .store-vl-head,
    .store-vl-row {
        grid-template-columns: 96px minmax(0, 1fr) 108px;
    }
}
