:root {
  color-scheme: light;
  --background: #eaf1ee;
  --paper: #fff;
  --text: #172d26;
  --muted: #436154;
  --green: #184d3e;
  --border: #cbdcd3;
  font: 16px/1.5 system-ui, sans-serif;
  color: var(--text);
  background: var(--background);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--green); text-underline-offset: .22em; }
button, input, textarea { font: inherit; }
button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.75rem;
  padding: .6rem 1rem;
  border: 1px solid transparent;
  border-radius: .6rem;
  color: #fff;
  background: var(--green);
  cursor: pointer;
}
button:disabled { opacity: .6; cursor: wait; }
.quiet { color: var(--green); background: transparent; border-color: var(--border); }
input, textarea { width: 100%; padding: .65rem .8rem; color: inherit; border: 1px solid #819d90; border-radius: .5rem; background: #fff; }
:focus-visible { outline: 3px solid #0d765b; outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.15; letter-spacing: -.035em; }
h2 { font-size: 1.25rem; }
p, small { color: var(--muted); }
.brand { font-size: 1.1rem; color: var(--green); text-decoration: none; font-weight: 750; letter-spacing: -.025em; }
.panel { background: var(--paper); border: 1px solid var(--border); border-radius: 1.15rem; box-shadow: 0 12px 40px #1d4a3b0c; }
.login-layout { min-height: 100dvh; display: grid; place-items: center; padding: 1rem; }
.login { width: min(100%, 25rem); padding: clamp(1.4rem, 5vw, 2.4rem); }
.login h1 { margin: .9rem 0 .55rem; }
.login form, .settings-panel form:not(.accounts form) { display: grid; gap: .9rem; margin-top: 1.4rem; }
label { display: grid; gap: .3rem; color: var(--text); font-weight: 600; }
.error { color: #a12b31; font-size: .9rem; }
.error:empty { display: none; }
.shell, .settings { width: min(100% - 2rem, 70rem); margin: auto; }
.site-header, .sub-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem 0; }
.site-header nav, .profile { display: flex; align-items: center; flex-wrap: wrap; gap: .15rem .9rem; }
nav a, .profile a { padding: .35rem 0; }
nav [aria-current] { font-weight: 700; }
.conversation { display: grid; grid-template-rows: auto minmax(15rem, 1fr) auto; min-height: 31rem; height: calc(100dvh - 6rem); }
.chat-heading, .composer { padding: 1.15rem clamp(.85rem, 3vw, 1.75rem); }
.chat-heading { border-bottom: 1px solid var(--border); }
.chat-heading p { margin-top: .3rem; }
.messages { display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; overflow-y: auto; padding: 1rem clamp(.85rem, 3vw, 1.75rem); }
.empty { margin: auto; }
.message { max-width: min(90%, 40rem); padding: .65rem .85rem; border: 1px solid var(--border); background: #f4f8f6; border-radius: .8rem; overflow-wrap: anywhere; }
.message.own { align-self: flex-end; background: #deeee5; }
.message header { display: flex; gap: .85rem; align-items: baseline; flex-wrap: wrap; }
.message time, .accounts small { color: var(--muted); font-size: .84rem; }
.message p { color: var(--text); white-space: pre-wrap; margin-top: .2rem; }
.composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .65rem; border-top: 1px solid var(--border); }
.composer textarea { resize: vertical; }
.composer .error { grid-column: 1 / -1; }
.settings { max-width: 42rem; }
.settings-panel { padding: clamp(1.1rem, 3.5vw, 2rem); }
.accounts { padding: 0; list-style: none; margin: 1rem 0 2rem; }
.accounts li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; border-bottom: 1px solid var(--border); padding: .65rem 0; }
.accounts form { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.accounts small { display: block; }
.checkbox { display: flex; align-items: center; flex-direction: row; font-weight: 500; }
.checkbox input { width: 1.15rem; height: 1.15rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 36rem) {
  .shell, .settings { width: calc(100% - 1rem); }
  .site-header { gap: .5rem; padding: .65rem .35rem; }
  .site-header nav { order: 3; width: 100%; gap: .15rem .75rem; }
  .profile .quiet { padding: .25rem .5rem; }
  .conversation { height: calc(100dvh - 7.5rem); min-height: 25rem; }
  .composer { gap: .45rem; }
  .composer button { padding-inline: .65rem; }
}
