/* Калькулятор экосбора: общий блок для главной и SEO-страницы.
   Все классы с префиксом rc-, чтобы блок не цеплялся за стили страницы. */

.rc {
  --rc-ink: #23282C;
  --rc-muted: #545A5F;
  --rc-line: #E3EAE5;
  --rc-green: #2F8F4E;
  --rc-green-d: #1F6B38;
  --rc-tint: #EAF3EC;
  --rc-white: #fff;
  --rc-r: 16px;

  border: 1px solid var(--rc-line);
  border-radius: var(--rc-r);
  background: var(--rc-white);
  color: var(--rc-ink);
  overflow: hidden;
}

.rc *, .rc *::before, .rc *::after { box-sizing: border-box; }

.rc-body { display: grid; grid-template-columns: minmax(0, 1.32fr) minmax(0, .68fr); }

/* ---------- левая половина: ввод ---------- */

.rc-in { padding: 26px 28px 24px; }
.rc-hint { margin-top: 6px; color: var(--rc-muted); font-size: 12px; line-height: 1.4; }
.rc-hint b { color: var(--rc-ink); font-weight: 700; }

.rc label {
  display: block;
  margin: 0 0 6px;
  color: var(--rc-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.rc select, .rc input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #CBD8D0;
  border-radius: 10px;
  background: var(--rc-white);
  color: var(--rc-ink);
  font: inherit;
  font-size: 15px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.rc select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23545A5F' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}

.rc select:focus, .rc input:focus {
  border-color: var(--rc-green);
  box-shadow: 0 0 0 3px rgba(47, 143, 78, .14);
}

.rc-mass { display: flex; gap: 8px; }
.rc-mass input { flex: 1; min-width: 0; }
.rc-mass select { flex: 0 0 74px; width: 74px; }

/* ---------- строка добавления ---------- */

.rc-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 156px auto;
  gap: 12px;
  align-items: end;
}
.rc-add-error {
  grid-column: 1 / -1;
  margin: 0;
  color: #A6541B;
  font-size: 13px;
}
.rc-add-btn {
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  background: var(--rc-green);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.rc-add-btn:hover { background: var(--rc-green-d); }

/* ---------- поиск по группам ---------- */

.rc-cb { position: relative; }
.rc-cb-input { padding-right: 36px !important; }
.rc-cb-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 36px;
  height: 100%;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
}
.rc-cb-toggle::after {
  content: "";
  display: block;
  width: 11px;
  height: 7px;
  margin: 0 auto;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23545A5F' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center/contain;
}
.rc-cb.is-open .rc-cb-toggle::after { transform: rotate(180deg); }

.rc-cb-list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  min-width: 430px;
  max-height: 300px;
  margin: 0;
  padding: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  background: var(--rc-white);
  border: 1px solid var(--rc-line);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(15, 38, 28, .14);
}
.rc-cb-list[hidden] { display: none; }
.rc-cb-group {
  padding: 9px 10px 5px;
  color: var(--rc-muted);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.rc-cb-option {
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}
.rc-cb-option:hover, .rc-cb-option.is-cursor { background: var(--rc-tint); }
.rc-cb-id {
  display: inline-block;
  min-width: 24px;
  color: var(--rc-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.rc-cb-empty { padding: 14px 10px; color: var(--rc-muted); font-size: 13px; }

/* ---------- список позиций ---------- */

.rc-rows:empty { display: none; }
.rc-rows { margin-top: 18px; }
.rc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px 96px auto 28px;
  gap: 10px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--rc-line);
}
.rc-row-main { min-width: 0; }
.rc-row-main > b { display: block; font-size: 14.5px; font-weight: 650; line-height: 1.35; }
.rc-row-meta { display: block; margin-top: 3px; color: var(--rc-muted); font-size: 12px; }
.rc-row-meta b { color: var(--rc-ink); font-weight: 650; }
.rc-row-num > span {
  display: block;
  margin-bottom: 5px;
  color: var(--rc-muted);
  font-size: 11.5px;
  font-weight: 600;
}
.rc-row-num input { padding: 9px 10px; font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; }
.rc-row-num input.is-auto { background: var(--rc-tint); border-color: #CFE2D6; }
.rc-row-sum { text-align: right; white-space: nowrap; }
.rc-row-sum > span { display: block; color: var(--rc-muted); font-size: 11.5px; font-weight: 600; }
.rc-row-sum > b { font-size: 15.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.rc-row-del {
  width: 30px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #99A49D;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}
.rc-row-del:hover { background: #FDECE8; color: #B4442F; }

.rc-empty-note { margin: 16px 0 0; color: var(--rc-muted); font-size: 13.5px; line-height: 1.55; }
.rc-empty-note[hidden] { display: none; }

.rc-more { margin-top: 16px; }
.rc-more > summary {
  color: var(--rc-green-d);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.rc-more > summary::-webkit-details-marker { display: none; }
.rc-more > summary::before { content: "▸ "; display: inline-block; width: 14px; }
.rc-more[open] > summary::before { content: "▾ "; }
.rc-more-in { max-width: 520px; margin-top: 12px; }
.rc-more-in .rc-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rc-more-in > .rc-hint { margin-top: 10px; }

/* быстрые сценарии вместо отдельных карточек с примерами */
.rc-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.rc-preset {
  padding: 7px 12px;
  border: 1px solid var(--rc-line);
  border-radius: 999px;
  background: var(--rc-tint);
  color: var(--rc-green-d);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.rc-preset:hover { border-color: var(--rc-green); background: #DFEDE3; }

/* ---------- правая половина: результат ---------- */

.rc-out {
  display: flex;
  flex-direction: column;
  padding: 26px 28px 24px;
  background: var(--rc-tint);
  border-left: 1px solid var(--rc-line);
}

.rc-year-row { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; }
.rc-year-row label { margin: 0; }
.rc-year-row select { width: auto; min-width: 92px; padding: 8px 30px 8px 11px; font-size: 14px; font-weight: 700; }
.rc-out-label { color: var(--rc-muted); font-size: 13px; font-weight: 500; }
.rc-total {
  margin: 6px 0 0;
  font-size: clamp(28px, 3.1vw, 37px);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.rc-year { margin: 4px 0 0; color: var(--rc-muted); font-size: 13px; }

.rc-formula {
  margin: 16px 0 0;
  padding: 13px 14px;
  border-radius: 11px;
  background: var(--rc-white);
  border: 1px solid var(--rc-line);
  font-size: 13px;
  line-height: 1.5;
  color: var(--rc-muted);
}
.rc-formula b { color: var(--rc-ink); font-weight: 750; }
.rc-formula .rc-warn { display: block; margin-top: 7px; color: #A6541B; }

.rc-cta {
  display: inline-block;
  align-self: start;
  margin-top: 20px;
  padding: 12px 20px;
  border: 0;
  border-radius: 10px;
  background: var(--rc-green);
  color: #fff;
  font: inherit;
  font-size: 14.5px;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.rc-cta:hover { background: var(--rc-green-d); }
.rc-note { margin: 10px 0 16px; color: var(--rc-muted); font-size: 12px; line-height: 1.45; }

.rc-how { margin-top: auto; padding-top: 16px; border-top: 1px solid #D9E7DE; }
.rc-how > summary {
  color: var(--rc-green-d);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.rc-how > summary::-webkit-details-marker { display: none; }
.rc-how > summary::before { content: "▸ "; display: inline-block; width: 14px; }
.rc-how[open] > summary::before { content: "▾ "; }
.rc-how-in { margin-top: 10px; font-size: 12.5px; line-height: 1.55; color: var(--rc-muted); }
.rc-how-row { display: block; padding: 6px 0; border-bottom: 1px solid #DDEAE1; }
.rc-how-row b { display: block; color: var(--rc-ink); font-weight: 600; }
.rc-how-note { display: block; margin-top: 9px; }

.rc-presets-label { align-self: center; margin-right: 2px; color: var(--rc-muted); font-size: 13px; }

.rc-about p { margin: 0 0 10px; font-size: 13px; line-height: 1.6; color: var(--rc-muted); }
.rc-about p:last-child { margin-bottom: 0; }
.rc-about b { color: var(--rc-ink); font-weight: 650; }
.rc-about a { color: var(--rc-green-d); }

/* ---------- окно со ставками ---------- */

.rc-rates { border-top: 1px solid var(--rc-line); }
.rc-rates > summary {
  padding: 15px 28px;
  color: var(--rc-green-d);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.rc-rates > summary::-webkit-details-marker { display: none; }
.rc-rates > summary::before { content: "▸ "; display: inline-block; width: 15px; }
.rc-rates[open] > summary::before { content: "▾ "; }
.rc-rates > summary:hover { background: #F7FAF8; }

.rc-rates-in { padding: 0 28px 22px; }
.rc-search { max-width: 320px; margin-bottom: 12px; }

.rc-scroll {
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--rc-line);
  border-radius: 11px;
  background: var(--rc-white);
  overscroll-behavior: contain;
}

.rc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rc-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 12px;
  background: #F4F7F5;
  border-bottom: 1px solid var(--rc-line);
  color: var(--rc-muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}
.rc-table thead th:first-child { text-align: left; }
.rc-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #EFF3F0;
  text-align: right;
  vertical-align: top;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rc-table td:first-child {
  text-align: left;
  white-space: normal;
  min-width: 210px;
  color: var(--rc-ink);
}
.rc-table tbody tr:hover { background: #F7FAF8; }
.rc-table tbody tr.is-active { background: var(--rc-tint); }
.rc-table tbody tr.is-active td:first-child { font-weight: 750; }
.rc-gid { color: var(--rc-muted); font-weight: 700; }
.rc-rate { font-weight: 600; }
.rc-k { display: block; margin-top: 2px; color: var(--rc-muted); font-size: 11.5px; font-weight: 500; }
.rc-empty { padding: 18px 12px; color: var(--rc-muted); font-size: 13px; text-align: center; }
.rc-src { margin: 11px 0 0; color: var(--rc-muted); font-size: 12px; line-height: 1.5; }
.rc-src a { color: var(--rc-green-d); }

.rc-fail { padding: 22px 28px; color: #A6541B; font-size: 14px; }

@media (max-width: 860px) {
  .rc-body { grid-template-columns: 1fr; }
  .rc-out { border-left: 0; border-top: 1px solid var(--rc-line); }
  .rc-in, .rc-out { padding: 22px 18px; }
  .rc-rates > summary, .rc-rates-in { padding-left: 18px; padding-right: 18px; }
  .rc-add { grid-template-columns: 1fr; }
  .rc-add-btn { width: 100%; }
  .rc-row { grid-template-columns: 1fr 1fr; row-gap: 12px; }
  .rc-cb-list { min-width: 0; }
  .rc-row-main { grid-column: 1 / -1; }
  .rc-row-sum { grid-column: 1; text-align: left; align-self: center; }
  .rc-row-del { grid-column: 2; justify-self: end; align-self: center; }
  .rc-scroll { max-height: 300px; }
  .rc-table td:first-child { min-width: 150px; }
}
