/* PackPrice — printable packaging calculator UI */
:root {
    --page-pad-start: max(16px, env(safe-area-inset-left, 0px));
    --page-pad-end: max(16px, env(safe-area-inset-right, 0px));
    --page-pad-bottom: max(20px, env(safe-area-inset-bottom, 0px));
    --ink: #1c2434;
    --ink-muted: #5c6578;
    --paper: #f4efe6;
    --paper-deep: #e8dfd0;
    --card: #ffffff;
    --accent: #c45c26;
    --accent-hover: #a84d1f;
    --accent-soft: rgba(196, 92, 38, 0.12);
    --teal: #1b6b5a;
    --teal-soft: rgba(27, 107, 90, 0.1);
    --success: #1b6b5a;
    --success-bg: #e8f5f0;
    --error: #9b2c2c;
    --error-bg: #fce8e8;
    --warning: #92610a;
    --warning-bg: #fef6e4;
    --info-bg: #eef4fb;
    --border: rgba(28, 36, 52, 0.1);
    --shadow-sm: 0 1px 3px rgba(28, 36, 52, 0.06);
    --shadow-md: 0 8px 32px rgba(28, 36, 52, 0.08);
    --shadow-lg: 0 20px 50px rgba(28, 36, 52, 0.12);
    --radius: 14px;
    --radius-sm: 10px;
    --font: 'Vazirmatn', Tahoma, sans-serif;
    --transition: 0.2s ease;
    --site-header-height: 68px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: clip;
    font-family: var(--font);
    font-size: clamp(14px, 2.8vw, 15px);
    line-height: 1.7;
    color: var(--ink);
    background: var(--paper);
    display: flex;
    flex-direction: column;
}

/* Subtle print-grid background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.45;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 20%, transparent 70%);
}

body::after {
    content: '';
    position: fixed;
    top: -120px;
    right: -80px;
    width: 400px;
    height: 400px;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
}

.site-header,
.main,
.site-footer {
    position: relative;
    z-index: 1;
}

/* Header */
.site-header {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px var(--page-pad-end) 12px var(--page-pad-start);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--ink);
}

.brand__icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent) 0%, #e07a3a 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.brand__icon svg {
    width: 26px;
    height: 26px;
    fill: white;
}

.brand__text strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}

.brand__text span {
    font-size: 12px;
    color: var(--ink-muted);
    font-weight: 400;
}

/* Navigation */
.site-nav {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: flex-end;
    min-width: 0;
}

.site-nav__toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--paper);
    color: var(--ink);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.site-nav__toggle:hover {
    border-color: var(--ink-muted);
    background: white;
}

.site-nav__toggle-icon {
    width: 16px;
    height: 2px;
    background: currentColor;
    position: relative;
    border-radius: 999px;
}

.site-nav__toggle-icon::before,
.site-nav__toggle-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 16px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    transition: transform 0.2s ease, top 0.2s ease, opacity 0.2s ease;
}

.site-nav__toggle-icon::before {
    top: -5px;
}

.site-nav__toggle-icon::after {
    top: 5px;
}

.site-nav--open .site-nav__toggle-icon {
    background: transparent;
}

.site-nav--open .site-nav__toggle-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.site-nav--open .site-nav__toggle-icon::after {
    top: 0;
    transform: rotate(-45deg);
}

.site-nav__panel {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.site-nav__link,
.site-nav__trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: var(--ink-muted);
    background: transparent;
    border: 1px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
    font-family: inherit;
    cursor: pointer;
}

.site-nav__link:hover,
.site-nav__trigger:hover {
    color: var(--ink);
    background: var(--paper);
    border-color: var(--border);
}

.site-nav__link.is-active,
.site-nav__group.is-active > .site-nav__trigger {
    color: var(--ink);
    background: white;
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.site-nav__link--cta {
    color: #fff;
    background: var(--accent, #c45c26);
    border-color: var(--accent, #c45c26);
    box-shadow: 0 2px 8px rgba(196, 92, 38, 0.28);
}

.site-nav__link--cta:hover {
    color: #fff;
    background: var(--accent-hover, #a84d1f);
    border-color: var(--accent-hover, #a84d1f);
}

.site-nav__link--cta.is-active {
    color: #fff;
    background: var(--accent-hover, #a84d1f);
    border-color: var(--accent-hover, #a84d1f);
    box-shadow: 0 2px 10px rgba(196, 92, 38, 0.35);
}

.site-nav__group {
    position: relative;
}

.site-nav__chevron {
    width: 12px;
    height: 12px;
    opacity: 0.65;
    transition: transform 0.2s ease;
}

.site-nav__group:hover .site-nav__chevron,
.site-nav__group:focus-within .site-nav__chevron,
.site-nav__group.is-open .site-nav__chevron {
    transform: rotate(180deg);
}

.site-nav__menu {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-start: 0;
    min-width: 220px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 200;
}

.site-nav__group:hover .site-nav__menu,
.site-nav__group:focus-within .site-nav__menu,
.site-nav__group.is-open .site-nav__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.site-nav__menu-link {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-muted);
    text-decoration: none;
    transition: var(--transition);
}

.site-nav__menu-link:hover {
    color: var(--ink);
    background: var(--paper);
}

.site-nav__menu-link.is-active {
    color: var(--ink);
    background: var(--paper);
    font-weight: 700;
}

@media (max-width: 900px) {
    .site-header {
        overflow-x: clip;
    }

    .header-inner {
        flex-wrap: nowrap;
        gap: 12px;
    }

    .site-nav {
        flex: 0 0 auto;
    }

    .site-nav__toggle {
        display: inline-flex;
    }

    .site-nav__panel {
        position: absolute;
        top: calc(100% + 10px);
        inset-inline-end: 0;
        width: min(360px, calc(100vw - 32px));
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 10px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(14px);
        border: 1px solid var(--border);
        border-radius: 16px;
        box-shadow: var(--shadow-md);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
        max-height: calc(100dvh - 88px);
        overflow-y: auto;
    }

    .site-nav--open .site-nav__panel {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    .site-nav__link,
    .site-nav__trigger {
        width: 100%;
        justify-content: space-between;
        min-height: 44px;
    }

    .site-nav__menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 0 0 4px;
        min-width: 0;
        display: none;
    }

    .site-nav__group.is-open .site-nav__menu {
        display: block;
    }

    .site-nav__group:hover .site-nav__menu,
    .site-nav__group:focus-within .site-nav__menu {
        display: none;
    }

    .site-nav__group.is-open:hover .site-nav__menu,
    .site-nav__group.is-open:focus-within .site-nav__menu {
        display: block;
    }

    .site-nav__menu-link {
        padding-inline-start: 18px;
    }
}

@media (max-width: 768px) {
    .header-inner {
        max-width: 100%;
    }

    .brand {
        min-width: 0;
        flex: 1;
    }
}

/* Main layout */
.main {
    flex: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 28px var(--page-pad-end) calc(48px + var(--page-pad-bottom)) var(--page-pad-start);
}

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    min-width: 0;
}

.container--narrow {
    max-width: 620px;
}

.container--calculator {
    max-width: 1180px;
}

.container--wide {
    max-width: 1140px;
}

.container--faramin {
    max-width: 1280px;
}

/* Page header */
.page-header {
    text-align: center;
    margin-bottom: 28px;
}

.page-header h1 {
    margin: 0 0 8px;
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 700;
    color: var(--ink);
}

.page-header .subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--ink-muted);
    max-width: 520px;
    margin-inline: auto;
}

.page-header .badge {
    display: inline-block;
    margin-bottom: 12px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 999px;
}

/* Cards */
.card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 24px 28px;
    margin-bottom: 20px;
}

.card--flat {
    box-shadow: var(--shadow-sm);
}

.card__title {
    margin: 0 0 18px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card__title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--accent);
    border-radius: 2px;
}

.card__title--flush {
    margin-top: 0;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.form-group .hint,
.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--ink-muted);
    font-weight: 400;
    line-height: 1.6;
}

input[type="search"] {
    width: 100%;
    padding: 11px 14px;
    font-family: var(--font);
    font-size: 15px;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 11px 14px;
    font-family: var(--font);
    font-size: 15px;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

input:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--card);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn:focus-visible,
.site-nav__link:focus-visible,
.site-nav__trigger:focus-visible,
.site-nav__menu-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-soft);
}

input[readonly] {
    background: var(--paper-deep);
    cursor: default;
}

input::placeholder {
    color: #9aa3b2;
}

.form-row {
    display: grid;
    gap: 16px;
}

.form-row[hidden],
#lidPieceFields[hidden],
#dielinePieceTabsWrap[hidden] {
    display: none !important;
}

.form-row--2 { grid-template-columns: repeat(2, 1fr); }
.form-row--3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 640px) {
    .form-row--2,
    .form-row--3 {
        grid-template-columns: 1fr;
    }
}

/* Dimension inputs (calculator) */
.dim-section-lead {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.65;
    color: var(--ink-muted);
}

.dim-section-lead--compact {
    margin-bottom: 10px;
    font-size: 12px;
}

.dim-guide {
    margin-bottom: 16px;
    padding: 12px 14px;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.dim-guide__title {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);
}

.dim-guide__list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dim-guide__list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 10px;
    font-size: 12px;
    line-height: 1.5;
}

.dim-guide__key {
    flex: 0 0 auto;
    min-width: 4.5rem;
    font-weight: 700;
    color: var(--accent);
}

.dim-guide__parts {
    flex: 1 1 auto;
    color: var(--ink-muted);
}

.dim-guide__list--single li {
    justify-content: space-between;
}

.dim-guide__side {
    font-weight: 700;
    color: var(--accent);
}

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

.fixed-product-summary {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--surface-2, #f6f4f0);
    border: 1px solid rgba(27, 107, 90, 0.15);
}

.fixed-product-summary__dims {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--accent, #1b6b5a);
}

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

.dim-field {
    text-align: center;
}

.dim-field label {
    font-size: 12px;
    color: var(--ink-muted);
    margin-bottom: 6px;
}

.dim-field input {
    text-align: center;
    font-weight: 600;
    font-size: 16px;
}

.dim-field .field-hint {
    text-align: right;
    margin-top: 8px;
    font-size: 11px;
    line-height: 1.6;
}

.dim-field .field-hint strong {
    color: var(--ink);
    font-weight: 600;
}

.field-hint--inline {
    margin: 10px 0 0;
    text-align: right;
}

.field-hint--error {
    color: var(--error, #9b2c2c);
    font-weight: 500;
}

/* Box preview flow: 3D → mockup → dieline */
.box-preview-flow {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 4px 0 8px;
}

.card--preview .card__title {
    margin-bottom: 12px;
}

input:disabled {
    background: var(--paper);
    color: var(--ink-muted);
    cursor: not-allowed;
    opacity: 0.85;
}

.box-preview-panel {
    padding: 14px;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.box-preview-panel__title {
    margin: 0 0 10px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
}

.box-preview-panel__caption {
    margin: 10px 0 0;
    text-align: center;
    font-size: 12px;
    color: var(--ink-muted);
    line-height: 1.55;
}

.box-mockup-svg {
    display: block;
    width: 100%;
    height: auto;
    min-height: 160px;
    max-height: 260px;
    overflow: visible;
}

/* موکاپ سه‌بعدی CSS (غیر برداری) */
.box-scene-hint {
    margin: -4px 0 8px;
    text-align: center;
    font-size: 11px;
    color: var(--ink-muted);
}

.box-scene {
    --box-l: 72px;
    --box-w: 48px;
    --box-h: 40px;
    --tuck-t: 6px;
    --tuck-corner-r: 8px;
    perspective: 860px;
    perspective-origin: 48% 42%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 8px 6px;
    background: radial-gradient(ellipse at 50% 78%, rgba(196, 92, 38, 0.08), transparent 62%);
    border-radius: 6px;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.box-scene--dragging {
    cursor: grabbing;
}

.box-scene--empty .box-cube {
    opacity: 0.45;
    filter: saturate(0.65);
}

.box-cube {
    position: relative;
    width: var(--box-l);
    height: var(--box-h);
    transform-style: preserve-3d;
    transform: rotateX(-22deg) rotateY(-34deg);
    transition: transform 0.2s ease;
    will-change: transform;
}

.box-scene--dragging .box-cube {
    transition: none;
}

.box-cube__face {
    position: absolute;
    left: 0;
    top: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(9px, 2.2vw, 11px);
    font-weight: 700;
    color: rgba(28, 36, 52, 0.72);
    border: 1px solid rgba(28, 36, 52, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
    backface-visibility: hidden;
}

.box-cube__face span {
    pointer-events: none;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    line-height: 1.25;
    text-align: center;
}

.box-cube__face span small {
    font-size: 0.78em;
    font-weight: 600;
    color: rgba(28, 36, 52, 0.55);
}

.box-scene-reset {
    display: block;
    margin: 8px auto 0;
    padding: 6px 14px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.box-scene-reset:hover {
    border-color: var(--accent);
    background: var(--paper);
}

.box-cube__face--front {
    width: var(--box-l);
    height: var(--box-h);
    background: linear-gradient(165deg, rgba(196, 92, 38, 0.24), rgba(196, 92, 38, 0.09));
    transform: rotateY(0deg) translateZ(calc(var(--box-w) / 2));
}

.box-cube__face--back {
    width: var(--box-l);
    height: var(--box-h);
    background: linear-gradient(165deg, rgba(27, 107, 90, 0.16), rgba(27, 107, 90, 0.06));
    transform: rotateY(180deg) translateZ(calc(var(--box-w) / 2));
}

.box-cube__face--right {
    width: var(--box-w);
    height: var(--box-h);
    left: calc((var(--box-l) - var(--box-w)) / 2);
    background: linear-gradient(165deg, rgba(196, 92, 38, 0.14), rgba(196, 92, 38, 0.05));
    transform: rotateY(90deg) translateZ(calc(var(--box-l) / 2));
}

.box-cube__face--left {
    width: var(--box-w);
    height: var(--box-h);
    left: calc((var(--box-l) - var(--box-w)) / 2);
    background: linear-gradient(165deg, rgba(27, 107, 90, 0.12), rgba(27, 107, 90, 0.04));
    transform: rotateY(-90deg) translateZ(calc(var(--box-l) / 2));
}

.box-cube__face--top {
    width: var(--box-l);
    height: var(--box-w);
    top: calc((var(--box-h) - var(--box-w)) / 2);
    background: linear-gradient(145deg, rgba(160, 72, 28, 0.34), rgba(196, 92, 38, 0.16));
    transform: rotateX(90deg) translateZ(calc(var(--box-h) / 2));
}

.box-cube__face--bottom {
    width: var(--box-l);
    height: var(--box-w);
    top: calc((var(--box-h) - var(--box-w)) / 2);
    background: linear-gradient(145deg, rgba(27, 107, 90, 0.2), rgba(27, 107, 90, 0.08));
    transform: rotateX(-90deg) translateZ(calc(var(--box-h) / 2));
}

.box-cube__tuck {
    position: absolute;
    width: calc(var(--box-l) * 0.76);
    height: var(--tuck-t);
    left: 12%;
    background: linear-gradient(180deg, rgba(160, 72, 28, 0.82), rgba(196, 92, 38, 0.5));
    border: 1px solid rgba(140, 64, 24, 0.45);
    box-shadow: 0 2px 5px rgba(28, 36, 52, 0.14);
}

.box-cube__tuck--top {
    top: calc((var(--box-h) - var(--box-w)) / 2 - var(--tuck-t) + 1px);
    border-radius: var(--tuck-corner-r) var(--tuck-corner-r) 0 0;
    transform-origin: bottom center;
    transform: rotateX(90deg) translateZ(calc(var(--box-h) / 2 + var(--box-w) * 0.38)) rotateX(-58deg);
}

.box-cube__tuck--bottom {
    top: calc((var(--box-h) - var(--box-w)) / 2 + var(--box-w) - 2px);
    border-radius: 0 0 var(--tuck-corner-r) var(--tuck-corner-r);
    transform-origin: top center;
    transform: rotateX(-90deg) translateZ(calc(var(--box-h) / 2 + var(--box-w) * 0.32)) rotateX(52deg);
    background: linear-gradient(0deg, rgba(160, 72, 28, 0.78), rgba(196, 92, 38, 0.45));
}

.box-cube__lock {
    position: absolute;
    width: calc(var(--box-l) * 0.5);
    height: calc(var(--tuck-t) * 0.85);
    left: 25%;
    top: calc((var(--box-h) - var(--box-w)) / 2 + var(--box-w) * 0.55);
    background: linear-gradient(180deg, rgba(27, 107, 90, 0.55), rgba(27, 107, 90, 0.28));
    border: 1px solid rgba(27, 107, 90, 0.45);
    clip-path: polygon(0 0, 100% 0, 72% 100%, 28% 100%);
    transform: rotateX(-90deg) translateZ(calc(var(--box-h) / 2 - var(--box-w) * 0.15));
    transform-origin: top center;
}

.box-scene--mailer .box-cube__face--front {
    background: linear-gradient(165deg, rgba(196, 92, 38, 0.28), rgba(196, 92, 38, 0.1));
}

.box-scene--mailer .box-cube__face--top {
    background: linear-gradient(145deg, rgba(160, 72, 28, 0.22), rgba(196, 92, 38, 0.1));
}

.box-scene--rsc .box-cube__face--front {
    background: linear-gradient(165deg, rgba(27, 107, 90, 0.22), rgba(27, 107, 90, 0.08));
}

.box-cube__tuck--mailer.box-cube__tuck--top {
    width: calc(var(--box-l) * 0.9);
    height: var(--mailer-flap, var(--tuck-t));
    left: 5%;
    top: calc((var(--box-h) - var(--box-w)) / 2);
    border-radius: 3px 3px 8px 8px;
    background: linear-gradient(180deg, rgba(160, 72, 28, 0.88), rgba(196, 92, 38, 0.62));
    transform-origin: top center;
    transform: rotateX(90deg) translateZ(calc(var(--box-h) / 2 + 1px)) rotateX(-108deg) translateZ(calc(var(--box-w) * 0.46));
    box-shadow: 0 4px 10px rgba(28, 36, 52, 0.18);
}

.box-preview-product-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 20px 16px;
    text-align: center;
    background: var(--card);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
}

.box-preview-product-empty[hidden] {
    display: none !important;
}

.box-preview-product-empty__text {
    margin: 0;
    max-width: 28em;
    font-size: 13px;
    line-height: 1.65;
    color: var(--ink-muted);
}

.box-scene--product {
    background: radial-gradient(ellipse at 50% 78%, rgba(27, 107, 90, 0.1), transparent 62%);
}

.box-cube--textured .box-cube__face {
    color: transparent;
    border-color: rgba(28, 36, 52, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
    background-color: #e8e4df;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    overflow: hidden;
}

.box-cube--textured.is-textured-ready .box-cube__face {
    background-color: transparent;
}

.box-preview-type-badge {
    margin: 10px 0 0;
    padding: 8px 12px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
}

.dieline-panel--tuck-bottom {
    fill: rgba(196, 92, 38, 0.22);
}

.dieline-panel--bottom-lock {
    fill: rgba(27, 107, 90, 0.14);
    stroke: rgba(27, 107, 90, 0.35);
}

.dieline-panel--dust {
    fill: rgba(160, 72, 28, 0.12);
    stroke: rgba(160, 72, 28, 0.35);
}

.dieline-sheet--tuck-top-auto-lock .dieline-panel--glue {
    fill: rgba(28, 36, 52, 0.06);
}

.dieline-panel--lock {
    fill: rgba(27, 107, 90, 0.35);
    stroke: rgba(27, 107, 90, 0.5);
}

.box-mockup-face--tuck-bottom {
    fill: url(#boxMockupFront);
    opacity: 0.92;
}

.box-mockup-face--lock {
    fill: rgba(27, 107, 90, 0.4);
    stroke: rgba(27, 107, 90, 0.55);
    stroke-width: 0.4;
}

.box-scene-legend__dot--tuck2 {
    background: rgba(196, 92, 38, 0.55);
    outline: 1px dashed rgba(196, 92, 38, 0.5);
}

.box-scene-legend__dot--lock {
    background: rgba(27, 107, 90, 0.45);
}

.box-scene-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--ink-muted);
}

.box-scene-legend__dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-left: 5px;
    vertical-align: -1px;
}

.box-scene-legend__dot--top {
    background: rgba(160, 72, 28, 0.55);
}

.box-scene-legend__dot--tuck {
    background: rgba(196, 92, 38, 0.75);
}

.box-scene-legend__dot--base {
    background: rgba(27, 107, 90, 0.45);
}

.box-scene-legend__dot--tail {
    background: rgba(27, 107, 90, 0.22);
    outline: 1px solid rgba(27, 107, 90, 0.35);
}

.box-scene-legend__dot--front {
    background: rgba(196, 92, 38, 0.2);
}

.dieline-legend__swatch--side {
    background: rgba(27, 107, 90, 0.13);
    outline: 1px solid rgba(27, 107, 90, 0.45);
}

.dieline-legend__swatch--side-tuck {
    background: rgba(255, 214, 64, 0.55);
    outline: 1px solid rgba(180, 140, 20, 0.5);
}

.dieline-legend__swatch--side-lock {
    background: rgba(27, 107, 90, 0.28);
    outline: 1px solid rgba(27, 107, 90, 0.55);
}

.dieline-legend__swatch--tail {
    background: rgba(196, 92, 38, 0.14);
    outline: 1px solid rgba(28, 36, 52, 0.25);
}

.dieline-legend__swatch--door {
    background: rgba(196, 92, 38, 0.32);
    outline: 1px dashed rgba(140, 64, 24, 0.55);
}

.dieline-pairs {
    margin: 8px 0 0;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
}

.dieline-pairs--scene {
    margin-top: 10px;
}

.box-mockup-face {
    stroke: rgba(28, 36, 52, 0.35);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.box-mockup-face--ro {
    fill: url(#boxMockupTop);
}

.box-mockup-face--door {
    fill: url(#boxMockupFront);
}

.box-mockup-face--posht {
    fill: rgba(27, 107, 90, 0.12);
    stroke: var(--teal);
}

.box-mockup-face--teh {
    fill: rgba(27, 107, 90, 0.08);
    stroke: var(--teal);
}

.box-mockup-face--tuck {
    fill: rgba(160, 72, 28, 0.45);
    stroke: var(--accent);
    stroke-dasharray: 2 1.5;
}

.box-mockup-fold--tuck {
    stroke: var(--accent);
    stroke-dasharray: 3 2;
}

.box-mockup-face--front {
    fill: url(#boxMockupFront);
}

.box-mockup-face--right {
    fill: url(#boxMockupSide);
}

.box-mockup-face--left {
    fill: rgba(27, 107, 90, 0.08);
    stroke: var(--teal);
}

/* موکاپ RSC / پستی — بعد از استایل‌های عمومی تا override نشوند */
.box-mockup--rsc .box-mockup-face--top {
    fill: url(#boxMockupRscTop);
}

.box-mockup--rsc .box-mockup-face--front,
.box-mockup--rsc .box-mockup-face--back {
    fill: url(#boxMockupRscFront);
}

.box-mockup--rsc .box-mockup-face--back {
    opacity: 0.88;
}

.box-mockup--rsc .box-mockup-face--left,
.box-mockup--rsc .box-mockup-face--right {
    fill: url(#boxMockupRscSide);
}

.box-mockup--rsc .box-mockup-face--bottom {
    fill: rgba(27, 107, 90, 0.1);
    opacity: 0.75;
}

.box-mockup--mailer .box-mockup-face--top,
.box-mockup--mailer .box-mockup-face--tuck.box-mockup-face--mailer-flap {
    fill: url(#boxMockupMailerTop);
}

.box-mockup--mailer .box-mockup-face--front,
.box-mockup--mailer .box-mockup-face--back,
.box-mockup--mailer .box-mockup-face--left,
.box-mockup--mailer .box-mockup-face--right {
    fill: url(#boxMockupMailerFront);
}

.box-mockup--mailer .box-mockup-face--mailer-flap {
    opacity: 0.92;
}

.box-mockup-edge {
    stroke: var(--accent);
    stroke-width: 1.4;
    vector-effect: non-scaling-stroke;
}

.box-mockup-fold {
    stroke: rgba(28, 36, 52, 0.2);
    stroke-width: 0.8;
    stroke-dasharray: 4 3;
    vector-effect: non-scaling-stroke;
}

.box-mockup-label {
    fill: var(--ink);
    font-family: var(--font);
    font-weight: 700;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

.box-mockup-dim-leader {
    stroke: rgba(28, 36, 52, 0.28);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.box-mockup-dim {
    fill: var(--accent);
    font-family: var(--font);
    font-size: 7px;
    font-weight: 600;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
    paint-order: stroke fill;
    stroke: var(--card);
    stroke-width: 2.5px;
    stroke-linejoin: round;
}

.box-mockup-placeholder-text {
    fill: var(--ink-muted);
    font-family: var(--font);
    text-anchor: middle;
}

/* Dieline (flat pattern) preview */

.dieline-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-bottom: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.92);
}

.dieline-toolbar__toggles {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.dieline-toggle-btn {
    display: inline-flex;
    align-items: center;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.dieline-toggle-btn input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.dieline-toggle-btn__label {
    display: inline-block;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-muted);
    line-height: 1.2;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.dieline-toggle-btn:hover .dieline-toggle-btn__label {
    border-color: rgba(27, 107, 90, 0.45);
    color: var(--ink);
}

.dieline-toggle-btn input:focus-visible + .dieline-toggle-btn__label {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.dieline-toggle-btn input:checked + .dieline-toggle-btn__label {
    border-color: var(--teal);
    background: var(--teal-soft);
    color: #0f5132;
    box-shadow: var(--shadow-sm);
}

.dieline-toggle-btn--dims input:checked + .dieline-toggle-btn__label {
    border-color: #1d4ed8;
    background: rgba(29, 78, 216, 0.12);
    color: #1e3a8a;
}

.dieline-toolbar__check {
    margin: 0;
}

.dieline-toolbar__zoom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin: 0;
    font-size: 13px;
    color: var(--ink-muted);
    cursor: default;
}

.dieline-toolbar__zoom-label {
    white-space: nowrap;
}

.dieline-toolbar__zoom input[type="range"] {
    width: min(160px, 42vw);
    accent-color: var(--accent);
    cursor: pointer;
}

.dieline-toolbar__zoom-value {
    min-width: 3.2em;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--ink);
}

.dieline-preview-panel--zoomable.is-expanded .dieline-toolbar {
    flex-shrink: 0;
}

.dieline-preview-panel--zoomable.is-expanded .dieline-toolbar {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(255, 255, 255, 0.35);
}

.dieline-preview-panel--zoomable.is-expanded .dieline-toolbar__zoom-label,
.dieline-preview-panel--zoomable.is-expanded .dieline-toggle-btn__label {
    color: var(--ink-muted);
}

.dieline-preview-panel--zoomable.is-expanded .dieline-toggle-btn input:checked + .dieline-toggle-btn__label {
    color: #0f5132;
}

.dieline-preview-panel--zoomable.is-expanded .dieline-toolbar__zoom-value {
    color: #fff;
}

.dieline-preview-panel--zoomable:not(.is-expanded) .dieline-zoom-hit {
    max-height: min(72vh, 720px);
}

.dieline-preview-panel--zoomable:not([hidden]) .dieline-zoom-hit {
    cursor: zoom-in;
    border: 1px dashed rgba(27, 107, 90, 0.35);
    border-radius: var(--radius-sm);
    background: var(--paper);
    padding: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dieline-preview-panel--zoomable:not([hidden]) .dieline-zoom-hit:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(27, 107, 90, 0.12);
}

.dieline-preview-panel--zoomable.is-expanded {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin: 0;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    overflow: auto;
    cursor: zoom-out;
    background: rgba(15, 18, 24, 0.9);
    border: none;
    border-radius: 0;
    backdrop-filter: blur(4px);
}

.dieline-preview-panel--zoomable.is-expanded .box-preview-panel__title,
.dieline-preview-panel--zoomable.is-expanded .dieline-zoom-hint {
    color: rgba(255, 255, 255, 0.92);
    flex-shrink: 0;
}

.dieline-preview-panel--zoomable.is-expanded .dieline-zoom-hint {
    display: none;
}

.dieline-preview-panel--zoomable.is-expanded .dieline-zoom-hit {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: min(72vh, 720px);
    cursor: zoom-out;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.97);
    padding: 16px;
}

.dieline-preview-panel--zoomable.is-expanded .box-preview-panel__caption,
.dieline-preview-panel--zoomable.is-expanded .dieline-pairs,
.dieline-preview-panel--zoomable.is-expanded .dieline-legend {
    color: rgba(255, 255, 255, 0.88);
    flex-shrink: 0;
}

.dieline-zoom-hit {
    display: block;
    width: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    --dieline-scale: 2.5;
}

.dieline-zoom-hit:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.dieline-pattern-labels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px 16px;
    margin-top: 12px;
}

.dieline-pattern-labels-grid .form-group {
    margin-bottom: 0;
}

.admin-dieline-preview-wrap {
    margin-bottom: 20px;
}

.admin-dieline-preview-wrap--after-pattern {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border, #d8dee6);
}

.admin-dieline-preview-layout {
    display: grid;
    grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    margin-top: 12px;
}

.admin-dieline-preview-layout--full {
    grid-template-columns: minmax(0, 1fr);
}

.dieline-pattern-picker-block {
    margin-bottom: 12px;
}

.dieline-pattern-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--paper, #faf9f7);
    overflow: hidden;
}

/* پروفایل گسترده: همه مدل‌ها دیده شوند — overflow:hidden پایه قبلاً بقیه را می‌برید */
.dieline-pattern-sidebar.dieline-pattern-sidebar--inline {
    max-height: none;
    overflow: visible;
}

.dieline-pattern-sidebar__title {
    margin: 0;
    padding: 10px 12px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ink);
    background: var(--teal-soft, #e8f4f2);
    border-bottom: 1px solid var(--border);
}

.dieline-pattern-sidebar__list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 6px;
}

.dieline-pattern-sidebar--inline .dieline-pattern-sidebar__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 8px;
    padding: 10px;
}

.dieline-pattern-image-field {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.dieline-pattern-image-field__label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink-muted);
}

.dieline-pattern-image-field__preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dieline-pattern-image-field__thumb {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
}

.dieline-pattern-image-field__upload {
    cursor: pointer;
}

.admin-dieline-reference-image {
    margin: 0.75rem 0 1rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card, #fff);
    max-width: 320px;
}

.admin-dieline-reference-image__img {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: contain;
}

.admin-dieline-reference-image__caption {
    margin: 0.5rem 0 0;
}

.dieline-pattern-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--card, #fff);
    color: var(--ink);
    font: inherit;
    text-align: right;
    cursor: pointer;
    transition: var(--transition, border-color 0.15s, background 0.15s);
}

.dieline-pattern-option + .dieline-pattern-option {
    margin-top: 4px;
}

.dieline-pattern-option:hover {
    border-color: var(--border);
    background: #fff;
}

.dieline-pattern-option.is-active {
    border-color: var(--teal);
    background: var(--teal-soft, #e8f4f2);
    box-shadow: inset 3px 0 0 var(--teal);
}

.dieline-pattern-option__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
}

.dieline-pattern-option__thumb {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
}

.dieline-pattern-option__title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
}

.dieline-pattern-option:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 1px;
}

.dieline-pattern-option--card {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 10px 8px 12px;
    min-height: 132px;
}

.dieline-pattern-sidebar--inline .dieline-pattern-option + .dieline-pattern-option {
    margin-top: 0;
}

.dieline-pattern-option--card .dieline-pattern-option__body {
    align-items: center;
    width: 100%;
    margin-top: 8px;
}

.dieline-pattern-option--card .dieline-pattern-option__thumb {
    width: 100%;
    height: 72px;
}

.dieline-pattern-option__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 72px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--teal);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
}

.dieline-pattern-option--card.is-active {
    box-shadow: inset 0 -3px 0 var(--teal);
}

.dieline-pattern-option--card .dieline-pattern-option__title {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dieline-pattern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.dieline-pattern-grid__empty {
    grid-column: 1 / -1;
}

.dieline-pattern-card {
    display: flex;
    flex-direction: column;
    background: var(--card, #fff);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
}

.dieline-pattern-card:hover {
    border-color: rgba(27, 107, 90, 0.35);
    box-shadow: var(--shadow-sm);
}

.dieline-pattern-card--inactive {
    opacity: 0.78;
}

.dieline-pattern-card--frozen {
    border-color: rgba(27, 107, 90, 0.28);
    background: linear-gradient(180deg, rgba(232, 244, 242, 0.45) 0%, var(--card, #fff) 140px);
}

.dieline-pattern-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #f4f2ef;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.dieline-pattern-card__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.dieline-pattern-card__placeholder {
    color: var(--ink-muted);
    font-size: 12px;
    text-align: center;
    padding: 16px;
    line-height: 1.5;
}

.dieline-pattern-card__badges {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
    max-width: calc(100% - 16px);
}

.dieline-pattern-card__body {
    padding: 12px 14px 10px;
    flex: 1;
}

.dieline-pattern-card__label {
    width: 100%;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
}

.dieline-pattern-card__label-static {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.45;
}

.dieline-pattern-card__footer {
    padding: 0 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dieline-pattern-card__image-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.dieline-pattern-card__actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.dieline-pattern-card__hint {
    font-size: 12px;
    color: var(--ink-muted);
}

.dieline-pattern-add-form {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.dieline-pattern-add-form__title {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
}

@media (max-width: 640px) {
    .dieline-pattern-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 10px;
    }

    .dieline-pattern-sidebar--inline .dieline-pattern-sidebar__list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

.admin-dieline-preview-main {
    min-width: 0;
}

@media (max-width: 768px) {
    .admin-dieline-preview-layout {
        grid-template-columns: 1fr;
    }
}

.admin-dieline-preview-wrap .dieline-toolbar {
    margin-bottom: 10px;
}

.admin-dieline-preview {
    min-height: 200px;
    overflow: visible;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    border: 1px solid var(--border, #d8dee6);
    border-radius: 10px;
    padding: 12px;
}

.admin-dieline-zoom-hit {
    width: 100%;
    overflow: visible;
}

.admin-dieline-preview .dieline-svg {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 160px;
    display: block;
    pointer-events: none;
}

.admin-dieline-legend {
    margin-top: 8px;
    margin-bottom: 0;
}

.dieline-svg {
    display: block;
    width: calc(100% * var(--dieline-scale, 1));
    height: auto;
    min-height: 200px;
    max-height: none;
    pointer-events: none;
}

.dieline-preview-panel--zoomable.is-expanded .dieline-svg {
    min-height: min(82vh, 1400px);
    max-height: none;
    width: calc(100% * var(--dieline-scale, 1));
    margin: 0;
}

/* فقط خط دوربرش/outline و خطوط برش تکی — نه پنل‌های رنگی (جعبه ایستاده / auto-lock همهٔ پنل‌ها dieline-cut دارند) */
.dieline-svg.dieline-svg--hide-cut .dieline-outline.dieline-cut,
.dieline-svg.dieline-svg--hide-cut line.dieline-cut {
    display: none;
}

.dieline-svg.dieline-svg--hide-fold .dieline-fold,
.dieline-svg.dieline-svg--hide-fold .dieline-fold--tuck {
    display: none;
}

.dieline-svg.dieline-svg--hide-annotations .dieline-annotation,
.dieline-svg.dieline-svg--hide-annotations .dieline-dim,
.dieline-svg.dieline-svg--hide-annotations .dieline-dim-leader,
.dieline-svg.dieline-svg--hide-annotations .dieline-dim--eflute-ref,
.dieline-svg.dieline-svg--hide-annotations .dieline-piece-marker__dims,
.dieline-svg.dieline-svg--hide-annotations .dieline-piece-marker__size,
.dieline-svg.dieline-svg--hide-annotations .dieline-text-badge,
.dieline-svg.dieline-svg--hide-annotations .dieline-label,
.dieline-svg.dieline-svg--hide-annotations .dieline-waste-label {
    display: none;
}

.dieline-svg.dieline-svg--hide-piece-numbers .dieline-piece-marker__halo,
.dieline-svg.dieline-svg--hide-piece-numbers .dieline-piece-marker__bg,
.dieline-svg.dieline-svg--hide-piece-numbers .dieline-piece-marker__num {
    display: none;
}

.dieline-pieces-legend--hide-dims .dieline-pieces-legend__dims {
    display: none;
}

.dieline-pieces-legend--hide-nums .dieline-pieces-legend__num {
    display: none;
}

#dielinePairsCutLegend[hidden],
#dielinePairsFoldLegend[hidden] {
    display: none;
}

.dieline-legend__pair {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dieline-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 14px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--ink-muted);
}

.dieline-legend__swatch {
    flex-shrink: 0;
    width: 18px;
    height: 14px;
    border: 1px solid rgba(28, 36, 52, 0.2);
    border-radius: 2px;
}

.dieline-legend__swatch--cut {
    background: transparent;
    border-color: #000000;
    background-image: repeating-linear-gradient(
        90deg,
        #000000 0,
        #000000 4px,
        transparent 4px,
        transparent 7px
    );
}

.dieline-legend__swatch--fold {
    background: #dc2626;
    border-color: #dc2626;
}

.dieline-legend__swatch--roof {
    background: rgba(160, 72, 28, 0.28);
    outline: 1px solid rgba(140, 64, 24, 0.45);
}

.dieline-legend__swatch--base {
    background: rgba(196, 92, 38, 0.2);
    outline: 1px solid rgba(28, 36, 52, 0.25);
}

.dieline-legend__swatch--waste {
    flex-shrink: 0;
    width: 30px;
    height: 18px;
    border: 1px solid rgba(28, 36, 52, 0.2);
    border-radius: 3px;
    background-color: rgba(28, 36, 52, 0.06);
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 3px,
            rgba(100, 110, 130, 0.45) 3px,
            rgba(100, 110, 130, 0.45) 4px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 3px,
            rgba(100, 110, 130, 0.35) 3px,
            rgba(100, 110, 130, 0.35) 4px
        );
}

.dieline-waste-bg {
    fill: rgba(28, 36, 52, 0.07);
}

.dieline-waste-line {
    stroke: rgba(90, 100, 120, 0.55);
    stroke-width: 0.14;
    vector-effect: non-scaling-stroke;
}

.dieline-waste {
    stroke: rgba(28, 36, 52, 0.22);
    stroke-width: 0.14;
    vector-effect: non-scaling-stroke;
}

.dieline-waste-label {
    fill: rgba(28, 36, 52, 0.45);
    font-family: var(--font);
    font-weight: 600;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

.dieline-outline {
    fill: none;
    stroke: #1a2433;
    stroke-width: 0.22;
    stroke-dasharray: none;
    vector-effect: non-scaling-stroke;
}

/* خط برش — ۳px ثابت روی صفحه (با zoom دایکات) */
.dieline-svg .dieline-outline.dieline-cut,
.dieline-svg .dieline-cut--outer,
.dieline-svg line.dieline-cut {
    fill: none;
    stroke-width: 3px;
    stroke-dasharray: none;
    vector-effect: non-scaling-stroke;
}

.dieline-panel {
    stroke: #1a2433;
    stroke-width: 0.18;
    stroke-dasharray: none;
    vector-effect: non-scaling-stroke;
}

/* گسترده افقی — برش مشکی، خط تا آبی نقطه‌چین (مثل فایل فنی) */
.dieline-sheet--tuck-top-auto-lock .dieline-cut,
.dieline-sheet--tuck-top-auto-lock .dieline-panel {
    fill: rgba(28, 36, 52, 0.03);
    stroke: #1a2433;
    stroke-width: 0.22;
    stroke-dasharray: none;
    vector-effect: non-scaling-stroke;
}

.dieline-sheet--tuck-top-auto-lock .dieline-panel--base {
    fill: rgba(27, 107, 90, 0.1);
}

.dieline-sheet--tuck-top-auto-lock .dieline-panel--side {
    fill: rgba(27, 107, 90, 0.08);
}

.dieline-sheet--tuck-top-auto-lock .dieline-panel--top.dieline-panel--door,
.dieline-sheet--tuck-top-auto-lock .dieline-panel--tuck {
    fill: rgba(196, 92, 38, 0.18);
    stroke: #1a2433;
    stroke-dasharray: none;
}

.dieline-sheet--tuck-top-auto-lock .dieline-panel--dust {
    fill: rgba(160, 72, 28, 0.1);
    stroke: #1a2433;
    stroke-dasharray: none;
}

.dieline-sheet--tuck-top-auto-lock .dieline-panel--bottom-lock {
    fill: rgba(27, 107, 90, 0.12);
    stroke: #1a2433;
    stroke-dasharray: none;
}

.dieline-sheet--tuck-top-auto-lock .dieline-panel--glue {
    fill: rgba(28, 36, 52, 0.05);
    stroke: #1a2433;
    stroke-dasharray: 0.35 0.28;
}

.dieline-sheet--tuck-top-auto-lock .dieline-fold {
    stroke: #2563eb;
    stroke-width: 0.16;
    stroke-dasharray: 0.65 0.45;
    fill: none;
    vector-effect: non-scaling-stroke;
}

.dieline-sheet--tuck-top-auto-lock .dieline-fold--tuck {
    stroke: #2563eb;
    stroke-dasharray: 0.65 0.45;
}

.dieline-sheet--tuck-top-auto-lock .dieline-outline {
    stroke: #1a2433;
    stroke-width: 0.24;
    stroke-dasharray: none;
}

/* جعبه کیفی — گسترده افقی با گوسست و قفل خودکار ته */
.dieline-sheet--bag-box .dieline-cut,
.dieline-sheet--bag-box .dieline-panel {
    fill: rgba(28, 36, 52, 0.03);
    stroke: #1a2433;
    stroke-width: 0.22;
    stroke-dasharray: none;
    vector-effect: non-scaling-stroke;
}

.dieline-sheet--bag-box .dieline-panel--base {
    fill: rgba(27, 107, 90, 0.1);
}

.dieline-sheet--bag-box .dieline-panel--side,
.dieline-sheet--bag-box .dieline-panel--gusset {
    fill: rgba(27, 107, 90, 0.08);
}

.dieline-sheet--bag-box .dieline-panel--top.dieline-panel--door,
.dieline-sheet--bag-box .dieline-panel--tuck {
    fill: rgba(196, 92, 38, 0.18);
    stroke: #1a2433;
    stroke-dasharray: none;
}

.dieline-sheet--bag-box .dieline-panel--bottom-lock {
    fill: rgba(27, 107, 90, 0.12);
    stroke: none;
}

.dieline-sheet--bag-box .dieline-panel--glue {
    fill: rgba(28, 36, 52, 0.05);
    stroke: #1a2433;
    stroke-dasharray: 0.35 0.28;
}

.dieline-sheet--bag-box .dieline-cut--slit {
    stroke: #1a2433;
    stroke-width: 0.2;
    fill: none;
}

.dieline-sheet--bag-box .dieline-fold {
    stroke: #2563eb;
    stroke-width: 0.16;
    stroke-dasharray: 0.65 0.45;
    fill: none;
    vector-effect: non-scaling-stroke;
}

.dieline-sheet--bag-box .dieline-outline {
    stroke: #1a2433;
    stroke-width: 0.24;
    stroke-dasharray: none;
}

.dieline-sheet--cardboard-dieline .dieline-panel,
.dieline-sheet--cardboard-dieline .dieline-outline {
    stroke: #1a2433;
    stroke-width: 0.22;
    vector-effect: non-scaling-stroke;
}

.dieline-sheet--cardboard-dieline .dieline-fold {
    stroke: #2563eb;
    stroke-width: 0.16;
    stroke-dasharray: 0.65 0.45;
    fill: none;
    vector-effect: non-scaling-stroke;
}

/* رنگ بخش‌ها — هم‌خوان با راهنمای زیر دایکات */
.dieline-panel--roof,
.dieline-panel--top {
    fill: rgba(160, 72, 28, 0.28);
    stroke: rgba(140, 64, 24, 0.48);
}

.dieline-panel--base {
    fill: rgba(196, 92, 38, 0.2);
    stroke: #1a2433;
}

.dieline-panel--tail,
.dieline-panel--bottom {
    fill: rgba(196, 92, 38, 0.14);
    stroke: #1a2433;
}

.dieline-panel--side {
    fill: rgba(27, 107, 90, 0.13);
    stroke: rgba(27, 107, 90, 0.55);
}

.dieline-panel--tuck {
    fill: rgba(196, 92, 38, 0.26);
    stroke: rgba(140, 64, 24, 0.55);
    stroke-width: 0.12;
    stroke-dasharray: 0.35 0.25;
}

.dieline-panel--door {
    fill: rgba(196, 92, 38, 0.26);
    stroke: rgba(140, 64, 24, 0.55);
}

.dieline-panel--door.dieline-panel--tuck,
.dieline-panel--tuck.dieline-panel--door {
    fill: rgba(196, 92, 38, 0.32);
}

/* ایفلوت — بدون پس‌زمینه/پوشال سفید؛ فقط داخل خط برش */
.dieline-sheet--eflute .dieline-sheet__bg {
    display: none;
}

.dieline-svg:has(.dieline-sheet--eflute) {
    background: transparent;
}

.dieline-zoom-hit:has(.dieline-sheet--eflute) {
    background: transparent;
    border-radius: var(--radius-sm);
}

.dieline-sheet--eflute .dieline-panel--side-lock {
    fill: var(--teal-soft);
    stroke: rgba(27, 107, 90, 0.35);
}

.dieline-sheet--eflute .dieline-panel--side-tuck-flap {
    fill: var(--warning-bg);
    stroke: rgba(146, 97, 10, 0.35);
}

.dieline-sheet--eflute .dieline-panel--tuck,
.dieline-sheet--eflute .dieline-panel--door {
    fill: var(--accent-soft);
    stroke: rgba(196, 92, 38, 0.4);
}

.dieline-sheet--eflute .dieline-panel--roof,
.dieline-sheet--eflute .dieline-panel--eflute-tuck {
    fill: rgba(196, 92, 38, 0.16);
    stroke: rgba(196, 92, 38, 0.38);
}

.dieline-sheet--eflute .dieline-panel--base {
    fill: rgba(196, 92, 38, 0.12);
    stroke: rgba(196, 92, 38, 0.32);
}

.dieline-sheet--eflute .dieline-panel--tail {
    fill: rgba(232, 223, 208, 0.55);
    stroke: rgba(28, 36, 52, 0.22);
}

.dieline-sheet--eflute .dieline-panel--side {
    fill: var(--teal-soft);
    stroke: rgba(27, 107, 90, 0.32);
}

.dieline-sheet--eflute .dieline-panel--eflute-tuck-side {
    fill: rgba(27, 107, 90, 0.14);
    stroke: rgba(27, 107, 90, 0.42);
}

.dieline-sheet--eflute .dieline-panel--eflute-back-side {
    fill: rgba(27, 107, 90, 0.22);
    stroke: rgba(21, 88, 72, 0.45);
}

.dieline-sheet--eflute .dieline-panel,
.dieline-sheet--eflute path.dieline-panel {
    stroke-width: 0.5;
    vector-effect: non-scaling-stroke;
}

.dieline-sheet--eflute .dieline-fold {
    stroke: #dc2626;
    stroke-width: 1px;
    stroke-dasharray: none;
    fill: none;
    vector-effect: non-scaling-stroke;
}

.dieline-sheet--eflute .dieline-outline.dieline-cut,
.dieline-sheet--eflute .dieline-cut--outer {
    stroke: #000000;
}

.dieline-sheet--eflute .dieline-dim {
    fill: var(--ink-muted);
}

.dieline-sheet--eflute .dieline-dim-leader {
    stroke: var(--ink-muted);
}

.dieline-sheet--eflute .dieline-label--side-lock {
    fill: #155848;
    font-weight: 600;
}

.dieline-sheet--eflute .dieline-dim--eflute-ref {
    fill: #1d4ed8;
    font-weight: 700;
}

.dieline-piece-marker {
    pointer-events: none;
}

.dieline-piece-marker__halo {
    fill: rgba(255, 255, 255, 0.92);
    stroke: none;
}

.dieline-piece-marker__bg {
    fill: #1e3a8a;
    stroke: none;
}

.dieline-svg:has(.dieline-sheet--eflute) .dieline-piece-marker__bg {
    fill: var(--teal);
}

.dieline-piece-marker__num {
    fill: #ffffff;
    font-family: var(--font);
    font-weight: 800;
    text-anchor: middle;
    dominant-baseline: middle;
}

.dieline-piece-marker__size {
    font-family: var(--font);
    font-weight: 800;
    text-anchor: middle;
    dominant-baseline: middle;
    stroke: none;
    paint-order: normal;
    letter-spacing: 0.02em;
}

.dieline-piece-marker__size--on-light {
    fill: #0f172a;
}

.dieline-piece-marker__size--on-flap {
    fill: #422006;
}

.dieline-piece-marker__size--on-teal {
    fill: #064e3b;
}

.dieline-piece-marker__size--on-accent {
    fill: #7c2d12;
}

.dieline-sheet--standing-box .dieline-piece-marker__size--standing,
.dieline-sheet--tuck-top-auto-lock.dieline-sheet--standing-box .dieline-piece-marker__size--standing {
    fill: #1a2433;
    font-weight: 700;
}

.dieline-sheet--standing-box .dieline-piece-marker__bg,
.dieline-sheet--tuck-top-auto-lock.dieline-sheet--standing-box .dieline-piece-marker__bg {
    fill: #475569;
}

.dieline-sheet--standing-box .dieline-panel--glue,
.dieline-sheet--tuck-top-auto-lock.dieline-sheet--standing-box .dieline-panel--glue {
    fill: rgba(130, 136, 148, 0.42);
    stroke: rgba(95, 100, 112, 0.55);
    stroke-dasharray: none;
}

/* جعبه ایستاده — خط دور پنل‌ها خاموش؛ فقط outline برش بیرونی دیده شود */
.dieline-sheet--standing-box .dieline-panel,
.dieline-sheet--tuck-top-auto-lock.dieline-sheet--standing-box .dieline-panel {
    stroke: none;
}

.dieline-piece-marker__size--on-glue {
    fill: #2e3440;
}

.dieline-pieces-legend__swatch--glue-flap {
    background: rgba(130, 136, 148, 0.55);
    border: 1px solid rgba(95, 100, 112, 0.45);
}

.dieline-pieces-legend__dims {
    display: inline-flex;
    align-items: baseline;
    gap: 0.2rem;
    margin-right: 0.15rem;
    padding: 0.12rem 0.42rem;
    border-radius: 4px;
    background: #f1f5f9;
    border: 1px solid rgba(15, 23, 42, 0.08);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dieline-pieces-legend__dims-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f172a;
}

.dieline-pieces-legend__dims-unit {
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748b;
}

.dieline-pieces-legend {
    margin-top: 0.65rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.72);
}

.dieline-pieces-legend__title {
    margin: 0 0 0.25rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ink);
}

.dieline-pieces-legend__lead {
    margin: 0 0 0.45rem;
    font-size: 0.74rem;
    color: var(--ink-muted);
    line-height: 1.4;
}

.dieline-pieces-legend__swatch {
    display: inline-block;
    width: 0.65rem;
    height: 0.65rem;
    margin-left: 0.25rem;
    border-radius: 2px;
    vertical-align: -0.1em;
}

.dieline-pieces-legend__swatch--tuck-side {
    background: rgba(27, 107, 90, 0.28);
    outline: 1px solid rgba(27, 107, 90, 0.45);
}

.dieline-pieces-legend__swatch--back-side {
    background: rgba(27, 107, 90, 0.38);
    outline: 1px solid rgba(21, 88, 72, 0.45);
}

.dieline-pieces-legend__swatch--side-tuck-flap {
    background: rgba(255, 214, 64, 0.55);
    outline: 1px solid rgba(180, 140, 20, 0.5);
}

.dieline-pieces-legend__swatch--eflute-tuck {
    background: rgba(27, 107, 90, 0.2);
    outline: 1px solid rgba(27, 107, 90, 0.45);
}

.dieline-legend--eflute-extra {
    margin-top: 0.45rem;
    padding-top: 0.45rem;
    border-top: 1px dashed var(--border);
}

.dieline-legend__swatch--eflute-tuck-side {
    background: rgba(27, 107, 90, 0.28);
    outline: 1px solid rgba(27, 107, 90, 0.45);
}

.dieline-legend__swatch--eflute-back-side {
    background: rgba(27, 107, 90, 0.38);
    outline: 1px solid rgba(21, 88, 72, 0.45);
}

.dieline-pieces-legend__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
    gap: 0.25rem 0.65rem;
}

.dieline-pieces-legend__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem 0.35rem;
    font-size: 0.8rem;
    color: var(--ink-muted);
    line-height: 1.45;
}

.dieline-pieces-legend__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    margin-left: 0.2rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: #1e3a8a;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}

.dieline-fold--tuck {
    stroke: #2563eb;
    stroke-width: 0.14;
    stroke-dasharray: 0.55 0.4;
}

.dieline-fold {
    stroke: #2563eb;
    stroke-width: 0.14;
    stroke-dasharray: 0.6 0.42;
    fill: none;
    vector-effect: non-scaling-stroke;
}

.dieline-sheet--mailer .dieline-panel--base {
    fill: rgba(27, 107, 90, 0.16);
}

.dieline-sheet--mailer .dieline-panel--top,
.dieline-sheet--mailer .dieline-panel--bottom {
    fill: rgba(196, 92, 38, 0.14);
}

.dieline-sheet--rsc .dieline-panel--base {
    fill: rgba(27, 107, 90, 0.14);
}

.dieline-sheet--rsc .dieline-panel--top,
.dieline-sheet--rsc .dieline-panel--bottom {
    fill: rgba(160, 72, 28, 0.12);
}

.dieline-panel--glue {
    fill: rgba(196, 92, 38, 0.25);
    stroke-dasharray: 0.4 0.3;
}

.dieline-label--major {
    font-weight: 800;
    fill: rgba(120, 52, 18, 0.95);
}

.dieline-label--side {
    font-weight: 700;
    fill: rgba(21, 88, 72, 0.92);
}

.dieline-label {
    fill: var(--ink);
    font-family: var(--font);
    font-weight: 600;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
    paint-order: stroke fill;
    stroke: var(--paper);
    stroke-width: 0.28;
    stroke-linejoin: round;
}

.dieline-dim-leader {
    stroke: rgba(28, 36, 52, 0.28);
    stroke-width: 0.12;
    vector-effect: non-scaling-stroke;
}

.dieline-dim {
    fill: #1e293b;
    font-family: var(--font);
    font-weight: 700;
    text-anchor: middle;
    dominant-baseline: middle;
    stroke: none;
    paint-order: normal;
}

.dieline-dim--sheet {
    fill: #0f172a;
    font-weight: 800;
}

.dieline-placeholder-bg {
    fill: var(--card);
    stroke: var(--border);
    stroke-width: 0.5;
}

.dieline-placeholder-icon {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.2;
    opacity: 0.45;
    stroke-linejoin: round;
}

.dieline-placeholder-text {
    fill: var(--ink-muted);
    font-family: var(--font);
    text-anchor: middle;
}

/* Checkbox */
.check-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 8px 0 4px;
}

.check-group[hidden],
.field-hint--inline[hidden],
.eflute-print-options[hidden] {
    display: none !important;
}

.eflute-print-options {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
    display: grid;
    gap: 14px;
}

.eflute-print-flow-lead {
    margin: 0;
    padding: 10px 14px;
    background: rgba(27, 107, 90, 0.08);
    border: 1px solid rgba(27, 107, 90, 0.22);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--teal);
    line-height: 1.5;
}

.eflute-print-step {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--paper);
    display: grid;
    gap: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.eflute-print-step[hidden] {
    display: none !important;
}

.eflute-print-step--current {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(27, 107, 90, 0.12);
}

.eflute-print-step--done {
    border-color: rgba(34, 120, 70, 0.35);
    background: rgba(34, 120, 70, 0.04);
}

.eflute-print-step__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
}

.eflute-print-step__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.eflute-print-step--done .eflute-print-step__num {
    background: #227846;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex: 1;
    min-width: 140px;
    transition: var(--transition);
}

.check-item:hover {
    border-color: var(--accent);
    background: var(--card);
}

.check-item input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.check-item label {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    flex: 1;
}

.check-item--gold input { accent-color: #b8860b; }
.check-item--uv input { accent-color: #2980b9; }
.check-item--silk input { accent-color: #6b4c9a; }

.check-item--blocked {
    opacity: 0.55;
    cursor: not-allowed;
    border-style: dashed;
}

.check-item--blocked input {
    cursor: not-allowed;
}

.silk-screen-status {
    margin: 8px 0 0;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    line-height: 1.55;
}

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

.silk-screen-status--error {
    background: rgba(192, 57, 43, 0.08);
    border: 1px solid rgba(192, 57, 43, 0.35);
    color: #922b21;
}

.silk-screen-status--ok {
    background: rgba(27, 107, 90, 0.08);
    border: 1px solid rgba(27, 107, 90, 0.25);
    color: var(--teal);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn--block {
    display: flex;
    width: 100%;
}

.btn--primary {
    background: linear-gradient(135deg, var(--teal) 0%, #238b72 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(27, 107, 90, 0.35);
    margin-top: 8px;
}

.btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(27, 107, 90, 0.4);
}

.btn--secondary {
    background: var(--ink);
    color: white;
}

.btn--secondary:hover {
    background: #2a3548;
}

.btn--outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    width: auto;
    padding: 8px 16px;
    font-size: 13px;
}

.btn--sm {
    width: auto;
    padding: 8px 14px;
    font-size: 13px;
}

.btn--warning {
    background: #d68910;
    color: white;
    width: auto;
}

.btn--warning:hover {
    background: #b9770e;
}

.btn--danger {
    background: #c0392b;
    color: white;
    width: auto;
}

.btn--danger:hover {
    background: #a93226;
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Messages */
.message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    display: none;
}

/* پنل ادمین: پیام شناور — بدون جابه‌جایی اسکرول */
.message.message--toast {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    z-index: 2000;
    max-width: min(92vw, 520px);
    margin: 0;
    box-shadow: var(--shadow-md);
}

.message.success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(27, 107, 90, 0.2);
}

.message.error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(155, 44, 44, 0.2);
}

/* Calculator result */
.result-panel {
    margin-top: 24px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: var(--shadow-md);
}

.result-panel--error {
    background: var(--error-bg);
    border-color: rgba(155, 44, 44, 0.25);
}

.result-panel--error .result-panel__body {
    color: var(--error);
    text-align: center;
    padding: 20px;
    font-weight: 500;
}

.result-paper-order {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(27, 107, 90, 0.1) 0%, rgba(196, 92, 38, 0.06) 100%);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.result-paper-order__title {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--teal);
}

.result-paper-order__bundles {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.2;
}

.result-paper-order__prices {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--teal);
    line-height: 1.5;
}

.result-paper-order__meta {
    margin: 0 0 4px;
    font-size: 13px;
    color: var(--ink);
}

.result-paper-order__detail {
    margin: 0;
    font-size: 11px;
    line-height: 1.55;
    color: var(--ink-muted);
}

.result-hero {
    background: linear-gradient(135deg, var(--ink) 0%, #2d3a52 100%);
    color: white;
    padding: 0;
    text-align: center;
}

.result-hero--pricing {
    text-align: inherit;
}

.result-hero__grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 0;
}

.result-hero__block {
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
}

.result-hero__block:first-child {
    background: rgba(0, 0, 0, 0.08);
    border-inline-end: 1px solid rgba(255, 255, 255, 0.12);
}

.result-hero__block--total {
    background: rgba(255, 255, 255, 0.06);
}

.result-hero__block--unit {
    background: transparent;
}

.result-hero__heading {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    opacity: 0.82;
    text-transform: none;
}

.result-hero__amount {
    margin: 0;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    line-height: 1.15;
}

.result-hero__amount-num {
    font-size: clamp(1.65rem, 4.5vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.result-hero__block--total .result-hero__amount-num {
    font-size: clamp(1.85rem, 5vw, 2.6rem);
}

.result-hero__amount--unit .result-hero__amount-num {
    font-size: clamp(1.35rem, 3.5vw, 1.85rem);
    font-weight: 700;
}

.result-hero__amount-unit {
    font-size: clamp(0.9rem, 2vw, 1rem);
    font-weight: 500;
    opacity: 0.88;
}

.result-hero__meta {
    margin: 4px 0 0;
    font-size: 13px;
    opacity: 0.8;
    line-height: 1.5;
}

.result-hero__math {
    margin: 6px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 13px;
    line-height: 1.4;
}

.result-hero__math-part {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.result-hero__math-part strong {
    font-weight: 700;
    font-size: 14px;
}

.result-hero__math-part span {
    opacity: 0.85;
    font-size: 12px;
}

.result-hero__math-op {
    font-size: 16px;
    font-weight: 300;
    opacity: 0.65;
    user-select: none;
}

/* Legacy hero classes (kept for cached markup) */
.result-hero__label {
    display: block;
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 4px;
}

.result-hero__price {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.result-hero__price span {
    font-size: 0.55em;
    font-weight: 500;
    opacity: 0.9;
    margin-right: 6px;
}

.result-hero__total {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 14px;
    opacity: 0.9;
}

.result-hero__total strong {
    font-weight: 700;
}

.result-cost-breakdown {
    padding: 14px 16px;
    max-width: 100%;
    box-sizing: border-box;
    background: var(--card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.result-cost-breakdown__heading {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}

.result-cost-breakdown__lead {
    margin: 0 0 12px;
    font-size: 11px;
    line-height: 1.55;
    color: var(--ink-muted);
}

.result-cost-breakdown__lead strong {
    font-weight: 700;
    color: var(--ink);
}

.cost-breakdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 100%;
}

.cost-breakdown-list--summary {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.cost-breakdown-list__item {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--paper);
    font-size: 12px;
    max-width: 100%;
    box-sizing: border-box;
}

.cost-breakdown-list__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.cost-breakdown-list__text {
    flex: 1 1 auto;
    min-width: 0;
}

.cost-breakdown-list__amount {
    flex: 0 1 auto;
    min-width: 0;
    text-align: left;
    max-width: 52%;
}

.cost-breakdown-list__title {
    display: block;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.35;
}

.cost-breakdown-list__meta {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.45;
    color: var(--ink-muted);
    word-break: break-word;
}

.cost-line__amount {
    display: block;
    font-size: 11px;
    line-height: 1.45;
    font-weight: 600;
    color: var(--ink);
    word-break: break-word;
}

.cost-line__amount strong {
    color: var(--teal);
    font-weight: 800;
}

.cost-line__amount--na {
    color: var(--ink-muted);
    font-weight: 600;
}

.cost-line__note {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    font-weight: 400;
    color: var(--ink-muted);
}

.cost-breakdown-list__item--muted {
    opacity: 0.65;
}

.cost-breakdown-list__item--subtotal {
    background: var(--teal-soft);
    border-color: rgba(27, 107, 90, 0.25);
}

.cost-breakdown-list__item--subtotal .cost-breakdown-list__title {
    color: var(--teal);
}

.cost-breakdown-list__item--grand {
    background: linear-gradient(135deg, rgba(27, 107, 90, 0.1) 0%, rgba(196, 92, 38, 0.06) 100%);
    border-color: rgba(27, 107, 90, 0.35);
}

.cost-breakdown-list__item--grand .cost-breakdown-list__title {
    font-size: 13px;
}

@media (max-width: 520px) {
    .cost-breakdown-list__head {
        flex-direction: column;
        gap: 4px;
    }

    .cost-breakdown-list__amount {
        max-width: 100%;
        text-align: right;
    }
}

.result-details {
    padding: 20px 24px;
}

.result-footnote a {
    color: var(--teal);
    font-weight: 600;
    text-decoration: none;
}

.result-footnote a:hover {
    text-decoration: underline;
}

.result-details__title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-muted);
    margin: 0 0 14px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 16px;
}

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

.detail-item {
    font-size: 13px;
    padding: 10px 12px;
    background: var(--paper);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.detail-item strong {
    display: block;
    color: var(--ink-muted);
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 2px;
}

.detail-item span {
    font-weight: 600;
    color: var(--ink);
}

.detail-item--formula {
    grid-column: 1 / -1;
}

.detail-item--formula span {
    font-weight: 500;
    font-size: 12px;
    line-height: 1.55;
    word-break: break-word;
}

.result-footnote {
    margin: 14px 0 0;
    font-size: 12px;
    color: var(--ink-muted);
    text-align: center;
}

/* Quick links (admin prices) */
.quick-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.quick-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--info-bg);
    border: 1px solid rgba(28, 36, 52, 0.08);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--ink);
    transition: var(--transition);
}

.quick-link:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateX(-4px);
}

.quick-link strong {
    font-size: 14px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.quick-link span {
    font-size: 12px;
    color: var(--ink-muted);
    text-align: left;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.quick-link::after {
    content: '←';
    color: var(--accent);
    font-weight: 700;
}

/* Condition box */
.condition-box {
    margin-top: 8px;
    padding: 18px 20px;
    background: var(--paper);
    border: 1px dashed var(--paper-deep);
    border-radius: var(--radius-sm);
}

.condition-box .hint {
    font-size: 13px;
    color: var(--ink-muted);
    margin: 10px 0 0;
    line-height: 1.7;
    font-weight: 400;
}

/* Paper list */
.paper-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Product grid (box types) */
.product-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.product-grid__empty {
    grid-column: 1 / -1;
}

.product-grid-card {
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
}

.product-grid-card:hover {
    border-color: rgba(196, 92, 38, 0.35);
    box-shadow: var(--shadow-sm);
}

.product-grid-card--inactive {
    opacity: 0.82;
}

.product-grid-card__media {
    position: relative;
    aspect-ratio: 1;
    background: #f4f2ef;
    overflow: hidden;
}

.product-grid-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-grid-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-muted);
    font-size: 12px;
    text-align: center;
    padding: 12px;
}

.product-grid-card__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
}

.product-grid-card__badge--active {
    background: var(--success-bg);
    color: var(--success);
}

.product-grid-card__badge--inactive {
    background: var(--error-bg);
    color: var(--error);
}

.product-grid-card__category {
    position: absolute;
    right: 0;
    left: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 8px;
    background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.82) 35%);
    color: #fff;
    font-size: 11px;
    line-height: 1.35;
}

.product-grid-card__category-name {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}

.product-grid-card__category-family {
    flex-shrink: 0;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 10px;
    font-weight: 600;
}

.product-grid-card__body {
    padding: 10px 12px 12px;
    flex: 1;
    min-height: 0;
}

.product-grid-card__title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-grid-card__meta {
    margin: 4px 0 0;
    font-size: 11px;
    line-height: 1.5;
    color: var(--ink-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-grid-card__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 10px 10px;
}

.product-grid-card__btn {
    width: 100%;
    justify-content: center;
}

@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

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

.paper-item__meta {
    display: block;
    font-size: 12px;
    color: var(--ink-muted);
    margin-top: 4px;
}

.paper-item__desc {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--ink-muted);
    line-height: 1.6;
}

.paper-item__badge {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
}

.paper-item__badge--active {
    background: var(--success-bg);
    color: var(--success);
}

.paper-item__badge--inactive {
    background: var(--error-bg);
    color: var(--error);
}

.paper-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 18px;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.paper-item:hover {
    border-color: rgba(196, 92, 38, 0.3);
    box-shadow: var(--shadow-sm);
}

.paper-info {
    flex: 1;
    font-size: 14px;
    line-height: 1.75;
}

.paper-info strong {
    font-size: 15px;
    color: var(--ink);
}

.paper-info__head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.paper-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.paper-badge--active {
    background: rgba(34, 120, 70, 0.12);
    color: #1a6b3f;
}

.paper-badge--inactive {
    background: rgba(120, 120, 120, 0.15);
    color: #666;
}

.paper-item--inactive {
    opacity: 0.82;
    background: #f8f8f8;
}

.paper-meta {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--ink-muted);
}

.paper-meta__pending {
    color: var(--accent);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    align-items: center;
}

.check-item--inline {
    padding: 8px 0;
    background: transparent;
    border: none;
    cursor: pointer;
}

.paper-filters--compact {
    margin-bottom: 12px;
}

.paper-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.paper-list-header .card__title {
    margin-bottom: 0;
}

.paper-total {
    margin: 0;
    font-size: 14px;
    color: var(--ink-muted);
    line-height: 1.6;
    text-align: left;
}

.paper-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

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

.paper-filters--5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 1100px) {
    .paper-filters--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .paper-filters--5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .paper-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .paper-filters {
        grid-template-columns: 1fr;
    }
}

.paper-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.paper-pager__info {
    font-size: 14px;
    color: var(--ink-muted);
}

.paper-pager .btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.paper-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.btn--muted {
    background: #eef0f2;
    color: #4a5568;
    border: 1px solid var(--border);
}

.btn--muted:hover {
    background: #e2e6ea;
}

.btn--success {
    background: rgba(34, 120, 70, 0.14);
    color: #1a6b3f;
    border: 1px solid rgba(34, 120, 70, 0.35);
}

.btn--success:hover {
    background: rgba(34, 120, 70, 0.22);
}

.paper-actions {
    display: flex;
    gap: 8px;
}

.empty-state {
    text-align: center;
    padding: 32px 20px;
    color: var(--ink-muted);
    font-size: 14px;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 28px 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

/* Docs */
.docs-toc {
    background: var(--info-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 32px;
}

.docs-toc strong {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
}

.docs-toc a {
    display: block;
    padding: 6px 0;
    color: var(--teal);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.docs-toc a:hover {
    color: var(--accent);
}

.docs-section {
    margin-bottom: 40px;
}

.docs-section h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 14px;
    padding-right: 14px;
    border-right: 4px solid var(--accent);
}

.docs-section h3 {
    font-size: 15px;
    color: var(--ink-muted);
    margin: 18px 0 8px;
}

.formula {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin: 12px 0;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    direction: ltr;
    text-align: left;
    overflow-x: auto;
}

.formula-rtl {
    direction: rtl;
    text-align: right;
    font-family: var(--font);
}

.note {
    background: var(--warning-bg);
    border: 1px solid rgba(146, 97, 10, 0.2);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-size: 13px;
    margin: 14px 0;
    line-height: 1.7;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin: 14px 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--paper);
    font-weight: 600;
    font-size: 13px;
}

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

.data-table tr:hover td {
    background: rgba(244, 239, 230, 0.5);
}

code {
    background: var(--paper-deep);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    direction: ltr;
    display: inline-block;
    font-family: Consolas, monospace;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: var(--ink-muted);
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.6);
}

.site-footer a {
    color: var(--accent);
    text-decoration: none;
}

/* Loading state */
.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ─── Responsive (موبایل و تبلت) ─── */

/* جداول افقی در عرض کم */
.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 14px 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--card);
}

.table-scroll .data-table {
    margin: 0;
    border: none;
    border-radius: 0;
    min-width: 520px;
}

.card .table-scroll,
.docs-section .table-scroll {
    margin: 14px 0;
}

.card .data-table,
.docs-section .data-table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.card .data-table thead,
.card .data-table tbody,
.card .data-table tr,
.docs-section .data-table thead,
.docs-section .data-table tbody,
.docs-section .data-table tr {
    display: table;
    width: 100%;
    min-width: min(480px, 100%);
}

@media (max-width: 900px) {
    .container--wide,
    .container--faramin,
    .container--narrow,
    .container {
        max-width: 100%;
    }

    .page-header {
        margin-bottom: 22px;
    }

    .page-header .subtitle {
        max-width: none;
        padding-inline: 4px;
    }
}

@media (max-width: 768px) {
    .main {
        padding-top: 20px;
        padding-inline: var(--page-pad-start) var(--page-pad-end);
        padding-bottom: calc(36px + var(--page-pad-bottom));
    }

    .container,
    .container--wide,
    .container--narrow,
    .container--calculator {
        overflow-x: clip;
    }

    .card {
        padding: 20px 18px;
        margin-bottom: 16px;
        border-radius: 12px;
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    .card__title {
        font-size: 14px;
        margin-bottom: 14px;
    }

    input[type="text"],
    input[type="number"],
    input[type="email"],
    select,
    textarea {
        font-size: 16px;
        min-height: 48px;
        padding: 12px 14px;
    }

    .btn {
        min-height: 48px;
        padding: 14px 20px;
    }

    .form-actions .btn--outline,
    .form-actions .btn--sm,
    .form-actions .btn--warning,
    .form-actions .btn--danger,
    .form-actions .btn--muted,
    .form-actions .btn--success,
    .card > .btn:not([class*="btn--"]),
    .card > .btn.btn--primary {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    .btn-row .btn,
    .btn-row .btn--outline,
    .btn-row .btn--sm,
    .page-toolbar .btn,
    .page-toolbar .btn--outline,
    .page-toolbar .btn--sm,
    .fab-stack .btn {
        width: auto;
        min-height: 44px;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        width: 100%;
    }

    .check-group {
        flex-direction: column;
    }

    .check-item {
        min-width: 0;
        width: 100%;
        flex: 1 1 auto;
    }

    .quick-link {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 14px 16px;
        max-width: 100%;
    }

    .quick-link span {
        text-align: right;
    }

    .quick-link::after {
        display: none;
    }

    .paper-list-header {
        flex-direction: column;
        align-items: stretch;
    }

    .paper-total {
        text-align: right;
    }

    .paper-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .paper-actions {
        width: 100%;
        flex-direction: column;
    }

    .paper-actions .btn {
        width: 100%;
    }

    .paper-pager {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .paper-pager .btn {
        width: auto;
        flex: 0 1 auto;
        min-width: 7rem;
    }

    .result-hero {
        padding: 0;
    }

    .result-hero__grid {
        grid-template-columns: 1fr;
    }

    .result-hero__block:first-child {
        border-inline-end: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .result-hero__block--total {
        border-bottom: none;
    }

    .result-hero__block {
        padding: 18px 16px;
    }

    .result-details {
        padding: 16px;
    }

    .box-preview-panel {
        padding: 12px 10px;
    }

    .box-mockup-svg {
        min-height: 140px;
        max-height: min(42vh, 240px);
    }

    .dieline-svg {
        min-height: 180px;
        max-height: min(50vh, 320px);
    }

    .box-scene {
        min-height: 180px;
        perspective: 640px;
    }

    .docs-toc {
        padding: 16px 18px;
    }

    .docs-toc a {
        padding: 8px 0;
        min-height: 36px;
        display: flex;
        align-items: center;
    }

    .formula {
        font-size: 12px;
        padding: 12px 14px;
    }

    .site-footer {
        padding: 16px var(--page-pad-end) calc(16px + env(safe-area-inset-bottom, 0px)) var(--page-pad-start);
        line-height: 1.65;
    }

    .container > .btn {
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .main {
        padding-top: 16px;
    }

    .card {
        padding: 16px 14px;
    }

    .page-header h1 {
        font-size: 1.25rem;
    }

    .brand__text strong {
        font-size: 15px;
    }

    .brand__icon {
        width: 40px;
        height: 40px;
    }

    .dim-field input {
        font-size: 18px;
    }

    .box-preview-flow {
        gap: 12px;
        margin-bottom: 8px;
    }

    .box-preview-panel__title {
        font-size: 12px;
    }

    .box-preview-panel__caption,
    .box-scene-hint,
    .dieline-legend,
    .box-scene-legend {
        font-size: 11px;
    }

    .dieline-legend {
        gap: 6px 10px;
    }

    .detail-item {
        padding: 8px 10px;
        font-size: 12px;
    }

    .message {
        font-size: 13px;
    }

    .condition-box {
        padding: 14px;
    }
}

@media (max-width: 360px) {
    .site-nav__link,
    .site-nav__trigger {
        font-size: 12px;
        padding: 8px 12px;
    }

    .result-hero__amount-num {
        font-size: 1.5rem;
    }

    .result-hero__block--total .result-hero__amount-num {
        font-size: 1.65rem;
    }
}

@media (hover: none) and (pointer: coarse) {
    .btn--primary:hover,
    .quick-link:hover {
        transform: none;
    }

    .site-nav__link,
    .site-nav__trigger {
        min-height: 44px;
    }

    .box-scene {
        touch-action: none;
        cursor: grab;
    }

    .box-scene--dragging {
        cursor: grabbing;
    }
}

/* Category menu (calculator) */
.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.order-mode-wrap {
    margin-bottom: 16px;
}

.order-mode-wrap--primary {
    padding: 12px 14px;
    margin-bottom: 18px;
    border-radius: 12px;
    background: rgba(27, 107, 90, 0.08);
    border: 1px solid rgba(27, 107, 90, 0.22);
}

.order-mode-wrap--primary .order-mode__item {
    font-size: 14px;
}

.order-mode {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.order-mode__item {
    flex: 1 1 200px;
    min-height: 44px;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.order-mode__item:hover {
    border-color: var(--teal);
    background: rgba(27, 107, 90, 0.06);
}

.order-mode__item.is-active {
    border-color: var(--teal);
    background: rgba(27, 107, 90, 0.12);
    box-shadow: 0 0 0 1px var(--teal);
}

.order-mode__item:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}

.category-menu-wrap {
    margin-bottom: 14px;
}

.category-menu {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 0;
    margin: 0;
}

.category-menu__empty {
    margin: 0;
    padding: 12px 14px;
    font-size: 13px;
    color: var(--ink-muted);
    background: var(--paper);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
    width: 100%;
    text-align: center;
}

.category-menu__item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 48px;
    padding: 10px 12px;
    border: 1.5px solid rgba(196, 92, 38, 0.28);
    border-radius: 10px;
    background: linear-gradient(180deg, #fff 0%, var(--paper) 100%);
    color: var(--ink);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
    white-space: normal;
    word-break: break-word;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.category-menu__item:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.category-menu__item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.category-menu__item.is-active {
    background: linear-gradient(145deg, var(--accent) 0%, #a84a1f 100%);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 6px 18px rgba(196, 92, 38, 0.38);
    transform: none;
}

.category-menu__item:active:not(.is-active) {
    transform: scale(0.98);
}

.category-menu__item.is-active .category-menu__count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.category-menu__item--disabled,
.category-menu__item:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    border-style: dashed;
    background: #f6f4f1;
    box-shadow: none;
    transform: none;
}

.category-menu__item--disabled:hover,
.category-menu__item:disabled:hover {
    border-color: rgba(196, 92, 38, 0.28);
    background: #f6f4f1;
    transform: none;
}

.category-menu__count--empty {
    opacity: 0.7;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Calculator product picker grid */
.calc-product-picker {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.calc-product-grid__empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--ink-muted);
    background: var(--paper);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
}

.calc-product-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--paper);
    overflow: hidden;
    cursor: pointer;
    text-align: inherit;
    font-family: var(--font);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.calc-product-card:hover {
    border-color: rgba(196, 92, 38, 0.45);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.calc-product-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.calc-product-card.is-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm);
}

.calc-product-card__media {
    display: block;
    aspect-ratio: 1;
    background: #f4f2ef;
    overflow: hidden;
}

.calc-product-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.calc-product-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--ink-muted);
}

.calc-product-card__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px 10px;
}

.calc-product-card__title {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.calc-product-card__meta {
    font-size: 11px;
    color: var(--ink-muted);
}

@media (max-width: 1100px) {
    .calc-product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .calc-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .calc-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

.category-menu__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    background: var(--paper-deep);
    color: var(--ink-muted);
}

.product-image-admin {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
}

.product-image-admin__img {
    max-width: 200px;
    max-height: 160px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--paper);
}

.paper-item__thumb {
    display: block;
    margin-top: 8px;
    max-width: 120px;
    max-height: 80px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.product-picker {
    display: grid;
    grid-template-columns: minmax(140px, 220px) 1fr;
    gap: 16px;
    align-items: start;
}

.product-picker__media {
    min-width: 0;
}

.product-picker__form .form-group {
    margin-bottom: 0;
}

.product-picker--no-media {
    grid-template-columns: 1fr;
}

.product-picker__media[hidden] {
    display: none !important;
}

.product-image-panel {
    margin: 0;
    padding: 12px;
    text-align: center;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.product-image-panel--zoomable:not([hidden]) {
    cursor: zoom-in;
}

.product-image-panel--zoomable.is-expanded {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    cursor: zoom-out;
    background: rgba(15, 18, 24, 0.88);
    border: none;
    border-radius: 0;
    backdrop-filter: blur(4px);
}

body.product-image-zoom-open,
body.dieline-zoom-open {
    overflow: hidden;
}

.product-image-panel--placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 140px;
    color: var(--ink-muted);
    border-style: dashed;
    background: linear-gradient(160deg, var(--paper) 0%, var(--card) 100%);
}

.product-image-panel--placeholder span {
    font-size: 13px;
    font-weight: 600;
}

.product-image-panel--placeholder small {
    font-size: 11px;
    opacity: 0.85;
    text-align: center;
    line-height: 1.5;
    padding-inline: 8px;
}

.product-image-panel__img {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: min(38vh, 240px);
    margin: 0 auto;
    object-fit: contain;
    pointer-events: none;
}

.product-image-panel.is-expanded .product-image-panel__img {
    max-width: min(96vw, 1100px);
    max-height: min(92vh, 900px);
    width: auto;
    height: auto;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
    border-radius: var(--radius-sm);
}

.product-image-panel__caption {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--ink-muted);
}

.card--product-picker .card__title {
    margin-bottom: 12px;
}

#catalogProductSummaryStep2 {
    margin-top: 12px;
}

#boxPreviewMountStep2 .card--preview {
    margin-top: 12px;
}

.order-mode-placement-above-preview {
    margin-bottom: 12px;
}

.order-mode-placement-above-preview .order-mode-block__card {
    margin-bottom: 0;
}

.order-mode-block__card .card__title--sm {
    margin-bottom: 10px;
    font-size: 13px;
}

.calc-step .calc-wizard__footer {
    margin-bottom: 12px;
}

@media (max-width: 900px) {
    .category-menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .category-menu__item {
        min-height: 44px;
        font-size: 11px;
        padding: 8px 10px;
    }
}

@media (max-width: 768px) {
    .product-picker {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .product-picker__media {
        order: -1;
    }

    .product-image-panel__img {
        max-height: min(42vh, 260px);
    }

    .product-image-panel--placeholder {
        min-height: 120px;
    }
}

/* ——— Calculator wizard ——— */
.calc-wizard {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.calc-stepper {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 4px;
    padding: 0;
}

.calc-stepper__item.is-wizard-skipped,
.calc-stepper__item[hidden],
.order-glance__step.is-wizard-skipped,
.order-glance__step[hidden] {
    display: none !important;
}

.calc-stepper__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.calc-stepper__item:disabled {
    cursor: default;
    opacity: 0.55;
}

.calc-stepper__item:not(:disabled):hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.calc-stepper__item.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 2px 10px rgba(196, 92, 38, 0.15);
}

.calc-stepper__item.is-active.is-advanceable {
    cursor: pointer;
}

.calc-stepper__item.is-active.is-advanceable:hover {
    border-color: var(--teal);
    background: var(--teal-soft);
    box-shadow: 0 2px 12px rgba(27, 107, 90, 0.18);
}

.calc-stepper__item.is-active.is-advanceable:hover .calc-stepper__num {
    background: var(--teal);
}

.calc-stepper__item.is-done {
    border-color: rgba(27, 107, 90, 0.35);
    background: var(--success-bg);
}

.calc-stepper__item.is-done .calc-stepper__num {
    background: var(--teal);
    color: #fff;
}

.calc-stepper__num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: var(--paper-deep);
    color: var(--ink-muted);
}

.calc-stepper__item.is-active .calc-stepper__num {
    background: var(--accent);
    color: #fff;
}

.calc-stepper__label {
    font-size: 10px;
    font-weight: 700;
    color: var(--ink);
    text-align: center;
    line-height: 1.3;
}

.calc-wizard__panels {
    min-height: 120px;
}

.calc-wizard:not(.is-ready) .calc-wizard__panels {
    opacity: 0.92;
}

.calc-wizard.is-ready .calc-wizard__panels {
    opacity: 1;
}

.calc-step[hidden] {
    display: none !important;
}

.wizard-step-lead {
    margin: 0 0 14px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--ink-muted);
    background: var(--paper);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.card--wizard-step {
    margin-bottom: 14px;
}

.card--wizard-step:last-child {
    margin-bottom: 0;
}

.wizard-qty-block {
    margin-top: 16px;
    margin-bottom: 0;
}

.calc-wizard__footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px 0 4px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

.calc-wizard__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    max-width: 320px;
    margin-inline: auto;
}

.calc-wizard__next,
.calc-wizard__prev {
    width: 100%;
    min-height: 44px;
    margin-top: 0;
}

.calc-wizard__next {
    order: 1;
}

.calc-wizard__prev {
    order: 2;
    background: var(--card);
    color: var(--ink-muted);
    border: 1px solid var(--border);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.calc-wizard__prev:hover:not(:disabled) {
    color: var(--teal);
    border-color: rgba(27, 107, 90, 0.35);
    background: var(--teal-soft);
    transform: none;
}

.calc-wizard__prev:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.calc-wizard__error {
    width: 100%;
    margin: 0;
}

.calc-stepper__item:not(:disabled) {
    cursor: pointer;
}

.calc-wizard__error {
    margin: 0;
    padding: 8px 12px;
    font-size: 12px;
    color: #b42318;
    background: #fef3f2;
    border-radius: var(--radius-sm);
    text-align: center;
}

.calc-wizard__error[hidden] {
    display: none;
}

.calc-wizard__footer--on-result .calc-wizard__next {
    display: none !important;
}

@media (max-width: 640px) {
    .calc-stepper {
        gap: 4px;
    }

    .calc-stepper__label {
        font-size: 8px;
    }

    .calc-stepper__num {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }

    .calc-stepper__item {
        padding: 6px 2px;
    }
}

@media (max-width: 520px) {
    .calc-stepper__label {
        font-size: 7px;
    }

    .calc-stepper__item {
        padding: 8px 2px;
    }
}

/* ——— Customer calculator dashboard (at-a-glance) ——— */
.calc-dashboard {
    display: grid;
    grid-template-columns: minmax(280px, 340px) 1fr;
    gap: 24px;
    align-items: start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

@media (min-width: 961px) {
    .order-glance--sidebar {
        grid-column: 1;
        grid-row: 1;
    }

    .calc-workspace {
        grid-column: 2;
        grid-row: 1;
    }
}

.order-glance {
    position: relative;
}

.order-glance__sticky {
    position: sticky;
    top: 88px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-glance--ready .order-glance__sticky {
    border-color: rgba(27, 107, 90, 0.35);
    box-shadow: 0 12px 40px rgba(27, 107, 90, 0.12);
}

.order-glance__price {
    text-align: center;
    padding: 16px 14px;
    border-radius: var(--radius-sm);
    background: linear-gradient(145deg, var(--ink) 0%, #2a3548 100%);
    color: #fff;
}

.order-glance__price-label {
    display: block;
    font-size: 12px;
    opacity: 0.85;
    margin-bottom: 4px;
}

.order-glance__price-value {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 800;
    line-height: 1.25;
}

.order-glance__price-main {
    letter-spacing: -0.02em;
}

.order-glance__price-currency {
    display: block;
    font-size: 0.5em;
    font-weight: 500;
    opacity: 0.85;
    margin-top: 2px;
}

.order-glance__price-value span {
    display: block;
    font-size: 0.55em;
    font-weight: 500;
    opacity: 0.85;
    margin-top: 2px;
}

.order-glance__price-total {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 12px;
    line-height: 1.5;
    opacity: 0.92;
}

.order-glance__price-formula {
    display: block;
}

.order-glance__price-formula strong {
    font-weight: 700;
}

.order-glance__steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-glance__step {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 8px 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--paper);
    border: 1px solid var(--border);
    font-size: 12px;
    transition: var(--transition);
}

.order-glance__step.is-done {
    background: var(--success-bg);
    border-color: rgba(27, 107, 90, 0.2);
}

.order-glance__step.is-done .order-glance__step-icon {
    background: var(--teal);
    color: #fff;
}

.order-glance__step-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    background: var(--paper-deep);
    color: var(--ink-muted);
    flex-shrink: 0;
}

.order-glance__step-text {
    font-weight: 600;
    color: var(--ink);
}

.order-glance__step-val {
    grid-column: 2 / -1;
    font-size: 11px;
    color: var(--ink-muted);
    text-align: start;
    line-height: 1.4;
    word-break: break-word;
}

.order-glance__tech {
    padding: 12px;
    background: var(--info-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.order-glance__tech-title {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.order-glance__tech-list {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.order-glance__tech-list div {
    text-align: center;
}

.order-glance__tech-list dt {
    font-size: 10px;
    color: var(--ink-muted);
    margin: 0 0 2px;
}

.order-glance__tech-list dd {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);
}

.order-glance__cta {
    margin-top: 4px;
}

.order-glance__cta:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.order-glance__note {
    margin: 0;
    font-size: 11px;
    color: var(--ink-muted);
    text-align: center;
    line-height: 1.5;
}

.calc-workspace {
    min-width: 0;
}

.calc-workspace .card--compact {
    padding: 18px 22px;
    margin-bottom: 16px;
}

.calc-workspace .card--compact .card__title {
    margin-bottom: 14px;
    font-size: 14px;
}

.calc-workspace .dim-grid {
    gap: 12px;
}

.card--materials .form-group {
    margin-bottom: 0;
}

.result-panel--workspace {
    margin-top: 0;
}

/* Pre-invoice share icon buttons */
.pi-share-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.pi-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border, #d8dce6);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    color: var(--ink, #1c2434);
    font: inherit;
    line-height: 0;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.pi-share-btn:hover {
    background: #f4f6fa;
    border-color: #b8c0d0;
    transform: translateY(-1px);
}

.pi-share-btn:active {
    transform: translateY(0);
}

.pi-share-btn--toolbar {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

.pi-share-btn--toolbar:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
}

.pi-share-icon {
    width: 22px;
    height: 22px;
    display: block;
    object-fit: contain;
    pointer-events: none;
}

.result-actions--share {
    margin: 8px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.result-actions--share .result-actions__label {
    font-size: 13px;
    color: var(--ink-muted, #5c6578);
    font-weight: 600;
}

.result-preinvoice {
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border, #d8dce6);
    border-radius: 12px;
    background: linear-gradient(135deg, #faf8f4 0%, #f4f0e8 100%);
}

.result-preinvoice__head {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink, #1c2434);
}

.result-preinvoice__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.result-panel--awaiting {
    border-style: dashed;
    background: var(--paper);
}

.result-panel__body--placeholder {
    padding: 28px 20px;
    text-align: center;
    color: var(--ink-muted);
}

.result-panel__body--placeholder p {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.6;
}

.result-panel__body--placeholder small {
    display: block;
    font-size: 12px;
    opacity: 0.9;
}

/* Preview tabs */
.preview-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    padding: 4px;
    background: var(--paper);
    border-radius: 999px;
    border: 1px solid var(--border);
}

.preview-tabs__btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 12px;
    border-radius: 999px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-muted);
    cursor: pointer;
    transition: var(--transition);
}

.preview-tabs__btn:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.7);
}

.preview-tabs__btn.is-active {
    background: var(--card);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.preview-tabs:not([hidden]) + .box-preview-flow .box-preview-panel:not(.is-tab-active):not([hidden]) {
    display: none;
}

@media (max-width: 960px) {
    .calc-dashboard {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .order-glance--sidebar {
        order: 2;
    }

    .calc-workspace {
        order: 1;
    }

    .order-glance__sticky {
        position: relative;
        top: 0;
    }

    .order-glance__steps {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .order-glance__step {
        grid-template-columns: 24px 1fr;
    }

    .order-glance__step-val {
        grid-column: 2;
    }
}

@media (max-width: 768px) {
    .calc-workspace,
    .calc-wizard {
        max-width: 100%;
        min-width: 0;
        overflow-x: clip;
    }

    .calc-dashboard {
        max-width: 100%;
        min-width: 0;
    }

    .order-glance--sidebar {
        display: none;
    }

    .calc-wizard__footer {
        margin-top: 20px;
        padding: 4px 0 12px;
        border-top: none;
    }

    .calc-wizard__actions {
        max-width: 300px;
    }

    .calc-wizard__next,
    .calc-wizard__next--calculate {
        min-height: 48px;
        font-size: 15px;
        font-weight: 700;
        touch-action: manipulation;
    }

    .calc-wizard__prev {
        min-height: 44px;
        touch-action: manipulation;
    }

    .calc-step .calc-wizard__footer {
        margin-top: 18px;
        padding-top: 16px;
        border-top: 1px dashed var(--border);
    }

    .calc-stepper {
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        padding-bottom: 2px;
    }

    .calc-stepper__item {
        scroll-snap-align: start;
    }

    .preview-tabs {
        flex-wrap: wrap;
        border-radius: var(--radius-sm);
    }

    .preview-tabs__btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    .box-preview-panel,
    .result-panel,
    .result-panel__body {
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-x: contain;
    }

    .box-mockup-svg,
    .dieline-svg,
    .box-scene {
        max-width: 100%;
    }
}

@media (max-width: 380px) {
    .calc-stepper__label {
        display: none;
    }

    .calc-stepper__item {
        padding: 8px 4px;
    }

    .calc-wizard__next,
    .calc-wizard__prev {
        width: 100%;
        max-width: none;
    }
}

/* ——— Single-page calculator (continuous form) ——— */
.calc-dashboard--single-page {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
}

.calc-wizard--single-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.calc-form-sheet {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.calc-wizard__panels--single {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.calc-wizard--single-page .calc-step--single {
    scroll-margin-top: 88px;
}

.calc-wizard--single-page .calc-step--single > .card,
.calc-wizard--single-page .calc-step--single > .card--flat {
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    border-bottom: 1px solid var(--border);
}

.calc-wizard--single-page .calc-step--single:last-of-type > .card:last-of-type,
.calc-wizard--single-page .calc-step--single:last-of-type > .card--flat:last-of-type {
    border-bottom: none;
}

.calc-wizard--single-page .calc-step--single .card__title {
    font-size: 1.02rem;
    margin-bottom: 10px;
}

.calc-wizard--single-page .wizard-step-lead,
.calc-wizard--single-page .dim-section-lead {
    margin-bottom: 12px;
}

.calc-wizard--single-page .wizard-footer-slot {
    display: none;
}

.calc-wizard--single-page #boxPreviewMountStep4,
.calc-wizard--single-page #boxPreviewMountStep5 {
    padding: 0 16px 16px;
    border-bottom: 1px solid var(--border);
}

.calc-wizard--single-page .fixed-product-summary {
    padding: 0 16px 12px;
    border-bottom: 1px solid var(--border);
}

.calc-wizard--single-page .is-field-error input,
.calc-wizard--single-page .is-field-error select,
.calc-wizard--single-page .is-field-error textarea {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.14);
}

.calc-wizard--single-page .is-field-error .order-mode,
.calc-wizard--single-page .is-field-error .category-menu,
.calc-wizard--single-page .is-field-error .calc-product-grid,
.calc-wizard--single-page .is-field-error .material-family {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
    border-radius: calc(var(--radius) - 2px);
}

.calc-wizard--single-page .is-field-error .check-item {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
    border-radius: 8px;
}

.calc-field-error-msg {
    color: #dc2626;
    font-size: 0.8125rem;
    margin: 8px 0 0;
    font-weight: 600;
    line-height: 1.45;
}

.calc-single-page-footer-slot {
    position: sticky;
    bottom: 0;
    z-index: 11;
    padding-top: 8px;
    background: linear-gradient(to top, var(--bg) 70%, transparent);
}

.calc-wizard__footer--single {
    position: relative;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow-lg);
}

.calc-wizard__footer--single .calc-wizard__actions {
    justify-content: stretch;
}

.calc-wizard__footer--single .calc-wizard__next {
    width: 100%;
    max-width: none;
}

.calc-wizard__footer--single .calc-wizard__error {
    margin-bottom: 10px;
}

.page-header__meta {
    margin-top: 8px;
    font-size: 0.875rem;
}

.page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.page-header__actions .btn {
    min-width: 9rem;
}

.page-header__meta .text-link {
    color: var(--primary);
    text-decoration: none;
}

.page-header__meta .text-link:hover {
    text-decoration: underline;
}

@media (max-width: 960px) {
    .calc-dashboard--single-page {
        grid-template-columns: 1fr;
    }
}

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

    .order-glance__tech-list {
        grid-template-columns: 1fr;
    }

    .order-glance__tech-list div {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: start;
    }
}

/* ─── Shared admin / utility ─── */
.card__header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.card__header-row .card__title {
    margin-bottom: 0;
}

.badge--muted {
    color: var(--ink-muted);
    background: var(--paper);
    border: 1px solid var(--border);
}

.u-mt-sm { margin-top: 8px; }
.u-mt-md { margin-top: 16px; }

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* ─── فرامین رییس ─── */
.faramin-layout {
    display: grid;
    gap: 1.25rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.stat-card {
    padding: 0.9rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: linear-gradient(180deg, var(--card) 0%, var(--paper) 100%);
}

.stat-card__label {
    font-size: 0.82rem;
    color: var(--ink-muted);
    margin-bottom: 0.25rem;
}

.stat-card__value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--teal);
}

.page-toolbar {
    position: sticky;
    top: calc(var(--site-header-height) + 8px);
    z-index: 30;
    padding: 1rem 1.15rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(8px);
}

.page-toolbar__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 0.85rem;
    align-items: center;
}

.page-toolbar__row + .page-toolbar__row {
    margin-top: 0.65rem;
}

.page-toolbar__search {
    flex: 1 1 240px;
    min-width: min(100%, 200px);
}

.page-toolbar__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
    align-items: center;
    font-size: 0.9rem;
}

.page-toolbar__filters label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    white-space: nowrap;
}

.page-toolbar__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(27, 107, 90, 0.25);
    background: var(--teal-soft);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
}

.page-toolbar__status {
    margin: 0.65rem 0 0;
    font-size: 0.88rem;
    color: var(--ink-muted);
}

.segment-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.segment-tabs button {
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 999px;
    padding: 0.4rem 0.95rem;
    font-size: 0.88rem;
    font-family: inherit;
    font-weight: 600;
    color: var(--ink-muted);
    cursor: pointer;
    transition: var(--transition);
}

.segment-tabs button:hover {
    border-color: var(--accent);
    color: var(--ink);
}

.segment-tabs button.is-active {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 0.85rem;
    font-size: 1.05rem;
}

.faramin-command-list {
    display: grid;
    gap: 0.65rem;
}

.faramin-command {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    overflow: hidden;
    transition: box-shadow var(--transition);
    scroll-margin-top: calc(var(--site-header-height) + 80px);
}

.faramin-command.is-latest {
    border-color: var(--teal);
    box-shadow: 0 0 0 1px var(--teal-soft);
}

.faramin-command.is-search-hit {
    box-shadow: 0 0 0 2px var(--warning);
}

.faramin-command.is-hidden,
.faramin-chat.is-hidden,
.is-hidden {
    display: none !important;
}

.faramin-command__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
    padding: 0.55rem 0.85rem;
    background: var(--teal-soft);
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
}

.faramin-command__num {
    font-weight: 800;
    color: var(--teal);
    min-width: 2.5rem;
}

.faramin-command__badge {
    font-size: 0.72rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

.faramin-command__meta {
    color: var(--ink-muted);
}

.faramin-command__time {
    direction: ltr;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.75rem;
}

.faramin-command__body {
    margin: 0;
    padding: 0.85rem 0.95rem;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.85;
    font-size: 0.93rem;
}

.faramin-command__link {
    font-size: 0.8rem;
    color: var(--teal);
    text-decoration: none;
    font-weight: 600;
}

.faramin-command__link:hover {
    color: var(--accent);
    text-decoration: underline;
}

.faramin-chats {
    display: grid;
    gap: 0.85rem;
}

.faramin-chat {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card);
    scroll-margin-top: calc(var(--site-header-height) + 24px);
}

.faramin-chat__summary {
    list-style: none;
    cursor: pointer;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, var(--paper) 0%, var(--card) 100%);
    border-bottom: 1px solid transparent;
    transition: background var(--transition);
}

.faramin-chat__summary:hover {
    background: var(--paper-deep);
}

.faramin-chat__summary::-webkit-details-marker {
    display: none;
}

.faramin-chat[open] .faramin-chat__summary {
    border-bottom-color: var(--border);
}

.faramin-chat__title {
    font-weight: 700;
    margin: 0 0 0.35rem;
    font-size: 0.98rem;
}

.faramin-chat__meta {
    font-size: 0.84rem;
    color: var(--ink-muted);
    line-height: 1.6;
}

.faramin-chat__meta code {
    font-size: 0.78rem;
}

.faramin-chat__log {
    display: grid;
    gap: 0.65rem;
    padding: 0.85rem;
}

.chat-bubble {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.chat-bubble--user {
    border-inline-end: 4px solid var(--teal);
}

.chat-bubble--assistant {
    border-inline-end: 4px solid var(--accent);
    background: var(--paper);
}

.chat-bubble.is-search-hit {
    box-shadow: 0 0 0 2px var(--warning);
}

.chat-bubble__head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    align-items: center;
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
    background: var(--paper);
    border-bottom: 1px solid var(--border);
}

.chat-bubble--user .chat-bubble__head {
    background: var(--teal-soft);
}

.chat-bubble__role {
    font-weight: 700;
}

.chat-bubble__time {
    direction: ltr;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.75rem;
    color: var(--ink-muted);
}

.chat-bubble__body {
    margin: 0;
    padding: 0.75rem 0.9rem;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.8;
    font-size: 0.92rem;
    max-height: 28rem;
    overflow: auto;
}

.chat-bubble__body mark,
.faramin-command__body mark {
    background: #ffeb3b;
    color: inherit;
    padding: 0 0.1em;
    border-radius: 2px;
}

.fab-stack {
    position: fixed;
    inset-inline-start: max(1rem, env(safe-area-inset-left, 0px));
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.fab-stack .btn {
    width: auto;
    box-shadow: var(--shadow-md);
}

@media (max-width: 640px) {
    .faramin-command__head {
        font-size: 0.78rem;
    }

    .page-toolbar {
        padding: 0.85rem;
    }

    .segment-tabs {
        width: 100%;
    }

    .segment-tabs button {
        flex: 1 1 auto;
        text-align: center;
        padding-inline: 0.5rem;
    }
}

/* Prices dashboard */
.prices-dashboard {
    margin-top: 8px;
}

.prices-dashboard__meta {
    font-size: 13px;
    color: var(--ink-muted);
    margin: 0 0 20px;
}

.prices-dashboard__quick-links {
    margin-bottom: 24px;
}

.prices-dashboard__section-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--ink);
}

.prices-dashboard__hint {
    font-size: 13px;
    color: var(--ink-muted);
    margin: 0 0 14px;
}

.prices-dashboard__grid {
    margin-bottom: 28px;
}

.prices-dashboard__grid--two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.prices-dashboard__grid--papers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.prices-dashboard__card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
}

.prices-dashboard__card--wide {
    grid-column: 1 / -1;
}

.prices-dashboard__card-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--ink);
}

.prices-dashboard__edit {
    font-size: 12px;
    margin: 12px 0 0;
}

.prices-dashboard__edit a {
    color: var(--teal);
    font-weight: 600;
    text-decoration: none;
}

.prices-dashboard__edit a:hover {
    text-decoration: underline;
}

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

.prices-dashboard__card--die {
    text-align: center;
    padding: 18px 12px;
    background: linear-gradient(180deg, var(--info-bg) 0%, var(--surface) 100%);
}

.prices-dashboard__die-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-muted);
    margin-bottom: 8px;
}

.prices-dashboard__die-value {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.2;
}

.prices-dashboard__die-unit {
    font-size: 12px;
    color: var(--ink-muted);
}

.data-table--compact {
    font-size: 13px;
    margin: 8px 0;
}

.data-table--compact th,
.data-table--compact td {
    padding: 8px 10px;
}

@media (max-width: 900px) {
    .prices-dashboard__grid--two-col,
    .prices-dashboard__grid--papers,
    .prices-dashboard__die-cut-cards {
        grid-template-columns: 1fr;
    }
}
