:root {
  color-scheme: dark;
  font: 1rem/1.5 system-ui, sans-serif;
  background: #111631;
  color: #f1edff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: radial-gradient(ellipse at top, #2a315e, #111631 42rem); min-height: 100dvh; }
main { max-width: 44rem; margin: auto; padding: 1.25rem 1rem 2rem; }
.masthead { display: flex; gap: .8rem; align-items: center; }
.masthead img { border-radius: 1.2rem; }
.eyebrow, .notice { color: #c0b8e9; font-size: .85rem; }
h1, h2, p { margin: 0; }
h1 { line-height: 1.1; font-size: 2rem; }
h2 { font-size: 1.25rem; }
.notice { margin: .85rem 0 1rem; }
#login, section { padding: 1rem; border: 1px solid #626699; border-radius: 1.25rem; background: #1a2145; }
nav { display: flex; gap: .4rem; margin-bottom: .75rem; flex-wrap: wrap; }
nav button:last-child { margin-left: auto; }
button, textarea, input, select { font: inherit; border: 1px solid #777ead; border-radius: .8rem; }
button { min-height: 44px; padding: .45rem .7rem; background: #2c345d; color: #f1edff; cursor: pointer; }
button[aria-pressed="true"], form button { background: #bdebf5; color: #111631; border-color: #bdebf5; }
button:disabled { opacity: .65; }
:focus-visible { outline: 2px solid #e3beff; outline-offset: 3px; }
label { display: block; margin: .8rem 0; }
input, textarea, select { display: block; width: 100%; margin-top: .25rem; padding: .6rem; background: #101631; color: inherit; }
textarea { min-height: 5rem; resize: vertical; }
input[type="checkbox"] { display: inline; width: auto; margin-right: .3rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
#status:not(:empty) { margin: .65rem 0; color: #dcd1f8; }
ol { list-style: none; padding: 0; }
#turns { max-height: min(52dvh, 32rem); overflow-y: auto; overscroll-behavior: contain; }
#turns:empty::before { content: "Say hi to Bubble."; color: #c0b8e9; }
#turns li { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .75rem; }
.message { align-self: flex-start; max-width: 92%; background: #353462; padding: .65rem .8rem; border-radius: .85rem; }
.message.from-user { align-self: flex-end; background: #234d64; }
.message strong { color: #d5eff9; font-size: .8rem; }
.message p, #images li { overflow-wrap: anywhere; white-space: pre-wrap; }
#images li { border-top: 1px solid #505682; padding: .75rem 0; }
#images button { margin: .35rem .35rem 0 0; }
#reference-picker { color: #dcd1f8; font-size: .9rem; }
#selected-references:empty::before { content: "No references selected."; }
#selected-references li { margin: .25rem 0; }
figure { margin: 1rem 0 0; }
figure img { display: block; max-width: 100%; height: auto; border-radius: .75rem; }
figcaption { margin-top: .4rem; color: #dcd1f8; }
#context-files { list-style: none; padding: 0; }
#context-files li { border-top: 1px solid #505682; padding: .75rem 0; }
#context-files button { margin: .35rem .35rem .35rem 0; }
#context pre { max-height: 40dvh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: #101631; padding: .7rem; border-radius: .65rem; }
