/* ── /try — free exam-style questions (no login) ─────────────────────────
   Built on shared/theme.css tokens and components (ui-*, btn-*, --sp-*,
   --radius*, --shadow). Mobile first (390px). Gold = one primary action
   per screen. Question content is monochrome: --text on --surface. */

.try-body { min-height: 100vh; display: flex; flex-direction: column; }
.try-main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: var(--sp-24) var(--sp-16) var(--sp-48); }
.try-muted { color: var(--text-muted); }
.try-small { font-size: var(--fs-small); line-height: var(--lh-small); }
.try-mono { font-family: var(--font-mono); font-size: var(--fs-mono); }

/* Header */
.try-header { gap: var(--sp-12); }
.try-header .brand-img { height: 40px; }
.try-header-right { gap: var(--sp-8); flex-wrap: nowrap; }
.try-header-right .btn { width: auto; white-space: nowrap; }
.try-profile { display: inline-flex; align-items: center; gap: var(--sp-8); font-size: var(--fs-small); color: var(--text-muted); white-space: nowrap; }
.try-link-btn { background: none; border: 0; padding: 0; color: var(--accent-text); font-size: var(--fs-small); text-decoration: underline; cursor: pointer; }
@media (max-width: 640px) {
  .app-header .wrap.try-header { height: auto; padding: var(--sp-8) var(--sp-16); flex-wrap: wrap; }
  .try-header .brand-img { height: 32px; }
  .try-hide-xs { display: none !important; }
  .try-profile { order: 5; width: 100%; justify-content: flex-start; padding-bottom: var(--sp-4); }
}

/* Start screen */
.try-start { max-width: 640px; }
.try-start h1 { font-size: clamp(26px, 5vw, 40px); line-height: 1.2; margin-bottom: var(--sp-12); }
.try-lede { color: var(--text-muted); margin-bottom: var(--sp-32); }
.try-step { margin-bottom: var(--sp-24); }
.try-step-label { display: flex; align-items: center; gap: var(--sp-12); font-family: var(--font-ui); font-size: var(--fs-h3); line-height: var(--lh-h3); margin-bottom: var(--sp-12); }
.try-step-num { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.try-options { display: flex; flex-wrap: wrap; gap: var(--sp-8); }
.try-option { padding: 10px 14px; min-height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500; }
.try-option:hover { border-color: var(--text-muted); }
.try-option[aria-pressed="true"] { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); background: var(--surface-2); }
.try-start-go { width: auto; min-width: 220px; margin-top: var(--sp-8); }
@media (max-width: 640px) { .try-start-go { width: 100%; } }

/* Tabs + locked teasers */
.try-tabs { margin-bottom: var(--sp-24); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.try-tabbar { min-width: max-content; align-items: flex-end; }
.try-tabbar .ui-tab { min-height: 44px; font-size: 14px; }
.try-locked { display: inline-grid; grid-template-columns: auto auto; column-gap: 6px; align-items: center; padding: 6px 12px; margin-bottom: -1px; color: var(--text-muted); font-size: var(--fs-small); line-height: 18px; text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.try-locked .ui-icon { grid-row: span 2; }
.try-locked small { font-size: 11px; line-height: 14px; }
.try-locked:hover { color: var(--text); text-decoration: none; }

/* Summary + filters */
.try-summary-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12); margin-bottom: var(--sp-12); }
.try-summary { font-family: var(--font-mono); font-size: var(--fs-mono); color: var(--text-muted); }
.try-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-12); margin-bottom: var(--sp-16); }
.try-filter { display: flex; flex-direction: column; gap: var(--sp-4); font-size: var(--fs-small); font-weight: 600; }
.try-filter .select { min-height: 40px; }

/* Question list — BLOCK VIEW (Dani, 2026-11-11 round 2: "I want the block
   view, it looks better"): golden-ratio cards exactly like the app's
   question bank. Meta on the minor axis, the question itself on the
   major one; long text fades out instead of being clamped. */
.try-bankcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.try-bankcard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.618fr); /* 1 : φ */
  gap: 20px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.try-bankcard:hover { border-color: var(--text-muted); transform: translateY(-2px); box-shadow: var(--shadow); }
.try-bankcard:focus-visible { outline-offset: 4px; }
.try-bankcard-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.try-bankcard-top { display: flex; align-items: center; gap: var(--sp-8); flex-wrap: wrap; }
.try-bankcard-topic {
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.35;
}
.try-bankcard-stats { display: flex; align-items: center; gap: var(--sp-12); font-size: var(--fs-small); color: var(--text-muted); }
.try-bankcard-add { width: 100%; margin-top: auto; }
.try-bankcard-add[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); }
.try-bankcard-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  min-height: 190px;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
}
.try-bankcard.has-diagram .try-bankcard-preview { align-items: center; justify-content: center; padding: 10px; }
.try-bankcard-preview svg { max-width: 100%; max-height: 200px; height: auto; }
.try-bankcard-text {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text);
  max-height: 11em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 68%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 68%, transparent 100%);
}
.try-bankcard-text .katex-display { margin: 8px 0; }
.try-done { display: inline-flex; align-items: center; gap: 4px; color: var(--text); font-weight: 600; }
@media (max-width: 900px) {
  .try-bankcards { grid-template-columns: 1fr; }
  .try-bankcard { grid-template-columns: 1fr; }
  .try-bankcard-preview { min-height: 130px; }
}

/* Single question */
.try-qview { max-width: 820px; }
.try-qview-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12); margin-bottom: var(--sp-16); }
.try-qview-top .btn { width: auto; }
.try-qmeta { display: flex; flex-wrap: wrap; gap: var(--sp-8); align-items: center; margin-bottom: var(--sp-12); font-size: var(--fs-small); color: var(--text-muted); }
/* Question content — monochrome, always */
.try-qcard { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-24) var(--sp-16); }
.try-qtext { color: var(--text); font-size: 16px; line-height: 26px; overflow-wrap: anywhere; }
.try-qtext .katex { color: var(--text); }
.try-qtext .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.try-diagram:empty { display: none; }
.try-diagram { margin-top: var(--sp-16); }
.try-qactions { display: flex; flex-wrap: wrap; gap: var(--sp-8); margin: var(--sp-16) 0; }
.try-qactions .btn { width: auto; }
.try-solution { display: grid; gap: var(--sp-16); }
.try-sol-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-16); }
.try-sol-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12); }
.try-sol-label { font-family: var(--font-ui); font-size: 12px; line-height: 16px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--sp-8); }
.try-score { font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--text); }
.try-working { margin-top: var(--sp-8); }
.try-alt { margin-top: var(--sp-16); padding-top: var(--sp-12); border-top: 1px dashed var(--border); color: var(--text-muted); font-size: 14px; line-height: 22px; }
.try-alt .try-qtext { color: var(--text-muted); font-size: 14px; }
/* Mark chips: [M1] [A1] … tickable, mono, monochrome */
.mark-chip { display: inline-flex; align-items: center; gap: 4px; margin: 0 2px; padding: 1px 8px; min-height: 26px; vertical-align: 1px; font-family: var(--font-mono); font-size: 12px; line-height: 18px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-pill); cursor: pointer; }
.mark-chip:hover { border-color: var(--text-muted); }
.mark-chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.mark-chip-static { cursor: default; }
.try-hint { font-size: var(--fs-small); line-height: var(--lh-small); }
.try-hint a { color: var(--text-muted); text-decoration: underline; }
.try-hint a:hover { color: var(--text); }
.try-qnav { display: flex; justify-content: space-between; gap: var(--sp-12); margin-top: var(--sp-24); }
.try-qnav .btn { width: auto; }

/* Create a paper */
.try-paper-layout { display: grid; gap: var(--sp-24); }
@media (min-width: 960px) { .try-paper-layout { grid-template-columns: 380px 1fr; align-items: start; } }
.try-qcard { padding: var(--sp-16); margin-bottom: var(--sp-16); box-shadow: none; }
.try-h2 { font-family: var(--font-ui); font-size: var(--fs-h3); line-height: var(--lh-h3); margin-bottom: var(--sp-12); }
.try-field { display: flex; flex-direction: column; gap: var(--sp-4); margin-bottom: var(--sp-12); font-size: var(--fs-small); font-weight: 600; }
.try-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-top: var(--sp-8); }
.try-sheet-list { list-style: none; display: grid; gap: var(--sp-4); margin: var(--sp-8) 0 var(--sp-16); counter-reset: sheet; }
.try-sheet-list li { counter-increment: sheet; display: grid; grid-template-columns: 24px 1fr auto; gap: var(--sp-8); align-items: center; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: var(--fs-small); background: var(--bg); }
.try-sheet-list li::before { content: counter(sheet) "."; font-family: var(--font-mono); color: var(--text-muted); }
.try-sheet-list .try-sheet-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.try-sheet-list .try-sheet-btns { display: inline-flex; gap: 2px; }
.try-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); }
.try-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.try-icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.try-sheet-empty { font-size: var(--fs-small); color: var(--text-muted); padding: var(--sp-8) 0; }
.try-pick { display: grid; gap: var(--sp-4); max-height: 420px; overflow: auto; }
.try-pick-row { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-8); align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--border); font-size: var(--fs-small); }
.try-pick-row .btn { width: auto; }

/* On-screen paper preview (white paper, like a printed sheet) */
.try-paper-preview { min-width: 0; }
.try-paper { background: #FFFFFF; color: #1C1420; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); overflow-x: auto; }
.try-paper .diagram-box, html[data-theme="dark"] .try-paper .diagram-box { color: #1C1420; background: #FFFFFF; border-color: #D0D0D0; }
.try-paper .katex { color: #1C1420; }

/* Paper content — shared by preview + print */
.pp-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid #1C1420; padding-bottom: 10px; margin-bottom: 16px; }
.pp-title { font-family: var(--font-display); font-size: 22px; line-height: 28px; font-weight: 600; }
.pp-meta { font-size: 12px; line-height: 18px; text-align: right; color: #3D3540; }
.pp-q { display: grid; grid-template-columns: 28px 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid #E2E2E2; break-inside: avoid; page-break-inside: avoid; }
.pp-num { font-weight: 700; }
.pp-marks { display: block; text-align: right; font-size: 12px; color: #3D3540; margin-top: 6px; }
.pp-text { font-size: 14px; line-height: 22px; overflow-wrap: anywhere; }
.pp-space { height: 64px; }
.pp-diagram { margin-top: 8px; max-width: 360px; }
.pp-ms-title { font-family: var(--font-display); font-size: 20px; margin: 0 0 12px; }
.pp-ms-q { padding: 8px 0; border-bottom: 1px solid #E2E2E2; break-inside: avoid; page-break-inside: avoid; font-size: 13px; line-height: 20px; }
.pp-ms-q .mark-chip { background: transparent; color: #1C1420; border-color: #9A9A9A; cursor: default; min-height: 0; }
.pp-footer { font-size: 10px; line-height: 14px; color: #6E5E68; text-align: center; padding-top: 8px; }
.pp-empty { color: #6E5E68; text-align: center; padding: 48px 0; }
.pp-table { width: 100%; border-collapse: collapse; }
.pp-table > tbody > tr > td, .pp-table > tfoot > tr > td { padding: 0; }

/* States */
.try-state { max-width: 640px; }
.try-skel { display: grid; gap: var(--sp-8); }
.try-skel .ui-skeleton { height: 64px; border-radius: var(--radius); }

/* Footer */
.try-footer { border-top: 1px solid var(--border); padding: var(--sp-16); text-align: center; font-size: var(--fs-small); color: var(--text-muted); }
.try-footer a { color: var(--text-muted); text-decoration: underline; }

/* Print — only the paper, A4, a footer on every page */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 14mm 14mm 12mm; }
  html, body { background: #FFFFFF !important; color: #1C1420 !important; }
  .no-print, .app-header, .try-footer, #state-slot, .ui-modal-overlay { display: none !important; }
  .print-only { display: block !important; }
  #print-area { color: #1C1420; }
  #print-area .katex { color: #1C1420; }
  #print-area .diagram-box { color: #1C1420 !important; background: #FFFFFF !important; border: 1px solid #D0D0D0 !important; }
  .pp-section + .pp-section { break-before: page; page-break-before: always; }
  .pp-table tfoot { display: table-footer-group; }
  .pp-table thead { display: table-header-group; }
  .pp-q, .pp-ms-q { break-inside: avoid; page-break-inside: avoid; }
}

/* ── Try page polish ──────────────────────────────────────────────────── */
/* Big header CTA — the conversion path once they've played with questions */
.try-cta-top {
  width: auto; padding: 10px 20px; font-size: 15px; font-weight: 600;
  white-space: nowrap;
}

/* Start screen hero treatment */
.try-start { text-align: left; }
.try-eyebrow {
  color: var(--gold); font-size: 12px; letter-spacing: .12em;
  text-transform: uppercase; font-weight: 600; margin-bottom: var(--sp-8);
}
.try-trust { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 var(--sp-32); }
.try-trust span {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 100px; padding: 5px 12px;
}
.try-start-go { min-width: 260px; min-height: 52px; font-size: 17px; }
.try-start-hint { font-size: 13px; color: var(--text-muted); margin-top: var(--sp-12); }
.try-start-hint a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }

/* ── Notes tab (Dani, 2026-11-11: "add a notes section — practice, create
   paper, notes"). Coming-soon showcase; chapter notes land here as the
   user writes them. Same visual language as the student Notes page. */
.try-notes { max-width: 760px; }
.try-notes-hero {
  padding: var(--sp-32);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-24);
}
.try-notes-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold); border: 1px solid var(--gold);
  padding: 4px 12px; border-radius: 100px; margin-bottom: var(--sp-16);
}
.try-notes-badge .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--gold);
  animation: try-pulse 1.6s ease-in-out infinite;
}
@keyframes try-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.8); }
}
.try-notes-hero h2 {
  font-family: var(--font-display);
  font-size: 30px; line-height: 1.2; margin: 0 0 var(--sp-8);
}
.try-notes-hero p { color: var(--text-muted); max-width: 56ch; margin: 0; }
.try-notes-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-16); }
.try-note-point {
  padding: var(--sp-24);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column; gap: var(--sp-8);
}
.try-note-point .ui-icon { color: var(--gold); }
.try-note-point h3 { font-family: var(--font-ui); font-size: 15px; margin: 0; }
.try-note-point p { font-size: var(--fs-small); color: var(--text-muted); margin: 0; line-height: 1.55; }
.try-notes-cta { margin-top: var(--sp-24); display: flex; align-items: center; gap: var(--sp-12); flex-wrap: wrap; }
.try-notes-cta .btn { width: auto; }
.try-notes-cta small { color: var(--text-muted); }
@media (max-width: 800px) { .try-notes-points { grid-template-columns: 1fr; } }
