.intake-body .shell-main {
    padding-top: 1.5rem;
}

.intake-stack {
    display: grid;
    gap: 0.85rem;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.intake-source-panel {
    padding: 1.5rem;
}

.source-layout {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.source-list-card {
    border: 1px solid var(--shell-border);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    padding: 1.25rem;
}

.source-search-wrap {
    margin-top: 1rem;
}

.source-search {
    width: 100%;
    padding: 0.95rem 1rem;
    border: 1px solid var(--shell-border);
    border-radius: 12px;
    background: var(--shell-surface);
}

.source-search:focus {
    border-color: var(--shell-accent);
    outline: none;
}

.source-list-label,
.step-label-title,
.panel-label,
.category-label,
.section-label {
    color: var(--shell-text-muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.source-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.source-item {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    border: 1px solid var(--shell-border);
    border-radius: 16px;
    background: var(--shell-surface-2);
    padding: 1rem;
    cursor: pointer;
    text-align: left;
    transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.source-item:hover {
    background: #f7fbff;
    border-color: var(--shell-border-strong);
    transform: translateY(-1px);
}

.source-item-content {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
    text-align: left;
}

.source-item-name {
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-align: left;
}

.source-item-meta,
.source-hint,
.source-help-copy,
.step-label-copy,
.scan-hint,
.product-hint,
.cart-subtitle,
.line-subtext,
.camera-hint,
.camera-status,
.summary-note {
    color: var(--shell-text-dim);
    font-size: 0.9rem;
    text-align: left;
}

.source-item-default {
    display: inline-flex;
    margin-left: 0.45rem;
    padding: 0.16rem 0.45rem;
    border-radius: 999px;
    background: var(--shell-accent-soft);
    color: var(--shell-accent-strong);
    font-size: 0.72rem;
    font-weight: 800;
}

.source-item-arrow {
    color: var(--shell-accent-strong);
    font-size: 0.9rem;
    font-weight: 800;
    justify-self: end;
    white-space: nowrap;
}

.source-footer {
    margin-top: 1rem;
}

.scanner-layout {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
}

.step-panel,
.cart-panel,
.summary-panel {
    border: 1px solid var(--shell-border);
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    box-shadow: var(--shell-shadow);
}

.step-panel {
    overflow: hidden;
}

.step-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--shell-border);
    padding: 1rem 1.25rem;
    background: rgba(248, 251, 255, 0.9);
}

.step-dot {
    width: 0.78rem;
    height: 0.78rem;
    border-radius: 999px;
    background: var(--shell-surface-3);
}

.step-dot.active {
    background: var(--shell-accent);
}

.step-dot.done {
    background: var(--shell-success);
}

.step-label {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-left: 0.2rem;
}

.step-container {
    min-height: 620px;
}

.step {
    display: none;
}

.step.active {
    display: block;
}

.step-content {
    padding: 1.25rem;
}

.step-footer {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    border-top: 1px solid var(--shell-border);
    padding: 1rem 1.25rem;
    background: rgba(248, 251, 255, 0.92);
}

.step-footer .shell-button,
.step-footer .shell-button-secondary {
    min-width: 10rem;
}

.scan-section {
    display: grid;
    gap: 1rem;
}

.scan-methods {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: minmax(0, 1fr) auto;
}

.scan-input-wrap {
    display: flex;
    gap: 0.75rem;
}

.scan-input,
.tag-codes-input,
.category-search-input,
.form-input,
.manual-search-input {
    width: 100%;
    padding: 1rem 1rem;
    border: 1px solid var(--shell-border);
    border-radius: 14px;
    background: var(--shell-surface);
    color: var(--shell-text);
}

.scan-input {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.scan-input:focus,
.tag-codes-input:focus,
.category-search-input:focus,
.form-input:focus,
.manual-search-input:focus {
    border-color: var(--shell-accent);
    outline: none;
}

.btn-lookup,
.btn-camera,
.btn-no-barcode,
.btn-record,
.cart-toggle,
.qty-btn,
.qty-preset,
.unit-btn,
.tag-btn,
.category-btn,
.miss-tab,
.miss-option,
.btn-back-to-suggestions,
.modal-close {
    border: 1px solid var(--shell-border);
    border-radius: 14px;
    background: var(--shell-surface);
    color: var(--shell-text);
    font-weight: 700;
}

.btn-lookup,
.btn-camera {
    min-height: 3.2rem;
    padding: 0.85rem 1rem;
}

.btn-lookup {
    background: var(--shell-accent);
    border-color: var(--shell-accent);
    color: #fff;
}

.btn-camera {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.2rem;
}

.btn-camera svg {
    width: 1.3rem;
    height: 1.3rem;
}

.scan-divider {
    color: var(--shell-text-muted);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.btn-no-barcode {
    padding: 1rem 1rem;
    text-align: left;
}

.product-header {
    display: grid;
    gap: 0.75rem;
}

.product-state {
    display: none;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid var(--shell-border);
    border-radius: 999px;
    padding: 0.55rem 0.85rem;
    width: fit-content;
    font-size: 0.9rem;
    font-weight: 800;
}

.product-state.found {
    background: var(--shell-success-soft);
    color: var(--shell-success);
}

.product-state.notfound {
    background: var(--shell-warning-soft);
    color: var(--shell-warning);
}

.product-state.noupc {
    background: var(--shell-accent-soft);
    color: var(--shell-accent-strong);
}

.product-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    font-size: 0.74rem;
    font-weight: 800;
}

.product-info {
    border: 1px solid var(--shell-border);
    border-radius: 18px;
    background: var(--shell-surface-2);
    padding: 1rem;
    margin-top: 1rem;
}

.product-name-text {
    margin-top: 0.35rem;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.product-source-badge {
    display: none;
    width: fit-content;
    margin-top: 0.8rem;
    padding: 0.34rem 0.6rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
}

.product-source-badge.local {
    background: var(--shell-success-soft);
    color: var(--shell-success);
}

.product-source-badge.api {
    background: var(--shell-accent-soft);
    color: var(--shell-accent-strong);
}

.product-meta-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-top: 1rem;
}

.product-meta-item,
.record-summary-item,
.cart-chip,
.summary-stat {
    border: 1px solid var(--shell-border);
    border-radius: 14px;
    background: #fff;
    padding: 0.85rem;
}

.product-meta-label,
.record-summary-label,
.cart-chip-label,
.summary-stat-label {
    color: var(--shell-text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.product-meta-value,
.record-summary-value,
.cart-chip-value,
.summary-stat-value {
    margin-top: 0.35rem;
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.category-search-panel {
    margin-top: 1rem;
}

.category-search-results {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.8rem;
}

.category-search-result {
    border: 1px solid var(--shell-border);
    border-radius: 14px;
    background: var(--shell-surface);
    padding: 0.85rem 0.95rem;
    cursor: pointer;
    text-align: left;
}

.category-search-result:hover {
    border-color: var(--shell-border-strong);
    background: #f7fbff;
}

.category-search-result-title {
    font-size: 0.94rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.category-search-result-meta {
    margin-top: 0.22rem;
    color: var(--shell-text-dim);
    font-size: 0.86rem;
}

.category-section,
.miss-picker {
    margin-top: 1rem;
}

.category-grid,
.miss-options,
.qty-presets,
.unit-grid,
.tags-grid {
    display: grid;
    gap: 0.75rem;
}

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

.category-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 4rem;
    padding: 0.75rem;
    text-align: center;
    font-size: 0.92rem;
}

.category-btn.selected,
.qty-preset.active,
.unit-btn.selected,
.tag-btn.selected,
.miss-option.selected {
    background: var(--shell-accent);
    border-color: var(--shell-accent);
    color: #fff;
}

.category-btn.see-all {
    background: var(--shell-surface-2);
}

.category-grid-wrapper,
.miss-picker-inline-wrapper {
    display: none;
}

.category-grid-wrapper.active,
.miss-picker-inline-wrapper.active {
    display: block;
}

.btn-back-to-suggestions {
    width: 100%;
    padding: 0.85rem;
    margin-bottom: 0.75rem;
}

.miss-tabs {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 0.75rem;
}

.miss-tab {
    padding: 0.85rem 0.8rem;
    text-align: left;
}

.miss-tab.active,
.miss-tab.done {
    border-color: var(--shell-border-strong);
    background: var(--shell-surface-2);
}

.miss-tab-label {
    display: block;
    color: var(--shell-text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.miss-tab-value {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

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

.miss-option {
    padding: 0.95rem 0.9rem;
    text-align: left;
}

.qty-unit-section,
.step4-content {
    display: grid;
    gap: 1rem;
}

.qty-section,
.unit-section,
.tags-section,
.record-summary {
    border: 1px solid var(--shell-border);
    border-radius: 18px;
    background: var(--shell-surface-2);
    padding: 1rem;
}

.qty-controls {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    margin-top: 0.9rem;
}

.qty-btn {
    width: 3rem;
    height: 3rem;
}

.qty-display {
    border: 1px solid var(--shell-border);
    border-radius: 14px;
    background: #fff;
    padding: 0.85rem 1rem;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.05em;
}

.qty-presets,
.unit-grid,
.tags-grid {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    margin-top: 0.9rem;
}

.qty-preset,
.unit-btn,
.tag-btn {
    padding: 0.85rem 0.8rem;
    min-height: 3rem;
}

.tag-codes-row {
    display: none;
    margin-top: 0.9rem;
}

.tag-codes-row.visible {
    display: block;
}

.record-summary-title {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.record-summary-name {
    margin-top: 0.35rem;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.record-summary-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    margin-top: 1rem;
}

.btn-record {
    min-height: 3.25rem;
    background: var(--shell-accent);
    border-color: var(--shell-accent);
    color: #fff;
}

.cart-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-header,
.cart-footer {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--shell-border);
}

.cart-footer {
    border-top: 1px solid var(--shell-border);
    border-bottom: none;
    margin-top: auto;
}

.cart-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.cart-toggle {
    padding: 0.55rem 0.8rem;
}

.cart-totals {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 1rem 1.1rem;
}

.cart-section {
    padding: 0 1.1rem 1rem;
}

.cart-session-section {
    padding-top: 0.9rem;
}

.cart-session-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cart-session-card {
    border: 1px solid var(--shell-border);
    border-radius: 14px;
    background: var(--shell-surface-2);
    padding: 0.8rem 0.85rem;
}

.cart-session-value {
    margin-top: 0.35rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--shell-text);
}

.cart-last,
.cart-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.cart-row,
.summary-item-card {
    display: grid;
    gap: 0.45rem;
    border: 1px solid var(--shell-border);
    border-radius: 12px;
    background: var(--shell-surface-2);
    padding: 0.7rem 0.85rem;
}

.cart-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
}

.cart-row-name,
.summary-item-title {
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.cart-row-qty,
.summary-item-qty {
    font-size: 0.88rem;
    font-weight: 800;
    white-space: nowrap;
}

.cart-row-time {
    color: var(--shell-text-dim);
    font-size: 0.82rem;
    white-space: nowrap;
}

.cart-empty {
    padding: 1rem;
    border: 1px dashed var(--shell-border);
    border-radius: 14px;
    background: var(--shell-surface-2);
    color: var(--shell-text-dim);
    text-align: center;
}

.cart-panel.collapsed .cart-totals,
.cart-panel.collapsed .cart-section,
.cart-panel.collapsed .cart-footer {
    display: none;
}

.summary-panel {
    padding: 1.5rem;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.summary-stats {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 1.25rem;
}

.summary-content {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.4fr);
    margin-top: 1.5rem;
}

.summary-section {
    display: grid;
    gap: 0.75rem;
}

.summary-section-header {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--shell-border);
    border-radius: 14px;
    background: var(--shell-surface-2);
    padding: 0.9rem 1rem;
}

.summary-row-name {
    font-weight: 800;
}

.summary-row-value {
    color: var(--shell-text-dim);
    font-size: 0.9rem;
    text-align: right;
}

.summary-items-list {
    display: grid;
    gap: 0.6rem;
}

.summary-item-grid {
    display: grid;
    gap: 0.6rem;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.summary-item-detail {
    border: 1px solid var(--shell-border);
    border-radius: 10px;
    background: #fff;
    padding: 0.55rem 0.7rem;
}

.summary-item-detail-label {
    color: var(--shell-text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.summary-item-detail-value {
    margin-top: 0.2rem;
    font-size: 0.84rem;
    font-weight: 700;
}

.summary-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.modal-backdrop,
.camera-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 36, 0.52);
    z-index: 80;
    padding: 1rem;
}

.modal-backdrop.active,
.camera-modal.active {
    display: flex;
}

.modal,
.camera-shell {
    width: min(100%, 520px);
    border: 1px solid var(--shell-border);
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--shell-shadow);
    overflow: hidden;
}

.camera-shell {
    width: min(100%, 760px);
}

.modal-header,
.modal-footer,
.camera-header,
.camera-footer {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--shell-border);
}

.modal-footer,
.camera-footer {
    border-top: 1px solid var(--shell-border);
    border-bottom: none;
}

.modal-title,
.camera-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.modal-close {
    width: 2.2rem;
    height: 2.2rem;
}

.modal-body,
.camera-body {
    padding: 1rem 1.1rem;
}

.form-grid {
    display: grid;
    gap: 0.9rem;
}

.form-row {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.form-label {
    color: var(--shell-text-dim);
    font-size: 0.84rem;
    font-weight: 700;
}

.camera-shell #scanner-container {
    position: relative;
    min-height: 360px;
    border-radius: 18px;
    overflow: hidden;
    background: #0b1220;
}

.scanner-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.scanner-frame {
    width: min(86%, 320px);
    height: 180px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 18px;
    box-shadow: 0 0 0 999px rgba(15, 23, 36, 0.35);
}

.scanner-line {
    position: absolute;
    width: min(80%, 280px);
    height: 2px;
    background: #58a6ff;
    animation: scanline 2.2s linear infinite;
}

.camera-status {
    margin-top: 0.85rem;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translateX(-50%) translateY(18px);
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    border-radius: 999px;
    background: rgba(15, 23, 36, 0.96);
    color: #fff;
    padding: 0.85rem 1.15rem;
    font-size: 0.92rem;
    font-weight: 700;
    transition: opacity 150ms ease, transform 150ms ease;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: rgba(15, 138, 95, 0.96);
}

.toast.error {
    background: rgba(191, 49, 72, 0.96);
}

@keyframes scanline {
    0% {
        transform: translateY(-70px);
    }

    50% {
        transform: translateY(70px);
    }

    100% {
        transform: translateY(-70px);
    }
}

@media (max-width: 1180px) {
    .intake-hero,
    .scanner-layout,
    .summary-content,
    .source-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .cart-session-grid,
    .category-grid,
    .miss-tabs,
    .miss-options,
    .summary-stats,
    .form-row {
        grid-template-columns: 1fr;
    }

    .scan-methods,
    .scan-input-wrap,
    .step-footer,
    .summary-footer {
        grid-template-columns: 1fr;
        display: grid;
    }

    .scan-methods {
        grid-template-columns: 1fr;
    }

    .step-footer .shell-button,
    .step-footer .shell-button-secondary,
    .summary-footer .shell-button,
    .summary-footer .shell-button-secondary {
        width: 100%;
    }
}
