/* Public capability showcase. Base controls, top bar and theme tokens come from parent.css. */
.capabilities { background: var(--paper); }
.capabilities .topbar { background: #fffdf8ed; }
.capabilities .topbar .button-link { flex-shrink: 0; }
.capabilities > main { max-width: 960px; padding: 0 24px 72px; }
.capabilities main > section { scroll-margin-top: 88px; }
.capabilities main > section + section { margin-top: 56px; }
.capabilities h2 { margin: 0 0 8px; font-size: 26px; }

.cap-hero { padding: 56px 0 0; }
.cap-hero h1 { font-size: 40px; line-height: 1.2; }
.cap-hero .lead { max-width: 640px; margin: 16px 0 0; color: var(--muted); font-size: 17px; line-height: 1.7; }
.cap-note { max-width: 640px; margin: 16px 0 0; padding: 12px 16px; border-radius: 14px; background: var(--sun-light); color: #604110; font-size: 14px; line-height: 1.7; }
.cap-scoring { max-width: none; margin: 0 0 20px; }
.cap-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.cap-toc a { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 14px; font-weight: 600; text-decoration: none; }
.cap-toc a:hover { background: var(--primary-light); }

.cap-section-lead { max-width: 680px; margin: 0 0 20px; color: var(--muted); font-size: 15px; }
.cap-list { display: grid; gap: 10px; }
.cap-card { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: var(--card-radius); background: #fff; }
.cap-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cap-card-head h3 { margin: 0; font-size: 20px; font-weight: 800; }
/* Each item is a closed row until it is opened. */
details.cap-card { padding: 0; }
details.cap-card > summary { min-height: 60px; padding: 14px 56px 14px 24px; position: relative; cursor: pointer; list-style: none; border-radius: var(--card-radius); }
details.cap-card > summary:hover { background: var(--primary-light); }
details.cap-card > summary::after, .cap-fold > summary::after { content: "+"; position: absolute; right: 24px; top: 50%; transform: translateY(-50%); color: var(--subtle); font-size: 24px; font-weight: 400; line-height: 1; }
details.cap-card[open] > summary::after, .cap-fold[open] > summary::after { content: "–"; }
details.cap-card[open] > summary { border-radius: var(--card-radius) var(--card-radius) 0 0; }
.cap-card-head h3 { font-size: 18px; }
.cap-card-body { padding: 0 24px 24px; }
.cap-card-body > :first-child { margin-top: 0; }
:is(.cap-card, .cap-card-body) > p { margin: 10px 0 0; font-size: 15px; }
:is(.cap-card, .cap-card-body) > p.muted { font-size: 14px; }
:is(.cap-card, .cap-card-body) > ul { margin: 10px 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.8; }
/* A whole section folded behind its heading. */
.cap-fold { border: 1px solid var(--line); border-radius: var(--card-radius); background: #fff; }
.cap-fold > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; min-height: 68px; padding: 18px 56px 18px 24px; position: relative; cursor: pointer; list-style: none; border-radius: var(--card-radius); }
.cap-fold > summary:hover { background: var(--primary-light); }
.capabilities .cap-fold > summary h2 { margin: 0; }
.cap-fold > summary span { color: var(--muted); font-size: 14px; }
.cap-fold > :not(summary) { margin-inline: 24px; }
.cap-fold > :last-child { margin-bottom: 24px; }
.cap-toc button { min-height: 40px; padding: 6px 16px; border-color: var(--ink); background: var(--ink); color: #fff; font-size: 14px; }
.cap-toc button:hover { background: var(--night); border-color: var(--night); }
.cap-picker { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.cap-picker button { min-height: 40px; }
.cap-picker button[aria-pressed=true], .demo-modes button[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* The try-it area. Colours, radii and the layout of the question follow the iOS answering page
   (CourseDesign / CourseQuizDesign in iOS/DengKeWords/Views/Components.swift), not the web theme. */
.cap-demo { margin-top: 20px; padding: 16px; border-radius: 18px; background: var(--canvas); container: cap-demo / inline-size; }
.demo-modes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.demo-modes button { min-height: 36px; padding: 6px 16px; }
.demo-modes small { color: var(--muted); font-size: 13px; }
.demo-screen {
  --app-ink: #13231c; --app-ink-soft: #5b6b63; --app-ink-faint: #98a39c; --app-forest: #1e6b4e; --app-deep: #0f3a2b;
  --app-mint: #d6ecdf; --app-mint-soft: #eaf5ee; --app-sun: #f6b93f; --app-sun-soft: #fdf0d3;
  --app-coral: #e5654a; --app-coral-soft: #fbe6df; --app-paper: #f3f1ea;
  display: grid; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 26px; background: var(--app-paper); color: var(--app-ink);
}
.demo-screen > .app-progress { grid-column: 1 / -1; }
@container cap-demo (min-width: 640px) {
  .demo-screen:has(> .demo-material) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}
.app-progress { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; color: var(--app-ink-soft); font-size: 13px; font-weight: 600; }
.app-progress b { flex-shrink: 0; padding: 3px 12px; border-radius: 999px; background: var(--app-sun-soft); color: #7a5300; font-size: 13px; }
.demo-material { display: grid; gap: 12px; min-width: 0; }
.app-material { min-width: 0; padding: 16px 20px 20px; border-radius: 26px; background: var(--app-mint-soft); }
.app-material-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.app-material-icon { display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 12px; background: #fff; color: var(--app-forest); }
.app-material-icon .icon { width: 20px; height: 20px; }
.app-material-names { flex: 1; min-width: 0; }
.app-material-names small { display: block; color: var(--app-forest); font-size: 11.5px; font-weight: 700; line-height: 1.4; }
.app-material-names strong { display: block; overflow: hidden; font-size: 16px; font-weight: 800; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.demo-screen .app-pill { min-height: 36px; padding: 6px 14px; border: 0; background: #fff; color: var(--app-forest); font-size: 13px; font-weight: 700; }
.app-text { margin: 0; font-size: 17px; line-height: 1.75; white-space: pre-wrap; }
.app-quote { padding: 2px 0; background: var(--app-sun-soft); color: inherit; }
.app-glossary { margin: 0 0 12px; font-size: 13px; font-weight: 600; }
.app-glossary summary { min-height: 32px; color: var(--app-forest); cursor: pointer; line-height: 32px; list-style: none; }
.app-glossary summary::before { content: "＋ "; }
.app-glossary[open] summary::before { content: "－ "; }
.app-glossary > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 14px; font-weight: 400; }
.app-glossary > div span { color: var(--app-ink-soft); }
.app-player { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: #fff; }
.app-player > span { flex: 1; font-size: 14px; font-weight: 600; text-align: center; }
.demo-screen .app-play { flex-shrink: 0; width: 48px; height: 48px; min-height: 48px; padding: 0; border: 0; border-radius: 50%; background: var(--app-deep); color: var(--app-sun); }
.app-play .icon { width: 20px; height: 20px; fill: currentColor; }
.demo-screen .app-replay { flex-shrink: 0; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--app-paper); }
.app-player + .app-text, .app-player + .app-locked { margin-top: 12px; }
.app-locked { display: grid; justify-items: center; gap: 6px; padding: 16px; border-radius: 16px; background: #ffffffb3; color: var(--app-ink-soft); text-align: center; }
.app-locked .icon { width: 20px; height: 20px; color: var(--app-ink-faint); }
.app-locked strong { font-size: 14px; }
.app-locked small { color: var(--app-ink-faint); font-size: 12.5px; }
.app-material > svg { display: block; width: min(220px, 100%); height: auto; margin: 0 auto; }
.demo-answer { min-width: 0; }
.app-group { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.app-group-title { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--app-mint); color: var(--app-forest); font-size: 12.5px; font-weight: 800; }
.app-group-title .icon { width: 14px; height: 14px; }
.app-group-numbers { display: flex; gap: 12px; }
.demo-screen .app-group-numbers button { width: 32px; height: 32px; min-height: 32px; padding: 0; border: 2px solid transparent; border-radius: 50%; background: #fff; color: var(--app-ink-soft); font-size: 13px; font-weight: 800; opacity: 1; }
.demo-screen .app-group-numbers button[data-state=已作答] { border-color: #1e6b4e66; }
.demo-screen .app-group-numbers button[aria-current=true] { background: var(--app-deep); color: #fff; }
.app-group-numbers button:disabled { cursor: default; }
.app-type { margin: 0 0 12px; color: var(--app-ink-soft); font-size: 14px; font-weight: 600; }
.demo-prompt { margin: 0 0 16px; font-size: 22px; font-weight: 800; letter-spacing: -.01em; line-height: 1.4; }
.demo-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.demo-fields > input[type=text] { min-height: 56px; border-radius: 16px; font-size: 18px; }
.demo-options { display: grid; gap: 12px; }
.demo-screen .app-option { justify-content: flex-start; gap: 16px; width: 100%; min-height: 64px; padding: 14px 16px; border: 2px solid transparent; border-radius: 22px; background: #fff; color: var(--app-ink); font-size: 17px; font-weight: 600; line-height: 1.5; text-align: left; opacity: 1; }
.app-mark { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border: 2px solid #98a39c99; border-radius: 50%; color: #fff; font-size: 16px; font-weight: 800; }
.app-option[data-state=chosen] { border-color: var(--app-forest); background: var(--app-mint-soft); }
.app-option[data-state=right] { border-color: var(--app-forest); background: var(--app-mint); color: var(--app-deep); }
.app-option[data-state=wrong] { border-color: var(--app-coral); background: var(--app-coral-soft); color: var(--app-coral); }
.app-option[data-state=dim] { background: #ffffff99; color: var(--app-ink-faint); }
.app-option[data-state=dim] .app-mark { border-color: #98a39c4d; }
.app-option[data-state=chosen] .app-mark, .app-option[data-state=right] .app-mark { border-color: var(--app-forest); background: var(--app-forest); }
.app-option[data-state=wrong] .app-mark { border-color: var(--app-coral); background: var(--app-coral); }
.app-option[data-state=chosen] .app-mark::after, .app-option[data-state=right] .app-mark::after { content: "✓"; }
.app-option[data-state=wrong] .app-mark::after { content: "✕"; }
.demo-fields:disabled .app-option { cursor: default; }
.demo-screen .app-action { width: 100%; min-height: 56px; margin-top: 16px; border: 0; border-radius: 16px; background: var(--app-deep); color: #fff; font-size: 17px; font-weight: 700; }
.demo-screen .app-action:hover { background: var(--app-forest); }
.demo-status { margin: 8px 0 0; color: #a03a25; font-size: 13px; }
.demo-status:empty { margin: 0; }
.demo-sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 68px; padding: 10px; border: 2px dashed #98a39c99; border-radius: 16px; background: #fff; }
.demo-placeholder { color: var(--app-ink-faint); font-size: 14px; }
.demo-bank:empty { display: none; }
.demo-bank { display: flex; flex-wrap: wrap; gap: 10px; min-height: 44px; margin-top: 12px; }
.demo-screen .demo-chip { min-height: 44px; padding: 10px 16px; border: 0; border-radius: 14px; background: #fff; color: var(--app-ink); font-size: 18px; font-weight: 700; opacity: 1; }
.demo-fields:disabled .demo-chip { cursor: default; }
.demo-help { margin: 0 0 12px; padding: 8px 14px; border-radius: 14px; background: #fff; font-size: 14px; }
.demo-help summary { min-height: 28px; cursor: pointer; font-weight: 600; line-height: 28px; list-style: none; }
.demo-help summary::before { content: "＋ "; color: var(--subtle); }
.demo-help[open] summary::before { content: "－ "; }
.demo-help p { margin: 6px 0; line-height: 1.7; white-space: pre-wrap; }
.demo-pending { margin-top: 16px; padding: 16px 20px; border-radius: 22px; background: #fff; }
.demo-pending p { margin: 0; font-size: 14px; }
.app-feedback { margin-top: 16px; padding: 16px 20px 20px; border-radius: 22px; }
.app-feedback.is-correct { background: var(--app-mint); }
.app-feedback.is-wrong { background: var(--app-coral-soft); }
.app-feedback strong { font-size: 17px; font-weight: 800; }
.app-feedback p { margin: 8px 0 0; }
.cap-demo .upload-prose { font-size: 14px; }
.demo-evidence { padding-left: 12px; border-left: 3px solid var(--app-forest); }
.demo-summary { grid-column: 1 / -1; }
.demo-summary .demo-pending { margin-top: 0; }
.cap-demo .preview-pad button { min-height: 32px; margin: 8px 0 0; padding: 4px 14px; font-size: 12px; }
.demo-video-scene { display: grid; place-items: center; aspect-ratio: 16 / 9; border-radius: 16px; background: var(--app-deep); color: #ffffffcc; font-size: 14px; }
.demo-video-bar { height: 6px; margin-top: 8px; border-radius: 6px; background: #ffffffb3; overflow: hidden; }
.demo-video-bar span { display: block; width: 0; height: 100%; background: var(--app-forest); transition: width .16s linear; }
.demo-video .actions { margin: 12px 0 0; }
.demo-word { justify-items: start; gap: 4px; background: var(--paper); }
.demo-word-title { font-size: 34px; font-weight: 800; line-height: 1.2; }
.demo-word p { margin: 0; }
.demo-word-meaning { font-size: 20px; font-weight: 700; }
.demo-word .upload-prose { margin-top: 12px; font-size: 15px; }
.demo-word .actions { margin: 12px 0 0; }
.demo-study { display: block; background: var(--paper); font-size: 16px; }
.demo-study h4 { margin: 0 0 12px; font-size: 18px; }

.cap-subhead { margin: 28px 0 12px; font-size: 17px; font-weight: 800; }
.cap-subhead:first-of-type { margin-top: 0; }
.cap-modes { display: grid; gap: 10px; }
.cap-mode .cap-pill { margin-left: 0; }
.cap-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 14px 0 0; font-size: 14px; }
.cap-facts dt { color: var(--muted); font-weight: 700; }
.cap-facts dd { margin: 0; }
.cap-rows { border: 1px solid var(--line); border-radius: var(--card-radius); background: #fff; overflow: hidden; }
.cap-row { padding: 18px 24px; border-bottom: 1px solid var(--line); }
.cap-row:last-child { border-bottom: 0; }
.cap-row h3 { display: inline; margin: 0 10px 0 0; font-size: 16px; }
.cap-row > p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.cap-pill { margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: var(--sun-light); color: var(--sun-ink); font-size: 12px; font-weight: 700; white-space: nowrap; }
.cap-table { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--card-radius); background: #fff; }
.cap-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cap-table th, .cap-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); line-height: 1.6; text-align: left; vertical-align: top; }
.cap-table thead th { background: var(--canvas); font-size: 13px; white-space: nowrap; }
.cap-table tbody th { font-weight: 500; }
.cap-table tbody tr:last-child > * { border-bottom: 0; }
.cap-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; padding: 0 24px 40px; color: var(--subtle); font-size: 13px; }
.cap-footer a { text-decoration: none; }
.cap-footer a:hover { color: var(--ink); }

@media (max-width: 767px) {
  .capabilities > main { padding: 0 16px 56px; }
  .capabilities main > section + section { margin-top: 40px; }
  .cap-hero { padding-top: 32px; }
  .cap-hero h1 { font-size: 30px; }
  .capabilities h2 { font-size: 22px; }
  .cap-card { padding: 20px 16px; }
  details.cap-card { padding: 0; }
  details.cap-card > summary { padding: 12px 44px 12px 16px; }
  details.cap-card > summary::after, .cap-fold > summary::after { right: 16px; }
  .cap-card-body { padding: 0 16px 20px; }
  .cap-fold > summary { padding: 14px 44px 14px 16px; }
  .cap-fold > :not(summary) { margin-inline: 16px; }
  .cap-demo { padding: 10px; }
  .demo-screen { padding: 14px 12px; border-radius: 22px; }
  .app-material { padding: 12px 16px 16px; }
  .demo-prompt { font-size: 20px; }
  .cap-row { padding: 16px; }
}
