/* =====================================================================
   r41 UI polish — loaded last (end of <body>) so it wins over the
   earlier patch layers in index.html and the phase stylesheet.
   Scope: layout, spacing, sizing and responsive behaviour only.
   No copy, story, colours, art or interactions are changed.
   ===================================================================== */

/* ---------- Global: visible themed scrollbars on scroll containers ---- */
.crt-root [class*="_left_ce1t7"],
.crt-root [class*="_sideBody_ijlim"],
.crt-root [class*="_scroll_bkfjx"],
.crt-root [class*="_stageBody_10fs8"],
.crt-root [class*="_treeSlot_18jvn"] *,
.crt-root .__collectionReport,
.crt-root [class*="_logRows_ijlim"] {
  scrollbar-width: thin;
  scrollbar-color: var(--green-muted) #0d5a3338;
}

/* ---------- Control chat composer: consistent terminal casing -------- */
/* Some states ("Select a session", "Locked") were mixed case while the
   rest ("WAITING FOR CONTROL…", "NO NEW MESSAGES") are upper case. */
._lockedText_1l2jf_25 { text-transform: uppercase; }

/* ---------- Phase 1 · Find a way in: legible map labels -------------- */
/* The 960x620 SVG is scaled to ~0.6 at laptop heights, so 9-12px text
   rendered at ~5-7px. Detail chips were widened in JS to fit. */
._companyLabel_23cg1_73 { font-size: 15px; letter-spacing: .12em; }
._companyMeta_23cg1_80  { font-size: 12px; letter-spacing: .14em; }
._routeLabel_23cg1_130  { font-size: 14px; letter-spacing: .14em; }
._detailText_23cg1_153  { font-size: 11.5px; letter-spacing: .08em; }
._networkLabel_23cg1_173 { font-size: 13px; letter-spacing: .16em; }

/* ---------- Build the Message: SEND always reachable ------------------ */
/* .__bm was stretched to the wrapper height (align-items: stretch), so the
   grid and SEND row overflowed it. Let it grow and keep SEND pinned at the
   bottom of the scrolling panel. */
._stageBody_10fs8_66.__bmBodyWrap { align-items: flex-start !important; }
.__bm { min-height: 100%; height: auto; }
.__bmGrid { flex: 1 0 auto; }
.__bmSendRow {
  position: sticky;
  bottom: calc(-1 * var(--sp-3));
  z-index: 2;
  margin: 0 calc(-1 * var(--sp-4)) calc(-1 * var(--sp-3));
  padding: var(--sp-3) var(--sp-4) !important;
  background: linear-gradient(to bottom, transparent, var(--bg-screen) 22%);
  pointer-events: none;
}
.__bmSendRow > * { pointer-events: auto; }
/* Message preview shows whole lines only (it scrolls for the rest). */
.__bmBody { box-sizing: border-box; height: calc(3 * 1.4em + 2 * var(--sp-2) + 0.4em + 2px) !important; }

/* ---------- Recruiter inbox: no jump when the MISTAKES badge appears -- */
._paneHead_10qbd_45 { min-height: 43px; box-sizing: border-box; }
/* Status text on one line, so all reply rows keep the same height. */
._rowHead_17ktj_133 > :last-child { white-space: nowrap; }
._sender_17ktj_131 { min-width: 0; }
@media (width <= 1240px) {
  ._rowHead_17ktj_133 { gap: 6px; }
  ._rowHead_17ktj_133 > * { letter-spacing: .06em; }
}

/* ---------- Assessment · file collection ------------------------------ */
/* The status column was a fixed 7.25rem even with no status yet, so file
   names wrapped mid-word ("Planning.xl / sx"); reasons were cut with an
   ellipsis ("Published alread…"). Let the status size to its content. */
._file_7vy0n_40 { grid-template-columns: auto minmax(0, 1fr) auto !important; }
._fileName_7vy0n_138 { overflow-wrap: normal; word-break: normal; }
._fileStatus_7vy0n_167 { max-width: 9.5rem; }
._fileReason_7vy0n_192 { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; }
._rowName_7wooa_144 { overflow-wrap: normal; }
/* During collection the session list is read-only; on laptop widths give
   its space to the file tree (same behaviour the game already used at
   <=1240px). */
@media (width <= 1440px) {
  ._screenCollect_ce1t7_489 ._stageBody_ce1t7_21 { grid-template-columns: minmax(0, 1fr) !important; }
  ._screenCollect_ce1t7_489 ._left_ce1t7_29 { display: none !important; }
}
/* 1081-1240px: keep Control's chat as a right-hand column (as on every
   other screen at this width) instead of a 190px strip under the board. */
@media (1081px <= width <= 1240px) {
  ._screenCollect_ce1t7_489 {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px) !important;
    grid-template-rows: minmax(0, 1fr) auto !important;
  }
  ._board_18jvn_19 {
    grid-template: "tabs tray" "tree tray" minmax(0, 1fr) / minmax(0, 1fr) minmax(170px, 210px) !important;
  }
}
@media (width <= 1080px) {
  ._screenCollect_ce1t7_489 { grid-template-rows: minmax(0, 1fr) minmax(190px, 30%) auto !important; }
  ._board_18jvn_19 { grid-template-rows: auto minmax(110px, 30%) minmax(160px, 1fr) !important; }
}
/* Collection report fits its column instead of a viewport calc that ran
   past the bottom of the layout. */
.__collectionReport { max-height: none !important; min-height: 0 !important; height: 100%; box-sizing: border-box; }

/* ---------- Something changed / Nina DM / The spread ------------------ */
/* Keep Control's column a readable width (it was squeezed to ~300px). */
@media (width >= 1081px) {
  ._screen_ijlim_9,
  .__directMessageLayout._screen_ijlim_9 {
    grid-template-columns: minmax(0, 38fr) minmax(0, 40fr) minmax(330px, 400px) !important;
  }
  ._screen_ijlim_9 ._chatPane_ijlim_253,
  .__directMessageLayout ._chatPane_ijlim_253 { grid-column: auto !important; max-height: none !important; }
  ._screen_19h3d_6 {
    grid-template-columns: minmax(0, 28fr) minmax(0, 46fr) minmax(330px, 400px) !important;
    grid-template-rows: minmax(0, 1fr) auto !important;
    overflow: visible !important;
  }
  ._screen_19h3d_6 ._activityPane_19h3d_17 { order: 0 !important; }
}
/* Activity log entries wrap instead of being cut ("2 SE…"). */
._logText_ijlim_166 { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: anywhere; }

/* Nina's DM: when the conversation is open, the thread takes the free
   height (it was capped at 220px with dead space under the replies) and
   the activity log keeps a compact, scrollable strip below it. */
.__directMessageLayout ._sideBody_ijlim_31:has(._thread_ijlim_122) { overflow-y: auto !important; }
.__directMessageLayout .__directMessagePanel:has(._thread_ijlim_122),
.__directMessageLayout .__directMessageBody:has(._thread_ijlim_122),
.__directMessageLayout .__directMessageBody > ._thread_ijlim_122,
.__directMessageLayout ._thread_ijlim_122 ._thread_bkfjx_3 {
  flex: 1 1 auto !important; min-height: 0 !important; max-height: none !important;
}
.__directMessageLayout ._thread_bkfjx_3 { overflow: visible !important; }
.__directMessageLayout ._thread_ijlim_122 ._scroll_bkfjx_41 {
  flex: 1 1 auto !important; min-height: 120px !important; max-height: none !important;
}
.__directMessageLayout ._sideBody_ijlim_31:has(._thread_ijlim_122) > ._log_ijlim_139 {
  flex: 0 1 auto !important; min-height: 96px; max-height: 26%; overflow-y: auto;
}
@media (width <= 1240px), (height <= 760px) {
  .__directMessageLayout ._thread_ijlim_122 ._scroll_bkfjx_41 { min-height: 90px !important; }
  .__directMessageLayout ._sideBody_ijlim_31:has(._thread_ijlim_122) > ._log_ijlim_139 { min-height: 80px; max-height: 18%; }
}

/* The spread: NEXT bar joins the activity panel instead of floating. */
._advance_19h3d_47 {
  border: var(--border-width) solid var(--green-dark);
  border-top-color: var(--border-subtle);
  margin-top: -1px;
}

/* ---------- Skip hint: sit in the bottom gutter, never on a panel ----- */
/* It was 19px tall at bottom:8px and overlapped panel borders by ~3px. */
p[class^="_hint_"][data-visible] { line-height: 1.2; }
._hint_1dk0d_149, ._hint_tkt5z_72, ._hint_10fs8_75, ._hint_10qbd_75, ._hint_12je2_123 { bottom: 4px !important; }

/* Nina's screenshot card: wrap the captured notice instead of cutting it. */
._thumbLine_i402h_49 { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; }

/* r50: assessment screen skip hint only shows while there is something to skip (matches every other screen). */
p._hint_ce1t7_111[data-visible="false"] { opacity: 0; pointer-events: none; }
p._hint_ce1t7_111 { transition: opacity .2s ease-out; }

/* r50: on short screens (e.g. a 1366×736 laptop at 125% zoom) the DM panel shrank
   below its reply options, which then spilled over the activity log. Keep the panel
   tall enough for the header, a strip of thread and the replies; the side column
   scrolls instead. */
.__directMessageLayout .__directMessagePanel:has(._thread_ijlim_122) { min-height: 440px !important; }

/* r50: The spread – on short screens the system tiles were squeezed into a box
   smaller than they need and drew over the "SYSTEM nn — ACTIVE" line and under the
   NEXT bar. Keep the tiles at full height; the panel body (already a scroller) scrolls. */
._body_1krn9_36 > ._field_1krn9_89 { flex-shrink: 0; }

/* r51: HUD icon buttons (music, sound, fullscreen) sit the same distance from the
   right edge as from the top edge, on every screen. The 27px buttons are centred in
   the HUD bar, so the top gap is (HUD height − 27px) / 2; the right padding matches. */
._hud_1efee_10 { padding-right: calc((var(--hud-height) - var(--border-width, 1px) - 27px) / 2) !important; }

/* r52: Build the message – an option already sent and rejected is dulled and locked. */
.__bmCard.__bmCardTried { opacity: .32; cursor: not-allowed; border-style: dashed; filter: grayscale(.6); }
.__bmCard.__bmCardTried .__bmRadio { visibility: hidden; }

/* r56: game text can't be selected or copied (double-click no longer highlights words).
   Text fields stay editable and selectable. */
html, body, #app, #app * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#app input, #app textarea, #app [contenteditable="true"] { -webkit-user-select: text; user-select: text; }
