:root {
  /* Brand palette — Moodle Boost default preset */
  --primary: #0f6cbf;
  --secondary: #ced4da;
  --success: #357a32;
  --info: #008196;
  --warning: #f0ad4e;
  --danger: #ca3120;
  --light: #f8f9fa;
  --dark: #343a40;

  /* Body / typography */
  --body-bg: #ffffff;
  --body-color: #1d2125;
  --link-color: var(--primary);

  --font-family-base: system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-size-base: 1rem;

  /* Boost's border-radius choices */
  --border-radius: 0.5rem;
  --border-radius-lg: 0.5rem;
  --border-radius-sm: 0.25rem;
}

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

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font-family-base);
  font-size: 15px;
  color: var(--body-color);
  background: #f0f2f5;
}

/* ── Two-pane layout ── */

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ── Shared pane structure ── */

.chat-pane,
.right-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-pane {
  border-right: 1px solid #d0d7de;
  background: #fff;
}

.right-pane {
  background: var(--light);
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: #1a3a5c;
  color: #fff;
  flex-shrink: 0;
}

.pane-title {
  flex: 1;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

/* ── Right pane tabs ── */

.right-tab-bar {
  display: flex;
  background: #1a3a5c;
  flex-shrink: 0;
}

.right-tab-btn {
  flex: 1;
  padding: 0.65rem 1rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
}

.right-tab-btn:hover {
  color: rgba(255, 255, 255, 0.9);
}

.right-tab-btn.active {
  color: #fff;
  border-bottom-color: #fff;
}

.right-tab-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.right-tab-panel.hidden {
  display: none;
}

/* Modeller tab: sub-header with nav arrows */
.model-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #1f456e;
  color: #fff;
  flex-shrink: 0;
}

.model-nav-title {
  flex: 1;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

/* ── Modeller tab: sub-tabs ── */

.model-subtab-bar {
  display: flex;
  background: #1f456e;
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,0.10);
}

.model-subtab-btn {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.75rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.model-subtab-btn:hover {
  color: rgba(255, 255, 255, 0.85);
}

.model-subtab-btn.active {
  color: #fff;
  border-bottom-color: #7ab8e8;
}

.model-subtab-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.model-subtab-panel.hidden {
  display: none;
}

#worksheet-img {
  max-width: 100%;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #fff;
  display: block;
}

/* ── Chat messages ── */

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.empty-state {
  color: #888;
  font-size: 0.95rem;
  margin: auto;
  text-align: center;
  padding: 2rem;
  max-width: 280px;
  line-height: 1.6;
}

.message {
  display: flex;
  flex-direction: column;
}

.message.user {
  align-items: flex-end;
}

.message.assistant {
  align-items: flex-start;
}

.bubble {
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  max-width: 88%;
  line-height: 1.5;
  word-break: break-word;
}

.user-bubble {
  background: var(--primary);
  color: #fff;
  border-radius: 12px 12px 2px 12px;
  white-space: pre-wrap;
}

.assistant-bubble {
  background: #fff;
  border: 1px solid #d0d7de;
  border-radius: 2px 12px 12px 12px;
}

/* ── Markdown body reset inside bubbles ── */

.markdown-body { font-size: 0.93rem; }
.markdown-body p { margin: 0 0 0.5em; }
.markdown-body p:last-child { margin-bottom: 0; }
.markdown-body ul, .markdown-body ol { margin: 0.3em 0 0.5em 1.2em; padding: 0; }
.markdown-body li { margin-bottom: 0.2em; }
.markdown-body code {
  background: #f0f4f8;
  border-radius: 3px;
  padding: 0.1em 0.35em;
  font-size: 0.88em;
  font-family: "Cascadia Code", "Fira Code", monospace;
}
.markdown-body pre {
  background: #f0f4f8;
  border: 1px solid #dde;
  border-radius: 5px;
  padding: 0.6rem 0.8rem;
  overflow-x: auto;
  font-size: 0.85rem;
}
.markdown-body pre code { background: none; padding: 0; }
.markdown-body strong { font-weight: 600; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  font-size: 1em;
  font-weight: 600;
  margin: 0.5em 0 0.3em;
}

/* ── Tool events ── */

.tool-events {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.35rem;
  max-width: 88%;
}

.tool-chip {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  white-space: nowrap;
}

.tool-chip.ok {
  background: #e8f4fd;
  color: #1a5a8c;
  border: 1px solid #b8d8f0;
}

.tool-chip.err {
  background: #fdf0ef;
  color: #8b1a1a;
  border: 1px solid #e0a0a0;
}

/* ── Loading indicator ── */

.loading-dots {
  display: inline-flex;
  gap: 4px;
  padding: 0.55rem 0.85rem;
  background: #f0f4f8;
  border-radius: 2px 12px 12px 12px;
  border: 1px solid #d0d7de;
  align-items: center;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  background: #888;
  border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* ── Chat input area ── */

.chat-input-area {
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  border-top: 1px solid #d0d7de;
  background: #fff;
}

.input-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
}

textarea {
  flex: 1;
  padding: 0.55rem 0.75rem;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1px solid #b0b8c1;
  border-radius: 6px;
  resize: none;
  line-height: 1.45;
  min-height: 60px;
  max-height: 160px;
  overflow-y: auto;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26, 127, 193, 0.18);
}

textarea:disabled {
  background: #f5f5f5;
  color: #aaa;
}

/* ── Buttons ── */

.btn-send {
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  align-self: flex-end;
  height: 38px;
}

.btn-send:hover { background: #155d9e; }
.btn-send:active { background: #0e4270; }
.btn-send:disabled { background: #ccc; color: #888; cursor: not-allowed; }

.btn-sidebar-toggle {
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.2rem 0.5rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-nav {
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 0.45rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn-nav:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ── Model pane content ── */

.model-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#model-img {
  max-width: 100%;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #fff;
  display: block;
}

.model-placeholder {
  margin: auto;
  text-align: center;
  color: #999;
  padding: 2rem;
  max-width: 260px;
}

.model-placeholder p { margin: 0 0 0.5em; }
.model-placeholder .hint { font-size: 0.85rem; color: #bbb; }

.json-details {
  margin-top: 1rem;
  width: 100%;
}

.json-details summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: #666;
  user-select: none;
  padding: 0.25rem 0;
}

.json-details pre {
  background: #f5f7fa;
  border: 1px solid #e0e4ea;
  border-radius: 4px;
  padding: 0.7rem 0.9rem;
  overflow-x: auto;
  font-size: 0.78rem;
  margin-top: 0.4rem;
  font-family: "Cascadia Code", "Fira Code", monospace;
}

/* ── Ders Planı tab ── */

/* ── Ders Planı toolbar (download button bar) ── */

.ders-plani-toolbar {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0.45rem 1rem;
  background: #f4f7fa;
  border-bottom: 1px solid #d8e4ef;
}

.btn-download-docx {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: #1a3a5c;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.15s;
}

.btn-download-docx:hover {
  background: #255080;
}

.lp-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}

.lp-header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #1a3a5c;
}

.lp-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a3a5c;
  margin: 0 0 0.3rem;
}

.lp-meta-strip {
  font-size: 0.82rem;
  color: #666;
}

.lp-section {
  margin-bottom: 1.5rem;
}

.lp-section-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1a3a5c;
  margin: 0 0 0.5rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid #c8d8e8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}


.lp-subsection-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #444;
  margin: 0.75rem 0 0.4rem;
}

.lp-placeholder {
  font-size: 0.85rem;
  color: #aaa;
  font-style: italic;
  margin: 0.2rem 0;
}

/* Kazanımlar */
.lp-kazanim-list {
  list-style: disc;
  margin: 0 0 0 1.2rem;
  padding: 0;
}

.lp-kazanim-list li {
  font-size: 0.88rem;
  margin-bottom: 0.3rem;
  line-height: 1.45;
}

.lp-kazanim-code {
  font-family: "Cascadia Code", "Fira Code", monospace;
  font-size: 0.8rem;
  background: #eef4fb;
  color: #1a5a8c;
  border-radius: 3px;
  padding: 0.05em 0.35em;
  margin-right: 0.3em;
}

/* Dersin Akışı */
.lp-steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.lp-step {
  background: #fff;
  border: 1px solid #d8e4ee;
  border-radius: 5px;
  padding: 0.6rem 0.8rem;
}

.lp-step-header {
  font-size: 0.88rem;
  font-weight: 600;
  color: #222;
  margin-bottom: 0.15rem;
}

.lp-sd-strip {
  font-size: 0.72rem;
  color: #7a9bbf;
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}

.lp-duration {
  font-weight: 400;
  color: #666;
  font-size: 0.82rem;
}

.lp-step-description {
  font-size: 0.84rem;
  color: #444;
  line-height: 1.45;
}

/* Artifacts (SFDs + ZBDGs) embedded within a step */
.lp-step-artifacts {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* Expected answer rendered beneath a discussion question */
.lp-expected-answer {
  font-size: 0.78rem;
  color: #666;
  font-style: italic;
  margin: 0.1rem 0 0.35rem 1.1rem;
}

/* Legacy fallback block for old-format unattached artifacts */
.lp-legacy-fallback {
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #fdf8f0;
  border: 1px dashed #e0c88a;
  border-radius: 5px;
}

.lp-legacy-fallback-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #856404;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}

.lp-legacy-fallback-note {
  font-size: 0.75rem;
  color: #856404;
  font-style: italic;
  margin: 0 0 0.4rem;
}

/* Tartışma Soruları inside steps */
.lp-dq-block {
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px dashed #d0dce8;
}

.lp-dq-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #1a5a8c;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.lp-dq-list {
  list-style: decimal;
  margin: 0 0 0 1.1rem;
  padding: 0;
}

.lp-dq-item {
  font-size: 0.82rem;
  color: #333;
  line-height: 1.45;
  margin-bottom: 0.2rem;
}

/* SFD + ZBDG thumbnails */
.lp-model-thumb {
  max-width: 200px;
  max-height: 150px;
  border: 1px solid #d0d7de;
  border-radius: 5px;
  background: #fff;
  object-fit: contain;
}

.lp-botg-thumb-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.lp-botg-thumb {
  max-width: 200px;
  max-height: 150px;
  border: 1px solid #d0d7de;
  border-radius: 5px;
  background: #fff;
  object-fit: contain;
}

.lp-botg-caption {
  font-size: 0.75rem;
  color: #555;
  text-align: center;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Çalışma Yaprağı */
.lp-worksheet-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #222;
  margin: 0 0 0.3rem;
}

.lp-worksheet-instructions {
  font-size: 0.84rem;
  color: #555;
  margin: 0 0 0.6rem;
  line-height: 1.45;
}

.lp-wq-list {
  list-style: decimal;
  margin: 0 0 0 1.2rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lp-wq-item {
  font-size: 0.84rem;
}

.lp-wq-prompt {
  color: #222;
  line-height: 1.45;
}

.lp-wq-notes {
  font-size: 0.78rem;
  color: #888;
  font-style: italic;
  margin-top: 0.1rem;
}

/* Çalışma Yaprağı Diyagramı (embedded in Section 4) */
.lp-ws-diagram {
  margin: 0.6rem 0 0.75rem;
}

.lp-ws-diagram-img {
  max-width: 100%;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #fff;
  display: block;
}

/* ── Prediction frames (worksheet section) ── */

.lp-frames {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
}

.lp-frame-figure {
  flex: 0 0 auto;
  margin: 0;
}

.lp-frame-img {
  max-width: 100%;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #fff;
  display: block;
}

.lp-frame-caption {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: #57606a;
  font-style: italic;
}

/* ── App footer (bottom of chat pane) ── */

.app-footer {
  flex-shrink: 0;
  padding: 0.3rem 1rem;
  border-top: 1px solid #e8ecf0;
  background: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #999;
  gap: 0.5rem;
}

.app-footer a {
  color: #999;
  text-decoration: none;
}

.app-footer a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ── DB unavailable notice ── */

.db-unavailable-notice {
  flex-shrink: 0;
  background: #fff3cd;
  border-bottom: 1px solid #ffc107;
  color: #664d03;
  font-size: 0.82rem;
  padding: 0.45rem 1rem;
  text-align: center;
  line-height: 1.4;
}

/* ── Consent overlay ── */

.consent-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.consent-box {
  background: #fff;
  border-radius: 10px;
  padding: 2rem 2.25rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
}

.consent-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: #1a3a5c;
  margin: 0 0 1rem;
}

.consent-body {
  font-size: 0.88rem;
  color: #444;
  line-height: 1.6;
  margin: 0 0 0.75rem;
}

.consent-links {
  font-size: 0.84rem;
  margin: 0 0 1.25rem;
}

.consent-links a {
  color: var(--primary);
  text-decoration: underline;
}

.btn-consent-accept {
  display: block;
  width: 100%;
  padding: 0.68rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}

.btn-consent-accept:hover { background: #155d9e; }
.btn-consent-accept:disabled { background: #ccc; cursor: not-allowed; }

/* ── Delete confirmation modal ── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-box {
  background: #fff;
  border-radius: 8px;
  padding: 1.75rem 2rem;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: #222;
  margin: 0 0 0.7rem;
}

.modal-body {
  font-size: 0.88rem;
  color: #555;
  line-height: 1.55;
  margin: 0 0 1.25rem;
}

.modal-warnings-list {
  margin: 0 0 0.75rem 1.25rem;
  padding: 0;
  font-size: 0.85rem;
  color: #555;
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.btn-modal-destructive {
  padding: 0.48rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
}

.btn-modal-destructive:hover { background: #922b21; }
.btn-modal-destructive:disabled { background: #ccc; cursor: not-allowed; }

.btn-modal-cancel {
  padding: 0.48rem 1rem;
  font-size: 0.88rem;
  font-weight: 500;
  background: #fff;
  color: #444;
  border: 1px solid #ccc;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
}

.btn-modal-cancel:hover { background: #f5f5f5; }

/* ── Conversation sidebar ── */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 200;
}

.sidebar-overlay.open {
  display: block;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: #fff;
  border-right: 1px solid #d0d7de;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  z-index: 201;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.14);
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  flex-shrink: 0;
  padding: 0.85rem;
  background: #1a3a5c;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-new-conversation {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s;
}

.btn-new-conversation:hover {
  background: rgba(255, 255, 255, 0.22);
}

.sidebar-conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.4rem 0;
}

.sidebar-empty {
  font-size: 0.82rem;
  color: #bbb;
  font-style: italic;
  padding: 1rem 1rem;
  margin: 0;
}

.conv-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.12s;
}

.conv-item:hover {
  background: #f0f4f8;
}

.conv-item.active {
  background: #e8f0f8;
  border-left-color: var(--primary);
}

.conv-item-info {
  flex: 1;
  min-width: 0;
}

.conv-item-title {
  font-size: 0.84rem;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-item.active .conv-item-title {
  color: #1a3a5c;
  font-weight: 600;
}

.conv-item-date {
  font-size: 0.71rem;
  color: #aaa;
  white-space: nowrap;
  margin-top: 0.1rem;
}

.btn-trash {
  flex-shrink: 0;
  padding: 0.15rem 0.35rem;
  background: transparent;
  color: #c0392b;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.82rem;
  opacity: 0;
  transition: opacity 0.15s;
  line-height: 1;
}

.conv-item:hover .btn-trash {
  opacity: 1;
}

.btn-trash:hover {
  background: #fdf0ef;
}

.sidebar-footer {
  flex-shrink: 0;
  padding: 0.6rem 0.85rem;
  border-top: 1px solid #e8ecf0;
}

.btn-sidebar-delete-all {
  font-size: 0.75rem;
  padding: 0.25rem 0.4rem;
  background: transparent;
  color: #b03a2e;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s;
}

.btn-sidebar-delete-all:hover {
  background: #fdf0ef;
  text-decoration: underline;
}

/* ── Static pages (gizlilik) ── */

body.static-page {
  overflow: auto;
  height: auto;
}

.static-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.static-header {
  margin-bottom: 2rem;
}

.static-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a3a5c;
  margin: 0.4rem 0 0.3rem;
}

.static-subtitle {
  font-size: 0.86rem;
  color: #666;
  margin: 0;
}

.back-link {
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0.35rem;
}

.back-link:hover { text-decoration: underline; }

.static-content section {
  background: #fff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.static-content h2 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1a3a5c;
  margin: 0 0 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.static-content p {
  font-size: 0.88rem;
  color: #444;
  line-height: 1.6;
  margin: 0 0 0.5em;
}

.static-content p:last-child { margin-bottom: 0; }

.static-content ul {
  margin: 0.25em 0 0.5em 1.3rem;
  padding: 0;
}

.static-content li {
  font-size: 0.87rem;
  color: #444;
  line-height: 1.55;
  margin-bottom: 0.35rem;
}

.static-content strong {
  color: #222;
  font-weight: 600;
}

/* Footer on static pages reuses .app-footer but without flex constraints */
body.static-page .app-footer {
  margin-top: 2rem;
  border-top: 1px solid #d0d7de;
  border-radius: 0;
  background: transparent;
  padding: 1rem 0 0;
  color: #888;
}

/* DL.13 — retry button on transient errors */
.message-retry-btn {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.1rem 0.45rem;
  background: transparent;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 1.1em;
  color: var(--secondary, #6c757d);
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s;
  line-height: 1;
}
.message-retry-btn:hover:not(:disabled) {
  opacity: 1;
  color: var(--primary);
}
.message-retry-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

/* DL.14 — quick-confirm button when assistant ends with '?' */
.message-confirm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6em;
  height: 1.6em;
  margin-left: 0.4em;
  vertical-align: middle;
  border: 1px solid var(--secondary);
  border-radius: 50%;
  background: var(--body-bg);
  color: var(--primary);
  font-size: 0.9em;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.message-confirm-btn:hover {
  opacity: 1;
  background: var(--primary);
  color: var(--body-bg);
}
.message-confirm-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

/* ── Quota display (below send button) ── */
/* ── Quota unit inside .app-footer ── */
.app-footer .quota-unit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 50%;
}
.app-footer .quota-unit .quota-bar {
  flex: 1;
  height: 8px;
  background: var(--light);
  border-radius: 4px;
  overflow: hidden;
}
.app-footer .quota-unit .quota-bar-fill {
  height: 100%;
  transition: width 0.3s ease, background-color 0.3s ease;
}
.app-footer .quota-unit .quota-label {
  white-space: nowrap;
  min-width: 5em;
  text-align: right;
  color: var(--body-color);
}

/* ── Quota at-limit banner (chat panel) ── */
.quota-at-limit-banner {
  background: var(--danger);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius, 4px);
  margin: 0.5rem 1rem;
}
.quota-at-limit-banner.hidden { display: none; }
.quota-at-limit-banner p { margin: 0; line-height: 1.5; font-size: 0.9em; }
