/* ScholarCompass try-it demo. Mobile first; desktop stays compact. */

.path-btn {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: transform 0.08s ease, box-shadow 0.12s ease;
}
.chip.side.path-btn { border: 1px solid var(--brand); font-size: 0.82rem; }
.path-btn:hover { box-shadow: 0 2px 8px #14304426; }
.path-btn:active { transform: scale(0.98); }
.path-btn:focus-visible, .try-btn:focus-visible, .try-opt:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 2px;
}
.chip.path-primary.path-btn { font-size: 1rem; }

.try-pick-note {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0 0 0.4rem;
}

.try-entry {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin: 0.6rem 0 0.15rem;
}

.try-btn {
  align-items: center;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  font: inherit;
  font-weight: 700;
  justify-content: center;
  line-height: 1.25;
  min-height: 3rem;
  padding: 0.55rem 1.3rem;
  text-align: center;
  text-decoration: none;
}
.try-btn:hover { text-decoration: none; background: #0e2433; }
.try-btn .en { color: #d7ebee; font-size: 0.78rem; font-weight: 500; }
.try-btn[disabled] { background: #9fb0b6; border-color: #9fb0b6; cursor: not-allowed; }
.try-btn.ghost { background: #fff; color: var(--brand); }
.try-btn.ghost .en { color: var(--muted); }
.try-btn.ghost:hover { background: var(--accent); }

.try-start {
  background: var(--brass);
  border-color: var(--brass);
  min-width: 11rem;
}
.try-start:hover { background: #7f5e33; }
.try-start .zh { font-size: 1.08rem; }
.try-start .en { color: #fbf3e4; }

.try-entry-note { color: var(--muted); font-size: 0.76rem; margin: 0; }

/* Flow view: hide the rest of the page while the demo is open. */
body.trying .main > :not(#try) { display: none; }
.try[hidden] { display: none; }
.try { margin: 0 auto; max-width: 980px; }

.try-card { padding: 0.9rem 0.9rem 0.8rem; }

.try-progress {
  background: #e3ecee;
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}
.try-progress-fill {
  background: var(--brass);
  border-radius: 999px;
  display: block;
  height: 100%;
  transition: width 0.2s ease;
  width: 0;
}

.try-step-count { color: var(--muted); font-size: 0.78rem; margin: 0.45rem 0 0; }
.try-path-label { color: var(--brand-2); font-size: 0.8rem; font-weight: 700; margin: 0.25rem 0 0; }
.try-path-label .en { font-weight: 500; }

.try-q { font-size: 1.15rem; margin: 0.45rem 0 0.2rem; outline: none; }
.try-q .en { font-size: 0.86em; }
.try-hint { color: var(--muted); font-size: 0.82rem; margin: 0 0 0.2rem; }

.try-options {
  display: grid;
  gap: 0.5rem;
  margin: 0.6rem 0 0.8rem;
}

.try-opt {
  align-items: center;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 0.6rem;
  min-height: 3.4rem;
  padding: 0.6rem 0.85rem;
  text-align: left;
}
.try-opt:hover { border-color: var(--brand-2); }
.try-opt .zh { font-size: 1rem; font-weight: 650; }
.try-opt .en { color: var(--muted); font-size: 0.82rem; }
.try-opt-text { display: flex; flex-direction: column; }
.try-opt.on { background: #eaf3f6; border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.try-check {
  border: 1.5px solid var(--muted);
  border-radius: 5px;
  flex: none;
  height: 1.1rem;
  position: relative;
  width: 1.1rem;
}
.try-opt.on .try-check { background: var(--brand); border-color: var(--brand); }
.try-opt.on .try-check::after {
  border: solid #fff;
  border-width: 0 2px 2px 0;
  content: "";
  height: 0.55rem;
  left: 0.33rem;
  position: absolute;
  top: 0.12rem;
  transform: rotate(45deg);
  width: 0.28rem;
}

.try-nav { display: grid; gap: 0.5rem; grid-template-columns: 1fr 1.6fr; }
.try-nav.end { grid-template-columns: 1fr 1fr; margin-top: 0.6rem; }

.try-privacy, .try-foot, .try-cta-note {
  color: var(--muted);
  font-size: 0.74rem;
  margin: 0.7rem 0 0;
  text-align: center;
}

/* Result */
.try-result-head { text-align: center; }
.try-result-title { color: var(--brand); font-size: 1.3rem; margin: 0.2rem 0 0.4rem; outline: none; }
.try-result-title .en { color: var(--brand); font-size: 0.75em; font-weight: 600; }
.try-warn {
  align-items: center;
  background: #fbefe2;
  border-radius: 10px;
  color: #8a4b14;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  font-size: 0.8rem;
  font-weight: 650;
  gap: 0.1rem 0.4rem;
  justify-content: center;
  margin: 0 0 0.6rem;
  padding: 0.45rem 0.7rem;
}
.try-warn .en { color: #8a4b14; font-weight: 500; }
.try-warn-icon {
  background: #e7b98a;
  border-radius: 50%;
  color: #fff;
  display: inline-grid;
  font-size: 0.72rem;
  height: 1.1rem;
  place-items: center;
  width: 1.1rem;
}

.try-results { display: grid; gap: 0.55rem; }
.try-results > .card { margin-bottom: 0; }

.try-rcard { background: #fffdf9; }
.try-rcard-top { align-items: flex-start; display: flex; gap: 0.5rem; justify-content: space-between; }
.try-rname { align-items: center; display: flex; font-size: 1rem; gap: 0.45rem; margin: 0; }
.try-rname .en { color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.try-code {
  background: var(--brand);
  border-radius: 6px;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.35rem;
}

.try-tag {
  border-radius: 999px;
  flex: none;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.22rem 0.55rem;
}
.try-tag.tag-safety { background: #e3f1e7; color: #2e7d4f; }
.try-tag.tag-steady { background: #e1eef3; color: #1f6f8b; }
.try-tag.tag-reach { background: #e6edf7; color: #3a6ea5; }

.try-rcard-body {
  align-items: center;
  display: grid;
  gap: 0.6rem;
  grid-template-columns: auto 1fr auto;
  margin-top: 0.55rem;
}
.try-rcard.wide .try-rcard-body, .try-rcard-body:not(:has(.try-score)) { grid-template-columns: 1fr auto; }

.try-score { display: flex; flex-direction: column; align-items: center; min-width: 4.2rem; }
.try-score-label { color: var(--muted); font-size: 0.68rem; text-align: center; }
.try-score-label .en { font-size: 1em; }
.try-score-num { font-size: 2rem; font-weight: 800; line-height: 1.05; }
.try-score-range { color: var(--muted); font-size: 0.72rem; font-weight: 600; }
.try-score.tag-safety .try-score-num { color: #2e7d4f; }
.try-score.tag-steady .try-score-num { color: #1f6f8b; }
.try-score.tag-reach .try-score-num { color: #3a6ea5; }

.try-bars { display: grid; gap: 0.35rem; min-width: 0; }
.try-bar { align-items: center; display: grid; gap: 0.4rem; grid-template-columns: 4.4rem 1fr; }
.try-bar-label { color: var(--muted); font-size: 0.68rem; line-height: 1.15; }
.try-bar-label .zh { color: var(--ink); font-weight: 600; }
.try-bar-label .en { font-size: 0.95em; }
.try-bar-track { background: #e8eef0; border-radius: 999px; display: block; height: 7px; overflow: hidden; }
.try-bar-fill { background: var(--brand-2); border-radius: 999px; display: block; height: 100%; width: 0; }

.try-gate {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  font-size: 0.68rem;
  gap: 0.15rem;
  max-width: 6.6rem;
  text-align: center;
}
.try-gate-icon {
  background: #eef2f4;
  border-radius: 50%;
  color: var(--muted);
  display: inline-grid;
  font-weight: 700;
  height: 1.4rem;
  place-items: center;
  width: 1.4rem;
}
.try-gate.ok .try-gate-icon { background: #e3f1e7; color: #2e7d4f; }
.try-gate-label .zh { color: var(--ink); font-weight: 600; }
.try-gate-status { font-weight: 700; }
.try-gate-status .zh { color: var(--ink); }
.try-gate.ok .try-gate-status .zh { color: #2e7d4f; }

.try-majors { border-top: 1px dashed var(--border); margin-top: 0.6rem; padding-top: 0.45rem; }
.try-majors-label { color: var(--muted); font-size: 0.74rem; margin: 0 0 0.3rem; }
.try-majors ul { display: flex; flex-wrap: wrap; gap: 0.35rem; list-style: none; margin: 0; padding: 0; }
.try-majors li {
  background: var(--accent);
  border-radius: 999px;
  font-size: 0.76rem;
  padding: 0.25rem 0.6rem;
}
.try-majors li .en { color: var(--muted); }
.try-card-note { color: var(--muted); font-size: 0.72rem; margin: 0.5rem 0 0; }

.try-after { margin-top: 0.7rem; }
.try-cta { background: #0e2433; display: flex; width: 100%; }
.try-cta .zh { font-size: 1.02rem; }

.try-how {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  margin-top: 0.6rem;
  padding: 0.5rem 0.75rem;
}
.try-how summary { cursor: pointer; font-weight: 650; }
.try-how summary .en { font-weight: 500; }

@media (width >= 640px) {
  .try-options { grid-template-columns: 1fr 1fr; }
  .try-nav { grid-template-columns: auto auto; justify-content: end; }
  .try-nav .try-btn { min-width: 9rem; }
  .try-results { grid-template-columns: 1fr 1fr; }
  .try-results.single { grid-template-columns: 1fr; }
  .try-after { align-items: center; display: grid; gap: 0 1rem; grid-template-columns: 1.2fr 1fr; }
  .try-after .try-cta-note { margin-top: 0; text-align: left; }
  .try-after .try-nav.end { grid-column: 1 / -1; justify-content: center; margin-top: 0.6rem; }
  .try-after .try-how, .try-after .try-foot { grid-column: 1 / -1; }
}

@media (width >= 1024px) {
  .try-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .try-options.many { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .try-results { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .try-results.single { grid-template-columns: minmax(0, 680px); justify-content: center; }
  .try-entry { margin-top: 0.75rem; }
}

/* Narrow phones: keep the start button thumb-wide. */
@media (width < 640px) {
  .try-entry .try-start { width: 100%; }
  .try-entry-note { text-align: center; width: 100%; }
  .try-bar { grid-template-columns: 3.7rem 1fr; }
}

/* Wider screens: the hard-gate line sits under the bars so the bars keep their width. */
@media (width >= 640px) {
  .try-rcard-body,
  .try-rcard.wide .try-rcard-body,
  .try-rcard-body:not(:has(.try-score)) { grid-template-columns: auto 1fr; }
  .try-rcard-body:not(:has(.try-score)) .try-bars { grid-column: 1 / -1; }
  .try-gate {
    border-top: 1px dashed var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.2rem 0.5rem;
    grid-column: 1 / -1;
    justify-content: flex-start;
    max-width: none;
    padding-top: 0.45rem;
    text-align: left;
  }
  .try-gate .bi { flex-direction: row; gap: 0.3rem; align-items: baseline; }
  .try-gate-status { margin-left: auto; }
}
