/* Индекс цен (/ceny, архив дня, итоги месяца, график на странице группы) - макет «Индекс-терминал v2»
   (утверждён 27.10.2026). Только токены base.css. Цены в двух видах: .vn без НДС, .vg с НДС - [data-nds]. */

/* ---- НДС: какую цену показывать ---- */
.vg { display: none; }
[data-nds="1"] .vn { display: none; }
[data-nds="1"] .vg { display: inline; }

/* ---- общие элементы ---- */
.ix-up { color: var(--wood); }
.ix-down { color: var(--brand); }
.ix-flat { color: var(--muted); }
.ix-chg { display: inline-flex; align-items: center; gap: 4px; font: 600 13.5px/1 var(--mono); white-space: nowrap; }
.ix-seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--surface-3); border-radius: var(--r-pill); flex-wrap: wrap; }
.ix-seg a, .ix-seg span.off { padding: 7px 14px; border-radius: var(--r-pill); color: var(--ink-2); font: 550 13.5px var(--font); white-space: nowrap; text-decoration: none; transition: background-color .15s var(--ease), color .15s var(--ease); }
.ix-seg a:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.ix-seg a.on, .ix-seg a.on:hover { background: var(--ink); color: var(--surface); }
.ix-seg span.off { opacity: .4; cursor: not-allowed; }
.ix-conf { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.ix-conf i { display: inline-flex; gap: 2px; }
.ix-conf i s { width: 4px; height: 12px; border-radius: 2px; background: var(--line-strong); text-decoration: none; }
.ix-conf i s.f { background: var(--brand); }
.ix-spark { display: block; }

/* ---- шапка ---- */
.ix-page .crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.ix-page .crumbs a { color: var(--muted); }
.ix-page .crumbs a:hover { color: var(--ink); }
.ix1-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.ix1-head h1 { font-size: clamp(28px, 3.4vw, 46px); margin: 0 0 6px; }
.ix1-head .lead { margin: 0; color: var(--muted); max-width: 62ch; }
.ix1-head-r { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ix-vat { background: transparent; }

/* ---- сводный индекс и Telegram ---- */
.ix1-top { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.ix1-hero { display: flex; flex-direction: column; gap: 14px; }
.ix1-hero-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ix1-base { font-size: 13px; color: var(--muted); font-weight: 600; }
.ix1-val { display: flex; align-items: flex-end; gap: 14px; }
.ix1-num { font: 700 clamp(56px, 7vw, 92px)/.9 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.ix1-unit { font-size: 13.5px; color: var(--muted); line-height: 1.3; padding-bottom: 6px; }
.ix1-chgs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ix1-chgs div { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; }
.ix1-chgs small { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 3px; }
.ix1-chgs b { font: 600 18px var(--mono); }
.ix1-ctl { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ix1-src { font-size: 12.5px; color: var(--muted); }
.ix1-side { display: flex; flex-direction: column; gap: 20px; }
.ix1-tg h2 { font-size: 22px; margin: 12px 0 14px; }
.ix1-chat { background: oklch(0.27 0.03 38); border-radius: 18px; padding: 12px; margin-bottom: 16px; }
.ix1-bot { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--wood-soft); margin-bottom: 8px; }
.ix1-bot small { color: var(--wood-soft-2); opacity: .6; }
.ix1-ava { width: 24px; height: 24px; border-radius: 50%; background: var(--signal); color: var(--wood-deep); display: inline-flex; align-items: center; justify-content: center; font: 700 13px var(--display); }
.ix1-msg { background: var(--surface); color: var(--ink); border-radius: 14px 14px 14px 4px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; line-height: 1.35; }
.ix1-msg em { font-style: normal; font-family: var(--mono); font-weight: 600; }
.ix1-msg small { color: var(--muted); }
.ix1-u { color: var(--wood); }
.ix1-d { color: var(--brand); }
.ix1-kb { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 6px; }
.ix1-kb span { background: oklch(0.34 0.035 38); color: var(--surface); text-align: center; border-radius: var(--r-xs); padding: 7px 4px; font-size: 12.5px; font-weight: 600; }
.ix1-tg .ticks { margin-bottom: 18px; }
.ix1-tg .ticks li { font-size: 14px; color: var(--wood-soft); }
.ix1-tg-s { display: block; text-align: center; margin-top: 10px; color: var(--wood-soft-2); opacity: .7; font-size: 12.5px; }
.ix1-void { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

/* ---- график: SVG растягивается, подписи - HTML ---- */
.ixc { margin: 0; position: relative; }
.ixc-plot { position: relative; height: 290px; margin: 8px 0 0 48px; touch-action: pan-y; }
.ixc-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; display: block; }
.ixc-grid { stroke: var(--line); stroke-width: 1; }
.ixc-line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ixc-gap { fill: none; stroke: var(--faint); stroke-width: 1.5; stroke-dasharray: 3 4; }
.ixc-y span { position: absolute; left: -48px; width: 40px; text-align: right; transform: translateY(-50%); font: 500 11.5px var(--font); color: var(--faint); font-variant-numeric: tabular-nums; }
.ixc-x { position: relative; height: 26px; margin-left: 48px; }
.ixc-x span { position: absolute; top: 8px; font: 500 11.5px var(--font); color: var(--faint); white-space: nowrap; transform: translateX(-50%); }
.ixc-x .ixc-x-start { transform: none; }
.ixc-x .ixc-x-end { transform: translateX(-100%); }
.ixc-gapl { position: absolute; transform: translate(-50%, -150%); font: 500 11.5px var(--font); color: var(--faint); white-space: nowrap; background: var(--surface); padding: 0 4px; border-radius: var(--r-xs); }
.ixc-end, .ixc-dot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px var(--surface); }
.ixc-dot { opacity: 0; transition: opacity .12s; }
.ixc-xh { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--ink); opacity: 0; }
.ixc-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--surface); border-radius: 10px; padding: 7px 10px; font-size: 12.5px; line-height: 1.35; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .12s; z-index: 3; }
.ixc-tip b { font: 600 14px var(--mono); }
.ixc.is-hover .ixc-tip, .ixc.is-hover .ixc-dot { opacity: 1; }
.ixc.is-hover .ixc-xh { opacity: .25; }
.ixc-none { color: var(--muted); font-size: 14px; margin: 16px 0; }
[data-chart-box].is-loading { opacity: .55; transition: opacity .15s; }

/* ---- подиндексы ---- */
.ix1-tbl { background: var(--surface); border-radius: var(--r-lg); padding: 8px 8px 10px; }
.ix1-tr { display: grid; grid-template-columns: minmax(200px, 1.6fr) 1fr 1.1fr .7fr .7fr 130px 120px; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 14px; color: var(--ink); }
.ix1-th { font-size: 12.5px; color: var(--muted); font-weight: 600; padding-top: 10px; padding-bottom: 8px; }
.ix1-sub { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 700; padding-top: 18px; padding-bottom: 4px; }
.ix1-tr .r { text-align: right; }
.ix1-tr .ix-chg.r { justify-content: flex-end; }
.ix1-g b { display: block; font-weight: 650; font-size: 15px; }
.ix1-g small { color: var(--muted); font-size: 12.5px; }
.ix1-p { font: 600 16px var(--mono); text-align: right; white-space: nowrap; }
.ix1-p small { font: 500 12px var(--font); color: var(--muted); }
.ix1-yl { display: none; }
.ix1-r { font: 500 13px var(--mono); color: var(--muted); text-align: right; white-space: nowrap; }
.ix1-grp { border-radius: 16px; }
.ix1-grp + .ix1-grp { border-top: 1px solid var(--line); }
.ix1-grp > summary { list-style: none; cursor: pointer; user-select: none; }
.ix1-grp > summary::-webkit-details-marker { display: none; }
.ix1-trb:hover { background: var(--surface-2); }
.ix1-trb:focus-visible { box-shadow: var(--ring); border-radius: 14px; }
.ix1-chev { display: inline-block; vertical-align: -3px; margin-right: 6px; color: var(--muted); transition: transform .2s var(--ease); }
.ix1-grp[open] .ix1-chev { transform: rotate(180deg); color: var(--ink); }
.ix1-grp[open] { background: var(--surface-2); margin: 4px 0; }
.ix1-grp[open] .ix1-trb:hover { background: transparent; }
.ix1-pan { padding: 4px 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.ix1-combo { display: flex; flex-direction: column; gap: 14px; }
.ix1-combo[hidden] { display: none; }
.ix1-pan-ctl { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: flex-end; }
.ix1-f { display: flex; flex-direction: column; gap: 5px; }
.ix1-f > small { font-size: 12px; color: var(--muted); font-weight: 600; }
.ix1-f .ix-seg { background: var(--surface); }
.ix1-types { display: flex; gap: 6px; flex-wrap: wrap; }
.ix1-types a, .ix1-types span.off { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); font: 600 13.5px var(--font); color: var(--ink-2); text-decoration: none; }
.ix1-types a:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }
.ix1-types em { font-style: normal; font: 500 12px var(--mono); color: var(--muted); }
.ix1-types a.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.ix1-types a.on em { color: var(--signal); }
.ix1-types span.off { opacity: .4; cursor: not-allowed; }
.ix1-mx { background: var(--surface); border-radius: 14px; overflow: hidden; }
.ix1-mx-h, .ix1-mx-r { display: grid; grid-template-columns: minmax(150px, 1.3fr) repeat(var(--n), minmax(0, 1fr)); align-items: stretch; }
.ix1-mx-h span { padding: 10px 14px; font-size: 12.5px; color: var(--muted); font-weight: 600; text-align: right; border-bottom: 1px solid var(--line); }
.ix1-mx-h span:first-child { text-align: left; }
.ix1-mx-r + .ix1-mx-r { border-top: 1px solid var(--line); }
.ix1-mx-n { padding: 11px 14px; font: 500 14px var(--mono); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.ix1-mx-n b { font: 600 14px var(--font); }
.ix1-mx-c { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 2px; padding: 9px 14px; color: var(--ink); border-left: 1px solid var(--line); }
a.ix1-mx-c:hover { background: var(--brand-soft); text-decoration: none; color: var(--ink); }
.ix1-mx-c b { font: 600 15.5px var(--mono); }
.ix1-mx-c small { display: flex; align-items: center; gap: 8px; }
.ix1-mx-c .ix-chg { font-size: 12px; }
.ix1-mx-e { color: var(--faint); font: 500 15px var(--mono); }
.ix1-nw { font: 500 12px var(--mono); color: var(--faint); }
.ix1-own { background: var(--surface); border-radius: 14px; padding: 4px 14px; }
.ix1-own-h { font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 9px 0 6px; }
.ix1-own-r { display: grid; grid-template-columns: minmax(150px, 1fr) 100px 130px 70px 40px; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); color: var(--ink); font: 500 14px var(--mono); }
.ix1-own-r:hover { text-decoration: none; color: var(--brand); }
.ix1-own-r b { font: 600 14px var(--font); }
.ix1-own-p { font-weight: 600; text-align: right; }
.ix1-own-v { color: var(--muted); font-size: 13px; text-align: right; }
.ix1-own-r .ix-chg { justify-content: flex-end; }
.ix1-pan-f { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.ix1-pan-a { display: flex; gap: 8px 20px; flex-wrap: wrap; }
.ix1-pan-f .sec-more { font-size: 14px; }
.ix1-empty { background: var(--surface); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.ix1-empty span { color: var(--muted); font-size: 13.5px; }
.ix1-pos { background: var(--surface); border-radius: 14px; padding: 2px 14px; }
.ix1-pos-h, .ix1-pos-r { display: grid; grid-template-columns: minmax(220px, 1.5fr) 110px 130px 80px minmax(170px, 1fr); gap: 12px; align-items: center; padding: 10px 0; }
.ix1-pos-h { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.ix1-pos-h .r { text-align: right; }
.ix1-pos-r { border-top: 1px solid var(--line); color: var(--ink); }
.ix1-pos-r:hover { text-decoration: none; color: var(--ink); }
.ix1-pos-r:hover .ix1-pos-n { color: var(--brand); }
.ix1-pos-n { font-weight: 600; font-size: 14.5px; }
.ix1-pos-r .r { text-align: right; }
.ix1-pos-r .ix-chg { justify-content: flex-end; }
.ix1-pos-b { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.ix1-pos-x { grid-template-columns: minmax(220px, 1.5fr) minmax(0, 3fr); }
.ix1-pos-none { color: var(--faint); font-size: 13.5px; }
.ix1-buy { background: var(--surface); border-radius: 14px; padding: 4px 14px 10px; }
.ix1-buy-h { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 10px 0 6px; }
.ix1-buy-h b { font-size: 14px; }
.ix1-buy-h span { font-size: 12.5px; color: var(--muted); }
.ix1-buy-r { display: grid; grid-template-columns: minmax(220px, 1.6fr) minmax(130px, .8fr) 150px 120px 90px; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.ix1-buy-n b { display: block; font-weight: 600; font-size: 14px; }
.ix1-buy-n small { color: var(--muted); font-size: 12.5px; }
.ix1-buy-p { font: 600 14.5px var(--mono); text-align: right; white-space: nowrap; }
.ix1-buy-p small { font: 500 12px var(--font); color: var(--muted); }
.ix1-buy-v, .ix1-buy-g { color: var(--muted); }
.ix1-buy-d { font: 500 12.5px var(--mono); color: var(--muted); text-align: right; }
.ix1-buy .sec-more { display: inline-flex; margin-top: 8px; font-size: 14px; }

/* ---- индекс обновляется сам ---- */
.ix1-upd h2 { font-size: clamp(22px, 2vw, 28px); margin-bottom: 4px; }
.ix1-updw { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 28px; align-items: start; margin-top: 56px; }
.ix1-sched { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ix1-sched li { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.ix1-sched li:first-child { border-top: 0; }
.ix1-sched b { display: block; font-size: 14.5px; font-weight: 600; }
.ix1-sched small { color: var(--muted); font-size: 12.5px; }
.ix1-sched em { font: 500 12.5px var(--mono); font-style: normal; color: var(--ink-2); text-align: right; }
.ix1-sched .live { justify-self: center; }
.ix-rev { font-style: normal; font-size: 12px; font-weight: 600; color: var(--signal-ink); background: var(--signal-soft); border-radius: var(--r-pill); padding: 1px 7px; cursor: help; white-space: nowrap; }
.ix1-dot-warn { background: var(--warn) !important; }
.ix1-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); justify-self: center; }
.ix1-arch { background: var(--surface-2); border-radius: var(--r-sm); padding: 14px; margin: 18px 0 14px; }
.ix1-arch label b { display: block; font-size: 14px; margin-bottom: 8px; }
.ix1-arch-f { display: flex; gap: 8px; }
.ix1-arch-f input { flex: 1; min-width: 0; font-size: 16px; }

.ix-more { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 20px; }

/* ---- итоги месяца ---- */
.ix-mo-top { display: flex; flex-direction: column; gap: 16px; }
.ix-mo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ix-mo-grid > div { background: var(--surface-2); border-radius: var(--r-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ix-mo-grid small { color: var(--muted); font-size: 12.5px; }
.ix-mo-grid b { font: 600 20px var(--mono); }
.ix-mo-grid b em { font: 500 12.5px var(--font); color: var(--muted); font-style: normal; }
.ix-mo-grid span.muted { font-size: 12.5px; }
.ix-mo-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ix-mo-note { color: var(--muted); font-size: 13.5px; margin-top: 16px; max-width: 80ch; }

/* ---- страница группы: история и месяцы ---- */
.ix-hist .ix1-ctl { margin-bottom: 4px; }
.ix-months-b { display: flex; flex-direction: column; gap: 6px; }
.ix-months-y { display: grid; grid-template-columns: 48px 1fr; gap: 10px; align-items: baseline; }
.ix-months-y b { font: 600 14px var(--mono); color: var(--muted); }
.ix-months-y span { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.ix-months-y a { font-size: 14px; }

@media (max-width: 1180px) {
  .ix1-top { grid-template-columns: 1fr; }
  .ix1-side { display: grid; grid-template-columns: 1fr; }
  .ix1-tr { grid-template-columns: minmax(180px, 1.6fr) 1fr 1.1fr .7fr .7fr 110px; }
  .ix1-tr > :nth-child(7) { display: none; }
  .ix1-updw { grid-template-columns: 1fr; }
  .ix1-pos-h, .ix1-pos-r { grid-template-columns: minmax(200px, 1.5fr) 100px 120px 70px minmax(150px, 1fr); }
}
@media (max-width: 720px) {
  .ix1-chgs { grid-template-columns: repeat(2, 1fr); }
  .ix-seg a, .ix-seg span.off { padding: 7px 10px; font-size: 13px; }
  .ixc-plot { height: 210px; margin-left: 40px; }
  .ixc-y span { left: -40px; width: 34px; }
  .ixc-x { margin-left: 40px; }
  .ixc-x .ixc-k1, .ixc-x .ixc-k2, .ixc-x .ixc-k4, .ixc-x .ixc-k5 { display: none; }
  .ix1-tbl { padding: 4px; }
  .ix1-th { display: none; }
  .ix1-tr { grid-template-columns: 1fr auto; grid-template-areas: "g p" "s c"; row-gap: 6px; padding: 12px; }
  .ix1-tr > :nth-child(1) { grid-area: g; }
  .ix1-tr > :nth-child(2) { grid-area: p; }
  .ix1-tr > :nth-child(3), .ix1-tr > :nth-child(4), .ix1-tr > :nth-child(7) { display: none; }
  .ix1-tr > :nth-child(5) { grid-area: c; text-align: right; }
  .ix1-tr > :nth-child(6) { grid-area: s; }
  .ix1-sub { display: block; }
  .ix1-g small { display: none; }
  .ix1-yl { display: inline !important; font: 500 12px var(--font); color: var(--muted); margin-left: 4px; }
  .ix1-pan { padding: 0 8px 12px; gap: 12px; }
  .ix1-grp[open] { margin: 4px -2px; }
  .ix1-pan-ctl { gap: 10px; }
  .ix1-f, .ix1-f .ix-seg { width: 100%; }
  .ix1-f .ix-seg a, .ix1-f .ix-seg span.off { flex: 1 1 0; text-align: center; }
  .ix1-mx-h, .ix1-mx-r { grid-template-columns: minmax(0, 1.15fr) repeat(var(--n), minmax(0, 1fr)); }
  .ix1-mx-h span { padding: 8px 6px; font-size: 11.5px; }
  .ix1-mx-n { padding: 9px 8px; font-size: 12.5px; white-space: normal; flex-direction: column; align-items: flex-start; gap: 0; }
  .ix1-mx-n b { font-size: 11.5px; color: var(--muted); font-weight: 600; }
  .ix1-mx-c { padding: 8px 6px; }
  .ix1-mx-c b { font-size: 13px; }
  .ix1-mx-c small { flex-direction: column; align-items: flex-end; gap: 2px; }
  .ix1-mx-c .ix-chg { font-size: 11px; }
  .ix1-own-r { grid-template-columns: minmax(0, 1fr) auto auto; row-gap: 2px; }
  .ix1-own-v, .ix1-own-r .ix-conf { display: none; }
  .ix1-pos-h { display: none; }
  .ix1-pos-r, .ix1-pos-x { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .ix1-pos-n, .ix1-pos-b, .ix1-pos-none { grid-column: 1 / -1; }
  .ix1-pos-r .ix1-r { text-align: left; }
  .ix1-buy-r { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .ix1-buy-n { grid-column: 1 / -1; }
  .ix1-buy-v { display: none; }
  .ix1-buy-d { grid-column: 2; grid-row: 3; }
  .ix1-buy-g { grid-row: 3; }
  .ix1-buy-p { grid-row: 2; grid-column: 1 / -1; text-align: left; }
  .ix1-grp .ix1-tr.ix1-trb { padding: 12px; }
  .ix-mo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ix-mo-grid b { font-size: 17px; }
}
