:root {
  --gsg-tv-primary: #2f5fd7;
  --gsg-tv-primary-dark: #1e3a8a;
  --gsg-tv-primary-soft: #eef2ff;
  --gsg-tv-gold: #e7c74d;
  --gsg-tv-bg: #f7faff;
  --gsg-tv-surface: #ffffff;
  --gsg-tv-text: #0f172a;
  --gsg-tv-muted: #475569;
  --gsg-tv-border: #e6eaf2;
  --gsg-tv-shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
  --gsg-tv-shadow-soft: 0 2px 10px rgba(16, 24, 40, 0.06);
}

.gsg-tv-app,
.gsg-tv-app * {
  box-sizing: border-box;
}

.gsg-tv-app {
  color: var(--gsg-tv-text);
  font: 16px/1.55 "Segoe UI", Arial, sans-serif;
}

body.gsg-tv-template-page {
  margin: 0;
  background: #eef3fb;
}

.gsg-tv-template-shell {
  min-height: 100vh;
  padding: 0 0 40px;
}

.gsg-tv-hero {
  position: relative;
  overflow: hidden;
  padding: 34px 16px 18px;
  text-align: center;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.gsg-tv-hero__content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
}

.gsg-tv-kicker {
  margin: 0;
  color: #3558b7;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gsg-tv-headline {
  margin: 8px 0 10px;
  color: var(--gsg-tv-primary-dark);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  line-height: 1.15;
}

.gsg-tv-subtitle {
  margin: 0 0 18px;
  color: var(--gsg-tv-muted);
  font-size: clamp(14px, 2.2vw, 18px);
}

.gsg-tv-relief {
  margin: -6px 0 18px;
  color: #31456e;
  font-weight: 600;
}

.gsg-tv-hero__ornament {
  display: none;
}

.gsg-tv-card {
  background: var(--gsg-tv-surface);
  border: 1px solid var(--gsg-tv-border);
  border-radius: 18px;
  box-shadow: var(--gsg-tv-shadow);
}

.gsg-tv-form {
  max-width: 560px;
  margin: 18px auto 0;
  padding: 22px;
  border-radius: 20px;
}

.gsg-tv-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  margin-bottom: 16px;
}

.gsg-tv-field span {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.gsg-tv-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gsg-tv-border);
  border-radius: 12px;
  outline: none;
  box-shadow: none;
  background: #fbfdff;
}

.gsg-tv-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gsg-tv-border);
  border-radius: 12px;
  outline: none;
  box-shadow: none;
  background: #fbfdff;
}

.gsg-tv-field input:focus,
.gsg-tv-field select:focus {
  border-color: var(--gsg-tv-primary);
  box-shadow: 0 0 0 3px rgba(47, 95, 215, 0.18);
}

.gsg-tv-phone-inline {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.gsg-tv-phone-inline select {
  flex: 0 0 180px;
}

.gsg-tv-phone-inline input {
  flex: 1 1 auto;
}

.gsg-tv-field--wide {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .gsg-tv-phone-inline {
    flex-direction: column;
  }

  .gsg-tv-phone-inline select {
    flex-basis: auto;
  }
}

.gsg-tv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--gsg-tv-border);
  border-radius: 12px;
  background: #fff;
  color: var(--gsg-tv-text);
  text-decoration: none;
  cursor: pointer;
  transition: 0.2s transform ease, 0.2s box-shadow ease, 0.2s background ease;
  box-shadow: var(--gsg-tv-shadow-soft);
}

.gsg-tv-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.08);
}

.gsg-tv-btn--lg {
  padding: 14px 18px;
  margin-bottom: 5px;
  font-size: 1.05rem;
  font-weight: 700;
}

.gsg-tv-btn--primary {
  border-color: #2349b6;
  background: linear-gradient(135deg, var(--gsg-tv-primary), #2952c4);
  color: #fff;
}

.gsg-tv-btn--primary::after {
  width: 8px;
  height: 8px;
  content: "";
  border-radius: 2px;
  background: var(--gsg-tv-gold);
}

.gsg-tv-btn--secondary {
  border-color: #cbd4e6;
  color: var(--gsg-tv-primary-dark);
}

.gsg-tv-btn--ghost {
  border-color: #cfd9ee;
  background: #f4f7fe;
  color: #3d5aa2;
}

.gsg-tv-note,
.gsg-tv-muted {
  color: var(--gsg-tv-muted);
}

.gsg-tv-progress {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 100%);
  margin: 0 0 14px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(209, 220, 240, 0.9);
  border-left: 0;
  border-right: 0;
  border-top: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.gsg-tv-progress__bar {
  flex: 1;
  height: 10px;
  overflow: hidden;
  border: 1px solid #d9e0f4;
  border-radius: 999px;
  background: #eef2ff;
}

.gsg-tv-progress__value {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gsg-tv-primary), #63b3ed);
  transition: width 0.35s ease;
}

.gsg-tv-progress__label {
  min-width: 64px;
  color: #3e4b6d;
  font-weight: 700;
  text-align: right;
}

.gsg-tv-scale {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 10px auto 0;
  max-width: 860px;
}

.gsg-tv-scale span {
  padding: 5px 10px;
  border: 1px solid #d5e1ff;
  border-radius: 999px;
  background: #eaf0ff;
  color: #2d4281;
  font-size: 0.82rem;
  font-weight: 600;
}

.gsg-tv-quiz {
  display: grid;
  gap: 14px;
  width: min(100%, 860px);
  margin: 18px auto 0;
  padding: 0 16px;
}

.gsg-tv-testing-tools {
  display: flex;
  justify-content: flex-end;
}

.gsg-tv-question {
  padding: 20px 20px 16px;
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(24, 40, 72, 0.04);
}

.gsg-tv-question__title {
  margin: 0;
  color: #16233d;
  font-size: 1.08rem;
  font-weight: 700;
}

.gsg-tv-question__title span {
  margin-right: 6px;
  color: var(--gsg-tv-primary-dark);
}

.gsg-tv-question__scale {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.gsg-tv-question__legend {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 10px;
  color: #5e70a5;
  font-size: 0.86rem;
}

.gsg-tv-pill {
  min-width: 44px;
  padding: 10px 14px;
  border: 1px solid #d9e0f4;
  border-radius: 999px;
  background: var(--gsg-tv-primary-soft);
  color: #3b4780;
  cursor: pointer;
  transition: 0.2s all ease;
}

.gsg-tv-pill:hover {
  background: #e6ecff;
}

.gsg-tv-pill[aria-pressed="true"] {
  border-color: #2147b2;
  background: var(--gsg-tv-primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(47, 95, 215, 0.25);
}

.gsg-tv-question.is-answered {
  outline: 2px solid rgba(47, 95, 215, 0.18);
}

.gsg-tv-quiz__actions {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 12px 0 6px;
}

.gsg-tv-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.gsg-tv-modal[hidden] {
  display: none;
}

.gsg-tv-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.gsg-tv-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 41, 59, 0.52);
}

.gsg-tv-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 530px);
  padding: 40px 36px 38px;
  border: 0;
  border-radius: 34px;
  box-shadow: 0 28px 80px rgba(17, 24, 39, 0.18);
  text-align: center;
}

.gsg-tv-modal__icon {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  margin: 0 auto 22px;
  border-radius: 999px;
  background: #ff6781;
  color: #fff;
  font-size: 3.5rem;
  font-weight: 300;
  line-height: 1;
}

.gsg-tv-modal.is-success .gsg-tv-modal__icon {
  background: #26b36a;
}

.gsg-tv-modal.is-error .gsg-tv-modal__icon {
  background: #ff6781;
}

.gsg-tv-modal__dialog h2 {
  margin: 0 0 10px;
  color: #005f8f;
  font-size: clamp(28px, 3.6vw, 38px);
  line-height: 1.12;
}

.gsg-tv-modal.is-success .gsg-tv-modal__dialog h2 {
  color: #17834c;
}

.gsg-tv-modal.is-error .gsg-tv-modal__dialog h2 {
  color: #b23149;
}

.gsg-tv-modal__dialog .gsg-tv-muted {
  max-width: 420px;
  margin: 0 auto;
  color: #334155;
  font-size: 17px;
  line-height: 1.35;
}

.gsg-tv-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}

.gsg-tv-modal__dialog .gsg-tv-btn--primary {
  min-width: 172px;
  border-color: #ff6781;
  border-radius: 999px;
  background: #ff6781;
  box-shadow: none;
}

.gsg-tv-modal.is-success .gsg-tv-modal__dialog .gsg-tv-btn--primary {
  border-color: #26b36a;
  background: #26b36a;
}

.gsg-tv-modal.is-error .gsg-tv-modal__dialog .gsg-tv-btn--primary {
  border-color: #ff6781;
  background: #ff6781;
}

.gsg-tv-modal__dialog .gsg-tv-btn--primary::after {
  display: none;
}

.gsg-tv-modal__dialog .gsg-tv-btn--primary:hover {
  background: #f55774;
  box-shadow: 0 12px 24px rgba(255, 103, 129, 0.24);
}

.gsg-tv-modal.is-success .gsg-tv-modal__dialog .gsg-tv-btn--primary:hover {
  background: #21985a;
  box-shadow: 0 12px 24px rgba(38, 179, 106, 0.24);
}

.gsg-tv-modal.is-error .gsg-tv-modal__dialog .gsg-tv-btn--primary:hover {
  background: #f55774;
  box-shadow: 0 12px 24px rgba(255, 103, 129, 0.24);
}

.gsg-tv-footer {
  margin-top: 24px;
  color: #66748f;
  line-height: 1.2;
  text-align: center;
}

.gsg-tv-app:not(.quiz-started) .gsg-tv-progress,
.gsg-tv-app:not(.quiz-started) .gsg-tv-scale,
.gsg-tv-app:not(.quiz-started) .gsg-tv-quiz {
  display: none !important;
}

.gsg-tv-app.quiz-started {
  padding-top: 0;
}

body.gsg-tv-modal-open {
  overflow: hidden;
}

@media (min-width: 720px) {
  .gsg-tv-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .gsg-tv-template-shell {
    padding-bottom: 24px;
  }

  .gsg-tv-progress {
    padding: 12px 12px 8px;
  }

  .gsg-tv-quiz {
    width: 100%;
    padding: 0 12px;
  }

  .gsg-tv-question {
    padding: 16px;
  }

  .gsg-tv-question__legend {
    gap: 8px;
    font-size: 0.8rem;
  }

  .gsg-tv-actions {
    flex-direction: column;
  }

  .gsg-tv-actions .gsg-tv-btn,
  .gsg-tv-modal__dialog .gsg-tv-btn {
    width: 100%;
  }

  .gsg-tv-modal__dialog {
    padding: 34px 22px 28px;
    border-radius: 28px;
  }

  .gsg-tv-modal__icon {
    width: 78px;
    height: 78px;
    margin-bottom: 18px;
    font-size: 3rem;
  }

  .gsg-tv-modal__dialog .gsg-tv-muted {
    font-size: 16px;
  }
}
