:root {
  --bg: #f4f6fc;
  --bg-soft: #eaeef8;
  --panel: #ffffff;
  --panel-2: #f1f4fb;
  --border: #d6dcec;
  --text: #1b2138;
  --muted: #5b6382;
  --accent: #0F766E;
  --accent-2: #115E59;
  --green: #12885f;
  --red: #d63a55;
  --amber: #a4700a;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(28, 40, 90, 0.10);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, #e6ebfa 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar .brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
}

.topbar .spacer { flex: 1; }

.back-link {
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
}
.back-link:hover { color: var(--text); text-decoration: none; border-color: var(--accent); }

.badge {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--bg-soft);
  white-space: nowrap;
}
.badge.ok { color: var(--green); border-color: rgba(18, 136, 95, 0.45); }
.badge.warn { color: var(--amber); border-color: rgba(164, 112, 10, 0.45); }
.badge.err { color: var(--red); border-color: rgba(214, 58, 85, 0.45); }

.container { max-width: 1080px; margin: 0 auto; padding: 34px 22px 60px; }

/* ---------- Home ---------- */
.hero { text-align: center; margin: 40px 0 34px; }
.hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  margin: 0 0 10px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { color: var(--muted); margin: 0 auto; max-width: 640px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 30px;
}

.card {
  display: block;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  text-decoration: none;
}
.card h2 { margin: 14px 0 8px; font-size: 21px; }
.card p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.card .go { font-size: 13px; color: var(--accent); font-weight: 600; }

.home-footer {
  margin-top: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Chatbot ---------- */
.chat-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 61px);
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: 0 16px;
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 22px 4px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg { display: flex; gap: 10px; max-width: 85%; }
.msg .avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 14px;
  flex-shrink: 0;
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.msg .bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14.5px;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--border);
}
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .bubble { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.msg.assistant .bubble { background: var(--panel); }
.msg .meta { font-size: 11px; color: var(--muted); margin-top: 6px; }

.chat-empty {
  margin: auto;
  text-align: center;
  color: var(--muted);
  max-width: 460px;
}
.chat-empty h3 { color: var(--text); margin-bottom: 6px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.suggestions button {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
}
.suggestions button:hover { color: var(--text); border-color: var(--accent); }

.chat-input {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 14px 0 20px;
  border-top: 1px solid var(--border);
}
.chat-input textarea {
  flex: 1;
  resize: none;
  overflow-y: hidden;
  box-sizing: border-box;
  min-height: 52px;
  max-height: 180px;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  font-family: inherit;
}
.chat-input textarea:focus { outline: none; border-color: var(--accent); }

.btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 500;
  padding: 8px 14px;
  font-size: 13px;
}
.btn.ghost:hover { color: var(--text); border-color: var(--accent); }

.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
  animation: blink 1.2s infinite both;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* ---------- Question generator ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 22px;
}
.panel h3 { margin: 0 0 16px; font-size: 16px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.field input, .field select {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 14.5px;
  font-family: inherit;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field.check { flex-direction: row; align-items: center; gap: 10px; margin-top: 24px; }
.field.check input { width: 18px; height: 18px; }

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.stat {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  min-width: 92px;
}
.stat .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.stat .v { font-size: 19px; font-weight: 700; }

.qcard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.qcard .qhead { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.qnum {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  padding: 3px 9px;
  color: var(--muted);
}
.tag {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.tag.ok { color: var(--green); border-color: rgba(18, 136, 95, 0.45); }
.tag.fix { color: var(--amber); border-color: rgba(240, 160, 20, 0.5); }
.tag.bad { color: var(--red); border-color: rgba(214, 58, 85, 0.5); }

.qtext { font-size: 15.5px; font-weight: 600; margin: 0 0 14px; }
.options { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.options li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14.5px;
}
.options li.answer {
  border-color: rgba(18, 136, 95, 0.5);
  background: rgba(18, 136, 95, 0.10);
}
.options li .letter { font-weight: 700; color: var(--muted); min-width: 20px; }
.options li.answer .letter { color: var(--green); }

.answer-line {
  background: rgba(18, 136, 95, 0.10);
  border: 1px solid rgba(18, 136, 95, 0.45);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14.5px;
  margin-bottom: 12px;
}
.answer-line b { color: var(--green); }

details.explain {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}
details.explain summary { cursor: pointer; color: var(--accent); font-size: 13px; }
details.explain p { margin: 10px 0 0; color: var(--muted); white-space: pre-wrap; }

.status {
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}
.status.error { display: block; background: rgba(214, 58, 85, 0.10); border: 1px solid rgba(214, 58, 85, 0.5); color: #98203a; }
.status.info { display: block; background: var(--bg-soft); border: 1px solid var(--border); color: var(--muted); }
.status.ok { display: block; background: rgba(18, 136, 95, 0.10); border: 1px solid rgba(18, 136, 95, 0.45); color: #0c5f42; }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
  vertical-align: -3px;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Chatbot sidebar (mirrors the Streamlit test UI) ---------- */
.chat-shell { display: flex; height: calc(100vh - 61px); width: 100%; }

.side {
  width: 300px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 18px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.drawer-heading { display: none; }
.drawer-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
  padding: 2px 8px;
  border-radius: 8px;
}
.drawer-close:hover { background: var(--bg-soft); color: var(--text); }
.side h4 {
  margin: 0 0 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}
.side .row { display: flex; flex-direction: column; gap: 6px; }
.side select, .side input[type="text"] {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 13.5px;
  font-family: inherit;
  width: 100%;
}
.side select:focus, .side input:focus { outline: none; border-color: var(--accent); }
.side .side-btn { width: 100%; padding: 10px; font-size: 13.5px; border-radius: 10px; }
.side .caption { font-size: 12px; color: var(--muted); word-break: break-all; }
.side .divider { height: 1px; background: var(--border); }

.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio {
  display: flex; gap: 8px; align-items: center;
  font-size: 13.5px; color: var(--text); cursor: pointer;
}
.radio input { accent-color: var(--accent); width: 16px; height: 16px; }
.check-row { display: flex; gap: 8px; align-items: center; font-size: 13.5px; cursor: pointer; }
.check-row input { accent-color: var(--accent); width: 16px; height: 16px; }

.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.range-row .val { font-size: 13px; color: var(--muted); min-width: 32px; text-align: right; }

.msg-warning {
  align-self: stretch;
  margin: 6px 0 0 40px;
  background: rgba(240, 160, 20, 0.12);
  border: 1px solid rgba(240, 160, 20, 0.5);
  color: #7a4c05;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
}

.msg .meta {
  margin: 6px 0 0 40px;
  font-size: 11.5px;
  color: var(--muted);
}
.msg.user .meta { margin-left: 0; text-align: right; }

/* Markdown inside chat bubbles (chatbot_ui.py renders st.markdown) */
.bubble > :first-child { margin-top: 0; }
.bubble > :last-child { margin-bottom: 0; }
.bubble p { margin: 0 0 10px; }
.bubble ul, .bubble ol { margin: 0 0 10px; padding-left: 22px; }
.bubble li { margin: 3px 0; }
.bubble h1, .bubble h2, .bubble h3, .bubble h4, .bubble h5, .bubble h6 {
  margin: 14px 0 8px; font-size: 15px; color: var(--text);
}
.bubble code {
  background: rgba(20, 28, 60, 0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 5px;
  font-size: 13px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.bubble pre {
  background: rgba(20, 28, 60, 0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  overflow-x: auto;
  margin: 0 0 10px;
}
.bubble pre code { background: none; border: none; padding: 0; }
.bubble blockquote {
  margin: 0 0 10px;
  padding: 4px 12px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}
.bubble table { border-collapse: collapse; margin: 0 0 10px; font-size: 13.5px; }
.bubble th, .bubble td { border: 1px solid var(--border); padding: 6px 10px; }
.bubble a { text-decoration: underline; }
.bubble hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

.frame-drawer {
  margin: 8px 0 0 40px;
  font-size: 12px;
}
.frame-drawer summary { color: var(--accent); cursor: pointer; }
.frame-drawer pre {
  margin-top: 8px;
  background: rgba(20, 28, 60, 0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

@media (max-width: 860px) {
  .chat-shell { flex-direction: column; height: auto; }
  .side { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .chat-wrap { height: 70vh; }
}

@media (max-width: 640px) {
  .msg { max-width: 100%; }
  .field.check { margin-top: 0; }
}

/* ---------- Claude-style theme (chatbot page only) ----------
 * Warm cream background, blue accent, assistant answers as plain text with
 * no bubble or avatar, user turns in a soft rounded card, and a floating
 * rounded composer with a circular send button — the claude.ai layout.
 * Scoped to body.claude-theme so the rest of the app keeps its theme.
 */
body.claude-theme {
  --bg: #faf9f5;
  --bg-soft: #f0eee6;
  --panel: #ffffff;
  --panel-2: #f5f3ec;
  --border: #e5e1d6;
  --text: #1f1e1d;
  --muted: #6b6963;
  --accent: #0F766E;
  --accent-2: #115E59;
  --shadow: 0 1px 2px rgba(31, 30, 29, 0.06);
  background: var(--bg);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.claude-theme .topbar {
  background: transparent;
  backdrop-filter: none;
  border-bottom: 1px solid var(--border);
  padding: 10px 18px;
}
.claude-theme .back-link,
.topbar .header-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 14px;
  border-color: #d9ded6;
  background: #fff;
  color: #4c625d;
  font-size: 13px;
  font-weight: 500;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.claude-theme .back-link:hover,
.topbar .header-home:hover {
  background: #edf5f2;
  border-color: #bfd5cd;
  color: var(--accent-2);
  text-decoration: none;
}

/* Logout is a <button>, so it needs the browser's button defaults reset
   before it can wear the same .back-link pill the anchors use: buttons ship
   with their own background, border radius, font and line height. */
.topbar button.back-link {
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  line-height: inherit;
}

.claude-theme .side-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 8px;
  line-height: 1;
}
.claude-theme .side-toggle:hover { background: var(--bg-soft); color: var(--text); }

body.claude-theme.side-hidden .side { display: none; }

.claude-theme .side {
  width: 272px;
  background: #f5f3ec;
  border-right: 1px solid #e8e4d9;
  padding: 16px 14px;
}

.claude-theme .chat-shell {
  flex: 1;
  min-height: 0;
  height: auto;
  width: 100%;
}

/* full-width column so the only scrollbar sits at the viewport's right edge */
.claude-theme .chat-wrap {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.claude-theme .chat-log {
  padding: 30px 20px 12px;
  gap: 22px;
  width: 100%;
  flex: 1;
  min-height: 0;
}

/* Start screen: center the welcome and composer together until a chat begins. */
.claude-theme.chat-start .chat-wrap { justify-content: center; }
.claude-theme.chat-start .chat-log {
  flex: 0 0 auto;
  overflow: visible;
  padding: 0 20px 18px;
}
.claude-theme.chat-start .chat-empty { margin: 0 auto; }
.claude-theme.chat-start .chat-input {
  border-top: 0;
  padding: 0 20px;
}
.claude-theme.chat-start .chat-input textarea { min-height: 104px; }

/* wider, darker scrollbar pinned to the right edge of the viewport */
.claude-theme .chat-log::-webkit-scrollbar { width: 14px; }
.claude-theme .chat-log::-webkit-scrollbar-track { background: transparent; }
.claude-theme .chat-log::-webkit-scrollbar-thumb {
  background: #8a8578;
  border-radius: 999px;
  border: 4px solid transparent;
  background-clip: content-box;
}
.claude-theme .chat-log::-webkit-scrollbar-thumb:hover {
  background: #6b675c;
  background-clip: content-box;
  border: 4px solid transparent;
}

/* messages centered in a reading-width column; scrollbar stays at viewport edge */
.claude-theme .msg {
  max-width: 48rem;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.claude-theme .msg.user .bubble { max-width: 78%; }
.claude-theme .msg.user .col {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.claude-theme .msg.user .bubble { width: fit-content; }
.claude-theme .msg .avatar { display: none; }
.claude-theme .msg .col { max-width: 100%; }

/* Claude: user turns are a soft rounded card, assistant is plain text */
.claude-theme .msg.user .bubble {
  background: #e5e5e5;
  border: none;
  border-radius: 18px;
  padding: 12px 16px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
}
.claude-theme .msg.assistant .bubble {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
}

.claude-theme .bubble p { margin: 0 0 12px; }
.claude-theme .msg.assistant .bubble h1,
.claude-theme .msg.assistant .bubble h2,
.claude-theme .msg.assistant .bubble h3,
.claude-theme .msg.assistant .bubble h4,
.claude-theme .msg.assistant .bubble h5,
.claude-theme .msg.assistant .bubble h6 {
  color: #244c45;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.4;
  margin: 24px 0 10px;
}
.claude-theme .msg.assistant .bubble h3 { font-size: 21px; }
.claude-theme .msg.assistant .bubble h4 { font-size: 17px; color: #465c56; }
.claude-theme .msg.assistant .bubble h5,
.claude-theme .msg.assistant .bubble h6 { font-size: 16px; }
.claude-theme .msg.assistant .bubble p,
.claude-theme .msg.assistant .bubble li { letter-spacing: 0.005em; }
.claude-theme .bubble code {
  background: #f0eee6;
  border: none;
  color: var(--accent-2);
}
.claude-theme .bubble pre {
  background: #f5f3ec;
  border: 1px solid #e8e4d9;
}
.claude-theme .bubble th { background: #f5f3ec; }
.claude-theme .bubble a { color: var(--accent); }
.claude-theme .bubble blockquote { border-left-color: var(--accent); }

.claude-theme .msg .meta,
.claude-theme .msg.user .meta { margin: 6px 0 0 0; text-align: left; }
.claude-theme .msg-warning { margin-left: 0; }
.claude-theme .frame-drawer { margin-left: 0; }

/* Floating composer: white rounded box + circular accent send button */
.claude-theme .chat-input {
  border-top: none;
  padding: 10px 20px 18px;
  gap: 10px;
  align-items: flex-end;
  max-width: 48rem;
  width: 100%;
  margin: 0 auto;
  flex-shrink: 0;
}
.claude-theme .chat-input textarea {
  background: #ffffff;
  border: 1px solid #e5e1d6;
  border-radius: 18px;
  box-shadow: 0 1px 3px rgba(31, 30, 29, 0.08);
  padding: 13px 16px;
  font-size: 16px;
  min-height: 50px;
  overflow-y: hidden;
}
.claude-theme .chat-input textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.claude-theme .chat-input .btn {
  background: var(--accent);
  border-radius: 999px;
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 19px;
  line-height: 1;
}
.claude-theme .chat-input .btn:hover { background: var(--accent-2); }
.claude-theme .chat-input .btn:disabled { background: #d7d9e4; }

/* Empty state, like Claude's centered greeting */
.claude-theme .chat-empty h3 {
  font-size: 26px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}
.claude-theme .chat-empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border: 1px solid #d8e7e2;
  border-radius: 18px;
  background: #edf5f2;
  color: var(--accent);
  font-size: 29px;
}
.claude-theme .chat-empty .chat-empty-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.02em;
}
.claude-theme .suggestions button {
  background: #ffffff;
  border: 1px solid #e5e1d6;
  color: #5c5a54;
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 13.5px;
  box-shadow: 0 1px 2px rgba(31, 30, 29, 0.05);
}
.claude-theme .suggestions button:hover {
  border-color: var(--accent);
  color: var(--accent-2);
}

.claude-theme .typing span { background: #b3aea2; }

/* Mobile: sidebar is a hamburger drawer — hidden by default, slides in as an
 * overlay only when the ☰ button is tapped, so the chat stays visible */
@media (max-width: 860px) {
  body.claude-theme { height: 100dvh; }
  .claude-theme .side {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(84vw, 320px);
    z-index: 30;
    box-shadow: 0 0 40px rgba(31, 30, 29, 0.25);
    display: none;
  }
  .claude-theme .drawer-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: -16px -14px 0;
    min-height: 38px;
    padding: 0 42px;
    font-size: 14px;
    font-weight: 600;
  }
  .claude-theme .drawer-heading > span { transform: translateY(8px); }
  .claude-theme .drawer-close {
    display: grid;
    place-items: center;
    position: fixed;
    z-index: 32;
    top: 10px;
    left: 10px;
    width: 34px;
    height: 34px;
    margin: 0;
    border: 1px solid #dedacf;
    border-radius: 9px;
    background: #fff;
    color: #315e59;
    box-shadow: 3px 2px 10px rgba(31, 30, 29, 0.12);
    font-family: Arial, sans-serif;
    font-size: 21px;
    font-weight: 400;
    padding: 0;
    transition: background .15s ease, color .15s ease, width .15s ease;
  }
  .claude-theme .drawer-close:hover { background: #f0f6f4; color: var(--accent-2); }
  body.claude-theme.side-open .side { display: flex; }
  /* dim the chat behind the open drawer; tapping it closes the drawer */
  body.claude-theme.side-open .chat-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(31, 30, 29, 0.35);
    z-index: 25;
  }
  .claude-theme .topbar { padding: 8px 12px; flex-wrap: nowrap; gap: 8px; }
  .claude-theme .back-link { min-height: 34px; padding: 5px 12px; }
  .claude-theme .chat-log { padding: 18px 14px 10px; }
  .claude-theme .chat-input { padding: 8px 14px 14px; }
  .claude-theme.chat-start .chat-log { padding: 0 14px 16px; }
  .claude-theme.chat-start .chat-input { padding: 0 14px; }
  .claude-theme .msg.user { max-width: 92%; }
  .claude-theme .msg.user .bubble { max-width: 100%; }
}

@media (max-width: 640px) {
  .claude-theme .badge { display: none; }
  .claude-theme .chat-input { position: relative; gap: 0; padding: 8px 14px 14px; }
  .claude-theme .chat-input textarea {
    min-height: 54px;
    padding: 12px 58px 12px 16px;
    border-radius: 17px;
    font-size: 14px;
  }
  .claude-theme.chat-start .chat-input textarea {
    min-height: 90px;
    padding: 14px 58px 42px 16px;
  }
  .claude-theme .chat-input .btn {
    position: absolute;
    right: 24px;
    bottom: 21px;
    width: 34px;
    height: 34px;
    min-width: 34px;
  }
  .claude-theme.chat-start .chat-wrap { justify-content: space-between; }
  .claude-theme.chat-start .chat-log {
    flex: 1 1 auto;
    display: flex;
    align-items: flex-start;
    padding: 16vh 14px 0;
    overflow: hidden;
  }
  .claude-theme.chat-start .chat-input { padding: 0 14px 16px; }
  .container { padding: 20px 14px 44px; }
  .hero { margin: 18px 0; }
  .panel { padding: 16px; }
  .form-actions .btn { flex: 1; }
  .topbar { padding: 10px 14px; flex-wrap: wrap; }
}
