:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #142033;
  --muted: #65748b;
  --line: #dbe3ef;
  --primary: #2f6df6;
  --primary-dark: #1d4ed8;
  --danger: #d43636;
  --warning: #b7791f;
  --success: #14855a;
  --shadow: 0 18px 45px rgba(20, 32, 51, .10);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, "Segoe UI", Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, select { font: inherit; }

.hero { padding: 24px clamp(20px, 5vw, 72px) 56px; color: #fff; background: radial-gradient(circle at 20% 20%, #4f8cff, transparent 30%), linear-gradient(135deg, #101827, #1d3764 70%, #245edb); }
.topbar, .hero__content, .page-shell { max-width: 1240px; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 56px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: .02em; }
.brand__mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); }
.topbar__links { display: flex; gap: 18px; color: rgba(255,255,255,.78); font-size: 14px; }
.hero__content { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; align-items: center; }
.eyebrow { margin: 0 0 8px; text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 800; color: var(--primary); }
.hero .eyebrow { color: #9fc2ff; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
h1 { font-size: clamp(36px, 5vw, 62px); max-width: 820px; }
h2 { font-size: clamp(24px, 3vw, 34px); }
h3 { font-size: 18px; margin-bottom: 14px; }
.hero__lead { color: rgba(255,255,255,.78); font-size: 18px; line-height: 1.7; max-width: 720px; }

.upload-card, .panel, .step-card { background: rgba(255,255,255,.96); color: var(--ink); border: 1px solid rgba(255,255,255,.5); border-radius: 28px; box-shadow: var(--shadow); }
.upload-card { padding: 22px; }
.file-drop { min-height: 220px; min-width: 0; border: 2px dashed #b8c7dd; border-radius: 22px; display: grid; place-items: center; text-align: center; padding: 24px; cursor: pointer; background: #f8fbff; }
.file-drop.dragover { border-color: var(--primary); background: #eef5ff; }
.file-drop input { display: none; }
.file-drop__icon { display: grid; place-items: center; width: 70px; height: 70px; border-radius: 20px; margin-bottom: 12px; color: #fff; background: linear-gradient(135deg, #2f6df6, #7c3aed); font-weight: 900; }
#file-title, #file-hint { max-width: 100%; overflow: hidden; text-overflow: ellipsis; overflow-wrap: anywhere; }
#file-hint { color: var(--muted); margin-top: 4px; }

.analysis-sidebar { display: grid; gap: 18px; align-self: start; }
.settings-panel { position: sticky; top: 82px; align-self: start; z-index: 2; padding: 16px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); backdrop-filter: blur(8px); }
.settings-panel h3 { margin-bottom: 12px; }
.settings-panel label { display: grid; gap: 8px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.settings-panel input { width: 100%; }
.params-details { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.params-details summary { cursor: pointer; color: var(--ink); font-weight: 700; font-size: 14px; }
.params-details[open] summary { margin-bottom: 4px; }
.page-shell { padding: 32px clamp(20px, 5vw, 72px) 72px; }
.step-grid { position: sticky; top: 0; z-index: 11; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: -72px 0 28px; padding: 10px 0; transition: .2s ease; }
.step-grid.is-collapsed { gap: 10px; margin-top: 0; background: rgba(244,247,251,.92); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(219,227,239,.8); }
.step-card { padding: 20px; cursor: pointer; transition: .2s ease; }
.step-grid.is-collapsed .step-card { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: center; padding: 10px 12px; border-radius: 18px; }
.step-grid.is-collapsed .step-card p { display: none; }
.step-grid.is-collapsed .step-card span { width: 28px; height: 28px; margin-bottom: 0; border-radius: 10px; }
.step-grid.is-collapsed .step-card strong { font-size: 14px; }
.step-card span { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: #edf4ff; color: var(--primary); font-weight: 900; margin-bottom: 14px; }
.step-card p { color: var(--muted); margin: 8px 0 0; }
.step-card.is-active { outline: 2px solid var(--primary); }
.step-card.is-done span { background: #e7f8f1; color: var(--success); font-size: 0; }
.step-card.is-done span::before { content: "✓"; font-size: 18px; }
.step-card.is-done { border-color: rgba(20, 133, 90, .35); }

.panel { padding: 26px; margin-bottom: 24px; }
.panel--analysis { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.analysis-content { min-width: 0; }
.panel__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.panel__controls, .actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
select { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.button { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 14px; padding: 11px 16px; cursor: pointer; font-weight: 700; transition: .18s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(20,32,51,.10); }
.button:disabled { opacity: .55; cursor: not-allowed; }
.button--primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.button--primary:hover:not(:disabled) { background: var(--primary-dark); }
.button--ghost { background: transparent; }
.status { margin-top: 16px; color: var(--muted); font-size: 14px; }
.status.is-busy::before { content: ""; display: inline-block; width: 12px; height: 12px; border: 2px solid #c7d5ea; border-top-color: var(--primary); border-radius: 50%; margin-right: 8px; vertical-align: -2px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.report-grid, .details-grid, .viewer-grid, .compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.report-grid--single, .details-grid--wide { grid-template-columns: 1fr; }
.report-card, .details-grid article, .viewer-grid article, .compare-grid article, .compare-pane { border: 1px solid var(--line); border-radius: 22px; padding: 18px; background: #fbfdff; min-width: 0; }
.report-card__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
pre { white-space: pre-wrap; word-break: break-word; color: #253247; margin: 0; font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; line-height: 1.55; }
.list-placeholder { color: var(--muted); }
.violation-card, .fixup-card { border: 1px solid var(--line); border-radius: 18px; background: #fff; padding: 14px; margin-bottom: 12px; }
.violation-card.is-error { border-color: rgba(212,54,54,.35); }
.meta { color: var(--muted); font-size: 13px; margin-top: 6px; }
.details-grid--wide article { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.details-grid--wide .report-card__head { grid-column: 1 / -1; margin-bottom: 0; }
.tabs { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 32px); overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.92); box-shadow: 0 14px 34px rgba(20,32,51,.10); backdrop-filter: blur(8px); }
.tab-button { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: #fff; cursor: pointer; font-weight: 800; text-align: left; }
.tab-button.has-errors { border-color: rgba(212,54,54,.35); }
.tab-button.is-passed { border-color: rgba(20,133,90,.35); }
.tab-button.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.image-grid--large { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.image-tile { border: 1px solid var(--line); border-radius: 16px; padding: 10px; background: #fff; }
.image-tile img, .preview-frame img { width: 100%; max-width: 100%; display: block; border-radius: 12px; }
.zoom-wrap { position: relative; overflow: visible; border-radius: 12px; cursor: zoom-in; }
.zoom-lens { position: absolute; width: 270px; height: 270px; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 12px 32px rgba(20,32,51,.32); background-repeat: no-repeat; pointer-events: none; transform: translate(-50%, -50%); display: none; z-index: 2; }
.zoom-wrap.is-zooming .zoom-lens { display: block; }
.preview-frame { min-height: 360px; border: 1px dashed #cbd8ea; border-radius: 18px; padding: 10px; background: repeating-linear-gradient(45deg, #fff, #fff 10px, #f5f8fc 10px, #f5f8fc 20px); overflow: auto; display: grid; place-items: center; }
.preview-frame canvas { max-width: 100%; display: block; border-radius: 12px; }
.toggle-list { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; color: var(--muted); }
.toggle { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); }
.fixups-list { display: grid; gap: 14px; }
.candidate { display: grid; grid-template-columns: auto minmax(260px, .85fr) minmax(420px, 1.35fr); gap: 16px; align-items: start; padding: 16px; border: 1px solid var(--line); border-radius: 16px; margin-top: 12px; }
.candidate-preview img { width: 100%; min-height: 260px; object-fit: contain; background: #f8fbff; border-radius: 12px; border: 1px solid var(--line); }
.warning { color: var(--warning); font-weight: 800; }
.notice { border: 1px solid #ffd79a; background: #fff8eb; color: #7a4a00; padding: 12px 14px; border-radius: 14px; margin-bottom: 16px; }
.empty-state { border: 1px dashed #cbd8ea; background: #f8fbff; color: var(--muted); border-radius: 16px; padding: 18px; text-align: center; }
.button.is-loading::before { content: ""; display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; margin-right: 8px; vertical-align: -2px; animation: spin .8s linear infinite; }
.compare-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.compare-settings { position: sticky; top: 16px; border: 1px solid var(--line); border-radius: 22px; padding: 18px; background: #fbfdff; }
.compare-settings .toggle { width: 100%; margin-bottom: 10px; }
.compare-view { display: grid; gap: 20px; }
.compare-view--horizontal { grid-template-columns: 1fr; }
.compare-view--vertical { grid-template-columns: 1fr 1fr; }
.compare-view--slider .compare-pane { display: none; }
.slider-compare { position: relative; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: #fbfdff; min-height: 520px; cursor: ew-resize; }
.slider-compare img { display: block; width: 100%; user-select: none; pointer-events: none; }
.slider-after-wrap { position: absolute; inset: 0; width: 100%; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 47%, transparent 53%, transparent 100%); mask-image: linear-gradient(90deg, #000 0%, #000 47%, transparent 53%, transparent 100%); }
.slider-after-wrap img { max-width: none; height: auto; }
.slider-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; background: var(--primary); box-shadow: 0 0 0 9999px rgba(47,109,246,.06); }
.panel--download { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.drawer { position: fixed; inset: 0; background: rgba(10,18,32,.32); z-index: 20; opacity: 0; pointer-events: none; transition: .18s ease; }
.drawer.is-open { opacity: 1; pointer-events: auto; }
.drawer__panel { margin-left: auto; width: min(560px, 92vw); height: 100%; background: #fff; padding: 28px; overflow: auto; box-shadow: -20px 0 50px rgba(20,32,51,.20); }
.drawer__close { position: sticky; top: 0; z-index: 3; display: block; margin-left: auto; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 8px 12px; cursor: pointer; font-weight: 800; box-shadow: 0 8px 18px rgba(20,32,51,.08); }
.modal { width: min(860px, 92vw); max-height: 88vh; overflow: auto; border: 0; border-radius: 24px; padding: 26px; box-shadow: var(--shadow); }
.modal form[method="dialog"] { position: sticky; top: -26px; z-index: 3; min-height: 42px; margin: -26px -26px 14px; padding: 14px 26px 8px; background: linear-gradient(#fff 75%, rgba(255,255,255,0)); }
.modal::backdrop { background: rgba(10,18,32,.42); }
.modal--image { width: min(1180px, 96vw); }
.modal--image img { width: 100%; max-height: 82vh; object-fit: contain; border-radius: 16px; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: 420px; padding: 14px 16px; border-radius: 16px; background: #152033; color: #fff; box-shadow: var(--shadow); z-index: 10; }
.toast.is-error { background: var(--danger); }
.toast.is-success { background: var(--success); }
/* Элементы, у которых display задаётся классом, корректно скрываются
   атрибутом hidden. Скоуп /order: общие страницы не трогаем. */
.order-page [hidden] { display: none !important; }

/* ------------------------------------------------------------------
   Страница заказчика (/order) — самостоятельный дизайн. Всё скоупится
   в .order-page, интерфейс оператора не затрагивается.
   ------------------------------------------------------------------ */
.order-page { background:
  radial-gradient(1100px 480px at 88% -60px, rgba(139, 92, 246, .10), transparent 60%),
  radial-gradient(900px 420px at -8% 4%, rgba(79, 125, 255, .09), transparent 55%),
  #f4f6fb; }

/* Липкая лента этапов. */
.order-page .order-steps { position: sticky; top: 14px; z-index: 20; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 24px auto 28px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 24px; background: rgba(255, 255, 255, .88); box-shadow: 0 24px 50px -20px rgba(14, 23, 38, .22); backdrop-filter: blur(14px); max-width: 1120px; }
.order-page .order-steps .chip { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #7d8aa0; font-size: 14px; font-weight: 700; cursor: pointer; transition: .2s ease; }
.order-page .order-steps .chip .dot { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #edf1f8; color: #7d8aa0; font-size: 12px; font-weight: 800; transition: .2s ease; }
.order-page .order-steps .chip.is-active { border-color: transparent; color: #fff; background: linear-gradient(135deg, #4f7dff, #8b5cf6); box-shadow: 0 12px 26px -10px rgba(79, 125, 255, .6); }
.order-page .order-steps .chip.is-active .dot { position: relative; background: rgba(255, 255, 255, .22); color: transparent; }
.order-page .order-steps .chip.is-active .dot::after { content: ""; position: absolute; inset: 4px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.order-page .order-steps .chip.is-done { color: var(--success); border-color: rgba(20, 133, 90, .3); background: #f2fbf7; }
.order-page .order-steps .chip.is-done .dot { background: #e2f6ec; color: var(--success); font-size: 0; }
.order-page .order-steps .chip.is-done .dot::before { content: "✓"; font-size: 13px; }
.order-page .order-steps .chip.is-error { color: var(--danger); border-color: rgba(212, 54, 54, .3); background: #fdf3f3; }
.order-page .order-steps .chip.is-error .dot { background: #fbe2e2; color: var(--danger); font-size: 0; }
.order-page .order-steps .chip.is-error .dot::before { content: "✕"; font-size: 13px; }
.order-page .order-steps .chip.is-doing .dot { animation: pulse-dot 1s ease infinite; }

/* Одноколоночная вёрстка без белой общей подложки: карточки плавают сами. */
.order-page .panel--order { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; align-items: start; padding: 0; margin: 0 0 26px; background: none; border: none; box-shadow: none; border-radius: 0; }
.order-page .panel--order > .analysis-content { min-width: 0; display: grid; gap: 22px; }
/* При скролле по чипам секции не должны прятаться под липким меню. */
.order-page #upload-panel, .order-page #preview-panel, .order-page #price-panel, .order-page #checkout-panel { scroll-margin-top: 96px; }

/* Кнопки меню этапов: загрузка + «Проверить и исправить» / «Сбросить». */
.order-page .order-steps .order-upload { display: inline-flex; align-items: center; gap: 8px; max-width: min(260px, 100%); padding: 10px 18px 10px 12px; border: 1.5px solid rgba(79, 125, 255, .5); border-radius: 999px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 700; cursor: pointer; transition: .2s ease; }
.order-page .order-steps .order-upload .dot { display: grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: #e6effe; color: var(--primary); font-size: 13px; font-weight: 800; transition: .2s ease; }
.order-page .order-steps .order-upload .upload-button__label { display: inline-block; vertical-align: middle; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-page .order-steps .order-upload:hover:not(:disabled) { background: #f2f7ff; transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(79, 125, 255, .5); }
.order-page .order-steps .order-upload.has-file { background: #f2f7ff; }
.order-page .order-steps .order-upload.is-done { color: var(--success); border-color: rgba(20, 133, 90, .3); background: #f2fbf7; }
.order-page .order-steps .order-upload.is-done .dot { background: #e2f6ec; color: var(--success); font-size: 0; }
.order-page .order-steps .order-upload.is-done .dot::before { content: "✓"; font-size: 13px; }
.order-page .order-steps .order-upload.is-doing .dot { position: relative; color: transparent; }
.order-page .order-steps .order-upload.is-doing .dot::after { content: ""; position: absolute; inset: 4px; border: 2px solid rgba(79, 125, 255, .25); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }

.order-page .button { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 16px; padding: 12px 18px; cursor: pointer; font-weight: 800; transition: .18s ease; }
.order-page .button:disabled { opacity: .5; cursor: not-allowed; }
.order-page .button--primary { border: none; color: #fff; background: linear-gradient(135deg, #4f7dff, #8b5cf6); box-shadow: 0 14px 30px -12px rgba(79, 125, 255, .6); }
.order-page .button--primary:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-2px); box-shadow: 0 18px 36px -12px rgba(79, 125, 255, .65); }
.order-page .button--ghost { background: transparent; color: #5b6b83; font-weight: 700; }
.order-page .button--xl { width: 100%; padding: 15px 20px; font-size: 16px; }
.order-page .button.is-loading::before { content: ""; display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; margin-right: 8px; vertical-align: -2px; animation: spin .8s linear infinite; }

/* Визуально скрытая строка статуса обработки (читается скринридером). */
.order-page .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Оформление заказа — отдельная панель после расчёта стоимости. */
.order-page #checkout-panel .checkout-card { display: grid; justify-items: center; gap: 12px; max-width: 560px; margin: 0 auto; width: 100%; text-align: center; }
.order-page #checkout-panel .checkout-card .meta { margin: 0; }
.order-page #checkout-panel .checkout-card .price-result { justify-self: stretch; width: 100%; margin-top: 0; text-align: left; }
.order-page #checkout-panel .checkout-card .button--xl { width: auto; min-width: 280px; }

/* Отчёт и нарушения. */
.order-page .report-grid, .order-page .report-grid--single { display: grid; grid-template-columns: 1fr; gap: 22px; }
.order-page .report-card { padding: 24px; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: 0 16px 40px -20px rgba(14, 23, 38, .14); min-width: 0; }
.order-page .report-card__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.order-page .report-card__head h3 { margin: 0; font-size: 18px; }
.order-page #report-summary { margin: 0; font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 15px; line-height: 1.75; color: #253247; white-space: pre-wrap; word-break: break-word; }
.order-page .meta { color: #5b6b83; }
.order-page .violation-card { position: relative; padding: 15px 46px 15px 54px; border: 1px solid #f0d9d9; border-radius: 18px; background: #fefbfb; margin-bottom: 12px; cursor: pointer; transition: .18s ease; }
.order-page .violation-card:hover { border-color: rgba(212, 54, 54, .5); background: #fdf3f3; box-shadow: 0 10px 24px -14px rgba(212, 54, 54, .55); }
.order-page .violation-card::after { content: "›"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid #ffe0e0; background: #fff; color: #c1535c; font-size: 15px; font-weight: 800; transition: .18s ease; }
.order-page .violation-card::before { content: "!"; position: absolute; left: 14px; top: 15px; display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: #fbe1e1; color: var(--danger); font-weight: 900; }
.order-page .violation-card strong { display: block; font-size: 14.5px; color: var(--ink); }
.order-page .violation-card p { margin: 8px 0 0; color: #4d5c74; font-size: 14px; line-height: 1.6; }
.order-page .badge { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 800; flex: 0 0 auto; }
.order-page .badge--ok { color: var(--success); background: #e7f8f1; border: 1px solid rgba(20, 133, 90, .3); }
.order-page .badge--fail { color: var(--danger); background: #fdeaea; border: 1px solid rgba(212, 54, 54, .3); }

/* Предпросмотр со слайдером. */
.order-page .panel__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.order-page .eyebrow { margin: 0 0 6px; text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 800; color: #4f7dff; }
.order-page .panel__header h2 { margin: 0; font-size: 24px; }
.order-page .panel__controls label { color: #5b6b83; font-size: 14px; font-weight: 700; }
.order-page .panel__controls select { margin-left: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font-weight: 700; }
.order-page .empty-state { margin: 0; padding: 44px 28px; text-align: center; color: #7d8aa0; border: 2px dashed #dde5f1; border-radius: 24px; background: #fff; font-size: 15px; }
.order-page .slider-compare { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: 0 22px 50px -22px rgba(14, 23, 38, .2); min-height: 420px; cursor: ew-resize; touch-action: none; }
.order-page .slider-compare img { display: block; width: 100%; user-select: none; pointer-events: none; }
.order-page .slider-after-wrap { position: absolute; inset: 0; width: 100%; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 47%, transparent 53%, transparent 100%); mask-image: linear-gradient(90deg, #000 0%, #000 47%, transparent 53%, transparent 100%); }
.order-page .slider-after-wrap img { max-width: none; height: auto; }
.order-page .slider-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; background: #fff; box-shadow: 0 0 20px rgba(10, 17, 32, .55); }
.order-page .slider-handle { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; color: #fff; font-size: 17px; background: linear-gradient(135deg, #4f7dff, #8b5cf6); box-shadow: 0 10px 26px rgba(10, 17, 32, .45); pointer-events: none; }
.order-page .slider-tag { position: absolute; top: 16px; z-index: 1; padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 800; color: #fff; background: rgba(10, 17, 32, .66); backdrop-filter: blur(8px); pointer-events: none; }
.order-page .slider-tag--before { left: 16px; }
.order-page .slider-tag--after { right: 16px; background: linear-gradient(135deg, rgba(79, 125, 255, .92), rgba(139, 92, 246, .92)); }
.order-page .slider-line, .order-page .slider-tag { z-index: 2; }

/* Лупа над слайдером убрана: сравнение только линией. */
.order-page .compare-note { margin: -8px 0 6px; color: #4d5c74; font-size: 14px; font-weight: 700; }

/* Подвал. */
.order-page .order-footer { padding: 26px clamp(20px, 5vw, 72px) 40px; text-align: center; color: #7d8aa0; font-size: 14px; line-height: 1.7; }
@keyframes pulse-dot { 50% { opacity: .35; } }

/* Расчёт стоимости тиража. */
.order-page .price-card { padding: 22px 24px; }
.order-page .price-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 18px; margin-bottom: 16px; }
.order-page .price-fields label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: #5b6c85; }
.order-page .roll-matrix { display: grid; grid-template-columns: repeat(var(--roll-matrix-columns, 1), var(--roll-matrix-cell-size, 8px)); grid-template-rows: repeat(var(--roll-matrix-rows, 1), var(--roll-matrix-cell-size, 8px)); width: fit-content; max-width: 100%; gap: var(--roll-matrix-gap, 3px); overflow: hidden; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #f8faff; }
.order-page .roll-matrix__cell { width: var(--roll-matrix-cell-size, 8px); height: var(--roll-matrix-cell-size, 8px); border-radius: 2px; background: linear-gradient(135deg, #4f7dff, #8b5cf6); }
.order-page .roll-matrix-layout { display: grid; grid-template-columns: minmax(116px, 180px) minmax(0, 1fr); grid-template-areas: ". streams" "labels display"; gap: 12px 18px; align-items: center; min-width: 0; }
.order-page .roll-matrix-control { display: grid; gap: 4px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdff; color: #46536a; }
.order-page .roll-matrix-control span { font-size: 14px; font-weight: 800; color: var(--ink); }
.order-page .roll-matrix-control small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.order-page .roll-matrix-control input { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-family: inherit; font-size: 15px; font-weight: 600; }
.order-page .roll-matrix-control input:disabled { background: #f1f4f9; opacity: .7; }
.order-page .roll-matrix-control--streams { grid-area: streams; width: min(100%, 260px); justify-self: start; }
.order-page .roll-matrix-control--labels { grid-area: labels; align-self: center; }
.order-page .roll-matrix-display { display: grid; grid-area: display; gap: 8px; min-width: 0; }
.order-page .roll-matrix-display > p { margin: 0; }
.order-page .roll-matrix-results { display: grid; gap: 8px; }
.order-page .roll-matrix-results > * { margin: 0; }
.order-page .roll-choice-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px 18px; max-width: 620px; margin: 12px 0; }
.order-page .roll-choice-fields label { display: grid; gap: 6px; min-width: 0; color: #5b6c85; font-size: 13px; font-weight: 700; }
.order-page .roll-choice-fields select { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font: inherit; }
.order-page .roll-choice-fields select:focus-visible { outline: 2px solid rgba(79, 125, 255, .5); outline-offset: 2px; }
.order-page .roll-stream-status { display: grid; justify-items: start; gap: 6px; max-width: 720px; margin-bottom: 8px; }
.order-page .roll-stream-status > * { margin: 0; }
.order-page #roll-options-retry { padding: 7px 10px; border-radius: 10px; font-size: 13px; }
.order-page .price-fields input[type="number"], .order-page .price-fields select {
  width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: #223; font-size: 15px; font-weight: 600; font-family: inherit;
}
.order-page .price-fields input:focus, .order-page .price-fields select:focus { outline: none; border-color: #4f7dff; box-shadow: 0 0 0 3px rgba(79, 125, 255, .16); }
.order-page .price-note { margin: 0; color: var(--danger); font-weight: 600; }
.order-page .price-result { margin-top: 18px; padding: 18px 20px; border-radius: 16px; background: linear-gradient(135deg, rgba(79, 125, 255, .08), rgba(139, 92, 246, .08)); border: 1px solid rgba(79, 125, 255, .25); }
.order-page .price-result__line { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 8px 0; font-size: 15px; font-weight: 650; color: #46536a; }
.order-page .price-result__line strong { font-size: clamp(20px, 2.6vw, 26px); font-weight: 800; letter-spacing: -.01em; background: linear-gradient(135deg, #4f7dff, #8b5cf6); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
.order-page .price-result .meta { margin: 6px 0 0; }
.order-page .extras { margin: 12px 0 4px; padding-top: 10px; border-top: 1px dashed var(--line); }
.order-page .extra-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 15px; font-weight: 650; color: #46536a; }
.order-page .extra-row input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.order-page .extra-row__title { flex: 1 1 auto; }
.order-page .extra-row__price { font-size: 15px; font-weight: 800; color: var(--ink); }
.order-page .extra-select { padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; color: var(--ink); background: #fff; }
.order-page .extra-select:disabled { opacity: .5; cursor: not-allowed; }
.order-page .extra-comment { width: 100%; margin: 4px 0 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font: inherit; font-size: 14px; resize: vertical; box-sizing: border-box; }
.order-page .price-result__line--total { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 17px; font-weight: 800; color: var(--ink); }
.order-page .usage-scenarios { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.order-page .usage-scenarios__title { margin: 0; font-size: 13px; font-weight: 700; color: #5b6c85; }
.order-page .usage-scenarios__list { display: flex; flex-wrap: wrap; gap: 10px; }
.order-page .scenario-chip { position: relative; display: inline-flex; align-items: center; padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #46536a; font-size: 14px; font-weight: 700; cursor: pointer; user-select: none; transition: .2s ease; }
.order-page .scenario-chip:hover { border-color: rgba(79, 125, 255, .5); color: var(--ink); }
.order-page .scenario-chip:has(input:checked) { border-color: transparent; background: #f2f6ff; box-shadow: 0 0 0 2px rgba(79, 125, 255, .35); color: var(--primary); }
.order-page .scenario-chip input { position: absolute; opacity: 0; pointer-events: none; }
.order-page .usage-scenarios .meta { margin: 0; font-size: 13px; line-height: 1.5; }
/* Кнопка «?» и модалка с инструкциями. */
.order-page .order-steps .help-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: rgba(255, 255, 255, .6); color: #5b6b83; font-size: 17px; font-weight: 800; cursor: pointer; transition: .2s ease; }
.order-page .order-steps .help-button:hover { border-color: rgba(79, 125, 255, .5); background: rgba(242, 247, 255, .9); color: var(--primary); transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(79, 125, 255, .5); }
/* Итог стоимости в верхнем меню (после кнопки «?»): появляется после расчёта. */
.order-page .menu-total { display: inline-flex; align-items: baseline; gap: 8px; padding: 8px 18px; border: 1px solid rgba(79, 125, 255, .25); border-radius: 999px; background: linear-gradient(135deg, rgba(79, 125, 255, .08), rgba(139, 92, 246, .08)); transition: .2s ease; }
.order-page .menu-total__label { font-size: 13px; font-weight: 700; color: #5b6b83; }
.order-page .menu-total strong { font-size: clamp(17px, 2vw, 22px); font-weight: 800; letter-spacing: -.01em; background: linear-gradient(135deg, #4f7dff, #8b5cf6); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
.order-page .help-modal { max-width: 640px; max-height: 80vh; padding: 26px 28px; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: 0 16px 40px -20px rgba(14, 23, 38, .14); color: var(--ink); overflow: auto; }
.order-page .help-modal::backdrop { background: rgba(12, 20, 35, .55); backdrop-filter: blur(3px); }
.order-page .help-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.order-page .help-modal__head h3 { margin: 0; font-size: 20px; }
.order-page .help-close { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: #5b6b83; font-size: 14px; cursor: pointer; transition: .18s ease; }
.order-page .help-close:hover { border-color: rgba(212, 54, 54, .4); background: #fdf3f3; color: var(--danger); }
.order-page .help-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.order-page .help-tab { padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #7d8aa0; font-size: 14px; font-weight: 700; cursor: pointer; transition: .2s ease; }
.order-page .help-tab:hover { border-color: rgba(79, 125, 255, .5); color: var(--ink); }
.order-page .help-tab.is-active { border-color: transparent; color: #fff; background: linear-gradient(135deg, #4f7dff, #8b5cf6); box-shadow: 0 12px 26px -10px rgba(79, 125, 255, .6); }
.order-page .help-tab-content p { margin: 0 0 12px; font-size: 15px; line-height: 1.7; color: #46536a; }
.order-page .help-tab-content ul { margin: 0 0 14px; padding-left: 22px; display: grid; gap: 6px; color: #46536a; font-size: 15px; line-height: 1.6; }
.order-page .help-tab-content h4 { margin: 16px 0 8px; font-size: 15px; color: var(--ink); }
.order-page .help-tab-content h4:first-child { margin-top: 0; }
.order-page .help-ok { width: 100%; margin-top: 6px; }

/* Модалка нарушения: короткий тезис, визуализация с лупой, полное описание. */
.order-page .error-modal[open] { display: flex; }
.order-page .error-modal { flex-direction: column; width: min(92vw, 720px); max-width: min(92vw, 720px); max-height: min(92vh, calc(100dvh - 24px)); padding: 24px 26px; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: 0 16px 40px -20px rgba(14, 23, 38, .14); color: var(--ink); overflow: auto; }
.order-page .error-modal.has-image { height: min(92dvh, calc(100dvh - 24px)); }
.order-page .error-modal::backdrop { background: rgba(12, 20, 35, .55); backdrop-filter: blur(3px); }
.order-page .error-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex: 0 0 auto; margin-bottom: 12px; }
.order-page .error-modal__head h3 { margin: 0; font-size: 19px; }
.order-page .error-modal__actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.order-page .error-modal-question { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: rgba(255, 255, 255, .6); color: #5b6b83; font-size: 15px; font-weight: 800; cursor: pointer; transition: .18s ease; }
.order-page .error-modal-question:hover { border-color: rgba(79, 125, 255, .5); background: rgba(242, 247, 255, .9); color: var(--primary); }
.order-page .error-modal-question[aria-expanded="true"] { border-color: transparent; color: #fff; background: linear-gradient(135deg, #4f7dff, #8b5cf6); }
.order-page .error-modal-short { margin: 0 0 14px; flex: 0 0 auto; color: #46536a; font-size: 15px; line-height: 1.65; }
.order-page .error-modal-image-wrap { position: relative; display: flex; align-items: center; justify-content: center; flex: 1 1 0; min-width: 0; min-height: 0; overflow: visible; border-radius: 12px; background: #f6f8fc; cursor: zoom-in; }
.order-page .error-modal-image-wrap[hidden] { display: none; }
.order-page .error-modal-image { display: block; min-width: 0; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 12px; user-select: none; }
.order-page .error-modal-lens { position: absolute; width: 300px; height: 300px; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 12px 32px rgba(20, 32, 51, .32); background-repeat: no-repeat; pointer-events: none; transform: translate(-50%, -50%); z-index: 2; }
.order-page .error-modal-noimage { margin: 0 0 4px; padding: 22px 18px; flex: 0 0 auto; text-align: center; color: #7d8aa0; border: 2px dashed #dde5f1; border-radius: 16px; font-size: 14px; }
.order-page .error-modal-details { margin-top: 14px; padding: 14px 16px; flex: 0 0 auto; max-height: min(34dvh, 220px); overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: #f7f9fd; }
.order-page .error-modal-details h4 { margin: 0 0 8px; font-size: 14px; color: var(--ink); }
.order-page .error-modal-details p { margin: 0 0 8px; font-size: 14px; line-height: 1.6; color: #46536a; word-break: break-word; }
.order-page .error-modal-details p:last-child { margin-bottom: 0; }

@media (max-width: 980px) {
  .order-page .panel--order { grid-template-columns: 1fr; }
  .order-page .price-fields { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}
@media (max-width: 640px) {
  .order-page .order-steps { gap: 6px; padding: 10px 10px; }
  .order-page .order-steps .chip { padding: 8px 12px; font-size: 12px; gap: 6px; }
  .order-page .order-steps .order-upload { padding: 8px 14px 8px 10px; font-size: 12px; gap: 6px; }
  .order-page .order-steps .order-upload .upload-button__label { max-width: 150px; }
  .order-page .slider-tag { font-size: 11.5px; padding: 5px 10px; }
  .order-page .error-modal { width: calc(100vw - 24px); max-width: calc(100vw - 24px); padding: 18px 16px; }
  .order-page .error-modal.has-image { height: min(92dvh, calc(100dvh - 24px)); }
  .order-page .price-result__line { flex-direction: column; gap: 2px; }
  .order-page .roll-matrix-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "streams" "labels" "display"; gap: 10px; }
  .order-page .roll-matrix-control--streams { width: 100%; max-width: 260px; }
  .order-page .roll-matrix-control--labels { width: 100%; max-width: 260px; }
}
@media (max-width: 360px) {
  .order-page .roll-matrix { --roll-matrix-cell-size: 6px; --roll-matrix-gap: 2px; padding: 6px; }
}
@media (max-width: 280px) {
  .order-page .roll-matrix { --roll-matrix-cell-size: 4px; --roll-matrix-gap: 1px; padding: 4px; }
}


@media (max-width: 980px) {
  .settings-panel { position: static; }
  .hero__content, .report-grid, .details-grid, .viewer-grid, .compare-grid, .compare-layout, .compare-view--vertical, .panel--analysis, .panel--order { grid-template-columns: 1fr; }
  .details-grid--wide article { grid-template-columns: 1fr; }
  .details-grid--wide .report-card__head { grid-column: auto; }
  .tabs { position: static; flex-direction: row; max-height: none; }
  .step-grid { grid-template-columns: repeat(2, 1fr); margin-top: 24px; }
  .topbar { align-items: flex-start; flex-direction: column; margin-bottom: 32px; }
}
@media (max-width: 640px) {
  .topbar__links { display: none; }
  .step-grid { grid-template-columns: 1fr; }
  .panel__header, .panel--download { align-items: flex-start; flex-direction: column; }
  .candidate { grid-template-columns: 1fr; }
  .candidate-preview img { min-height: 180px; }
}
