/* The discussion under a challenge (portal-challenges-discussion.js). Palette tokens only (site.css). */
.ch-disc { max-width: 780px; margin-top: 28px; }
.dz { border: 1px solid var(--rule); border-radius: 20px; background: var(--bg-card); padding: 22px 22px 18px; }
.dz-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 6px; }
.dz-head h2 { font-size: 1.25rem; margin: 0; display: flex; align-items: center; gap: 8px; }
.dz-count { font-size: .8rem; font-weight: 700; color: var(--accent-text); background: var(--brand-50); border-radius: 999px; padding: 2px 9px; }
.dz-sort { display: inline-flex; gap: 2px; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 999px; padding: 3px; }
.dz-sortbtn { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .85rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.dz-sortbtn.on { background: var(--bg-card); color: var(--ink); box-shadow: var(--shadow-1); }
.dz-empty, .dz-closed { color: var(--muted); margin: 14px 0; }
.dz-link { border: 0; background: none; padding: 0; color: var(--accent-text); font: inherit; text-decoration: underline; cursor: pointer; }

.dz-thread { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.dz-thread:last-child { border-bottom: 0; }
.dz-item { display: flex; gap: 12px; align-items: flex-start; scroll-margin-top: 90px; border-radius: 12px; transition: background-color .8s ease; }
.dz-item.dz-flash { background: var(--brand-50); }
.dz-reply { margin-top: 14px; }
.dz-l1 { margin-left: 56px; } .dz-l2 { margin-left: 92px; } .dz-l3 { margin-left: 128px; }
.dz-col { min-width: 0; flex: 1; }
.dz-av { border-radius: 50%; flex: none; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; color: var(--accent-ink); background: var(--brand-100); }
.dz-av-1 { background: var(--brand-50); color: var(--accent-text); }
.dz-av-2 { background: var(--member-tile); color: var(--member-ink); }
.dz-av-3 { background: var(--paper-3); color: var(--ink); }
.dz-av-gone { background: var(--paper-3); }
.dz-root > .dz-av { font-size: 1rem; }
.dz-name { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; }
.dz-you { font-size: .72rem; font-weight: 700; color: var(--accent-text); background: var(--brand-50); padding: 1px 7px; border-radius: 999px; }
.dz-meta { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.dz-gone .dz-meta { padding-top: 8px; }
.dz-text { margin: 8px 0 0; line-height: 1.6; overflow-wrap: anywhere; color: var(--ink); }
.dz-replyto { display: inline-block; margin-top: 6px; font-size: .82rem; color: var(--muted); }
.dz-mention { color: var(--accent-text); font-weight: 600; background: var(--brand-50); border-radius: 4px; padding: 0 2px; }
.dz-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 6px 0 0 -8px; }
.dz-act { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .86rem; font-weight: 600; padding: 6px 8px; border-radius: 8px; cursor: pointer; min-height: 32px; }
.dz-act:hover:not(:disabled) { background: var(--paper-2); color: var(--ink); }
.dz-act:disabled { cursor: default; opacity: .75; }
.dz-act.on { color: var(--accent-text); }
.dz-act span:empty { display: none; }
.dz-more { position: relative; }
.dz-menu { position: absolute; right: 0; top: 100%; z-index: 5; min-width: 150px; background: var(--bg-card); border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow-1); padding: 5px; display: grid; }
.dz-menu button { border: 0; background: transparent; text-align: left; font: inherit; font-size: .9rem; color: var(--ink); padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.dz-menu button:hover { background: var(--paper-2); }

.dz-compose { margin-top: 14px; }
.dz-replybox { margin-top: 10px; }
.dz-form { border: 1px solid var(--rule); border-radius: 16px; padding: 12px 12px 10px; background: var(--bg-card); }
.dz-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--brand-50); }
.dz-form-label { display: block; color: var(--muted); font-size: .88rem; margin-bottom: 4px; }
.dz-ta-wrap { position: relative; }
.dz-form textarea { width: 100%; border: 0; outline: 0; resize: vertical; background: transparent; color: var(--ink); font: inherit; line-height: 1.5; min-height: 52px; padding: 4px 0; }
.dz-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dz-hint { color: var(--faint); font-size: .8rem; }
.dz-form-btns { display: inline-flex; gap: 6px; margin-left: auto; }
.dz-btn, .dz-btn-ghost { border-radius: 999px; font: inherit; font-weight: 700; font-size: .9rem; padding: 8px 18px; cursor: pointer; }
.dz-btn { border: 0; background: var(--btn-solid-bg); color: var(--btn-solid-text); }
.dz-btn:disabled { opacity: .6; cursor: default; }
.dz-btn-ghost { border: 1px solid var(--rule); background: transparent; color: var(--ink); }
.dz-err { color: var(--error); font-size: .86rem; margin: 4px 0 6px; }
.dz-picker { position: absolute; left: 0; top: 100%; z-index: 6; width: min(300px, 100%); background: var(--bg-card); border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow-1); padding: 4px; }
.dz-pick { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; font: inherit; color: var(--ink); padding: 7px 8px; border-radius: 8px; cursor: pointer; text-align: left; }
.dz-pick img { border-radius: 50%; object-fit: cover; }
.dz-pick.on, .dz-pick:hover { background: var(--paper-2); }
.dz-picker-empty { margin: 6px 8px; color: var(--muted); font-size: .88rem; }

@media (max-width: 640px) {
  .dz { padding: 16px 14px 14px; border-radius: 16px; }
  .dz-l1 { margin-left: 22px; } .dz-l2 { margin-left: 38px; } .dz-l3 { margin-left: 54px; }
  .dz-sort { width: 100%; justify-content: space-between; }
  .dz-sortbtn { flex: 1; padding: 6px 4px; }
}
/* the discussion lines up with the challenge's main column (the "At a glance" panel is 340px + a 56px gap to its right) */
@media (min-width: 1200px) { .ch-disc { max-width: min(860px, calc(100% - 396px)); } }
