/* Feedback loop (reports + thumbs) and the two-way lesson <-> problem links. Loaded by js/feedback.js. Site tokens only. */

/* ---- thumbs + report row ---- */
.fb-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 16px 0 0; padding: 10px 0 0; border-top: 1px solid var(--border); font-family: var(--font-sans); font-size: var(--fs-sm); color: var(--text-muted); }
.fb-row--box { margin: 0 0 var(--space-4); padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-elev); }
.fb-row__q { margin-right: 4px; }
.fb-thumbs { display: inline-flex; gap: 6px; }
.fb-thumb { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 34px; padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--bg-elev); color: var(--text-muted); cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.fb-thumb svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.fb-thumb:hover { border-color: var(--accent); color: var(--accent); }
.fb-thumb:focus-visible { outline: none; box-shadow: var(--focus); }
.fb-thumb[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.fb-thumb[aria-pressed="true"] svg { fill: currentColor; fill-opacity: .18; }
.fb-report { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 4px; border: 0; background: none; color: var(--text-faint); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
.fb-report svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fb-report:hover { color: var(--accent); text-decoration-color: var(--accent); }
.fb-report:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.fb-thanks { font-size: var(--fs-xs); color: var(--ok); min-height: 1em; }

/* inside the coding IDE's description column */
.cs-leftbody .fb-row { margin: 18px 0 8px; }

/* lesson player: the report flag in the top bar */
.lp__report { width: 34px; height: 34px; border: 0; background: none; color: var(--text-faint); cursor: pointer; border-radius: 50%; display: grid; place-items: center; flex: none; }
.lp__report:hover { background: var(--bg-sunken); color: var(--text); }
.lp__report svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* lesson end screen: "was this lesson useful" */
.lp-end .fb-row { justify-content: center; border-top: 0; margin: 14px 0 0; padding: 0; }
.lp-end .fb-report { margin-left: 0; }

/* ---- the modal ---- */
.fb-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(28, 25, 21, .5); animation: fbIn .16s ease-out both; }
.fb-modal__card { width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--bg-elev); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px 20px 18px; font-family: var(--font-sans); }
.fb-modal__h { margin: 0 28px 2px 0; font: 500 var(--fs-lg)/1.25 var(--font-display); }
.fb-modal__sub { margin: 0 0 14px; font-size: var(--fs-sm); color: var(--text-muted); overflow-wrap: anywhere; }
.fb-modal__x { position: absolute; }
.fb-modal__top { position: relative; }
.fb-modal__close { position: absolute; top: -4px; right: -6px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--text-muted); font-size: 22px; line-height: 1; cursor: pointer; }
.fb-modal__close:hover { background: var(--bg-sunken); color: var(--text); }
.fb-reasons { display: grid; gap: 6px; margin: 0 0 12px; padding: 0; border: 0; }
.fb-reasons legend { padding: 0; margin-bottom: 6px; font-size: var(--fs-xs); font-weight: 700; color: var(--text-faint); }
.fb-reason { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; font-size: var(--fs-md); background: var(--bg); }
.fb-reason:hover { border-color: var(--border-strong); }
.fb-reason input { accent-color: var(--accent); margin: 0; width: 16px; height: 16px; }
.fb-reason:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.fb-reason:has(input:focus-visible) { box-shadow: var(--focus); }
.fb-label { display: block; margin: 0 0 6px; font-size: var(--fs-sm); color: var(--text-muted); }
.fb-text { width: 100%; box-sizing: border-box; min-height: 84px; resize: vertical; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); color: var(--text); font: var(--fs-md)/1.45 var(--font-sans); }
.fb-text:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.fb-modal__err { margin: 10px 0 0; font-size: var(--fs-sm); color: var(--bad); }
.fb-modal__err a { color: inherit; }
.fb-modal__foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 14px; }
.fb-modal__who { margin-right: auto; font-size: var(--fs-xs); color: var(--text-faint); }
.fb-modal__done { text-align: center; padding: 12px 0 4px; }
.fb-modal__done b { display: block; margin-bottom: 4px; font: 500 var(--fs-lg) var(--font-display); }
@keyframes fbIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fb-modal { animation: none; } }
@media (max-width: 480px) { .fb-modal { align-items: flex-end; padding: 0; } .fb-modal__card { width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; } }

/* ---- Learn this (problem page) ---- */
.br-learn { display: block; margin: 0 0 var(--space-4); padding: 12px 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: var(--bg-elev); font-family: var(--font-sans); }
.br-learn__h { margin: 0 0 8px; font-size: var(--fs-xs); font-weight: 700; color: var(--text-faint); }
.br-learn__list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.br-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 0 -10px; border-radius: var(--radius); color: var(--text); text-decoration: none; }
.br-link:hover { background: var(--accent-soft); text-decoration: none; }
.br-link:focus-visible { outline: none; box-shadow: var(--focus); }
.br-link__ico { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.br-link__ico svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.br-link__t { flex: 1; min-width: 0; font-size: var(--fs-md); line-height: 1.3; font-weight: 600; }
.br-link__m { flex: none; font-size: var(--fs-xs); color: var(--text-faint); white-space: nowrap; }
.br-link__go { flex: none; color: var(--accent); font-weight: 700; }
.br-learn--ide { margin: 14px 0 0; }

/* ---- Practise next (lesson end screen + recap card) ---- */
.br-practise { margin: 18px auto 0; max-width: 560px; text-align: left; font-family: var(--font-sans); }
.br-practise .br-learn__h { text-align: center; }
.br-practise__list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.br-prob { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); color: var(--text); text-decoration: none; }
.br-prob:hover { border-color: var(--accent); text-decoration: none; }
.br-prob:focus-visible { outline: none; box-shadow: var(--focus); }
.br-prob__t { flex: 1; min-width: 0; font-size: var(--fs-md); line-height: 1.3; font-weight: 600; }
.br-prob__d { flex: none; font-size: var(--fs-xs); font-weight: 700; text-transform: capitalize; }
.br-prob__d--easy { color: var(--easy); } .br-prob__d--medium { color: var(--medium); } .br-prob__d--hard { color: var(--hard); }
.br-practise--recap { margin-top: 16px; max-width: none; }
.br-practise--recap .br-learn__h { text-align: left; }

/* ---- triage page ---- */
.tg { padding: var(--space-5) 0 var(--space-7); font-family: var(--font-sans); }
.tg h1 { font: 500 var(--fs-2xl)/1.15 var(--font-display); margin: 0 0 4px; }
.tg__sub { color: var(--text-muted); margin: 0 0 var(--space-5); }
.tg__grid { display: grid; gap: var(--space-5); grid-template-columns: 1fr; }
@media (min-width: 980px) { .tg__grid { grid-template-columns: 3fr 2fr; align-items: start; } }
.tg h2 { font-size: var(--fs-xs); font-weight: 700; color: var(--text-faint); margin: 0 0 10px; }
.tg__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tg__item { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-elev); }
.tg__top { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.tg__what { font-weight: 700; overflow-wrap: anywhere; }
.tg__reason { font-size: var(--fs-xs); font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent); }
.tg__when { margin-left: auto; font-size: var(--fs-xs); color: var(--text-faint); }
.tg__text { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tg__meta { margin: 6px 0 0; font-size: var(--fs-xs); color: var(--text-faint); overflow-wrap: anywhere; }
.tg__meta a { color: inherit; }
.tg__vote { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); }
.tg__vote b { flex: none; min-width: 2.2em; font-variant-numeric: tabular-nums; color: var(--bad); }
.tg__vote span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tg__vote small { flex: none; color: var(--text-faint); }
.tg__empty, .tg__msg { padding: 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--text-muted); }
.tg__tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tg__tab { padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--bg-elev); color: var(--text-muted); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.tg__tab[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }

/* phones: the lesson top bar gained a report flag; tighten it so the progress bar keeps its width */
@media (max-width: 480px) { .lp__top { gap: 6px; padding-left: 10px; padding-right: 10px; } }
.tg__triage { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.tg__st { font-size: var(--fs-xs); font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--bg-sunken); color: var(--text-muted); }
.tg__st--open { background: color-mix(in srgb, var(--accent) 14%, var(--bg)); color: var(--accent); }
.tg__st--fixed { background: var(--ok-soft, #e3f3e8); color: var(--ok, #1d7a3a); }
.tg__note { font-size: var(--fs-xs); color: var(--text-muted); }
.tg__in { flex: 1 1 220px; min-width: 0; height: 32px; font-size: var(--fs-sm); }

.tg__error { flex-basis: 100%; color: var(--bad); font-size: 0.85rem; }
.tg__error:empty { display: none; }

.br-learn { background: none; }
.br-learn .br-link__ico { display: none; }
.br-learn .br-link__t { font-size: .95rem; font-weight: 500; }
.br-learn .br-link__go { color: var(--text-faint); font-weight: 400; }

@media (max-width: 599px) {
  .fb-row .fb-report { flex-basis: 100%; margin-left: 0; padding-left: 0; }
}
