/* Loaded on every page through custom_css in .chainlit/config.toml.

   The login page's picture (public/logo.jpg, login_page_image) fills the right half of the
   screen, and Chainlit crops it to fit (object-cover), which cut off the "TMS AI Assistant"
   text. Show the whole picture instead, on the navy of its own edges, so the space above
   and below blends in. The selector is our own file's address rather than Chainlit's class
   names; if a Chainlit upgrade stops it matching, the picture is only cropped again. */
img[src="/public/logo.jpg"] {
  object-fit: contain;
  background-color: rgb(0, 9, 32);
}

/* Chainlit's own logo, which it shows above the login form (from its /logo address). The
   picture beside the form already says what the site is, so hide it rather than add
   another image to the repo. */
img[alt="logo"] {
  display: none;
}

/* The message box. While it's empty, zooming in can make "Type your message here..." wider
   than the box; Safari doesn't wrap the placeholder, so the box scrolled sideways and showed
   a horizontal scrollbar. Typed text always wraps, so turning off sideways scrolling hides
   nothing but the end of the placeholder at that zoom. */
#chat-input {
  overflow-x: hidden;
}

/* The strip along the sidebar's edge only folds the sidebar away when clicked (the sidebar
   has a fixed width and can't be dragged), but Chainlit gives it a left-right resize cursor,
   so it looked like a drag handle. A pointer shows it's something to click. !important
   because Chainlit's cursor rules ("[data-side=left][data-state=collapsed] .x") are more
   specific than this selector. */
button[data-sidebar="rail"] {
  cursor: pointer !important;
}

/* A step's title ("Used Searching: <query>"). Chainlit lays it out as a flex row in which
   "Used" and the name are separate boxes, and the button centres its text, so a name too
   long for one line wrapped in its own centred column beside "Used", with the arrow pushed
   to the far edge. Letting the title flow as one left-aligned paragraph keeps a long name
   wrapping under "Used", with the arrow right after the last word. The selectors are the
   title's own elements (Chainlit gives them the id "step-<name>"); the step's outer box
   also has a "step-" id, but it is a div, so it isn't matched. If a Chainlit upgrade stops
   these matching, long titles only look as they did before. */
button[id^="step-"],
p[id^="step-"] {
  display: block;
  text-align: left;
}

button[id^="step-"] > svg {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.25rem;
}

/* The browser's own parts of the page, such as the sidebar's scrollbar, follow color-scheme,
   which Chainlit never sets, so in dark mode the browser still drew them light: a white
   scrollbar track beside the dark chat list. Chainlit marks its dark theme with the class
   "dark" on <html>, so tell the browser which scheme each theme is. */
:root {
  color-scheme: light;
}

:root.dark {
  color-scheme: dark;
}
