@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,300..800;1,8..60,300..800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --serif: 'Source Serif 4', 'Georgia', serif;
  --sans: 'Inter', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;

  --bg: #ffffff;
  --bg-sidebar: #fafafa;
  --bg-muted: #f7f7f8;
  --text: #111;
  --text-secondary: #333;
  --text-muted: #777;
  --border: #e5e5e5;
  --border-light: #eeeeee;

  --accent: #1a56db;
  --accent-hover: #1244b0;
  --accent-bg: #f0f4ff;

  --def-bg: #f0f4ff;
  --def-border: #4a7bea;
  --thm-bg: #eefbf4;
  --thm-border: #2a9d6a;
  --warn-bg: #fef9ec;
  --warn-border: #d4930a;
  --rmk-bg: #f5f3ff;
  --rmk-border: #8b6fc0;
  --ex-bg: #fef4ea;
  --ex-border: #d67d1a;
  --key-bg: #fef1f1;
  --key-border: #d63a3a;

  --sidebar-w: 260px;
  --header-h: 52px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--serif);
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
}

/* ===== HEADER ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 1000;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.header-brand .code {
  background: var(--text);
  color: #fff;
  padding: 3px 10px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.header-right {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 6px;
  margin-right: 12px;
  line-height: 1;
}

.menu-toggle:hover { background: var(--bg-muted); }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  overflow-y: auto;
  padding: 16px 0 32px;
  z-index: 900;
  transition: transform 0.25s ease;
}

.sidebar-section {
  margin-bottom: 2px;
}

.sidebar-heading {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 14px 20px 5px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 20px;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 450;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.12s;
  border-left: 2px solid transparent;
}

.sidebar-link:hover {
  color: var(--text);
  background: var(--bg-muted);
}

.sidebar-link.active {
  color: var(--accent);
  background: var(--accent-bg);
  border-left-color: var(--accent);
  font-weight: 600;
}

.sidebar-link .num {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  min-width: 20px;
}

.sidebar-link.active .num {
  color: var(--accent);
}

.sidebar-progress {
  margin: 8px 14px 12px;
  padding: 12px 14px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.sidebar-progress .label {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.progress-bar {
  height: 4px;
  background: var(--border-light);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  transition: width 0.5s ease;
}

/* ===== MAIN ===== */
.main {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

.content-wrapper {
  max-width: 740px;
  margin: 0 auto;
  padding: 48px 40px 100px;
}

/* ===== SECTIONS ===== */
.topic-section {
  display: none;
}

.topic-section.active {
  display: block;
  animation: fadeUp 0.3s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== TYPOGRAPHY ===== */
.topic-section h1 {
  font-family: var(--sans);
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
  color: var(--text);
}

.topic-subtitle {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
  line-height: 1.5;
}

.topic-section h2 {
  font-family: var(--sans);
  font-size: 1.4rem;
  font-weight: 700;
  margin: 48px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  letter-spacing: -0.02em;
}

.topic-section h3 {
  font-family: var(--sans);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.topic-section h4 {
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 700;
  margin: 24px 0 8px;
  color: var(--text-secondary);
}

.topic-section p {
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.topic-section ul, .topic-section ol {
  margin: 0 0 16px 22px;
  color: var(--text-secondary);
}

.topic-section li {
  margin-bottom: 6px;
}

.topic-section li::marker {
  color: var(--text-muted);
}

.topic-section strong {
  color: var(--text);
  font-weight: 600;
}

/* ===== BOXES ===== */
.box {
  margin: 24px 0;
  padding: 20px 22px;
  border-radius: 6px;
  border-left: 3px solid;
  font-size: 0.95rem;
}

.box-title {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.box p:last-child, .box ul:last-child, .box ol:last-child {
  margin-bottom: 0;
}

.def       { background: var(--def-bg); border-color: var(--def-border); }
.def .box-title { color: var(--def-border); }

.thm       { background: var(--thm-bg); border-color: var(--thm-border); }
.thm .box-title { color: var(--thm-border); }

.warn      { background: var(--warn-bg); border-color: var(--warn-border); }
.warn .box-title { color: var(--warn-border); }

.rmk       { background: var(--rmk-bg); border-color: var(--rmk-border); }
.rmk .box-title { color: var(--rmk-border); }

.example   { background: var(--ex-bg); border-color: var(--ex-border); }
.example .box-title { color: var(--ex-border); }

.key-concept { background: var(--key-bg); border-color: var(--key-border); }
.key-concept .box-title { color: var(--key-border); }

/* ===== EQUATIONS ===== */
.equation {
  margin: 20px 0;
  padding: 16px 24px;
  background: var(--bg-muted);
  border-radius: 6px;
  text-align: center;
  overflow-x: auto;
}

.box .equation {
  background: rgba(255,255,255,0.55);
  border: none;
}

.katex-display { margin: 0 !important; }

/* ===== TABLES ===== */
.topic-section table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.88rem;
  font-family: var(--sans);
}

.topic-section th {
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-muted);
  border-bottom: 2px solid var(--border);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.topic-section td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.topic-section tr:last-child td { border-bottom: none; }
.topic-section tbody tr:hover td { background: var(--bg-muted); }

.paper-question table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.88rem;
  font-family: var(--sans);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow: hidden;
}

.paper-question th {
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-muted);
  border-bottom: 2px solid var(--border);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.paper-question td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.paper-question tr:last-child td { border-bottom: none; }
.paper-question tbody tr:hover td { background: var(--bg-muted); }

/* ===== LANDING ===== */
.landing-hero {
  text-align: center;
  padding: 56px 0 32px;
}

.landing-hero h1 {
  font-size: 2.5rem;
  margin-bottom: 16px;
  font-family: var(--sans);
  letter-spacing: -0.035em;
}

.landing-hero .lead {
  font-family: var(--sans);
  font-size: 1.02rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 40px;
  line-height: 1.65;
}

.section-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1px;
  margin: 0 0 32px;
  background: var(--border-light);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
}

.topic-card {
  background: #fff;
  padding: 20px;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}

.topic-card:hover {
  background: var(--bg-muted);
}

.topic-card .card-num {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.topic-card h3 {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 650;
  margin-bottom: 4px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.topic-card p {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

/* ===== NAV ARROWS ===== */
.page-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.page-nav a {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 6px;
  transition: background 0.15s;
}

.page-nav a:hover {
  background: var(--accent-bg);
}

/* ===== FORMULA SHEET ===== */
.formula-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 20px 0;
  background: var(--border-light);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
}

.formula-card {
  background: #fff;
  padding: 16px 18px;
}

.formula-card .formula-name {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.formula-card .equation {
  margin: 0;
  padding: 8px 10px;
  background: var(--bg-muted);
  border: none;
}

/* ===== QUIZ ===== */
.quiz-question {
  margin: 20px 0;
  padding: 22px 24px;
  background: var(--bg-muted);
  border-radius: 8px;
}

.quiz-question .q-text {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 14px;
  color: var(--text);
  line-height: 1.5;
}

.quiz-option {
  display: block;
  padding: 9px 14px;
  margin: 5px 0;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.12s;
  color: var(--text-secondary);
}

.quiz-option:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.quiz-option.correct {
  border-color: var(--thm-border);
  background: var(--thm-bg);
  color: #1a7a4e;
  font-weight: 600;
}

.quiz-option.incorrect {
  border-color: var(--key-border);
  background: var(--key-bg);
  color: #b91c1c;
}

.quiz-explanation {
  margin-top: 12px;
  padding: 12px 14px;
  font-size: 0.88rem;
  font-family: var(--sans);
  border-radius: 6px;
  display: none;
  line-height: 1.55;
  color: var(--text-secondary);
}

.quiz-explanation.show { display: block; }

/* ===== PAST PAPERS ===== */
.paper-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.paper-btn {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s;
}

.paper-btn:hover { border-color: var(--text-muted); }

.paper-btn.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.paper-question {
  margin: 20px 0;
  padding: 20px 22px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: #fff;
}

.paper-question .pq-number {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.paper-question .pq-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.paper-question .pq-marks {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 6px;
}

.paper-question .pq-subparts {
  margin-top: 12px;
  padding-left: 18px;
  border-left: 2px solid var(--border-light);
}

.paper-question .pq-subpart {
  margin-bottom: 12px;
}

.paper-question .pq-subpart-label {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 2px;
}

/* ===== FIGURES ===== */
.figure {
  margin: 28px 0;
  text-align: center;
}

.figure img {
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border-light);
}

.figure-caption {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 10px;
  font-style: italic;
}

/* ===== INTERACTIVE ===== */
.interactive-container {
  margin: 24px 0;
  padding: 24px;
  background: var(--bg-muted);
  border-radius: 8px;
}

.slider-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-family: var(--sans);
  font-size: 0.85rem;
}

.slider-group label {
  min-width: 100px;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.slider-group input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}

.slider-group .val {
  font-family: var(--mono);
  font-size: 0.8rem;
  min-width: 60px;
  text-align: right;
  color: var(--text-secondary);
}

canvas {
  border: 1px solid var(--border-light);
  border-radius: 6px;
  max-width: 100%;
}

/* ===== OVERLAY ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 850;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 16px rgba(0,0,0,0.08); }
  .sidebar-overlay.open { display: block; }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .content-wrapper { padding: 32px 20px 60px; }
  .topic-section h1 { font-size: 1.7rem; }
  .header-right { display: none; }
  .header-brand .code { display: none; }
  .header-brand { font-size: 0.82rem; }
}

@media (max-width: 600px) {
  html { font-size: 15px; }
  .landing-hero h1 { font-size: 1.9rem; }
  .topic-grid { grid-template-columns: 1fr; }
  .formula-grid { grid-template-columns: 1fr; }
  .content-wrapper { padding: 24px 16px 48px; }
  .box { padding: 16px 16px; }
}

/* ===== SCROLLBAR ===== */
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 100px; }

/* ===== FOCUS ===== */
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== CHAT PANEL ===== */
.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  height: 44px;
  padding: 0 18px 0 14px;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  transition: background 0.15s, transform 0.15s;
}

.chat-fab:hover {
  background: #333;
  transform: translateY(-1px);
}

.chat-fab svg { flex-shrink: 0; }

.chat-panel {
  position: fixed;
  top: var(--header-h);
  right: 0;
  bottom: 0;
  width: 360px;
  background: #fff;
  border-left: 1px solid var(--border);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.chat-panel.open {
  transform: translateX(0);
}

.chat-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-new-btn {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.12s;
}

.chat-new-btn:hover { color: var(--text); background: var(--bg-muted); }

.chat-close-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.12s;
}

.chat-close-btn:hover { color: var(--text); background: var(--bg-muted); }

.chat-context {
  margin: 12px 18px 0;
  padding: 10px 12px;
  background: var(--accent-bg);
  border: 1px solid #d4ddff;
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.chat-context p {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--accent);
  line-height: 1.4;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.chat-context-close {
  background: none;
  border: none;
  color: #a0b0ff;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.chat-context-close:hover { color: var(--accent); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
}

.chat-empty {
  padding-top: 24px;
}

.chat-empty h4 {
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.chat-starter {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  margin-bottom: 6px;
  background: none;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s;
  line-height: 1.45;
}

.chat-starter:hover {
  border-color: var(--border);
  background: var(--bg-muted);
}

.chat-msg {
  margin-bottom: 16px;
}

.chat-msg-user {
  display: flex;
  justify-content: flex-end;
}

.chat-msg-user-bubble {
  max-width: 85%;
  background: var(--text);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 0.82rem;
  line-height: 1.5;
}

.chat-msg-ai {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.chat-msg-ai p { margin-bottom: 8px; }
.chat-msg-ai p:last-child { margin-bottom: 0; }
.chat-msg-ai strong { color: var(--text); }
.chat-msg-ai code {
  font-family: var(--mono);
  font-size: 0.78rem;
  background: var(--bg-muted);
  padding: 1px 5px;
  border-radius: 3px;
}

.chat-msg-ai ul, .chat-msg-ai ol {
  margin: 4px 0 8px 16px;
  font-size: 0.82rem;
}

.chat-dots {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.chat-dots span {
  width: 6px;
  height: 6px;
  background: var(--border);
  border-radius: 50%;
  animation: chatBounce 1.2s infinite;
}

.chat-dots span:nth-child(2) { animation-delay: 0.15s; }
.chat-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chatBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

.chat-error {
  margin: 0 18px 8px;
  padding: 8px 12px;
  background: var(--key-bg);
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 0.75rem;
  color: #b91c1c;
}

.chat-input-area {
  padding: 12px 18px;
  border-top: 1px solid var(--border-light);
}

.chat-input-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-muted);
  border-radius: 10px;
  padding: 8px 12px;
}

.chat-input-form textarea {
  flex: 1;
  border: none;
  background: none;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--text);
  resize: none;
  outline: none;
  line-height: 1.5;
  min-height: 20px;
  max-height: 100px;
}

.chat-input-form textarea::placeholder {
  color: var(--text-muted);
}

.chat-send-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.12s;
}

.chat-send-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.chat-send-btn:not(:disabled):hover {
  background: #333;
}

@media (max-width: 600px) {
  .chat-panel { width: 100%; }
  .chat-fab { bottom: 16px; right: 16px; }
}
