/* Zaezzd — растаможка: калькулятор (T5) и страница результата (T5a).
   Только то, чего нет в main.css. Всё остальное — готовые компоненты. */

/* ── Раскладка калькулятора ────────────────────────────────────────
   До 1200 — одна колонка: форма, результат, график, реклама.
   От 1200 — форма слева, результат sticky справа (десктоп-макет 560+560). */
.cust { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.cust > * { min-width: 0; }
.cust__form { display: flex; flex-direction: column; gap: 18px; }
.cust__note { font-size: 11.5px; line-height: 1.5; color: var(--ink-4); }
.cust__stick, .cc-stack { display: flex; flex-direction: column; gap: 14px; }

@media (min-width: 1200px) {
  .cust {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px 32px;
    grid-template-areas:
      "form res"
      "chart ad"
      "chart note";
  }
  .cust__form  { grid-area: form;  align-self: start; }
  .cust__res   { grid-area: res; }
  .cust__chart { grid-area: chart; align-self: start; }
  .cust__ad    { grid-area: ad;    align-self: start; }
  .cust__note  { grid-area: note;  align-self: start; }
  .cust__stick { position: sticky; top: 96px; gap: 16px; }
}

/* ── Поля формы ────────────────────────────────────────────────── */
.cc-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.cc-opts--3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cc-opts--2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cc-opts .chip { justify-content: center; text-align: center; }
.cc-opts--3 .chip, .cc-opts--2 .chip { border-radius: var(--r-ctl); padding: 0 8px; }

.cc-more { border-top: 1px dashed #D7D6D1; padding-top: 12px; }
.cc-more > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 44px; cursor: pointer; list-style: none;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-4);
}
.cc-more > summary::-webkit-details-marker { display: none; }
.cc-more > summary::after { content: '+'; font-size: 18px; color: var(--ink-3); }
.cc-more[open] > summary::after { content: '−'; }
.cc-more__body { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }

/* ── Карточка результата ───────────────────────────────────────── */
.cc-card { display: flex; flex-direction: column; }
.cc-total {
  font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; margin: 6px 0 14px;
}
@media (min-width: 768px) { .cc-total { font-size: 52px; letter-spacing: -.035em; margin-bottom: 18px; } }

.cc-rows { display: flex; flex-direction: column; }
.cc-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-top: 1px solid var(--line-soft);
}
.cc-row__t { display: block; min-width: 0; }
.cc-row__name { display: block; font-size: 13.5px; font-weight: 500; line-height: 1.3; }
.cc-row__src { display: block; font-size: 11.5px; color: var(--ink-4); line-height: 1.35; margin-top: 2px; }
.cc-row__v { flex: 0 0 auto; font-size: 14.5px; font-weight: 700; white-space: nowrap; }
@media (min-width: 768px) {
  .cc-row { padding: 13px 0; }
  .cc-row__name { font-size: 15px; }
  .cc-row__src { font-size: 12.5px; }
  .cc-row__v { font-size: 17px; }
}

.cc-key {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0 0; margin-top: 2px; border-top: 2px solid var(--ink);
}
.cc-key__t { font-size: 13.5px; font-weight: 600; }
.cc-key__v { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (min-width: 768px) {
  .cc-key__t { font-size: 15px; }
  .cc-key__v { font-size: 22px; }
}

.cc-actions { display: flex; gap: 8px; margin-top: 16px; }
.cc-actions > * { flex: 1 1 0; min-width: 0; }

/* ── График по возрасту: чистый CSS, без библиотек ─────────────── */
.cc-chart { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.cc-chart__col { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.cc-chart__stack {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 6px; width: 100%; height: 120px;
}
.cc-chart__v { font-size: 11px; font-weight: 700; color: var(--ink-3); }
.cc-chart__bar { width: 100%; min-height: 6px; background: #D7D6D1; border-radius: 4px 4px 0 0; }
.cc-chart__lab { font-size: 10.5px; line-height: 1.25; color: var(--ink-3); text-align: center; }
.cc-chart__col.is-on .cc-chart__bar { background: var(--acc); }
.cc-chart__col.is-on .cc-chart__v { color: var(--ink); }
.cc-chart__col.is-on .cc-chart__lab { color: var(--ink); font-weight: 600; }

/* ── Липкий итог на мобильном ──────────────────────────────────────
   Смещаем над таб-баром: у .sticky-sum в main.css bottom:0 и полоса
   уезжает под фиксированный таб-бар (sharedRequests). */
.cust__sum { bottom: calc(var(--tabbar-h) + 8px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 768px) { .cust__sum { bottom: 8px; } }

/* ── T5a: шапка результата ─────────────────────────────────────── */
.cc-hero { border-radius: var(--r-res); padding: 18px 16px 20px; }
.cc-hero__brand { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 15px; font-weight: 700; }
.cc-hero__brand i { font-style: normal; color: var(--yellow); }
.cc-hero__params { font-size: 15px; line-height: 1.4; color: #C6CAD1; margin: 7px 0 10px; }
.cc-hero__sum {
  font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: -.035em;
  font-variant-numeric: tabular-nums; margin-bottom: 6px;
}
.cc-hero__sub { font-size: 14px; color: #8A8F99; line-height: 1.4; }
@media (min-width: 768px) {
  .cc-hero { padding: 32px; }
  .cc-hero__sum { font-size: 64px; }
}

.cc-sum-card { padding: 4px 14px; }
.cc-sum-card .cc-row:first-child { border-top: 0; }
.cc-sum-card .cc-row { border-top: 0; border-bottom: 1px solid var(--line-soft); }
.cc-sum-card .cc-row:last-of-type { border-bottom: 0; }
.cc-sum-total {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 0; border-top: 1px solid var(--line-soft);
}
.cc-sum-total b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Превью OG-картинки 1200×630 — объясняет, что видно в ленте соцсети */
.cc-og { background: var(--bg); border: 1px dashed var(--ad-line); border-radius: var(--r-card); padding: 13px; }
.cc-og__frame { background: var(--ink); border-radius: 8px; padding: 14px; color: #fff; margin-top: 8px; }
.cc-og__sum { font-size: 26px; font-weight: 700; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.cc-og__p { font-size: 11px; color: #8A8F99; }
.cc-og__note { font-size: 11.5px; color: var(--ink-4); line-height: 1.4; margin-top: 8px; }

/* ── Мелочи ────────────────────────────────────────────────────── */
.cc-links { display: flex; flex-direction: column; gap: 7px; }
.cc-facts { display: flex; flex-direction: column; gap: 10px; }
.cc-facts li { line-height: 1.5; }
[hidden] { display: none !important; }

@media print {
  .cc-actions, .cc-chart, .cc-more { display: none !important; }
}
