/* Student · Report a bug — R1 Report Composer.
   Tokens and control shapes follow the released S3.2 Settings Workspace and the
   MP2 passport, so a student moving between them sees one product. The sheet
   holds the report; the tray says what travels with it. Scoped to the route. */
body.student-report-page { background: #fff; }
body.student-report-page .app-inner.rc-page { max-width: 1240px !important; }

.rc {
  --ink: #16233f; --navy: #081f47; --action: #1559b0; --focus: #1f6fd6; --muted: #56677a;
  --rule: #dfe4ec; --line: #cbd6e4; --line-hover: #aebed2; --divider: #e6ebf1; --paper: #f6f8fb;
  --tray: #f4f7fb; --tray-rule: #e2e8f0; --slate: #34465f;
  --ok: #18583a; --bad: #a1271b; --bad-bg: #fbeceb; --warn: #7a4b08; --warn-bg: #fdf5e6;
  position: relative; min-width: 0; color: var(--ink);
  font: 16px/1.55 'IBM Plex Sans', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
  container: rc / inline-size;
}
.rc *, .rc *::before, .rc *::after { box-sizing: border-box; }
.rc :where(h1, h2, h3, p, ul, dl, dd, fieldset, legend) { margin: 0; padding: 0; }
.rc :where(ul) { list-style: none; }
.rc :where(fieldset) { border: 0; min-width: 0; }
.rc :where(button, input, select, textarea) { font: inherit; color: inherit; }
.rc a { color: var(--action); text-decoration: none; text-underline-offset: 3px; }
.rc a:hover { text-decoration: underline; }
.rc ::selection { background: #d9e9ff; color: var(--navy); }
.rc :focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.rc [tabindex="-1"]:focus { outline: none; }
.rc-ico { width: 18px; height: 18px; flex: none; }
.rc-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.rc [hidden] { display: none !important; }

/* ---------- where you are ---------- */
.rc-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; min-height: 44px; margin: -6px 0 10px; font-size: 14px; }
.rc-back { display: inline-flex; align-items: center; gap: 2px; text-decoration: none !important; min-height: 44px; margin-left: -6px; padding: 0 4px 0 0; border-radius: 8px; color: var(--action); font-weight: 500; }
.rc-back:hover #rc-back-label { text-decoration: underline; }
.rc-back .rc-ico { transition: transform 160ms cubic-bezier(.16, 1, .3, 1); }
.rc-back:hover .rc-ico { transform: translateX(-3px); }
.rc-crumb-sep { margin-left: 6px; color: var(--muted); font-weight: 400; }
/* The page's h1, at breadcrumb size: the question below is the display line.
   #rc-root out-weighs the frame's phone sizes for this one title. */
body.pf-frame-v1 #rc-root .rc-pagehead { margin: 0 !important; }
body.pf-frame-v1 #rc-root .rc-pagehead .pf-pagehead-title { font-size: 14px !important; font-weight: 500 !important; line-height: 1.4 !important; letter-spacing: 0; color: var(--muted) !important; }
.rc-pagehead .pf-pagehead-main { flex: none; }

/* ---------- the two columns: S3.2's footprint, mirrored ---------- */
.rc-layout { display: grid; grid-template-columns: minmax(0, 720px) 280px; column-gap: 48px; align-items: start; }
.rc-main { position: relative; min-width: 0; }

.rc-title { font-size: 30px; font-weight: 600; line-height: 1.16; letter-spacing: -.028em; color: var(--ink); text-wrap: balance; }
.rc-lede { text-wrap: pretty; margin-top: 8px; max-width: 60ch; font-size: 16px; line-height: 1.5; color: var(--slate); }
.rc-restored { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 10px; margin-top: 14px; font-size: 14px; color: var(--slate); }
.rc-inline { min-height: 44px; margin-block: -10px; padding: 0 2px; border: 0; background: none; color: var(--action); font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.rc-form { margin-top: 24px; }

/* ---------- the sheet ---------- */
.rc-sheet { position: relative; border: 1px solid var(--line); border-radius: 14px; background: #fff; transition: border-color 140ms ease, box-shadow 140ms ease; }
.rc-sheet:hover { border-color: var(--line-hover); }
/* Writing is the page's one focused state: the frame answers, immediately. */
.rc-sheet:has(textarea:focus) { border-color: var(--focus); box-shadow: inset 0 0 0 1px var(--focus); }
.rc-sheet.is-invalid { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.rc-sheet.is-invalid:has(textarea:focus) { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }

.rc-bar { display: flex; align-items: center; padding: 8px 8px 0 20px; }


.rc-where { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; }
.rc-where label { flex: none; color: var(--muted); }
.rc-select { position: relative; display: inline-flex; min-width: 0; }
.rc-select::after { content: ""; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; margin-top: -6px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
.rc-select select { field-sizing: content; min-height: 40px; max-width: 220px; padding: 0 30px 0 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; appearance: none; color: var(--ink); font-size: 15px; font-weight: 500; text-overflow: ellipsis; cursor: pointer; transition: background-color 140ms, border-color 140ms; }
.rc-select select:hover { background: var(--paper); border-color: var(--rule); }

.rc-other { display: grid; gap: 4px; padding: 14px 20px 0; }
.rc-other label { font-size: 13.5px; color: var(--muted); }
.rc-other input { min-height: 44px; padding: 0 12px; border: 1px solid #b7c5d7; border-radius: 8px; background: #fff; font-size: 16px; caret-color: var(--action); }
.rc-other input::placeholder { color: #5f6f86; opacity: 1; }

/* The field the page exists for: writing size, writing measure, no inner box. */
.rc-label { display: block; padding: 20px 20px 0; font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--ink); }
/* Beside the words as they are written: on a phone with the keyboard open this
   is the warning still in view, and reports are kept. */
.rc-note { padding: 2px 20px 0; font-size: 14px; line-height: 1.45; color: var(--slate); }
.rc-note-sent, .rc-note-urgent, .rc-sent-line { display: none; }
.rc-other-note { margin: 6px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--slate); }
.rc-note a { display: inline-block; padding-block: 3px; font-weight: 500; white-space: nowrap; }
.rc-sheet textarea:focus-visible { outline: none; }
.rc-sheet textarea { display: block; width: 100%; min-height: 248px; margin: 0; padding: 10px 20px 22px; border: 0; border-radius: 0 0 13px 13px; background: transparent; outline: none; resize: none; font-size: 17px; line-height: 1.6; color: var(--ink); caret-color: var(--action); overflow-y: auto; scroll-padding-block: 12px; }
.rc-sheet textarea::placeholder { color: #5f6f86; opacity: 1; }
.rc-sheet textarea:read-only { color: var(--slate); }
.rc-meter { padding: 0 20px 10px; text-align: right; font-size: 13px; color: var(--muted); }
.rc-meter.is-over { color: var(--bad); font-weight: 500; }
.rc-sheet.has-meter textarea { padding-bottom: 8px; }

.rc-error { display: flex; align-items: flex-start; gap: 6px; margin-top: 8px; font-size: 14px; color: var(--bad); }

/* ---------- sending and failing ---------- */
.rc-alert { display: flex; gap: 12px; margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--bad-bg); color: #5f170f; animation: rc-appear 220ms cubic-bezier(.16, 1, .3, 1); }
.rc-alert > .rc-ico { width: 20px; height: 20px; margin-top: 1px; color: var(--bad); }
.rc-alert-text { min-width: 0; }
.rc-alert-title { text-wrap: pretty; font-size: 15px; font-weight: 600; line-height: 1.4; color: #7c1c12; }
.rc-alert-body { margin-top: 2px; font-size: 14px; line-height: 1.5; }
.rc[data-tone="notice"] .rc-alert { background: var(--warn-bg); color: #4d3608; }
.rc[data-tone="notice"] .rc-alert > .rc-ico { color: var(--warn); }
.rc[data-tone="notice"] .rc-alert-title { color: #4d3608; }
@keyframes rc-appear { from { opacity: .3; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.rc-send { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; margin-top: 16px; }
.rc-care { display: flex; gap: 9px; flex: 1 1 auto; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.rc-care .rc-ico { margin-top: 1px; color: var(--muted); }
.rc-care a { font-weight: 500; white-space: nowrap; }
.rc-send-bar { display: flex; flex: none; align-items: center; gap: 8px; }
/* Fixed widths: a change of label or emphasis must not move a button under a press. */
.rc-send-bar .rc-quiet { min-width: 148px; }
.rc-send-bar #rc-copy, .rc-send-bar #rc-submit { min-width: 176px; }
.rc-submit { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-width: 148px; min-height: 46px; padding: 11px 22px; border-radius: 9px; border: 1px solid var(--navy); background: var(--navy); color: #fff !important; font-size: 15px; font-weight: 500; line-height: 1.3; white-space: nowrap; cursor: pointer; text-decoration: none !important; transition: background-color 140ms, border-color 140ms; }
@media (hover: hover) { .rc-submit:hover { background: var(--action); border-color: var(--action); } }
.rc-submit:active { background: #0f4a96; border-color: #0f4a96; }
.rc-submit[aria-disabled="true"] { background: var(--navy); border-color: var(--navy); cursor: progress; }
.rc-spin { display: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .34); border-top-color: #fff; animation: rc-spin .8s linear infinite; }
.rc[data-state="sending"] .rc-spin { display: block; }
@keyframes rc-spin { to { transform: rotate(360deg); } }
.rc[data-state="sending"] .rc-where { opacity: .6; }

/* ---------- received ---------- */
.rc-done-head { display: flex; align-items: flex-start; gap: 16px; }
.rc-marker { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--navy); color: #fff; }
.rc-tick { width: 24px; height: 24px; }
.rc-tick path { stroke-dasharray: 24; animation: rc-draw 300ms 120ms cubic-bezier(.16, 1, .3, 1) backwards; }
@keyframes rc-draw { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
.rc-done-text { min-width: 0; padding-top: 4px; }
.rc-done-text .rc-title { font-size: 26px; }
.rc-sent { margin-top: 24px; padding: 14px 0 0 60px; }
.rc-sent-label { font-size: 13px; color: var(--muted); }
.rc-sent-message { margin-top: 2px; max-width: 60ch; font-size: 15.5px; line-height: 1.5; color: var(--slate); white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden; }
.rc-done-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 18px; padding-left: 60px; }
.rc-quiet { display: inline-flex; align-items: center; justify-content: center; text-decoration: none !important; min-height: 44px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--action); font-size: 14.5px; font-weight: 500; cursor: pointer; transition: background-color 140ms; }
@media (hover: hover) { .rc-quiet:hover { background: #eef3fa; } }

/* ---------- the tray ---------- */
.rc-tray { position: sticky; top: 88px; padding: 18px 16px 16px; border-radius: 16px; background: var(--tray); }
.rc-tray-title { padding: 0 2px; font-size: 14.5px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.rc-facts { display: grid; gap: 12px; margin-top: 12px; }
.rc-facts li { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 11px; align-items: start; }
.rc-facts .rc-ico { margin: 1px 0 0; color: var(--muted); }
.rc-fact { display: flex; flex-direction: column; min-width: 0; }
.rc-fact-name { font-size: 13px; line-height: 1.35; color: var(--muted); }
.rc-fact-value { font-size: 14px; font-weight: 500; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.rc-tray-note { margin-top: 14px; padding: 12px 2px 0; border-top: 1px solid var(--tray-rule); font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.rc-tray-note a { font-weight: 500; white-space: nowrap; }
.rc-tray-alt { margin-top: 8px; padding: 0 2px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.rc-tray-alt a { font-weight: 500; white-space: nowrap; }
/* Beside a receipt the tray is the record of what went, and its promise has been
   made once already. Beneath one, on narrower pages, it would only repeat it. */
.rc[data-state="sent"] .rc-tray-note, .rc[data-state="sent"] .rc-tray-alt { display: none; }

/* ---------- motion: one opening, the shell never moves ---------- */
.rc.is-opening { overflow: clip; }
.rc-main.is-swapping { overflow-y: clip; }
.rc-leaving { position: absolute; top: 0; left: 0; right: 0; pointer-events: none; }

/* ---------- composition by the root's own width ----------
   1024px beside the sidebar and the 769–1023px drawer range land here too: one
   writing column, the tray beneath it as a band, three facts across. */
@container rc (max-width: 959px) {
  /* The tray now sits after Send, so what travels is said before it. */
  .rc-note-sent { display: inline; }
  .rc-layout { grid-template-columns: minmax(0, 720px); row-gap: 32px; }
  .rc-tray { position: static; max-width: 720px; padding: 16px 18px; }
  .rc[data-state="sent"] .rc-tray { display: none; }
  .rc-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}
@container rc (max-width: 600px) {
  .rc-facts { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .rc-sent { padding-left: 0; }
  .rc-done-actions { padding-left: 0; }
  .rc-form { margin-top: 18px; }
  .rc-send-bar { flex-direction: column; align-items: stretch; }
  .rc-send-bar #rc-submit { order: -1; }
  .rc-send-bar .rc-quiet { width: 100%; }
  .rc-send { flex-direction: column; align-items: stretch; }
  .rc-send-bar .rc-submit, .rc-done-actions .rc-submit { width: 100%; }
  .rc-done-actions { flex-direction: column; align-items: stretch; }
  .rc-quiet { width: 100%; }
  .rc-title { font-size: 26px; }
  .rc-done-text .rc-title { font-size: 24px; }
  .rc-lede { font-size: 15.5px; }
  .rc-bar { padding: 4px 6px 0 16px; }
  .rc-where { flex: 1; justify-content: space-between; }
  .rc-where label { font-size: 14px; }
  .rc-select select { min-height: 44px; max-width: 214px; font-size: 16px; }
  .rc-sheet textarea { min-height: max(140px, 17svh); padding-inline: 16px; }
  .rc-label { padding: 16px 16px 0; }
  .rc-note { padding-inline: 16px; }
  .rc-other { padding-inline: 16px; }
}

/* the shell's phone layout: focus clears the bottom navigation, and with the
   keyboard open Send stays in reach above it (set by the script, from the same
   visual-viewport test the phone search uses) */
@media (max-width: 768px) {
  .rc-page { --rc-clear: calc(var(--student-mobile-nav-height, 76px) + 12px + env(safe-area-inset-bottom, 0px)); }
  .rc-submit, .rc-send-bar, .rc textarea, .rc select, .rc input { scroll-margin-bottom: var(--rc-clear); }
  .rc-crumb-sep { display: none; }
  /* Hosted in the shell there is no masthead: the composer claims the shell's
     phone header, which hides the desktop navbar and would hide this head too.
     So this row stays, and the capsule rides beside it; a long page name wraps
     rather than runs beneath it. */
  body:not(:has(.pp-mobhead)) #rc-root .rc-pagehead { display: block !important; }
  body:not(:has(.pp-mobhead)) .rc-crumbs { margin-top: calc(env(safe-area-inset-top, 0px) + 10px); padding-right: 128px; }
  body.rc-keyboard .student-mobile-nav { display: none !important; }
  /* Send stays reachable at any screen height, in Safari's short viewport as much
     as a tall one, instead of being cut off by the bottom navigation. `contents`
     lets it stick within the whole form rather than its own short row. */
  .rc-send { display: contents; }
  /* The urgent line goes under Send, which is pinned: above it, the bar cut the
     sentence in half. The field's note carries the short version and its link, and
     where the report goes, in view before Send; the details follow straight after it. */
  .rc-form { display: flex; flex-direction: column; }
  .rc-form > * { min-width: 0; }
  .rc-sent-line { display: block; order: 1; margin-top: 12px; font-size: 13.5px; line-height: 1.5; color: var(--muted); text-align: center; }
  .rc-care { order: 2; margin-top: 12px; }
  .rc-care a { display: none; }
  .rc-note-urgent { display: block; padding-top: 2px; }
  .rc-send-bar { position: sticky; bottom: calc(var(--student-mobile-nav-height, 76px) + env(safe-area-inset-bottom, 0px)); z-index: 5; margin: 12px -16px 0; padding: 8px 16px; background: #fff; }
  .rc-send-bar::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 14px; background: linear-gradient(to top, #fff, rgba(255, 255, 255, 0)); pointer-events: none; }
  /* The shell hides its navigation for a keyboard that resizes the page. */
  body.pp-keyboard-open .rc-send-bar { bottom: env(safe-area-inset-bottom, 0px); }
  .rc-care a { scroll-margin-bottom: calc(var(--rc-clear) + 64px); }
  .rc[data-keyboard="open"] .rc-send-bar { position: fixed; left: 0; right: 0; bottom: var(--rc-keyboard-bottom, 0px); z-index: 60; margin: 0; border-top: 1px solid var(--divider); }
  .rc[data-keyboard="open"] .rc-send-bar::before { display: none; }
  /* The keyboard covers the page's end, so the page needs that much more to scroll. */
  .rc[data-keyboard="open"] .rc-form { padding-bottom: calc(72px + var(--rc-keyboard-bottom, 0px)); }
  /* Neither fits the pinned bar, and the note keeps the short safety line. */
  .rc[data-keyboard="open"] .rc-care, .rc[data-keyboard="open"] .rc-sent-line { display: none; }
  /* The patient warning is what has to stay beside the words. Where the report goes
     was on screen above the field until now, and gives up its lines while typing. */
  .rc[data-keyboard="open"] .rc-note-sent { display: none; }
  .rc[data-keyboard="open"] .rc-sheet textarea { min-height: min(120px, var(--rc-writing-height, 120px)); max-height: var(--rc-writing-height, 40vh); mask-image: linear-gradient(to bottom, transparent, #000 10px); }
}

@media (forced-colors: active) {
  .rc-sheet:has(textarea:focus) { outline: 2px solid Highlight; }
  .rc-tray, .rc-alert, .rc-marker { border: 1px solid CanvasText; }
}
@media (prefers-reduced-motion: reduce) {
  .rc *, .rc *::before, .rc *::after { transition: none !important; }
  .rc-alert { animation: none; }
  .rc-spin { animation: none; border-top-color: rgba(255, 255, 255, .34); }
  .rc-tick path { animation: none; }
}
