body { margin: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 5; padding: 12px; background: white; }
.skip-link:focus { top: 12px; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 17px 42px; border-bottom: 1px solid var(--line); position: relative; flex-shrink: 0; }
.site-header::after { content: ''; position: absolute; bottom: -1px; left: 0; height: 2px; width: 160px; background: var(--lime); }
.brand { display: flex; align-items: center; gap: 21px; text-decoration: none; flex-shrink: 0; }
.brand img { object-fit: contain; }
.brand-divider { height: 32px; width: 1px; background: var(--line); }
.brand-name { font: 700 23px Montserrat, sans-serif; color: var(--teal); letter-spacing: -.8px; }
.brand-name > span { display: block; margin-top: 5px; font: 500 9px Roboto, sans-serif; letter-spacing: 1.8px; color: var(--muted); }
.nav { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 18px; font-size: 13px; }
.nav a { text-decoration: none; }
.nav a:hover { text-decoration: underline; }
#account { color: var(--muted); overflow-wrap: anywhere; }
.quiet-button { background: white; border: 1px solid var(--line); border-radius: 5px; color: var(--teal); padding: 9px 13px; }
.quiet-button:hover { background: var(--surface); border-color: var(--teal); }
#auth-status { margin: 0; padding: 10px 24px; background: #f1f6e6; color: var(--teal-dark); font-size: 14px; }
#log { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable both-edges; padding: 32px max(24px, calc((100% - 900px) / 2)); display: flex; flex-direction: column; gap: 26px; }
.welcome { text-align: center; width: 100%; max-width: 900px; margin: auto; padding: 20px 0; position: relative; }
.welcome-icon { width: 64px; height: 64px; margin: 0 auto 24px; display: grid; place-items: center; border: 1px solid #c8dedf; border-radius: 50%; color: var(--teal); background: #f2f8f8; position: relative; }
.welcome-icon::after { content: ''; position: absolute; width: 12px; height: 12px; border: 3px solid white; border-radius: 50%; background: var(--lime); right: 0; bottom: 0; }
.welcome-icon svg { width: 28px; height: 28px; }
.eyebrow { font-size: 10px; font-weight: 500; letter-spacing: 2px; color: var(--teal); margin: 0 0 18px; }
h1 { font-size: clamp(29px, 3.2vw, 43px); line-height: 1.2; letter-spacing: -1.6px; margin: 0 0 20px; }
.welcome-description { color: var(--muted); font-size: 16px; line-height: 1.7; margin: 0; }
.suggestions { display: grid; grid-template-columns: repeat(3, 1fr); text-align: left; margin-top: 40px; gap: 14px; }
.suggestion { position: relative; text-align: left; display: flex; flex-direction: column; gap: 12px; padding: 21px 34px 24px 20px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 15px; line-height: 1.5; transition: border-color .15s, background .15s; }
.suggestion:hover { background: #f6f9ef; border-color: var(--lime); }
.suggestion-label { color: var(--teal); font-size: 9px; letter-spacing: 1.1px; font-weight: 500; }
.suggestion-arrow { position: absolute; right: 15px; bottom: 23px; color: var(--teal); font-size: 19px; }
.welcome-note { color: var(--muted); font-size: 12px; margin: 18px 0 0; }
.msg { display: flex; gap: 12px; align-items: flex-start; width: 100%; }
.role { flex: 0 0 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 500; border: 1px solid var(--line); }
.bot .role { color: white; background: var(--teal); border-color: var(--teal); }
.user .role { background: #e9f1d6; color: var(--teal-dark); border-color: #d2e0b2; }
.bubble { min-width: 0; padding: 15px 19px; border: 1px solid var(--line); border-radius: 0 12px 12px; line-height: 1.75; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.user .bubble { background: var(--surface); }
.bot .bubble { background: white; }
.err .bubble { background: #fff3f0; border-color: #efc7bd; color: #9d3529; }
.err .role { background: #fff3f0; color: #9d3529; }
.thinking { color: var(--muted); }
.markdown-body { white-space: normal; }
.markdown-fallback { white-space: pre-wrap; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body p, .markdown-body ul, .markdown-body ol, .markdown-body blockquote,
.markdown-body pre, .markdown-table { margin: 0 0 1em; }
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
  font-family: Montserrat, sans-serif; color: var(--teal); line-height: 1.4;
  letter-spacing: normal; margin: 1.3em 0 .6em;
}
.markdown-body h1 { font-size: 1.45em; }
.markdown-body h2 { font-size: 1.25em; }
.markdown-body h3 { font-size: 1.1em; }
.markdown-body h4, .markdown-body h5, .markdown-body h6 { font-size: 1em; }
.markdown-body ul, .markdown-body ol { padding-left: 1.6em; }
.markdown-body li { margin: .3em 0; }
.markdown-body li > ul, .markdown-body li > ol { margin-bottom: .4em; }
.markdown-body li > p { margin-bottom: .5em; }
.markdown-body blockquote { padding: .6em 1em; border-left: 3px solid var(--lime); background: var(--surface); }
.markdown-body blockquote > :last-child { margin-bottom: 0; }
.markdown-body code { font: .9em ui-monospace, Consolas, monospace; background: #edf3f3; border-radius: 3px; padding: .15em .3em; }
.markdown-body pre { max-width: 100%; overflow-x: auto; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; white-space: pre; overflow-wrap: normal; }
.markdown-body pre code { padding: 0; background: none; line-height: 1.6; }
.markdown-body hr { border: 0; border-top: 1px solid var(--line); margin: 1.5em 0; }
.markdown-table { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
.markdown-body table { width: 100%; border-collapse: collapse; font-size: .93em; }
.markdown-body th, .markdown-body td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); min-width: 110px; }
.markdown-body th { color: var(--teal-dark); background: #eef5f5; font-weight: 500; }
.markdown-body tr:last-child td { border-bottom: 0; }
.sources { margin-top: 18px; padding-top: 12px; border-top: 1px dotted #b6ced0; font-size: 12px; color: var(--muted); white-space: normal; }
.sources details { margin-top: 8px; }
.sources summary { cursor: pointer; color: var(--teal); }
.sources .source-excerpt { max-height: 280px; overflow: auto; margin: 8px 0; white-space: pre-wrap; }
.sources-heading { margin: 0 0 8px; color: var(--teal); font-weight: 500; }
.sources .sources-other { margin-top: 14px; }
.sources-other > details { margin-left: 14px; }
.composer-area { flex-shrink: 0; width: 100%; max-width: 948px; margin: 0 auto; padding: 12px 24px 18px; background: white; }
.composer { display: flex; align-items: flex-end; gap: 12px; padding: 12px; background: white; border: 1px solid #bed0d3; border-radius: 10px; box-shadow: 0 4px 20px #064a5809; }
.composer:focus-within { border-color: var(--teal); box-shadow: 0 0 0 2px #00677c12; }
#q { flex: 1; min-width: 0; resize: vertical; max-height: 180px; min-height: 48px; border: 0; border-radius: 4px; background: transparent; color: var(--ink); padding: 8px; line-height: 1.5; font-size: 15px; }
#q:focus { outline: none; }
#q::placeholder { color: var(--muted); }
#send { display: flex; align-items: center; gap: 12px; padding: 12px 17px; min-height: 44px; border: 0; border-radius: 5px; background: var(--lime); color: var(--teal-dark); font-weight: 500; }
#send:not(:disabled):hover { background: #9bc936; }
#send svg { width: 19px; height: 19px; }
.composer-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; margin: 12px 3px 0; }
.source-note { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.source-note > span { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }
.disclaimer { text-align: center; margin: 16px 0 0; font-size: 11px; color: var(--muted); line-height: 1.5; }
@media (min-width: 1100px) {
  body { background: linear-gradient(135deg, transparent 96%, #eaf2d9 96%); }
}
@media (max-width: 700px) {
  .site-header { padding: 12px 18px; gap: 12px; flex-wrap: wrap; }
  .brand { gap: 14px; }
  .brand img { width: 56px; height: 43px; }
  .brand-name { font-size: 20px; }
  .brand-name > span { font-size: 8px; }
  .nav { width: 100%; justify-content: flex-start; gap: 12px; font-size: 12px; }
  .nav:has(#logout[hidden]) { display: none; }
  #logout { margin-left: auto; }
  #log { padding: 24px 16px; gap: 20px; }
  .welcome { padding: 8px 0; }
  .welcome-icon { width: 50px; height: 50px; margin-bottom: 18px; }
  h1 { letter-spacing: -1px; }
  .eyebrow { font-size: 9px; letter-spacing: 1.3px; }
  .welcome-description { font-size: 14px; }
  .desktop-break { display: none; }
  .suggestions { grid-template-columns: 1fr; margin-top: 24px; gap: 9px; }
  .suggestion { gap: 5px; padding: 12px 34px 12px 15px; font-size: 14px; }
  .suggestion-arrow { bottom: 14px; }
  .composer-area { padding: 10px 16px max(12px, env(safe-area-inset-bottom)); }
  .composer { padding: 8px; gap: 6px; }
  #send { padding: 12px; }
  #send span { display: none; }
  #send::before { content: none; }
  .source-note { display: none; }
  .disclaimer { margin-top: 10px; font-size: 10px; }
  .msg { gap: 8px; }
  .role { flex-basis: 28px; height: 28px; font-size: 10px; }
  .bubble { padding: 12px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Conversation workspace: shared OCL colors, typography and outlined surfaces. */
.chat-workspace { display: flex; flex: 1; min-height: 0; position: relative; }
.chat-main { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
.history-panel { flex: 0 0 260px; width: 260px; display: flex; flex-direction: column; padding: 24px 16px 16px; border-right: 1px solid var(--line); background: var(--surface); min-height: 0; }
.new-chat { display: flex; align-items: center; gap: 10px; padding: 13px 16px; background: var(--lime); color: var(--teal-dark); border: 0; border-radius: 6px; text-align: left; font-weight: 500; flex-shrink: 0; }
.new-chat span { font-size: 20px; line-height: 1; }
.new-chat:hover { background: #9bc936; }
.history-label { margin: 28px 10px 12px; color: var(--teal); font-size: 10px; font-weight: 500; letter-spacing: 1.4px; }
.history-status { margin: 0 10px 10px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.history-status:empty { display: none; }
#history-list { overflow-y: auto; min-height: 0; flex: 1; }
.history-item { display: flex; flex-direction: column; gap: 7px; padding: 12px 11px; margin-bottom: 4px; border: 1px solid transparent; border-radius: 6px; text-decoration: none; font-size: 13px; color: var(--ink); }
.history-item > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item small { font-size: 10px; color: var(--muted); }
.history-item:hover { background: #fff; border-color: var(--line); }
.history-item[aria-current="page"] { background: white; border-color: #c8dedf; box-shadow: inset 3px 0 var(--teal); color: var(--teal); }
.history-note { margin: 16px 10px 0; color: var(--muted); font-size: 11px; }
#history-more, #history-retry { margin-top: 10px; }
.chat-toolbar { display: flex; align-items: center; gap: 14px; padding: 14px 24px; border-bottom: 1px solid var(--line); min-height: 49px; }
#chat-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--teal); }
#chat-status { margin: 0; padding: 12px 24px; background: #fff3f0; color: #9d3529; font-size: 13px; line-height: 1.5; }
#history-toggle { display: none; flex-shrink: 0; }
@media (max-width: 1000px) and (min-width: 761px) {
  .history-panel { flex-basis: 220px; width: 220px; padding: 20px 12px; }
  .suggestions { grid-template-columns: 1fr; gap: 8px; margin-top: 24px; }
  .suggestion { padding: 12px 32px 12px 14px; gap: 5px; }
}
@media (max-width: 760px) {
  #history-toggle { display: block; }
  .chat-toolbar { padding: 10px 16px; }
  .history-panel { display: none; }
  .history-panel.is-open { display: flex; position: absolute; top: 56px; bottom: 0; left: 0; z-index: 3; width: min(300px, 88vw); box-shadow: 8px 6px 24px #064a5820; }
}
