/* Аяулы Жүсіп — жаңа компоненттер: «Есептеу» батырмасы, нәтиже күйлері, анимация, Kaspi, құжаттар */

/* ---------- Есептеу батырмасы ---------- */
.cta { position: sticky; bottom: 14px; z-index: 5; display: flex; align-items: center; gap: 16px; margin: 24px -10px -10px; padding: 12px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 2px 8px rgba(19, 48, 27, .06); }
.cta[hidden] { display: none; }
.cta__hint { margin: 0; font-size: 13.5px; color: var(--muted); }
.cta--inline { position: static; margin: 26px 0 0; padding: 0; border: 0; background: none; box-shadow: none; backdrop-filter: none; flex-wrap: wrap; }
.calc-btn { position: relative; display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 12px; height: 58px; padding: 0 30px; overflow: hidden; border: 0; border-radius: 16px; background: var(--royal); color: #fff; font-size: 17px; font-weight: 500; letter-spacing: .01em; box-shadow: none; transition: transform .2s var(--spring), box-shadow .2s, opacity .2s; }
.calc-btn svg { width: 20px; height: 20px; stroke-width: 1.5; transition: transform .35s var(--spring); }
@keyframes shine { 0%, 70% { left: -40%; } 100% { left: 130%; } }
.calc-btn:active:not(:disabled) { transform: scale(.97); }
.calc-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.calc-btn.is-busy { pointer-events: none; }
.calc-btn.is-busy svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.calc-btn--sm { height: 50px; padding: 0 22px; font-size: 15.5px; border-radius: 14px; }
.btn--sm { height: 42px; padding: 0 16px; font-size: 14px; border-radius: 12px; }
.ghost--txt { width: auto !important; padding: 0 16px !important; }
.ghost--txt span { display: inline !important; }
.ghost--txt svg { width: 17px; height: 17px; color: var(--blue); }
.ghost[hidden] { display: none; }

/* ---------- нәтиже күйлері ---------- */
.result__empty { display: none; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 26px 24px 28px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); position: sticky; top: calc(var(--top-h) + var(--tabs-h) + 12px); }
.result[data-state="empty"] .result__empty { display: flex; }
.result[data-state="empty"] .result__card, .result[data-state="empty"] .result__scroll { display: none; }
.result__empty h3 { margin: 6px 0 0; font-size: 19px; letter-spacing: -.01em; }
.result__empty p { margin: 0; max-width: 34ch; font-size: 14px; color: var(--muted); }
.empty__art { position: relative; width: 190px; height: 150px; }
.blob--e1 { width: 140px; height: 140px; left: 24px; top: 6px; background: #e5f2de; }
.blob--e2 { width: 56px; height: 56px; right: 10px; top: 0; border: 2px solid #cbe7bb; }
.empty__paper { position: absolute; left: 56px; top: 18px; display: flex; flex-direction: column; gap: 9px; width: 84px; height: 116px; padding: 16px 12px; border-radius: 10px 10px 4px 4px; background: #fff; box-shadow: 0 16px 30px -14px rgba(31, 90, 38, .45); animation: bob 5s ease-in-out infinite; }
.empty__paper i { height: 6px; border-radius: 3px; background: #dcefd2; background-size: 200% 100%; animation: skel 1.6s linear infinite; }
.empty__paper i:nth-child(2) { width: 70%; } .empty__paper i:nth-child(4) { width: 50%; }
.empty__paper b { position: absolute; right: -14px; bottom: -12px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--royal); color: #fff; font-size: 18px; box-shadow: none; }
@keyframes skel { to { background-position: -200% 0; } }
.empty__leaf { position: absolute; left: 6px; bottom: 6px; width: 44px; height: 44px; color: var(--leaf); stroke-width: 1.5; transform: rotate(-20deg); }
.empty__steps { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 8px; padding: 0; list-style: none; counter-reset: st; text-align: left; }
.empty__steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--ink-2); counter-increment: st; }
.empty__steps li::before { content: counter(st); display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--blue-50); color: var(--blue); font-size: 12.5px; font-weight: 500; }

.result__stale { display: none; position: sticky; top: calc(var(--top-h) + var(--tabs-h) + 12px + 64px); z-index: 5; height: 72px; margin: 64px 14px -136px; align-items: center; gap: 12px; padding: 0 10px 0 12px; border-radius: 16px; background: rgba(255, 255, 255, .96); box-shadow: 0 16px 34px -12px rgba(19, 48, 27, .45); animation: swap .4s var(--spring); }
.result[data-state="stale"] .result__stale { display: flex; }
.result[data-state="stale"] .result__card > *, .result[data-state="stale"] .result__scroll { filter: blur(3px); opacity: .45; pointer-events: none; transition: filter .3s, opacity .3s; }
.stale__ic { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: #fff4e6; color: var(--amber); }
.result__stale > div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.result__stale b { font-size: 14.5px; }
.result__stale small { font-size: 12.5px; color: var(--muted); line-height: 1.3; }

/* reveal after calculation */
.result.is-revealing .result__card { animation: cardIn .7s var(--spring) both; }
.result.is-revealing .result__value { animation: valueIn .9s var(--spring) .1s both; }
.result.is-revealing .group, .result.is-revealing .note, .result.is-revealing #copyBtn, .result.is-revealing #printBtn { animation: rowIn .6s var(--spring) both; }
.result.is-revealing .group:nth-child(1) { animation-delay: .18s; }
.result.is-revealing .group:nth-child(2) { animation-delay: .28s; }
.result.is-revealing .group:nth-child(3) { animation-delay: .38s; }
.result.is-revealing .group:nth-child(4) { animation-delay: .48s; }
.result.is-revealing .result__notes .note { animation-delay: .5s; }
.result.is-revealing #copyBtn, .result.is-revealing #printBtn { animation-delay: .6s; }
.result.is-revealing .row { animation: rowIn .5s var(--spring) both; }
.result.is-revealing .row:nth-child(2) { animation-delay: .25s; } .result.is-revealing .row:nth-child(3) { animation-delay: .3s; }
.result.is-revealing .row:nth-child(4) { animation-delay: .35s; } .result.is-revealing .row:nth-child(5) { animation-delay: .4s; }
.result.is-revealing .row:nth-child(n+6) { animation-delay: .45s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(22px) scale(.95); } }
@keyframes valueIn { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } }
@keyframes rowIn { from { opacity: 0; transform: translateY(14px); } }

/* ---------- «Есептеу» анимациясы (чек + мөр) ---------- */
.fx { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.fx[hidden] { display: none; }
.fx__bg { position: absolute; inset: 0; background: radial-gradient(circle at 50% 42%, rgba(168, 217, 143, .55) 0%, rgba(31, 90, 38, .7) 75%); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); opacity: 0; transition: opacity .35s; }
.fx.is-in .fx__bg { opacity: 1; }
.fx.is-out .fx__bg { opacity: 0; }
.fx__float { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.fx__float i { position: absolute; left: var(--x); bottom: -60px; font-style: normal; font-size: calc(18px + (var(--i) * 3px) % 22px); font-weight: 700; color: rgba(255, 255, 255, .55); opacity: 0; }
.fx.is-in .fx__float i { animation: floatUp 3.4s linear infinite; animation-delay: calc(var(--i) * -.29s); }
@keyframes floatUp { 0% { transform: translateY(0) rotate(0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: .8; } 100% { transform: translateY(-110vh) rotate(160deg); opacity: 0; } }
.fx__stage { position: relative; display: flex; flex-direction: column; align-items: center; width: min(370px, 100%); transition: transform .4s var(--spring), opacity .3s; }
.fx.is-out .fx__stage { transform: translateY(-30px) scale(.94); opacity: 0; }
.fx__printer { position: relative; z-index: 2; width: calc(100% + 26px); height: 30px; border-radius: 15px; background: linear-gradient(180deg, #2e7526, #174a1f); box-shadow: 0 14px 26px -12px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .2); opacity: 0; transform: translateY(-16px) scale(.96); transition: opacity .3s, transform .45s var(--spring); }
.fx__printer span { position: absolute; left: 22px; right: 22px; bottom: 9px; height: 4px; border-radius: 2px; background: #0e3013; }
.fx.is-in .fx__printer { opacity: 1; transform: none; }
.fx__receipt { position: relative; width: 100%; margin-top: -14px; padding: 30px 22px 30px; background: #fff; color: var(--ink); filter: drop-shadow(0 26px 40px rgba(14, 40, 18, .35)); clip-path: inset(0 0 100% 0); transition: clip-path 1.9s cubic-bezier(.35, .1, .3, 1); }
.fx__receipt::after { content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px; background: radial-gradient(circle at 7px -1px, transparent 7px, #fff 7.5px) 0 0 / 14px 10px repeat-x; }
.fx.is-print .fx__receipt { clip-path: inset(0 0 -12px 0); }
.fx__head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; margin-bottom: 6px; border-bottom: 2px dashed #d5e8cb; }
.fx__ring { position: relative; display: grid; place-items: center; width: 46px; height: 46px; flex: none; }
.fx__ring svg { position: absolute; inset: 0; width: 46px; height: 46px; transform: rotate(-90deg); }
.fx__track { fill: none; stroke: #e5f2de; stroke-width: 4; }
.fx__prog { fill: none; stroke: var(--blue); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 113.1; stroke-dashoffset: 113.1; transition: stroke-dashoffset .35s var(--ease); }
.fx__pct { position: relative; font-size: 12px; font-weight: 500; color: var(--navy); font-variant-numeric: tabular-nums; }
.fx__pct::after { content: "%"; font-size: 9px; }
.fx__head > div { display: flex; flex-direction: column; min-width: 0; }
.fx__title { font-size: 15px; line-height: 1.25; }
.fx__status { min-height: 18px; font-size: 12.5px; color: var(--muted); }
.fx__line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed #dcebd4; font-size: 13.5px; opacity: 0; transform: translateX(-10px); transition: opacity .3s, transform .4s var(--spring); }
.fx__line span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.fx__line b, .fx__total b { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--blue); transition: color .3s; }
.fx__line b.is-set { color: var(--ink); }
.fx__line.is-on { opacity: 1; transform: none; }
.fx__total { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 12px; border-top: 2px solid var(--ink); font-size: 18px; font-weight: 700; opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .4s var(--spring); }
.fx__total:empty { display: none; }
.fx.is-total .fx__total { opacity: 1; transform: none; }
.fx__total b.is-set { color: var(--navy); }
.fx__stamp { position: absolute; right: 16px; bottom: 54px; padding: 4px; border: 3px solid #2e7d32; border-radius: 12px; color: #2e7d32; opacity: 0; transform: rotate(-14deg) scale(2.6); pointer-events: none; mix-blend-mode: multiply; }
.fx__stamp span { display: block; padding: 5px 12px; border: 1.5px dashed currentColor; border-radius: 8px; font-size: 17px; font-weight: 700; letter-spacing: .14em; }
.fx.is-stamped .fx__stamp { animation: stampIn .42s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.fx.is-stamped .fx__receipt { animation: thud .32s .12s; }
@keyframes stampIn { 0% { opacity: 0; transform: rotate(-24deg) scale(2.6); } 70% { opacity: .95; transform: rotate(-12deg) scale(.92); } 100% { opacity: .9; transform: rotate(-14deg) scale(1); } }
@keyframes thud { 30% { transform: translateY(3px) scale(.99); } 60% { transform: translateY(-1px); } }
.fx__skip { margin-top: 26px; height: 40px; padding: 0 20px; border: 1px solid rgba(255, 255, 255, .4); border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 13.5px; font-weight: 500; opacity: 0; transition: opacity .3s .6s, background .2s; }
.fx.is-in .fx__skip { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .fx__skip:hover { background: rgba(255, 255, 255, .26); } }
.fx__skip:active { scale: .96; }

.confetti { position: fixed; inset: 0; z-index: 120; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; width: 10px; height: 6px; border-radius: 2px; font-style: normal; }
.confetti .is-ci { width: 8px; height: 8px; border-radius: 50%; }
.confetti .is-t { width: auto; height: auto; font-size: 17px; font-weight: 700; }

/* ---------- сервистер ---------- */
.is-svc .app { grid-template-columns: minmax(0, 1fr); }
.is-svc .result, .is-svc .dock, .is-svc .sheet-backdrop { display: none !important; }
.is-svc .app { padding-bottom: 64px !important; }
.is-svc .foot__row { padding-bottom: 24px !important; }
#svc[hidden] { display: none; }
.svc__grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.svc__main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.svc__side { padding: 20px 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--blue-50); }
.svc__side h3 { margin: 0 0 8px; font-size: 16px; }
.svc__side p { margin: 0 0 14px; font-size: 14px; color: var(--ink-2); }
.svc__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 20px; border: 2px dashed var(--blue-100); border-radius: 22px; background: #f6fbf3; text-align: center; cursor: var(--cur-hand); transition: border-color .2s, background .2s, transform .2s var(--spring); }
.drop:focus-within { outline: 3px solid var(--blue); outline-offset: 2px; }
.drop.is-over { border-color: var(--blue); background: var(--blue-50); transform: scale(1.01); }
.drop.has-file { border-style: solid; border-color: #c4e4b3; background: #fff; }
.drop__ic { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 6px; border-radius: 18px; background: var(--blue-50); color: var(--blue); box-shadow: none; }
.drop__ic svg { width: 28px; height: 28px; }
.drop.has-file .drop__ic { background: var(--blue); color: #fff; }
.drop__t { font-size: 16px; font-weight: 500; word-break: break-word; }
.drop__s { font-size: 13px; color: var(--muted); }
.note--ok { background: #eef8ea; }
.note--ok svg { color: #4f9a35; }
.howto { border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.howto summary { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 12px; cursor: var(--cur-hand); list-style: none; font-size: 14px; font-weight: 500; }
.howto summary::-webkit-details-marker { display: none; }
.howto summary span { flex: 1; }
.howto summary svg { width: 18px; height: 18px; color: var(--blue); }
.howto summary svg:last-child { color: var(--muted); transition: transform .3s var(--spring); }
.howto[open] summary svg:last-child { transform: rotate(180deg); }
.howto ol { margin: 0; padding: 0 16px 14px 34px; font-size: 14px; color: var(--ink-2); }
.howto li + li { margin-top: 4px; }

/* Kaspi report */
.kr { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--top-h) + var(--tabs-h) + 16px); }
.kr__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.kr__head h3 { margin: 0; font-size: 21px; letter-spacing: -.01em; }
.kr__head p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }
.kr__tools { display: flex; gap: 8px; }
.kr__stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.stat span { font-size: 13px; color: var(--muted); line-height: 1.3; }
.stat b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat--main { position: relative; overflow: hidden; border: 0; background: var(--royal); color: #fff; box-shadow: none; }
.stat--main span { color: rgba(255, 255, 255, .75); }
.stat--main::after { content: ""; position: absolute; right: -40px; top: -50px; width: 120px; height: 120px; border-radius: 50%; background: rgba(168, 217, 143, .35); }
.is-revealing .stat { animation: rowIn .6s var(--spring) both; animation-delay: calc(var(--i) * .08s + .1s); }
.kchart { position: relative; display: flex; align-items: flex-end; gap: 10px; height: 240px; margin: 14px 0; padding: 30px 14px 34px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.kchart__lim { position: absolute; left: 14px; right: 14px; bottom: calc(34px + (100% - 64px) * var(--lim)); border-top: 2px dashed #f0b56a; pointer-events: none; transform: translateY(-1px); }
.kchart__lim span { position: absolute; left: 0; top: -22px; padding: 1px 8px; border-radius: 6px; background: #fff4e6; color: var(--amber); font-size: 11.5px; font-weight: 500; }
.kchart__col { position: relative; display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.kchart__col b { margin-bottom: 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.kchart__bar { width: 100%; max-width: 58px; height: var(--h); min-height: 4px; border-radius: 10px 10px 4px 4px; background: #b9dda5; }
.kchart__col.is-recent .kchart__bar { background: var(--royal); }
.kchart__col.is-over .kchart__bar { background: var(--amber); }
.kchart__col small { position: absolute; bottom: -26px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.is-revealing .kchart__bar { animation: grow .9s var(--spring) both; animation-delay: calc(var(--i) * .08s + .2s); }
@keyframes grow { from { height: 0; min-height: 0; } }
.kr__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rank { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%; background: var(--blue-50); color: var(--blue); font-size: 11.5px; font-weight: 500; vertical-align: 1px; }
.row__val.is-hot { color: var(--amber); }

/* Documents */
.dtabs { display: flex; flex-wrap: wrap; gap: 8px; }
.dtab { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 14px; font-weight: 500; color: var(--ink-2); transition: background .2s, color .2s, border-color .2s, transform .15s; }
.dtab svg { width: 19px; height: 19px; color: var(--blue); }
.dtab[aria-selected="true"] { background: var(--royal); border-color: transparent; color: #fff; box-shadow: none; }
.dtab[aria-selected="true"] svg { color: #d4f0c4; }
.dtab:active { transform: scale(.97); }
.docs__title { margin: 20px 0 14px; font-size: 18px; letter-spacing: -.01em; }
.parties { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 8px; }
.party { min-width: 0; margin: 0; padding: 12px 16px 16px; border: 1px solid var(--line); border-radius: 18px; background: #fbfdf9; }
.party legend { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px; font-size: 12.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--blue-600); }
.party legend svg { width: 17px; height: 17px; }
.form--tight { gap: 12px; }
.docs .kicker { margin: 22px 0 12px; padding-top: 18px; }
.docs .input input { font-size: 15.5px; }
.input.is-err input { border-color: #df4d4d; box-shadow: 0 0 0 4px #fde3e3; }
.it { display: flex; flex-direction: column; gap: 8px; }
.it__row { display: grid; grid-template-columns: var(--tpl); gap: 8px; align-items: center; animation: swap .35s var(--spring); }
.it__row--head { animation: none; }
.it__row--head span { font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.it__row--head .r { text-align: right; }
.it__cell { display: flex; flex-direction: column; min-width: 0; }
.it__cell input { width: 100%; height: 46px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-size: 15px; transition: border-color .2s, box-shadow .2s; }
.it__cell input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-100); }
.it__cell.is-num input { text-align: right; font-variant-numeric: tabular-nums; }
.it__lab { display: none; }
.it__sum { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 15px; }
.it + .add-btn { margin-top: 10px; }
.dtot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin: 14px 0 6px; padding: 14px 18px; border-radius: 16px; background: var(--blue-50); font-size: 13.5px; color: var(--ink-2); }
.dtot b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.dtot__main { margin-left: auto; font-size: 14.5px; }
.dtot__main b { color: var(--blue-600); font-size: 18px; font-weight: 700; }
.docs > .form--tight { margin-top: 12px; }
.docs .hint { margin: 12px 0 0; }

/* document preview */
.dlg--doc { width: min(940px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.dlg--doc .dlg__head { flex-wrap: wrap; }
.dlg--doc .dlg__head h2 { font-size: 17px; min-width: 160px; }
.doc-view { padding: 24px; background: #e9f1e5; }
.sheet { width: 794px; max-width: none; margin: 0 auto; padding: 56px 52px; background: #fff; box-shadow: 0 14px 40px -18px rgba(19, 48, 27, .4); }

/* hover */
@media (hover: hover) and (pointer: fine) {
  .calc-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: none; }
  .calc-btn:hover:not(:disabled) svg { transform: translateX(4px); }
  .drop:hover { border-color: var(--blue); background: var(--blue-50); }
  .dtab:hover:not([aria-selected="true"]) { border-color: var(--line-2); color: var(--ink); transform: translateY(-1px); }
  .tool:hover svg { color: var(--navy); }
}

/* mobile */
@media (max-width: 899px) {
  .cta { position: static; margin: 22px 0 0; padding: 0; border: 0; background: none; box-shadow: none; backdrop-filter: none; flex-direction: column; align-items: stretch; gap: 8px; }
  .cta__hint { text-align: center; font-size: 12.5px; }
  .calc-btn { width: 100%; }
  .cta--inline { flex-direction: column; align-items: stretch; }
  .result__empty { display: none !important; }
  .result__stale { margin: 64px 4px -136px; }
  .svc__grid, .parties, .kr__cols { grid-template-columns: 1fr; }
  .kr__stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 12px 14px; border-radius: 14px; }
  .stat b { font-size: 21px; }
  .kchart { gap: 6px; height: 210px; padding: 30px 8px 34px; }
  .kchart__col b { font-size: 11.5px; }
  .kchart__col small { font-size: 10px; }
  .drop { padding: 26px 16px; }
  .dtabs { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .dtabs::-webkit-scrollbar { display: none; }
  .dtab { flex: none; }
  .it__row--head { display: none; }
  .it__row { grid-template-columns: 1fr 1fr; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #fbfdf9; position: relative; }
  .it__cell.is-main { grid-column: 1 / -1; padding-right: 52px; }
  .it__lab { display: block; margin-bottom: 4px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
  .it__sum { grid-column: 1 / -1; padding-top: 4px; border-top: 1px dashed var(--line); }
  .it__row .icon-btn { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; }
  .dtot__main { margin-left: 0; width: 100%; }
  .doc-view { padding: 12px; overflow-x: auto; overscroll-behavior-x: contain; }
  .dlg--doc .dlg__head .btn--sm span { display: none; }
  .fx__stamp span { font-size: 15px; }
}

/* print: only the generated document */
@media print {
  @page { size: A4; margin: 14mm; }
  html.is-printing-doc body > *:not(.dlg--doc) { display: none !important; }
  html.is-printing-doc, html.is-printing-doc body { background: #fff !important; }
  .dlg--doc { position: static; display: block !important; width: auto; max-width: none; max-height: none; margin: 0; border-radius: 0; box-shadow: none; overflow: visible; animation: none !important; }
  .dlg--doc::backdrop { display: none; }
  .dlg--doc .dlg__head { display: none !important; }
  .dlg--doc .dlg__box, .doc-view { display: block; padding: 0; background: none; overflow: visible; }
  .sheet { width: auto; padding: 0; box-shadow: none; }
}

/* ---------- ЕНПФ үзіндісі: тиімді кезең ---------- */
.pbest { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; padding: 16px 18px; border: 1px solid #cfe7c2; border-radius: 18px; background: #f3faef; }
.pbest__txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pbest__txt span { font-size: 13px; color: var(--muted); line-height: 1.3; }
.pbest__txt b { font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--navy); font-variant-numeric: tabular-nums; }
.pbest__txt small { font-size: 13px; color: var(--ink-2); }
.pbest .ghost { flex-shrink: 0; }
.pbest__tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 6px; background: var(--blue-50); color: var(--blue); font-size: 11.5px; font-weight: 500; vertical-align: 2px; }
.pwho { margin-top: 14px; }
.pwho .row__name b { white-space: normal; overflow-wrap: anywhere; }
.kchart--years { overflow-x: auto; overscroll-behavior-x: contain; }
.kchart--years .kchart__col { min-width: 30px; }
.kchart--years .kchart__col b { font-size: 11.5px; font-weight: 500; white-space: nowrap; }
@media (max-width: 600px) {
  .pbest .ghost { width: 100%; justify-content: center; }
  .kchart--years .kchart__col b { writing-mode: vertical-rl; transform: rotate(180deg); margin-bottom: 4px; }
}

/* ---------- басып шығару ---------- */
.result__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.result__actions .btn { flex: 1 1 170px; }
.btn--line { background: #fff; color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--line); }
@media (hover: hover) and (pointer: fine) { .btn.btn--line:hover { background: var(--blue-50); color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--blue); } }
.btn.btn--line:active { background: var(--blue-50); }
.btn.btn--line:focus-visible { background: var(--blue-50); }
#printSheet { display: none; }
@media print {
  html.is-printing-res body > *:not(#printSheet) { display: none !important; }
  html.is-printing-res, html.is-printing-res body { background: #fff !important; }
  html.is-printing-res #printSheet { display: block; color: #111; font-size: 12.5px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #printSheet *, #printSheet *::before, #printSheet *::after { animation: none !important; transition: none !important; }
  #printSheet [data-reveal], #printSheet .group, #printSheet .row, #printSheet .note, #printSheet .stat { opacity: 1 !important; transform: none !important; }
  .ps__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 6px; }
  .ps__logo { position: relative; display: flex; align-items: baseline; gap: 2px; line-height: 1; }
  .ps__la { font-size: 26px; font-weight: 300; color: #2f4a33; }
  .ps__lb { margin-left: 4px; padding: .3em .2em .1em; font-family: var(--script); font-size: 50px; color: var(--navy); }
  .ps__wave { position: absolute; left: 70px; bottom: -4px; width: 190px; height: 16px; fill: none; stroke: #a8d98f; stroke-width: 4; stroke-linecap: round; }
  .ps__who { display: flex; align-items: center; gap: 12px; text-align: right; font-size: 11px; color: #555; }
  .ps__who > div { display: flex; flex-direction: column; gap: 1px; }
  .ps__who b { font-size: 12.5px; font-weight: 600; color: var(--navy); }
  .ps__who img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; border: 2.5px solid #a8d98f; }
  .ps__band { display: flex; justify-content: space-between; margin-top: 6px; padding: 7px 14px; border-radius: 8px; background: var(--royal) !important; color: #fff; font-size: 11px; letter-spacing: .02em; }
  .ps__title { margin: 16px 0 2px; font-size: 22px; font-weight: 700; color: #13301b; }
  .ps__sub { margin: 0 0 8px; color: #555; }
  .ps__in h2, .ps__h { margin: 14px 0 6px; font-size: 13px; font-weight: 700; text-transform: none; color: var(--royal); }
  .ps__in dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; margin: 0; }
  .ps__in dl div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid #e5e5e5; break-inside: avoid; }
  .ps__in dt { color: #555; }
  .ps__in dd { margin: 0; font-weight: 600; text-align: right; white-space: nowrap; }
  .ps__body { display: flex; flex-direction: column; gap: 10px; }
  .ps__body .result__card { padding: 12px 16px; border: 1px solid #ddd; border-radius: 12px; background: #f5faf2 !important; color: #111 !important; box-shadow: none; }
  .ps__body .result__card * { color: #111 !important; }
  .ps__body .group, .ps__body .note, .ps__body .stat, .ps__body .pbest, .ps__body .kchart { break-inside: avoid; box-shadow: none; }
  .ps__body .kr { margin: 0; padding: 0; border: 0; }
  .ps__body .kr__stats { grid-template-columns: repeat(4, 1fr); }
  .ps__body .kr__cols { grid-template-columns: 1fr 1fr; align-items: start; }
  .ps__body .kchart { overflow: visible; gap: 3px; height: 200px; padding: 26px 6px 30px; }
  .ps__body .kchart__col { min-width: 0 !important; }
  .ps__body .kchart__col b { font-size: 7.5px !important; font-weight: 500; letter-spacing: -.02em; }
  .ps__body .kchart__col small { font-size: 9px; }
  .ps__body .stat--main { background: var(--royal) !important; color: #fff !important; }
  .ps__foot { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 18px; padding-top: 8px; border-top: 2px solid var(--royal); font-size: 10px; color: #666; break-inside: avoid; }
  .ps__fb { font-size: 13px; font-weight: 300; color: #2f4a33; white-space: nowrap; }
  .ps__fb i { font-family: var(--script); font-style: normal; font-size: 22px; color: var(--navy); }
  .ps__foot span:last-child { white-space: nowrap; font-weight: 600; color: var(--navy); }
  .ps__pw { margin-top: 5px; text-align: right; font-size: 7.5px; letter-spacing: .08em; text-transform: uppercase; color: #aaa; }
  .ps__pw b { font-weight: 600; color: #888; }
}

/* iOS zooms into any field under 16px and never zooms back out */
@media (pointer: coarse) {
  .docs .input input, .it__cell input { font-size: 16px; }
}
