/* PainServ CMS — премиальный минимализм, light theme */

:root {
  --color-bg: #fff;
  --color-text: #1d1d1f;
  --color-text-muted: rgba(29, 29, 31, 0.62);
  --color-border: rgba(29, 29, 31, 0.12);
  --color-surface: #f5f5f7;
  --color-accent: #007aff;
  --color-accent-hover: #0066d6;
  --color-gray: #6b7280;
  --color-danger: #ff3b30;
  --color-focus: rgba(0, 122, 255, 0.45);

  --spacing-unit: 8px;
  --catalog-sidebar-xl: 320px;
  --catalog-sidebar-lg: 280px;
  --catalog-sidebar-md: 260px;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-base: 1rem;
  --text-sm: 0.875rem;
  --text-lg: 1.125rem;
  --heading-1: clamp(2rem, 4vw, 2.75rem);
  --heading-2: clamp(1.5rem, 3vw, 2rem);
  --heading-3: 1.25rem;
  --line-height: 1.55;
  --line-height-tight: 1.25;

  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4.5rem;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --max-content: 75rem;
  --max-prose: 42rem;

  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.08);

  /* Stacking: page content < mobile nav < modals < toasts */
  --z-mobile-nav: 200;
  --z-modal: 1000;
  --z-toast: 1100;
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

@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;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--line-height);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

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

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: var(--space-sm);
  z-index: 1000;
  padding: var(--space-xs) var(--space-md);
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  left: var(--space-md);
}

/* Header */
/* Site header styles moved to static/portal_cms/css/header.css */

main {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: var(--space-xl) clamp(1.25rem, 4vw, 2.5rem) var(--space-2xl);
}

.section-block {
  margin-bottom: var(--space-2xl);
}

.section-title {
  margin: 0 0 var(--space-lg);
  font-size: var(--heading-2);
  font-weight: 700;
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.section-subtitle {
  margin: 0 0 var(--space-md);
  font-size: var(--heading-3);
  font-weight: 600;
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

.prose {
  max-width: var(--max-prose);
  line-height: var(--line-height);
}

.prose p {
  margin: 0 0 var(--space-md);
  color: var(--color-text-muted);
}

/* Cards */
.card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: clamp(1.25rem, 3vw, 2rem);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* Carousel (scroll-snap + a11y) */
.hero-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-2xl);
  background-color: var(--color-surface);
  isolation: isolate;
}

.carousel-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.carousel-viewport::-webkit-scrollbar {
  display: none;
}

@supports not (scroll-snap-type: x mandatory) {
  .carousel-viewport {
    scroll-snap-type: none;
  }
}

.carousel-track {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  min-height: clamp(16rem, 42vw, 22rem);
}

.carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  min-height: clamp(16rem, 42vw, 22rem);
}

.carousel-slide img {
  display: block;
  width: 100%;
  height: clamp(16rem, 42vw, 22rem);
  object-fit: cover;
}

.carousel-caption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 1;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.72) 100%);
  color: #fff;
}

.carousel-caption--solo {
  position: relative;
  min-height: clamp(16rem, 42vw, 22rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(135deg, var(--color-accent) 0%, #1a3a52 100%);
}

.carousel-caption__title {
  margin: 0 0 var(--space-sm);
  font-size: clamp(1.35rem, 3.5vw, var(--heading-1));
  font-weight: 700;
  line-height: var(--line-height-tight);
  max-width: var(--max-prose);
  text-wrap: balance;
}

.carousel-caption__text {
  margin: 0 0 var(--space-md);
  max-width: 36ch;
  line-height: var(--line-height);
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  opacity: 0.95;
}

.carousel-caption__cta {
  margin-top: var(--space-xs);
}

.carousel-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.carousel-control {
  position: absolute;
  top: 50%;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.95);
  color: var(--color-text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: transform var(--transition-fast), background-color var(--transition-fast);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.carousel-control:hover {
  transform: translateY(-50%) scale(1.05);
  background-color: #fff;
}

.carousel-control:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.carousel-control--prev {
  left: var(--space-md);
}

.carousel-control--next {
  right: var(--space-md);
}

.carousel-indicators {
  position: absolute;
  left: 50%;
  bottom: var(--space-md);
  z-index: 3;
  transform: translateX(-50%);
  pointer-events: none;
}

.carousel-indicators--glass {
  --glass-fill: rgba(255, 255, 255, 0.14);
  --glass-stroke: rgba(255, 255, 255, 0.32);
  --glass-highlight: rgba(255, 255, 255, 0.45);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
  --glass-blur: 14px;
  padding: 0.4rem 0.55rem;
  border-radius: 999px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-stroke);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
  backdrop-filter: blur(var(--glass-blur)) saturate(165%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(165%);
  pointer-events: auto;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .carousel-indicators--glass {
    background: rgba(29, 29, 31, 0.55);
    border-color: rgba(255, 255, 255, 0.2);
  }
}

.carousel-indicators__track {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.carousel-indicators__thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-50%) translateX(var(--thumb-x, 0));
  transition: transform 0.45s cubic-bezier(0.34, 1.35, 0.64, 1);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.carousel-indicator {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.carousel-indicator__dot {
  display: block;
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.52);
  transition:
    transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1),
    background-color 0.25s ease,
    box-shadow 0.25s ease;
}

.carousel-indicator.is-active .carousel-indicator__dot,
.carousel-indicator[aria-current="true"] .carousel-indicator__dot {
  transform: scale(1.15);
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.55);
}

.carousel-indicator:not(.is-active):hover .carousel-indicator__dot {
  background: rgba(255, 255, 255, 0.78);
}

.carousel-indicator:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

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

  .carousel-control,
  .carousel-indicator,
  .carousel-indicators__thumb {
    transition: none;
  }
}

@media (max-width: 47.99rem) {
  .carousel-control {
    min-width: 2.5rem;
    min-height: 2.5rem;
    font-size: 1.25rem;
  }

  .carousel-control--prev {
    left: var(--space-sm);
  }

  .carousel-control--next {
    right: var(--space-sm);
  }

  .carousel-indicators {
    bottom: var(--space-sm);
  }

  .carousel-caption {
    padding-bottom: 3.25rem;
  }
}

/* Forum preview */
.forum-preview .forum-row {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  margin-bottom: var(--space-lg);
}

.avatar {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--color-surface);
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--color-accent);
}

.forum-preview h3 {
  margin: 0 0 var(--space-xs);
  font-size: var(--heading-3);
  font-weight: 600;
  line-height: var(--line-height-tight);
}

.forum-preview .meta {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.forum-preview .preview {
  margin: 0;
  max-width: var(--max-prose);
  color: var(--color-text-muted);
  line-height: var(--line-height);
}

.badge {
  margin-left: var(--space-xs);
}

/* Product grid */
.partner-grid {
  margin-bottom: var(--space-2xl);
}

.grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.product-card img {
  border-radius: var(--radius-sm);
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.product-card h3 {
  margin: 0;
  font-size: var(--heading-3);
  font-weight: 600;
  line-height: var(--line-height-tight);
}

.product-card p {
  margin: 0;
  flex-grow: 1;
  font-size: var(--text-sm);
  line-height: var(--line-height);
  color: var(--color-text-muted);
}

.price {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
}

.price s {
  margin-right: var(--space-xs);
  font-weight: 400;
  color: var(--color-text-muted);
}

.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent);
  background-color: rgba(0, 122, 255, 0.1);
  border-radius: var(--radius-sm);
}

.product-card.promo {
  background-color: var(--color-surface);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  color: #fff;
  background-color: var(--color-accent);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition-fast), transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.btn:hover {
  background-color: var(--color-accent-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.28);
}

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

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.btn-outline {
  color: var(--color-accent);
  background-color: transparent;
  border-color: var(--color-accent);
}

.btn-outline:hover {
  color: #fff;
  background-color: var(--color-accent);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--text-sm);
}

/* Order forms */
.order-forms {
  scroll-margin-top: 5rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.tab {
  padding: 0.65rem 1.25rem;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast),
    background-color var(--transition-fast), transform var(--transition-fast);
}

.tab:hover {
  color: var(--color-text);
  transform: translateY(-1px);
}

.tab.is-active {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background-color: rgba(0, 122, 255, 0.06);
}

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

.order-form {
  display: none;
  max-width: 50rem;
}

.order-form.is-active {
  display: block;
}

.order-forms__pick-type {
  margin: 0 0 var(--space-lg);
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface, rgba(0, 0, 0, 0.02));
}

.order-forms:has(.order-form.is-active) .order-forms__pick-type {
  display: none;
}

.field {
  margin-bottom: var(--space-md);
}

.field label {
  display: block;
  margin-bottom: var(--space-xs);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: var(--text-base);
  line-height: var(--line-height-tight);
  color: var(--color-text);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--color-accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--color-focus);
}

.field.invalid input,
.field.invalid select {
  border-color: var(--color-danger);
}

.item-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  align-items: end;
}

.item-row__color {
  grid-column: 1 / -1;
}

fieldset {
  margin: var(--space-md) 0;
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

fieldset legend {
  padding: 0 var(--space-xs);
  font-weight: 600;
}

.box-visual {
  margin: var(--space-md) 0;
  padding: var(--space-lg);
  text-align: center;
  background-color: var(--color-surface);
  border-radius: var(--radius-sm);
}

.box-shape {
  display: inline-flex;
  gap: var(--space-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
}

/* Painting order form — UX system (8px grid) */
.painting-form {
  max-width: none;
  font-size: 14px;
  line-height: 1.4;
  --painting-accent: #007aff;
  --painting-accent-soft: rgba(0, 122, 255, 0.08);
  --painting-accent-flash: rgba(0, 122, 255, 0.1);
  --painting-success: #34c759;
  --painting-error: #f44336;
  --painting-warning: #ff9800;
  --painting-radius: 12px;
}

.painting-form__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.painting-form__title {
  margin: 0 0 0.25rem;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 700;
  line-height: 1.25;
}

.painting-form__lead {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  max-width: 36rem;
}

.painting-form__eta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--color-surface);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.painting-form__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 var(--space-lg);
  padding: 0;
  list-style: none;
}

.painting-form__step {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-surface);
  transition: background-color 0.25s ease, color 0.25s ease;
}

.painting-form__step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  font-size: 0.6875rem;
  font-weight: 700;
  background: rgba(29, 29, 31, 0.08);
}

.painting-form__step.is-active {
  color: var(--painting-accent);
  background: var(--painting-accent-soft);
}

.painting-form__step.is-active span {
  background: var(--painting-accent);
  color: #fff;
}

.painting-form__step.is-done {
  color: var(--painting-success);
}

.painting-form__step.is-done span {
  background: var(--painting-success);
  color: #fff;
}

.painting-form__step {
  cursor: pointer;
}

.painting-form__progress {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 var(--space-md);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.painting-form__progress-bar {
  height: 0.35rem;
  border-radius: 999px;
  background: var(--color-surface);
  overflow: hidden;
}

.painting-form__progress-bar span {
  display: block;
  height: 100%;
  width: 20%;
  background: var(--painting-accent);
  transition: width 0.25s ease;
}

.painting-form--wizard fieldset[data-form-step] {
  display: none;
}

.painting-form--wizard fieldset[data-form-step].is-wizard-visible {
  display: block;
}

.painting-form__nav {
  display: flex;
  gap: 0.75rem;
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
}

.painting-form__nav .btn {
  min-width: 7rem;
}

.painting-form__nav [data-painting-next] {
  margin-left: auto;
}

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

.painting-composition-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.painting-composition-count {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.painting-items-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 1.35rem 1.25rem;
  border: 1px dashed var(--color-border);
  border-radius: var(--painting-radius);
  background: var(--color-surface);
}

.painting-items-empty[hidden] {
  display: none !important;
}

.painting-items-empty__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.painting-items-empty__text {
  margin: 0;
  max-width: 36rem;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.painting-composition-list[hidden] {
  display: none !important;
}

.painting-items-summary {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.painting-items-summary__card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--painting-radius);
  background: var(--color-bg);
  outline: none;
  transition: background-color 0.9s ease, border-color 0.9s ease, box-shadow 0.9s ease;
}

.painting-items-summary__card.is-just-saved {
  border-color: var(--painting-accent);
  background: var(--painting-accent-soft);
  box-shadow: 0 0 0 2px var(--painting-accent-soft);
}

.painting-items-summary__title {
  display: block;
  font-size: 1rem;
}

.painting-items-summary__meta {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.painting-items-summary__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.painting-type-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.painting-type-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--painting-radius);
  cursor: pointer;
  background: var(--color-surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.painting-type-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.painting-type-card.is-selected {
  border-color: var(--painting-accent);
  box-shadow: 0 0 0 2px var(--painting-accent-soft);
  background: #fff;
}

.painting-type-card__title {
  font-weight: 700;
}

.painting-type-card__desc {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.painting-item-editor {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  justify-content: flex-end;
}

.painting-item-editor[hidden] {
  display: none !important;
}

.painting-item-editor__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 19, 0.45);
}

.painting-item-editor__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  height: 100%;
  background: var(--color-bg, #fff);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
  animation: painting-editor-in 0.22s ease;
}

@keyframes painting-editor-in {
  from { transform: translateX(16px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.painting-item-editor__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.painting-item-editor__eyebrow {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.painting-item-editor__mobile-step {
  display: none;
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--painting-accent);
}

.painting-item-editor__title {
  margin: 0.15rem 0 0;
  font-size: 1.2rem;
  outline: none;
  border-radius: 0.25rem;
  transition: background-color 0.45s ease, box-shadow 0.45s ease;
}

.painting-item-editor__title.is-flash {
  background: var(--painting-accent-soft);
  box-shadow: 0 0 0 4px var(--painting-accent-soft);
}

.painting-item-editor__close {
  font-size: 1.5rem;
  line-height: 1;
  min-width: 2.5rem;
}

.painting-item-editor__steps {
  display: flex;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.painting-item-editor__steps li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  padding: 0.2rem 0.35rem;
  border-radius: 999px;
}

.painting-item-editor__steps li.is-clickable {
  cursor: pointer;
}

.painting-item-editor__steps li:not(.is-clickable):not(.is-active) {
  opacity: 0.65;
}

.painting-item-editor__step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--color-surface);
  font-weight: 700;
  font-size: 0.6875rem;
}

.painting-item-editor__steps li.is-active {
  color: var(--painting-accent);
  font-weight: 700;
  background: var(--painting-accent-soft);
}

.painting-item-editor__steps li.is-active .painting-item-editor__step-num,
.painting-item-editor__steps li.is-done .painting-item-editor__step-num {
  background: var(--painting-accent);
  color: #fff;
}

.painting-item-editor__banner {
  margin: 0;
  padding: 0.65rem 1.1rem;
  background: #fff4f0;
  color: #9a3412;
  font-size: 0.875rem;
  font-weight: 600;
  border-bottom: 1px solid #fed7aa;
  flex-shrink: 0;
}

.painting-item-editor__banner[hidden] {
  display: none !important;
}

.painting-item-editor__body {
  flex: 1;
  overflow: auto;
  padding: 1rem 1.1rem;
  -webkit-overflow-scrolling: touch;
}

.painting-item-editor__body .order-position-card {
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

.painting-item-editor__body .order-position-card__header,
.painting-item-editor__body .order-position-card__actions {
  display: none;
}

.painting-item-editor__body [data-editor-block].is-enter-forward {
  animation: painting-editor-slide-forward 220ms ease;
}

.painting-item-editor__body [data-editor-block].is-enter-back {
  animation: painting-editor-slide-back 220ms ease;
}

@keyframes painting-editor-slide-forward {
  from { opacity: 0.35; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes painting-editor-slide-back {
  from { opacity: 0.35; transform: translateX(-18px); }
  to { opacity: 1; transform: translateX(0); }
}

.painting-item-editor__footer {
  display: flex;
  gap: 0.65rem;
  padding: 0.85rem 1.1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
  flex-shrink: 0;
}

.painting-item-editor__footer .btn {
  flex: 1;
}

body.painting-item-editor-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .painting-item-editor__panel,
  .painting-item-editor__body [data-editor-block].is-enter-forward,
  .painting-item-editor__body [data-editor-block].is-enter-back,
  .painting-items-summary__card,
  .painting-item-editor__title {
    animation: none !important;
    transition: none !important;
  }
}

.painting-form__section {
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--painting-radius);
  background: var(--color-bg);
  transition: box-shadow 0.25s ease;
}

.painting-form__section:focus-within {
  box-shadow: 0 0 0 3px var(--color-focus);
}

.painting-form__legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 var(--space-xs);
  font-weight: 700;
  font-size: var(--text-lg);
}

.painting-form__legend-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  font-size: 0.8125rem;
  background: var(--painting-accent-soft);
  color: var(--painting-accent);
}

.painting-form__section-desc {
  margin: 0 0 var(--space-md);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.painting-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}

.painting-form__grid-full {
  grid-column: 1 / -1;
}

.painting-form__grid--logistics {
  margin-top: var(--space-md);
}

.painting-phone-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.painting-phone-wrap:focus-within {
  border-color: var(--painting-accent);
  box-shadow: 0 0 0 3px var(--color-focus);
}

.has-error .painting-phone-wrap {
  border-color: var(--painting-error);
}

.painting-phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  background: var(--color-surface);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  border-right: 1px solid var(--color-border);
}

.painting-phone-input {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.field.has-error .input:not(.painting-phone-input) {
  border-color: var(--painting-error);
}

.field-error {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--painting-error);
}

.field-hint--counter {
  text-align: right;
}

.field-hint--cell {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.6875rem;
}

.field-hint-inline {
  font-weight: 400;
  color: var(--color-text-muted);
}

.painting-form__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.positions-container,
.order-positions-container {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  list-style: none;
  margin: 0;
  padding: 0;
}

.order-position-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--painting-radius);
  background: var(--color-bg);
  transition: all 0.3s ease;
}

.order-position-card.is-active,
.order-position-card.has-focus {
  background: var(--painting-accent-soft);
  border-color: rgba(0, 122, 255, 0.35);
  box-shadow: inset 3px 0 0 var(--painting-accent);
}

.order-position-card.has-focus {
  box-shadow:
    0 4px 16px rgba(0, 122, 255, 0.12),
    inset 3px 0 0 var(--painting-accent);
}

.order-position-card.has-error {
  border-color: rgba(244, 67, 54, 0.45);
  background: rgba(244, 67, 54, 0.04);
}

.order-position-card.is-removing {
  opacity: 0;
}

.order-position-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.order-position-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.order-position-card__type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: var(--painting-accent-soft);
  color: var(--painting-accent);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.type-icon--default { background: var(--painting-accent-soft); color: #007aff; }
.type-icon--linear { background: rgba(0, 122, 255, 0.12); color: #007aff; }
.type-icon--area { background: rgba(255, 152, 0, 0.12); color: #ff9800; }
.type-icon--furniture { background: rgba(88, 86, 214, 0.12); color: #5856d6; }
.type-icon--decor { background: rgba(52, 199, 89, 0.12); color: #34c759; }

.order-position-card.has-focus .type-icon {
  transform: scale(1.05);
}

.order-position-card__index {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.order-position-card__actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.order-position-card__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.order-position-card__action:focus-visible {
  outline: 2px solid var(--painting-accent);
  outline-offset: 2px;
}

.order-position-card__action:hover {
  transform: scale(1.1);
}

.order-position-card__action--copy {
  color: var(--painting-accent);
}

.order-position-card__action--copy:hover {
  background: var(--painting-accent-flash);
}

.order-position-card__action--delete {
  color: var(--painting-error);
}

.order-position-card__action--delete:hover {
  background: rgba(244, 67, 54, 0.1);
}

.order-position-card__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.order-position-card__section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* [hidden] должен побеждать display:flex секций — иначе wizard показывает все шаги сразу */
.order-position-card__section[hidden],
[data-editor-block][hidden] {
  display: none !important;
}

.order-position-card__section--dims {
  padding: 12px;
  border-radius: 10px;
  background: var(--color-surface);
}

.order-position-card__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.order-position-card__dims-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.order-position-card__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.order-position-card__field--wide {
  grid-column: 1 / -1;
}

.order-position-card__field--dim.is-hidden {
  display: none !important;
}

.order-position-card__field--dim.is-visible {
  display: flex;
  animation: order-field-reveal 0.3s ease;
}

.order-position-card__field--height.is-hidden {
  display: none;
}

.order-position-card__field--height.is-visible {
  display: flex;
  animation: order-field-reveal 0.3s ease;
}

@keyframes order-field-reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.order-position-card__field--height:not(.is-hidden):not(.is-visible) {
  display: none;
}

.order-position-card__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}

.order-position-card__label .req {
  color: var(--painting-error);
}

.order-position-card__control {
  position: relative;
  padding-left: 1.25rem;
}

.order-position-card__control--plain,
.order-position-card__field--calc .order-position-card__control {
  padding-left: 0;
}

.order-position-card__field.has-error .order-position-card__control:not(.order-position-card__control--plain)::before {
  content: "⚠";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  color: var(--painting-error);
}

.order-position-card__error {
  font-size: 12px;
  color: var(--painting-error);
}

.order-position-card__unit-badge {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0 0.75rem;
  border-radius: 8px;
  background: var(--painting-accent-soft);
  color: var(--painting-accent);
  font-weight: 700;
  font-size: 14px;
}

.order-position-card__calc {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 14px;
}

.qty-stepper {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all 0.3s ease;
}

.qty-stepper:focus-within {
  border-color: var(--painting-accent);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.25);
}

.qty-stepper__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  min-width: 2.25rem;
  padding: 0;
  border: none;
  background: var(--color-surface);
  color: var(--painting-accent);
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.qty-stepper__btn:hover {
  background: var(--painting-accent-flash);
}

.qty-stepper__btn:focus-visible {
  outline: 2px solid var(--painting-accent);
  outline-offset: -2px;
}

.qty-stepper__input {
  width: 100%;
  min-width: 2.5rem;
  padding: 0.45rem 0.25rem;
  border: none;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  background: var(--color-bg);
}

.qty-stepper__unit {
  display: inline-flex;
  align-items: center;
  padding: 0 0.5rem;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  user-select: none;
}

.qty-stepper__input:focus {
  outline: none;
}

.ral-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.ral-swatch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  background: var(--ral-color, #ccc);
  cursor: pointer;
  transition: all 0.3s ease;
}

.ral-swatch[data-ral="9003"],
.ral-swatch[data-ral="9010"] {
  border-color: #8a9099;
}

.ral-swatch:hover {
  transform: scale(1.1);
  border-color: var(--painting-accent);
}

.ral-swatch:focus-visible {
  outline: 2px solid var(--painting-accent);
  outline-offset: 2px;
}

.ral-swatch.is-selected {
  border-color: var(--painting-accent);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.25);
}

.ral-swatch__check {
  display: none;
  width: 0.55rem;
  height: 0.35rem;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.95)) drop-shadow(0 1px 1px rgba(0, 0, 0, 0.55));
  pointer-events: none;
}

.ral-swatch.is-selected .ral-swatch__check {
  display: block;
}

.order-position-card__reveal.is-hidden {
  display: none;
}

.order-position-card__reveal.is-visible {
  display: block;
  animation: order-field-reveal 0.3s ease;
}

.painting-form .field .field-hint,
.order-position-card__field .field-hint {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
  transition: all 0.3s ease;
}

.painting-form .field:focus-within .field-hint,
.order-position-card__field:focus-within .field-hint {
  opacity: 1;
  max-height: 2.5rem;
  margin-top: 2px;
}

.painting-form .input--error,
.dimension-input.input--error {
  border-color: var(--painting-error) !important;
  box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.2) !important;
}

.order-position-card__field--dim .order-position-card__control {
  max-width: 12.5rem;
}

.dimension-input {
  display: inline-flex;
  align-items: stretch;
  width: 100%;
  max-width: 12.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.dimension-input:focus-within {
  border-color: var(--painting-accent);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.25);
}

.dimension-input__value {
  flex: 1 1 72%;
  min-width: 5rem;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0.5rem 0.65rem !important;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.dimension-input__unit {
  flex: 0 0 2.5rem;
  width: 2.5rem;
  min-width: 2.5rem;
  padding: 0.45rem 0.2rem !important;
  border: none !important;
  border-left: 1px solid var(--color-border) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: var(--color-surface);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: var(--color-text-muted);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='%23666' d='M0 0l4 5 4-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.2rem center;
  padding-right: 0.85rem !important;
}

.painting-form .input:focus,
.painting-form select:focus,
.painting-form textarea:focus {
  outline: none;
  border-color: var(--painting-accent);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.35);
}

.input--sm {
  padding: 0.45rem 0.55rem;
  font-size: var(--text-sm);
}

.input--qty {
  max-width: 4rem;
}

.painting-form__conditional-panel {
  margin-bottom: var(--space-md);
  padding: 0 var(--space-md);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, max-height 0.25s ease, padding 0.2s ease, margin 0.2s ease;
}

.painting-form__conditional-panel.is-visible {
  opacity: 1;
  max-height: 14rem;
  padding: var(--space-md);
}

.painting-unit,
.painting-calc {
  display: inline-block;
  min-width: 3rem;
  font-weight: 600;
  white-space: nowrap;
}

.painting-calc {
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  color: var(--painting-accent);
  background: var(--painting-accent-soft);
  transition: background-color 0.3s ease;
}

.painting-calc.is-updated {
  animation: painting-calc-highlight 0.3s ease;
}

@keyframes painting-calc-highlight {
  from { background: var(--painting-accent-flash); }
  to { background: transparent; }
}

.btn-ghost {
  background: transparent;
  border: 1px dashed var(--color-border);
  color: var(--color-text-muted);
}

.btn-ghost:hover {
  border-color: var(--painting-error);
  color: var(--painting-error);
}

.painting-request-mode {
  margin: 0 0 var(--space-md);
  padding: 0;
  border: 0;
  min-width: 0;
}

.painting-request-mode__legend {
  margin: 0 0 var(--space-sm);
  padding: 0;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.painting-delivery-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.painting-request-mode__cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: var(--space-md);
}

.painting-request-simple {
  margin-top: var(--space-sm);
}

.painting-request-simple textarea.input {
  min-height: 10rem;
  resize: vertical;
  white-space: pre-wrap;
}

.painting-freeform-description {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}


.painting-delivery-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: var(--space-md);
  border: 2px solid var(--color-border);
  border-radius: var(--painting-radius);
  background: var(--color-bg);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

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

.painting-delivery-card:focus-within {
  outline: 2px solid var(--painting-accent);
  outline-offset: 2px;
}

.painting-delivery-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.painting-delivery-card.is-selected {
  border-color: var(--painting-accent);
  background: var(--painting-accent-soft);
  box-shadow: 0 0 0 3px var(--color-focus);
}

.painting-delivery-card__icon {
  font-size: 1.25rem;
}

.painting-delivery-card__title {
  font-weight: 600;
  font-size: var(--text-sm);
}

.painting-delivery-card__desc {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.35;
}

/* --- Единый чекбокс согласия (все формы заказа) --- */

.order-consent-wrap {
  margin: var(--space-md) 0;
}

.order-consent {
  --consent-accent: #007aff;
  --consent-accent-soft: rgba(0, 122, 255, 0.08);
  --consent-accent-hover: rgba(0, 122, 255, 0.12);
  --consent-error: #f44336;
  --consent-error-soft: rgba(244, 67, 54, 0.06);
  --consent-box-size: 1.375rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  min-height: 2.75rem;
  border: 1.5px solid rgba(29, 29, 31, 0.18);
  border-radius: 12px;
  background: var(--color-surface);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
  user-select: none;
}

.order-consent:hover {
  border-color: var(--consent-accent);
  background: var(--consent-accent-soft);
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.08);
}

.order-consent:has(input:checked) {
  border-color: var(--consent-accent);
  background: var(--consent-accent-soft);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.order-consent:has(input:focus-visible) {
  outline: 2px solid var(--consent-accent);
  outline-offset: 2px;
}

.order-consent-wrap.has-error .order-consent {
  border-color: var(--consent-error);
  background: var(--consent-error-soft);
  box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.12);
}

.order-consent-wrap.has-error .order-consent__box {
  border-color: var(--consent-error);
}

.order-consent input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.order-consent__box {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--consent-box-size);
  height: var(--consent-box-size);
  margin-top: 0.1rem;
  border: 2px solid rgba(29, 29, 31, 0.35);
  border-radius: 6px;
  background: #fff;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.order-consent:hover .order-consent__box {
  border-color: var(--consent-accent);
}

.order-consent:has(input:checked) .order-consent__box {
  border-color: var(--consent-accent);
  background: var(--consent-accent);
  transform: scale(1.05);
}

.order-consent:active .order-consent__box {
  transform: scale(0.95);
}

.order-consent:has(input:checked):active .order-consent__box {
  transform: scale(1);
}

.order-consent__icon {
  font-size: 0.6875rem;
  color: #fff;
  opacity: 0;
  transform: scale(0.4);
  transition:
    opacity 0.15s ease,
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.order-consent:has(input:checked) .order-consent__icon {
  opacity: 1;
  transform: scale(1);
}

.order-consent__text {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--color-text);
}

.order-consent__text .req {
  color: var(--consent-error);
  font-weight: 700;
}

.order-consent__link {
  color: var(--consent-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.order-consent__link:hover {
  text-decoration-thickness: 2px;
}

.order-consent__link:focus-visible {
  outline: 2px solid var(--consent-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.order-consent__error {
  margin-top: 0.35rem;
  padding-left: calc(var(--consent-box-size) + 0.75rem + 1rem);
}

.order-consent__hint {
  margin: 0.35rem 0 0;
  padding-left: calc(var(--consent-box-size) + 0.75rem + 1rem);
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

@media (max-width: 767px) {
  .order-consent {
    padding: 1rem;
    min-height: 3rem;
    gap: 0.875rem;
  }

  .order-consent__box {
    --consent-box-size: 1.5rem;
    margin-top: 0.05rem;
  }

  .order-consent__text {
    font-size: 1rem;
    line-height: 1.5;
  }

  .order-consent__error,
  .order-consent__hint {
    padding-left: calc(var(--consent-box-size) + 0.875rem + 1rem);
  }
}

.painting-link {
  color: var(--painting-accent);
  text-underline-offset: 2px;
}

.painting-form__submit-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.painting-form__submit {
  min-width: 12rem;
  position: relative;
}

.painting-form__submit.is-loading {
  pointer-events: none;
  opacity: 0.85;
}

.painting-form__spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-left: 0.5rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: painting-spin 0.7s linear infinite;
  vertical-align: middle;
}

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

.painting-form__submit[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.painting-form__calc-quote[hidden] {
  display: none !important;
}

.painting-form__calc-quote:not([hidden]) {
  display: grid;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  padding: var(--space-sm);
  border: 1px solid rgba(0, 122, 255, 0.2);
  background: rgba(0, 122, 255, 0.04);
  border-radius: 10px;
}

.painting-form__calc-quote-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-xs);
}

.painting-form__calc-quote-detail {
  margin-top: 0.25rem;
}

.painting-form__calc-quote-diff {
  margin: 0;
}

.painting-review__lead {
  margin: 0 0 var(--space-sm);
}

.painting-review__price-diff {
  display: grid;
  gap: 0.35rem;
  margin: var(--space-sm) 0;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted, rgba(0, 0, 0, 0.03));
}

.painting-review__price-diff p {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  margin: 0;
}

.painting-review-note--warn {
  color: var(--painting-error, #ff3b30);
}

.order-estimate-items {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  font-size: var(--text-sm);
}

.painting-form__calc-quote-text {
  margin: 0;
  font-size: 0.9375rem;
}

.painting-success__actions {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.painting-success__actions[hidden] {
  display: none;
}

.painting-form__submit-hint {
  margin: 0;
}

.btn-lg {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
}

.field-label .req {
  color: var(--painting-error);
}

.field-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.painting-success__dialog {
  text-align: center;
  max-width: 24rem;
}

.painting-success__icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(52, 199, 89, 0.15);
  color: var(--painting-success);
  font-size: 1.5rem;
  font-weight: 700;
}

.painting-success__number {
  margin: 0 0 var(--space-sm);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--painting-accent);
}

.painting-success__text {
  margin-bottom: var(--space-md);
}

.painting-success .modal__backdrop {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.painting-success:not([hidden]) .modal__dialog {
  pointer-events: auto;
}

.painting-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 9999;
  max-width: min(90vw, 22rem);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(29, 29, 31, 0.92);
  color: #fff;
  font-size: var(--text-sm);
  transform: translate(-50%, 120%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.painting-toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (min-width: 64rem) {
  .order-positions-container {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 63.99rem) {
  .order-positions-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 47.99rem) {
  .painting-form__grid,
  .painting-delivery-cards {
    grid-template-columns: 1fr;
  }

  .painting-request-mode__cards {
    grid-template-columns: 1fr;
  }

  .order-positions-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .order-position-card {
    padding: 16px;
  }

  .order-position-card__row,
  .order-position-card__dims-grid {
    grid-template-columns: 1fr;
  }

  .order-position-card__header {
    flex-wrap: wrap;
  }

  .order-position-card__actions {
    gap: 8px;
    margin-left: auto;
  }

  .order-position-card__action {
    width: 2.75rem;
    height: 2.75rem;
  }

  .qty-stepper__btn {
    width: 2.75rem;
    min-width: 2.75rem;
  }

  .ral-swatch {
    width: 2.25rem;
    height: 2.25rem;
  }

  .order-position-card__field--dim .order-position-card__control,
  .dimension-input {
    max-width: none;
  }

  .dimension-input__value {
    flex: 1 1 75%;
    min-width: 6rem;
    font-size: 16px;
    padding: 0.55rem 0.75rem !important;
  }

  .dimension-input__unit {
    flex: 0 0 2.75rem;
    width: 2.75rem;
    min-width: 2.75rem;
    font-size: 12px;
    min-height: 2.75rem;
  }

  .painting-form__header {
    flex-direction: column;
  }

  .painting-form__steps {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.25rem;
  }

  .painting-form__submit-wrap {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: var(--space-sm) 0;
    background: linear-gradient(transparent, var(--color-bg) 30%);
  }

  .painting-form__submit {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .order-position-card,
  .painting-calc,
  .painting-delivery-card,
  .painting-form__step,
  .order-position-card__reveal,
  .order-position-card__field--height,
  .qty-stepper__btn,
  .ral-swatch,
  .order-position-card__action,
  .painting-form__conditional-panel,
  .painting-toast,
  .order-consent,
  .order-consent__box,
  .order-consent__icon {
    transition: none;
  }

  .painting-calc.is-updated {
    animation: none;
  }

  .painting-form__spinner {
    animation: none;
  }
}

/* FAQ */
.faq-section {
  scroll-margin-top: 5rem;
}

.faq-section__head {
  margin-bottom: var(--space-md);
}

.faq-section__lead {
  margin: 0.35rem 0 0;
  max-width: 40rem;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.faq-panel {
  --faq-accent: var(--color-accent);
  --faq-accent-soft: rgba(0, 122, 255, 0.08);
  --faq-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.faq-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.faq-toolbar__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.faq-controls {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.faq-controls__btn {
  min-height: 2.25rem;
  font-size: 12px;
  font-weight: 600;
}

.faq-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 36rem;
}

.faq-search__icon {
  position: absolute;
  left: 0.875rem;
  z-index: 1;
  font-size: 1.125rem;
  line-height: 1;
  color: var(--color-text-muted);
  pointer-events: none;
}

.faq-search__input {
  width: 100%;
  min-height: 2.75rem;
  padding-left: 2.5rem;
  padding-right: 2.75rem;
  border-radius: var(--faq-radius);
  border: 1.5px solid var(--color-border);
  background: var(--color-bg);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

.faq-search__input:hover {
  border-color: rgba(0, 122, 255, 0.35);
}

.faq-search__input:focus-visible {
  outline: none;
  border-color: var(--faq-accent);
  box-shadow: 0 0 0 3px var(--color-focus);
}

.faq-search__clear {
  position: absolute;
  right: 0.35rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
}

.faq-search__status {
  margin: 0;
  min-height: 1.25rem;
  font-size: 12px;
  color: var(--color-text-muted);
}

.faq-nav {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.15rem;
}

.faq-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.faq-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.faq-nav__link:hover {
  border-color: var(--faq-accent);
  background: var(--faq-accent-soft);
  color: var(--faq-accent);
  box-shadow: var(--shadow-sm);
}

.faq-nav__link:active {
  transform: translateY(1px);
}

.faq-nav__link:focus-visible {
  outline: 2px solid var(--faq-accent);
  outline-offset: 2px;
  box-shadow: var(--shadow-sm);
}

.faq-nav__link.is-active,
.faq-nav__link[aria-current="true"] {
  border-color: var(--faq-accent);
  background: var(--faq-accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.25);
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: none;
}

.faq-category {
  scroll-margin-top: 5.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--faq-radius);
  background: var(--color-bg);
  overflow: hidden;
  transition:
    box-shadow var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

.faq-category.is-open {
  border-color: rgba(0, 122, 255, 0.35);
  box-shadow: var(--shadow-hover);
}

.faq-category:focus-within {
  box-shadow: 0 0 0 3px var(--color-focus);
}

.faq-category__details > summary {
  list-style: none;
}

.faq-category__details > summary::-webkit-details-marker {
  display: none;
}

.faq-category__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) 1.125rem;
  cursor: pointer;
  background: var(--color-surface);
  transition:
    background var(--transition-base),
    box-shadow var(--transition-base);
  user-select: none;
}

.faq-category__summary:hover {
  background: var(--faq-accent-soft);
  box-shadow: var(--shadow-sm);
}

.faq-category__summary:active {
  background: rgba(0, 122, 255, 0.12);
}

.faq-category__summary:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--faq-accent), 0 0 0 3px var(--color-focus);
}

.faq-category__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  min-width: 0;
}

.faq-category__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--faq-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.faq-category__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
}

.faq-category__count {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.2;
}

.faq-category__toggle,
.faq-item__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  transition:
    background var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-fast);
}

.faq-category__summary:hover .faq-category__toggle,
.faq-item__summary:hover .faq-item__toggle {
  border-color: var(--faq-accent);
  background: var(--faq-accent-soft);
  box-shadow: var(--shadow-sm);
}

.faq-category.is-open .faq-category__toggle,
.faq-item[open] .faq-item__toggle {
  background: var(--faq-accent);
  border-color: var(--faq-accent);
}

.faq-chevron {
  display: block;
  width: 1.125rem;
  height: 1.125rem;
  color: var(--color-text);
  transition: transform var(--transition-base), color var(--transition-base);
}

.faq-category.is-open .faq-chevron,
.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
  color: #fff;
}

.faq-category__body {
  padding: var(--space-sm) var(--space-md) var(--space-md);
  background: linear-gradient(180deg, rgba(245, 245, 247, 0.65) 0%, var(--color-bg) 100%);
  border-top: 1px solid var(--color-border);
}

.faq-category__body.has-open-item {
  background: linear-gradient(180deg, rgba(0, 122, 255, 0.04) 0%, var(--color-bg) 100%);
}

.faq-category__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

.faq-category__list-item {
  margin: 0;
  padding: 0;
}

.faq-item {
  position: relative;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  overflow: hidden;
  scroll-margin-top: 6rem;
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-fast);
}

.faq-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background var(--transition-base);
}

.faq-item:hover {
  border-color: rgba(0, 122, 255, 0.28);
  box-shadow: var(--shadow-sm);
}

.faq-item[open] {
  border-color: rgba(0, 122, 255, 0.38);
  box-shadow: var(--shadow-hover);
}

.faq-item[open]::before {
  background: var(--faq-accent);
}

.faq-item.is-search-match {
  border-color: rgba(0, 122, 255, 0.45);
}

.faq-item > summary {
  list-style: none;
}

.faq-item > summary::-webkit-details-marker {
  display: none;
}

.faq-item__summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  transition:
    background var(--transition-base),
    box-shadow var(--transition-base);
}

.faq-item[open] .faq-item__summary {
  background: var(--faq-accent-soft);
  border-bottom: 1px solid var(--color-border);
}

.faq-item__leading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--faq-accent);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  transition:
    background var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base);
}

.faq-item[open] .faq-item__leading {
  background: var(--faq-accent);
  border-color: var(--faq-accent);
  color: #fff;
}

.faq-item__content {
  min-width: 0;
}

.faq-item__summary:hover {
  background: var(--faq-accent-soft);
}

.faq-item__summary:active {
  background: rgba(0, 122, 255, 0.12);
}

.faq-item__summary:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--faq-accent), 0 0 0 3px var(--color-focus);
}

.faq-item.is-opening .faq-item__summary {
  box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.2);
}

.faq-item.is-search-match .faq-item__summary {
  box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.15);
}

.faq-item__question {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--color-text);
}

.faq-item__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.faq-item__permalink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition:
    color var(--transition-base),
    border-color var(--transition-base),
    background var(--transition-base),
    transform var(--transition-fast),
    box-shadow var(--transition-base);
}

.faq-item__permalink-label--done {
  display: none;
}

.faq-item__permalink.is-copied .faq-item__permalink-label--link {
  display: none;
}

.faq-item__permalink.is-copied .faq-item__permalink-label--done {
  display: inline;
}

.faq-item__permalink:hover,
.faq-item__permalink:focus-visible {
  color: var(--faq-accent);
  border-color: var(--faq-accent);
  background: var(--faq-accent-soft);
  outline: none;
  box-shadow: var(--shadow-sm);
}

.faq-item__permalink:active {
  transform: scale(0.96);
}

.faq-item__permalink.is-copied {
  color: #fff;
  border-color: #248a3d;
  background: #248a3d;
  box-shadow: var(--shadow-sm);
}

.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  padding: 0 var(--space-md);
  transition:
    grid-template-rows var(--transition-base),
    padding var(--transition-base);
}

.faq-item[open] .faq-answer {
  grid-template-rows: 1fr;
  padding: var(--space-sm) var(--space-md) var(--space-md);
}

.faq-answer__inner {
  overflow: hidden;
  padding: var(--space-sm) var(--space-md);
  padding-left: calc(1.75rem + var(--space-md));
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: #424245;
  font-size: 0.9375rem;
  line-height: 1.55;
  border-left: 2px solid rgba(0, 122, 255, 0.25);
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity var(--transition-base),
    transform var(--transition-base);
}

.faq-item[open] .faq-answer__inner {
  opacity: 1;
  transform: translateY(0);
}

.faq-answer__inner p {
  margin: 0 0 0.75rem;
}

.faq-answer__inner p:last-child {
  margin-bottom: 0;
}

.faq-panel__empty {
  margin: 0;
  padding: var(--space-lg);
  text-align: center;
  color: var(--color-text-muted);
  border: 1px dashed var(--color-border);
  border-radius: var(--faq-radius);
  background: var(--color-surface);
}

.faq-panel__empty--search {
  margin-top: calc(var(--space-md) * -1);
}

.faq-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 9999;
  max-width: min(92vw, 22rem);
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: var(--faq-radius);
  background: rgba(29, 29, 31, 0.92);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  box-shadow: var(--shadow-hover);
  opacity: 0;
  transform: translate(-50%, 12px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
  pointer-events: none;
}

.faq-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 768px) and (max-width: 1023px) {
  .faq-category__body {
    padding: var(--space-sm) var(--space-md);
  }

  .faq-category__list {
    gap: var(--space-sm);
  }
}

@media (max-width: 767px) {
  .faq-panel {
    gap: var(--space-sm);
  }

  .faq-search__input {
    font-size: 16px;
    min-height: 2.75rem;
  }

  .faq-nav__list {
    flex-wrap: nowrap;
    padding-bottom: var(--space-sm);
  }

  .faq-category__body {
    padding: var(--space-sm);
  }

  .faq-category__list {
    gap: var(--space-xs);
  }

  .faq-category__summary,
  .faq-item__summary {
    padding: var(--space-sm);
    gap: var(--space-sm);
  }

  .faq-answer {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }

  .faq-item[open] .faq-answer {
    padding: var(--space-xs) var(--space-sm) var(--space-sm);
  }

  .faq-answer__inner {
    padding-left: var(--space-sm);
  }

  .faq-item__question {
    font-size: 1rem;
  }

  .faq-category__toggle,
  .faq-item__toggle,
  .faq-item__permalink {
    width: 2.75rem;
    height: 2.75rem;
  }

  .faq-toolbar__meta {
    flex-direction: column;
    align-items: stretch;
  }

  .faq-controls {
    width: 100%;
  }

  .faq-controls__btn {
    flex: 1;
    justify-content: center;
    min-height: 2.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-category,
  .faq-item__summary,
  .faq-nav__link,
  .faq-chevron,
  .faq-search__input,
  .faq-answer,
  .faq-answer__inner,
  .faq-toast {
    transition: none;
  }
}

/* Footer */
.site-footer {
  margin-top: var(--space-2xl);
  padding: var(--space-2xl) clamp(1.25rem, 4vw, 2.5rem) var(--space-xl);
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.footer-brand {
  max-width: var(--max-content);
  margin: 0 auto var(--space-lg);
}

.footer-brand__link {
  display: inline-flex !important;
  align-items: center;
  margin-bottom: 0 !important;
  text-decoration: none;
  opacity: 0.92;
  transition: opacity var(--transition-fast);
}

.site-footer .footer-brand__link:hover {
  opacity: 1;
  transform: none;
  color: inherit;
}

.footer-grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(2, 1fr);
  max-width: var(--max-content);
  margin: 0 auto var(--space-lg);
}

.site-footer h4 {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.site-footer a {
  display: block;
  margin-bottom: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.site-footer a:hover {
  color: var(--color-text);
  transform: translateX(2px);
}

.copy {
  max-width: var(--max-prose);
  margin: var(--space-lg) auto 0;
  text-align: center;
  font-size: var(--text-sm);
  line-height: var(--line-height);
  color: var(--color-text-muted);
}

.copy a {
  color: var(--color-text-muted);
}

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

/* Cabinet */
.cabinet {
  max-width: 50rem;
}

.cabinet-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.cabinet-tabs a {
  font-weight: 500;
  color: var(--color-text-muted);
}

.cabinet-tabs a.is-active {
  color: var(--color-accent);
}

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

.order-list li {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
  line-height: var(--line-height);
}

/* Breakpoints */
@media (min-width: 48rem) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .item-row {
    grid-template-columns: 1fr 1fr 5rem auto;
  }

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

@media (min-width: 64rem) {
  .grid.cols-4,
  .partner-grid .grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 75rem) {
  .grid.cols-4,
  .partner-grid .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 47.99rem) {
  .dashboard-layout {
    flex-direction: column;
  }
}

/* --- Расширения UI: ЛК, модалки --- */

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

.admin-link {
  color: var(--color-accent) !important;
  font-weight: 600;
}

.breadcrumbs {
  margin-bottom: var(--space-lg);
  font-size: var(--text-sm);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li:not(:last-child)::after {
  content: "›";
  margin-left: var(--space-xs);
  color: var(--color-text-muted);
}

.breadcrumbs a {
  color: var(--color-text-muted);
}

.breadcrumbs [aria-current="page"] {
  color: var(--color-text);
  font-weight: 500;
}

.dashboard-layout {
  display: flex;
  gap: var(--space-lg);
  align-items: flex-start;
}

.dashboard-sidebar {
  flex: 0 0 14rem;
  width: 100%;
  max-width: 16rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: var(--space-md);
}

.sidebar-link {
  display: block;
  width: 100%;
  padding: 0.65rem 0.85rem;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: left;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition-fast), color var(--transition-fast),
    transform var(--transition-fast);
}

.sidebar-link:hover,
.sidebar-link.is-active {
  color: var(--color-text);
  background-color: rgba(0, 122, 255, 0.08);
}

.sidebar-link.is-active {
  color: var(--color-accent);
}

.sidebar-link--anchor {
  cursor: pointer;
}

.sidebar-label {
  margin: var(--space-md) 0 var(--space-xs);
  padding: 0 0.85rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.dashboard-content {
  flex: 1;
  min-width: 0;
}

.cabinet-panel {
  display: none;
}

.cabinet-panel[hidden] {
  display: none !important;
}

.cabinet-panel.is-active {
  display: block;
  animation: fadeIn 0.25s ease;
}

.cabinet-panel.is-active.admin-orders-panel {
  display: flex !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stats-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  margin: var(--space-lg) 0;
}

.stat-card {
  padding: var(--space-md);
}

.stat-label {
  margin: 0 0 var(--space-xs);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.stat-value {
  margin: 0;
  font-size: var(--heading-3);
  font-weight: 700;
}

.data-table {
  margin: 0 0 var(--space-lg);
  padding: 0;
  list-style: none;
}

.data-table li {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

.link-list {
  list-style: none;
  padding: 0;
}

.link-list li {
  margin-bottom: var(--space-sm);
}

.prose-form {
  max-width: 28rem;
}

.inline-form {
  display: inline;
}

.text-muted {
  color: var(--color-text-muted);
}

.toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: var(--z-toast, 1100);
  max-width: min(24rem, 92vw);
  margin: 0;
  pointer-events: none;
}

.toast-stack .toast {
  pointer-events: auto;
  box-shadow: var(--shadow-hover);
}

.toast {
  margin: 0 0 var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.toast--success {
  border-color: rgba(0, 122, 255, 0.35);
}

.toast--error {
  border-color: rgba(255, 59, 48, 0.35);
}

.back-to-top {
  position: fixed;
  right: var(--space-md);
  bottom: var(--space-md);
  z-index: 90;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: var(--shadow-hover);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.back-to-top:hover {
  transform: translateY(-2px) scale(1.05);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 3px;
}

.modal[hidden] {
  display: none;
}

.modal:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 1000);
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.modal__dialog {
  position: relative;
  z-index: 1;
  width: min(28rem, 92vw);
  max-height: 90vh;
  overflow: auto;
}

.modal__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
}

body.modal-open {
  overflow: hidden;
}

/* Hide cabinet tab bar while any .modal is open (same stacking conflict as keyboard-open). */
body.modal-open .cabinet-mobile-nav {
  transform: translateY(110%);
  visibility: hidden;
  pointer-events: none;
}

.executor-toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: var(--z-toast, 1100);
  max-width: min(24rem, 92vw);
  pointer-events: none;
}

.executor-toast-stack .toast {
  pointer-events: auto;
  box-shadow: var(--shadow-hover);
}

.share-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: var(--space-xl) 0;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 var(--space-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent);
  background: rgba(0, 122, 255, 0.1);
  border-radius: var(--radius-sm);
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.share-btn:hover {
  transform: translateY(-1px);
  background: rgba(0, 122, 255, 0.18);
}

.footer-subscribe {
  max-width: var(--max-prose);
  margin: 0 auto var(--space-lg);
  text-align: center;
}

.subscribe-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  margin-top: var(--space-sm);
}

.subscribe-form input {
  flex: 1;
  min-width: 12rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font: inherit;
}

.footer-link-btn {
  display: block;
  margin-bottom: var(--space-xs);
  padding: 0;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}

.footer-link-btn:hover {
  color: var(--color-text);
}

.flex-between {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.messages-layout {
  display: grid;
  gap: var(--space-lg);
}

@media (min-width: 48rem) {
  .messages-layout {
    grid-template-columns: 2fr 1fr;
  }
}

.message-bubble {
  margin-bottom: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-size: var(--text-sm);
}

.message-bubble--staff {
  background: rgba(0, 122, 255, 0.08);
}

.order-message__meta {
  margin: 0 0 0.25rem;
  font-size: var(--text-xs, 0.75rem);
}

.order-messages [data-order-messages-list] {
  max-height: 24rem;
  overflow-y: auto;
}

.notification-item {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

.notification-item--high {
  border-left: 3px solid #ff9500;
  padding-left: var(--space-sm);
}

.tag--pending { color: #b8860b; background: rgba(255, 204, 0, 0.15); }
.tag--approved { color: #248a3d; background: rgba(52, 199, 89, 0.15); }
.tag--rejected { color: #d70015; background: rgba(255, 59, 48, 0.12); }

.photo-previews {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.photo-preview img {
  width: 4rem;
  height: 4rem;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.dropzone {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.whitespace-nowrap { white-space: nowrap; }
.text-muted { color: var(--color-text-muted); }
.overflow-x-auto { overflow-x: auto; }
.mt-2 { margin-top: var(--space-xs); }
.mt-3 { margin-top: var(--space-sm); }
.mt-4 { margin-top: var(--space-md); }
.mt-6 { margin-top: var(--space-lg); }
.mb-2 { margin-bottom: var(--space-xs); }
.mb-3 { margin-bottom: var(--space-sm); }
.mb-4 { margin-bottom: var(--space-md); }
.max-w-lg { max-width: 28rem; }
.max-w-md { max-width: 22rem; }

/* --- Mobile-first: ЛК и сайт (< 768px) --- */

.desktop-only {
  display: revert;
}

.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block;
  }

  .cabinet-mobile-header.mobile-only,
  .cabinet-mobile-nav.mobile-only {
    display: flex;
  }

  .order-cards.mobile-only {
    display: grid;
  }

  .mobile-quick-actions.mobile-only {
    display: grid;
  }

  body.cabinet-page {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }

  body.cabinet-page .site-footer {
    display: none;
  }

  body.cabinet-page .back-to-top {
    bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  }

  body.cabinet-page main {
    padding-top: 0;
  }

  .cabinet-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    position: sticky;
    top: var(--header-offset, 3.75rem);
    z-index: 90;
    margin: 0 0 var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
  }

  .cabinet-mobile-header__title {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: 600;
    line-height: var(--line-height-tight);
  }

  .cabinet-mobile-header__cta {
    flex-shrink: 0;
  }

  .cabinet-mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-mobile-nav, 200);
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 0;
    padding: 0.25rem 0 calc(0.25rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.06);
    pointer-events: auto;
    transition: transform 0.2s ease, visibility 0.2s ease;
  }

  .cabinet-mobile-nav__item {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0.35rem 0.15rem;
    font: inherit;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: color var(--transition-fast), background-color var(--transition-fast);
  }

  .cabinet-mobile-nav__item.is-active {
    color: var(--color-accent);
  }

  .cabinet-mobile-nav__icon {
    font-size: 1.15rem;
    line-height: 1;
  }

  .cabinet-mobile-nav__label {
    line-height: 1.1;
  }

  .mobile-greeting {
    margin: 0 0 var(--space-md);
    font-size: var(--text-lg);
    font-weight: 600;
  }

  .stats-grid--mobile-focus {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
  }

  .stat-card--primary {
    display: flex;
    flex-direction: column;
    min-height: 6.5rem;
  }

  .stat-card__action {
    margin-top: auto;
    padding: 0;
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-accent);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
  }

  .mobile-quick-actions {
    display: grid;
    gap: var(--space-sm);
    margin-top: var(--space-md);
  }

  .mobile-hint {
    margin: var(--space-md) 0 0;
    font-size: var(--text-sm);
    line-height: 1.45;
  }

  .order-cards {
    display: grid;
    gap: var(--space-sm);
  }

  .order-card {
    padding: var(--space-md);
  }

  .order-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
  }

  .order-card__id {
    font-weight: 600;
  }

  .order-card__meta {
    margin: 0 0 var(--space-xs);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
  }

  .order-card__action {
    margin-top: var(--space-sm);
  }

  .empty-state {
    padding: var(--space-lg);
    text-align: center;
  }

  .messages-compose textarea,
  .messages-compose input[type="text"] {
    width: 100%;
    min-height: 2.75rem;
    font: inherit;
  }

  .support-chat-card__head {
    margin: 0 0 var(--space-xs);
  }

  .support-chat-card__subject {
    margin: 0 0 var(--space-sm);
    font-size: var(--text-sm);
  }

  .footer-subscribe,
  .site-footer .footer-grid > div:nth-child(n + 4) {
    display: none;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }
}

@media (min-width: 769px) {
  .cabinet-burger,
  .cabinet-drawer {
    display: none !important;
  }
}

/* --- ЛК v2: топбар, drawer, прогресс, фильтры --- */

.cabinet-topbar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.cabinet-topbar__heading {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
}

.cabinet-topbar__user {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.cabinet-topbar__title {
  flex: 1;
  min-width: 0;
}

.cabinet-burger {
  display: none;
  padding: 0.5rem 0.75rem;
  font-size: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  cursor: pointer;
}

.cabinet-drawer[hidden] {
  display: none;
}

.cabinet-drawer:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 150;
}

.cabinet-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.cabinet-drawer__panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(18rem, 88vw);
  padding: var(--space-md);
  overflow: auto;
  animation: slideIn 0.25s ease;
}

.cabinet-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: flex-end;
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.toolbar .field {
  margin: 0;
  min-width: 10rem;
}

.progress-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xs);
  margin: var(--space-sm) 0;
}

.progress-step {
  padding: 0.35rem 0.25rem;
  font-size: 0.7rem;
  text-align: center;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
}

.progress-step.is-done {
  color: #fff;
  background: var(--color-accent);
  font-weight: 600;
}

.amount--positive { color: #248a3d; font-weight: 600; }
.amount--negative { color: #d70015; font-weight: 600; }

.balance-hero .stat-value {
  font-size: clamp(2rem, 5vw, 3rem);
}

.referral-steps {
  list-style: none;
  padding: var(--space-md);
  margin: 0;
}

.referral-steps__item {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

.referral-steps__item:last-child {
  border-bottom: none;
}

.referral-steps__icon {
  font-size: 1.25rem;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.btn-group .btn.is-active {
  background: var(--color-accent);
  color: #fff;
}

[data-order-row] {
  cursor: pointer;
}

[data-order-row]:hover {
  background: rgba(0, 122, 255, 0.04);
}

.input,
.toolbar select,
.toolbar input[type="search"],
.prose-form input,
.prose-form textarea,
.prose-form select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font: inherit;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
}

.input:focus-visible,
.toolbar select:focus-visible,
.prose-form input:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
}

@media (max-width: 768px) {
  .cabinet-burger {
    display: inline-flex;
  }

  body.cabinet-page {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }

  /* .cabinet-topbar mobile — cabinet-enhanced.css (sticky под site-header, без отрицательных margin) */
}

/* --- Форма монтажа (UX как у «Покраски», табличная структура) --- */

.mounting-form {
  max-width: none;
  font-size: 14px;
  line-height: 1.4;
  --mount-accent: #007aff;
  --mount-accent-soft: rgba(0, 122, 255, 0.08);
  --mount-accent-flash: rgba(0, 122, 255, 0.1);
  --mount-success: #34c759;
  --mount-error: #f44336;
  --mount-warning: #ff9800;
  --mount-radius: 12px;
}


.mounting-form__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.mounting-form__title {
  margin: 0 0 0.25rem;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 700;
  line-height: 1.25;
}

.mounting-form__lead {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 12px;
  max-width: 36rem;
}

.mounting-form__eta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--color-surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.mounting-form__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 var(--space-lg);
  padding: 0;
  list-style: none;
}

.mounting-form__step {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-surface);
  transition: all 0.2s ease;
}

.mounting-form__step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  font-size: 0.6875rem;
  font-weight: 700;
  background: rgba(29, 29, 31, 0.08);
}

.mounting-form__step.is-active {
  color: var(--mount-accent);
  background: var(--mount-accent-soft);
}

.mounting-form__step.is-active span {
  background: var(--mount-accent);
  color: #fff;
}

.mounting-form__step.is-done {
  color: var(--mount-success);
}

.mounting-form__step.is-done span {
  background: var(--mount-success);
  color: #fff;
}

.mounting-form__section {
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--mount-radius);
  background: var(--color-bg);
  transition: box-shadow 0.2s ease;
}

.mounting-form__section:focus-within {
  box-shadow: 0 0 0 3px var(--color-focus);
}

.mounting-form__legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 var(--space-xs);
  font-weight: 700;
  font-size: var(--text-lg);
}

.mounting-form__legend-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  font-size: 12px;
  background: var(--mount-accent-soft);
  color: var(--mount-accent);
}

.mounting-form__section-desc,
.mounting-form__table-hint {
  margin: 0 0 var(--space-md);
  font-size: 12px;
  color: var(--color-text-muted);
}

.mounting-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}

.mounting-form__grid-full {
  grid-column: 1 / -1;
}

.mounting-form__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.mounting-form .order-position-card {
  --painting-accent: var(--mount-accent);
  --painting-accent-soft: var(--mount-accent-soft);
  --painting-accent-flash: var(--mount-accent-flash);
  --painting-error: var(--mount-error);
  --painting-radius: var(--mount-radius);
}

.mounting-form .order-position-card.is-active,
.mounting-form .order-position-card.has-focus {
  background: var(--mount-accent-soft);
  border-color: rgba(0, 122, 255, 0.35);
  box-shadow:
    0 4px 16px rgba(0, 122, 255, 0.12),
    inset 3px 0 0 var(--mount-accent);
}

.mounting-form .order-position-card.has-error {
  border-color: rgba(244, 67, 54, 0.45);
  background: rgba(244, 67, 54, 0.04);
}

.mounting-position-card.is-new {
  animation: mounting-row-in 0.3s ease;
}

.type-icon--cornice { background: rgba(0, 122, 255, 0.12); color: #007aff; }
.type-icon--molding { background: rgba(255, 152, 0, 0.12); color: #ff9800; }
.type-icon--plinth { background: rgba(52, 199, 89, 0.12); color: #34c759; }
.type-icon--panel { background: rgba(88, 86, 214, 0.12); color: #5856d6; }
.type-icon--other { background: var(--mount-accent-soft); color: var(--mount-accent); }

.mounting-position-card__dims {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mounting-form .mounting-num-input {
  width: 100%;
  font-variant-numeric: tabular-nums;
}

.mounting-form .mounting-calc.is-updated {
  animation: painting-calc-highlight 0.3s ease;
}

@media (max-width: 767px) {
  .mounting-position-card__dims {
    grid-template-columns: 1fr;
  }

  .mounting-form .mounting-num-input {
    min-height: 2.75rem;
    font-size: 16px;
  }
}

.mounting-phone-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all 0.2s ease;
}

.mounting-phone-wrap:focus-within {
  border-color: var(--mount-accent);
  box-shadow: 0 0 0 2px var(--mount-accent);
}

.has-error .mounting-phone-wrap {
  border-color: var(--mount-error);
}

.mounting-phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  background: var(--color-surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  border-right: 1px solid var(--color-border);
}

.mounting-phone-input {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.mounting-form .field-label .req {
  color: var(--mount-error);
}

.mounting-form .input:focus,
.mounting-form select:focus,
.mounting-form textarea:focus {
  outline: none;
  border-color: var(--mount-accent);
  box-shadow: 0 0 0 2px var(--mount-accent);
}

.mounting-form .input--error,
.mounting-form select.input--error,
.mounting-form textarea.input--error {
  border-color: var(--mount-error) !important;
  box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.2);
}

.mounting-form .field-error,
.mounting-cell-error {
  display: block;
  margin-top: 0.25rem;
  font-size: 12px;
  color: var(--mount-error);
}

.mounting-cell-error::before {
  content: "⚠️ ";
}

.mounting-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.mounting-positions-table {
  width: 100%;
  min-width: 42rem;
  border-collapse: collapse;
  font-size: 14px;
}

.mounting-positions-table thead th {
  padding: 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.mounting-positions-table thead th.mounting-positions-table__col-num,
.mounting-positions-table thead th.mounting-positions-table__col-calc {
  text-align: right;
}

.mounting-positions-table__row {
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--color-border);
}

.mounting-positions-table__row:nth-child(even) {
  background: rgba(0, 0, 0, 0.015);
}

.mounting-positions-table__row.is-active,
.mounting-positions-table__row:focus-within {
  background: var(--mount-accent-soft);
}

.mounting-positions-table__row.has-error {
  background: rgba(244, 67, 54, 0.04);
}

.mounting-positions-table__row.is-removing {
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.mounting-positions-table td {
  padding: 12px;
  vertical-align: top;
}

.mounting-positions-table__col-index {
  width: 2.5rem;
  text-align: center;
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 12px;
}

.mounting-positions-table__col-num {
  width: 7rem;
  text-align: right;
}

.mounting-positions-table__col-unit {
  width: 4rem;
  text-align: center;
}

.mounting-positions-table__col-calc {
  width: 8rem;
  text-align: right;
}

.mounting-positions-table__col-actions {
  width: 5.5rem;
}

.mounting-positions-table td[data-cell="volume"] {
  text-align: right;
}

.mounting-num-input {
  width: 100%;
  min-width: 5.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mounting-positions-table .input--sm {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.5rem 0.65rem;
  font-size: 14px;
  transition: all 0.2s ease;
}

.mounting-positions-table td.is-muted {
  opacity: 0.45;
}

.mounting-unit-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--mount-accent);
  background: var(--mount-accent-soft);
}

.mounting-calc {
  display: inline-block;
  min-width: 4rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  transition: background-color 0.3s ease;
}

.mounting-calc.is-updated {
  animation: painting-calc-highlight 0.3s ease;
}

.mounting-row-actions {
  display: flex;
  gap: 0.25rem;
  justify-content: flex-end;
}

.mounting-row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mounting-row-action:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--mount-accent);
}

.mounting-row-action:hover {
  border-color: var(--mount-accent);
  color: var(--mount-accent);
  background: var(--mount-accent-soft);
}

.mounting-row-action--delete:hover {
  border-color: var(--mount-error);
  color: var(--mount-error);
  background: rgba(244, 67, 54, 0.08);
}

.mounting-file-previews {
  margin: var(--space-sm) 0 0;
  padding-left: 0;
  list-style: none;
  font-size: 12px;
  color: var(--color-text-muted);
}

.mounting-file-previews__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.mounting-file-previews__thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

.mounting-dropzone {
  border: 1px dashed var(--color-border);
  border-radius: 10px;
  padding: var(--space-md);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.mounting-dropzone.is-dragover {
  border-color: var(--color-accent);
  background: rgba(0, 122, 255, 0.06);
}

.mounting-dropzone__text {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

.mounting-dropzone__link {
  color: var(--color-accent);
  text-decoration: underline;
}

.mounting-form__summary,
.mounting-form__review {
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  background: var(--color-surface-muted, #f8f9fb);
  border-radius: 10px;
}

.mounting-form__summary-title {
  margin: 0 0 var(--space-sm);
  font-size: 15px;
}

.mounting-form__summary-list {
  margin: 0;
  padding-left: 1.1rem;
}

.mounting-inline-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
  font-size: 13px;
}

.mounting-availability__row {
  display: grid;
  grid-template-columns: 1fr 0.7fr 0.7fr 1.2fr auto;
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
}

.order-detail-list,
.order-detail-checklist {
  margin: 0;
  padding-left: 1.1rem;
}

.order-detail-legacy-notes {
  white-space: pre-wrap;
  font-size: 13px;
  background: var(--color-surface-muted, #f5f5f5);
  padding: var(--space-sm);
  border-radius: 8px;
}

.order-detail-extension {
  border-style: dashed;
}

.mounting-form__submit-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: var(--space-md);
}

.mounting-form__submit {
  min-width: 12rem;
  position: relative;
}

.mounting-form__submit.is-loading {
  pointer-events: none;
  opacity: 0.85;
}

.mounting-form__spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-left: 0.5rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: painting-spin 0.7s linear infinite;
  vertical-align: middle;
}

.mounting-form__submit[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.mounting-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 9999;
  max-width: min(90vw, 22rem);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(29, 29, 31, 0.92);
  color: #fff;
  font-size: 12px;
  transform: translateX(-50%) translateY(1rem);
  opacity: 0;
  transition: all 0.2s ease;
}

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

.form-section {
  margin: 0 0 var(--space-lg);
  padding: 0;
  border: none;
}

.form-section__title {
  margin: 0 0 var(--space-md);
  font-size: var(--text-lg);
  font-weight: 600;
}

.req {
  color: var(--mount-error, #f44336);
}

.field-error {
  margin: var(--space-xs) 0 0;
  font-size: 12px;
  color: var(--mount-error, #f44336);
}

.field-hint {
  margin: var(--space-xs) 0 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.input--invalid {
  border-color: var(--mount-error, #f44336) !important;
}

.form-status {
  margin: var(--space-md) 0;
  font-size: 12px;
}

.form-status--success {
  color: #248a3d;
}

.form-status--error {
  color: var(--mount-error, #f44336);
}

.file-previews {
  margin: var(--space-sm) 0 0;
  padding-left: 1.1rem;
  font-size: 12px;
  color: var(--color-text-muted);
}

@media (max-width: 1023px) {
  .mounting-form__grid {
    grid-template-columns: 1fr;
  }
}

.mounting-positions-table__empty td {
  padding: var(--space-lg);
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
}

.mounting-positions-table__row.is-new {
  animation: mounting-row-in 0.3s ease;
}

@keyframes mounting-row-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
    background: var(--mount-accent-flash);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mounting-item-modal__dialog {
  width: min(100%, 28rem);
  max-height: 90vh;
  overflow-y: auto;
}

.mounting-item-modal__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.mounting-item-modal__form .field {
  margin: 0;
}

.mounting-item-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: flex-end;
  margin-top: var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.mounting-item-modal__actions .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 767px) {
  .mounting-form__header {
    flex-direction: column;
  }

  .mounting-form__steps {
    gap: 0.35rem;
  }

  .mounting-form__step {
    font-size: 11px;
    padding: 0.3rem 0.5rem;
  }

  .mounting-positions-table {
    min-width: 0;
    width: 100%;
  }

  .mounting-row-action {
    width: 2.75rem;
    height: 2.75rem;
  }

  .mounting-num-input,
  .mounting-item-modal__form .input {
    min-height: 2.75rem;
    font-size: 16px;
  }

  .mounting-item-modal__dialog {
    width: 100%;
    margin: var(--space-sm);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mounting-positions-table__row,
  .mounting-row-action,
  .mounting-calc.is-updated,
  .mounting-toast {
    transition: none;
    animation: none;
  }
}

/* --- Форма доставки (UX как у «Покраски» и «Монтажа») --- */

.delivery-form {
  max-width: none;
  font-size: 14px;
  line-height: 1.4;
  --delivery-accent: #007aff;
  --delivery-accent-soft: rgba(0, 122, 255, 0.08);
  --delivery-accent-flash: rgba(0, 122, 255, 0.1);
  --delivery-success: #34c759;
  --delivery-error: #f44336;
  --delivery-radius: 12px;
}

.delivery-form__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.delivery-form__title {
  margin: 0 0 0.25rem;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 700;
  line-height: 1.25;
}

.delivery-form__lead {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 12px;
  max-width: 36rem;
}

.delivery-form__eta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--color-surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.delivery-form__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 var(--space-lg);
  padding: 0;
  list-style: none;
}

.delivery-form__step {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-surface);
  transition: all 0.2s ease;
}

.delivery-form__step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  font-size: 0.6875rem;
  font-weight: 700;
  background: rgba(29, 29, 31, 0.08);
}

.delivery-form__step.is-active {
  color: var(--delivery-accent);
  background: var(--delivery-accent-soft);
}

.delivery-form__step.is-active span {
  background: var(--delivery-accent);
  color: #fff;
}

.delivery-form__step.is-done {
  color: var(--delivery-success);
}

.delivery-form__step.is-done span {
  background: var(--delivery-success);
  color: #fff;
}

.delivery-form__section {
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--delivery-radius);
  background: var(--color-bg);
  transition: box-shadow 0.2s ease;
}

.delivery-form__section:focus-within {
  box-shadow: 0 0 0 3px var(--color-focus);
}

.delivery-form__legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: var(--space-sm);
  font-size: 1rem;
  font-weight: 700;
}

.delivery-form__legend-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: var(--delivery-accent);
}

.delivery-form__section-desc {
  margin: 0 0 var(--space-md);
  font-size: 12px;
  color: var(--color-text-muted);
}

.delivery-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}

.delivery-form__grid-full {
  grid-column: 1 / -1;
}

.delivery-phone-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all 0.2s ease;
}

.delivery-phone-wrap:focus-within {
  border-color: var(--delivery-accent);
  box-shadow: 0 0 0 2px var(--delivery-accent);
}

.has-error .delivery-phone-wrap {
  border-color: var(--delivery-error);
}

.delivery-phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  background: var(--color-surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  border-right: 1px solid var(--color-border);
}

.delivery-phone-input {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.delivery-form .field-label .req {
  color: var(--delivery-error);
}

.delivery-form .input:focus,
.delivery-form select:focus,
.delivery-form textarea:focus {
  outline: none;
  border-color: var(--delivery-accent);
  box-shadow: 0 0 0 2px var(--delivery-accent);
}

.delivery-form .input--error,
.delivery-form select.input--error,
.delivery-form textarea.input--error {
  border-color: var(--delivery-error) !important;
  box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.2);
}

.delivery-form .field-error {
  display: block;
  margin-top: 0.25rem;
  font-size: 12px;
  color: var(--delivery-error);
}

.delivery-box-visual {
  margin-top: var(--space-md);
  padding: var(--space-lg);
  text-align: center;
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--delivery-radius);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.delivery-box-visual.is-active {
  border-color: var(--delivery-accent);
  background: var(--delivery-accent-soft);
}

.delivery-box-visual__shape {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: calc(var(--box-d, 48) * 0.08px + 0.5rem);
  min-height: 5rem;
  margin-bottom: var(--space-sm);
}

.delivery-box-visual__dim {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}

.delivery-box-visual.is-active .delivery-box-visual__dim:nth-child(1) {
  min-height: calc(var(--box-d, 48) * 1px);
  border-color: var(--delivery-accent);
  color: var(--delivery-accent);
}

.delivery-box-visual.is-active .delivery-box-visual__dim:nth-child(2) {
  min-height: calc(var(--box-w, 48) * 1px);
  border-color: var(--delivery-accent);
  color: var(--delivery-accent);
}

.delivery-box-visual.is-active .delivery-box-visual__dim:nth-child(3) {
  min-height: calc(var(--box-h, 48) * 1px);
  border-color: var(--delivery-accent);
  color: var(--delivery-accent);
}

.delivery-box-visual__hint {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.delivery-body-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
  margin-top: var(--space-xs);
}

.delivery-body-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--delivery-radius);
  background: var(--color-bg);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  min-height: 2.75rem;
}

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

.delivery-body-card:focus-within {
  outline: 2px solid var(--delivery-accent);
  outline-offset: 2px;
}

.delivery-body-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.delivery-body-card.is-selected {
  border-color: var(--delivery-accent);
  background: var(--delivery-accent-soft);
  box-shadow: 0 0 0 3px var(--color-focus);
}

.delivery-body-card__icon {
  font-size: 1.25rem;
  color: var(--delivery-accent);
}

.delivery-body-card__title {
  font-weight: 600;
  font-size: var(--text-sm);
}

.delivery-body-card__desc {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.35;
}

.delivery-form__submit-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: var(--space-md);
}

.delivery-form__submit {
  min-width: 12rem;
  min-height: 2.75rem;
  position: relative;
}

.delivery-form__submit.is-loading {
  pointer-events: none;
  opacity: 0.85;
}

.delivery-form__spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-left: 0.5rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: painting-spin 0.7s linear infinite;
  vertical-align: middle;
}

.delivery-form__submit[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 1023px) {
  .delivery-form__grid {
    grid-template-columns: 1fr;
  }

  .delivery-body-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .delivery-form__header {
    flex-direction: column;
  }

  .delivery-form__steps {
    gap: 0.35rem;
  }

  .delivery-form__step {
    font-size: 11px;
    padding: 0.3rem 0.5rem;
  }

  .delivery-form .input,
  .delivery-phone-input,
  .delivery-form__submit,
  .delivery-body-card,
  .qty-stepper__btn {
    min-height: 2.75rem;
  }

  .delivery-form .input,
  .delivery-phone-input {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .delivery-form__step,
  .delivery-body-card,
  .delivery-box-visual {
    transition: none;
  }

  .delivery-form__spinner {
    animation: none;
  }
}

.detail-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-xs) var(--space-md);
  margin: var(--space-sm) 0;
  font-size: var(--text-sm);
}

.detail-list dt {
  color: var(--color-text-muted);
  font-weight: 500;
}

.detail-list dd {
  margin: 0;
}

/* --- Форум --- */

.forum-page {
  --forum-text-secondary: rgba(29, 29, 31, 0.72);
  --forum-text-tertiary: rgba(29, 29, 31, 0.55);
}

.muted,
.forum-meta,
.forum-empty {
  color: var(--forum-text-secondary, var(--color-text-muted));
}

.forum-lead {
  margin: var(--space-xs) 0 0;
  color: var(--forum-text-secondary);
  font-size: var(--text-base);
  line-height: var(--line-height);
}

.forum-lead a {
  font-weight: 500;
}

.forum-subheading {
  margin: var(--space-md) 0 var(--space-sm);
  font-size: var(--text-lg);
  font-weight: 600;
}

.forum-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-md);
  padding-bottom: calc(var(--space-xl) + 3rem);
}

.forum-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-lg);
  align-items: start;
  margin-bottom: var(--space-lg);
}

.forum-header__intro {
  min-width: 0;
}

.forum-header__intro .section-title {
  margin-bottom: var(--space-sm);
}

.forum-header--topic .forum-header__actions {
  flex-direction: column;
  align-items: stretch;
  width: min(100%, 18.75rem);
}

.forum-header__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  justify-content: flex-end;
}

.forum-header--topic .forum-header__toolbar {
  justify-content: flex-start;
}

.forum-jump-reply {
  padding: 8px 16px;
  font-weight: 600;
}

.forum-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  justify-content: flex-end;
}

.forum-search {
  display: flex;
  align-items: stretch;
  width: min(100%, 18.75rem);
}

.forum-search--inline {
  width: min(100%, 18.75rem);
}

.forum-search__field {
  position: relative;
  width: 100%;
}

.forum-search__input {
  width: 100%;
  min-width: 0;
  padding-right: 2.75rem;
}

.forum-search__submit {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--forum-text-secondary);
  cursor: pointer;
  transform: translateY(-50%);
}

.forum-search__submit:hover {
  color: var(--color-accent);
  background: rgba(0, 122, 255, 0.08);
}

.forum-search__submit:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.forum-create-topic {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 8px 16px;
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff !important;
  font-weight: 600;
}

.forum-create-topic:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.forum-create-topic:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

.forum-create-topic__icon {
  flex-shrink: 0;
}

.forum-banner {
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
}

.forum-banner--closed {
  color: #7a4b00;
  background: #fff4e5;
  border: 1px solid rgba(122, 75, 0, 0.18);
}

.forum-sections {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.forum-section-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
}

.forum-section-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.forum-section-row__title {
  margin: 0 0 var(--space-xs);
  font-size: var(--text-lg);
  line-height: var(--line-height-tight);
}

.forum-section-row__title a {
  display: inline-block;
  padding: 0.125rem 0;
  font-weight: 600;
}

.forum-section-row__desc {
  margin: 0;
  color: var(--forum-text-secondary);
}

.forum-section-row__stats {
  display: grid;
  gap: var(--space-xs);
  margin: 0;
  min-width: 7rem;
  font-size: var(--text-sm);
}

.forum-section-row__stats div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
}

.forum-section-row__stats dt {
  color: var(--forum-text-tertiary);
  font-weight: 500;
}

.forum-section-row__stats dd {
  margin: 0;
  font-weight: 600;
  color: var(--color-text);
}

.forum-section-row__last {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 9rem;
  font-size: var(--text-sm);
}

.forum-section-row__last-link {
  font-weight: 500;
}

.forum-topics {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.forum-topics__col--topic {
  min-width: 0;
}

.forum-topics__head {
  display: none;
}

.forum-topics__empty {
  margin: 0;
  padding: var(--space-md) 0;
}

.forum-topic-row {
  display: grid;
  gap: var(--space-xs) var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
  align-items: start;
}

.forum-topic-row:last-child {
  border-bottom: none;
}

.forum-topic-card__title {
  margin: var(--space-xs) 0 0;
  font-size: var(--text-lg);
  line-height: var(--line-height-tight);
}

.forum-topic-card__title a {
  display: inline-block;
  padding: 0.125rem 0;
  font-weight: 600;
  color: var(--color-text);
}

.forum-topic-card__title a:hover {
  color: var(--color-accent);
}

.forum-topic-card__title a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.forum-topic-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
}

.forum-topic-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-size: var(--text-xs);
  color: var(--forum-text-secondary);
}

.forum-topic-card__tags:empty {
  display: none;
}

.topic-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.topic-labels:empty {
  display: none;
}

.label {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.label-new {
  color: #005bb5;
  background: #e8f4ff;
}

.label-pinned {
  color: #9a6700;
  background: #fff4e5;
}

.label-closed {
  color: #555;
  background: #f3f4f6;
}

.forum-topic-card__last {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--forum-text-secondary);
}

.forum-topic-card__last time {
  cursor: default;
}

.forum-topic-date--short {
  display: none;
}

@media (min-width: 48rem) {
  .forum-search,
  .forum-search--inline {
    width: 300px;
  }

  .forum-search__input {
    min-width: 300px;
  }

  .forum-topic-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "topic topic topic"
      "author replies last";
    align-items: center;
  }

  .forum-topics__col--topic {
    grid-area: topic;
  }

  .forum-topics__col--author {
    grid-area: author;
  }

  .forum-topics__col--replies {
    grid-area: replies;
  }

  .forum-topics__col--last {
    grid-area: last;
    justify-self: end;
    text-align: right;
  }

  .forum-topics__col--author,
  .forum-topics__col--replies,
  .forum-topics__col--last {
    font-size: var(--text-sm);
    color: var(--forum-text-secondary);
  }
}

@media (min-width: 75rem) {
  .forum-topics__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 8.5rem 5.5rem 10rem;
    grid-template-areas: "head-topic head-author head-replies head-last";
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    border-bottom: 2px solid var(--color-border);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--forum-text-secondary);
  }

  .forum-topics__head .forum-topics__col--topic {
    grid-area: head-topic;
  }

  .forum-topics__head .forum-topics__col--author {
    grid-area: head-author;
  }

  .forum-topics__head .forum-topics__col--replies {
    grid-area: head-replies;
  }

  .forum-topics__head .forum-topics__col--last {
    grid-area: head-last;
  }

  .forum-topic-row {
    grid-template-columns: minmax(0, 1fr) 8.5rem 5.5rem 10rem;
    grid-template-areas: "topic author replies last";
    align-items: center;
  }

  .forum-topics__col--author,
  .forum-topics__col--replies,
  .forum-topics__col--last {
    color: var(--color-text);
  }

  .forum-topics__col--last {
    justify-self: stretch;
    text-align: left;
  }
}

.forum-post {
  margin-bottom: 0;
}

.forum-post.card:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

.forum-posts {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.forum-reply-form.card:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

.forum-post--nested {
  margin-left: clamp(0.75rem, 3vw, 1.5rem);
  border-left: 3px solid rgba(0, 122, 255, 0.18);
}

.forum-post__head {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  margin-bottom: var(--space-sm);
}

.forum-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: var(--text-sm);
  font-weight: 600;
  flex-shrink: 0;
}

.forum-post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-sm);
  align-items: baseline;
  font-size: var(--text-sm);
  color: var(--forum-text-secondary);
}

.forum-post__author {
  color: var(--color-text);
  font-size: var(--text-base);
}

.forum-post__presentation {
  margin: 0.15rem 0 0;
  font-size: var(--text-sm);
  line-height: 1.45;
  white-space: pre-wrap;
}

.forum-post__body {
  margin: var(--space-sm) 0;
  line-height: 1.65;
  color: var(--color-text);
  font-size: var(--text-base);
  overflow-wrap: anywhere;
}

.forum-post__body a {
  word-break: break-word;
}

.forum-post__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border);
}

.forum-post__actions .btn-sm {
  min-height: 2.75rem;
  min-width: 2.75rem;
}

.forum-quote,
.forum-quote--inline {
  margin: var(--space-sm) 0;
  padding: var(--space-sm) var(--space-md);
  border-left: 3px solid var(--color-accent);
  background: rgba(0, 122, 255, 0.06);
  font-size: var(--text-sm);
  color: var(--color-text);
}

.forum-quote__cite {
  display: block;
  margin-bottom: var(--space-xs);
  font-style: normal;
  font-weight: 600;
}

.forum-quote-preview {
  margin-bottom: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-size: var(--text-sm);
  color: var(--color-text);
}

.forum-attachments {
  margin: var(--space-sm) 0 0;
  padding-left: 1.1rem;
  font-size: var(--text-sm);
}

.forum-poll-fieldset {
  border: 0;
  margin: 0 0 var(--space-md);
  padding: 0;
}

.forum-poll-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.forum-poll-results li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.forum-link-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-md);
}

.forum-link-list li {
  margin-bottom: var(--space-sm);
}

.forum-link-list a {
  font-weight: 500;
}

.forum-pagination,
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  margin-top: var(--space-md);
  font-size: var(--text-sm);
}

.forum-pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-accent);
  text-decoration: none;
  background: var(--color-bg);
}

.forum-pagination__link:hover {
  background: var(--color-surface);
}

.forum-pagination__link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.forum-pagination__status {
  color: var(--forum-text-secondary);
}

.forum-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.forum-form-actions .btn {
  min-height: 2.75rem;
}

.forum-bbcode-help {
  margin-bottom: var(--space-md);
  font-size: var(--text-sm);
}

.forum-bbcode-help summary {
  cursor: pointer;
  color: var(--color-accent);
  font-weight: 500;
}

.forum-login-cta {
  text-align: center;
}

.forum-login-cta p {
  margin: 0 0 var(--space-md);
  color: var(--forum-text-secondary);
}

.forum-fab {
  position: fixed;
  right: var(--space-md);
  bottom: calc(var(--space-md) + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.1rem;
  border-radius: 999px;
  background: var(--color-accent);
  color: #fff !important;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-hover);
}

.forum-fab:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

.inline-form {
  display: inline;
}

.forum-breadcrumbs {
  margin-bottom: var(--space-md);
}

.forum-breadcrumbs ol {
  gap: 0;
}

.forum-breadcrumbs li {
  display: flex;
  align-items: center;
  margin-right: 16px;
}

.forum-breadcrumbs li:last-child {
  margin-right: 0;
}

.forum-breadcrumbs li:not(:last-child)::after {
  content: "›";
  margin-left: 16px;
  color: #888;
}

.forum-breadcrumbs [aria-current="page"] {
  color: #666;
  font-weight: 600;
}

.forum-breadcrumbs__home {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.forum-breadcrumbs__home-icon {
  flex-shrink: 0;
  color: var(--forum-text-secondary);
}

.forum-breadcrumbs__home:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (max-width: 47.99rem) {
  .forum-wrap {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }

  .forum-header {
    grid-template-columns: 1fr;
  }

  .forum-header__actions {
    width: 100%;
    max-width: none;
    flex-direction: column;
    align-items: stretch;
  }

  .forum-header__toolbar {
    justify-content: stretch;
  }

  .forum-header__toolbar .btn {
    flex: 1 1 calc(50% - var(--space-sm));
    justify-content: center;
  }

  .forum-header__toolbar .inline-form {
    display: flex;
    flex: 1 1 calc(50% - var(--space-sm));
  }

  .forum-header__toolbar .inline-form .btn {
    width: 100%;
  }

  .forum-header__toolbar .forum-jump-reply {
    flex: 1 1 100%;
  }

  .forum-search,
  .forum-search--inline {
    width: 100%;
  }

  .forum-search__input {
    min-width: 0;
  }

  .forum-create-topic {
    width: 100%;
    justify-content: center;
  }

  .forum-section-row {
    grid-template-columns: 1fr;
  }

  .forum-section-row__stats,
  .forum-section-row__last {
    min-width: 0;
  }

  .forum-topic-row {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  .forum-topics__col--topic,
  .forum-topics__col--author,
  .forum-topics__col--replies,
  .forum-topics__col--last {
    grid-area: auto;
  }

  .forum-topics__col[data-label]::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: var(--color-text);
  }

  .forum-topics__col--author,
  .forum-topics__col--replies,
  .forum-topics__col--last {
    font-size: var(--text-sm);
    color: var(--forum-text-secondary);
  }

  .forum-topic-date--full {
    display: none;
  }

  .forum-topic-date--short {
    display: inline;
  }

  .forum-post__actions .btn-sm {
    flex: 1 1 calc(50% - var(--space-sm));
  }
}

/* --- Каталог --- */

.catalog-page {
  --catalog-text-secondary: rgba(29, 29, 31, 0.72);
}

.catalog-wrap {
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
  padding: 0;
}

.catalog-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.catalog-lead {
  margin: var(--space-xs) 0 0;
  color: var(--catalog-text-secondary, var(--color-text-muted));
}

.catalog-breadcrumbs,
.catalog-search {
  margin-bottom: var(--space-md);
}

.catalog-search {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.catalog-search .input {
  flex: 1 1 12rem;
}

/* Сетка и карточки каталога — catalog-card.css */
.catalog-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.catalog-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-md);
}

.catalog-category-card {
  display: block;
  padding: var(--space-md);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition-fast);
}

.catalog-category-card:hover {
  box-shadow: var(--shadow-hover);
}

.catalog-category-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}

.catalog-category-card h3 {
  margin: 0 0 var(--space-xs);
}

.catalog-category-card p {
  margin: 0;
  color: var(--catalog-text-secondary);
  font-size: var(--text-sm);
}

.catalog-category-card__count {
  display: inline-block;
  margin-top: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-accent);
}

.catalog-filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: flex-end;
}

.catalog-filters .field {
  min-width: 140px;
}

.catalog-product__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.catalog-product__main {
  width: 100%;
  border-radius: var(--radius-md);
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--color-surface);
}

.catalog-product__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.catalog-product__thumb {
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
}

.catalog-product__thumb.is-active {
  border-color: var(--color-accent);
}

.catalog-product__thumb img {
  width: 4rem;
  height: 4rem;
  object-fit: cover;
  border-radius: calc(var(--radius-sm) - 2px);
  display: block;
}

.catalog-product__section {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.catalog-empty {
  color: var(--catalog-text-secondary);
}

.catalog-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  margin-top: var(--space-lg);
}

.catalog-pagination__link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-accent);
  text-decoration: none;
}

.catalog-featured__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.catalog-carousel {
  position: relative;
}

.catalog-carousel__viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.catalog-carousel__viewport:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.catalog-carousel__viewport::-webkit-scrollbar {
  display: none;
}

@supports not (scroll-snap-type: x mandatory) {
  .catalog-carousel__viewport {
    scroll-snap-type: none;
  }
}

.catalog-carousel__track {
  display: flex;
  gap: var(--space-md);
  margin: 0;
  padding: 0;
  list-style: none;
}

.catalog-carousel__slide {
  flex: 0 0 min(280px, 85vw);
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.catalog-carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.catalog-carousel__nav:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.catalog-carousel__nav--prev { left: -0.5rem; }
.catalog-carousel__nav--next { right: -0.5rem; }

.catalog-featured__mobile-cta {
  margin-top: var(--space-md);
}

.inline-details {
  display: inline-block;
}

@media (max-width: 47.99rem) {
  .catalog-product__layout {
    grid-template-columns: 1fr;
  }

  .catalog-carousel__nav {
    display: none;
  }
}

.author-box__inner {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.author-box__photo,
.author-box__avatar {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.author-box__avatar {
  display: grid;
  place-items: center;
  background: var(--color-surface-muted, #eee);
  font-weight: 600;
}

.author-box__name {
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.author-box__role {
  color: var(--color-text-muted, #666);
  margin: 0 0 0.5rem;
}

.author-box__bio {
  margin: 0;
}

.author-box__credentials {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
}

/* Order form drafts */
.order-form-draft {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--color-surface-muted, #f7f7f8);
  border: 1px solid var(--color-border, #e5e5e5);
}

.order-form-draft__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.order-form-draft__status {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted, #666);
}

.order-form-draft__status--saved {
  color: var(--color-success, #1a7f37);
}

.order-form-draft__status--pending {
  color: var(--color-text-muted, #666);
}

.order-form-draft__status--warn {
  color: var(--color-warning, #9a6700);
}

.order-form-draft__status--error {
  color: var(--color-danger, #cf222e);
}

.order-form-draft__status--restored {
  color: var(--color-accent, #0969da);
}

.order-form-draft__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.order-form-draft__hint {
  margin: 0.5rem 0 0;
}

.drafts-list {
  display: grid;
  gap: 1rem;
}

.draft-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.draft-card__title {
  margin: 0;
  font-size: 1rem;
}

.draft-card__meta {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
}

.draft-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.legal-document {
  max-width: 48rem;
  margin: 0 auto var(--space-lg);
  padding: var(--space-lg);
}

.legal-document__head {
  margin-bottom: var(--space-md);
}

.legal-document__meta {
  margin: 0.25rem 0 0;
}

.legal-document__body h2 {
  margin-top: 1.25rem;
  font-size: 1.05rem;
}

.legal-document__footer {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border, #e5e5e5);
}

.footer-contacts__line {
  margin: 0.35rem 0;
}

.footer-contacts__line a {
  color: inherit;
  text-decoration: none;
}

.footer-contacts__line a:hover {
  text-decoration: underline;
}

.cabinet-mobile-nav__item {
  position: relative;
}

.cabinet-mobile-nav__badge {
  position: absolute;
  top: 0.15rem;
  right: 0.35rem;
  min-width: 1.1rem;
  padding: 0 0.25rem;
  font-size: 0.65rem;
  line-height: 1.1rem;
}

/* CMS: editable block above page content (django-cms placeholder "content") */
.cms-page-content {
  margin-bottom: var(--space-md);
}

.cms-page-content:empty {
  display: none;
  margin: 0;
}

html:not(.cms-structure-mode-structure):not(.cms-structure-mode-content) .cms-page-content:not(:has(.cms-plugin)) {
  display: none;
  margin: 0;
}

.cms-structure-mode-content .cms-page-content,
.cms-structure-mode-structure .cms-page-content {
  display: block;
  min-height: 3rem;
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border: 2px dashed var(--color-border, rgba(29, 29, 31, 0.18));
  border-radius: var(--radius-md, 12px);
  background: var(--color-surface-muted, rgba(29, 29, 31, 0.03));
}

.cms-page-content__edit-hint {
  margin: 0 0 var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--color-text-muted, #6e6e73);
  background: var(--color-surface, #fff);
  border-radius: var(--radius-sm, 8px);
}

