/* Онлайн-расшифровка (/decode/): рабочий экран — история слева, расшифровка панелями на весь экран.
   Громкое одно — схема кузова: фильтр по серьёзности оставляет на ней только выбранные выноски, остальные гаснут.
   Панели на месте всё время: пустой бланк → ожидание → данные.
   Префиксы: dc- — компоненты (печать, переключатели, плашки кодов, схема, цена, галерея), dd- — раскладка рабочего экрана. */

/* ---------- компоненты ---------- */
.dc-link {
  padding: 0; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px;
}
.dc-link:hover { text-decoration-color: var(--red); }
.dc-link:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px; }
.dc-sheet {
  position: relative; margin: 0; aspect-ratio: 3 / 4; overflow: hidden;
  border-radius: 10px; background: var(--paper-2); rotate: -1.4deg;
  box-shadow: 0 18px 36px -20px rgba(20, 31, 56, 0.6);
}
.dc-sheet img, .dc-sheet svg { width: 100%; height: 100%; object-fit: cover; }
.dc-beam {
  position: absolute; left: 0; right: 0; top: 0; height: 32%;
  background: linear-gradient(180deg, rgba(200, 16, 46, 0), rgba(200, 16, 46, 0.18));
  border-bottom: 2px solid var(--red);
  translate: 0 -100%;
  animation: dc-beam 2.2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
@keyframes dc-beam { to { translate: 0 320%; } }
.dc-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; }
.dc-dot svg { width: 12px; height: 12px; opacity: 0; }
@keyframes dc-spin { to { rotate: 1turn; } }
.dc-stamp {
  position: relative; width: 104px; height: 104px; border-radius: 50%;
  display: grid; place-content: center; text-align: center;
  border: 3px solid var(--red); color: var(--red); rotate: -9deg;
  background: radial-gradient(circle, rgba(200, 16, 46, 0.05), transparent 70%);
}
.dc-stamp::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; border: 1.5px solid var(--red); opacity: 0.55; }
.dc-stamp b { font-family: var(--font-display); font-size: 34px; font-weight: 800; line-height: 1; }
.dc-stamp span { margin-top: 3px; font-size: 12px; font-weight: 600; }
.dc-stamp.is-empty b { font-size: 26px; }
.dc-seg { position: relative; display: inline-flex; padding: 4px; border-radius: 12px; background: var(--paper); }
.dc-seg button {
  position: relative; z-index: 1; padding: 9px 18px; border: 0; border-radius: 9px; background: none;
  font: inherit; font-size: 15.5px; font-weight: 600; color: var(--ink-3); cursor: pointer; transition: color 0.25s var(--ease);
}
.dc-seg button:hover { color: var(--ink-2); }
.dc-seg button[aria-selected="true"], .dc-seg button[aria-pressed="true"] { color: var(--ink); }
.dc-seg button:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }
.dc-ind {
  position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 9px; background: var(--white);
  box-shadow: 0 1px 2px rgba(20, 31, 56, 0.12), 0 6px 14px -8px rgba(20, 31, 56, 0.45);
}
.dc-seg-sm button { padding: 7px 14px; font-size: 14px; }
.dc-equip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dc-equip span { padding: 4px 11px; border-radius: 999px; background: var(--paper); font-size: 14px; }
.dc-dia {
  position: relative; display: block; width: 100%; max-width: 780px; margin-top: 16px; padding: 0; border: 0; overflow: hidden;
  border-radius: calc(100% * 22 / 808) / calc(100% * 22 / 756); background: var(--paper); aspect-ratio: 808 / 756; cursor: zoom-in; font: inherit;
}
.dc-dia > div { position: absolute; inset: 0; }
.dc-dia svg { width: 100%; height: 100%; }
.dc-dia:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.dc-code {
  justify-self: start; padding: 5px 9px; border-radius: 999px; border: 1.5px solid currentColor;
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; line-height: 1;
}
.dc-code.s3 { color: var(--white); background: var(--red); border-color: var(--red); }
.dc-code.s2 { color: var(--red); }
.dc-code.s1 { color: var(--ink-2); }
.dc-range { position: relative; height: 8px; margin: 34px 0 10px; border-radius: 4px; background: linear-gradient(90deg, var(--paper-3), var(--paper-2)); }
.dc-range i { position: absolute; top: -7px; width: 3px; height: 22px; margin-left: -1.5px; border-radius: 2px; background: var(--red); }
.dc-range-l { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; color: var(--ink-2); }
.dc-range-l b { font-family: var(--font-mono); font-weight: 600; font-size: 13.5px; color: var(--ink); display: block; }
.dc-lb { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 56px 76px 36px; }
.dc-lb-back { position: absolute; inset: 0; background: rgba(12, 19, 36, 0.8); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.dc-lb-fig { position: relative; margin: 0; display: grid; justify-items: center; gap: 14px; max-width: 100%; }
.dc-lb-media { overflow: hidden; border-radius: 18px; background: var(--white); box-shadow: 0 40px 110px -30px rgba(0, 0, 0, 0.7); }
.dc-lb-media img { display: block; width: auto; height: auto; max-width: min(1100px, calc(100vw - 152px)); max-height: calc(100vh - 140px); }
.dc-lb-media[data-kind="svg"] {
  width: min(1000px, calc(100vw - 152px), calc((100vh - 140px) * 808 / 756));
  border-radius: calc(100% * 22 / 808) / calc(100% * 22 / 756); background: none;
}
.dc-lb-media svg { display: block; width: 100%; height: auto; }
.dc-lb-cap { color: rgba(255, 253, 249, 0.85); font-size: 14.5px; text-align: center; }
.dc-lb-x, .dc-lb-nav {
  position: absolute; z-index: 1; width: 46px; height: 46px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 50%; background: rgba(255, 253, 249, 0.14); color: var(--white); cursor: pointer;
  transition: background-color 0.2s var(--ease);
}
.dc-lb-x:hover, .dc-lb-nav:hover { background: rgba(255, 253, 249, 0.28); }
.dc-lb-x:focus-visible, .dc-lb-nav:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
.dc-lb-x { top: 16px; right: 16px; }
.dc-lb-nav { top: 50%; translate: 0 -50%; }
.dc-lb-prev { left: 16px; }
.dc-lb-next { right: 16px; }
.dc-lb .ic { width: 20px; height: 20px; }
@media (max-width: 640px) {
  .dc-lb { padding: 66px 12px 84px; }
  .dc-lb-media img { max-width: calc(100vw - 24px); max-height: calc(100vh - 180px); }
  .dc-lb-media[data-kind="svg"] { width: min(calc(100vw - 24px), calc((100vh - 180px) * 808 / 756)); }
  .dc-lb-nav { top: auto; bottom: 20px; translate: none; }
  .dc-lb-prev { left: calc(50% - 58px); }
  .dc-lb-next { right: calc(50% - 58px); }
}
@media (prefers-reduced-motion: reduce) {
  .dc-beam { animation: none; translate: 0 150%; }
}

/* ---------- рабочий экран ---------- */

.dd-body { font-size: 15.5px; line-height: 1.5; }
.dd { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.dd .ic { width: 20px; height: 20px; }

/* ---------- история ---------- */
.dd-rail {
  position: sticky; top: 0; z-index: 20; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; gap: 18px; padding: 18px 14px 16px;
  background: var(--paper-2); border-right: 1px solid var(--line);
  overflow-y: auto; overscroll-behavior: contain;
}
.dd-rail-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 0; }
.dd-rail .dd-rail-x { display: none; }
.dd-new { justify-content: center; }
.dd-new svg { width: 18px; height: 18px; }
.dd-hist { flex: 1 0 auto; }
.dd-rail-h { margin: 0 0 6px; padding: 0 10px; font-family: var(--font-body); font-size: 13.5px; font-weight: 600; letter-spacing: 0; color: var(--ink-3); }
.dd-rail-h-sample { margin-top: 20px; }
.dd-hist ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.dd-hist-empty { padding: 2px 10px; font-size: 13.5px; line-height: 1.45; color: var(--ink-3); }
.dd-slip {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; column-gap: 11px; align-items: center;
  width: 100%; padding: 9px 10px; border: 0; border-radius: 12px; background: none;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.dd-slip:hover { background: rgba(255, 253, 249, 0.6); }
.dd-slip[aria-current="true"] { background: var(--white); box-shadow: 0 1px 2px rgba(20, 31, 56, 0.08), 0 10px 22px -16px rgba(20, 31, 56, 0.45); }
.dd-slip:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }
.dd-slip:disabled { cursor: default; }
.dd-slip .dd-mini { grid-row: 1 / 3; }
.dd-slip b { font-size: 14.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-slip time { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dd-slip small { grid-column: 2 / 4; font-size: 12.5px; line-height: 1.35; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* маленькая печать с оценкой — как большая в шапке */
.dd-mini {
  position: relative; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--red); color: var(--red); rotate: -9deg;
  font-family: var(--font-display); font-style: normal; font-size: 11.5px; font-weight: 700; letter-spacing: -0.02em;
}
.dd-mini.is-empty { border-color: var(--line-strong); color: var(--ink-3); }
.dd-mini.is-sample { border-style: dashed; }
.dd-mini.is-run { border-color: rgba(200, 16, 46, 0.2); }
.dd-mini.is-run::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--red); animation: dc-spin 0.8s linear infinite; }
.dd-rail-foot { display: grid; gap: 12px; justify-items: start; padding: 16px 10px 2px; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
/* остаток бесплатных расшифровок */
.dd-quota { display: grid; gap: 8px; width: 100%; }
.dd-quota[hidden] { display: none; }
.dd-quota b { color: var(--ink); font-variant-numeric: tabular-nums; }
.dd-quota-bar { display: flex; gap: 4px; }
.dd-quota-bar i { flex: 1; height: 6px; border-radius: 3px; background: var(--paper-3); }
.dd-quota-bar i.on { background: var(--green); }

.dd-icon {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; flex: none;
  border: 0; border-radius: 10px; background: none; color: var(--ink-2); cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.dd-icon:hover { background: var(--paper); color: var(--ink); }
.dd-icon:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }

/* ---------- рабочая область ---------- */
.dd-main { position: relative; min-width: 0; padding: 22px clamp(18px, 2.4vw, 36px) 56px; }
.dd-bar { display: none; }
.dd-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; max-width: 1500px; margin: 0 auto; }
.dd-head { position: relative; grid-column: 1 / -1; }
.dd-head > .is-leaving { position: absolute; top: 0; left: 0; right: 0; pointer-events: none; }
.dd-nojs { display: grid; gap: 16px; justify-items: start; max-width: 36em; padding: 40px 0; color: var(--ink-2); }

/* панели */
.dd-p {
  position: relative; min-width: 0; display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 1px 0 rgba(20, 31, 56, 0.03), 0 24px 46px -42px rgba(20, 31, 56, 0.55);
  transition: opacity 0.5s var(--ease);
}
.dd-p[hidden] { display: none; }
.dd-p-dia { grid-column: span 7; }
.dd-p-marks { grid-column: span 5; }
.dd-p-specs { grid-column: span 5; }
.dd-p-price { grid-column: span 4; }
.dd-p-sheet { grid-column: span 3; }
.dd-p-notes { grid-column: 1 / -1; }
.dd-ph { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 11px 12px 7px 20px; }
.dd-ph h2 { font-family: var(--font-body); font-size: 16px; font-weight: 600; letter-spacing: 0; white-space: nowrap; }
.dd-n { margin-left: 3px; color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.dd-ph-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; min-width: 0; }
.dd-pb { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 2px 20px 20px; }
.dd-fill { flex: 1 1 auto; min-height: 0; }
.dd-pb > .is-leaving { position: absolute; top: 2px; left: 20px; right: 20px; pointer-events: none; }
.dd-empty { color: var(--ink-3); padding: 6px 0 4px; }

/* пустой бланк и ожидание */
.dd-grid:is([data-state="idle"], [data-state="error"], [data-state="paywall"]) .dd-p { opacity: 0.56; pointer-events: none; }
.dd-grid:not([data-state="result"]) .dd-styles, .dd-grid:not([data-state="result"]) .dd-ph [data-zoom],
.dd-grid:not([data-state="result"]) .dd-sheet-zoom { display: none; }
.dd-grid:not([data-state="result"]) .dd-sheet { pointer-events: none; }
.dd-grid:not([data-state="result"]) .dd-p-marks .dd-fill { overflow: hidden; }
.dd-status { display: none; align-items: center; gap: 8px; margin-right: 8px; font-size: 13.5px; color: var(--ink-3); white-space: nowrap; }
.dd-grid[data-state="scan"] .dd-status:is(.is-on, .is-done) { display: inline-flex; }
.dd-status.is-on { color: var(--ink-2); }
.dd-status.is-done { color: var(--green); }
.dd-status .dc-dot, .dd-step .dc-dot { width: 18px; height: 18px; flex: none; }
.dd-status .dc-dot svg, .dd-step .dc-dot svg { width: 10px; height: 10px; }
.dd-status.is-on .dc-dot, .dd-step.is-on .dc-dot { border-color: rgba(200, 16, 46, 0.22); border-top-color: var(--red); animation: dc-spin 0.8s linear infinite; }
.dd-status.is-done .dc-dot, .dd-step.is-done .dc-dot { border-color: var(--green); background: var(--green); animation: none; }
.dd-status.is-done .dc-dot svg, .dd-step.is-done .dc-dot svg { opacity: 1; }
.dd-sk { display: block; height: 11px; border-radius: 6px; background: var(--paper-2); }
.dd-grid[data-state="scan"] .dd-sk {
  background: linear-gradient(90deg, var(--paper-2) 0 35%, #f7f3ec 50%, var(--paper-2) 65% 100%) 0 0 / 300% 100%;
  animation: dd-shine 1.6s linear infinite;
}
@keyframes dd-shine { from { background-position: 100% 0; } to { background-position: 0 0; } }
.dd-sk-list { display: grid; gap: 18px; padding-top: 6px; }
.dd-sk-row { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center; }
.dd-sk-row span { display: grid; gap: 7px; }
.dd-sk-pill { width: 40px; height: 20px; border-radius: 999px; }
.dd-sk-specs { display: grid; gap: 0; }
.dd-sk-specs div { display: grid; grid-template-columns: 40% 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.dd-sk-specs div:last-child { border-bottom: 0; }
.dd-sk-price { display: grid; gap: 12px; padding-top: 4px; }
.dd-sk-price > div { display: flex; justify-content: space-between; }
.dd-sk-range { height: 8px; margin: 18px 0 2px; }

/* ---------- шапка ---------- */
.dd-drop {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 30px; align-items: center;
  padding: 30px 34px; border: 1.5px dashed var(--line-strong); border-radius: 22px; background: rgba(255, 253, 249, 0.62);
  cursor: pointer; transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}
.dd-drop:hover { border-color: var(--ink-3); }
.dd-drop.is-over { border-color: var(--red); background: var(--red-soft); }
.dd-drop-art { width: 104px; height: 104px; }
.dd-drop h1 { font-size: clamp(26px, 2.5vw, 36px); font-weight: 700; }
.dd-drop p { margin-top: 10px; max-width: 44em; color: var(--ink-2); font-size: 16.5px; }
.dd-drop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 20px; }
.dd-drop .dd-consent { margin-top: 14px; font-size: 13.5px; color: var(--ink-3); }
.dd-consent a, .dd-legal a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.dd-consent a:hover, .dd-legal a:hover { color: var(--ink); text-decoration-color: var(--red); }
.dd-legal { font-size: 12.5px; color: var(--ink-3); }
.dd-tips { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 16px 0 0; padding: 0; list-style: none; color: var(--ink-3); font-size: 14px; }
.dd-tips li { display: inline-flex; align-items: center; gap: 8px; }
.dd-tips li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.dd-tips li.dd-left { color: var(--ink); font-weight: 600; }

.dd-scanhead { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 26px; align-items: center; padding: 10px 4px 12px; }
.dd-scanhead .dc-sheet { width: 88px; aspect-ratio: 3 / 4; }
.dd-scanhead h1 { font-size: clamp(24px, 2.3vw, 32px); font-weight: 700; }
.dd-steps { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 14px 0 0; padding: 0; list-style: none; }
.dd-step { display: inline-flex; align-items: center; gap: 9px; font-size: 14.5px; color: var(--ink-3); transition: color 0.3s var(--ease); }
.dd-step.is-on, .dd-step.is-done { color: var(--ink); }
.dd-step time { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }
.dd-timer { align-self: start; margin-top: 6px; font-family: var(--font-mono); font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.dd-title { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 34px; align-items: start; padding: 6px 4px 8px; }
.dd-title h1 { font-size: clamp(28px, 3vw, 44px); font-weight: 700; }
.dd-facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 16px 0 0; }
.dd-facts div { display: grid; gap: 2px; }
.dd-facts dt { font-size: 12.5px; color: var(--ink-3); }
.dd-facts dd { margin: 0; font-size: 15.5px; font-weight: 600; }
.dd-verdict { margin-top: 18px; max-width: 68ch; font-size: 17.5px; line-height: 1.5; }
.dd-side { display: grid; justify-items: end; gap: 18px; }
.dd-side .dc-stamp { width: 100px; height: 100px; margin: 2px 8px 0 0; }
.dd-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

/* бесплатные закончились: серая «печать» 0 из 5 — та же форма, что у оценки */
.dd-pay {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 30px; align-items: center;
  padding: 30px 34px; border: 1px solid var(--line); border-radius: 22px; background: var(--white);
}
.dd-pay h1 { font-size: clamp(24px, 2.4vw, 34px); font-weight: 700; }
.dd-pay p { margin-top: 10px; max-width: 46em; color: var(--ink-2); font-size: 16.5px; }
.dd-pay-mark {
  width: 104px; height: 104px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  border: 3px dashed var(--line-strong); color: var(--ink-3); rotate: -9deg;
}
.dd-pay-mark b { font-family: var(--font-display); font-size: 34px; font-weight: 800; line-height: 1; }
.dd-pay-mark span { margin-top: 3px; font-size: 12px; font-weight: 600; }

.dd-errhead {
  display: grid; gap: 10px; justify-items: start; padding: 28px 32px;
  border: 1.5px solid rgba(200, 16, 46, 0.32); border-radius: 22px; background: var(--white);
}
.dd-errhead h1 { font-size: clamp(24px, 2.3vw, 32px); font-weight: 700; }
.dd-errhead p { max-width: 40em; color: var(--ink-2); }
.dd-errhead .btn { margin-top: 8px; }

/* ---------- схема ---------- */
.dd-styles button { padding: 6px 12px; font-size: 13.5px; }
.dd-dia { max-width: none; margin: 0; }
.dd-dia [data-mark] { transition: opacity 0.22s var(--ease); }
.dd-dia[data-focus] [data-mark]:not(.is-hit) { opacity: 0.12; }
.dd-beam {
  display: none; position: absolute; z-index: 2; left: 0; right: 0; top: 0; height: 26%;
  background: linear-gradient(180deg, rgba(200, 16, 46, 0), rgba(200, 16, 46, 0.1));
  border-bottom: 2px solid rgba(200, 16, 46, 0.7);
  translate: 0 -100%; animation: dd-beam 2.8s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
.dd-grid[data-state="scan"] .dd-beam { display: block; }
@keyframes dd-beam { to { translate: 0 385%; } }

/* ---------- отметки ---------- */
/* высоту ряда задаёт схема: список её не раздвигает, а прокручивается внутри */
.dd-p-marks .dd-pb { contain: size; padding-bottom: 0; }
.dd-p-marks .dd-fill { display: flex; flex-direction: column; gap: 12px; }
.dd-filter { display: flex; width: 100%; flex: none; }
.dd-filter button { flex: 1 1 auto; padding: 7px 6px; font-size: 13.5px; white-space: nowrap; }
.dd-filter i { margin-left: 5px; font-style: normal; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
/* низ списка тает — видно, что он прокручивается; запас снизу, чтобы последняя строка выходила из тени */
.dd-scroll {
  position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -20px; padding: 0 20px 30px;
  scrollbar-width: thin; scrollbar-color: var(--paper-3) transparent;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 30px), transparent); mask-image: linear-gradient(#000 calc(100% - 30px), transparent);
}
.dd-marks { list-style: none; margin: 0 -10px; padding: 0; display: grid; gap: 1px; }
.dd-marks li[hidden] { display: none; }
.dd-mark { display: grid; grid-template-columns: 3.3em minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 10px; }
.dd-mark b { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.dd-mark em { display: block; font-style: normal; font-size: 13.5px; line-height: 1.35; color: var(--ink-3); }

/* ---------- характеристики, цена, фото, заметки ---------- */
.dd-specs { margin: 0; }
.dd-spec { display: grid; grid-template-columns: minmax(8em, 40%) minmax(0, 1fr); gap: 12px; align-items: center; min-height: 42px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.dd-spec:last-child { border-bottom: 0; }
.dd-spec dt { color: var(--ink-3); }
.dd-spec dd { margin: 0; display: flex; align-items: center; gap: 4px; min-width: 0; font-weight: 500; }
.dd-spec dd.mono { font-size: 13.5px; }
.dd-copy { width: 30px; height: 30px; margin: -4px 0; border-radius: 8px; color: var(--ink-3); }
.dd-copy .ic { width: 17px; height: 17px; }
.dd-copy.is-done { color: var(--green); }

.dd-price { display: grid; }
.dd-avg b { display: block; font-family: var(--font-display); font-size: clamp(28px, 2.5vw, 38px); font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.dd-avg em { display: block; margin-top: 8px; font-style: normal; font-size: 17px; font-weight: 600; color: var(--ink-2); }
.dd-price .dc-range { margin: 26px 0 10px; }
.dd-note { margin-top: 16px; font-size: 13.5px; line-height: 1.45; color: var(--ink-3); }

.dd-p-sheet .dd-fill { display: flex; }
.dd-sheet {
  position: relative; flex: 1; display: block; min-height: 220px; padding: 0; border: 0; overflow: hidden;
  border-radius: 12px; background: var(--paper-2); font: inherit; color: inherit;
}
button.dd-sheet { cursor: zoom-in; }
button.dd-sheet:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.dd-sheet img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transition: scale 0.5s var(--ease); }
button.dd-sheet:hover img { scale: 1.03; }
.dd-sheet-zoom { position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(20, 31, 56, 0.72); color: var(--white); }
.dd-sheet-empty { display: grid; place-content: center; justify-items: center; gap: 10px; padding: 20px; text-align: center; color: var(--ink-3); font-size: 13.5px; line-height: 1.45; }
.dd-sheet-empty svg { width: 64px; height: 64px; }

.dd-p-notes .dd-pb { padding-top: 20px; }
.dd-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px 36px; }
.dd-notes h3 { font-family: var(--font-body); font-size: 14px; font-weight: 600; letter-spacing: 0; color: var(--ink-3); }
.dd-notes p { margin-top: 6px; max-width: 60ch; }

/* файл тащат поверх готовой расшифровки */
.dd-cover {
  position: fixed; z-index: 80; inset: 12px 12px 12px 284px; display: grid; place-items: center;
  border: 2px dashed var(--red); border-radius: 22px; background: rgba(244, 240, 231, 0.9);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); pointer-events: none;
}
.dd-cover[hidden] { display: none; }
.dd-cover p { font-family: var(--font-display); font-size: 24px; font-weight: 700; }

/* ---------- узкие экраны: история уезжает в выдвижную панель ---------- */
@media (max-width: 1099px) {
  .dd { grid-template-columns: minmax(0, 1fr); }
  .dd-bar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; height: 60px;
    margin: 0 calc(-1 * clamp(18px, 2.4vw, 36px)) 18px; padding: 0 clamp(14px, 2.4vw, 36px);
    background: rgba(244, 240, 231, 0.9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
  }
  .dd-bar .logo { margin-right: auto; }
  .dd-bar .logo svg { flex: none; }
  .dd-bar .btn { padding: 9px 14px; font-size: 14.5px; }
  .dd-main { padding-top: 0; }
  .dd-rail {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 70; width: min(320px, 88vw); height: auto;
    visibility: hidden; transform: translateX(-100%); box-shadow: 30px 0 60px -30px rgba(20, 31, 56, 0.45);
  }
  .dd-rail.is-open { visibility: visible; transform: none; }
  .dd-rail .dd-rail-x { display: inline-grid; }
  .dd-scrim { position: fixed; inset: 0; z-index: 65; background: rgba(12, 19, 36, 0.42); }
  .dd-scrim[hidden] { display: none; }
  .dd-cover { inset: 12px; }
}
@media (max-width: 899px) {
  .dd-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .dd-p-dia, .dd-p-marks, .dd-p-specs, .dd-p-price, .dd-p-sheet, .dd-p-notes { grid-column: 1 / -1; }
  .dd-p-marks .dd-pb { contain: none; padding-bottom: 12px; }
  .dd-scroll { overflow: visible; padding-bottom: 0; -webkit-mask-image: none; mask-image: none; }
  .dd-sk-list { max-height: 260px; overflow: hidden; }
  .dd-sheet { min-height: 0; aspect-ratio: 4 / 3; }
  .dd-sheet.dd-sheet-empty { aspect-ratio: auto; padding: 26px 20px; }
  .dd-drop, .dd-pay { grid-template-columns: 1fr; padding: 24px 20px 22px; }
  .dd-pay-mark { width: 76px; height: 76px; }
  .dd-pay-mark b { font-size: 26px; }
  .dd-drop-art { width: 72px; height: 72px; }
  .dd-drop-actions .btn { flex: 1 1 auto; justify-content: center; }
  .dd-scanhead { grid-template-columns: 64px minmax(0, 1fr); gap: 16px; }
  .dd-scanhead .dc-sheet { width: 64px; }
  .dd-timer { grid-column: 2; margin-top: -6px; }
  .dd-title { grid-template-columns: minmax(0, 1fr) auto; gap: 14px; }
  .dd-title-main, .dd-side { display: contents; }
  .dd-title h1 { grid-column: 1; grid-row: 1; align-self: center; }
  .dd-facts, .dd-verdict { grid-column: 1 / -1; margin-top: 0; }
  .dd-side .dc-stamp { grid-column: 2; grid-row: 1; width: 78px; height: 78px; margin: 0; }
  .dd-side .dc-stamp b { font-size: 25px; }
  .dd-side .dc-stamp span { font-size: 10.5px; }
  .dd-actions { grid-column: 1 / -1; justify-content: stretch; }
  .dd-actions .btn { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 560px) {
  .dd-ph { padding-left: 16px; }
  .dd-pb { padding: 2px 16px 16px; }
  .dd-pb > .is-leaving { left: 16px; right: 16px; }
  .dd-scroll { margin: 0 -16px; padding: 0 16px 12px; }
  /* заголовок схемы и «открыть крупно» в строку, переключатель вида — строкой ниже на всю ширину */
  .dd-p-dia .dd-ph { flex-wrap: wrap; }
  .dd-p-dia .dd-ph-tools { display: contents; }
  .dd-p-dia .dd-status, .dd-p-dia [data-zoom] { margin-left: auto; }
  .dd-styles { order: 3; flex: 1 1 100%; }
  .dd-styles button { flex: 1; padding: 7px 4px; }
  .dd-scanhead h1, .dd-errhead h1 { font-size: 21px; }
  .dd-drop h1 { font-size: 24px; }
  .dd-verdict { font-size: 16.5px; }
  .dd-spec { grid-template-columns: minmax(7.5em, 42%) minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .dd-beam { animation: none; translate: 0 150%; }
  .dd-grid[data-state="scan"] .dd-sk { animation: none; }
  .dd-mini.is-run::after, .dd-status.is-on .dc-dot, .dd-step.is-on .dc-dot { animation-duration: 2.4s; }
}
