/* Single-page tariff calculator */

.tariff-builder [hidden] {
  display: none !important;
}

body.template-tariff-builder {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  color: #1a1a1a;
  min-height: 100vh;
  position: relative;
}

body.template-tariff-builder::before {
  display: none !important;
}

body.template-tariff-builder::after {
  content: "";
  position: fixed;
  inset: 0;
  background: #ffffff;
  pointer-events: none;
  z-index: -2;
}

body.template-tariff-builder .site-header {
  position: static;
}

body.template-tariff-builder .tariff-builder {
  --tb-surface: rgba(15, 23, 42, 0.04);
  --tb-surface-strong: rgba(15, 23, 42, 0.08);
  --tb-border: rgba(15, 23, 42, 0.12);
  --tb-border-strong: rgba(15, 23, 42, 0.2);
  --tb-accent: #2563eb;
  --tb-accent-2: #1d4ed8;
  --tb-text: #0f172a;
  --tb-muted: rgba(15, 23, 42, 0.68);
  --tb-slider-track-bg: rgba(15, 23, 42, 0.12);
  --tb-slider-thumb-bg: #ffffff;
  --tb-card: #ffffff;
  --tb-summary-bg: rgba(255, 255, 255, 0.92);
  font-family: var(--font-family-base);
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  padding: 28px 0 120px;
}

body.template-tariff-builder.theme-dark {
  color: #f5f6ff;
}

body.template-tariff-builder.theme-dark::after {
  background:
    linear-gradient(135deg, #01030b 0%, #050714 35%, #080d2a 50%, #050714 75%, #01030b 100%);
}

body.template-tariff-builder.theme-dark .tariff-builder {
  --tb-surface: rgba(255, 255, 255, 0.04);
  --tb-surface-strong: rgba(255, 255, 255, 0.08);
  --tb-border: rgba(255, 255, 255, 0.12);
  --tb-border-strong: rgba(255, 255, 255, 0.22);
  --tb-accent: #60a5fa;
  --tb-accent-2: #93c5fd;
  --tb-text: #f5f6ff;
  --tb-muted: rgba(226, 232, 240, 0.72);
  --tb-slider-track-bg: rgba(255, 255, 255, 0.18);
  --tb-slider-thumb-bg: #f8faff;
  --tb-card: rgba(15, 23, 42, 0.72);
  --tb-summary-bg: rgba(8, 12, 28, 0.88);
}

/* Layout */
.tb-calc {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

@media (min-width: 1100px) {
  body.template-tariff-builder .tb-calc.container {
    max-width: min(1440px, calc(100% - 48px));
  }

  .tb-calc {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
    gap: 40px;
  }
}

.tb-calc__main {
  display: grid;
  gap: 28px;
  min-width: 0;
}

.tb-module {
  border: 1px solid var(--tb-border);
  border-radius: 24px;
  background: var(--tb-card);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
  padding: 28px 24px;
}

@media (min-width: 768px) {
  .tb-module {
    padding: 36px 32px;
  }
}

body.theme-dark .tb-module,
body.template-tariff-builder.theme-dark .tb-module {
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}

.tb-module__header {
  margin-bottom: 24px;
}

.tb-module__header--plain {
  margin-bottom: 20px;
}

.tb-module__eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tb-accent);
}

.tb-module__title {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--tb-text);
  font-weight: 400;
}

.tb-module__header--plain .tb-module__title {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.tb-module__subtitle,
.tb-module__subtitle p {
  margin: 0;
  color: var(--tb-muted);
  font-size: 16px;
  line-height: 1.55;
  max-width: 48rem;
}

/* Buttons */
.btn-builder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn-builder:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-builder-primary {
  background: linear-gradient(135deg, #1e40af, #2563eb 50%, #3b82f6);
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.btn-builder-primary:hover:not(:disabled) {
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.36);
}

.btn-builder-secondary {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.22);
  color: var(--tb-text);
}

/* Internet filters */
.tb-stage__flow {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
  margin-bottom: 20px;
}

.tb-stage__selector-track {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  flex: 1 1 auto;
}

.tb-flow-group__label {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tb-muted);
}

.tb-tech-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tb-tech-switch__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--tb-border);
  background: var(--tb-surface);
  color: var(--tb-text);
  text-decoration: none;
}

.tb-tech-switch__item.is-active,
.tb-tech-switch__item[aria-current="page"] {
  border-color: rgba(37, 99, 235, 0.4);
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

body.template-tariff-builder.theme-dark .tb-tech-switch__item.is-active,
body.template-tariff-builder.theme-dark .tb-tech-switch__item[aria-current="page"] {
  color: #dbeafe;
  background: rgba(37, 99, 235, 0.28);
}

.tb-tech-single__value {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  color: var(--tb-text);
}

.tb-traffic-filter {
  margin-left: auto;
}

.tb-traffic-filter__control {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--tb-border);
  background: var(--tb-surface);
}

.tb-traffic-filter__title {
  font-size: 14px;
  color: var(--tb-text);
}

.tb-traffic-filter__toggle {
  display: inline-flex;
  cursor: pointer;
}

.tb-traffic-filter__checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tb-traffic-filter__switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.45);
}

.tb-traffic-filter__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.tb-traffic-filter__checkbox:checked + .tb-traffic-filter__switch {
  background: rgba(37, 99, 235, 0.7);
}

.tb-traffic-filter__checkbox:checked + .tb-traffic-filter__switch .tb-traffic-filter__thumb {
  transform: translateX(18px);
}

/* Internet grid */
.tb-stage__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

@media (min-width: 900px) {
  .tb-stage__grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 24px;
  }
}

.tb-controller,
.tb-panel {
  position: relative;
  border-radius: 20px;
  border: 1px solid var(--tb-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.86));
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
  padding: 24px;
  min-height: 100%;
}

body.template-tariff-builder.theme-dark .tb-controller,
body.template-tariff-builder.theme-dark .tb-panel {
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.86));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.tb-controller__meter {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.tb-controller__speed {
  display: inline-flex;
  align-items: flex-end;
  gap: 8px;
}

.tb-controller__value {
  font-size: clamp(2.6rem, 7vw, 3.8rem);
  line-height: 1;
  color: var(--tb-accent);
}

.tb-controller__unit {
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tb-muted);
}

.tb-controller__name-wrap {
  max-width: 55%;
  text-align: right;
}

.tb-controller__name {
  display: block;
  font-size: 18px;
  color: var(--tb-text);
}

.tb-controller__control {
  display: grid;
  gap: 0;
  border: 1px solid var(--tb-border);
  border-radius: 16px;
  background: var(--tb-surface);
  overflow: hidden;
}

.tb-controller__range {
  position: relative;
  --tb-range-track-height: 8px;
  --tb-range-thumb-size: 22px;
  padding: 18px 16px 10px;
}

.tb-controller__range input[type="range"] {
  width: 100%;
  display: block;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  z-index: 2;
  height: var(--tb-range-thumb-size);
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.tb-controller__range input[type="range"]::-webkit-slider-runnable-track,
.tb-controller__range input[type="range"]::-moz-range-track {
  height: var(--tb-range-track-height);
  border-radius: 999px;
  background: transparent;
}

.tb-controller__range input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: var(--tb-range-thumb-size);
  height: var(--tb-range-thumb-size);
  margin-top: calc((var(--tb-range-track-height) - var(--tb-range-thumb-size)) / 2);
  border-radius: 50%;
  background: var(--tb-slider-thumb-bg);
  border: 3px solid #2563eb;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.tb-controller__range input[type="range"]::-moz-range-thumb {
  width: var(--tb-range-thumb-size);
  height: var(--tb-range-thumb-size);
  border-radius: 50%;
  border: 3px solid #2563eb;
  background: var(--tb-slider-thumb-bg);
}

.tb-controller__progress {
  position: absolute;
  left: 16px;
  right: 16px;
  top: calc(18px + var(--tb-range-thumb-size) / 2);
  height: var(--tb-range-track-height);
  transform: translateY(-50%);
  border-radius: 999px;
  background: var(--tb-slider-track-bg);
  pointer-events: none;
  z-index: 1;
}

.tb-controller__progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1d4ed8, #3b82f6);
  width: calc((100% - var(--tb-range-thumb-size)) * var(--progress-ratio, 1) + (var(--tb-range-thumb-size) / 2));
  min-width: calc(var(--tb-range-thumb-size) / 2);
  max-width: calc(100% - (var(--tb-range-thumb-size) / 2));
}

.tb-controller__ticks {
  display: grid;
  grid-template-columns: repeat(var(--tb-tick-count, auto-fit), minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--tb-border);
  background: rgba(255, 255, 255, 0.35);
}

body.template-tariff-builder.theme-dark .tb-controller__ticks {
  background: rgba(15, 23, 42, 0.28);
}

.tb-controller__ticks button {
  width: 100%;
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--tb-border);
  border-radius: 0;
  padding: 12px 8px;
  background: transparent;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  cursor: pointer;
  font: inherit;
  text-align: center;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tb-controller__ticks button:last-child {
  border-right: 0;
}

.tb-controller__ticks button .speed {
  font-size: 15px;
  line-height: 1.1;
  color: var(--tb-text);
}

.tb-controller__ticks button small {
  color: var(--tb-muted);
  font-size: 11px;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tb-controller__ticks button.is-active,
.tb-controller__ticks button:hover,
.tb-controller__ticks button:focus-visible {
  background: rgba(37, 99, 235, 0.12);
  box-shadow: none;
}

.tb-controller__ticks button.is-active .speed {
  color: #1d4ed8;
}

body.template-tariff-builder.theme-dark .tb-controller__ticks button.is-active .speed {
  color: #93c5fd;
}

.tb-upsell {
  width: 100%;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px dashed rgba(37, 99, 235, 0.45);
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--tb-text);
  display: grid;
  gap: 4px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.tb-upsell[hidden] {
  display: none !important;
}

.tb-upsell__lead {
  color: #2563eb;
}

body.template-tariff-builder.theme-dark .tb-upsell__lead {
  color: #93c5fd;
}

.tb-panel__badge {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tb-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.tb-panel__eyebrow {
  margin: 0 0 6px;
  color: var(--tb-muted);
  font-size: 13px;
}

.tb-panel__title {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  color: var(--tb-text);
  font-weight: 400;
}

.tb-panel__price {
  text-align: right;
  white-space: nowrap;
}

.tb-panel__price-value {
  display: block;
  font-size: 28px;
  line-height: 1;
  color: var(--tb-text);
}

.tb-panel__price-unit {
  color: var(--tb-muted);
  font-size: 13px;
}

.tb-panel__tagline {
  margin: 0 0 10px;
  color: var(--tb-text);
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.35;
  letter-spacing: -0.01em;
  font-weight: 500;
}

.tb-panel__description {
  margin: 0 0 14px;
  color: var(--tb-muted);
  font-size: 14px;
  line-height: 1.55;
  opacity: 0.88;
}

.tb-panel__description p {
  margin: 0 0 0.55em;
}

.tb-panel__description p:last-child {
  margin-bottom: 0;
}

.tb-panel__perks {
  margin: 0 0 18px;
  padding-left: 18px;
  color: var(--tb-text);
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.tb-panel__footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tb-panel__footer-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--tb-surface);
  border: 1px solid transparent;
}

.tb-panel__footer-item span {
  color: var(--tb-muted);
  font-size: 12px;
}

.tb-panel__footer-item strong {
  color: var(--tb-text);
  font-weight: 400;
  font-size: 14px;
}

.tb-empty-state {
  display: grid;
  gap: 8px;
  padding: 24px;
  border-radius: 16px;
  border: 1px dashed var(--tb-border);
}

.tb-empty-state__title {
  margin: 0;
  color: var(--tb-text);
  font-weight: 400;
}

.tb-empty-state__text {
  margin: 0;
  color: var(--tb-muted);
}

/* Provider groups */
.tb-provider-groups {
  display: grid;
  gap: 28px;
}

.tb-provider-group__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  min-height: 44px;
}

.tb-provider-group__logo {
  display: block;
  max-width: 168px;
  max-height: 44px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.tb-provider-group__name {
  margin: 0;
  color: var(--tb-text);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Option tiles — marketplace showcase */
.tb-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.tb-options--tiles {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.tb-provider-groups--antivirus {
  gap: 32px;
}

.tb-provider-group--antivirus .tb-provider-group__header {
  margin-bottom: 16px;
}

.tb-options--antivirus {
  display: grid;
  grid-template-columns: repeat(var(--tb-av-cols, 1), minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
  padding-top: 14px;
}

.tb-options--antivirus > .tb-option {
  display: flex;
  min-width: 0;
  height: 100%;
}

.tb-options--antivirus .tb-option__card {
  position: relative;
  overflow: visible;
  flex: 1 1 auto;
  width: 100%;
  min-height: 340px;
  padding-top: 22px;
}

.tb-options--antivirus .tb-option__title {
  margin: 0;
}

.tb-options--antivirus .tb-option__subtitle {
  margin: -2px 0 2px;
}

.tb-options--antivirus .tb-option__price-tag {
  margin: 0;
}

@media (max-width: 900px) {
  .tb-options--antivirus {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (max-width: 640px) {
  .tb-options--antivirus {
    grid-template-columns: minmax(0, 1fr);
  }
}

.tb-options--single {
  grid-template-columns: minmax(0, 420px);
}

.tb-option {
  display: block;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tb-option__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tb-option__card {
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  min-height: 100%;
  padding: 20px 18px 16px;
  border-radius: 20px;
  border: 2px solid rgba(15, 23, 42, 0.06);
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
  transition:
    border-color 0.28s ease,
    box-shadow 0.28s ease,
    background-color 0.28s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.tb-option--product .tb-option__card {
  padding-top: 22px;
}

body.template-tariff-builder.theme-dark .tb-option__card {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(255, 255, 255, 0.08);
}

.tb-option:hover .tb-option__card {
  border-color: rgba(37, 99, 235, 0.35);
  background: #fff;
  transform: translateY(-6px);
  box-shadow:
    0 22px 44px rgba(37, 99, 235, 0.14),
    0 8px 18px rgba(15, 23, 42, 0.06);
}

body.template-tariff-builder.theme-dark .tb-option:hover .tb-option__card {
  background: rgba(30, 41, 59, 0.92);
}

.tb-option:focus-within .tb-option__card {
  outline: 2px solid rgba(37, 99, 235, 0.28);
  outline-offset: 3px;
}

.tb-option.is-selected .tb-option__card,
.tb-option__input:checked + .tb-option__card {
  border-color: #2563eb;
  border-width: 2.5px;
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(37, 99, 235, 0.18),
    0 20px 42px rgba(37, 99, 235, 0.2);
  transform: translateY(-3px);
}

body.template-tariff-builder.theme-dark .tb-option.is-selected .tb-option__card,
body.template-tariff-builder.theme-dark .tb-option__input:checked + .tb-option__card {
  background: rgba(15, 23, 42, 0.94);
  border-color: #60a5fa;
  box-shadow:
    0 0 0 4px rgba(96, 165, 250, 0.22),
    0 22px 48px rgba(37, 99, 235, 0.28);
}

.tb-option__badge {
  position: absolute;
  top: -12px;
  left: 50%;
  z-index: 3;
  display: inline-flex;
  max-width: calc(100% - 32px);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  pointer-events: none;
}

.tb-option__check {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
  opacity: 0;
  transform: scale(0.55);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.tb-option__check svg {
  width: 16px;
  height: 16px;
}

.tb-option.is-selected .tb-option__check,
.tb-option__input:checked + .tb-option__card .tb-option__check {
  opacity: 1;
  transform: scale(1);
}

.tb-option__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.tb-option__meta {
  color: var(--tb-muted);
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}

.tb-option__plan {
  color: var(--tb-muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.tb-option__title {
  color: var(--tb-text);
  font-size: clamp(22px, 2.4vw, 26px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.tb-option__value-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
  margin-top: 2px;
}

.tb-option__metric {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.tb-option__metric-value {
  color: var(--tb-text);
  font-size: clamp(28px, 3.2vw, 34px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.tb-option__metric-label {
  color: var(--tb-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.tb-option__quality {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
}

.tb-option__quality-item {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 54px;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.05);
  color: var(--tb-text);
  line-height: 1.05;
}

.tb-option__quality-item strong {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tb-option__quality-item span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tb-muted);
}

.tb-option__quality-item--hd {
  background: rgba(37, 99, 235, 0.1);
}

.tb-option__quality-item--hd span {
  color: #1d4ed8;
}

.tb-option__quality-item--uhd {
  background: rgba(124, 58, 237, 0.1);
}

.tb-option__quality-item--uhd span {
  color: #6d28d9;
}

body.template-tariff-builder.theme-dark .tb-option__quality-item {
  background: rgba(255, 255, 255, 0.06);
}

body.template-tariff-builder.theme-dark .tb-option__quality-item--hd {
  background: rgba(96, 165, 250, 0.14);
}

body.template-tariff-builder.theme-dark .tb-option__quality-item--hd span {
  color: #93c5fd;
}

body.template-tariff-builder.theme-dark .tb-option__quality-item--uhd {
  background: rgba(167, 139, 250, 0.16);
}

body.template-tariff-builder.theme-dark .tb-option__quality-item--uhd span {
  color: #c4b5fd;
}

.tb-option__brands {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tb-option__brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 11px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--tb-text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

.tb-option__brand--start {
  background: linear-gradient(135deg, #6d28d9 0%, #a21caf 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(109, 40, 217, 0.28);
}

.tb-option__brand--wink {
  background: linear-gradient(135deg, #e11d48 0%, #fb7185 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(225, 29, 72, 0.28);
}

.tb-option__brand--premier {
  background: linear-gradient(135deg, #111827 0%, #374151 100%);
  color: #fbbf24;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.28);
}

.tb-option__vendor-logo {
  display: none;
}

.tb-option__checklist {
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}

.tb-option__checklist li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: var(--tb-text);
  font-size: 13px;
  line-height: 1.4;
}

.tb-option__checklist-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}

.tb-option__checklist-mark svg {
  width: 12px;
  height: 12px;
}

body.template-tariff-builder.theme-dark .tb-option__checklist-mark {
  background: rgba(52, 211, 153, 0.18);
  color: #34d399;
}

.tb-option__perks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tb-option__perk {
  display: inline-flex;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: var(--tb-text);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
}

body.template-tariff-builder.theme-dark .tb-option__perk {
  background: rgba(255, 255, 255, 0.07);
}

.tb-option__footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.tb-option__price-tag {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.tb-option__price-tag strong {
  color: var(--tb-text);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.tb-option__price-tag small {
  color: var(--tb-muted);
  font-size: 12px;
  font-weight: 500;
}

.tb-option--antivirus .tb-option__cta {
  margin-top: 0;
}

.tb-option__subtitle {
  margin: -2px 0 2px;
  color: var(--tb-muted);
  font-size: 13.5px;
  line-height: 1.4;
}

.tb-option__badge--hit {
  background: linear-gradient(135deg, #ea580c, #f59e0b);
  color: #fff;
  box-shadow: 0 8px 18px rgba(234, 88, 12, 0.28);
}

.tb-option--kis .tb-option__card,
.tb-option.is-featured .tb-option__card,
.tb-option--kav .tb-option__card,
.tb-option--kids .tb-option__card {
  padding-top: 22px;
}

.tb-option--kis .tb-option__card,
.tb-option.is-featured .tb-option__card {
  border-color: rgba(37, 99, 235, 0.45);
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.06), #fff 38%);
  box-shadow:
    0 0 0 1px rgba(37, 99, 235, 0.12),
    0 14px 32px rgba(37, 99, 235, 0.12);
}

.tb-option--kis .tb-option__cta,
.tb-option.is-featured .tb-option__cta {
  border-color: transparent;
  background: linear-gradient(135deg, #ea580c, #f59e0b);
  color: #fff;
  box-shadow: 0 12px 24px rgba(234, 88, 12, 0.3);
}

.tb-option--kis:hover .tb-option__cta,
.tb-option.is-featured:hover .tb-option__cta {
  background: linear-gradient(135deg, #c2410c, #ea580c 45%, #f59e0b);
  color: #fff;
  box-shadow: 0 14px 28px rgba(234, 88, 12, 0.36);
}

.tb-option--kis.is-selected .tb-option__cta,
.tb-option.is-featured.is-selected .tb-option__cta,
.tb-option--kis .tb-option__input:checked + .tb-option__card .tb-option__cta,
.tb-option.is-featured .tb-option__input:checked + .tb-option__card .tb-option__cta {
  background: linear-gradient(135deg, #1d4ed8, #2563eb 55%, #3b82f6);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.32);
}

.tb-option__checklist li.is-missing {
  opacity: 0.72;
}

.tb-option__checklist li.is-missing > span:last-child {
  color: var(--tb-muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.tb-option__checklist li.is-missing .tb-option__checklist-mark {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

body.template-tariff-builder.theme-dark .tb-option--kis .tb-option__card,
body.template-tariff-builder.theme-dark .tb-option.is-featured .tb-option__card {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.18), rgba(15, 23, 42, 0.92) 42%);
  border-color: rgba(96, 165, 250, 0.5);
}

body.template-tariff-builder.theme-dark .tb-option__checklist li.is-missing .tb-option__checklist-mark {
  background: rgba(248, 113, 113, 0.18);
  color: #f87171;
}

.tb-option__price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
  color: var(--tb-text);
}

.tb-option__price strong {
  font-size: clamp(24px, 2.4vw, 30px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.tb-option__price--secondary {
  margin-top: auto;
  padding-top: 6px;
}

.tb-option__price--secondary strong {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--tb-muted);
}

.tb-option__price small {
  color: var(--tb-muted);
  font-size: 12px;
  font-weight: 500;
}

.tb-option__price-ask,
.tb-option__price-request {
  display: inline-block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(15, 23, 42, 0.55);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

body.template-tariff-builder.theme-dark .tb-option__price-ask,
body.template-tariff-builder.theme-dark .tb-option__price-request {
  border: 0;
  background: transparent;
  color: rgba(226, 232, 240, 0.62);
}

.tb-option__details {
  margin-top: 2px;
}

.tb-option__details-toggle {
  list-style: none;
  cursor: pointer;
  width: fit-content;
  color: #2563eb;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  user-select: none;
}

.tb-option__details-toggle::-webkit-details-marker {
  display: none;
}

.tb-option__details-toggle::after {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  margin-left: 0.45em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
  transition: transform 0.2s ease;
}

.tb-option__details[open] .tb-option__details-toggle::after {
  transform: translateY(1px) rotate(225deg);
}

body.template-tariff-builder.theme-dark .tb-option__details-toggle {
  color: #93c5fd;
}

.tb-option__details-panel {
  margin-top: 8px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--tb-muted);
  font-size: 12.5px;
  line-height: 1.5;
  opacity: 0.92;
}

.tb-option__details-panel p {
  margin: 0 0 0.6em;
}

.tb-option__details-panel p:last-child {
  margin-bottom: 0;
}

.tb-option__features {
  margin: 0;
  padding-left: 16px;
  display: grid;
  gap: 3px;
  color: var(--tb-muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.tb-option__detail {
  display: inline-flex;
  margin-top: 8px;
  color: #2563eb;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

body.template-tariff-builder.theme-dark .tb-option__detail {
  color: #93c5fd;
}

.tb-option__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  min-height: 46px;
  padding: 11px 16px;
  border-radius: 14px;
  border: 1.5px solid rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: none;
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.tb-option:hover .tb-option__cta {
  border-color: rgba(37, 99, 235, 0.55);
  background: rgba(37, 99, 235, 0.14);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}

.tb-option--antivirus:not(.tb-option--kis):not(.is-featured) .tb-option__cta {
  border-color: rgba(37, 99, 235, 0.4);
  background: rgba(255, 255, 255, 0.72);
  color: #1d4ed8;
}

.tb-option--antivirus:not(.tb-option--kis):not(.is-featured):hover .tb-option__cta {
  background: rgba(37, 99, 235, 0.1);
}

.tb-option__cta-label[data-option-on] {
  display: none;
}

.tb-option.is-selected .tb-option__cta,
.tb-option__input:checked + .tb-option__card .tb-option__cta {
  border-color: transparent;
  background: linear-gradient(135deg, #1d4ed8, #2563eb 55%, #3b82f6);
  color: #fff;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.36);
  transform: none;
}

.tb-option.is-selected .tb-option__cta-label[data-option-off],
.tb-option__input:checked + .tb-option__card .tb-option__cta-label[data-option-off] {
  display: none;
}

.tb-option.is-selected .tb-option__cta-label[data-option-on],
.tb-option__input:checked + .tb-option__card .tb-option__cta-label[data-option-on] {
  display: inline;
}

body.template-tariff-builder.theme-dark .tb-option__cta {
  color: #eff6ff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(147, 197, 253, 0.55);
  box-shadow: none;
}

body.template-tariff-builder.theme-dark .tb-option:hover .tb-option__cta {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(191, 219, 254, 0.7);
}

body.template-tariff-builder.theme-dark .tb-option--antivirus:not(.tb-option--kis):not(.is-featured) .tb-option__cta {
  color: #eff6ff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(147, 197, 253, 0.55);
}

body.template-tariff-builder.theme-dark .tb-option--kis .tb-option__cta,
body.template-tariff-builder.theme-dark .tb-option.is-featured .tb-option__cta {
  border-color: transparent;
  background: linear-gradient(135deg, #ea580c, #f59e0b);
  color: #fff;
}

body.template-tariff-builder.theme-dark .tb-option.is-selected .tb-option__cta,
body.template-tariff-builder.theme-dark .tb-option__input:checked + .tb-option__card .tb-option__cta {
  background: #3b82f6;
  color: #fff;
  border-color: transparent;
}

/* Compact phone picker — whole module as one control */
.tb-module--phone {
  padding: 0;
  overflow: hidden;
  transition:
    border-color 0.28s ease,
    box-shadow 0.28s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.tb-module--phone:has(.tb-phone-pick.is-selected),
.tb-module--phone:has(.tb-option__input:checked) {
  border-color: #2563eb;
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.16),
    0 18px 40px rgba(37, 99, 235, 0.16);
}

.tb-phone-pick {
  display: block;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tb-phone-pick__surface {
  display: grid;
  gap: 20px;
  padding: 28px 24px;
}

@media (min-width: 768px) {
  .tb-phone-pick__surface {
    padding: 36px 32px;
  }
}

.tb-phone-pick__intro .tb-module__header,
.tb-phone-pick__intro .tb-module__title {
  margin-bottom: 0;
}

.tb-phone-pick__intro .tb-module__title {
  margin-bottom: 10px;
}

.tb-phone-pick__offer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 4px;
}

.tb-phone-pick__copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.tb-phone-pick__intro .tb-module__title {
  margin: 0;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.tb-phone-pick__name {
  color: var(--tb-muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.tb-phone-pick__value {
  color: var(--tb-text);
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.tb-phone-pick__price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--tb-muted);
}

.tb-phone-pick__price strong {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1;
}

.tb-phone-pick__price small {
  color: var(--tb-muted);
  font-size: 12px;
}

.tb-phone-pick__control {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.tb-phone-pick__state {
  font-size: 14px;
  font-weight: 600;
  color: #1d4ed8;
}

.tb-phone-pick__state[data-option-on] {
  display: none;
}

.tb-phone-pick.is-selected .tb-phone-pick__state[data-option-off],
.tb-phone-pick:has(.tb-option__input:checked) .tb-phone-pick__state[data-option-off] {
  display: none;
}

.tb-phone-pick.is-selected .tb-phone-pick__state[data-option-on],
.tb-phone-pick:has(.tb-option__input:checked) .tb-phone-pick__state[data-option-on] {
  display: inline;
  color: #2563eb;
}

.tb-phone-pick__switch {
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.4);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.tb-phone-pick__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
  transition: transform 0.25s ease;
}

.tb-phone-pick.is-selected .tb-phone-pick__switch,
.tb-phone-pick:has(.tb-option__input:checked) .tb-phone-pick__switch {
  background: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.tb-phone-pick.is-selected .tb-phone-pick__thumb,
.tb-phone-pick:has(.tb-option__input:checked) .tb-phone-pick__thumb {
  transform: translateX(22px);
}

body.template-tariff-builder.theme-dark .tb-module--phone:has(.tb-phone-pick.is-selected),
body.template-tariff-builder.theme-dark .tb-module--phone:has(.tb-option__input:checked) {
  border-color: #60a5fa;
  box-shadow:
    0 0 0 3px rgba(96, 165, 250, 0.2),
    0 20px 44px rgba(37, 99, 235, 0.24);
}

body.template-tariff-builder.theme-dark .tb-phone-pick__state {
  color: #93c5fd;
}

/* Sticky summary */
.tb-summary {
  display: none;
}

@media (min-width: 1100px) {
  .tb-summary {
    display: block;
    position: sticky;
    top: 24px;
    align-self: start;
    width: 100%;
    z-index: 5;
  }
}

.tb-summary__inner {
  border: 1px solid var(--tb-border);
  border-radius: 24px;
  background: var(--tb-summary-bg);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  padding: 22px;
  display: grid;
  gap: 18px;
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.tb-summary__title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 400;
  color: var(--tb-text);
}

.tb-summary__hint,
.tb-summary__note,
.tb-summary__empty p {
  margin: 0;
  color: var(--tb-muted);
  font-size: 13px;
  line-height: 1.45;
}

.tb-summary__list {
  display: grid;
  gap: 12px;
  min-height: 72px;
}

.tb-summary__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--tb-border);
}

.tb-summary__row-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.tb-summary__row-label {
  color: var(--tb-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tb-summary__row-title {
  color: var(--tb-text);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.3;
}

.tb-summary__row-meta {
  color: var(--tb-muted);
  font-size: 12px;
}

.tb-summary__row-side {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.tb-summary__row-price {
  color: var(--tb-text);
  font-size: 14px;
  white-space: nowrap;
}

.tb-summary__remove {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 8px;
  background: var(--tb-surface-strong);
  color: var(--tb-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.tb-summary__footer {
  display: grid;
  gap: 12px;
}

.tb-summary__total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.tb-summary__total-label {
  color: var(--tb-muted);
  font-size: 14px;
}

.tb-summary__total-price {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--tb-text);
  font-size: 28px;
  line-height: 1;
}

.tb-summary__currency {
  font-size: 13px;
  color: var(--tb-muted);
}

.tb-summary__cta {
  width: 100%;
}

/* Mobile sticky bar */
.tb-summary-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--tb-border);
  background: var(--tb-summary-bg);
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
}

.tb-summary-bar__price {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.tb-summary-bar__label {
  color: var(--tb-muted);
  font-size: 12px;
}

.tb-summary-bar__price strong {
  color: var(--tb-text);
  font-size: 18px;
  font-weight: 400;
}

.tb-summary-bar__cta {
  flex: 0 0 auto;
  min-width: 148px;
}

@media (min-width: 1100px) {
  .tb-summary-bar {
    display: none;
  }

  body.template-tariff-builder .tariff-builder {
    padding-bottom: 48px;
  }
}

@media (max-width: 640px) {
  .tb-module {
    padding: 22px 16px;
    border-radius: 18px;
  }

  .tb-panel__footer {
    grid-template-columns: 1fr;
  }

  .tb-controller__range {
    padding: 16px 12px 8px;
  }

  .tb-controller__progress {
    left: 12px;
    right: 12px;
  }

  .tb-controller__ticks button {
    padding: 10px 4px;
  }

  .tb-controller__ticks button small {
    display: none;
  }

  .tb-options--tiles {
    grid-template-columns: minmax(0, 1fr);
  }

  .tb-options--single {
    grid-template-columns: minmax(0, 1fr);
  }

  .tb-phone-pick__offer {
    flex-direction: column;
    align-items: flex-start;
  }

  .tb-phone-pick__control {
    width: 100%;
    justify-content: space-between;
  }

  .tb-traffic-filter {
    margin-left: 0;
    width: 100%;
  }

  .tb-traffic-filter__control {
    width: 100%;
    justify-content: space-between;
  }
}
