* { box-sizing: border-box; }
:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #173129;
  background: #f1f4f0;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  --app-height: 100vh;
  --app-top: 0px;
}
@supports (height: 100dvh) { :root { --app-height: 100dvh; } }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
button, textarea, a { -webkit-tap-highlight-color: transparent; }
button, textarea { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
a { color: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid #78a639; outline-offset: 3px; }
[hidden] { display: none !important; }
.shell {
  position: fixed;
  top: var(--app-top);
  left: 0;
  width: 100%;
  height: var(--app-height);
  display: flex;
  overflow: hidden;
}
.side { display: none; }
.workspace { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.topbar {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  min-height: 56px;
  color: #fff;
  background: #143c2c;
}
.eyebrow { font-size: 10px; letter-spacing: 1.4px; font-weight: 750; }
.topbar .eyebrow { color: #d1e3b8; }
.topbar p, .channel-tag { display: none; }
.mobile-brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 25px;
  font-weight: 850;
  letter-spacing: -1.2px;
  text-decoration: none;
}
.mobile-brand span { color: #d8ff87; }
.chat-card { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: #fff; }
.chat-header {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px max(14px, env(safe-area-inset-right)) 12px max(14px, env(safe-area-inset-left));
  border-bottom: 1px solid #edf0eb;
}
.avatar { width: 40px; height: 40px; display: grid; place-items: center; background: #eaf2df; border-radius: 13px; flex-shrink: 0; }
.avatar svg { width: 23px; height: 23px; fill: none; stroke: #43612e; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.chat-title { min-width: 0; flex: 1; }
.chat-title h2 { margin: 0; font-size: 16px; line-height: 1.3; font-weight: 700; letter-spacing: -.3px; }
.chat-title p { margin: 4px 0 0; color: #607467; font-size: 12px; line-height: 1.35; display: flex; align-items: center; gap: 5px; }
.status-dot { width: 6px; height: 6px; background: #8d9986; border-radius: 50%; flex-shrink: 0; }
.status-dot.ready { background: #6b982e; }
.human-button {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
  border: 1px solid #dbe4d4;
  border-radius: 10px;
  background: #fafcf7;
  color: #476737;
  font-size: 12px;
  font-weight: 650;
}
.human-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.mode-note { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px max(14px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left)); border-bottom: 1px solid #edf0e7; background: #fbfcf8; }
.mode-note p { font-size: 12px; line-height: 1.4; color: #63715f; margin: 0; }
.mode-label { font-size: 10px; background: #e9eee4; color: #506547; padding: 4px 6px; border-radius: 5px; flex-shrink: 0; }
.thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding: 20px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  scroll-padding-block: 16px;
}
.welcome { display: flex; flex-direction: column; align-items: center; text-align: center; justify-content: center; min-height: 100%; padding: 10px 0 20px; }
.welcome-symbol { display: grid; place-items: center; width: 56px; height: 56px; flex-shrink: 0; border-radius: 18px; background: #f1f6e8; font-size: 31px; color: #6c9634; margin-bottom: 20px; }
.welcome h3 { font-size: 24px; font-weight: 650; line-height: 1.2; letter-spacing: -.7px; margin: 0 0 12px; }
.welcome > p { font-size: 14px; line-height: 1.6; color: #687665; margin: 0; max-width: 320px; }
.topics { width: 100%; max-width: 360px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 24px 0 18px; }
.topics button { min-height: 52px; display: flex; align-items: center; gap: 8px; text-align: left; padding: 12px; background: #fff; border: 1px solid #dfe6d8; border-radius: 12px; color: #42573a; font-size: 14px; line-height: 1.4; }
.topics button:hover { background: #f6f9f0; border-color: #b8cd99; }
.topics button:active { background: #eaf2df; }
.topics button span { font-size: 19px; color: #769945; flex-shrink: 0; }
.welcome .welcome-foot { max-width: 340px; font-size: 12px; line-height: 1.6; color: #788271; }
.messages { display: flex; flex-direction: column; gap: 20px; }
.message { max-width: 94%; display: flex; flex-direction: column; align-self: flex-start; min-width: 0; }
.message.user { align-self: flex-end; }
.speaker { color: #687963; font-size: 11px; font-weight: 650; line-height: 1.5; margin: 0 3px 6px; overflow-wrap: anywhere; }
.message.user .speaker, .message.user .message-time { text-align: right; }
.bubble { margin: 0; padding: 12px 15px; border-radius: 15px 15px 15px 4px; background: #f1f4ed; color: #2b402c; font-size: 15px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.user .bubble { background: #e4f3cc; border-radius: 15px 15px 4px 15px; }
.human .bubble { background: #eaf2f0; }
.system .bubble { background: #faf6e9; color: #665933; }
.message-time { font-size: 10px; color: #7b8576; margin: 6px 3px 0; }
.typing { display: flex; align-items: center; gap: 9px; margin-top: 18px; font-size: 12px; line-height: 1.5; color: #65775b; }
.typing-dots { color: #7b9a50; font-size: 19px; letter-spacing: 2px; }
.handoff { margin-top: 16px; padding: 12px 14px; border: 1px solid #d8e3ca; border-radius: 12px; background: #f3f8eb; color: #4f633e; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.error-box { margin-top: 16px; padding: 12px 14px; border: 1px solid #e9d6b6; border-radius: 12px; background: #fff8e9; color: #795d2b; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.error-box button { display: block; margin-top: 8px; padding: 8px 0; min-height: 44px; border: 0; background: none; text-decoration: underline; color: #745a27; font-size: 13px; font-weight: 650; }
.composer { flex: none; display: flex; align-items: flex-end; gap: 10px; padding: 8px; margin: 8px max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); border: 1px solid #dce5d2; background: #fafcf6; border-radius: 16px; }
.composer:focus-within { border-color: #85a85b; box-shadow: 0 0 0 2px #9aba6522; }
.composer textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 128px; padding: 10px 4px; border: 0; border-radius: 0; resize: none; background: none; outline: none; color: #253b27; font-size: 16px; line-height: 24px; overflow-y: auto; }
.composer textarea::placeholder { color: #7d8b70; }
.send-button { flex-shrink: 0; width: 44px; height: 44px; border: 0; border-radius: 12px; background: #d8ff87; color: #254227; display: grid; place-items: center; }
.send-button:hover:enabled { background: #c8ef72; }
.send-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.chat-footer { flex: none; display: flex; justify-content: space-between; align-items: start; gap: 10px; padding: 8px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); font-size: 10px; line-height: 1.4; color: #6d7b63; }
#char-count { flex-shrink: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.page-footer { display: none; }
.preparing { flex: 1; min-height: 0; overflow-y: auto; text-align: center; padding: 30px 22px; font-size: 15px; line-height: 1.7; }
.preparing h3 { font-size: 24px; margin-top: 30px; }
.preparing a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; color: #58793b; margin-top: 20px; }
.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 (max-width: 359px) {
  .chat-title h2 { font-size: 15px; }
  .human-button span { display: none; }
  .topics button { padding: 10px; font-size: 14px; gap: 6px; }
  .welcome h3 { font-size: 22px; }
}
@media (max-height: 650px) {
  .welcome-symbol { display: none; }
  .welcome { justify-content: flex-start; padding: 4px 0 10px; }
  .welcome h3 { font-size: 22px; margin-bottom: 10px; }
  .topics { margin-top: 16px; margin-bottom: 14px; gap: 8px; }
}
/* Short landscape screens and a viewport reduced by the on-screen keyboard. */
@media (max-height: 500px) {
  .topbar { min-height: 44px; padding-top: env(safe-area-inset-top); padding-bottom: 0; }
  .chat-header { padding-top: 6px; padding-bottom: 6px; }
  .welcome-symbol { display: none; }
  .welcome { justify-content: flex-start; padding-bottom: 8px; }
  .welcome h3 { font-size: 21px; }
  .topics { margin-top: 14px; margin-bottom: 12px; }
  .thread { padding-top: 14px; }
  .chat-footer { padding-top: 5px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
}
.viewport-compact .topbar { min-height: 44px; padding-top: env(safe-area-inset-top); padding-bottom: 0; }
.viewport-compact .chat-header { padding-top: 6px; padding-bottom: 6px; }
.viewport-compact .welcome-symbol { display: none; }
.viewport-compact .welcome { justify-content: flex-start; padding-bottom: 8px; }
.viewport-compact .welcome h3 { font-size: 21px; }
.viewport-compact .topics { margin-top: 14px; margin-bottom: 12px; }
.viewport-compact .thread { padding-top: 14px; }
.viewport-compact .chat-footer { padding-top: 5px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
@media (min-width: 791px) and (min-height: 501px) and (pointer: fine) {
  .workspace { max-width: 1060px; margin: 0 auto; padding: 24px 32px 18px; }
  .topbar { background: none; color: #173129; padding: 0; margin-bottom: 20px; }
  .topbar .eyebrow { color: #617857; }
  .topbar p { display: block; margin: 7px 0 0; font-size: 12px; color: #73816b; }
  .mobile-brand { color: #143c2c; }
  .mobile-brand span { color: #729443; }
  .chat-card { border: 1px solid #dfe6dc; border-radius: 18px; box-shadow: 0 8px 32px #203d2705; }
  .chat-header { padding: 18px 24px; }
  .thread { padding: 24px; }
  .bubble { font-size: 15px; }
  .message { max-width: 85%; }
  .composer { margin-inline: 20px; }
  .chat-footer { padding-inline: 24px; padding-bottom: 16px; }
  .page-footer { display: flex; justify-content: space-between; gap: 15px; color: #78856d; font-size: 10px; margin: 14px 3px 0; line-height: 1.5; }
  .page-footer span { text-align: right; }
}
@media (min-width: 1024px) and (min-height: 600px) and (pointer: fine) {
  .side { width: 280px; flex-shrink: 0; background: #143c2c; color: #fff; padding: 32px 28px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
  .brand { text-decoration: none; font-weight: 850; letter-spacing: -1.3px; font-size: 28px; display: flex; align-items: center; gap: 12px; }
  .brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid #62856a; border-radius: 12px; font-size: 27px; color: #d8ff87; letter-spacing: -2px; }
  .brand-number { color: #d8ff87; }
  .side-main { margin: auto 0; padding: 35px 0 25px; }
  .side-main .eyebrow { color: #b3d18d; }
  .side h1 { font-size: 32px; line-height: 1.17; letter-spacing: -1.4px; font-weight: 650; margin: 19px 0; }
  .side-main > p { font-size: 14px; line-height: 1.7; color: #c0d1c6; }
  .side-visual { height: 156px; position: relative; margin-top: 30px; max-width: 225px; }
  .chat-shape { position: absolute; top: 12px; left: 15px; width: 153px; height: 115px; background: #d8ff87; border-radius: 31px 31px 31px 8px; transform: rotate(-9deg); display: flex; gap: 10px; align-items: center; justify-content: center; box-shadow: 0 25px 45px #061b1833; }
  .chat-shape:after { content: ""; position: absolute; bottom: -14px; left: 0; border-top: 28px solid #d8ff87; border-right: 28px solid transparent; }
  .chat-shape span { width: 13px; height: 13px; border-radius: 50%; background: #2a5439; }
  .small-shape { position: absolute; right: 13px; bottom: 3px; background: #316347; width: 73px; height: 66px; border-radius: 21px 21px 5px 21px; transform: rotate(10deg); display: grid; place-items: center; color: #d8ff87; font-size: 30px; border: 1px solid #477958; }
  .side-note { display: flex; gap: 13px; border-top: 1px solid #3c5d4b; padding-top: 20px; }
  .note-icon { font-size: 21px; color: #d8ff87; }
  .side-note strong { font-size: 12px; font-weight: 600; }
  .side-note p { font-size: 11px; line-height: 1.6; color: #a8c0b3; margin: 8px 0; }
  .back-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; text-decoration: none; margin-top: 16px; color: #c4dacd; }
  .mobile-brand { display: none; }
  .channel-tag { display: block; font-size: 11px; padding: 9px 13px; background: #e8ede5; border: 1px solid #dce4d8; border-radius: 7px; color: #65806a; }
}
