/* ==================================================================
   Guided — the worked example  (LOCAL PREVIEW ONLY)

   An inset of the tutor at work. Not a chat window.
   ================================================================== */

.gs-demo {
  max-width: 680px;
  margin: 56px auto 0;
  text-align: left;
}

/* ---- subject tabs ---- */

.gs-tabs {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 22px;
}

.gs-tab {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 17px;
  font-weight: 500;
  color: #86868B;
  padding: 0 0 9px;
  position: relative;
  transition: color 0.2s ease;
}

.gs-tab.is-on { color: #1D1D1F; }

.gs-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: #0071E3;
  opacity: 0;
}

.gs-tab.is-on::after { opacity: 1; }

/* not a tab — a quiet count of what the three examples leave out */
.gs-tab-more {
  align-self: center;
  font-size: 13px;
  font-weight: 500;
  color: #86868B;
  background: #F0F0F2;
  border-radius: 999px;
  padding: 4px 11px;
  margin-bottom: 9px;
  cursor: default;
  white-space: nowrap;
}

.gs-demo-more {
  margin: 18px 0 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: #86868B;
  text-align: center;
}

/* ---- grade toggles ---- */

.gs-seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  margin: 0 auto 26px;
  background: #F0F0F2;
  border-radius: 999px;
}

.gs-demo > .gs-seg { display: flex; width: fit-content; }

.gs-seg-btn {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #6E6E73;
  padding: 8px 18px;
  border-radius: 999px;
  transition: background 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
  white-space: nowrap;
}

.gs-seg-btn.is-on {
  background: #FFFFFF;
  color: #1D1D1F;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10);
}

/* ---- the inset ---- */

.gs-sheet {
  background: #FFFFFF;
  border: 1px solid #E3E3E6;
  border-radius: 22px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.07);
  padding: 30px 32px 34px;
  min-height: 430px;
  text-align: left;
}

/* Every element fades up as it is written.
   NB: keyframes, not transitions. A CSS transition can stick in a
   permanently "running" state in this runtime and the element then
   never reaches its end value — the line simply never appears. */
.gs-sheet-head,
.gs-sheet-q,
.gs-sheet-attempt,
.gs-sheet-hint,
.gs-sheet-close {
  opacity: 0;
}

@keyframes gsIn {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

.gs-sheet-head.is-in,
.gs-sheet-q.is-in,
.gs-sheet-attempt.is-in,
.gs-sheet-hint.is-in,
.gs-sheet-close.is-in {
  animation: gsIn 0.55s cubic-bezier(0.22, 0.9, 0.3, 1) forwards;
}

.gs-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid #EDEDF0;
}

.gs-sheet-meta {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #86868B;
  text-align: left;
}

.gs-sheet-tag {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0071E3;
  background: rgba(0, 113, 227, 0.08);
  border-radius: 999px;
  padding: 5px 11px;
}

.gs-sheet-q {
  margin-top: 24px;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1D1D1F;
  text-align: left;
}

.gs-sheet-attempt {
  margin-top: 10px;
  font-size: 16px;
  color: #86868B;
  text-align: left;
}

.gs-sheet-hint {
  margin-top: 22px;
  font-size: 19px;
  line-height: 1.45;
  color: #1D1D1F;
  text-align: left;
}

.gs-sheet-hint::before {
  content: "Guided";
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #0071E3;
  margin-bottom: 7px;
}

/* ---- the working, written out ---- */

.gs-sheet-work {
  margin-top: 26px;
  display: grid;
  gap: 12px;
  justify-items: start;
}

/* NB: the wipe clips to the element box, so the box must be padded out
   far enough that the pen marks live inside it — otherwise the circle
   gets sliced flat and the underline disappears entirely. */
.gs-step {
  padding: 14px 18px;
  margin: -14px -18px;
  clip-path: inset(0 100% 0 0);
}

@keyframes gsWrite {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}

.gs-step.is-in {
  animation: gsWrite 0.85s cubic-bezier(0.3, 0.7, 0.3, 1) forwards;
}

.gs-step-text {
  position: relative;
  display: inline-block;
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #1D1D1F;
  padding: 2px 4px;
  text-align: left;
  white-space: pre;
}

@keyframes gsDraw { to { stroke-dashoffset: 0; } }

/* the pen marks */
.gs-mark {
  position: absolute;
  pointer-events: none;
  overflow: visible;
}

.gs-mark path {
  fill: none;
  stroke: #0071E3;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gs-mark-underline {
  left: 0;
  right: 0;
  bottom: -9px;
  height: 12px;
  width: 100%;
}

.gs-mark-circle {
  left: -10px;
  right: -10px;
  top: -6px;
  bottom: -6px;
  width: calc(100% + 20px);
  height: calc(100% + 12px);
}

.gs-sheet-close {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #EDEDF0;
  font-size: 16px;
  line-height: 1.5;
  color: #6E6E73;
  text-align: left;
}

/* ---- mobile ---- */

@media (max-width: 1024px) {
  .gs-demo { margin-top: 36px; }

  .gs-tabs { gap: 16px; margin-bottom: 16px; }
  .gs-tab { font-size: 15px; padding-bottom: 8px; }
  .gs-tab-more { font-size: 12px; padding: 3px 9px; }
  .gs-demo-more { font-size: 13.5px; margin-top: 14px; }

  .gs-seg { width: 100%; margin-bottom: 20px; }
  .gs-seg-btn { flex: 1; padding: 9px 6px; font-size: 13px; }

  .gs-sheet {
    padding: 22px 20px 26px;
    border-radius: 18px;
    min-height: 0;
  }

  .gs-sheet-q { margin-top: 18px; }
  .gs-sheet-hint { font-size: 17px; margin-top: 18px; }
  .gs-sheet-work { margin-top: 20px; gap: 15px; }
  .gs-sheet-close { margin-top: 24px; font-size: 15px; }
}
