/* Cheat sheets: one topic, answered fast. The answer first, then a tool,
   the table, a short quiz and the way deeper. Uses the course's de/het colours
   (--de, --het) and the workbook palette. */

.cheat-sheet-page { background: var(--bg); }
.cheat-sheet-page .lesson-navl[aria-current="page"] { color: var(--accent); }
/* Buttons below set their own display; the hidden attribute must still win. */
.cheat-sheet-page [hidden] { display: none !important; }
.cheat-sheet-layout > .cs-wrap { padding-bottom: 64px; }
.cs-wrap > [id] { scroll-margin-top: 24px; }
.cs-visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cs-muted { color: var(--text-muted); font-size: 13.5px; line-height: 1.65; }
.cs-de { color: var(--de); }
.cs-het { color: var(--het); }

/* The same left column and sticky behaviour as the course workbook. */
.cs-guide-toggle { display: none; }
.cs-guide-body { padding-bottom: 20px; }
.cs-topics { margin-bottom: 22px; }
.cs-topic { display: flex; align-items: baseline; gap: 12px; min-height: 56px; padding: 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 13px; font-weight: 700; }
.cs-topic.current { background: var(--accent-light); color: var(--accent); box-shadow: inset 3px 0 var(--accent); }
.cs-topic-num { font-size: 11px; }
.cs-topic small { display: block; margin-top: 4px; color: var(--text-muted); font-size: 11px; font-weight: 400; }
.cs-section-nav { display: grid; gap: 2px; }
.cs-section-nav > p { margin-bottom: 7px; }
.cs-section-nav a { display: flex; align-items: center; min-height: 40px; padding: 8px 12px; border-radius: 7px; color: var(--text-muted); text-decoration: none; font-size: 13px; line-height: 1.45; }
.cs-section-nav a:hover { background: var(--workbook-sage); color: var(--workbook-ink); }
.cs-section-nav a[aria-current="location"] { background: var(--workbook-sage); color: var(--workbook-ink); font-weight: 700; }
.cs-sidebar .course-footnote a { color: var(--workbook-ink); text-underline-offset: 3px; }

/* --- the answer --- */
.cs-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--workbook-ink); }
.cs-eyebrow span { color: var(--text-muted); font-weight: 600; }
.cs-hero h1 { margin: 10px 0 16px; font: 700 46px/1.1 'Playfair Display', Georgia, serif; letter-spacing: -.02em; }
.cs-hero h1 span { display: block; margin-top: 6px; font-size: 26px; font-weight: 400; font-style: italic; color: var(--text-muted); }
.cs-answer { max-width: 760px; font-size: 18px; line-height: 1.7; }
.cs-answer strong { font-weight: 700; }
.cs-answer-note { margin-top: 10px; font-size: 14px; color: var(--text-muted); }

/* --- cards --- */
.cs-card { margin-top: 22px; padding: 26px 28px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; }
.cs-card h2 { font: 700 24px/1.3 'Playfair Display', Georgia, serif; letter-spacing: -.01em; }
.cs-card > h2 + .cs-muted { margin-top: 4px; }
.cs-card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; }
.cs-subhead { margin: 24px 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--workbook-ink); }

.cs-button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px; border: 1px solid var(--workbook-ink); border-radius: 10px; background: var(--workbook-ink); color: #fff; font: 700 14px 'DM Sans', sans-serif; text-decoration: none; cursor: pointer; }
.cs-button:hover { background: #2a3d31; color: #fff; }
.cs-download { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--workbook-ink); border-radius: 10px; color: var(--workbook-ink); font-size: 13px; font-weight: 700; text-decoration: none; }
.cs-download::before { content: '↓'; font-size: 15px; }
.cs-download:hover { background: var(--workbook-sage); }
.cs-text-link { color: var(--workbook-ink); font-size: 13px; font-weight: 600; }
.cheat-sheet-page a:focus-visible, .cheat-sheet-page button:focus-visible, .cheat-sheet-page input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* --- word checker --- */
.cs-checker { border-top: 3px solid var(--workbook-ink); }
.cs-checker-form { display: flex; gap: 10px; margin-top: 16px; }
.cs-checker-form input { flex: 1; min-width: 0; min-height: 50px; padding: 0 16px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); font: 500 17px 'DM Sans', sans-serif; }
.cs-checker-form input:focus { border-color: var(--workbook-ink); outline: none; }
.cs-try { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.cs-chip { min-height: 34px; padding: 0 13px; border: 1px solid var(--border); border-radius: 17px; background: var(--card); color: var(--text); font: 600 13px 'DM Sans', sans-serif; cursor: pointer; }
.cs-chip:hover { border-color: var(--workbook-ink); color: var(--workbook-ink); }
.cs-result { margin-top: 18px; padding: 16px 18px; border-radius: 12px; border-left: 5px solid var(--border); background: var(--workbook-soft, #fafbf7); }
.cs-result.is-de { border-left-color: var(--de); background: var(--de-bg); }
.cs-result.is-het { border-left-color: var(--het); background: var(--het-bg); }
.cs-result-word { font-size: 22px; line-height: 1.4; }
.cs-result-article { font: 700 28px 'Playfair Display', Georgia, serif; }
.cs-result-article.is-de { color: var(--de); }
.cs-result-article.is-het { color: var(--het); }
.cs-result-article.is-unknown { color: var(--text-muted); }
.cs-result-reason { margin-top: 6px; font-size: 14.5px; line-height: 1.65; }
.cs-result-tag { display: inline-block; padding: 1px 8px; border-radius: 10px; background: var(--card); color: var(--text-muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; vertical-align: 1px; }

/* --- the sheet --- */
.cs-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.cs-col { padding: 18px 20px; border-radius: 12px; border-top: 4px solid; }
.cs-col.is-de { background: var(--de-bg); border-color: var(--de); }
.cs-col.is-het { background: var(--het-bg); border-color: var(--het); }
.cs-col h3 { font: 700 30px/1.1 'Playfair Display', Georgia, serif; }
.cs-col.is-de h3 { color: var(--de); }
.cs-col.is-het h3 { color: var(--het); }
.cs-col h3 small { display: block; margin-top: 4px; font: 600 12px 'DM Sans', sans-serif; color: var(--text-muted); letter-spacing: .02em; }
.cs-col ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.cs-col li { font-size: 14px; line-height: 1.55; }
.cs-col li strong { display: block; }
.cs-col li span { color: var(--text-muted); }
.cs-rows { display: grid; gap: 8px; margin-top: 16px; padding: 14px 16px; border-radius: 10px; background: var(--workbook-sage); color: var(--workbook-ink); font-size: 14px; line-height: 1.6; }
.cs-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.cs-table th, .cs-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.cs-table thead th { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.cs-table tbody th { font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.cs-table tbody tr:last-child th, .cs-table tbody tr:last-child td { border-bottom: 0; }

/* --- quiz --- */
.cs-quiz-word { display: grid; justify-items: center; gap: 2px; margin: 18px 0 14px; font: 700 40px/1.2 'Playfair Display', Georgia, serif; text-align: center; }
.cs-quiz-word small { font: 500 14px 'DM Sans', sans-serif; color: var(--text-muted); }
.cs-quiz-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 160px)); justify-content: center; gap: 12px; }
.cs-choice { min-height: 56px; border: 2px solid; border-radius: 12px; background: var(--card); font: 700 24px 'Playfair Display', Georgia, serif; cursor: pointer; }
.cs-choice.is-de { color: var(--de); border-color: var(--de); }
.cs-choice.is-het { color: var(--het); border-color: var(--het); }
.cs-choice.is-de:hover:not(:disabled), .cs-choice.is-de.is-right { background: var(--de-bg); }
.cs-choice.is-het:hover:not(:disabled), .cs-choice.is-het.is-right { background: var(--het-bg); }
.cs-choice.is-wrong { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.cs-choice:disabled { cursor: default; }
.cs-choice:disabled:not(.is-right):not(.is-wrong) { opacity: .45; }
.cs-quiz-feedback { min-height: 24px; margin-top: 14px; font-size: 14.5px; line-height: 1.6; text-align: center; }
.cs-quiz-feedback.is-right { color: var(--de); }
.cs-quiz-feedback.is-wrong { color: var(--danger); }
.cs-quiz-next { display: flex; margin: 14px auto 0; }

/* --- mistakes, PDF, links --- */
.cs-mistakes { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; font-size: 14.5px; line-height: 1.6; }
.cs-wrong { color: var(--danger); text-decoration: line-through; }
.cs-right { color: var(--de); font-weight: 700; }
.cs-pdf { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px 28px; background: var(--workbook-sage); border-color: var(--workbook-sage-border, var(--border)); }
/* A thumbnail only: small, slightly tilted paper. The image itself is low
   resolution on purpose, so it cannot stand in for the PDF. */
.cs-pdf-preview { position: relative; display: block; width: 118px; transform: rotate(-3deg); transition: transform .2s ease; }
.cs-pdf-preview:hover { transform: rotate(-1deg) translateY(-3px); }
.cs-pdf-preview img { display: block; width: 100%; height: auto; border-radius: 3px; background: #fff; box-shadow: 0 1px 2px rgba(42, 37, 32, .12), 0 8px 22px rgba(42, 37, 32, .16); -webkit-user-drag: none; user-select: none; pointer-events: none; }
.cs-pdf-badge { position: absolute; right: -8px; bottom: 10px; padding: 3px 7px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.cs-pdf .cs-muted { margin-top: 4px; max-width: 460px; color: var(--workbook-ink); }
.cs-pdf-actions { display: grid; justify-items: center; gap: 8px; }
.cs-links { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cs-links a { display: grid; gap: 3px; height: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none; }
.cs-links a:hover { border-color: var(--workbook-ink); }
.cs-links strong { color: var(--workbook-ink); }
.cs-links span { font-size: 13px; color: var(--text-muted); }

@media (max-width: 900px) {
  .cs-sidebar { margin-bottom: 28px; }
  .cs-guide { background: var(--card); border: 1px solid var(--border); border-radius: 10px; }
  .cs-guide-toggle { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 12px 14px; list-style: none; color: var(--text); font-size: 13px; font-weight: 700; cursor: pointer; }
  .cs-guide-toggle::-webkit-details-marker { display: none; }
  .cs-guide-toggle::after { content: '+'; font-size: 20px; font-weight: 400; line-height: 1; color: var(--workbook-ink); }
  .cs-guide[open] > .cs-guide-toggle::after { content: '−'; }
  .cs-guide-toggle-label { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--text-muted); }
  .cs-guide-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 10px; }
  .cs-guide-body { padding: 0 12px 12px; }
  .cs-topics { margin-bottom: 12px; }
  .cs-section-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .cs-section-nav > p { display: none; }
  .cs-section-nav a { min-height: 44px; }
  .cheat-sheet-layout > .cs-wrap { padding-bottom: 48px; }
}

@media (max-width: 700px) {
  .cs-hero h1 { font-size: 36px; }
  .cs-hero h1 span { font-size: 21px; }
  .cs-answer { font-size: 16.5px; }
  .cs-card { padding: 20px 16px; }
  .cs-checker-form { flex-direction: column; }
  .cs-checker-form .cs-button { width: 100%; }
  .cs-columns, .cs-links { grid-template-columns: 1fr; }
  .cs-card-head .cs-download { width: 100%; justify-content: center; min-height: 44px; }
  .cs-quiz-word { font-size: 34px; }
  .cs-quiz-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-pdf { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .cs-pdf .cs-muted { margin-left: auto; margin-right: auto; }
  .cs-pdf-preview { width: 104px; margin-top: 4px; }
  .cs-pdf-actions, .cs-pdf .cs-button { width: 100%; }
  .cs-table { font-size: 13.5px; }
  .cs-table th, .cs-table td { padding: 9px 8px; }
}
