/* 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));

    /* سبز مریم */
    --sage-50: #f0f4eb;
    --sage-100: #e3ead9;
    --sage-200: #c8d4b8;
    --sage-300: #a8b896;
    --sage-400: #8a9d74;
    --sage-500: #6b8260;
    --sage-600: #566a4d;
    --sage-700: #44543e;
    --sage-800: #354233;

    /* بژ ماشه‌ای */
    --sand-50: #faf8f4;
    --sand-100: #f4efe6;
    --sand-200: #e8dfd0;
    --sand-300: #d9ccb5;
    --sand-400: #c4b49a;

    --ink: #2c3229;
    --ink-muted: #5a6356;
    --paper: var(--sand-100);
    --paper-deep: var(--sand-200);
    --card: #fdfcf9;
    --accent: var(--sage-500);
    --accent-hover: var(--sage-600);
    --accent-light: var(--sage-400);
    --accent-soft: rgba(107, 130, 96, 0.14);
    --teal: var(--sage-600);
    --teal-soft: rgba(86, 106, 77, 0.12);
    --success: var(--sage-600);
    --success-bg: var(--sage-50);
    --error: #9b4a4a;
    --error-bg: #f9eded;
    --warning: #8a6b3a;
    --warning-bg: #f9f3e6;
    --info-bg: var(--sage-50);
    --border: rgba(44, 50, 41, 0.1);
    --border-strong: rgba(44, 50, 41, 0.18);
    --shadow-sm: 0 1px 3px rgba(44, 50, 41, 0.06);
    --shadow-md: 0 8px 28px rgba(44, 50, 41, 0.07);
    --shadow-lg: 0 20px 48px rgba(44, 50, 41, 0.1);
    --shadow-sage: 0 4px 16px rgba(86, 106, 77, 0.22);
    --radius: 14px;
    --radius-sm: 10px;
    --font: 'Vazirmatn', Tahoma, sans-serif;
    --transition: 0.2s ease;
    --transition-slow: 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    --site-header-height: 76px;
    --focus-ring: 0 0 0 3px var(--accent-soft);
    --touch-min: 44px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--site-header-height) + 12px);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

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, rgba(168, 184, 150, 0.22) 0%, transparent 70%);
}

/* دسترسی‌پذیری — پرش به محتوا */
.skip-link {
    position: absolute;
    top: -100px;
    inset-inline-start: var(--page-pad-start);
    z-index: 10000;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--sage-600);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 12px;
    outline: none;
    box-shadow: var(--focus-ring), var(--shadow-md);
}

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

/* بنر تازگی قیمت (ادمین) */
.pricing-freshness-banner {
    background: var(--warning-bg);
    color: var(--warning);
    padding: 10px 16px;
    text-align: center;
    font-size: 13px;
    line-height: 1.55;
    border-bottom: 1px solid rgba(138, 107, 58, 0.22);
}

.pricing-freshness-banner a {
    margin-inline-start: 8px;
    font-weight: 700;
    color: var(--sage-700);
    text-decoration: none;
}

.pricing-freshness-banner a:hover {
    text-decoration: underline;
}

/* بنر پیگیری روزانه (پنل) */
.follow-up-banner {
    background: #e8f4fd;
    color: #0d47a1;
    padding: 10px 16px;
    text-align: center;
    font-size: 13px;
    line-height: 1.55;
    border-bottom: 1px solid rgba(13, 71, 161, 0.18);
}

.follow-up-banner a {
    margin-inline-start: 8px;
    font-weight: 700;
    color: var(--sage-700);
    text-decoration: none;
}

.follow-up-banner a:hover {
    text-decoration: underline;
}

.follow-up-banner__overdue {
    color: #c62828;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.follow-up-banner__overdue:hover {
    color: #b71c1c;
}

.follow-up-overdue-alert {
    margin-bottom: 1rem;
    padding: 12px 16px;
    border: 1px solid rgba(198, 40, 40, 0.35);
    border-radius: 8px;
    background: #ffebee;
    color: #b71c1c;
}

.follow-up-overdue-alert strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.follow-up-overdue-alert p {
    margin: 0;
    line-height: 1.55;
}

.follow-up-overdue-alert .field-hint {
    margin-top: 6px;
    color: #c62828;
}

.follow-up-overdue-alert__list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.follow-up-overdue-alert__link {
    display: block;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(198, 40, 40, 0.25);
    background: rgba(255, 255, 255, 0.55);
    color: #b71c1c;
    text-decoration: none;
    line-height: 1.5;
}

.follow-up-overdue-alert__link:hover {
    background: #fff;
    border-color: rgba(198, 40, 40, 0.45);
}

.follow-up-overdue-alert__kind,
.follow-up-overdue-alert__meta,
.follow-up-overdue-alert__date {
    display: inline-block;
    margin-inline-start: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.follow-up-overdue-alert__date {
    color: #c62828;
}

.follow-up-group-card--overdue {
    border-color: rgba(198, 40, 40, 0.35);
}

.follow-up-group-card--overdue .follow-up-group-card__title {
    color: #b71c1c;
}

.follow-up-task--overdue {
    scroll-margin-top: 96px;
    border-inline-start: 3px solid #c62828;
    padding-inline-start: 10px;
}

.follow-up-task--overdue:target {
    background: #fff8f8;
    box-shadow: inset 0 0 0 1px rgba(198, 40, 40, 0.2);
}

.follow-up-dialog__form {
    min-width: min(420px, 92vw);
    max-width: 520px;
}

@media (max-width: 480px) {
    .follow-up-dialog__form {
        min-width: 0;
    }
}

.follow-up-next-date {
    cursor: pointer;
}

.follow-up-dialog jdp-container {
    font-family: Vazirmatn, Tahoma, sans-serif;
}

.follow-up-history {
    margin: 0.75rem 0 0;
    padding: 0.75rem;
    background: var(--surface-muted, #f6f7f8);
    border-radius: 8px;
}

.follow-up-history__title {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
}

.follow-up-history__list {
    margin: 0;
    padding-right: 1.1rem;
    font-size: 0.88rem;
    line-height: 1.6;
}

.follow-up-history__date {
    color: var(--text-muted, #666);
    font-size: 0.82rem;
}

.follow-up-close-lost {
    margin-top: 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--border-muted, #e0e3e7);
    border-radius: 8px;
    background: var(--surface-muted, #f6f7f8);
}

.follow-up-close-lost__label {
    margin: 0 0 0.5rem;
    font-weight: 600;
    font-size: 0.92rem;
}

.follow-up-close-lost__options {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.follow-up-close-lost__option {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    font-size: 0.9rem;
    line-height: 1.5;
    cursor: pointer;
}

.follow-up-close-lost__option input {
    margin-top: 0.25rem;
    flex-shrink: 0;
}

/* کارهای امروز — صفحه */
.follow-up-summary-card {
    margin-bottom: 1rem;
}

.follow-up-summary-card__body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
}

.follow-up-summary-card__stat {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
}

.follow-up-summary-card__count {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--sage-700);
}

.follow-up-summary-card__count--empty {
    color: var(--ink-muted);
    font-weight: 700;
}

.follow-up-summary-card__label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
}

.follow-up-summary-card__overdue {
    font-size: 0.875rem;
    font-weight: 700;
    color: #c62828;
}

.follow-up-summary-card__hint {
    margin: 0;
    max-width: 420px;
}

.follow-up-group-card {
    margin-top: 1rem;
}

.follow-up-group-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 12px;
}

.follow-up-group-card__title {
    margin: 0;
}

.follow-up-group-card__count {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-muted);
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 10px;
}

.follow-up-task-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.follow-up-task {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    box-shadow: var(--shadow-sm);
}

.follow-up-task__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 4px;
}

.follow-up-task__name {
    font-size: 1rem;
    color: var(--ink);
}

.follow-up-task__kind {
    font-size: 11px;
    font-weight: 700;
    color: var(--sage-700);
    background: var(--sage-50);
    border: 1px solid rgba(107, 130, 96, 0.22);
    border-radius: 999px;
    padding: 2px 8px;
}

.follow-up-task__phone {
    margin-bottom: 2px;
}

.follow-up-task__meta,
.follow-up-task__detail {
    font-size: 0.875rem;
    color: var(--ink-muted);
}

.follow-up-task__hint {
    margin: 8px 0 0;
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--ink);
}

.follow-up-task__status {
    margin-top: 6px;
    font-size: 0.8125rem;
    color: var(--ink-muted);
}

.follow-up-task__actions {
    flex: 0 0 auto;
    min-width: min(100%, 220px);
}

.follow-up-task__actions .order-btn-bar {
    min-width: 200px;
}

.follow-up-empty-card {
    margin-top: 1rem;
}

@media (max-width: 640px) {
    .follow-up-task {
        flex-direction: column;
    }

    .follow-up-task__actions,
    .follow-up-task__actions .order-btn-bar {
        width: 100%;
        min-width: 0;
    }
}

/* Header */
.site-header {
    background: rgba(253, 252, 249, 0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(232, 223, 208, 0.6);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

/* پروفایل کاربر — کنار منو، بدون به‌هم‌ریختن چیدمان */
.panel-profile {
    position: relative;
    flex-shrink: 0;
    margin-inline-start: 12px;
}

.panel-profile--stale {
    flex-shrink: 0;
    margin-inline-start: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--warning-bg);
    color: var(--warning);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.panel-profile--stale:hover {
    text-decoration: none;
    border-color: rgba(138, 107, 58, 0.35);
}

.panel-profile__trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--ink);
    font-family: inherit;
    cursor: pointer;
    max-width: 160px;
}

.panel-profile__trigger:hover .panel-profile__avatar,
.panel-profile.is-open .panel-profile__avatar {
    box-shadow: 0 0 0 2px rgba(86, 106, 77, 0.25);
}

.panel-profile__avatar,
.panel-profile__menu-avatar {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(145deg, var(--sage-500) 0%, var(--sage-400) 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: box-shadow var(--transition);
}

.panel-profile__menu-avatar {
    width: 48px;
    height: 48px;
}

.panel-profile__avatar-initials {
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.panel-profile__menu-avatar .panel-profile__avatar-initials {
    font-size: 18px;
}

.panel-profile__avatar-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.panel-profile__trigger-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 96px;
}

.panel-profile__menu {
    position: absolute;
    top: calc(100% + 10px);
    inset-inline-end: 0;
    width: min(300px, calc(100vw - 24px));
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-md);
    z-index: 120;
}

.panel-profile__menu-head {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.panel-profile__menu-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.panel-profile__menu-name {
    font-size: 14px;
    line-height: 1.35;
}

.panel-profile__menu-role {
    font-size: 12px;
    color: var(--ink-muted);
}

.panel-profile__menu-username {
    font-size: 11px;
    color: var(--ink-muted);
    opacity: 0.85;
}

.panel-profile__avatar-upload {
    display: block;
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--sage-700);
    cursor: pointer;
}

.panel-profile__avatar-upload:hover {
    text-decoration: underline;
}

.panel-profile__status {
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.45;
}

.panel-profile__status.is-error {
    background: var(--error-bg, rgba(180, 70, 70, 0.08));
    color: var(--error, #b44646);
}

.panel-profile__status.is-success {
    background: rgba(86, 106, 77, 0.08);
    color: var(--sage-700);
}

.panel-profile__form .form-group {
    margin-bottom: 10px;
}

.panel-profile__form .form-group label {
    font-size: 12px;
    margin-bottom: 4px;
}

.panel-profile__form + .panel-profile__form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.panel-profile__section-title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-muted);
}

.panel-profile__logout {
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.panel-profile__logout-link {
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--error, #b44646);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}

.panel-profile__logout-link:hover {
    text-decoration: underline;
}

.panel-profile__avatar-input {
    display: none;
}

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

.brand__icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(145deg, var(--sage-500) 0%, var(--sage-400) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sage);
    flex-shrink: 0;
    transition: transform var(--transition), box-shadow var(--transition);
}

.brand:hover .brand__icon {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(86, 106, 77, 0.28);
}

.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: 2px;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.site-nav__link,
.site-nav__trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 11px;
    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(--sage-700);
    background: var(--sage-50);
    border-color: rgba(107, 130, 96, 0.28);
    box-shadow: var(--shadow-sm);
}

.site-nav__link--cta {
    color: #fff;
    background: linear-gradient(145deg, var(--sage-500), var(--sage-600));
    border-color: var(--sage-600);
    box-shadow: var(--shadow-sage);
}

.site-nav__link--cta:hover {
    color: #fff;
    background: linear-gradient(145deg, var(--sage-600), var(--sage-700));
    border-color: var(--sage-700);
    transform: translateY(-1px);
}

.site-nav__link--cta.is-active {
    color: #fff;
    background: linear-gradient(145deg, var(--sage-600), var(--sage-700));
    border-color: var(--sage-700);
    box-shadow: 0 4px 14px rgba(86, 106, 77, 0.32);
}

.site-nav__link--daily {
    color: var(--sage-700);
    background: linear-gradient(180deg, #f4f8f0 0%, var(--sage-50) 100%);
    border-color: rgba(107, 130, 96, 0.32);
    box-shadow: var(--shadow-sm);
}

.site-nav__link--daily:hover {
    color: var(--sage-700);
    background: var(--sage-50);
    border-color: rgba(107, 130, 96, 0.45);
    transform: translateY(-1px);
}

.site-nav__link--daily.is-active {
    color: #fff;
    background: linear-gradient(145deg, var(--sage-500), var(--sage-600));
    border-color: var(--sage-600);
    box-shadow: var(--shadow-sage);
}

.site-nav__link--daily .site-nav__badge {
    background: #c62828;
}

.site-nav__link--daily.is-active .site-nav__badge {
    background: rgba(255, 255, 255, 0.92);
    color: #c62828;
}

.site-nav__link .site-nav__badge {
    margin-inline-start: 2px;
    margin-inline-end: 0;
}

.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: 240px;
    max-width: min(320px, calc(100vw - 32px));
    max-height: min(70vh, 520px);
    overflow-y: auto;
    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(--sage-700);
    background: var(--sage-50);
    font-weight: 700;
    border-inline-end: 3px solid var(--sage-500);
}

.site-nav__badge {
    display: inline-block;
    min-width: 1.25rem;
    margin-right: 6px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--error);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    vertical-align: middle;
}

.site-nav__menu-heading {
    padding: 10px 12px 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--ink-muted);
    opacity: 0.75;
    user-select: none;
}

.site-nav__menu-heading:not(:first-child) {
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

@media (max-width: 900px) {
    :root {
        --site-header-height: 60px;
    }

    body.site-nav-open {
        overflow: hidden;
    }

    .site-header {
        overflow-x: clip;
    }

    .site-nav--open::before {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 90;
        background: rgba(15, 23, 42, 0.38);
        backdrop-filter: blur(2px);
    }

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

    .panel-profile__trigger-name {
        display: none;
    }

    .panel-profile {
        margin-inline-start: 8px;
    }

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

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

    .site-nav__panel {
        position: fixed;
        top: calc(var(--site-header-height) + 8px + env(safe-area-inset-top, 0px));
        inset-inline-end: max(16px, env(safe-area-inset-right, 0px));
        inset-inline-start: max(16px, env(safe-area-inset-left, 0px));
        width: auto;
        z-index: 102;
        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--orders {
    max-width: min(1620px, calc(100vw - 2 * var(--page-pad-start) - 2 * var(--page-pad-end)));
}

.container--preinvoices {
    max-width: min(1620px, calc(100vw - 2 * var(--page-pad-start) - 2 * var(--page-pad-end)));
}

.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: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--sage-700);
    background: var(--sage-50);
    border: 1px solid rgba(107, 130, 96, 0.22);
    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;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
    border-color: var(--border-strong);
}

.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: linear-gradient(180deg, var(--sage-400), var(--sage-600));
    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%;
    min-height: var(--touch-min);
    padding: 11px 14px;
    font-family: var(--font);
    font-size: 15px;
    color: var(--ink);
    background: var(--sand-50);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

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

input:hover:not(:disabled):not([readonly]),
input[type="search"]:hover:not(:disabled),
select:hover:not(:disabled),
textarea:hover:not(:disabled) {
    border-color: var(--border-strong);
    background: var(--card);
}

input:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--sage-500);
    background: var(--card);
    box-shadow: var(--focus-ring);
}

.btn:focus-visible,
.site-nav__link:focus-visible,
.site-nav__trigger:focus-visible,
.site-nav__menu-link:focus-visible,
a:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.dim-field input {
    min-height: auto;
}

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

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

.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(--sand-50);
    border: 1px solid rgba(86, 106, 77, 0.15);
}

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

@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(168, 157, 116, 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(168, 157, 116, 0.24), rgba(168, 157, 116, 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(86, 106, 77, 0.16), rgba(86, 106, 77, 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(168, 157, 116, 0.14), rgba(168, 157, 116, 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(86, 106, 77, 0.12), rgba(86, 106, 77, 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(140, 130, 100, 0.34), rgba(168, 157, 116, 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(86, 106, 77, 0.2), rgba(86, 106, 77, 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(140, 130, 100, 0.82), rgba(168, 157, 116, 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(140, 130, 100, 0.78), rgba(168, 157, 116, 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(86, 106, 77, 0.55), rgba(86, 106, 77, 0.28));
    border: 1px solid rgba(86, 106, 77, 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(168, 157, 116, 0.28), rgba(168, 157, 116, 0.1));
}

.box-scene--mailer .box-cube__face--top {
    background: linear-gradient(145deg, rgba(140, 130, 100, 0.22), rgba(168, 157, 116, 0.1));
}

.box-scene--rsc .box-cube__face--front {
    background: linear-gradient(165deg, rgba(86, 106, 77, 0.22), rgba(86, 106, 77, 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(140, 130, 100, 0.88), rgba(168, 157, 116, 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(86, 106, 77, 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(168, 157, 116, 0.22);
}

.dieline-panel--bottom-lock {
    fill: rgba(86, 106, 77, 0.14);
    stroke: rgba(86, 106, 77, 0.35);
}

.dieline-panel--dust {
    fill: rgba(140, 130, 100, 0.12);
    stroke: rgba(140, 130, 100, 0.35);
}

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

.dieline-panel--lock {
    fill: rgba(86, 106, 77, 0.35);
    stroke: rgba(86, 106, 77, 0.5);
}

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

.box-mockup-face--lock {
    fill: rgba(86, 106, 77, 0.4);
    stroke: rgba(86, 106, 77, 0.55);
    stroke-width: 0.4;
}

.box-scene-legend__dot--tuck2 {
    background: rgba(168, 157, 116, 0.55);
    outline: 1px dashed rgba(168, 157, 116, 0.5);
}

.box-scene-legend__dot--lock {
    background: rgba(86, 106, 77, 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(140, 130, 100, 0.55);
}

.box-scene-legend__dot--tuck {
    background: rgba(168, 157, 116, 0.75);
}

.box-scene-legend__dot--base {
    background: rgba(86, 106, 77, 0.45);
}

.box-scene-legend__dot--tail {
    background: rgba(86, 106, 77, 0.22);
    outline: 1px solid rgba(86, 106, 77, 0.35);
}

.box-scene-legend__dot--front {
    background: rgba(168, 157, 116, 0.2);
}

.dieline-legend__swatch--side {
    background: rgba(86, 106, 77, 0.13);
    outline: 1px solid rgba(86, 106, 77, 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(86, 106, 77, 0.28);
    outline: 1px solid rgba(86, 106, 77, 0.55);
}

.dieline-legend__swatch--tail {
    background: rgba(168, 157, 116, 0.14);
    outline: 1px solid rgba(28, 36, 52, 0.25);
}

.dieline-legend__swatch--door {
    background: rgba(168, 157, 116, 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(86, 106, 77, 0.12);
    stroke: var(--teal);
}

.box-mockup-face--teh {
    fill: rgba(86, 106, 77, 0.08);
    stroke: var(--teal);
}

.box-mockup-face--tuck {
    fill: rgba(140, 130, 100, 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(86, 106, 77, 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(86, 106, 77, 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(86, 106, 77, 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(86, 106, 77, 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(86, 106, 77, 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(86, 106, 77, 0.35);
    box-shadow: var(--shadow-sm);
}

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

.dieline-pattern-card--frozen {
    border-color: rgba(86, 106, 77, 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(140, 130, 100, 0.28);
    outline: 1px solid rgba(140, 64, 24, 0.45);
}

.dieline-legend__swatch--base {
    background: rgba(168, 157, 116, 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(86, 106, 77, 0.1);
}

.dieline-sheet--tuck-top-auto-lock .dieline-panel--side {
    fill: rgba(86, 106, 77, 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(168, 157, 116, 0.18);
    stroke: #1a2433;
    stroke-dasharray: none;
}

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

.dieline-sheet--tuck-top-auto-lock .dieline-panel--bottom-lock {
    fill: rgba(86, 106, 77, 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(86, 106, 77, 0.1);
}

.dieline-sheet--bag-box .dieline-panel--side,
.dieline-sheet--bag-box .dieline-panel--gusset {
    fill: rgba(86, 106, 77, 0.08);
}

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

.dieline-sheet--bag-box .dieline-panel--bottom-lock {
    fill: rgba(86, 106, 77, 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--pillow-box .dieline-cut,
.dieline-sheet--pillow-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--pillow-box .dieline-panel--base,
.dieline-sheet--pillow-box .dieline-panel--front,
.dieline-sheet--pillow-box .dieline-panel--back {
    fill: rgba(86, 106, 77, 0.1);
}

.dieline-sheet--pillow-box .dieline-panel--curve {
    fill: rgba(168, 157, 116, 0.16);
    stroke: none;
}

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

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

.dieline-sheet--pillow-box .dieline-layer--folds {
    pointer-events: none;
}

.dieline-sheet--pillow-box .dieline-layer--folds .dieline-fold {
    stroke: #2563eb !important;
    stroke-width: 2.5px !important;
    fill: none !important;
    opacity: 1;
    vector-effect: non-scaling-stroke;
}

.dieline-sheet--pillow-box .dieline-fold--curve {
    stroke: #2563eb !important;
    pointer-events: none;
}

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

.dieline-sheet--dish-box .dieline-cut,
.dieline-sheet--dish-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--dish-box .dieline-panel--base {
    fill: rgba(86, 106, 77, 0.1);
}

.dieline-sheet--dish-box .dieline-panel--curve {
    fill: rgba(168, 157, 116, 0.16);
    stroke: none;
}

.dieline-sheet--dish-box .dieline-panel--side-petal {
    fill: #ffffff;
    stroke: none;
}

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

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

.dieline-sheet--dish-box .dieline-layer--folds {
    pointer-events: none;
}

.dieline-sheet--dish-box .dieline-layer--folds .dieline-fold {
    stroke: #2563eb !important;
    stroke-width: 2.5px !important;
    fill: none !important;
    opacity: 1;
    vector-effect: non-scaling-stroke;
}

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

.dieline-sheet--handled-box .dieline-cut,
.dieline-sheet--handled-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--handled-box .dieline-panel--base {
    fill: rgba(86, 106, 77, 0.1);
}

.dieline-sheet--handled-box .dieline-panel--side {
    fill: rgba(86, 106, 77, 0.08);
}

.dieline-sheet--handled-box .dieline-panel--gable,
.dieline-sheet--handled-box .dieline-panel--arch {
    fill: rgba(168, 157, 116, 0.16);
    stroke: none;
}

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

.dieline-sheet--handled-box .dieline-panel--bottom-lock {
    fill: rgba(168, 157, 116, 0.12);
}

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

.dieline-sheet--handled-box .dieline-layer--folds {
    pointer-events: none;
}

.dieline-sheet--handled-box .dieline-layer--folds .dieline-fold {
    stroke: #2563eb !important;
    stroke-width: 2.5px !important;
    fill: none !important;
    opacity: 1;
    vector-effect: non-scaling-stroke;
}

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

.dieline-sheet--handled-box .dieline-piece-marker__bg {
    fill: #1e3a8a;
}

.dieline-sheet--handled-box .dieline-piece-marker__num {
    fill: #ffffff;
}

.dieline-sheet--handled-box .dieline-piece-marker__halo {
    fill: rgba(255, 255, 255, 0.94);
}

.dieline-sheet--packet-box .dieline-cut,
.dieline-sheet--packet-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--packet-box .dieline-panel--base {
    fill: rgba(86, 106, 77, 0.1);
}

.dieline-sheet--packet-box .dieline-panel--side {
    fill: rgba(86, 106, 77, 0.08);
}

.dieline-sheet--packet-box .dieline-panel--top,
.dieline-sheet--packet-box .dieline-panel--door {
    fill: rgba(168, 157, 116, 0.22);
}

.dieline-sheet--packet-box .dieline-panel--tuck {
    fill: rgba(168, 157, 116, 0.28);
}

.dieline-sheet--packet-box .dieline-panel--side-tuck-flap {
    fill: rgba(168, 157, 116, 0.16);
}

.dieline-sheet--packet-box .dieline-panel--bottom-lock {
    fill: rgba(168, 157, 116, 0.12);
}

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

.dieline-sheet--packet-box .dieline-layer--folds {
    pointer-events: none;
}

.dieline-sheet--packet-box .dieline-layer--folds .dieline-fold {
    stroke: #2563eb !important;
    stroke-width: 2.5px !important;
    fill: none !important;
    opacity: 1;
    vector-effect: non-scaling-stroke;
}

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

.dieline-sheet--packet-box .dieline-piece-marker__bg {
    fill: #1e3a8a;
}

.dieline-sheet--packet-box .dieline-piece-marker__num {
    fill: #ffffff;
}

.dieline-sheet--packet-box .dieline-piece-marker__halo {
    fill: rgba(255, 255, 255, 0.94);
}

.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(140, 130, 100, 0.28);
    stroke: rgba(140, 64, 24, 0.48);
}

.dieline-panel--base {
    fill: rgba(168, 157, 116, 0.2);
    stroke: #1a2433;
}

.dieline-panel--tail,
.dieline-panel--bottom {
    fill: rgba(168, 157, 116, 0.14);
    stroke: #1a2433;
}

.dieline-panel--side {
    fill: rgba(86, 106, 77, 0.13);
    stroke: rgba(86, 106, 77, 0.55);
}

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

.dieline-panel--door {
    fill: rgba(168, 157, 116, 0.26);
    stroke: rgba(140, 64, 24, 0.55);
}

.dieline-panel--door.dieline-panel--tuck,
.dieline-panel--tuck.dieline-panel--door {
    fill: rgba(168, 157, 116, 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(86, 106, 77, 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(168, 157, 116, 0.4);
}

.dieline-sheet--eflute .dieline-panel--roof,
.dieline-sheet--eflute .dieline-panel--eflute-tuck {
    fill: rgba(168, 157, 116, 0.16);
    stroke: rgba(168, 157, 116, 0.38);
}

.dieline-sheet--eflute .dieline-panel--base {
    fill: rgba(168, 157, 116, 0.12);
    stroke: rgba(168, 157, 116, 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(86, 106, 77, 0.32);
}

.dieline-sheet--eflute .dieline-panel--eflute-tuck-side {
    fill: rgba(86, 106, 77, 0.14);
    stroke: rgba(86, 106, 77, 0.42);
}

.dieline-sheet--eflute .dieline-panel--eflute-back-side {
    fill: rgba(86, 106, 77, 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(86, 106, 77, 0.28);
    outline: 1px solid rgba(86, 106, 77, 0.45);
}

.dieline-pieces-legend__swatch--back-side {
    background: rgba(86, 106, 77, 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(86, 106, 77, 0.2);
    outline: 1px solid rgba(86, 106, 77, 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(86, 106, 77, 0.28);
    outline: 1px solid rgba(86, 106, 77, 0.45);
}

.dieline-legend__swatch--eflute-back-side {
    background: rgba(86, 106, 77, 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(86, 106, 77, 0.16);
}

.dieline-sheet--mailer .dieline-panel--top,
.dieline-sheet--mailer .dieline-panel--bottom {
    fill: rgba(168, 157, 116, 0.14);
}

.dieline-sheet--rsc .dieline-panel--base {
    fill: rgba(86, 106, 77, 0.14);
}

.dieline-sheet--rsc .dieline-panel--top,
.dieline-sheet--rsc .dieline-panel--bottom {
    fill: rgba(140, 130, 100, 0.12);
}

.dieline-panel--glue {
    fill: rgba(168, 157, 116, 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(86, 106, 77, 0.08);
    border: 1px solid rgba(86, 106, 77, 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(86, 106, 77, 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: var(--error-bg);
    border: 1px solid rgba(155, 74, 74, 0.35);
    color: var(--error);
}

.silk-screen-status--ok {
    background: rgba(86, 106, 77, 0.08);
    border: 1px solid rgba(86, 106, 77, 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: transform var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition), color var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
}

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

.btn--primary {
    background: linear-gradient(145deg, var(--sage-500) 0%, var(--sage-600) 100%);
    color: white;
    box-shadow: var(--shadow-sage);
    margin-top: 8px;
    min-height: var(--touch-min);
}

.btn--primary:hover {
    transform: translateY(-1px);
    background: linear-gradient(145deg, var(--sage-600) 0%, var(--sage-700) 100%);
    box-shadow: 0 6px 20px rgba(86, 106, 77, 0.35);
}

.btn--primary:active {
    transform: translateY(0);
}

.btn--secondary {
    background: var(--sand-200);
    color: var(--sage-700);
    border: 1px solid var(--border-strong);
    min-height: var(--touch-min);
}

.btn--secondary:hover {
    background: var(--sage-50);
    border-color: rgba(107, 130, 96, 0.35);
    color: var(--sage-800);
}

.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;
    min-height: 38px;
}

a.btn {
    text-decoration: none;
}

.btn--warning {
    background: var(--sage-50);
    color: var(--sage-700);
    border: 1px solid rgba(107, 130, 96, 0.35);
    width: auto;
}

.btn--warning:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--sage-800);
}

.btn--danger {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(155, 74, 74, 0.35);
    width: auto;
}

.btn--danger:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

.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,
#panel-toast.message--toast,
#message.message--toast {
    position: fixed;
    top: calc(var(--site-header-height) + 12px + env(safe-area-inset-top, 0px));
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    z-index: 99999;
    max-width: min(92vw, 560px);
    max-height: min(70vh, calc(100dvh - var(--site-header-height) - 32px));
    overflow-y: auto;
    margin: 0;
    padding: 14px 18px;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.18);
    pointer-events: auto;
    line-height: 1.55;
    text-align: start;
}

.message.message--success,
.message.message--error,
.message.success,
.message.error {
    display: block;
}

.message.message--success,
.message.success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(86, 106, 77, 0.22);
}

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

/* 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(86, 106, 77, 0.1) 0%, rgba(217, 204, 181, 0.18) 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(145deg, var(--sage-800) 0%, var(--sage-700) 55%, var(--sage-600) 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(86, 106, 77, 0.25);
}

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

.cost-breakdown-list__item--grand {
    background: linear-gradient(135deg, rgba(86, 106, 77, 0.1) 0%, rgba(168, 157, 116, 0.06) 100%);
    border-color: rgba(86, 106, 77, 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(107, 130, 96, 0.35);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

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

.product-grid-card__media {
    position: relative;
    aspect-ratio: 1;
    background: var(--sand-100);
    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(168, 157, 116, 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: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(86, 106, 77, 0.35);
}

.btn--success:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--sage-800);
}

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

.empty-state {
    text-align: center;
    padding: 40px 24px;
    color: var(--ink-muted);
    font-size: 14px;
    line-height: 1.7;
    background: var(--sand-50);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-strong);
}

.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;
}

/* راهنمای نرم‌افزار — گام‌های شماره‌دار */
.guide-steps {
    list-style: none;
    counter-reset: guide-step;
    margin: 14px 0;
    padding: 0;
}

.guide-steps > li {
    counter-increment: guide-step;
    position: relative;
    padding: 14px 16px 14px 0;
    margin-bottom: 10px;
    border-right: 3px solid var(--sage-200);
    padding-right: 52px;
    line-height: 1.75;
    font-size: 14px;
    background: var(--sand-50);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: border-color var(--transition), background var(--transition);
}

.guide-steps > li:hover {
    border-right-color: var(--sage-400);
    background: var(--card);
}

/* تاریخچه نسخه‌ها */
.changelog-release {
    padding: 28px 0;
    border-bottom: 1px solid var(--border);
    scroll-margin-top: 20px;
}

.changelog-release:last-child {
    border-bottom: none;
    padding-bottom: 8px;
}

.changelog-release--current {
    background: linear-gradient(to left, rgba(107, 130, 96, 0.08), transparent 60%);
    margin-inline: -20px;
    padding-inline: 20px;
    border-radius: var(--radius-sm);
}

.changelog-release__header {
    margin-bottom: 18px;
}

.changelog-release__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.changelog-release__version {
    font-size: 13px;
    font-weight: 700;
    color: var(--teal);
    letter-spacing: 0.02em;
}

.changelog-release__badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--teal);
    padding: 2px 8px;
    border-radius: 999px;
}

.changelog-release__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 8px;
    padding-right: 14px;
    border-right: 4px solid var(--accent);
}

.changelog-release__date {
    display: block;
    font-size: 13px;
    color: var(--ink-muted);
}

.changelog-release__time {
    margin-right: 6px;
}

.changelog-release__time::before {
    content: '·';
    margin-left: 6px;
}

.changelog-release__section {
    margin-bottom: 16px;
}

.changelog-release__section h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 10px;
}

.changelog-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.changelog-list > li {
    position: relative;
    padding: 8px 36px 8px 0;
    font-size: 14px;
    line-height: 1.7;
    border-bottom: 1px dashed var(--border);
}

.changelog-list > li:last-child {
    border-bottom: none;
}

.changelog-list > li::before {
    content: '';
    position: absolute;
    right: 0;
    top: 14px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.changelog-list--features > li::before {
    background: var(--teal);
}

.changelog-list--fixes > li::before {
    background: var(--accent);
}

.changelog-release__empty {
    font-size: 13px;
    color: var(--ink-muted);
    margin: 0;
}

.changelog-note {
    margin-bottom: 20px;
}

.changelog-release__summary {
    font-size: 14px;
    line-height: 1.75;
    color: var(--ink-muted);
    margin: 12px 0 0;
    max-width: 72ch;
}

.changelog-release__modules {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.changelog-module-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--paper);
    border: 1px solid var(--border);
    color: var(--ink-muted);
}

.changelog-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-muted);
}

.changelog-release--pending {
    border: 1px dashed var(--accent);
    border-radius: var(--radius-sm);
    padding-inline: 16px;
    margin-bottom: 8px;
}

.changelog-release__badge--pending {
    background: var(--accent);
}

/* چیدمان صفحه — منوی کناری + محتوا */
.changelog-layout {
    display: grid;
    grid-template-columns: minmax(248px, 280px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.changelog-sidebar {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    z-index: 2;
}

.changelog-nav {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
}

.changelog-nav__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--info-bg);
}

.changelog-nav__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}

.changelog-nav__count {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-muted);
    background: var(--paper);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 999px;
}

.changelog-nav__list {
    list-style: none;
    margin: 0;
    padding: 8px;
    overflow-y: auto;
    flex: 1;
}

.changelog-nav__item + .changelog-nav__item {
    margin-top: 4px;
}

.changelog-nav__link {
    display: flex;
    gap: 10px;
    padding: 10px 10px 10px 8px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease, border-color 0.15s ease;
    border: 1px solid transparent;
}

.changelog-nav__link:hover {
    background: var(--paper);
    border-color: var(--border);
}

.changelog-nav__link.is-active,
.changelog-nav__link.is-current {
    background: rgba(0, 128, 128, 0.08);
    border-color: rgba(0, 128, 128, 0.25);
}

.changelog-nav__link.is-pending.is-active {
    background: rgba(146, 97, 10, 0.08);
    border-color: rgba(146, 97, 10, 0.25);
}

.changelog-nav__rail {
    width: 3px;
    border-radius: 999px;
    background: var(--border);
    flex-shrink: 0;
    align-self: stretch;
}

.changelog-nav__link.is-active .changelog-nav__rail,
.changelog-nav__link.is-current .changelog-nav__rail {
    background: var(--teal);
}

.changelog-nav__link.is-pending.is-active .changelog-nav__rail {
    background: var(--accent);
}

.changelog-nav__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.changelog-nav__row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.changelog-nav__version {
    font-size: 12px;
    font-weight: 700;
    color: var(--teal);
    font-family: 'Consolas', 'Courier New', monospace;
    direction: ltr;
    unicode-bidi: isolate;
}

.changelog-nav__link.is-pending .changelog-nav__version {
    color: var(--accent);
    font-family: var(--font);
}

.changelog-nav__badge {
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: var(--teal);
    padding: 1px 6px;
    border-radius: 999px;
}

.changelog-nav__badge--pending {
    background: var(--accent);
}

.changelog-nav__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.changelog-nav__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--ink-muted);
}

.changelog-nav__stat {
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
}

.changelog-nav__stat--feat {
    color: var(--teal);
    background: rgba(0, 128, 128, 0.1);
}

.changelog-nav__stat--fix {
    color: var(--accent);
    background: rgba(146, 97, 10, 0.12);
}

.changelog-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.changelog-releases-card {
    padding-top: 8px;
}

/* درخت رشد پروژه */
.changelog-tree-section {
    padding: 24px 24px 28px;
    overflow: hidden;
}

.changelog-tree-section__header {
    margin-bottom: 24px;
}

.changelog-tree-section__header h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
    padding-right: 14px;
    border-right: 4px solid var(--teal);
    color: var(--ink);
}

.changelog-tree-section__lead {
    margin: 0;
    font-size: 13px;
    color: var(--ink-muted);
    line-height: 1.7;
    max-width: 60ch;
}

.changelog-tree {
    position: relative;
    padding: 0 0 8px;
}

.changelog-tree__canopy {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.changelog-tree__root-label {
    font-size: 14px;
    font-weight: 800;
    color: var(--ink);
    padding: 8px 20px;
    border: 2px solid var(--border);
    border-radius: 999px;
    background: var(--paper);
}

.changelog-tree__root-meta {
    font-size: 11px;
    color: var(--ink-muted);
    margin-top: 6px;
}

.changelog-tree__root {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

.changelog-tree__trunk {
    width: 3px;
    height: 24px;
    margin: 0 auto;
    background: linear-gradient(to bottom, var(--teal), var(--border));
    border-radius: 999px;
}

.changelog-tree__trunk--top {
    background: linear-gradient(to bottom, var(--accent), var(--teal));
}

.changelog-tree__trunk--bottom {
    background: linear-gradient(to bottom, var(--border), var(--teal));
}

.changelog-tree__phases {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.changelog-tree__phase {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 12px;
    position: relative;
}

.changelog-tree__connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 18px;
}

.changelog-tree__dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid var(--teal);
    background: var(--card);
    flex-shrink: 0;
    z-index: 1;
}

.changelog-tree__phase--latest .changelog-tree__dot {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(146, 97, 10, 0.15);
}

.changelog-tree__stem {
    width: 3px;
    flex: 1;
    min-height: 24px;
    background: var(--border);
    margin-top: 4px;
}

.changelog-tree__phase:last-child .changelog-tree__stem {
    min-height: 8px;
    background: transparent;
}

.changelog-tree__card {
    margin: 8px 0 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--paper);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.changelog-tree__phase--latest .changelog-tree__card {
    border-color: rgba(146, 97, 10, 0.35);
    background: linear-gradient(to left, rgba(146, 97, 10, 0.04), var(--paper));
}

.changelog-tree__card:hover {
    border-color: rgba(0, 128, 128, 0.35);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.changelog-tree__card-head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.changelog-tree__phase-num {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}

.changelog-tree__phase--latest .changelog-tree__phase-num {
    background: var(--accent);
}

.changelog-tree__card-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}

.changelog-tree__card-period {
    margin: 0;
    font-size: 12px;
    color: var(--ink-muted);
}

.changelog-tree__versions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.changelog-tree__version-link {
    font-size: 11px;
    font-weight: 700;
    font-family: 'Consolas', 'Courier New', monospace;
    direction: ltr;
    unicode-bidi: isolate;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--teal);
    text-decoration: none;
}

.changelog-tree__version-link:hover {
    border-color: var(--teal);
    background: rgba(0, 128, 128, 0.06);
}

.changelog-tree__branches {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.changelog-tree__branch {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--card);
    border: 1px dashed var(--border);
    color: var(--ink-muted);
}

.changelog-tree__phase--latest .changelog-tree__branch {
    border-style: solid;
    border-color: rgba(146, 97, 10, 0.25);
    color: var(--ink);
}

.changelog-tree__jump {
    display: inline-block;
    margin-top: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--teal);
    text-decoration: none;
}

.changelog-tree__phase--foundation .changelog-tree__dot {
    border-color: var(--border);
    background: var(--paper);
}

.changelog-tree__jump:hover {
    color: var(--accent);
    text-decoration: underline;
}

.changelog-tree__canopy-label {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #a84d1f);
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 14px rgba(168, 157, 116, 0.25);
}

@media (max-width: 960px) {
    .changelog-layout {
        grid-template-columns: 1fr;
    }

    .changelog-sidebar {
        position: static;
        max-height: none;
    }

    .changelog-nav {
        max-height: 280px;
    }

    .changelog-nav__list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 6px;
    }

    .changelog-nav__item + .changelog-nav__item {
        margin-top: 0;
    }
}

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

    .changelog-tree__card-head {
        flex-direction: column;
        gap: 8px;
    }
}

.guide-steps > li::before {
    content: counter(guide-step, persian);
    position: absolute;
    right: 0;
    top: 10px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--sage-500), var(--sage-600));
    color: #fff;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    font-size: 14px;
    border-radius: 50%;
    line-height: 1;
}

.guide-steps > li:last-child {
    margin-bottom: 0;
}

.guide-steps--workflow > li {
    padding-bottom: 16px;
    margin-bottom: 12px;
    border-right-color: var(--accent);
}

.guide-steps--workflow > li p {
    margin: 6px 0 0;
    font-size: 14px;
    color: var(--ink-muted);
    line-height: 1.75;
}

.guide-steps--workflow > li strong {
    display: block;
    font-size: 15px;
    color: var(--ink);
    margin-bottom: 4px;
}

.guide-steps__link {
    margin-top: 8px !important;
}

.guide-steps__link a {
    color: var(--teal);
    font-weight: 600;
    text-decoration: none;
    font-size: 13px;
}

.guide-steps__link a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.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(--sand-200);
    font-weight: 600;
    font-size: 13px;
    color: var(--sage-700);
}

.data-table tbody tr:nth-child(even) td {
    background: rgba(244, 239, 230, 0.4);
}

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

.data-table tbody tr:hover td {
    background: var(--sage-50);
}

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: 24px 20px calc(24px + var(--page-pad-bottom));
    font-size: 12px;
    color: var(--ink-muted);
    border-top: 1px solid var(--border);
    background: rgba(253, 252, 249, 0.75);
    line-height: 1.65;
}

.site-footer a {
    color: var(--sage-600);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition);
}

.site-footer a:hover {
    color: var(--sage-700);
    text-decoration: underline;
}

/* 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 .table-scroll .data-table,
.card .table-wrap .data-table {
    display: table;
    table-layout: auto;
    width: max-content;
    min-width: 100%;
    overflow-x: visible;
    overscroll-behavior-x: auto;
}

.card .table-scroll .data-table thead,
.card .table-wrap .data-table thead {
    display: table-header-group;
    width: auto;
    min-width: 0;
}

.card .table-scroll .data-table tbody,
.card .table-wrap .data-table tbody {
    display: table-row-group;
    width: auto;
    min-width: 0;
}

.card .table-scroll .data-table tr,
.card .table-wrap .data-table tr {
    display: table-row;
    width: auto;
    min-width: 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--orders,
    .container--preinvoices,
    .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--orders,
    .container--preinvoices,
    .container--narrow,
    .container--calculator {
        overflow-x: clip;
    }

    .card {
        padding: 20px 18px;
        margin-bottom: 16px;
        border-radius: 12px;
        max-width: 100%;
        overflow-x: clip;
    }

    .card .table-wrap,
    .card .table-scroll {
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .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,
    .order-toolbar .btn,
    .order-toolbar .order-btn-bar,
    .order-list-actions .order-btn-bar,
    .order-actions-row .order-btn-bar,
    .order-search__actions .btn,
    .order-deposit-actions .order-btn-bar,
    .order-form--actions .order-btn-bar,
    .order-form--inline .order-btn-bar,
    .fab-stack .btn {
        width: auto;
        min-height: 44px;
    }

    .order-btn-bar {
        flex-wrap: nowrap;
    }

    .order-btn-bar__item {
        width: auto;
        min-height: 36px;
    }

    .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(86, 106, 77, 0.08);
    border: 1px solid rgba(86, 106, 77, 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(--card);
    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(86, 106, 77, 0.06);
}

.order-mode__item.is-active {
    border-color: var(--teal);
    background: rgba(86, 106, 77, 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(168, 157, 116, 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(168, 157, 116, 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(168, 157, 116, 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(168, 157, 116, 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;
}

.sales-inquiry-banner {
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border, #ddd);
    background: var(--surface-muted, #f5f7fa);
    font-size: 0.95rem;
    line-height: 1.5;
}

.sales-inquiry-banner--warning {
    border-color: #e6c200;
    background: #fffbea;
}

.sales-inquiry-banner--error {
    border-color: #e57373;
    background: #ffebee;
}

.sales-inquiry-banner__notes {
    margin: 8px 0 0;
    color: var(--text-muted, #666);
}

.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(--sage-500);
    background: var(--accent-soft);
    box-shadow: 0 2px 10px rgba(107, 130, 96, 0.18);
}

.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(86, 106, 77, 0.18);
}

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

.calc-stepper__item.is-done {
    border-color: rgba(86, 106, 77, 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: 12px 14px;
    font-size: 13px;
    color: var(--ink-muted);
    background: var(--sage-50);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(107, 130, 96, 0.18);
    border-inline-end: 3px solid var(--sage-400);
    line-height: 1.65;
}

.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(86, 106, 77, 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(86, 106, 77, 0.35);
    box-shadow: 0 12px 40px rgba(86, 106, 77, 0.12);
}

.order-glance__price {
    text-align: center;
    padding: 16px 14px;
    border-radius: var(--radius-sm);
    background: linear-gradient(145deg, var(--sage-800) 0%, var(--sage-700) 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(86, 106, 77, 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-sales-panel {
    margin-top: 14px;
    padding: 16px 18px 18px;
    border: 1px solid var(--border, #d8dce6);
    border-radius: 14px;
    background: linear-gradient(160deg, #faf8f4 0%, #fff 55%, #f8f6f2 100%);
    box-shadow: 0 4px 18px rgba(28, 36, 52, 0.06);
}

.result-sales-panel__header {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border, #e4e8f0);
}

.result-sales-panel__title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 800;
    color: var(--ink, #1c2434);
}

.result-sales-panel__lead {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--ink-muted, #5c6578);
}

.result-sales-panel__body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px 16px;
    align-items: stretch;
}

.result-sales-panel__col {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(216, 220, 230, 0.85);
}

.result-sales-panel__badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--ink, #1c2434);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.result-sales-panel__content {
    flex: 1;
    min-width: 0;
}

.result-sales-panel__label {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink, #1c2434);
}

.result-sales-panel__hint {
    margin: 0 0 12px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--ink-muted, #5c6578);
}

.result-sales-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.result-sales-panel__btn {
    min-width: 0;
}

.result-sales-panel__or {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    padding: 0 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-muted, #8a93a8);
    white-space: nowrap;
}

.result-sales-panel .result-order-confirm__success {
    margin-top: 12px;
}

@media (max-width: 640px) {
    .result-sales-panel__body {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .result-sales-panel__or {
        position: relative;
        padding: 8px 0;
        width: 100%;
    }

    .result-sales-panel__or::before,
    .result-sales-panel__or::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--border, #d8dce6);
    }

    .result-sales-panel__or {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    .result-sales-panel__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .result-sales-panel__actions .btn {
        width: 100%;
    }

    .result-sales-panel__btn {
        width: 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: none;
        width: 100%;
    }

    .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[hidden],
.calc-wizard__actions [hidden] {
    display: none !important;
}

.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(86, 106, 77, 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(--card);
    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;
    }
}

/* Orders admin */
.order-num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.order-contact {
    margin-top: 0.2rem;
    font-size: 0.82rem;
    color: var(--muted, #5c6578);
}

.order-number-link {
    font-weight: 700;
    text-decoration: none;
}

.order-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

/* نوار دکمه افقی — بدون width:100% کلاس .btn */
.order-btn-bar {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    max-width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--card);
    box-shadow: var(--shadow-sm);
}

.order-btn-bar__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.45rem 0.75rem;
    min-height: 32px;
    border: none;
    border-inline-start: 1px solid var(--border);
    background: var(--sand-100);
    color: var(--sage-700);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.order-btn-bar__item:first-child {
    border-inline-start: none;
}

.order-btn-bar__item:hover {
    background: var(--sage-50);
    color: var(--sage-800);
}

.order-btn-bar__item:focus-visible {
    outline: none;
    box-shadow: inset var(--focus-ring);
    z-index: 1;
}

.order-btn-bar__item--primary {
    background: linear-gradient(145deg, var(--sage-500) 0%, var(--sage-600) 100%);
    color: #fff;
}

.order-btn-bar__item--primary:hover {
    background: linear-gradient(145deg, var(--sage-600) 0%, var(--sage-700) 100%);
    color: #fff;
}

.order-btn-bar__item--warn {
    background: var(--warning-bg);
    color: var(--warning);
}

.order-btn-bar__item--warn:hover {
    background: #f5e8cc;
    color: #6b4f1a;
}

.order-btn-bar__item--danger {
    background: var(--error-bg);
    color: var(--error);
}

.order-btn-bar__item--danger:hover {
    background: var(--error);
    color: #fff;
}

.order-btn-bar-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#orderTable {
    table-layout: auto;
}

.container--orders .orders-table-wrap {
    overflow: visible;
    margin-inline: 0;
}

.container--orders .card--orders-table {
    overflow: visible;
}

.container--orders .orders-table-wrap #orderTable {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    font-size: 12px;
    overflow: visible;
}

.container--orders #orderTable th,
.container--orders #orderTable td {
    padding: 6px 7px;
    vertical-align: top;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
}

.container--orders #orderTable th.order-actions-col,
.container--orders #orderTable td.order-actions,
.container--orders #orderTable .order-num {
    white-space: nowrap;
}

.container--orders #orderTable th:nth-child(1),
.container--orders #orderTable td:nth-child(1) {
    width: 2.5rem;
}

.container--orders #orderTable th:nth-child(2),
.container--orders #orderTable td:nth-child(2) {
    width: 6.5rem;
}

.container--orders #orderTable th:nth-child(4),
.container--orders #orderTable td:nth-child(4) {
    width: 5.5rem;
}

.container--orders #orderTable th:nth-child(6),
.container--orders #orderTable td:nth-child(6),
.container--orders #orderTable th:nth-child(7),
.container--orders #orderTable td:nth-child(7),
.container--orders #orderTable th:nth-child(8),
.container--orders #orderTable td:nth-child(8),
.container--orders #orderTable th:nth-child(10),
.container--orders #orderTable td:nth-child(10),
.container--orders #orderTable th:nth-child(11),
.container--orders #orderTable td:nth-child(11),
.container--orders #orderTable th:nth-child(12),
.container--orders #orderTable td:nth-child(12) {
    width: 4.75rem;
}

.container--orders #orderTable th:nth-child(15),
.container--orders #orderTable td:nth-child(15) {
    width: 5.25rem;
}

.container--orders #orderTable th:nth-child(14),
.container--orders #orderTable td:nth-child(14) {
    width: 5rem;
}

.container--orders #orderTable .order-status-badge,
.container--orders #orderTable .order-risk-badge {
    display: inline-block;
    margin: 0.1rem 0 0.1rem 0.15rem;
    font-size: 0.72rem;
}

.container--orders #orderTable .order-contact {
    font-size: 0.75rem;
}

.container--orders #orderTable .order-deposit-inline__link {
    font-size: 0.75rem;
}

#orderTable th.order-actions-col,
#orderTable td.order-actions {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
}

.order-search__actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.5rem;
    align-items: center;
    flex: 0 0 auto;
    padding-bottom: 0.15rem;
}

.order-search__actions .btn {
    width: auto;
    min-height: 36px;
    padding: 7px 14px;
    font-size: 13px;
    margin-top: 0;
    white-space: nowrap;
}

.order-list-actions {
    display: block;
}

.order-actions-menu {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.order-actions-menu__trigger-bar {
    width: auto;
}

.order-actions-menu__trigger-bar .order-btn-bar__item {
    gap: 0.35rem;
}

.order-actions-menu__caret {
    font-size: 0.72rem;
    line-height: 1;
    opacity: 0.85;
}

.order-actions-menu__panel {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 4px);
    z-index: 30;
    flex-direction: column;
    min-width: 11.5rem;
    max-width: min(16rem, 90vw);
    box-shadow: var(--shadow-md);
}

.order-actions-menu__panel[hidden] {
    display: none !important;
}

.order-actions-menu__panel--up {
    top: auto;
    bottom: calc(100% + 4px);
}

.order-actions-menu__panel .order-btn-bar__item {
    width: 100%;
    justify-content: flex-start;
    border-inline-start: none;
    border-top: 1px solid var(--border);
}

.order-actions-menu__panel .order-btn-bar__item:first-child {
    border-top: none;
}

.order-btn-bar__item--muted {
    cursor: default;
    opacity: 0.82;
    font-size: 0.82rem;
    line-height: 1.35;
    white-space: normal;
}

#orderTable td.order-actions {
    position: relative;
}

.order-actions-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0;
    align-items: stretch;
}

.order-actions-row .order-btn-bar {
    width: auto;
}

.order-action-groups {
    display: grid;
    gap: 0.85rem;
}

.order-action-group__title {
    margin: 0 0 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink-muted);
}

.order-toolbar .order-btn-bar__item,
.order-deposit-actions .order-btn-bar__item,
.order-form--actions .order-btn-bar__item {
    min-height: 34px;
    padding: 0.5rem 0.85rem;
    font-size: 13px;
}

.order-form--inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.order-form--inline .form-group {
    flex: 1 1 200px;
    margin-bottom: 0;
}

.order-form--inline .order-btn-bar {
    flex: 0 0 auto;
}

.order-form--section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.order-form--actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.order-form--actions .btn {
    width: auto;
    margin-top: 0;
}

.order-deposit-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.65rem;
    align-items: center;
    margin-top: 0.5rem;
}

.order-deposit-actions .order-btn-bar {
    flex: 0 0 auto;
}

.order-deposit-receipt-panel {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
}

.order-deposit-receipt-list {
    list-style: none;
    margin: 0.5rem 0 1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.order-deposit-receipt-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.order-deposit-receipt-thumb {
    max-width: 220px;
    max-height: 160px;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 4px;
    object-fit: contain;
    background: #fafafa;
}

.order-deposit-inline {
    margin-top: 0.35rem;
}

.order-deposit-inline__btn {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.82rem;
    border: 1px solid #2e7d32;
    border-radius: 4px;
    background: #e8f5e9;
    color: #1b5e20;
    cursor: pointer;
}

.order-deposit-inline__btn:hover {
    background: #c8e6c9;
}

.order-deposit-inline__link {
    display: inline-block;
    margin-top: 0.2rem;
    font-size: 0.82rem;
    color: #1565c0;
    text-decoration: underline;
}

.deposit-receipt-dialog {
    max-width: 32rem;
    width: calc(100% - 2rem);
}

@media (max-width: 768px) {
    .order-search {
        flex-direction: column;
        align-items: stretch;
    }

    .order-search__field,
    .order-search__field--grow {
        flex: 1 1 auto;
        width: 100%;
        max-width: none;
    }

    .order-search__actions {
        width: 100%;
        flex-wrap: wrap;
        padding-bottom: 0;
    }

    .order-search__actions .btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    .order-form--inline {
        flex-direction: column;
        align-items: stretch;
    }

    .order-form--inline .form-group {
        flex: 1 1 auto;
        width: 100%;
    }

    .order-form--inline .order-btn-bar {
        width: 100%;
    }

    .order-deposit-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .order-deposit-actions .order-btn-bar {
        width: 100%;
    }

    .paper-total {
        width: 100%;
        text-align: right;
    }

    .paper-list-header .btn {
        width: 100%;
        justify-content: center;
    }

    .order-detail-dl > div {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .order-detail-dl dd {
        text-align: right;
    }

    .order-timeline__item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

.order-status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--surface-muted, #f3f4f6);
    color: var(--ink, #1c2434);
}

.order-status-badge--customer_confirmed { background: #e8f4fd; color: #0b5cab; }
.order-status-badge--sent_to_printshop { background: #fff4e5; color: #9a5b00; }
.order-status-badge--printshop_agreed { background: #e8f8ef; color: #1a7a42; }
.order-status-badge--in_production { background: #f0e8ff; color: #5b21b6; }
.order-status-badge--ready { background: #e0f7fa; color: #006874; }
.order-status-badge--delivered { background: #e8f5e9; color: #2e7d32; }
.order-status-badge--cancelled { background: #fdecea; color: #b42318; }
.order-status-badge--draft { background: #f5f5f5; color: #666; }
.order-status-badge--preinvoice-active { background: #e8f4fd; color: #0b5cab; }
.order-status-badge--preinvoice-converted { background: #e8f8ef; color: #1a7a42; }
.order-status-badge--preinvoice-expired { background: #fff4e5; color: #9a5b00; }
.order-status-badge--preinvoice-cancelled { background: #fdecea; color: #b42318; }
.order-status-badge--preinvoice-legacy_share { background: #f5f5f5; color: #666; }

.order-risk-badge {
    display: inline-block;
    margin-right: 0.35rem;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #fdecea;
    color: #b42318;
}

.order-locked-panel {
    background: var(--surface-muted, #f8f9fb);
}

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

.order-detail-grid__full {
    grid-column: 1 / -1;
}

.order-next-steps-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--sage-50, #f0f5f1);
    border: 1px solid var(--border);
}

.order-next-steps-banner__text {
    margin: 0;
    flex: 1 1 16rem;
    font-size: 0.92rem;
    color: var(--ink);
    line-height: 1.45;
}

.order-detail-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border, #e8e8e8);
}

.order-detail-section:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.order-detail-section__title {
    margin: 0 0 0.65rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ink-muted);
}

.order-detail-communications .order-action-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.85rem;
}

.order-detail-sales-rep__form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
}

.order-detail-sales-rep__form select {
    min-width: 10rem;
    max-width: 100%;
}

.order-detail-sales-rep__form .btn {
    width: auto;
    margin-top: 0;
    min-height: 34px;
}

.order-timeline--compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.35rem 1rem;
}

.order-timeline--compact .order-timeline__item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 0.45rem 0;
    border-bottom: none;
    border-inline-start: 3px solid var(--sage-400, #7a9e87);
    padding-inline-start: 0.55rem;
}

.order-detail-timeline-card .card__title {
    margin-bottom: 0.75rem;
}

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

.order-detail-dl {
    display: grid;
    gap: 0.65rem;
    margin: 0;
}

.order-detail-dl > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--border, #e8e8e8);
}

.order-detail-dl dt {
    margin: 0;
    color: var(--muted, #5c6578);
    font-weight: 500;
}

.order-detail-dl dd {
    margin: 0;
    text-align: left;
}

.order-variance--good { color: #1a7a42; }
.order-variance--bad { color: #b42318; }

.order-risk-alert {
    margin-top: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 6px;
    background: #fdecea;
    color: #b42318;
    font-weight: 600;
}

.order-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.order-timeline__item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border, #e8e8e8);
}

.order-timeline__item--done .order-timeline__label {
    font-weight: 600;
}

.order-search {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-end;
}

.order-search__field {
    flex: 0 1 180px;
    margin-bottom: 0;
}

.order-search__field--grow {
    flex: 1 1 280px;
}

.order-search-status {
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
    color: var(--muted, #5c6578);
}

.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.table-wrap--wide-scroll {
    margin-inline: -4px;
    padding-bottom: 6px;
    border-radius: var(--radius-sm);
    scrollbar-gutter: stable;
}

.table-wrap-hint {
    margin: 0 0 0.65rem;
    font-size: 0.82rem;
    color: var(--ink-muted);
}

/* Preinvoices admin */
.container--preinvoices .preinvoices-table-wrap {
    overflow: visible;
    margin-inline: 0;
}

.container--preinvoices .card--preinvoices-table {
    overflow: visible;
}

.container--preinvoices .preinvoices-table-wrap #preinvoiceTable {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    font-size: 12px;
    overflow: visible;
}

.container--preinvoices #preinvoiceTable th,
.container--preinvoices #preinvoiceTable td {
    padding: 6px 7px;
    vertical-align: top;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
}

.container--preinvoices #preinvoiceTable th.preinvoice-select-col,
.container--preinvoices #preinvoiceTable td.preinvoice-select-col {
    width: 2.5rem;
}

.container--preinvoices #preinvoiceTable th:nth-child(2),
.container--preinvoices #preinvoiceTable td:nth-child(2) {
    width: 6.75rem;
}

.container--preinvoices #preinvoiceTable th:nth-child(3),
.container--preinvoices #preinvoiceTable td:nth-child(3) {
    width: 4.25rem;
}

.container--preinvoices #preinvoiceTable th:nth-child(4),
.container--preinvoices #preinvoiceTable td:nth-child(4) {
    width: 5.5rem;
}

.container--preinvoices #preinvoiceTable th:nth-child(8),
.container--preinvoices #preinvoiceTable td:nth-child(8),
.container--preinvoices #preinvoiceTable th:nth-child(9),
.container--preinvoices #preinvoiceTable td:nth-child(9),
.container--preinvoices #preinvoiceTable th:nth-child(10),
.container--preinvoices #preinvoiceTable td:nth-child(10),
.container--preinvoices #preinvoiceTable th:nth-child(11),
.container--preinvoices #preinvoiceTable td:nth-child(11),
.container--preinvoices #preinvoiceTable th:nth-child(12),
.container--preinvoices #preinvoiceTable td:nth-child(12) {
    width: 4.75rem;
}

.container--preinvoices #preinvoiceTable th.preinvoice-actions-col,
.container--preinvoices #preinvoiceTable td.preinvoice-actions,
.container--preinvoices #preinvoiceTable .preinvoice-num {
    white-space: nowrap;
}

.container--preinvoices #preinvoiceTable th.preinvoice-actions-col,
.container--preinvoices #preinvoiceTable td.preinvoice-actions {
    width: 5.25rem;
    vertical-align: middle;
    position: relative;
}

.container--preinvoices #preinvoiceTable td.preinvoice-cancel-reason-cell {
    width: 7.5rem;
}

.container--preinvoices #preinvoiceTable .order-status-badge,
.container--preinvoices #preinvoiceTable .order-risk-badge {
    display: inline-block;
    margin: 0.1rem 0 0.1rem 0.15rem;
    font-size: 0.72rem;
}

.container--preinvoices #preinvoiceTable .preinvoice-contact {
    font-size: 0.75rem;
}

.preinvoice-bulk-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
    padding: 0.55rem 0.75rem;
    background: var(--surface-alt, #f4f6f9);
    border: 1px solid var(--border, #e2e6ee);
    border-radius: var(--radius-sm);
}

.preinvoice-bulk-bar[hidden] {
    display: none !important;
}

.preinvoice-bulk-bar__count {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink, #1a1f2b);
}

.preinvoice-select-col {
    width: 2.6rem;
    min-width: 2.6rem;
    text-align: center;
    vertical-align: middle;
}

.preinvoice-row-select {
    width: 1rem;
    height: 1rem;
    margin: 0;
    cursor: pointer;
}

#preinvoiceTable {
    table-layout: auto;
}

#preinvoiceTable th.preinvoice-actions-col {
    background: var(--sand-200);
}

#preinvoiceTable td.preinvoice-cancel-reason-cell {
    white-space: normal;
}

.preinvoice-meta,
.preinvoice-contact {
    margin-top: 0.2rem;
    font-size: 0.82rem;
    color: var(--muted, #5c6578);
    line-height: 1.45;
}

.preinvoice-num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.preinvoice-model {
    display: inline-block;
    padding: 0.12rem 0.45rem;
    border-radius: 4px;
    background: var(--surface-muted, #f3f4f6);
    font-size: 0.85rem;
    font-weight: 600;
}

.preinvoice-dim-unit {
    margin-right: 0.2rem;
    font-size: 0.82rem;
    color: var(--muted, #5c6578);
    font-weight: 500;
}

.preinvoice-search {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-end;
}

.preinvoice-search__field {
    flex: 1 1 280px;
    margin-bottom: 0;
}

.preinvoice-search__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    flex: 0 0 auto;
    padding-bottom: 0.15rem;
}

.preinvoice-search-status {
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
    color: var(--muted, #5c6578);
}

.preinvoice-search-status strong {
    color: var(--ink, #1c2434);
}

.preinvoice-cancel-reason {
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: var(--ink-muted, #5c6578);
    line-height: 1.5;
    max-width: 14rem;
    white-space: normal;
}

.preinvoice-cancel-reason-cell {
    font-size: 0.85rem;
    color: var(--ink, #1c2434);
    line-height: 1.5;
    white-space: normal;
    vertical-align: top;
}

.preinvoice-cancel-reason__label {
    font-weight: 600;
    color: var(--ink, #1c2434);
}

/* دیالوگ‌های بومی — موبایل و دسکتاپ */
dialog {
    border: none;
    border-radius: var(--radius);
    padding: 0;
    margin: auto;
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    overflow: auto;
    color: var(--ink);
    background: var(--card);
    box-shadow: var(--shadow-lg);
}

dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.dialog-panel-form {
    min-width: min(320px, 100%);
    padding: 1.25rem;
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .dialog-panel-form {
        min-width: 0;
        padding: 1rem;
    }

    .dialog-panel-form .order-btn-bar {
        flex-direction: column;
        width: 100%;
    }

    .dialog-panel-form .order-btn-bar__item {
        width: 100%;
        border-inline-start: none;
        border-top: 1px solid var(--border);
    }

    .dialog-panel-form .order-btn-bar__item:first-child {
        border-top: none;
    }
}

/* Calculator order confirm modal */
.order-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.45);
}

.order-modal-overlay[hidden] {
    display: none;
}

.order-modal {
    width: min(480px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 1.25rem;
}

.order-modal__title {
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
}

.order-modal__summary {
    margin: 0 0 1rem;
    line-height: 1.7;
}

.order-modal__actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.order-modal__feedback {
    margin: 0 0 0.85rem;
    padding: 0.65rem 0.85rem;
    border-radius: 6px;
    font-size: 0.92rem;
    line-height: 1.5;
}

.order-modal__feedback--info {
    background: var(--sage-50);
    color: var(--sage-700);
    border: 1px solid rgba(86, 106, 77, 0.2);
}

.order-modal__feedback--error {
    background: #fdecea;
    color: #b42318;
    font-weight: 600;
}

.order-modal__feedback--success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(86, 106, 77, 0.2);
}

.order-modal--preinvoice {
    width: min(920px, 100%);
}

.pre-invoice-modal-preview {
    margin: 0 0 1rem;
    max-height: min(52vh, 640px);
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: linear-gradient(180deg, #ece8e0 0%, #e0dbd2 100%);
    padding: 12px;
}

.pre-invoice-modal-preview__sheet .pre-invoice-sheet {
    width: 100%;
    max-width: 210mm;
    margin: 0 auto;
    box-shadow: 0 8px 24px rgba(28, 36, 52, 0.12);
    border-radius: 4px;
    overflow: hidden;
}

#preInvoiceModalShare {
    margin-bottom: 1rem;
}

.pre-invoice-modal-share {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--paper, #faf8f4);
}

.order-modal__actions--preinvoice {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.order-modal__actions--preinvoice .btn {
    flex: 1 1 140px;
}

.result-order-confirm__success {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(86, 106, 77, 0.2);
}

/* —— Workflow infographic (admin/workflow + guide) —— */
.card--flush {
    padding: 1.25rem 1rem 1.5rem;
    overflow-x: auto;
}

.workflow-infographic {
    min-width: min(100%, 720px);
}

.workflow-infographic__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1rem;
}

.workflow-legend {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
}

.workflow-legend--sales {
    background: rgba(45, 106, 110, 0.08);
    color: var(--teal);
    border-color: rgba(45, 106, 110, 0.25);
}

.workflow-legend--support {
    background: rgba(120, 90, 60, 0.08);
    color: #785a3c;
    border-color: rgba(120, 90, 60, 0.2);
}

.workflow-pipeline {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    margin-bottom: 0.5rem;
}

.workflow-pipeline__arrow {
    display: flex;
    align-items: center;
    color: var(--ink-muted);
    opacity: 0.55;
    flex-shrink: 0;
}

.workflow-step {
    flex: 1 1 88px;
    min-width: 88px;
    max-width: 130px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 8px;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.workflow-step:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.workflow-step__num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    line-height: 1;
}

.workflow-step__title {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--ink);
}

.workflow-step__desc {
    font-size: 10px;
    line-height: 1.45;
    color: var(--ink-muted);
}

.workflow-step--crm { border-color: #7c6bae; background: linear-gradient(180deg, #faf8ff 0%, #fff 100%); }
.workflow-step--crm .workflow-step__num { background: #7c6bae; }
.workflow-step--calc { border-color: var(--teal); background: linear-gradient(180deg, #f0fafa 0%, #fff 100%); }
.workflow-step--calc .workflow-step__num { background: var(--teal); }
.workflow-step--quote { border-color: #5a8fc4; background: linear-gradient(180deg, #f4f9ff 0%, #fff 100%); }
.workflow-step--quote .workflow-step__num { background: #5a8fc4; }
.workflow-step--order { border-color: var(--accent); background: linear-gradient(180deg, #fff8f0 0%, #fff 100%); }
.workflow-step--order .workflow-step__num { background: var(--accent); }
.workflow-step--pay { border-color: #3d9a6a; background: linear-gradient(180deg, #f2fbf6 0%, #fff 100%); }
.workflow-step--pay .workflow-step__num { background: #3d9a6a; }
.workflow-step--print { border-color: #8b6914; background: linear-gradient(180deg, #fffbf0 0%, #fff 100%); }
.workflow-step--print .workflow-step__num { background: #8b6914; }
.workflow-step--prod { border-color: #6b7280; background: linear-gradient(180deg, #f5f6f7 0%, #fff 100%); }
.workflow-step--prod .workflow-step__num { background: #6b7280; }
.workflow-step--report { border-color: #c45a5a; background: linear-gradient(180deg, #fff5f5 0%, #fff 100%); }
.workflow-step--report .workflow-step__num { background: #c45a5a; }

.workflow-bridge {
    height: 32px;
    margin: 4px 0 12px;
    color: var(--border);
}

.workflow-bridge__svg {
    width: 100%;
    height: 100%;
    display: block;
}

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

.workflow-support {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.workflow-support:hover {
    border-color: var(--teal);
    box-shadow: 0 2px 8px rgba(45, 106, 110, 0.12);
    text-decoration: none;
}

.workflow-support__title {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--ink);
}

.workflow-support__list {
    margin: 0;
    padding: 0 1rem 0 0;
    font-size: 11px;
    line-height: 1.55;
    color: var(--ink-muted);
}

.workflow-support--engine { border-right: 3px solid var(--accent); }
.workflow-support--trust { border-right: 3px solid var(--teal); }
.workflow-support--comms { border-right: 3px solid #7c6bae; }
.workflow-support--backup { border-right: 3px solid #785a3c; }

.workflow-phases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.workflow-phase {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-alt, #f8f8f6);
    font-size: 12px;
}

.workflow-phase__label {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-muted);
    margin-bottom: 4px;
}

.workflow-phase strong {
    display: block;
    font-size: 13px;
    margin-bottom: 2px;
}

.workflow-phase p {
    margin: 0;
    font-size: 11px;
    color: var(--ink-muted);
    line-height: 1.45;
}

.workflow-phase--a { border-right: 3px solid #5a8fc4; }
.workflow-phase--b { border-right: 3px solid var(--accent); }
.workflow-phase--c { border-right: 3px solid #3d9a6a; }
.workflow-phase--d { border-right: 3px solid #c45a5a; }

.workflow-problems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.workflow-problem__list,
.workflow-quickstart {
    margin: 0;
    padding: 0 1.25rem 0 0;
    line-height: 1.75;
    font-size: 14px;
    color: var(--ink-muted);
}

.workflow-problem__list li + li,
.workflow-quickstart li + li {
    margin-top: 6px;
}

.workflow-problem--accent {
    border: 1px solid rgba(45, 106, 110, 0.25);
    background: linear-gradient(135deg, rgba(45, 106, 110, 0.04) 0%, #fff 100%);
}

.workflow-quickstart a {
    color: var(--teal);
    font-weight: 600;
}

@media (max-width: 900px) {
    .workflow-pipeline__arrow {
        display: none;
    }

    .workflow-step {
        flex: 1 1 calc(50% - 8px);
        max-width: none;
    }
}

@media (max-width: 520px) {
    .brand__text span {
        display: none;
    }

    .pricing-freshness-banner,
    .follow-up-banner {
        font-size: 12px;
        padding: 8px 12px;
        text-align: start;
    }

    .workflow-step {
        flex: 1 1 100%;
        max-width: none;
    }
}

.preinvoice-approve-panel {
    position: sticky;
    bottom: 0;
    z-index: 20;
    padding: 16px 20px 20px;
    background: linear-gradient(180deg, rgba(28, 36, 52, 0) 0%, rgba(28, 36, 52, 0.92) 24%, #1c2434 100%);
    box-shadow: 0 -8px 32px rgba(28, 36, 52, 0.18);
}

.preinvoice-approve-panel__inner {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.preinvoice-approve-panel__lead {
    margin: 0;
    color: #f4f6fa;
    font-size: 14px;
    line-height: 1.7;
    text-align: center;
}

.preinvoice-approve-panel__lead--warn {
    color: #ffd9a8;
}

.preinvoice-approve-panel__lead--info {
    color: #d7e8ff;
}

.preinvoice-approve-panel__feedback {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    text-align: center;
}

.preinvoice-approve-panel__feedback--info {
    background: rgba(255, 255, 255, 0.1);
    color: #f4f6fa;
}

.preinvoice-approve-panel__feedback--error {
    background: rgba(180, 48, 48, 0.25);
    color: #ffd4d4;
}

.preinvoice-approve-panel__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    background: #c45c26;
    color: #fff;
    font: inherit;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.preinvoice-approve-panel__btn:hover {
    background: #a84d1f;
    color: #fff;
}

.preinvoice-approve-panel__btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.preinvoice-approve-panel__btn--secondary {
    background: rgba(255, 255, 255, 0.12);
}

.preinvoice-approve-panel__btn--secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ——— فروشگاه ——— */
.shop-toolbar {
    margin-bottom: 1.25rem;
}

.shop-toolbar__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.shop-cart-link {
    position: relative;
}

.shop-cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    margin-right: 0.35rem;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}

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

.shop-grid__empty {
    margin-top: 1rem;
}

.shop-card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.shop-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lg);
}

.shop-card__link {
    display: flex;
    flex-direction: column;
    flex: 1;
    color: inherit;
    text-decoration: none;
}

.shop-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--surface-muted);
    overflow: hidden;
}

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

.shop-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--ink-muted);
    font-size: 0.875rem;
}

.shop-card__body {
    padding: 0.85rem 1rem 0.5rem;
}

.shop-card__category {
    display: block;
    font-size: 0.75rem;
    color: var(--ink-muted);
    margin-bottom: 0.25rem;
}

.shop-card__title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.45;
}

.shop-card__meta {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--ink-muted);
}

.shop-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem 1rem;
    margin-top: auto;
}

.shop-card__btn {
    flex: 1 1 auto;
    min-width: 5.5rem;
}

.shop-card__btn--full {
    flex: 1 1 100%;
}

.shop-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 1.5rem;
}

.shop-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--ink-muted);
}

.shop-breadcrumb a {
    color: inherit;
    text-decoration: none;
}

.shop-breadcrumb a:hover {
    color: var(--ink);
    text-decoration: underline;
}

.shop-product {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 1.75rem;
    padding: 1.25rem;
}

.shop-product__gallery {
    border-radius: calc(var(--radius) - 4px);
    overflow: hidden;
    background: var(--surface-muted);
    border: 1px solid var(--border);
}

.shop-product__img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: contain;
}

.shop-product__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    color: var(--ink-muted);
}

.shop-product__head {
    margin-bottom: 1rem;
}

.shop-product__title {
    margin: 0.5rem 0 0.35rem;
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    line-height: 1.35;
}

.shop-product__subtitle {
    margin: 0;
    color: var(--ink-muted);
    font-size: 0.9375rem;
}

.shop-product__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.shop-product__tag {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--ink-muted);
}

.shop-product__section-title {
    margin: 0 0 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
}

.shop-product__description {
    margin-bottom: 1.25rem;
}

.shop-product__description p {
    margin: 0;
    line-height: 1.75;
    color: var(--ink);
}

.shop-product__specs {
    display: grid;
    gap: 0.65rem;
    margin: 0 0 1.25rem;
}

.shop-product__specs div {
    display: grid;
    grid-template-columns: 7rem 1fr;
    gap: 0.75rem;
    font-size: 0.9375rem;
}

.shop-product__specs dt {
    margin: 0;
    color: var(--ink-muted);
    font-weight: 500;
}

.shop-product__specs dd {
    margin: 0;
}

.shop-product__purchase {
    padding: 1rem;
    background: var(--surface-muted);
    border: 1px solid var(--border);
}

.shop-product__price-note {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: var(--ink-muted);
    line-height: 1.6;
}

.shop-product__qty {
    margin-bottom: 1rem;
}

.shop-product__qty > label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.shop-qty-stepper {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card);
}

.shop-qty-stepper__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 1.1rem;
    cursor: pointer;
}

.shop-qty-stepper__btn:hover {
    background: var(--surface-muted);
}

.shop-qty-stepper input {
    width: 6.5rem;
    border: 0;
    border-inline: 1px solid var(--border);
    border-radius: 0;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.shop-product__actions {
    display: grid;
    gap: 0.65rem;
}

.shop-quote-result {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: calc(var(--radius) - 4px);
    border: 1px solid var(--border-strong);
    background: var(--card);
}

.shop-quote-result__title {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
}

.shop-quote-result__meta {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--ink-muted);
}

.shop-quote-result__price-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0.85rem 0 0.35rem;
}

.shop-quote-result__per {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.shop-quote-result__unit {
    font-size: 0.9375rem;
    color: var(--ink-muted);
}

.shop-quote-result__total {
    margin: 0 0 0.5rem;
    font-size: 0.9375rem;
}

.shop-quote-result__hint {
    margin: 0;
}

.shop-detail__media {
    border-radius: calc(var(--radius) - 4px);
    overflow: hidden;
    background: var(--surface-muted);
}

.shop-detail__img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: contain;
}

.shop-detail__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    color: var(--ink-muted);
}

.shop-detail__description {
    margin: 0 0 1rem;
    line-height: 1.75;
}

.shop-detail__specs {
    display: grid;
    gap: 0.65rem;
    margin: 0 0 1.25rem;
}

.shop-detail__specs div {
    display: grid;
    grid-template-columns: 7rem 1fr;
    gap: 0.75rem;
    font-size: 0.9375rem;
}

.shop-detail__specs dt {
    margin: 0;
    color: var(--ink-muted);
    font-weight: 500;
}

.shop-detail__specs dd {
    margin: 0;
}

.shop-detail__qty {
    max-width: 16rem;
}

.shop-detail__actions {
    margin-top: 0.5rem;
}

.shop-cart-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shop-cart-item {
    display: grid;
    grid-template-columns: 88px 1fr auto;
    gap: 1rem;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.shop-cart-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.shop-cart-item__media {
    display: block;
    width: 88px;
    height: 66px;
    border-radius: calc(var(--radius) - 6px);
    overflow: hidden;
    background: var(--surface-muted);
}

.shop-cart-item__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-cart-item__placeholder {
    width: 100%;
    height: 100%;
    background: var(--surface-muted);
}

.shop-cart-item__title {
    display: block;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
    margin-bottom: 0.25rem;
}

.shop-cart-item__meta {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    color: var(--ink-muted);
}

.shop-cart-item__qty {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.shop-cart-item__qty input {
    width: 6rem;
}

.shop-cart-item__quote {
    margin-top: 0.65rem;
}

.shop-cart-item__price {
    margin: 0.35rem 0 0;
    font-size: 0.95rem;
}

.shop-cart-item__price--stale {
    color: var(--danger, #b42318);
}

.shop-cart-totals {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.shop-cart-totals__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 1.05rem;
}

.shop-checkout-success .form-actions {
    margin-top: 1rem;
}

.shop-cart-item__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
}

.shop-cart-footer {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.shop-cart-checkout {
    margin-top: 1rem;
}

.shop-cart-checkout__summary {
    margin: 0.75rem 0 1rem;
    padding: 0.75rem 1rem;
    background: var(--surface-muted, rgba(0, 0, 0, 0.03));
    border-radius: var(--radius, 8px);
}

.shop-cart-checkout__total {
    margin: 0;
    font-size: 1.05rem;
}

.shop-cart-checkout__form {
    margin-top: 0.5rem;
}

/* ——— تکمیل خرید (چک‌اوت) ——— */
.page-shop-checkout {
    --checkout-accent: #7b7b37;
    --checkout-bg: #f5f5f3;
}

.page-shop-checkout .main {
    background: var(--checkout-bg);
}

.shop-checkout-layout {
    margin-top: 0.5rem;
}

.shop-checkout-toplinks {
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
    color: var(--ink-muted, #666);
}

.shop-checkout-toplinks p {
    margin: 0 0 0.35rem;
}

.shop-checkout-toplinks a,
.shop-checkout-toplinks__toggle {
    color: var(--checkout-accent);
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.shop-checkout-toplinks a:hover,
.shop-checkout-toplinks__toggle:hover {
    text-decoration: underline;
}

.shop-checkout-coupon {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 8px);
    max-width: 28rem;
}

.shop-checkout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
    gap: 2rem;
    align-items: start;
}

.shop-checkout-billing__title {
    margin: 0 0 1.25rem;
    font-size: 1.35rem;
    font-weight: 700;
}

.shop-checkout-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shop-checkout-form label,
.shop-checkout-fieldset {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.92rem;
    font-weight: 500;
}

.shop-checkout-form input,
.shop-checkout-form select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    font: inherit;
}

.shop-checkout-form__row {
    display: grid;
    gap: 1rem;
}

.shop-checkout-form__row--2 {
    grid-template-columns: 1fr 1fr;
}

.shop-checkout-fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.shop-checkout-fieldset legend {
    padding: 0;
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.shop-checkout-form .req {
    color: var(--error);
}

.shop-checkout-receipt {
    background: #fff;
    border-radius: var(--radius, 10px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 1.25rem 1.25rem 1.5rem;
    position: relative;
}

.shop-checkout-receipt::after {
    content: '';
    display: block;
    height: 12px;
    margin: 1rem -1.25rem -1.5rem;
    background:
        linear-gradient(135deg, #fff 33.33%, transparent 33.33%) 0 0,
        linear-gradient(225deg, #fff 33.33%, transparent 33.33%) 0 0;
    background-size: 12px 12px;
    background-color: var(--checkout-bg);
}

.shop-checkout-receipt__title {
    margin: 0 0 1rem;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
}

.shop-checkout-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.shop-checkout-table th,
.shop-checkout-table td {
    padding: 0.55rem 0;
    border-bottom: 1px solid #eee;
    text-align: right;
    vertical-align: top;
}

.shop-checkout-table thead th {
    font-weight: 600;
    border-bottom-width: 2px;
}

.shop-checkout-table tfoot th {
    font-weight: 500;
}

.shop-checkout-table__muted {
    color: var(--ink-muted, #777);
    font-size: 0.85rem;
}

.shop-checkout-table__total-row td,
.shop-checkout-table__total-row th {
    border-bottom: none;
    padding-top: 0.75rem;
    font-size: 1.05rem;
}

.shop-checkout-payment {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.shop-checkout-payment__brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.shop-checkout-payment__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 6px;
    background: #ffc107;
    color: #1a1a1a;
    font-weight: 700;
    font-size: 1.1rem;
}

.shop-checkout-payment__note {
    margin: 0.65rem 0 0;
    padding: 0.65rem 0.85rem;
    background: #f3f3f3;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--ink-muted, #666);
}

.shop-checkout-payment__note--warn {
    background: #fff8e6;
    color: #8a6d00;
}

.shop-checkout-privacy {
    margin: 1rem 0;
    font-size: 0.82rem;
    color: var(--ink-muted, #777);
    line-height: 1.6;
}

.shop-checkout-submit {
    display: block;
    width: 100%;
    padding: 0.95rem 1rem;
    border: none;
    border-radius: 6px;
    background: var(--checkout-accent);
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.shop-checkout-submit:hover:not(:disabled) {
    filter: brightness(1.05);
}

.shop-checkout-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.shop-checkout-back {
    margin: 0.85rem 0 0;
    text-align: center;
    font-size: 0.9rem;
}

.shop-checkout-back a {
    color: var(--checkout-accent);
}

.shop-checkout-empty,
.shop-checkout-stale {
    text-align: center;
}

.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;
}

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

    .shop-checkout-order {
        order: -1;
    }

    .shop-checkout-form__row--2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .shop-product,
    .shop-detail {
        grid-template-columns: 1fr;
    }

    .shop-cart-item {
        grid-template-columns: 72px 1fr;
    }

    .shop-cart-item__actions {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* ——— مدیریت کاربران — دسترسی منو ——— */
.perm-picker-wrap {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.perm-picker-wrap__title {
    margin: 0 0 0.75rem;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.perm-admin-toggle {
    margin-top: 0.5rem;
}

.perm-admin-toggle__label {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--sand-50);
    cursor: pointer;
}

.perm-admin-toggle__label strong {
    display: block;
    font-size: 13px;
}

.perm-admin-toggle__label small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--ink-muted);
    font-weight: 400;
}

.perm-picker__toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.perm-picker__hint {
    margin: 0;
}

.perm-picker__toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

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

.perm-picker__grid--single {
    grid-template-columns: 1fr;
}

.perm-picker__panel {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    overflow: hidden;
}

.perm-picker__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    list-style: none;
    background: var(--sand-50);
    border-bottom: 1px solid transparent;
    user-select: none;
}

.perm-picker__panel[open] .perm-picker__summary {
    border-bottom-color: var(--border);
}

.perm-picker__summary::-webkit-details-marker {
    display: none;
}

.perm-picker__summary-main {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.perm-picker__group-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.perm-picker__count {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-muted);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
}

.perm-picker__body {
    padding: 0.65rem 0.85rem 0.85rem;
}

.perm-picker__section-title {
    margin: 0.65rem 0 0.35rem;
    padding-top: 0.55rem;
    border-top: 1px dashed var(--border);
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-muted);
    letter-spacing: 0.02em;
}

.perm-picker__body .perm-picker__section-title:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.perm-picker__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.perm-picker__item + .perm-picker__item {
    margin-top: 0.15rem;
}

.perm-picker__label {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.4rem 0.45rem;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 400;
    color: var(--ink);
    cursor: pointer;
    line-height: 1.45;
}

.perm-picker__label:hover {
    background: var(--sand-50);
}

.perm-picker__item-cb {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.perm-picker__table {
    margin: 0;
}

.perm-picker__table th,
.perm-picker__table td {
    vertical-align: middle;
}

.perm-picker__col-action {
    width: 5.5rem;
    text-align: center;
    white-space: nowrap;
}

.perm-picker__col-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.perm-picker__item-name {
    font-size: 13px;
    min-width: 180px;
}

.perm-picker__section-row td {
    background: var(--sand-50);
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-muted);
    padding-top: 0.55rem;
    padding-bottom: 0.35rem;
    border-top: 1px dashed var(--border);
}

.perm-picker__section-row:first-child td {
    border-top: 0;
}

.user-perm-page__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.user-perm-roles-hint {
    margin-bottom: 1rem;
}

.user-perm-card__role-note {
    margin-top: 0.75rem;
}

.user-perm-table__role-users {
    display: inline-block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-muted, #64748b);
}

.user-perm-table {
    margin: 0;
    min-width: 560px;
}

.user-perm-table__col-user {
    width: 32%;
}

.user-perm-table__col-summary {
    width: 38%;
}

.user-perm-table__col-actions {
    width: 30%;
}

.user-perm-table__cell-user,
.user-perm-table__cell-summary,
.user-perm-table__cell-actions {
    vertical-align: middle;
}

.user-perm-table__username {
    display: inline-block;
    margin: 0;
    padding: 0.15rem 0.45rem;
    font-size: 13px;
    background: var(--sand-50);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.user-perm-table__summary-text {
    display: block;
    font-size: 13px;
    color: var(--ink);
    line-height: 1.5;
}

.user-perm-table__actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.4rem;
}

.user-perm-table__cell-actions {
    text-align: right;
}

.user-perm-panel {
    margin-top: 1rem;
}

.user-perm-panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.user-perm-panel[hidden] {
    display: none !important;
}

.user-perm-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.user-perm-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--sand-50);
    padding: 1rem 1.1rem;
}

.user-perm-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.user-perm-card__identity {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.user-perm-card__username {
    font-size: 14px;
    font-weight: 600;
    background: var(--card);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.user-perm-card__head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.user-perm-card__fields {
    margin-bottom: 0.25rem;
}

.user-perm-card__menus {
    margin-top: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
}

.user-perm-card__menus > summary {
    padding: 0.7rem 1rem;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.user-perm-card__menus > summary::-webkit-details-marker {
    display: none;
}

.user-perm-card__menus .perm-picker-wrap {
    margin: 0;
    padding: 0 1rem 1rem;
    border-top: 0;
}

.user-perm-card__admin-note {
    margin: 0.5rem 0 0;
}

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

@media print {
    .preinvoice-approve-panel {
        display: none !important;
    }
}

/* ——— صفحه ورود (/login) ——— */
.route-login-page {
    --site-header-height: 0;
    min-height: 100vh;
    min-height: 100dvh;
}

.route-login-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding:
        max(20px, env(safe-area-inset-top, 0px))
        max(16px, env(safe-area-inset-right, 0px))
        max(20px, env(safe-area-inset-bottom, 0px))
        max(16px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
}

.route-login-card {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 1.35rem 1.25rem 1.5rem;
}

.route-login-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.route-login-brand__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--sage-500) 0%, var(--sage-600) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sage);
}

.route-login-brand__icon svg {
    width: 24px;
    height: 24px;
}

.route-login-brand__text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.route-login-brand__text strong {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
}

.route-login-brand__text span {
    font-size: 0.9rem;
    color: var(--ink-muted);
}

.route-login-lead {
    margin: 0 0 1.1rem;
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--ink-muted);
}

.route-login-message {
    margin: 0 0 1rem;
    text-align: right;
}

.route-login-form .form-group:last-of-type {
    margin-bottom: 1.1rem;
}

.route-login-submit {
    margin-top: 0;
}

/* بدون هدر/فوتر تا قبل از ورود */
body.site-chrome-hidden .main {
    padding-top: max(16px, env(safe-area-inset-top, 0px));
}

body.site-chrome-hidden .skip-link {
    display: none;
}

@media (max-width: 768px) {
    .route-login-page .route-login-input {
        font-size: 16px;
        min-height: 48px;
    }

    .route-login-card {
        padding: 1.15rem 1rem 1.35rem;
    }

    body.site-chrome-hidden .main {
        padding-top: max(12px, env(safe-area-inset-top, 0px));
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    }
}

/* PackPrice — حالت فروش و بنر راهنما */
body.calc-sales-mode .check-item--uv,
body.calc-sales-mode .check-item--gold,
body.calc-sales-mode .check-item--silk,
body.calc-sales-mode #goldStampDesignBlock,
body.calc-sales-mode #silkScreenDesignBlock,
body.calc-sales-mode #hasUVHint,
body.calc-fast-sales-mode .check-item--uv,
body.calc-fast-sales-mode .check-item--gold,
body.calc-fast-sales-mode .check-item--silk,
body.calc-fast-sales-mode #goldStampDesignBlock,
body.calc-fast-sales-mode #silkScreenDesignBlock,
body.calc-fast-sales-mode #hasUVHint {
    display: none !important;
}

body.calc-sales-mode #calcStepper,
body.calc-sales-mode #calcSection1,
body.calc-sales-mode #calcSection2,
body.calc-sales-mode #calcSection6,
body.calc-sales-mode #calcSection5 .check-item,
body.calc-sales-mode #orderModeBlock,
body.calc-sales-mode .order-glance__tech,
body.calc-sales-mode .result-cost-breakdown,
body.calc-sales-mode .result-details,
body.calc-sales-mode #calcQuoteModeBanner {
    display: none !important;
}

body.calc-sales-mode .calc-sales-share-btn {
    font-size: 1.05rem;
    padding: 0.65rem 1.25rem;
}

body.calc-sales-mode .calc-sales-whatsapp-btn:not([hidden]) {
    font-weight: 600;
}

.calc-sales-mode-banner {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: #e3f2fd;
    border: 1px solid #90caf9;
    font-size: 0.92rem;
}

.calc-sales-mode-banner p {
    margin: 0.25rem 0;
}

.calc-quote-mode-banner {
    margin: 0 0 1rem;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    font-size: 0.92rem;
}

.calc-quote-mode-banner--server {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #1b5e20;
}

.calc-quote-mode-banner--browser {
    background: #fff8e1;
    border: 1px solid #ffe082;
    color: #6d4c00;
}

.result-actions--copy-templates {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

