/* ── Sea of Reeds Prada Blue + Cream Dark Theme ── */
:root {
  --bg: #162a3a;
  --card: #1d3447;
  --border: #2c455a;
  --text: #fcf5e2;
  --text2: #a09880;
  --accent: #0175cc;
  --accent2: #015ea3;
  --green: #4a9e7e;
  --bubble-user: linear-gradient(135deg, #2563a0 0%, #2e74b8 100%);
  --bubble-assistant: #1b2e3f;
  --font-size: 15px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow: 0 2px 8px rgba(0,0,0,0.25);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.35);
}

/* ── Light Theme ── */
[data-theme="light"] {
  --bg: #faf8f5;
  --card: #ffffff;
  --border: #e8e2d8;
  --text: #2d2820;
  --text2: #8c8278;
  --accent: #c4954a;
  --accent2: #b87850;
  --green: #5a9a7a;
  --bubble-user: linear-gradient(135deg, #e6ceaa 0%, #dbc094 100%);
  --bubble-assistant: #eeede5;
  --shadow: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.08);
}
[data-theme="light"] #splash {
  background: linear-gradient(135deg, #faf8f5 0%, #f5f0e8 50%, #ede0d0 100%);
}
[data-theme="light"] .msg.assistant { background: #eeede5; }
[data-theme="light"] .msg.assistant pre { background: rgba(0, 0, 0, 0.03); }
[data-theme="light"] .msg.assistant code { background: rgba(0, 0, 0, 0.04); }
[data-theme="light"] .typing-indicator { background: #f5f0ea; }
[data-theme="light"] .diary-input input[type=date] { color-scheme: light; }
[data-theme="light"] .panel-details { background: #faf8f5; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: var(--font-size);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: fixed;
  inset: 0;
}

/* ── Header ── */
header {
  display: flex;
  align-items: center;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  background: var(--card);
  box-shadow: 0 1px 0 var(--border);
  flex-shrink: 0;
  gap: 10px;
}
header h1 {
  font-size: 18px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 1px;
}
header .btn-back {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  display: none;
  line-height: 1;
}
header .btn-back.visible { display: block; }
header .btn-theme {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s;
}
header .btn-theme:hover { opacity: 1; }

/* ── Bubble labels ── */
.bubble-label {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 4px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.msg-wrapper.user .bubble-label { justify-content: flex-end; }
.bubble-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.bubble-avatar-fallback {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.msg-wrapper.assistant .bubble-avatar-fallback {
  background: var(--border);
  color: var(--text);
}

/* ── Views ── */
.view { display: none; flex: 1; flex-direction: column; overflow: hidden; }
.view.active { display: flex; }
.view.scrollable { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

/* ── Home View ── */
#homeView h2 {
  font-size: 16px;
  color: var(--text2);
  text-align: center;
  margin-bottom: 4px;
}

/* ── Memory View ── */
#memoryView { padding: 20px 16px 24px; }

/* ── Diary View ── */
#diaryView { padding: 20px 16px 24px; gap: 12px; }
.diary-entry-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  overflow: hidden;
}
.diary-entry-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: rgba(212, 168, 83, 0.1);
  transition: background 0.15s;
}
.diary-entry-header:hover { background: var(--border); }
.diary-entry-date {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.5px;
  flex: 1;
}
.diary-entry-arrow {
  font-size: 11px;
  color: var(--text2);
  transition: transform 0.2s;
}
.diary-entry-del {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.diary-entry-del:hover { opacity: 1; color: #c06050; }
.diary-entry-body {
  border-top: 1px solid var(--border);
  padding: 14px 16px 18px;
}
.diary-entry-content {
  font-size: var(--font-size);
  line-height: 1.7;
  color: var(--text);
}
.diary-entry-content p { margin: 0 0 10px; }
.diary-entry-content p:last-child { margin: 0; }

/* ── Chat View ── */
#chatView {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.chat-bg-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg);
  pointer-events: none;
  z-index: 0;
  display: none;
}
#chatView .model-bar,
#chatView .chat-messages,
#chatView .chat-input-area,
#chatView .image-preview {
  position: relative;
  z-index: 1;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg-wrapper {
  display: flex;
  flex-direction: column;
  margin-bottom: 2px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.msg-wrapper.user { align-items: flex-end; }
.msg-wrapper.assistant { align-items: flex-start; }

.msg {
  max-width: 82%;
  padding: 14px 18px;
  border-radius: 18px;
  line-height: 1.55;
  font-size: var(--font-size);
  word-break: break-word;
  overflow-wrap: anywhere;
  overflow-x: hidden;
  animation: msgIn 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.msg.user {
  align-self: flex-end;
  background: var(--bubble-user);
  color: var(--text);
  border-bottom-right-radius: 6px;
}
.msg.assistant {
  align-self: flex-start;
  background: var(--bubble-assistant);
  color: var(--text);
  border-bottom-left-radius: 6px;
}
.msg.assistant p { margin: 0 0 12px; }
.msg.assistant p:last-child { margin: 0; }
.msg.assistant code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 13px;
}
.msg.assistant pre {
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 14px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
}
.msg.assistant pre code { background: none; padding: 0; }
.msg.assistant img { max-width: 100%; border-radius: 8px; margin: 6px 0; }

.msg .time {
  font-size: 11px;
  opacity: 0.5;
  margin-top: 4px;
}

.token-usage {
  font-size: 10px;
  opacity: 0.35;
  margin-top: 6px;
}

/* ── Collapsible panels (CoT + Tools) ── */
.chain-panel {
  align-self: flex-start;
  max-width: 88%;
  background: var(--card);
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: var(--shadow);
  margin-top: 4px;
}
.panel-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  min-height: 44px;
  cursor: pointer;
  color: var(--text2);
  user-select: none;
  transition: background 0.15s;
  -webkit-tap-highlight-color: rgba(96, 165, 250, 0.15);
}
.panel-summary:hover { background: var(--border); }
.panel-summary .arrow {
  font-size: 10px;
  transition: transform 0.2s;
  display: inline-block;
}
.chain-panel.open .panel-summary .arrow { transform: rotate(90deg); }
.panel-summary .panel-count { font-weight: 600; }
.tool-panel .panel-summary .panel-count { color: var(--accent); }
.thinking-panel .panel-summary .panel-count { color: var(--accent2); }
.panel-details {
  display: none;
  box-shadow: 0 1px 0 var(--border) inset;
  padding: 10px 14px;
}
.chain-panel.open .panel-details { display: block; }

/* Tool steps */
.tool-step {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.tool-step:last-child { border-bottom: none; }
.tool-step .step-name {
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}
.tool-step .step-args {
  font-family: monospace;
  font-size: 11px;
  color: var(--text2);
  background: var(--bg);
  padding: 6px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 80px;
  overflow-y: auto;
}
.tool-step .step-result {
  font-size: 12px;
  color: var(--text);
  background: var(--bg);
  padding: 6px 8px;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 120px;
  overflow-y: auto;
}
.tool-step .step-status {
  font-size: 11px;
  margin-top: 4px;
}
.tool-step .step-status.ok { color: var(--green); }
.tool-step .step-status.err { color: #b45353; }

/* Thinking text */
.thinking-text {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
  white-space: pre-wrap;
}

.typing-indicator {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: var(--bubble-assistant);
  border-radius: 16px 16px 16px 6px;
}
.typing-indicator span {
  width: 6px; height: 6px;
  background: var(--accent2);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

/* ── Scroll-to-bottom button ── */
.scroll-bottom-btn {
  position: absolute;
  right: 16px;
  bottom: 80px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text2);
  font-size: 16px;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scroll-bottom-btn.visible {
  opacity: 0.65;
  pointer-events: auto;
}
.scroll-bottom-btn:active { transform: scale(0.9); }

/* ── Chat Input ── */
.chat-input-area {
  padding: 10px 12px 14px;
  background: var(--card);
  box-shadow: 0 -1px 0 var(--border);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}
.chat-input-area textarea {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  min-height: 42px;
  max-height: 120px;
  outline: none;
  background: var(--bg);
  color: var(--text);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.chat-input-area textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.15);
}
.chat-input-area button {
  width: 42px; height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, opacity 0.15s;
}
.chat-input-area button:active { transform: scale(0.93); }
.chat-input-area button:disabled { opacity: 0.5; }
.chat-input-area button.stop-btn {
  background: #d44;
  font-size: 14px;
}

.chat-input-area .btn-plus {
  background: var(--bg);
  color: var(--accent);
  border: 1px solid var(--border);
  font-size: 20px;
  font-weight: 300;
  line-height: 1;
}

.plus-menu-wrapper {
  position: relative;
}

.plus-menu {
  position: absolute;
  bottom: 46px;
  left: 0;
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 100;
  min-width: 140px;
}
.plus-menu button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
}
.plus-menu button:hover {
  background: var(--border);
}

.image-preview {
  padding: 6px 12px 6px;
  background: var(--card);
  display: none;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.image-preview img { width: 48px; height: 48px; object-fit: cover; border-radius: var(--radius-sm); }
.image-preview .remove-img {
  background: none; border: none;
  color: var(--text2); font-size: 20px; cursor: pointer; padding: 0 4px;
  transition: color 0.15s;
}
.image-preview .remove-img:hover { color: var(--accent); }


.model-bar {
  padding: 4px 12px 6px;
  background: var(--card);
  text-align: center;
  flex-shrink: 0;
}
.model-bar select {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text2);
  background: var(--bg);
  outline: none;
  max-width: 200px;
  width: 100%;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.model-bar select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.12);
}

/* ── Board View ── */
#boardView { padding: 16px 16px 24px; gap: 12px; }
.board-input { display: flex; gap: 8px; }
.board-input textarea {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  min-height: 60px;
  outline: none;
  background: var(--bg);
  color: var(--text);
}
.board-input textarea:focus { border-color: var(--accent); }
.board-input button {
  padding: 8px 18px;
  height: 40px;
  align-self: flex-end;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.board-input button:active { transform: scale(0.96); }

.note-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.note-card .note-text { flex: 1; line-height: 1.55; font-size: 15px; white-space: pre-wrap; }
.note-card .note-time { font-size: 12px; color: var(--text2); margin-top: 6px; }
.note-card .note-del {
  background: none; border: none;
  color: var(--text2); cursor: pointer; font-size: 18px; padding: 2px 6px;
}
.note-card .note-del:hover { color: var(--accent); }

/* ── Diary View ── */
#diaryView { padding: 16px 16px 24px; gap: 12px; }
.diary-input {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.diary-input input { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 15px; outline: none; margin-bottom: 8px; background: var(--bg); color: var(--text); }
.diary-input input:focus { border-color: var(--accent); }
.diary-input textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 15px; font-family: inherit; resize: none; min-height: 80px; outline: none; background: var(--bg); color: var(--text); }
.diary-input textarea:focus { border-color: var(--accent); }
.diary-input .diary-actions { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.diary-input .diary-actions input[type=date] { width: auto; margin: 0; padding: 6px 10px; font-size: 14px; color-scheme: dark; }
.diary-input .diary-actions button { padding: 8px 18px; border: none; border-radius: var(--radius); background: var(--accent); color: #fff; font-size: 14px; cursor: pointer; }

.diary-entry {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.diary-entry .entry-date { font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.diary-entry .entry-title { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.diary-entry .entry-content { line-height: 1.6; font-size: 15px; white-space: pre-wrap; }
.diary-entry .entry-img { max-width: 100%; border-radius: 8px; margin-top: 8px; }
.diary-entry .entry-del { float: right; background: none; border: none; color: var(--text2); cursor: pointer; font-size: 16px; }

/* ── Settings View ── */
#settingsView { padding: 16px 16px 24px; gap: 14px; }

/* ── Provider Cards (collapsible) ── */
.provider-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.provider-card.is-default {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(212, 168, 83, 0.2);
}
.provider-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
  background: var(--bg);
  transition: background 0.15s;
  -webkit-tap-highlight-color: rgba(212, 168, 83, 0.15);
}
.provider-card-header:hover { background: var(--border); }
.provider-card-header .expand-arrow {
  font-size: 11px;
  color: var(--text2);
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}
.provider-card-header .status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.provider-card-header .status-dot.ok { background: var(--green); }
.provider-card-header .status-dot.none { background: #b45353; }
.provider-card-header .provider-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
}
.btn-set-default {
  font-size: 10px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text2);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.btn-set-default:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.provider-card-body {
  padding: 0 12px 12px;
  border-top: 1px solid var(--border);
}
.provider-card-body .field-row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.provider-card-body input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: monospace;
  background: var(--card);
  color: var(--text);
  outline: none;
}
.provider-card-body input:focus { border-color: var(--accent); }
.provider-card-body select {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--card);
  color: var(--text);
  outline: none;
}
.provider-card-body .btn-sm {
  padding: 6px 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--card);
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.provider-card-body .btn-sm:hover { background: var(--accent); color: #fff; }
.provider-card-body .btn-sm.loading { opacity: 0.5; pointer-events: none; }
.model-count {
  font-size: 11px;
  color: var(--text2);
  margin-top: 6px;
}

/* ── Bottom Nav ── */
nav {
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
nav button {
  flex: 1;
  padding: 8px 4px 10px;
  border: none;
  background: none;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text2);
  cursor: pointer;
  transition: color 0.2s;
}
nav button.active { color: var(--accent); font-weight: 600; }

/* ── Splash ── */
#splash {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #162a3a 0%, #1d3447 50%, #20384d 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.5s, visibility 0.5s;
}
#splash.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
#splash .splash-content { text-align: center; }
#splash h1 {
  font-size: 32px;
  color: var(--accent);
  font-weight: 600;
  margin: 12px 0 6px;
  letter-spacing: 2px;
}
#splash p { color: var(--text2); font-size: 15px; margin-bottom: 24px; }
#splash button {
  padding: 12px 36px;
  border: none;
  border-radius: 30px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: transform 0.15s;
}
#splash button:active { transform: scale(0.95); }

@media (max-width: 480px) {
  .msg { max-width: 88%; font-size: var(--font-size); }
}

/* ── Image lightbox ── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: lbFadeIn 0.2s ease;
}
@keyframes lbFadeIn { from { opacity: 0; } to { opacity: 1; } }

.lightbox-overlay img {
  max-width: 95vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 40px rgba(0,0,0,0.5);
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.lightbox-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.lightbox-actions button {
  padding: 10px 24px;
  border-radius: 20px;
  border: none;
  font-size: 15px;
  cursor: pointer;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}
.lightbox-btn-download {
  background: var(--accent);
}
.lightbox-btn-share {
  background: rgba(255,255,255,0.15);
}

/* Make chat images look clickable */
.msg img {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}
.msg img:active {
  opacity: 0.7;
}

/* ── History pull-up loader ── */
.history-loader {
  text-align: center;
  padding: 12px;
  color: var(--text2);
  font-size: 13px;
}
