/* Second Guess Explorer — one exact row, two practical recommendations. */

.sg-page {
  width: min(100% - 2rem, 900px);
  margin: 0 auto;
  padding: 2.25rem 0 4rem;
}

.sg-page > .related-tools {
  margin-top: 2rem;
}

.sg-hero {
  max-width: 680px;
  margin: 0 auto 1.5rem;
  text-align: center;
}

.sg-eyebrow,
.sg-step {
  margin: 0 0 0.4rem;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.sg-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.35rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.sg-deck {
  max-width: 58ch;
  margin: 0.85rem auto 0;
  color: var(--text-secondary);
  font-size: clamp(1rem, 2vw, 1.12rem);
  line-height: 1.65;
}

.sg-workbench,
.sg-results {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.sg-workbench {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 1.7rem);
}

.sg-workbench__head,
.sg-candidates__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sg-workbench__head h2,
.sg-result-heading h2,
.sg-editorial h2,
.sg-data-note h2 {
  margin: 0;
  letter-spacing: -0.025em;
}

.sg-workbench__head h2 {
  font-size: 1.35rem;
}

.sg-reset,
.sg-show-all {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.sg-reset:hover,
.sg-show-all:hover {
  color: var(--accent-hover);
}

.sg-opener-field {
  margin-top: 1.3rem;
}

.sg-opener-field label,
.sg-feedback-field legend {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 750;
}

.sg-opener-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
}

#sg-opener {
  min-width: 0;
  height: 48px;
  padding: 0 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#sg-opener:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: 0;
}

.sg-field-hint {
  margin: 0.42rem 0 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.45;
}

.sg-feedback-field {
  min-width: 0;
  margin: 1.35rem 0 0;
  padding: 0;
  border: 0;
}

.sg-tiles {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(0.35rem, 2vw, 0.65rem);
  max-width: 470px;
  margin-top: 0.75rem;
}

.sg-tile {
  aspect-ratio: 1 / 1.08;
  min-width: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  font: inherit;
  transition: filter 120ms ease, transform 80ms ease, box-shadow 120ms ease;
  touch-action: manipulation;
}

.sg-tile:hover {
  filter: brightness(1.06);
}

.sg-tile:active {
  transform: translateY(1px);
}

.sg-tile:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.sg-tile--gray {
  background: #57534e;
  color: #fff;
}

.sg-tile--yellow {
  background: var(--present);
  color: #1c1917;
}

.sg-tile--green {
  background: var(--correct);
  color: var(--on-accent);
}

.sg-tile__letter {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 5vw, 1.8rem);
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.sg-tile__state {
  font-size: clamp(0.59rem, 1.8vw, 0.72rem);
  font-weight: 700;
  opacity: 0.92;
}

.sg-submit {
  min-height: 48px;
  white-space: nowrap;
}

.sg-submit--mobile {
  display: none;
  width: 100%;
  margin-top: 1rem;
}

.sg-submit[disabled] {
  cursor: wait;
  opacity: 0.7;
}

.sg-error {
  min-height: 1.3rem;
  margin: 0.75rem 0 0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 650;
}

.sg-results {
  margin: 1.25rem auto 0;
  padding: clamp(1.1rem, 4vw, 1.9rem);
}

.sg-results[hidden] {
  display: none;
}

.sg-result-heading {
  max-width: 650px;
}

.sg-result-heading h2 {
  font-size: clamp(1.55rem, 4vw, 2rem);
}

.sg-result-summary {
  margin: 0.55rem 0 0;
  color: var(--text-secondary);
  line-height: 1.55;
}

.sg-branch-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 1.3rem 0;
}

.sg-branch-strip > div {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-1);
}

.sg-branch-value,
.sg-branch-label {
  display: block;
}

.sg-branch-value {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.sg-branch-label {
  margin-top: 0.1rem;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.sg-recommendations {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.sg-pick {
  position: relative;
  overflow: hidden;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.sg-pick::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
  content: "";
}

.sg-pick--hard::before {
  background: var(--correct);
}

.sg-pick__mode {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sg-pick__word {
  display: inline-block;
  margin-top: 0.28rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.sg-pick__word:hover {
  color: var(--accent);
}

.sg-pick__answer-note {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.14rem 0.4rem;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 0.67rem;
  font-weight: 700;
  vertical-align: 0.35rem;
}

.sg-pick__metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0.8rem 0 0;
}

.sg-pick__metric strong,
.sg-pick__metric span {
  display: block;
}

.sg-pick__metric strong {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.sg-pick__metric span {
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.sg-explanation {
  margin-top: 0.9rem;
  padding: 0.95rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
}

.sg-explanation h3,
.sg-candidates h3 {
  margin: 0;
  font-size: 0.98rem;
}

.sg-explanation p {
  margin: 0.28rem 0 0;
  line-height: 1.6;
}

.sg-candidates {
  margin-top: 1.25rem;
}

.sg-word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  margin-top: 0.7rem;
}

.sg-word {
  padding: 0.28rem 0.52rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-decoration: none;
}

.sg-word:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sg-method-note {
  margin: 1.2rem 0 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.55;
}

.sg-noscript {
  max-width: 720px;
  margin: 1rem auto;
  color: var(--danger);
  text-align: center;
}

.sg-editorial {
  margin-top: clamp(2.5rem, 7vw, 4rem);
}

.sg-editorial__intro {
  max-width: 700px;
}

.sg-editorial__intro h2,
.sg-data-note h2 {
  font-size: clamp(1.55rem, 4vw, 2.15rem);
}

.sg-editorial__intro p,
.sg-data-note p {
  color: var(--text-secondary);
  line-height: 1.75;
}

.sg-notes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.sg-note {
  padding: 1rem;
  border-top: 2px solid var(--border);
}

.sg-note h3 {
  margin: 0;
  font-size: 1rem;
}

.sg-note p {
  margin: 0.45rem 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.65;
}

.sg-data-note {
  margin-top: 2.2rem;
  padding: clamp(1rem, 4vw, 1.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
}

.sg-data-note > summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
}

.sg-data-note[open] > summary {
  margin-bottom: 0.75rem;
}

.sg-data-note p:last-child {
  margin-bottom: 0;
}

.sg-data-note a {
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 620px) {
  .sg-page {
    width: min(100% - 1rem, 900px);
    padding-top: 1.35rem;
  }

  .sg-hero {
    padding: 0 0.45rem;
  }

  .sg-opener-row {
    grid-template-columns: 1fr;
  }

  .sg-submit--desktop {
    display: none;
  }

  .sg-submit--mobile {
    display: block;
  }

  .sg-recommendations,
  .sg-notes-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .sg-workbench,
  .sg-results {
    border-radius: var(--radius-lg);
  }

  .sg-tile__state {
    font-size: 0.55rem;
  }

  .sg-branch-strip {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sg-tile {
    transition: none;
  }
}
