/* Calculator kit (2026-10-24): pieces the /tools/ calculators share on top of the fund calculator's yv-fc layout
   (story-v1.css). Colors come from the story tokens, so light and dark both work. */
.yv-ck { --ck-up: #0e8f63; --ck-down: #c23b3b; --ck-gold: #c99a1e; --ck-violet: #7a5af5; --ck-teal: #0e9aa7; }
html[data-theme="dark"] .yv-ck { --ck-up: #3fd29a; --ck-down: #ff7b7b; --ck-gold: #e8bd4f; --ck-violet: #a58bff; --ck-teal: #3fc7d2; }

.yv-ck .yv-fc__seg--2 { grid-template-columns: repeat(2, 1fr); }
.yv-ck .yv-fc__seg--3 { grid-template-columns: repeat(3, 1fr); }
.yv-ck .yv-fc__seg--5 { grid-template-columns: repeat(5, 1fr); }
.yv-ck .yv-fc__seg button[disabled] { opacity: .38; cursor: not-allowed; }
.yv-ck .yv-fc__seg button small { display: block; font-size: .72rem; font-weight: 600; opacity: .7; line-height: 1.3; }

.yv-ck__inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.yv-ck__inputs > div { display: grid; gap: 6px; align-content: start; min-width: 0; }
.yv-ck__field { position: relative; }
.yv-ck__field input { padding-inline-end: 46px !important; }
.yv-ck__suffix { position: absolute; inset-inline-end: 14px; top: 50%; translate: 0 -50%; color: var(--st-ink2); font-size: .85rem; font-weight: 700; pointer-events: none; }
.yv-ck__help { margin: 0; color: var(--st-ink2); font-size: .82rem; line-height: 1.8; }
.yv-ck__stamp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; color: var(--st-ink2); font-size: .84rem; line-height: 1.8; }
.yv-ck__stamp::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #34c98a; box-shadow: 0 0 0 4px color-mix(in srgb, #34c98a 22%, transparent); }
.yv-ck__stamp.is-old::before { background: #e0a100; box-shadow: 0 0 0 4px color-mix(in srgb, #e0a100 22%, transparent); }
.yv-ck__reset { border: 0; background: none; padding: 0; color: var(--st-blue); font: inherit; font-size: .84rem; font-weight: 800; cursor: pointer; }
.yv-ck__reset:hover { text-decoration: underline; }

/* result: insight callout, stacked composition bar, comparison bars */
.yv-story .yv-fc__result .yv-ck__insight { margin: 2px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--st-blue-soft); color: var(--st-ink); font-size: .92rem; line-height: 1.95; }
.yv-story .yv-fc__result .yv-ck__insight b { color: var(--st-blue); }
.yv-story .yv-fc__result .yv-fc__final.is-down { color: var(--ck-down); }
.yv-story .yv-fc__result .yv-fc__final.is-up { color: var(--ck-up); }
.yv-story .yv-fc__result .yv-fc__gain.is-down { color: var(--ck-down); }
.yv-ck__stack { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--st-bg); border: 1px solid var(--st-line); }
.yv-ck__stack span { display: block; height: 100%; min-width: 2px; transition: flex-basis .3s ease; }
.yv-ck__legend { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.yv-ck__legend li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: .9rem; }
.yv-ck__legend li > span:first-child { display: inline-flex; align-items: center; gap: 8px; color: var(--st-ink2); }
.yv-ck__legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.yv-ck__legend b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.yv-ck__legend li.is-total { padding-top: 8px; border-top: 1px dashed var(--st-line); }
.yv-ck__legend li.is-total > span:first-child { color: var(--st-ink); font-weight: 800; }
.yv-ck .c-gold { background: var(--ck-gold); }
.yv-ck .c-blue { background: var(--st-blue); }
.yv-ck .c-violet { background: var(--ck-violet); }
.yv-ck .c-teal { background: var(--ck-teal); }
.yv-ck .c-red { background: var(--ck-down); }
.yv-ck .c-green { background: var(--ck-up); }
.yv-ck .c-gray { background: color-mix(in srgb, var(--st-ink2) 55%, transparent); }

.yv-ck__bars { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.yv-ck__bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: baseline; }
.yv-ck__bars .yv-ck__name { font-weight: 800; font-size: .93rem; }
.yv-ck__bars .yv-ck__name small { font-weight: 600; color: var(--st-ink2); font-size: .78rem; margin-inline-start: 6px; }
.yv-ck__bars .yv-ck__val { font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; font-size: .93rem; }
.yv-ck__bars .yv-ck__val small { display: block; text-align: left; font-size: .78rem; font-weight: 700; }
.yv-ck__bars .yv-ck__track { grid-column: 1 / -1; height: 10px; border-radius: 999px; background: var(--st-bg); border: 1px solid var(--st-line); overflow: hidden; }
.yv-ck__bars .yv-ck__track span { display: block; height: 100%; border-radius: 999px; background: var(--st-blue); transition: width .35s ease; }
.yv-ck__bars li.is-best .yv-ck__track span { background: var(--ck-up); }
.yv-ck__bars li.is-down .yv-ck__track span { background: var(--ck-down); }
.yv-ck__bars li.is-base .yv-ck__track span { background: color-mix(in srgb, var(--st-ink2) 45%, transparent); }
.yv-ck__bars .is-up { color: var(--ck-up); }
.yv-ck__bars .is-down { color: var(--ck-down); }
.yv-ck__bars li.is-best .yv-ck__name::after { content: "بیشترین"; margin-inline-start: 8px; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--ck-up) 15%, transparent); color: var(--ck-up); font-size: .72rem; font-weight: 800; }
.yv-story .yv-fc__result .yv-ck__missing { margin: 0; color: var(--st-ink2); font-size: .82rem; line-height: 1.8; }
.yv-story .yv-fc__result .yv-ck__missing:empty { display: none; }

/* two columns side by side inside the result (deposit vs fund) */
.yv-ck__vs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.yv-ck__vs > div { display: grid; gap: 2px; padding: 12px; border-radius: 16px; background: var(--st-bg); border: 1px solid var(--st-line); min-width: 0; }
.yv-ck__vs > div.is-win { border-color: color-mix(in srgb, var(--ck-up) 55%, var(--st-line)); background: color-mix(in srgb, var(--ck-up) 7%, var(--st-surface)); }
.yv-ck__vs span { color: var(--st-ink2); font-size: .82rem; }
.yv-ck__vs strong { font-size: 1.08rem; font-weight: 900; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.yv-ck__vs small { color: var(--st-ink2); font-size: .8rem; }

/* purchase rows (average cost) */
.yv-ck__rows { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: ckrow; }
.yv-ck__rows li { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1.4fr) 40px; gap: 8px; align-items: center; counter-increment: ckrow; }
.yv-ck__rows li::before { content: counter(ckrow, persian); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 9px; background: var(--st-blue-soft); color: var(--st-blue); font-weight: 800; font-size: .82rem; }
.yv-ck__rows input { min-height: 46px !important; }
.yv-ck__rowhead { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1.4fr) 40px; gap: 8px; font-size: .8rem; font-weight: 700; color: var(--st-ink2); }
.yv-ck__rowhead span:first-child { grid-column: 2; }
.yv-ck__del { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--st-line); background: var(--st-bg); color: var(--st-ink2); font: inherit; font-size: 1.1rem; cursor: pointer; }
.yv-ck__del:hover { border-color: var(--ck-down); color: var(--ck-down); }
.yv-ck__del[disabled] { opacity: .35; cursor: not-allowed; }
.yv-ck__add { justify-self: start; min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1.5px dashed color-mix(in srgb, var(--st-blue) 50%, var(--st-line)); background: transparent; color: var(--st-blue); font: inherit; font-weight: 800; cursor: pointer; }
.yv-ck__add:hover { background: var(--st-blue-soft); }
.yv-ck__add[hidden] { display: none; }

/* multi-select chips (asset picker) */
.yv-ck .yv-fc__chip[aria-pressed="true"] { background: var(--st-blue); border-color: var(--st-blue); color: #fff; }
.yv-ck .yv-fc__chip[disabled] { opacity: .4; cursor: not-allowed; }

/* chart: the part of the balance that is your own deposits, under the growth line */
.yv-story .yv-fc__result .yv-ck__base { fill: color-mix(in srgb, var(--st-blue) 26%, transparent); }
.yv-ck__key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -2px 0 2px; color: var(--st-ink2); font-size: .8rem; }
.yv-ck__key span { display: inline-flex; align-items: center; gap: 6px; }
.yv-ck__key i { width: 10px; height: 10px; border-radius: 3px; }
.yv-ck__key .k-own { background: color-mix(in srgb, var(--st-blue) 40%, transparent); }
.yv-ck__key .k-gain { background: color-mix(in srgb, var(--st-blue) 14%, transparent); border: 1px solid color-mix(in srgb, var(--st-blue) 40%, transparent); }

/* «more calculators» strip under each calculator */
.yv-ck__more { margin-top: 30px; }
.yv-ck__more h2 { margin: 0 0 14px; font-size: 1.2rem; font-weight: 800; }
.yv-ck__more .yv-tools__grid { margin: 0; }

@media (max-width: 520px) {
	.yv-ck .yv-fc__seg--5 { grid-template-columns: repeat(3, 1fr); }
	.yv-ck__rows li, .yv-ck__rowhead { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1.25fr) 38px; gap: 6px; }
	.yv-ck__vs { grid-template-columns: 1fr; }
}
.yv-ck__opt { font-weight: 600; font-size: .85rem; color: var(--st-ink2); }
/* a wide fact keeps its label on one line; on phones the value goes under the label instead of squeezing it */
.yv-story .yv-ck .yv-fc__result .yv-fc__facts .yv-fc__fact-wide { flex-wrap: wrap; }
.yv-story .yv-ck .yv-fc__result .yv-fc__facts .yv-fc__fact-wide dt { flex: 1 0 auto; }
@media (max-width: 520px) {
	.yv-story .yv-ck .yv-fc__result .yv-fc__facts .yv-fc__fact-wide { display: grid; gap: 2px; }
	.yv-story .yv-ck .yv-fc__result .yv-fc__facts dd { white-space: normal; overflow-wrap: anywhere; }
}
