/* GKSchools Online Test Series — exam layout */
:root {
  --ots-teal: #0f766e;
  --ots-teal-dark: #115e59;
  --ots-ink: #0f172a;
  --ots-muted: #64748b;
  --ots-line: #e2e8f0;
  --ots-bg: #f4efe4;
  --ots-paper: #ffffff;
  --ots-ok: #15803d;
  --ots-bad: #b91c1c;
  --ots-mark: #b45309;
  --ots-skip: #64748b;
}

html.gks-exp body.ots-page,
body.ots-page {
  --gks-accent: #0f766e;
  --gks-hover: #0d9488;
  background: var(--ots-bg) !important;
  background-image: none !important;
  color: var(--ots-ink);
  min-height: 100vh;
  font-family: var(--gks-font, Inter, "Segoe UI", system-ui, sans-serif);
  font-size: var(--gks-fs-body, 1.0625rem);
  line-height: 1.6;
}

.ots-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--ots-teal);
  color: #fff;
  box-shadow: 0 2px 10px rgba(15, 118, 110, 0.28);
}

.ots-topbar a.ots-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
}

.ots-topbar img {
  height: 36px;
  width: auto;
}

.ots-top-title {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.ots-top-title h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ots-top-title span {
  display: block;
  font-size: 0.8125rem;
  opacity: 0.9;
}

.ots-timer {
  min-width: 118px;
  text-align: center;
  background: #042f2e;
  border-radius: 10px;
  padding: 6px 10px;
  font-variant-numeric: tabular-nums;
}

.ots-timer strong {
  display: block;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.ots-timer.ots-timer-warn {
  background: #7f1d1d;
  animation: otsPulse 1s ease-in-out infinite;
}

@keyframes otsPulse {
  50% { opacity: 0.75; }
}

.ots-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px;
}

.ots-card {
  background: var(--ots-paper);
  border: 1px solid var(--ots-line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.ots-exam-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}

.ots-q-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--ots-muted);
  margin-bottom: 12px;
}

.ots-q-text {
  font-size: var(--gks-fs-sub, 1.125rem);
  line-height: 1.65;
  font-weight: 600;
  margin: 0 0 18px;
}

.ots-options {
  display: grid;
  gap: 10px;
}

.ots-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1.5px solid var(--ots-line);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  background: #fff;
}

.ots-option:hover,
.ots-option:focus-within {
  border-color: var(--ots-teal);
  background: #f0fdfa;
}

.ots-option input {
  margin-top: 4px;
}

.ots-option.is-selected {
  border-color: var(--ots-teal);
  background: #ccfbf1;
}

.ots-opt-key {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--ots-teal);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.ots-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.ots-btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ots-btn-ghost { background: #e2e8f0; color: #0f172a; }
.ots-btn-mark { background: #fef3c7; color: #92400e; }
.ots-btn-next { background: var(--ots-teal); color: #fff; }
.ots-btn-submit { background: #b91c1c; color: #fff; margin-left: auto; }
.ots-btn-primary { background: var(--ots-teal); color: #fff; }
.ots-btn-outline { background: #fff; color: var(--ots-teal); border: 1.5px solid var(--ots-teal); }

.ots-palette {
  position: sticky;
  top: 76px;
}

.ots-palette h2 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.ots-palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.ots-pbtn {
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--ots-line);
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.ots-pbtn.is-current { outline: 2px solid var(--ots-teal); }
.ots-pbtn.is-answered { background: #16a34a; color: #fff; border-color: #16a34a; }
.ots-pbtn.is-marked { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.ots-pbtn.is-marked.is-answered { background: linear-gradient(135deg, #16a34a 50%, #f59e0b 50%); }

.ots-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 12px;
  font-size: var(--gks-fs-small, 0.875rem);
  color: var(--ots-muted);
}

.ots-legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
  background: #cbd5e1;
}
.ots-legend .ans::before { background: #16a34a; }
.ots-legend .mark::before { background: #f59e0b; }
.ots-legend .cur::before { background: var(--ots-teal); }

.ots-palette-toggle {
  display: none;
}

.ots-instr dt { font-weight: 700; margin-top: 12px; }
.ots-instr dd { margin: 4px 0 0; color: var(--ots-muted); }
.ots-instr-list { margin: 0; padding-left: 18px; line-height: 1.6; }
.ots-ready { display: flex; align-items: center; gap: 8px; margin: 18px 0; }

.ots-score-hero {
  text-align: center;
  padding: 10px 0 24px;
}
.ots-ring {
  width: 140px;
  height: 140px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--ots-teal) calc(var(--p) * 1%), #e2e8f0 0);
}
.ots-ring span {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 800;
}
.ots-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 18px 0;
}
.ots-stat {
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
}
.ots-stat b { display: block; font-size: 1.3rem; }
.ots-stat.ok b { color: var(--ots-ok); }
.ots-stat.bad b { color: var(--ots-bad); }
.ots-grade-a { color: #15803d; }
.ots-grade-b { color: #a16207; }
.ots-grade-c { color: #c2410c; }
.ots-grade-f { color: #b91c1c; }

.ots-review-item {
  border-top: 1px solid var(--ots-line);
  padding: 16px 0;
}
.ots-review-item h3 { margin: 0 0 8px; font-size: var(--gks-fs-sub, 1.1rem); line-height: 1.45; }
.ots-tag {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 6px;
}
.ots-tag-ok { background: #dcfce7; color: #166534; }
.ots-tag-bad { background: #fee2e2; color: #991b1b; }
.ots-tag-skip { background: #e2e8f0; color: #334155; }
.ots-rev-opt { padding: 6px 0; }
.ots-rev-opt.is-correct { color: var(--ots-ok); font-weight: 700; }
.ots-rev-opt.is-wrong { color: var(--ots-bad); }

.ots-hub-hero {
  background: linear-gradient(135deg, #0f766e, #115e59);
  color: #fff;
  border-radius: 18px;
  padding: 32px 24px;
  margin-bottom: 22px;
}
.ots-hub-hero h1 { margin: 0 0 8px; font-size: var(--gks-fs-h1, clamp(1.875rem, 3vw, 2.5rem)); line-height: 1.22; }
.ots-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.ots-sub-card, .ots-test-card {
  display: block;
  background: #fff;
  border: 1px solid var(--ots-line);
  border-radius: 14px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}
.ots-sub-card:hover, .ots-test-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.12);
}
.ots-sub-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #ccfbf1;
  color: var(--ots-teal);
  display: grid;
  place-items: center;
  font-weight: 800;
  margin-bottom: 10px;
}
.ots-test-card .ots-meta-row {
  display: flex;
  gap: 10px;
  font-size: var(--gks-fs-small, 0.9rem);
  color: var(--ots-muted);
  margin-top: 8px;
}

.ots-hidden { display: none !important; }
.ots-qpanel { display: none; }
.ots-qpanel.is-active { display: block; }

.ots-mode-picks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}
.ots-mode-card {
  border: 1.5px solid var(--ots-line);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  display: block;
}
.ots-mode-card strong { display: block; margin-bottom: 4px; }
.ots-mode-card span { color: var(--ots-muted); font-size: var(--gks-fs-small, 0.95rem); line-height: 1.45; }
.ots-mode-card:has(input:checked) {
  border-color: var(--ots-teal);
  background: #f0fdfa;
}
.ots-guest-note {
  background: #fffbeb;
  border-radius: 10px;
  padding: 10px 12px;
  color: #92400e;
}
.ots-rank {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #115e59;
  font-weight: 800;
  font-size: 1.05rem;
}
.ots-rank strong { color: #0f766e; }
.ots-timer-practice { background: #134e4a; }
.ots-option.is-right { border-color: var(--ots-ok); background: #dcfce7; }
.ots-option.is-wrong-pick { border-color: var(--ots-bad); background: #fee2e2; }
.ots-compare {
  background: #f0fdfa;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
  color: var(--ots-teal-dark);
}
.ots-score-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 12px 0;
}
.ots-score-actions form { margin: 0; }

@media (max-width: 560px) {
  .ots-mode-picks { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .ots-exam-grid {
    grid-template-columns: 1fr;
  }
  .ots-palette {
    position: fixed;
    right: 0;
    top: 58px;
    bottom: 0;
    width: min(86vw, 320px);
    z-index: 50;
    transform: translateX(110%);
    transition: transform .2s ease;
    background: #fff;
    border-left: 1px solid var(--ots-line);
    padding: 16px;
    overflow: auto;
  }
  .ots-palette.is-open { transform: none; }
  .ots-palette-toggle {
    display: inline-flex;
  }
  .ots-stats { grid-template-columns: 1fr 1fr; }
  .ots-top-title h1 { font-size: 0.95rem; }
  .ots-btn-submit { margin-left: 0; width: 100%; }
}

@media (max-width: 560px) {
  .ots-topbar { padding: 8px; flex-wrap: wrap; }
  .ots-topbar img { height: 28px; }
  .ots-top-title h1 {
    white-space: normal;
    font-size: 0.85rem;
    line-height: 1.25;
  }
  .ots-timer { min-width: 96px; padding: 4px 6px; }
  .ots-shell { padding: 10px; }
  .ots-card { padding: 14px; }
}
.ots-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.95rem;
  margin: 0 0 14px;
  color: var(--ots-muted);
}
.ots-crumb a { color: var(--ots-teal); font-weight: 700; text-decoration: none; }

/* —— Theme polish (scoped to OTS pages only) —— */
body.ots-page .ots-shell {
  max-width: 1100px;
}
body.ots-page .ots-card {
  border-color: #e8dcc8;
  box-shadow: 0 10px 28px rgba(15, 118, 110, 0.07);
}
body.ots-page .ots-kicker {
  margin: 0 0 8px;
  color: #0f766e;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
body.ots-page .ots-score-title,
body.ots-page .ots-instr-title {
  margin: 0 0 8px;
  color: #134e4a;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  line-height: 1.25;
}
body.ots-page .ots-score-sub,
body.ots-page .ots-lead,
body.ots-page .ots-score-summary {
  color: #475569;
  margin: 0 0 14px;
}
body.ots-page .ots-ring-wrap {
  display: flex;
  justify-content: center;
  margin: 8px 0 14px;
}
body.ots-page .ots-ring {
  width: 156px;
  height: 156px;
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.16);
}
body.ots-page .ots-ring span {
  width: 118px;
  height: 118px;
  color: #134e4a;
}
body.ots-page .ots-grade-line {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 800;
}
body.ots-page .ots-stat {
  background: #f8fffe;
  border: 1px solid #ccfbf1;
}
body.ots-page .ots-stat.skip b { color: #475569; }
body.ots-page .ots-stat.time b { color: #0f766e; }
body.ots-page .ots-notice {
  max-width: 36rem;
  margin: 0 auto 16px;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  text-align: left;
}
body.ots-page .ots-notice-ok {
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #bbf7d0;
}
body.ots-page .ots-notice-warn {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}
body.ots-page .ots-notice a {
  color: #0f766e;
  font-weight: 800;
}
body.ots-page .ots-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 18px;
}
body.ots-page .ots-fact {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
}
body.ots-page .ots-fact span {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 4px;
}
body.ots-page .ots-fact strong {
  color: #115e59;
  font-size: 0.98rem;
}
body.ots-page .ots-section-title {
  margin: 8px 0 14px;
  color: #134e4a;
  font-size: 1.35rem;
}
body.ots-page a.ots-btn,
body.ots-page button.ots-btn {
  appearance: none;
  box-sizing: border-box;
  min-height: 42px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none !important;
  border-radius: 12px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
body.ots-page a.ots-btn:hover,
body.ots-page button.ots-btn:hover {
  transform: translateY(-1px);
}
body.ots-page a.ots-btn-primary,
body.ots-page button.ots-btn-primary,
body.ots-page .ots-btn-next {
  background: #0f766e !important;
  color: #fff !important;
  border: 1.5px solid #0f766e !important;
}
body.ots-page a.ots-btn-outline,
body.ots-page button.ots-btn-outline {
  background: #fff !important;
  color: #0f766e !important;
  border: 1.5px solid #0f766e !important;
}
body.ots-page a.ots-btn-ghost,
body.ots-page button.ots-btn-ghost {
  background: #f0fdfa !important;
  color: #115e59 !important;
  border: 1.5px solid #99f6e4 !important;
}
body.ots-page a.ots-btn-wa {
  background: #fff !important;
  color: #047857 !important;
  border: 1.5px solid #34d399 !important;
}
body.ots-page a.ots-btn-on-hero {
  background: transparent !important;
  color: #fff !important;
  border: 1.5px solid rgba(255, 255, 255, 0.75) !important;
}
body.ots-page a.ots-btn-on-hero:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}
body.ots-page .ots-score-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 8px 0 4px;
}
body.ots-page .ots-score-actions-more {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid #e8dcc8;
}
body.ots-page .ots-score-hero {
  padding: 28px 22px 22px;
}
body.ots-page .ots-review-card {
  margin-top: 16px;
}
body.ots-page .ots-review-card h2 {
  margin: 0 0 8px;
  color: #134e4a;
}
body.ots-page .ots-review-item {
  background: #f8fffe;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px 0 0;
}
body.ots-page .ots-hub-hero {
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.18);
}
body.ots-page .ots-sub-card,
body.ots-page .ots-test-card {
  border-color: #e8dcc8;
}
body.ots-page .ots-sub-card:hover,
body.ots-page .ots-test-card:hover {
  border-color: #99f6e4;
}
body.ots-page .ots-start-form .ots-btn {
  margin-right: 8px;
  margin-top: 4px;
}

@media (max-width: 900px) {
  body.ots-page .ots-facts {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  body.ots-page .ots-score-hero {
    padding: 18px 14px 16px;
  }
  body.ots-page .ots-score-actions .ots-btn,
  body.ots-page .ots-score-actions form,
  body.ots-page .ots-start-form .ots-btn {
    width: 100%;
  }
  body.ots-page .ots-score-actions form .ots-btn {
    width: 100%;
  }
  body.ots-page .ots-actions .ots-btn {
    flex: 1 1 calc(50% - 8px);
  }
  body.ots-page .ots-btn-submit {
    flex: 1 1 100%;
  }
  body.ots-page .ots-hub-hero {
    padding: 22px 16px;
    border-radius: 14px;
  }
  body.ots-page .ots-facts {
    grid-template-columns: 1fr 1fr;
  }
}
