/* GruzDok · цвета продукта и оформление результата: матрица сверки, два агента, просчёт авто. */
:root {
  --brand: #4d5320; --brand-2: #6b7430; --brand-ink: #3a3e16; --brand-soft: #f1f2e4; --brand-line: #dcdfbf;
  --accent: #7fb7be; --accent-soft: #e6f2f3; --accent-ink: #2d6970;
  --a2: #2d6970;
}
/* режим проверки ?qa=1: без переходов, кадр совпадает с тем, что уже должно быть на экране */
.gd-qa .w-h, .gd-qa .w-d, .gd-qa .w-stamp, .gd-qa .w-result, .gd-qa .w-msg, .gd-qa .w-note, .gd-qa .w-st, .gd-qa .w-st i,
.gd-qa .gd-c, .gd-qa .gd-dh, .gd-qa .gd-f, .gd-qa .gd-hot, .gd-qa .why { transition: none !important; animation: none !important; }

.gd { display: flex; flex-direction: column; gap: 14px; }
.gd-head { display: flex; flex-direction: column; gap: 8px; }
.gd-no { font-size: 13px; color: var(--muted); font-weight: 500; }
.gd-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 31px; }
.gd-chip { display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-ink);
  font-size: 14px; font-weight: 600; border: 1px solid var(--brand-line); white-space: nowrap; }
.gd-chip.c2 { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 60%, transparent); }

/* ---------- матрица «поле × документ» ---------- */
/* колонка не уже своего самого длинного слова: «перестановка» влезает и на ноутбуке */
.gd-mx { display: grid; grid-template-columns: minmax(112px, 1.22fr) repeat(6, minmax(min-content, 1fr)) minmax(min-content, 1.1fr); border: 1px solid var(--brand-line);
  border-radius: 14px; background: #fff; }
/* углы скруглены у самих ячеек: значок второго агента может сесть на край таблицы */
.gd-hd > :first-child { border-top-left-radius: 13px; }
.gd-hd > :last-child { border-top-right-radius: 13px; overflow: hidden; }
.gd-row:last-child > :first-child { border-bottom-left-radius: 13px; }
.gd-row:last-child > :last-child { border-bottom-right-radius: 13px; }
.gd-row { display: contents; }
.gd-lab { display: flex; align-items: center; padding: 0 8px 0 12px; font-size: 14px; font-weight: 650; color: var(--ink); background: #fafbf6;
  border-top: 1px solid var(--line-2); line-height: 1.2; }
.gd-corner { border-top: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.gd-dh { position: relative; display: flex; align-items: center; justify-content: center; padding: 11px 3px 8px; text-align: center; font-size: 13px;
  font-weight: 700; color: var(--brand-ink); background: #fafbf6; border-left: 1px solid var(--line-2); transition: background .25s; line-height: 1.15; }
.gd-dh::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--fx, #8a917a); }
.gd-dh.pdf, .gd-fe.pdf { --fx: #c8463d; }
.gd-dh.xls, .gd-fe.xls { --fx: #1f8a4c; }
.gd-dh.xml, .gd-fe.xml { --fx: #55657f; }
.gd-dh.rd { background: var(--brand-soft); }
.gd-c { position: relative; display: flex; align-items: center; justify-content: center; min-height: 42px; padding: 5px 4px; text-align: center;
  border-top: 1px solid var(--line-2); border-left: 1px solid var(--line-2); transition: background .25s; }
.gd-c.rd { background: var(--brand-soft); }
.gd-c.a2rd { background: color-mix(in srgb, var(--accent) 22%, #fff); }
.gd-tint { position: absolute; inset: 3px; border-radius: 8px; }
.gd-c.t-ok .gd-tint { background: var(--good-soft); }
.gd-c.t-bad .gd-tint, .gd-c.t-warn .gd-tint { inset: 2px; }
.gd-c.t-bad .gd-tint { background: var(--bad-soft); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--bad) 70%, transparent); }
.gd-c.t-warn .gd-tint { background: var(--warn-soft); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--warn) 65%, transparent); }
.gd-in { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 0 3px; line-height: 1.15; min-width: 0; }
.gd-dn { display: none; }
.gd-c .v { font-size: 14px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gd-c .v.code { white-space: normal; max-width: 5.4em; font-size: 13.5px; line-height: 1.12; }
.gd-c .v u { text-decoration: none; border-radius: 3px; }
.gd-c.t-ok .gd-tint.in ~ .gd-in .v { color: var(--good-ink); }
.gd-c.t-bad .gd-tint.in ~ .gd-in .v { color: var(--bad-ink); font-weight: 800; }
.gd-c.t-warn .gd-tint.in ~ .gd-in .v { color: var(--warn-ink); font-weight: 800; }
.gd-c.t-bad .gd-tint.in ~ .gd-in .v u { background: color-mix(in srgb, var(--bad) 20%, transparent); box-shadow: inset 0 -2px 0 var(--bad); }
.gd-c .why { font-size: 13px; font-weight: 600; letter-spacing: -.025em; white-space: nowrap; color: var(--muted); }
.gd-c.t-bad .why { color: var(--bad-ink); }
.gd-c.t-warn .why { color: var(--warn-ink); }
.gd-c.t-ok .why { color: var(--good-ink); font-weight: 500; }
.gd-tint:not(.in) ~ .gd-in .why { display: none; }
.gd-c.t-no .gd-in::before { content: ""; display: block; width: 12px; height: 2px; border-radius: 1px; background: #d8dcd2; }
.gd-a2 { position: absolute; top: -4px; right: -4px; z-index: 1; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--a2); color: #fff; font-style: normal; font-size: 11px; font-weight: 800; line-height: 1; box-shadow: 0 0 0 2px #fff; }
.gd-a2.no { background: #c2620a; font-size: 13px; }
.gd-c .why .s { display: none; }
.gd-hot { z-index: 2; animation: gd-ring 1.4s ease-out 1; }
@keyframes gd-ring { 0% { box-shadow: 0 0 0 0 rgba(210, 60, 60, .55); } 70% { box-shadow: 0 0 0 12px rgba(210, 60, 60, 0); } 100% { box-shadow: 0 0 0 0 rgba(210, 60, 60, 0); } }

/* ---------- два агента и кто решает ---------- */
.gd-pair { display: flex; flex-direction: column; gap: 8px; }
.gd-pair-h { margin: 0; display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--accent-ink); }
.gd-pair-h::before { content: "2"; flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--a2);
  color: #fff; font-size: 11px; font-weight: 800; }
.gd-pair-b { display: grid; grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.gd-ag { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
  min-width: 0; box-shadow: inset 3px 0 0 var(--agc); --agc: var(--brand); }
.gd-ag.a2 { --agc: var(--a2); }
.gd-av { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--agc); color: #fff; font-size: 14px; font-weight: 800; }
.gd-ag > div { min-width: 0; }
.gd-ag small { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.gd-ag b { display: block; font-size: 15.5px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.gd-ag > div > span { display: block; min-height: 1.3em; font-size: 13px; line-height: 1.3; color: var(--ink-2); }
.gd-vs { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; font-weight: 800; line-height: 1; }
.gd-vs.ne { background: var(--warn-soft); color: #b45309; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--warn) 60%, transparent); }
.gd-vs.eq { background: var(--good-soft); color: var(--good-ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--good) 45%, transparent); }
.gd-stamp { --rot: -5deg; --sc: #15803d; display: flex; flex-direction: column; align-items: center; gap: 1px; margin: 0 6px 0 4px; padding: 7px 14px;
  border: 3px solid var(--sc); border-radius: 10px; color: var(--sc); background: rgba(255, 255, 255, .92); text-transform: uppercase;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--sc) 22%, transparent); }
.gd-stamp.w-stamp:not(.in) { transform: rotate(var(--rot)) scale(1.35); }
.gd-stamp.t-warn { --sc: #b45309; }
.gd-stamp.t-bad { --sc: #b42318; }
.gd-stamp b { font-size: 14.5px; font-weight: 850; letter-spacing: .06em; white-space: nowrap; }
.gd-stamp span { font-size: 12.5px; font-weight: 700; letter-spacing: .03em; white-space: nowrap; }

/* ---------- авто под заказ: лист машины и просчёт ---------- */
.gd-auto { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.gd-left { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.gd-left .gd-sheet { align-self: stretch; }
.gd-left .gd-stamp { margin: 2px 0 0; }
.gd-chk { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 7px 11px; border-radius: 10px; background: var(--accent-soft);
  font-size: 14px; color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.gd-chk b { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.gd-chk i { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-style: normal; font-weight: 700; color: var(--good-ink); white-space: nowrap; }
.gd-chk i svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.gd-av2 { flex: none; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--a2); color: #fff; font-size: 12px; font-weight: 800; }
.gd-sheet { border: 1px solid var(--brand-line); border-radius: 14px; padding: 10px 12px 4px; }
.gd-sheet-h { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--brand-ink); }
.gd-sheet-h > span:last-child { color: var(--muted); }
.gd-sheet-h .nw { white-space: nowrap; }
.gd-car, .gd-tl { display: block; width: 100%; height: auto; }
.gd-car { margin-top: 4px; }
.gd-tl { margin-top: 6px; }
.gd-car text, .gd-tl text { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.gd-bfill { fill: #f4f5ec; stroke: none; }
.gd-body { fill: none; stroke: #2b2f1e; stroke-width: 2.4; stroke-linejoin: round; }
.gd-glass { fill: #dfeced; stroke: #2b2f1e; stroke-width: 1.3; stroke-linejoin: round; }
.gd-thin { fill: none; stroke: #2b2f1e; stroke-width: 1.4; stroke-linecap: round; }
.gd-wh circle { fill: #2b2f1e; }
.gd-wh circle.hub { fill: #c9cdbd; }
.gd-gr { fill: none; stroke: #a3a892; stroke-width: 1.2; stroke-dasharray: 5 4; }
.gd-ld { fill: none; stroke: var(--brand); stroke-width: 1.3; }
.gd-dot { fill: var(--brand); }
.gd-lbl { font-size: 13px; font-weight: 650; fill: #25302c; paint-order: stroke; stroke: #fbfdfe; stroke-width: 4px; stroke-linejoin: round; }
.gd-lbl.r { fill: var(--bad-ink); }
.gd-lbl.b { fill: var(--brand-ink); }
.gd-band.good { fill: color-mix(in srgb, var(--good) 20%, #fff); }
.gd-band.bad { fill: color-mix(in srgb, var(--bad) 17%, #fff); }
.gd-bt { font-size: 12.5px; font-weight: 750; dominant-baseline: central; }
.gd-nar { display: none; }
.gd-bt.good { fill: var(--good-ink); }
.gd-bt.bad { fill: var(--bad-ink); }
.gd-tk { fill: none; stroke: #a3a892; stroke-width: 1.2; }
.gd-mn { font-size: 12.5px; font-weight: 500; fill: var(--muted); }
.gd-edge path { fill: none; stroke: var(--bad); stroke-width: 2; stroke-dasharray: 4 3; }
.gd-edge.gd-hot { animation: gd-blink 1.2s ease-out 1; }
@keyframes gd-blink { 0%, 50% { opacity: .25; } 25%, 75%, 100% { opacity: 1; } }
.gd-nw path { fill: var(--ink); }
.gd-cu path { fill: var(--brand); }
.gd-calc { display: flex; flex-direction: column; gap: 5px; }
.gd-calc-h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; padding: 2px 2px 3px; font-size: 11.5px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted); }
.gd-calc-h span { white-space: nowrap; }
/* строка просчёта: название и сумма сверху, формула во всю ширину под ними */
.gd-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 12px; padding: 5px 11px; border-radius: 10px;
  background: var(--page); }
.gd-line span { min-width: 0; font-size: 14.5px; font-weight: 600; line-height: 1.25; }
.gd-line small, .gd-line em { grid-column: 1 / -1; }
.gd-line small { font-size: 13px; color: var(--muted); line-height: 1.25; }
.gd-line em { font-style: normal; font-size: 13px; font-weight: 650; color: var(--warn-ink); line-height: 1.25; }
.gd-line b { white-space: nowrap; font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.25; }
.gd-line.x { background: var(--warn-soft); box-shadow: inset 3px 0 0 var(--warn); }
.gd-line.gd-hot { animation: gd-glow 1.4s ease-out 1; }
@keyframes gd-glow { 0% { box-shadow: inset 3px 0 0 var(--warn), 0 0 0 0 rgba(212, 136, 6, .5); } 70% { box-shadow: inset 3px 0 0 var(--warn), 0 0 0 10px rgba(212, 136, 6, 0); } 100% { box-shadow: inset 3px 0 0 var(--warn); } }
.gd-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 2px; padding: 8px 2px 0; border-top: 2px solid var(--ink); }
.gd-total > span { font-size: 15px; font-weight: 650; }
.gd-sum { font-size: 30px; line-height: 1; letter-spacing: -.02em; color: var(--brand); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gd-sum i { font-style: normal; }

/* ---------- переписка: письмо с вложениями, черновик ответа, карточка просчёта ---------- */
.gd-mail { display: flex; flex-direction: column; gap: 3px; }
.gd-mail-s { font-size: 14.5px; }
.gd-mail-t { font-size: 14.5px; line-height: 1.4; }
.gd-att { display: flex; flex-direction: column; gap: 3px; margin-top: 7px; padding-top: 8px; border-top: 1px solid var(--line-2); }
.gd-f { display: flex; align-items: center; gap: 8px; padding: 2px 5px 2px 2px; border-radius: 7px; font-size: 13px; transition: background .25s; }
.gd-f.rd { background: var(--brand-soft); }
.gd-fe { flex: none; width: 30px; padding: 2px 0; border-radius: 4px; background: var(--fx); color: #fff; font-style: normal; font-size: 10px; font-weight: 800;
  text-align: center; letter-spacing: .02em; }
.gd-f .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.gd-f .ty { display: none; flex: none; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 650; color: var(--good-ink); white-space: nowrap; }
.gd-f.ok .ty { display: inline-flex; }
.gd-f .ty svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.gd-dr { display: flex; flex-direction: column; gap: 3px; font-size: 14px; line-height: 1.4; }
.gd-dr-h { font-size: 11.5px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--warn-ink); }
.gd-dr-to { font-size: 12.5px; color: var(--muted); }
.gd-dr p { margin: 4px 0 0; }
.gd-dr ol { margin: 2px 0 0; padding-left: 19px; display: flex; flex-direction: column; gap: 3px; }
.gd-cc { min-width: 220px; }
.gd-cc-h { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.gd-cc-sum { margin: 3px 0 2px; font-size: 25px; font-weight: 800; letter-spacing: -.02em; color: var(--brand); }
.gd-cc-s { font-size: 13px; color: var(--ink-2); }

/* превью ссылки 1200×630: зелёная плашка не помещается целиком, её нет */
.w-og .w-result { display: none; }

/* ноутбук 1280–1366: всё плотнее, чтобы итог и плашка были на экране без прокрутки */
@container (max-width: 860px) {
  .gd { gap: 7px; }
  .gd-head { gap: 5px; }
  .gd-dh { font-size: 12.5px; padding: 7px 3px 4px; }
  .gd-lab { font-size: 13.5px; padding-left: 10px; }
  .gd-c { min-height: 34px; padding: 2px 3px; }
  .gd-in { gap: 0; padding: 0 4px 0 5px; line-height: 1.08; }
  /* строки низкие: у замечаний вместо рамки полоска слева, текст не упирается в край */
  .gd-c.t-bad .gd-tint, .gd-c.t-warn .gd-tint { inset: 1px; border-radius: 6px; }
  .gd-c.t-bad .gd-tint { box-shadow: inset 3px 0 0 var(--bad); }
  .gd-c.t-warn .gd-tint { box-shadow: inset 3px 0 0 var(--warn); }
  .gd-a2 { top: -5px; right: -8px; }
  .gd-pair { gap: 5px; }
  .gd-ag { padding: 6px 12px 6px 10px; }
  .gd-ag small { line-height: 1.1; }
  .gd-ag b { line-height: 1.15; }
  .gd-ag > div > span { line-height: 1.25; }
  .gd-auto { gap: 14px; }
  .gd-calc { gap: 4px; }
  .gd-line { padding: 4px 10px; }
  .gd-total { padding-top: 6px; }
  .gd-sum { font-size: 28px; }
  .gd-chk { padding: 6px 10px; }
}
/* самая узкая матрица (окно 1221–1270): длинное слово причины не влезает, вместо него «12 ↔ 21» */
@container (max-width: 750px) {
  .gd-mx { grid-template-columns: minmax(92px, 1.22fr) repeat(6, minmax(min-content, 1fr)) minmax(min-content, 1.1fr); }
  .gd-c .why .l { display: none; }
  .gd-c .why .s { display: inline; }
}

/* ---------- узкая ширина: строки матрицы карточками, колонки друг под другом ---------- */
@container (max-width: 700px) {
  .gd-mx { display: flex; flex-direction: column; }
  .gd-row.gd-hd { display: none; }
  .gd-c .v.code { max-width: none; }
  .gd-c .why .l { display: inline; }
  .gd-c .why .s { display: none; }
  .gd-row { display: flex; flex-wrap: wrap; gap: 5px; padding: 9px 10px 10px; border-top: 1px solid var(--line-2); }
  .gd-row:nth-child(2) { border-top: 0; }
  .gd-lab { width: 100%; padding: 0 0 2px; background: none; border: 0; }
  .gd-c { min-height: 0; padding: 5px 9px; border: 0; border-radius: 8px; }
  .gd-c.t-no { display: none; }
  .gd-tint { inset: 0; }
  .gd-in { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
  .gd-dn { display: inline; font-style: normal; font-size: 12.5px; color: var(--muted); }
  .gd-c { gap: 6px; }
  .gd-a2 { position: relative; top: auto; right: auto; flex: none; box-shadow: none; }
  .gd-pair-b { grid-template-columns: minmax(0, 1fr); }
  .gd-vs { display: none; }
  .gd-stamp { justify-self: center; margin: 4px 0 2px; }
  .gd-ag b { white-space: normal; }
  .gd-auto { grid-template-columns: minmax(0, 1fr); }
  .gd-sum { font-size: 26px; }
  /* подписи рисунка машины и шкалы: на телефоне крупнее, короткие варианты */
  .gd-lbl, .gd-bt, .gd-mn { font-size: 17px; }
  .gd-lbl { stroke-width: 5px; }
  .gd-wide { display: none; }
  .gd-nar { display: inline; }
}
