:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #173449;
  background: #eaf3f5;
  --accent: #12695d;
  --muted: #405b6c;
  --line: #d8e5e9;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: #115b52; text-underline-offset: .2em; }
button, input, textarea, select { font: inherit; }
button, a, textarea, input, select { outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); }
.shell { width: min(100% - 2rem, 55rem); margin: 0 auto; padding: .8rem 0 1rem; }
.topline { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .55rem 1rem; min-height: 2.1rem; margin-bottom: .65rem; font-size: .88rem; font-weight: 650; }
.topline > div { display: flex; flex-wrap: wrap; gap: 1rem; }
.chat { border: 1px solid var(--line); background: #fff; border-radius: 1rem; overflow: hidden; box-shadow: 0 .6rem 2rem #1c48520d; }
.chat-head { display: flex; align-items: center; gap: .8rem; padding: .9rem 1.15rem; background: #f2faf8; border-bottom: 1px solid var(--line); }
.chat-head h1 { font-size: 1.7rem; line-height: 1; margin: 0 0 .35rem; letter-spacing: -.035em; }
.chat-head p { margin: 0; color: var(--muted); font-size: .87rem; }
.avatar { display: grid; place-items: center; flex: 0 0 auto; inline-size: 2.7rem; block-size: 2.7rem; border-radius: .8rem; background: #d9f0e7; font-size: 1.55rem; }
.chat-head .quota { margin-left: auto; text-align: right; font-size: .8rem; font-weight: 650; }
.conversation { height: clamp(10rem, calc(100dvh - 18.5rem), 35rem); overflow: auto; padding: .9rem 1.15rem; display: flex; flex-direction: column; gap: .7rem; }
.bubble { max-width: min(95%, 45rem); margin: 0; align-self: flex-start; overflow-wrap: anywhere; }
.bubble > p { margin: 0; }
.intro, .reply { border-radius: 0 .8rem .8rem .8rem; background: #f1f6f8; padding: .75rem .9rem; }
.reply { width: min(100%, 45rem); }
.prompt { align-self: flex-end; background: #ddf2ea; color: #174a42; border-radius: .8rem 0 .8rem .8rem; padding: .65rem .8rem; white-space: pre-wrap; }
.result + .result { margin-top: .65rem; padding-top: .65rem; border-top: 1px solid var(--line); }
.result h2, .result p { margin: 0 0 .3rem; }
.result h2 { font-size: .9rem; }
.result .value { font-size: 1.12rem; font-weight: 740; }
.detail, .source, .fine, .status { font-size: .82rem; color: var(--muted); }
.source { color: #115b52; }
.status { min-height: 1.2rem; margin: 0; padding: 0 1.15rem .15rem; }
.compose, .admin-body { padding: .75rem 1.15rem .9rem; border-top: 1px solid var(--line); }
.examples { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
.examples button { border: 1px solid #bcd7d2; background: #f2faf8; color: #17554c; font-size: .84rem; padding: .36rem .55rem; border-radius: .5rem; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
label { display: block; font-size: .88rem; font-weight: 650; }
.compose label { margin: .55rem 0 .28rem; }
.input-row { display: flex; align-items: stretch; gap: .5rem; }
textarea, input:not([type=checkbox]), select { width: 100%; border: 1px solid #b5cad4; border-radius: .48rem; padding: .48rem .6rem; background: #fff; color: inherit; }
textarea { resize: vertical; }
.primary, .examples .primary { background: var(--accent); color: white; padding: .5rem .85rem; border: 1px solid var(--accent); border-radius: .5rem; font-weight: 700; }
.primary:hover { background: #0f574e; }
.fine { margin: .48rem 0 0; }
.settings { display: grid; gap: .8rem; }
.settings button { justify-self: start; }
.settings label > :not([type=checkbox]) { margin-top: .32rem; }
.limits, .admin-status { display: flex; flex-wrap: wrap; gap: .6rem 1.3rem; }
.admin-status { color: var(--muted); font-size: .92rem; margin-bottom: .7rem; }
.admin-status p { margin: 0; }
.check { display: flex; align-items: flex-start; gap: .4rem; }
.notice { background: #edf7f4; padding: .55rem .7rem; border-radius: .45rem; }
@media (max-width: 500px) {
  .shell { width: calc(100% - 1rem); padding-top: .35rem; }
  .chat-head, .conversation, .compose, .admin-body { padding-left: .7rem; padding-right: .7rem; }
  .chat-head .quota { max-width: 6.5rem; }
  .chat-head { gap: .5rem; }
  .chat-head p { font-size: .78rem; }
  .status { padding-left: .7rem; }
}
