/* Venturoo member challenges (v2): the four tabs, the home card, the challenge page, "Helpful", comments and replies.
   Loaded after challenges.css and uses its tokens (--ink, --muted, --rule, --paper, --ch-accent ...), so it follows light/dark.
   Neutral surfaces and 1px borders; Venturoo orange only for the primary button and the selected tab. */

/* ── nothing a member or an administrator writes may widen the page: long links and long words wrap, flex and grid children can shrink ── */
.ch-page, .ch-home, .ch-card, .ch-posts, .ch-post, .ch-empty, .ch-notes, .ch-banner, .ch-answers, .ch-workspace, .pt-dlg, .ch-panel, .ch-explain, .ch-section { overflow-wrap: anywhere; min-width: 0; max-width: 100%; }
.ch-page *, .ch-home *, .ch-card *, .ch-post *, .ch-empty *, .pt-dlg * { overflow-wrap: anywhere; }
.ch-steps li, .ch-bullets li, .ch-deliverables li, .ch-prompt span, .ch-stats li, .ch-comment-main, .ch-reply, .ch-comment, .ch-filelist li > span, .ch-glance dd, .ch-glance dt,
.ch-deliv-head, .ch-deliv-head strong, .ch-subtitle, .ch-hint, .ch-note, .ch-lede, .ch-hook, .ch-prose, .ch-card-summary, .ch-answer-text, .ch-ref, .ch-ref summary,
.ch-card-top, .ch-cat, .ch-activity, .ch-facts-line, .ch-card-error, .ch-head-chips, .ch-eyebrow, .ch-home-body, .ch-layout > * { min-width: 0; overflow-wrap: anywhere; }
.ch-deliv-head, .ch-card-top, .ch-head-chips, .ch-stats { max-width: 100%; }
.ch-chip, .ch-tag { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.ch-glance > div { gap: 4px 14px; flex-wrap: wrap; }
.ch-glance dd { text-align: right; flex: 1 1 auto; }
.ch-ptab { overflow-wrap: normal; }   /* the four tab labels are short words and must stay whole */
.ch-facts-line { color: var(--muted); font-size: 14.5px; margin: 0; }
.ch-card-error { margin: 4px 0 0; }

/* ── the four tabs: Now, Coming up, Past, My work (they share the row, also at 360px) ── */
.ch-ptabs { display: flex; gap: 6px; border-bottom: 1px solid var(--rule); margin: 0; }
.ch-ptab { flex: 1 1 auto; text-align: center; padding: 11px 6px; text-decoration: none; color: var(--muted); font: 600 15px var(--sans); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; min-width: 0; }
.ch-ptab:hover { color: var(--ink); }
.ch-ptab.on { color: var(--ink); border-bottom-color: var(--ch-accent); }
.ch-ptab:focus-visible { outline: 2px solid var(--ch-accent); outline-offset: -2px; border-radius: 6px; }
.ch-explain { color: var(--muted); font-size: 15px; line-height: 1.5; margin: 14px 0 22px; }
@media (min-width: 640px) {
  .ch-ptabs { gap: 28px; }
  .ch-ptab { flex: 0 0 auto; padding-left: 2px; padding-right: 2px; }
}
.ch-groupt { font: 600 13px var(--sans); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 26px 0 12px; }
.ch-groupt:first-child { margin-top: 0; }
.ch-empty p { margin: 0 0 4px; font-size: 16px; color: var(--ink); }
.ch-empty { margin-bottom: 22px; }

/* ── cards ── */
.ch-stack { display: grid; gap: 20px; max-width: 820px; }
.ch-card2 { position: relative; }
.ch-card2:hover { border-color: var(--border-input); }
.ch-card-link::after { content: ''; position: absolute; inset: 0; }
.ch-card-link:focus-visible { outline: 2px solid var(--ch-accent); outline-offset: 4px; border-radius: 4px; }
.ch-card2 .ch-card-foot .ch-btn, .ch-home .ch-card-foot .ch-btn { position: relative; z-index: 1; }
.ch-card-soon { border-style: dashed; }
.ch-cover { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 240px; object-fit: cover; background: var(--paper-2); border-radius: var(--ch-r); }
.ch-card2 > .ch-cover { width: calc(100% + 40px); max-width: none; margin: -20px -20px 4px; border-radius: var(--ch-r) var(--ch-r) 0 0; max-height: 200px; }
.ch-cover-wide { max-height: 300px; margin: 0 0 20px; }
.ch-hero h3 { font-size: 24px; }
/* contrast of the orange chips: at least 4.5:1 on the page (a test computes it from these values) */
.ch-chip-live, .ch-chip-submitted { color: #8a3004; border-color: #8a3004; background: rgba(200, 74, 12, .1); }
[data-theme="dark"] .ch-chip-live, [data-theme="dark"] .ch-chip-submitted { color: #ffb48f; border-color: #ffb48f; background: rgba(255, 122, 69, .14); }
.ch-chip-soon { color: var(--ink); border-style: dashed; }
.ch-btn-quiet { border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.ch-stats { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; color: var(--muted); font-size: 14.5px; }
.ch-stats li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.ch-activity { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14.5px; margin: 0; overflow-wrap: anywhere; }
.ch-activity .ch-ico, .ch-stats .ch-ico { color: var(--muted); }

/* ── the home card (top of the Community page) ── */
.pt-home:empty { display: none; }
.pt-home { margin: 0 0 26px; }
.ch-home { display: grid; border: 1px solid var(--rule); border-radius: var(--ch-r); background: var(--paper); overflow: hidden; position: relative; }
.ch-home-soon { border-style: dashed; }
.ch-home > .ch-cover { border-radius: 0; max-height: 220px; }
.ch-home-body { display: grid; gap: 10px; padding: 20px 22px 22px; min-width: 0; }
.ch-eyebrow { font: 600 12.5px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0; }
.ch-home h2 { font-size: clamp(22px, 2.6vw, 28px); line-height: 1.2; letter-spacing: -0.02em; margin: 0; overflow-wrap: anywhere; }
.ch-home h2 a { color: inherit; text-decoration: none; }
.ch-home h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── the challenge page ── */
.ch-hook { font-size: 19px; line-height: 1.5; font-weight: 500; max-width: 38em; margin: 0 0 8px; overflow-wrap: anywhere; }
.ch-notes { border: 1px solid var(--rule); border-radius: var(--ch-r); background: var(--paper-2); padding: 14px 18px; }
.ch-notes p { margin: 8px 0 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.ch-notes-title { display: flex; align-items: center; gap: 8px; font: 600 13px var(--sans); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 0; }
.ch-notes-slim { margin: 0 0 18px; }
.ch-ref { border: 1px solid var(--rule); border-radius: 10px; padding: 10px 16px; margin: 0 0 18px; }
.ch-ref summary { cursor: pointer; font-weight: 600; }
.ch-ref .ch-steps { margin: 12px 0 4px; }
.ch-actionhint { margin: 10px 0 0; }
.ch-sharedline { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; }
.ch-sharehint { margin: 10px 0 0; }
.ch-banner-ok { border-color: var(--ink); }

/* ── the submit dialog ── */
.ch-check { display: flex; gap: 12px; align-items: flex-start; margin: 16px 0; cursor: pointer; }
.ch-check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--ink); }
.ch-check span { display: grid; gap: 2px; } .ch-check small { color: var(--muted); font-size: 14px; }
.ch-check:has(input:focus-visible) { outline: 2px solid var(--ch-accent); outline-offset: 4px; border-radius: 6px; }

/* ── community: "Helpful", comments and replies ── */
.ch-reactrow { display: flex; align-items: center; gap: 12px; margin: 18px 0 4px; color: var(--muted); font-size: 14.5px; }
.ch-reacthint { min-width: 0; overflow-wrap: anywhere; }
.ch-note[hidden] { display: none; }
.ch-react { gap: 6px; }
.ch-react.on { color: var(--ink); border-color: var(--ink); background: var(--paper-2); }
.ch-comments, .ch-replies { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.ch-comment { display: flex; gap: 12px; align-items: flex-start; }
.ch-comment-main { min-width: 0; flex: 1; }
.ch-comment-main > p { margin: 0 0 4px; overflow-wrap: anywhere; }
.ch-comment-actions { display: flex; gap: 14px; }
.ch-replies { margin: 10px 0 0; padding-left: 14px; border-left: 2px solid var(--rule); }
.ch-reply { display: flex; gap: 10px; align-items: flex-start; }
.ch-prompt-tag { color: var(--muted); font-size: 13.5px; font-style: italic; }
.ch-replyform { margin-top: 10px; }
.ch-replyform .ch-card-foot { margin-top: 8px; }
.ch-prompts { border: 1px solid var(--rule); border-radius: 10px; padding: 8px 14px 10px; margin: 8px 0 0; min-width: 0; }
.ch-prompts legend { font-size: 14px; font-weight: 600; padding: 0 6px; margin-left: -6px; }
.ch-prompt { display: flex; gap: 10px; align-items: flex-start; padding: 4px 0; cursor: pointer; font-size: 15px; }
.ch-prompt input { margin: 4px 0 0; flex: none; accent-color: var(--ink); }
.ch-prompt:has(input:focus-visible) { outline: 2px solid var(--ch-accent); outline-offset: 2px; border-radius: 6px; }

@media (max-width: 520px) {
  .ch-ptab { font-size: 14px; padding-left: 2px; padding-right: 2px; }
  .ch-ptabs { gap: 2px; }
  .ch-home-body { padding: 16px 16px 18px; }
  .ch-card2 > .ch-cover { width: calc(100% + 32px); margin: -16px -16px 4px; }
  .ch-card2 { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { .ch-card2, .ch-home { transition: none; } }
