/* Істейміз — бесплатные инструменты (/instrumenty/). Поверх /styles.css и /landing.css.
   Токены те же; новых цветов нет. Листы, строки на линиях, синий — только точки и то, что нажимается.
   iOS 15: без color-mix(), :has(), container queries и dvh. */

.tool { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) clamp(72px, 10vw, 128px); }
.tool__tabs { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--paper-2); margin-bottom: 20px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tool__tabs::-webkit-scrollbar { display: none; }
.tool__tabs button {
  border: 0; background: none; cursor: pointer; white-space: nowrap;
  font: 600 15px/1 var(--sans); min-height: 44px; padding: 0 20px; border-radius: 999px; color: var(--stone);
  transition: background-color .2s, color .2s, box-shadow .2s; -webkit-tap-highlight-color: transparent;
}
.tool__tabs button:hover { color: var(--ink); }
.tool__tabs button[aria-selected="true"] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 2px rgba(21,20,15,.12); }

.calc { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(16px, 2.4vw, 28px); align-items: start; }
@media (max-width: 960px) { .calc { grid-template-columns: minmax(0, 1fr); } }
.sheet { background: var(--sheet); border-radius: 24px; box-shadow: var(--shadow-sheet); padding: clamp(20px, 2.6vw, 32px); }
@media (max-width: 600px) { .sheet { border-radius: 20px; padding: 18px; } }

/* ——— поля ——— */
.form { display: grid; gap: 26px; }
.fld { display: grid; gap: 10px; min-width: 0; border: 0; padding: 0; margin: 0; }
.fld__l { font-size: 14px; font-weight: 500; color: var(--stone); padding: 0; }
.fld__h { font-size: 13px; line-height: 1.45; color: var(--stone); }
.fld .chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; -webkit-mask-image: none; mask-image: none; }
.fld .chip { min-height: 42px; padding: 0 16px; font-size: 15px; }
.fld .chip[aria-disabled="true"] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.money { position: relative; }
.money .input { padding-right: 44px; }
.money__u { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 17px; color: var(--stone); pointer-events: none; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 420px) { .two { grid-template-columns: minmax(0, 1fr); } }
.two.two--keep { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

.step { display: inline-flex; align-items: center; gap: 6px; padding: 4px; border-radius: 999px; background: var(--paper-2); justify-self: start; }
.step button {
  width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer; background: var(--sheet);
  font: 500 22px/1 var(--sans); color: var(--ink); box-shadow: 0 1px 2px rgba(21,20,15,.12);
  transition: background-color .2s, color .2s, transform .15s var(--ease-out); -webkit-tap-highlight-color: transparent;
}
.step button:hover { background: var(--ink); color: var(--paper); }
.step button:active { transform: scale(.94); }
.step output { min-width: 48px; text-align: center; font: 600 19px/1 var(--sans); font-variant-numeric: tabular-nums; }

.more { border-top: 1px solid var(--line); padding-top: 4px; }
.more summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; font-size: 15px; font-weight: 600;
}
.more summary::-webkit-details-marker { display: none; }
.more summary i { position: relative; width: 30px; height: 30px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line); }
.more summary i::before, .more summary i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 1.6px; margin: -.8px 0 0 -5px; background: var(--ink); border-radius: 2px; transition: transform .35s var(--ease-out); }
.more summary i::after { transform: rotate(90deg); }
.more[open] summary i::after { transform: rotate(0deg); }
.more__in { display: grid; gap: 14px; padding-bottom: 6px; }

.tick { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; cursor: pointer; font-size: 15px; line-height: 1.45; }
.tick input { position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; cursor: pointer; }
.tick__box { width: 24px; height: 24px; border-radius: 7px; box-shadow: inset 0 0 0 1.5px #C9C3B4; background: var(--sheet); display: grid; place-items: center; transition: background-color .2s, box-shadow .2s; }
.tick__box svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 2.4; fill: none; opacity: 0; transition: opacity .15s; }
.tick input:checked + .tick__box { background: var(--blue); box-shadow: none; }
.tick input:checked + .tick__box svg { opacity: 1; }
.tick input:focus-visible + .tick__box { outline: 2px solid var(--blue); outline-offset: 3px; }
.tick input:disabled + .tick__box, .tick input:disabled ~ span { opacity: .45; }
.tick small { display: block; color: var(--stone); font-size: 13px; }

/* ——— результат ——— */
.res { display: grid; gap: 22px; align-content: start; }

.res__k { font-size: 14px; font-weight: 500; color: var(--stone); }
.res__big { font-weight: 300; font-size: clamp(52px, 7vw, 88px); line-height: .96; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.res__big small { font-size: .42em; letter-spacing: -0.01em; margin-left: .12em; }
.res__per { font-size: 15px; color: var(--stone); margin-top: 6px; }
.res__say { font-family: var(--voice); font-style: italic; font-size: clamp(19px, 1.8vw, 23px); line-height: 1.3; max-width: 36ch; }
.delta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1.5px solid var(--ink); }
.delta > div { padding: 14px 14px 14px 0; display: grid; gap: 4px; align-content: start; }
.delta > div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.delta dt { font-size: 13px; color: var(--stone); line-height: 1.3; }
.delta dd { font-size: clamp(18px, 1.7vw, 22px); font-weight: 600; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta .is-up { color: var(--ink); }
@media (max-width: 520px) {
  .delta { grid-template-columns: minmax(0, 1fr); }
  .delta > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .delta > div + div { padding-left: 0; border-left: 0; }
}

.yr { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--paper-2); }
.yr button { border: 0; background: none; cursor: pointer; font: 600 14px/1 var(--sans); min-height: 36px; min-width: 64px; padding: 0 12px; border-radius: 999px; color: var(--stone); font-variant-numeric: tabular-nums; transition: background-color .2s, color .2s; }
.yr button[aria-pressed="true"] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 2px rgba(21,20,15,.12); }
.res__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.res__h { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }

.ledger { border-top: 1.5px solid var(--ink); }
.ledger__g { padding: 14px 0 4px; font-size: 13px; font-weight: 500; color: var(--stone); }
.ledger__r { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 20px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.ledger__r b { font-weight: 500; }
.ledger__r span { color: var(--stone); font-size: 13px; display: block; }
.ledger__v { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; font-weight: 500; }
.ledger__r--sum { border-bottom: 0; border-top: 1.5px solid var(--ink); padding-top: 14px; font-size: 17px; }
.ledger__r--sum b, .ledger__r--sum .ledger__v { font-weight: 700; }
.ledger__r--sub { font-weight: 600; }
.ledger__r--sub .ledger__v { font-weight: 600; }

.acts { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 520px) { .acts .btn { flex: 1 1 100%; } }

.bridge { display: grid; gap: 14px; padding: 20px 22px; border-radius: 20px; background: var(--paper-2); }
.bridge p { font-family: var(--voice); font-style: italic; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.3; max-width: 40ch; }
.bridge .btn { justify-self: start; }
@media (max-width: 520px) { .bridge .btn { justify-self: stretch; } }

.warns { display: grid; gap: 8px; }
.warn { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; font-size: 14px; line-height: 1.45; padding: 12px 14px; border-radius: 14px; background: var(--paper-2); }
.warn::before { content: "!"; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 700; }
.disc { font-size: 13px; line-height: 1.45; color: var(--stone); }
.disc a { color: inherit; text-underline-offset: 3px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60;
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 500;
  transition: opacity .25s, transform .35s var(--ease-out); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ——— таблица ставок ——— */
.rt { border-top: 1.5px solid var(--ink); font-size: 15px; }
.rt__r { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 3fr); gap: 6px 20px; padding: 13px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.rt__r--h { font-size: 13px; font-weight: 500; color: var(--stone); padding: 10px 0; }
.rt__v { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rt__v em { display: block; font-style: normal; font-size: 12px; color: var(--stone); white-space: normal; }
.rt__s { font-size: 13px; line-height: 1.45; color: var(--stone); }
.rt__s a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
@media (max-width: 760px) {
  .rt__r { grid-template-columns: minmax(0, 1fr) auto auto; }
  .rt__r--h .rt__s { display: none; }
  .rt__s { grid-column: 1 / -1; }
}

/* ——— ипотека: программы ——— */
.mo { border-top: 1.5px solid var(--ink); }
.mo__g { padding: 16px 0 2px; font-size: 13px; font-weight: 500; color: var(--stone); }
.mo__r { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mo__n { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.mo__r.is-best .mo__n::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--blue); vertical-align: 2px; }
.mo__s { font-size: 13px; line-height: 1.45; color: var(--stone); margin-top: 2px; }
.mo__s b { color: var(--ink); font-weight: 600; }
.mo__v { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.mo__o { font-size: 13px; color: var(--stone); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; margin-top: 2px; }
.mo__x { border-top: 0; margin-top: 4px; }
.mo__x .more__in { gap: 8px; }
@media (max-width: 420px) {
  .mo__r { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .mo__v, .mo__o { text-align: left; }
}

.pgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: clamp(14px, 2vw, 20px); }
.pg { display: grid; gap: 10px; align-content: start; }
.pg__b { font-size: 13px; font-weight: 500; color: var(--stone); }
.pg__n { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }
.pg__d { border-top: 1.5px solid var(--ink); }
.pg__d > div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.4; }
.pg__d dt { color: var(--stone); }
.pg__c { font-size: 14px; line-height: 1.5; color: var(--stone); }
.pg__a { font-size: 13px; color: var(--stone); }
.pg__a a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }

.rt__r > span:first-child em { display: block; font-style: normal; font-size: 12px; color: var(--stone); }
.rt--mo .rt__r { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1.3fr) minmax(0, .9fr) minmax(0, 2fr); gap: 6px 16px; }
.rt--closed .rt__r { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) auto; }
@media (max-width: 760px) {
  .rt--mo .rt__r { grid-template-columns: minmax(0, 1fr) auto auto; }
  .rt--mo .rt__r > span:nth-child(4) { display: none; }
  .rt--closed .rt__r { grid-template-columns: minmax(0, 1fr) auto; }
  .rt--closed .rt__r > span:nth-child(2) { grid-column: 1 / -1; order: 3; }
  .rt--closed .rt__r > span:nth-child(3) { grid-column: auto; }
}

/* ——— эквайринг и банки: длинные ставки переносятся, на телефоне — «что | ставка», остальное ниже ——— */
.rt--acq .rt__r { grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 2.6fr); }
.rt--rko .rt__r { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 1.8fr) minmax(0, 2.4fr); }
.rt--acq .rt__v, .rt--rko .rt__v { white-space: normal; }
@media (max-width: 760px) {
  .rt--acq .rt__r, .rt--rko .rt__r { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rt--acq .rt__r > span:nth-child(3), .rt--rko .rt__r > span:nth-child(3) { grid-column: 1 / -1; }
  .rt--acq .rt__r--h > span:nth-child(3), .rt--rko .rt__r--h > span:nth-child(3) { display: none; }
}

/* ——— доход таксиста: куда уходят деньги ———
   одна полоса — доли выручки; «на руки» тёмным, расходы — оттенками камня; подписи — в легенде */
.split { display: grid; gap: 12px; }
.split__bar { display: flex; gap: 2px; height: 20px; }
.split__bar .split__s { flex: 1 1 0; min-width: 3px; }
.split__bar .split__s:first-child { border-radius: 4px 0 0 4px; }
.split__bar .split__s:last-child { border-radius: 0 4px 4px 0; }
.split__bar .split__s:only-child { border-radius: 4px; }
.split__leg { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 6px 18px; font-size: 13px; color: var(--stone); }
.split__leg li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.split__leg i { width: 10px; height: 10px; border-radius: 3px; }
.split__leg b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.split__s--0 { background: var(--ink); }
.split__s--1 { background: var(--stone); }
.split__s--2 { background: rgba(100, 96, 86, .68); }
.split__s--3 { background: rgba(100, 96, 86, .46); }
.split__s--4 { background: rgba(100, 96, 86, .3); }
.split__s--5 { background: rgba(100, 96, 86, .18); }

/* ——— список инструментов ——— */
.tools-list { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) clamp(72px, 10vw, 128px); }

@media (prefers-reduced-motion: reduce) {
  .toast, .tick__box, .more summary i::after { transition: none; }
}

/* первый экран инструмента короче: калькулятор должен быть виден сразу */
.lp-hero--tool { padding-bottom: clamp(28px, 3.4vw, 44px); }
.lp-hero--tool .crumbs { margin-bottom: clamp(20px, 3vw, 40px); }
.lp-hero--tool .lp-hero__h1 { margin-bottom: clamp(18px, 2.4vw, 28px); }
.lp-hero--tool .lp-hero__grid { gap: 12px; }

/* список калькуляторов: четыре карточки — две в ряд, без одинокой в последнем ряду */
@media (min-width: 761px) { .tools-list .pgs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
