.vcst {
  --vcst-main: #331a6c;
  --vcst-accent: #ab79e5;
  --vcst-now: #6c3fc0;
  --vcst-ink: currentColor;
  --vcst-line: rgba(127, 127, 127, .35);
  --vcst-soft: rgba(127, 127, 127, .07);
  --vcst-paper: rgba(70, 100, 160, .16);
  --vcst-cell: 28px;
  margin: 0 0 2em;
  line-height: 1.5;
  font-size: 16px;
}
.vcst *, .vcst *::before, .vcst *::after { box-sizing: border-box; }
.vcst [hidden] { display: none !important; }
.vcst p { margin: 0; }

/* ---------- Форма ---------- */
.vcst .vcst-lead { margin: 0 0 1.25em; }
.vcst .vcst-ops, .vcst .vcst-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.vcst .vcst-ops { margin-bottom: 18px; }
.vcst .vcst-chip { position: relative; margin: 0; cursor: pointer; }
.vcst .vcst-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.vcst .vcst-chip span {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--vcst-line);
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  transition: background-color .15s, color .15s, border-color .15s;
}
.vcst .vcst-chip:hover span { border-color: var(--vcst-accent); }
.vcst .vcst-chip input:checked + span { background: var(--vcst-main); border-color: var(--vcst-main); color: #fff; }
.vcst .vcst-chip input:focus-visible + span { outline: 2px solid var(--vcst-accent); outline-offset: 2px; }

.vcst .vcst-nums { display: flex; align-items: flex-end; gap: 10px; margin: 0 0 16px; }
.vcst .vcst-num { flex: 1 1 0; min-width: 0; margin: 0; }
.vcst .vcst-label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.vcst .vcst-input {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--vcst-line);
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  box-shadow: none;
}
.vcst .vcst-input:focus { outline: 2px solid var(--vcst-accent); outline-offset: 1px; border-color: var(--vcst-accent); }
.vcst .vcst-sign {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  min-height: 48px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}
.vcst .vcst-opts { display: flex; flex-wrap: wrap; gap: 14px 28px; margin: 0 0 18px; }
.vcst .vcst-opt { margin: 0; padding: 0; border: 0; min-width: 0; }
.vcst .vcst-opt legend { margin: 0 0 6px; padding: 0; font-size: 14px; font-weight: 600; }

.vcst .vcst-btn {
  display: inline-flex;
  height: auto;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 44px;
  margin: 0;
  padding: 8px 18px;
  border: 1px solid var(--vcst-main);
  border-radius: 4px;
  background: var(--vcst-main);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  text-transform: none;
  letter-spacing: normal;
}
.vcst .vcst-btn:hover { background: #4a2a8f; border-color: #4a2a8f; color: #fff; }
.vcst .vcst-btn:focus-visible { outline: 2px solid var(--vcst-accent); outline-offset: 2px; }
.vcst .vcst-btn[disabled] { opacity: .4; cursor: default; }
.vcst .vcst-btn-line { background: transparent; color: inherit; border-color: var(--vcst-line); }
.vcst .vcst-btn-line:hover { background: var(--vcst-soft); color: inherit; border-color: var(--vcst-accent); }

.vcst .vcst-err { margin: 0 0 14px; padding: 10px 14px; border-left: 4px solid #c0392b; background: rgba(192, 57, 43, .08); font-size: 15px; }

/* ---------- Результат ---------- */
.vcst .vcst-res { margin: 0 0 16px; padding: 14px 18px; border-left: 5px solid var(--vcst-main); background: var(--vcst-soft); }
.vcst .vcst-res:empty { display: none; }
.vcst .vcst-res-main { font-size: 24px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; word-break: break-word; }
.vcst .vcst-res-sub { margin-top: 4px; font-size: 15px; }
.vcst .vcst-res-note { margin-top: 8px; font-size: 14px; opacity: .8; }

.vcst .vcst-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; }
.vcst .vcst-count { font-size: 15px; font-weight: 600; min-width: 90px; text-align: center; }

.vcst .vcst-body { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: flex-start; }
.vcst .vcst-paperbox { flex: 0 1 auto; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.vcst .vcst-steps { flex: 1 1 280px; min-width: 0; margin: 0; padding: 0 0 0 1.4em; font-size: 15px; }
.vcst .vcst-steps:empty { display: none; }
.vcst .vcst-steps li { margin: 0 0 10px; padding: 0; }
.vcst .vcst-steps li.is-now { font-weight: 600; }
.vcst .vcst-steps li.is-now::marker { color: var(--vcst-now); }

/* ---------- Зошит ---------- */
.vcst .vcst-paper {
  display: inline-block;
  padding: var(--vcst-cell);
  background-color: transparent;
  background-image:
    linear-gradient(to right, var(--vcst-paper) 1px, transparent 1px),
    linear-gradient(to bottom, var(--vcst-paper) 1px, transparent 1px);
  background-size: var(--vcst-cell) var(--vcst-cell);
  background-position: -1px -1px;
  border: 1px solid var(--vcst-line);
}
.vcst .vcst-paper:empty { display: none; }
.vcst .vcst-grid { display: grid; }
.vcst .vcst-c {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--vcst-cell);
  height: var(--vcst-cell);
  font-size: calc(var(--vcst-cell) * .64);
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.vcst .vcst-c.vcst-ub { box-shadow: inset 0 -2px 0 var(--vcst-ink); }
.vcst .vcst-c.vcst-vr { box-shadow: inset -2px 0 0 var(--vcst-ink); }
.vcst .vcst-c.is-nol { box-shadow: none; }
.vcst .vcst-c.is-h, .vcst .vcst-cm.is-h { visibility: hidden; }
.vcst .vcst-c.vcst-q { color: var(--vcst-now); font-weight: 700; }
.vcst .vcst-c.vcst-add { opacity: .55; }
.vcst .vcst-c.vcst-rm, .vcst .vcst-c.vcst-rs { font-weight: 700; }
.vcst .vcst-c.vcst-mn { transform: translateY(50%); font-weight: 700; font-size: calc(var(--vcst-cell) * .8); }
.vcst .vcst-c.vcst-sgu { transform: translateY(-50%); font-weight: 700; font-size: calc(var(--vcst-cell) * .7); }
.vcst .vcst-c.is-now { color: var(--vcst-now); font-weight: 800; }
.vcst .vcst-cm { position: absolute; right: -2px; bottom: 1px; font-style: normal; font-weight: 700; line-height: 1; }

/* ---------- Мобільний рядок з відповіддю ---------- */
.vcst .vcst-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  border: 0;
  border-radius: 0;
  background: var(--vcst-main);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
  height: auto;
  cursor: pointer;
  box-shadow: 0 -4px 14px rgba(0, 0, 0, .18);
}
@media (min-width: 768px) { .vcst .vcst-sticky { display: none !important; } }

@media (max-width: 767px) {
  .vcst { --vcst-cell: 25px; }
  .vcst .vcst-res-main { font-size: 21px; }
  .vcst .vcst-chip span { padding: 8px 12px; }
  .vcst .vcst-opts { gap: 14px; }
  .vcst .vcst-opt-rand .vcst-label { display: none; }
}

/* ---------- Віджет у сайдбарі ---------- */
.vcst.vcst-mini { --vcst-cell: 22px; margin: 0 0 30px; font-size: 15px; }
.vcst-mini .vcst-mini-h {
  margin: 0 0 14px;
  padding: 13px 18px;
  background: #0f0f0f;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.3;
  text-transform: uppercase;
}
.vcst-mini .vcst-ops { margin-bottom: 12px; gap: 6px; }
.vcst-mini .vcst-ops .vcst-chip { flex: 1 1 0; }
.vcst-mini .vcst-chip span { font-size: 14px; padding: 8px 10px; }
.vcst-mini .vcst-label { font-size: 13px; }
.vcst-mini .vcst-nums { margin-bottom: 12px; gap: 6px; }
.vcst-mini .vcst-input { font-size: 18px; min-height: 46px; padding: 6px 10px; }
.vcst-mini .vcst-sign { width: 16px; min-height: 46px; font-size: 22px; }
.vcst-mini .vcst-res { margin: 0 0 12px; padding: 10px 14px; border-left-width: 4px; }
.vcst-mini .vcst-res-main { font-size: 19px; }
.vcst-mini .vcst-paperbox { margin: 0 0 14px; }
.vcst-mini .vcst-btn { width: 100%; }

/* ---------- Темна тема сайту ---------- */
.s-dark .vcst, .site-s-dark .vcst { --vcst-now: #c9a6f5; --vcst-paper: rgba(170, 190, 230, .14); --vcst-soft: rgba(255, 255, 255, .05); }
.s-dark .vcst-mini .vcst-mini-h, .site-s-dark .vcst-mini .vcst-mini-h { background: #000; }
.s-dark .vcst .vcst-chip input:checked + span, .site-s-dark .vcst .vcst-chip input:checked + span { background: #5b37a3; border-color: #5b37a3; }

/* ---------- Розгорнуті запитання ---------- */
.vcst-faq { margin: 0 0 10px; border: 1px solid rgba(127, 127, 127, .3); border-radius: 4px; }
.vcst-faq summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 44px 12px 16px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
}
.vcst-faq summary::-webkit-details-marker { display: none; }
.vcst-faq summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  color: #331a6c;
}
.s-dark .vcst-faq summary::after, .site-s-dark .vcst-faq summary::after { color: #c9a6f5; }
.vcst-faq[open] summary::after { content: "−"; }
.vcst-faq summary:focus-visible { outline: 2px solid #ab79e5; outline-offset: 2px; }
.vcst-faq .vcst-faq-a { padding: 0 16px 14px; }
.vcst-faq .vcst-faq-a > *:last-child { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  .vcst *, .vcst-faq * { transition: none !important; }
}
