/* ── «Новая техника» (#/assets/new) — пять шагов ───────────────────────────────
   Раньше стили вставлялись из самой страницы; теперь это обычный файл на токенах темы (светлая и тёмная работают без правок).
   Телефон: компактный ход «Шаг 2 из 5», поля в одну колонку с крупными целями, кнопки шагов закреплены внизу над нижней панелью. */

.aw-page { max-width: var(--page-max); margin: 0 auto; padding: 24px 16px 40px; box-sizing: border-box; }
.aw-page * { box-sizing: border-box; }
.aw-page__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.aw-page__title { margin: 0; font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; color: var(--text-primary); }

/* Ход по шагам: на компьютере — точки с подписями, на телефоне — одна строка и полоса */
.aw-progress { display: flex; align-items: center; margin-bottom: 28px; }
.aw-progress__step { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.aw-progress__dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: var(--border-default); color: var(--text-muted); transition: background .2s; }
.aw-progress__label { font-size: 11px; color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.aw-progress__step--active .aw-progress__dot { background: var(--accent-primary); color: var(--text-inverse); box-shadow: 0 0 0 4px var(--accent-surface); }
.aw-progress__step--active .aw-progress__label { color: var(--accent-primary); font-weight: 700; }
.aw-progress__step--done .aw-progress__dot { background: var(--status-success, var(--accent-primary)); color: var(--text-inverse); }
.aw-progress__step--done .aw-progress__label { color: var(--status-success, var(--accent-primary)); }
.aw-progress__line { flex: 1; height: 2px; background: var(--border-default); margin: 0 8px 18px; }
.aw-progress__line--done { background: var(--status-success, var(--accent-primary)); }
.aw-compact { display: none; margin-bottom: 18px; }
.aw-compact__t { font-size: var(--text-sm); font-weight: var(--font-semibold); color: var(--text-primary); margin-bottom: 8px; }
.aw-compact__bar { height: 6px; border-radius: 999px; background: var(--border-subtle); overflow: hidden; }
.aw-compact__bar span { display: block; height: 100%; background: var(--accent-primary); border-radius: inherit; }

.aw-body { background: var(--surface-primary); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: 28px; }
.aw-step__title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; color: var(--text-primary); }
.aw-step__sub { font-size: .83rem; color: var(--text-muted); margin-bottom: 22px; }

.aw-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 18px 16px; }
.aw-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.aw-field--full { grid-column: 1 / -1; }
@media (min-width: 1500px) { .aw-field--full { grid-column: span 2; } }    /* в трёх колонках длинное поле — на две, а не на всю строку в 1500 px */
.aw-label { font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: .02em; }
.aw-req { color: var(--status-danger, var(--color-danger)); }
.aw-hint { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.aw-hint--center { margin-top: 16px; text-align: center; }
.aw-err { font-size: 12px; color: var(--status-danger, var(--color-danger)); line-height: 1.4; }
.aw-field--bad .form-input { border-color: var(--status-danger, var(--color-danger)); }
.aw-empty { padding: 12px 14px; border: 1px dashed var(--status-warning, var(--color-warning)); border-radius: var(--radius-md); font-size: var(--text-sm); color: var(--text-primary); background: color-mix(in srgb, var(--status-warning, var(--color-warning)) 8%, transparent); }
.aw-price { display: flex; gap: 8px; }
.aw-price .form-input:first-child { flex: 1; min-width: 0; }
.aw-price select { width: 92px; flex: none; }

.aw-type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.aw-type-tile { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 12px; min-height: 96px; border: 1.5px solid var(--border-default); border-radius: var(--radius-lg); background: var(--surface-elevated); color: var(--text-secondary); cursor: pointer; transition: border-color .15s, background .15s; font: inherit; }
.aw-type-tile:hover { border-color: var(--accent-primary); background: var(--accent-surface); }
.aw-type-tile:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
.aw-type-tile--selected { border-color: var(--accent-primary); background: var(--accent-surface); color: var(--accent-primary); }
.aw-type-tile__label { font-size: 13px; font-weight: 600; color: var(--text-primary); }

.aw-upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.aw-upload-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px 12px; min-height: 110px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.aw-upload-zone:hover { border-color: var(--accent-primary); background: var(--accent-surface); }
.aw-upload-zone--filled { border-style: solid; border-color: var(--accent-primary); background: var(--accent-surface); }
.aw-upload-zone__label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.aw-upload-zone__hint { font-size: 12px; color: var(--text-muted); }
.aw-upload-zone__file { font-size: 12px; overflow-wrap: anywhere; color: var(--text-primary); }
.aw-upload-zone__file span { color: var(--text-muted); }
.aw-upload-zone__clear { min-height: 36px; border: 0; background: none; color: var(--accent-primary); font: inherit; font-size: 13px; cursor: pointer; padding: 2px 8px; }

.aw-nav { display: flex; align-items: center; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border-default); }
.aw-nav__gap { flex: 1; }
.aw-nav .btn { min-height: 40px; padding-left: 20px; padding-right: 20px; }

@media (max-width: 768px) {
  .aw-page { padding: 12px 16px calc(150px + env(safe-area-inset-bottom, 0px)); }
  .aw-page__header { margin-bottom: 12px; }
  .aw-close { display: none; }
  .aw-progress { display: none; }
  .aw-compact { display: block; }
  .aw-body { padding: 18px 16px; border-radius: var(--radius-md); }
  .aw-form-grid { grid-template-columns: 1fr; gap: 16px; }
  .aw-field .form-input { min-height: 46px; font-size: 16px; }   /* 16 px: Safari не приближает страницу при фокусе */
  .aw-field textarea.form-input { min-height: 96px; }
  .aw-type-grid { grid-template-columns: repeat(2, 1fr); }
  .aw-upload-grid { grid-template-columns: 1fr; }
  /* Кнопки шагов закреплены над нижней панелью: до них всегда достаёт большой палец */
  .aw-nav { position: fixed; left: 0; right: 0; bottom: calc(58px + env(safe-area-inset-bottom, 0px)); z-index: 205; margin: 0; padding: 10px 16px; background: var(--surface-elevated); border-top: 1px solid var(--border-default); }
  .aw-nav .btn { min-height: 48px; font-size: var(--text-md); }
  .aw-nav .js-aw-next, .aw-nav .js-aw-submit { flex: 1; }
  body:not(.has-mobile-bottom-nav) .aw-nav { bottom: env(safe-area-inset-bottom, 0px); }
}

@media (prefers-reduced-motion: reduce) {
  .aw-progress__dot, .aw-type-tile, .aw-upload-zone { transition: none; }
}

/* ── Выбор модели из справочника: поле с подсказками, выбранная модель плашкой ───────────────────────────── */
.mp { display: flex; flex-direction: column; gap: 6px; }
.mp-box { position: relative; }
.mp-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; max-height: 260px; overflow-y: auto;
  background: var(--surface-primary); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: 0 12px 32px rgba(0, 0, 0, .35); }
.mp-list[hidden] { display: none; }
.mp-opt { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--text-primary); }
.mp-opt:hover, .mp-opt--on { background: var(--row-hi, var(--accent-surface)); }
.mp-opt__t { font-size: 14px; font-weight: 600; }
.mp-opt__s { font-size: 12px; color: var(--text-muted); }
.mp-opt--add { flex-direction: row; align-items: center; margin-top: 2px; border-top: 1px solid var(--border-subtle); border-radius: 0 0 8px 8px; padding-top: 10px; color: var(--accent-primary); font-weight: 600; font-size: 14px; }
.mp-empty { padding: 10px; font-size: 13px; color: var(--text-muted); }
.mp-chip { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 8px 6px 12px; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--accent-surface); }
.mp-chip__t { font-weight: 600; font-size: 14px; color: var(--text-primary); min-width: 0; overflow-wrap: anywhere; }
.mp-chip__s { font-size: 12px; color: var(--text-muted); }
.mp-chip__x { margin-left: auto; width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: var(--text-muted); font-size: 18px; line-height: 1; cursor: pointer; }
.mp-chip__x:hover { background: var(--row-hi, var(--border-subtle)); color: var(--text-primary); }
.mp-chip__x:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
@media (max-width: 768px) { .mp-opt { padding: 12px 10px; } .mp-chip__x { width: 36px; height: 36px; } }
