/* The supplied coastal artwork sets the ivory, clay and palm palette. */
:root {
  color-scheme: light;
  --ink: #3c392f;
  --muted: #706657;
  --clay: #985539;
  --palm: #3f594b;
  --line: #d9cbb6;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: #f7f2e7 url("/static/coastal-background.png") center / cover no-repeat fixed;
}
main {
  max-width: 940px;
  height: 100vh;
  height: 100dvh;
  min-height: 480px;
  margin: auto;
  padding: 0 36px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(90deg, transparent, #fffaf044 18%, #fffaf044 82%, transparent);
}
header { display: flex; align-items: center; gap: 13px; padding: 25px 0 20px; border-bottom: 1px solid var(--line); }
.mark { display: grid; place-items: center; width: 46px; height: 46px; flex-shrink: 0; border: 1px solid #a87656; border-radius: 50%; color: var(--clay); font: 20px Georgia, serif; background: #fffaf0b8; }
h1 { margin: 0; font: 26px Georgia, "Times New Roman", serif; letter-spacing: -.6px; }
header p { font-size: 12px; margin: 6px 0 0; color: var(--muted); letter-spacing: .8px; }
.tag { margin-left: auto; color: var(--muted); font: italic 13px/1.6 Georgia, serif; text-align: right; }
.intro { text-align: center; padding: 27px 0 7px; }
.eyebrow { margin: 0 0 10px; font-size: 10px; font-weight: 700; letter-spacing: 2.4px; color: var(--clay); }
h2 { margin: 0; font: 32px/1.2 Georgia, "Times New Roman", serif; letter-spacing: -.7px; }
.intro > p:last-child { margin: 10px 0 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
#messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 7px 18px 0; display: flex; flex-direction: column; gap: 16px; scrollbar-width: thin; scrollbar-color: #b7a58e transparent; }
.message { max-width: 88%; flex-shrink: 0; padding: 17px 21px; border-radius: 18px; line-height: 1.7; font-size: 14px; overflow-wrap: anywhere; box-shadow: 0 4px 18px #66523c08; }
.message p { white-space: pre-wrap; margin: 7px 0 0; }
.assistant { align-self: flex-start; background: #fffdf5ed; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.assistant .speaker { color: var(--clay); }
.user { align-self: flex-end; background: var(--palm); color: #fffdf5; border: 1px solid var(--palm); border-bottom-right-radius: 4px; }
.speaker { font-size: 9px; letter-spacing: 1.5px; font-weight: 700; }
#status { margin: 0; min-height: 22px; font-size: 12px; color: var(--palm); }
#choices { display: flex; gap: 8px; flex-wrap: wrap; margin: 5px 0 13px; }
button { font: inherit; cursor: pointer; border: 1px solid #bca78d; background: #fffcf2ed; color: var(--ink); border-radius: 24px; padding: 9px 15px; transition: background .15s, border-color .15s; }
#choices button { font-size: 12px; }
button:hover { background: #efe3cf; border-color: var(--clay); }
button:disabled { opacity: .6; cursor: wait; }
button:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--clay); outline-offset: 3px; }
form { display: flex; gap: 12px; border: 1px solid #bca78d; border-radius: 20px; background: #fffdf7f5; padding: 12px; box-shadow: 0 6px 26px #66523c0c; }
form:focus-within { border-color: var(--clay); }
textarea { flex: 1; min-width: 0; resize: none; border: 0; padding: 7px; font: 14px/1.6 "Segoe UI", system-ui, sans-serif; background: transparent; color: var(--ink); }
textarea::placeholder { color: #817766; }
#send { align-self: center; background: var(--clay); color: #fffdf5; border: 0; font-size: 13px; padding: 12px 19px; }
#send:hover { background: #7e432c; }
#send span { margin-left: 8px; font-size: 17px; }
.composer-note { display: flex; justify-content: space-between; gap: 12px; margin-top: 9px; color: var(--muted); font-size: 10px; }
footer { text-align: center; color: var(--muted); font-size: 10px; line-height: 1.5; padding: 16px 0 17px; }
a { color: inherit; text-underline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (min-width: 1500px) { main { max-width: 1000px; } header { padding-top: 32px; } .intro { padding-top: 38px; } }
@media (max-width: 600px) {
  body { background-position: 55% center; }
  main { padding: 0 17px; min-height: 380px; }
  header { padding: 16px 0; gap: 10px; }
  .mark { width: 38px; height: 38px; font-size: 17px; }
  h1 { font-size: 22px; }
  header p { font-size: 10px; }
  .tag { display: none; }
  .intro { padding-top: 21px; }
  h2 { font-size: 26px; }
  .intro > p:last-child { font-size: 12px; }
  #messages { padding-top: 18px; }
  .message { max-width: 95%; padding: 13px 16px; }
  #choices { gap: 6px; }
  #choices button { padding: 8px 11px; }
  textarea { font-size: 16px; }
  #send { padding: 11px 14px; }
  .composer-note > span:last-child { display: none; }
  footer { font-size: 9px; padding: 12px 0; }
}
@media (max-height: 650px) { main { min-height: 0; } .intro { display: none; } header { padding: 12px 0; } footer { padding: 9px 0; } }
@media (prefers-reduced-motion: reduce) { button { transition: none; } }

#notification-panel { flex-shrink: 0; background: #fffdf5ed; border: 1px solid var(--line); border-radius: 12px; padding: 9px 13px; font-size: 12px; }
#notification-panel summary { cursor: pointer; color: var(--palm); font-weight: 600; }
#notification-panel summary:focus-visible { outline: 3px solid var(--clay); }
#notification-list { max-height: 150px; overflow-y: auto; }
.notification-item { border-top: 1px solid var(--line); padding: 8px 0; overflow-wrap: anywhere; }
.notification-item p { margin: 4px 0; white-space: pre-wrap; }
.notification-item button { padding: 5px 10px; margin-top: 5px; font-size: 11px; }
#worker-status { color: var(--muted); margin: 7px 0; }
@media(max-height:650px) { #notification-list { max-height: 75px; } .composer-note { display: none; } }

@media(max-height:450px) {
  header { padding: 7px 0; }
  header p, footer { display: none; }
  .mark { width: 32px; height: 32px; font-size: 15px; }
  h1 { font-size: 22px; }
  #notification-list { max-height: 45px; }
  #status { min-height: 16px; }
  #choices { margin-bottom: 7px; }
  form { padding: 7px; }
}
