/* examples/external-chatbot/public/styles.css
   Deliberately not ZeroFlow's look: this is a third-party app. */
:root {
  --paper: #fbf7ef;
  --ink: #1f2a2e;
  --muted: #55636a;
  --teal: #0f6b62;
  --teal-dark: #0a4f48;
  --sand: #efe4cf;
  --line: #d9ccb2;
  --error: #a3261b;
  --ok: #1d6b2f;
  --radius: 14px;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
code { font-family: ui-monospace, Menlo, monospace; font-size: 0.9em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 12px; }
.skip:focus { left: 8px; top: 8px; z-index: 10; }

.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px clamp(16px, 4vw, 40px); background: var(--teal); color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--sand); color: var(--teal-dark); font-weight: 700; font-size: 1.3rem;
}
.brand-name { margin: 0; font-size: 1.15rem; font-weight: 700; }
.brand-sub { margin: 0; font-size: 0.85rem; opacity: 0.9; font-family: system-ui, sans-serif; }
.pill {
  margin: 0; padding: 4px 10px; border-radius: 999px; background: var(--sand); color: var(--teal-dark);
  font: 600 0.75rem system-ui, sans-serif; letter-spacing: 0.06em;
}

.layout { width: 100%; max-width: 760px; margin: 0 auto; padding: 24px 16px 40px; display: grid; gap: 16px; flex: 1; align-content: start; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card.compact { padding: 14px 20px; }
h1, h2 { margin: 0 0 8px; line-height: 1.2; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
.muted { color: var(--muted); margin: 0 0 16px; font-family: system-ui, sans-serif; line-height: 1.5; }
.small { font-size: 0.85rem; margin: 0; overflow-wrap: anywhere; }
.row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

form { font-family: system-ui, sans-serif; }
label { display: block; font-weight: 600; margin: 12px 0 6px; }
input, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
textarea { resize: vertical; min-height: 48px; }
input:focus-visible, textarea:focus-visible, .btn:focus-visible { outline: 3px solid #e3a13b; outline-offset: 2px; }
.help { margin: 4px 0 0; font-size: 0.82rem; color: var(--muted); }

.btn {
  font: 600 0.92rem system-ui, sans-serif; border-radius: 10px; padding: 10px 16px; cursor: pointer;
  border: 1px solid var(--teal); background: #fff; color: var(--teal-dark); min-height: 44px;
}
.btn.primary { background: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-dark); }
.btn.ghost { border-color: var(--line); color: var(--muted); }
.btn:disabled { opacity: 0.6; cursor: progress; }
#setup-form .btn, #access-form .btn { margin-top: 18px; }

.status { margin: 10px 0 0; min-height: 1.2em; font: 0.9rem system-ui, sans-serif; color: var(--muted); }
.status[data-tone="error"] { color: var(--error); }
.status[data-tone="ok"] { color: var(--ok); }

.chat { display: flex; flex-direction: column; }
.transcript { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 12px; max-height: 60vh; overflow-y: auto; }
.transcript:empty::before {
  content: "Ask a question about the documents in this application's knowledge base.";
  color: var(--muted); font: 0.92rem system-ui, sans-serif;
}
.msg { border-radius: 12px; padding: 12px 14px; border: 1px solid var(--line); }
.msg.user { background: var(--sand); margin-left: clamp(0px, 10%, 64px); }
.msg.assistant { background: #fff; margin-right: clamp(0px, 10%, 64px); }
.who { margin: 0 0 4px; font: 700 0.78rem system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.text { margin: 0; white-space: pre-wrap; line-height: 1.55; overflow-wrap: anywhere; }
.meta { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font: 0.85rem system-ui, sans-serif; }
.cite-title { margin: 0 0 4px; font-weight: 700; color: var(--teal-dark); }
.citations { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 2px; overflow-wrap: anywhere; }
.cite-none { margin: 0; color: var(--muted); font-style: italic; }
.trace { margin: 6px 0 0; color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: 0.75rem; overflow-wrap: anywhere; }

.composer { position: relative; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; }

.foot { padding: 16px; text-align: center; color: var(--muted); font: 0.8rem system-ui, sans-serif; }
.foot p { margin: 0; }

@media (max-width: 520px) {
  .composer { flex-direction: column; align-items: stretch; }
  .masthead { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
