/* ═══════════════════════════════════════════════════
   備忘錄 v5 — Lumina Design System
   Purple-Blue gradient · Glassmorphism · Dark mode
   Updated: 2026-04-16
═══════════════════════════════════════════════════ */

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

/* ── Design Tokens ─────────────────────────────── */
:root {
  /* Accent — Violet / Indigo gradient */
  --accent:        #7c3aed;
  --accent2:       #4f46e5;
  --accent-dark:   #5b21b6;
  --accent-light:  #ede9fe;
  --accent-glow:   rgba(124,58,237,0.25);
  --accent-grad:   linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  --accent-grad2:  linear-gradient(135deg, #6d28d9 0%, #3730a3 100%);

  /* Send button — Emerald (distinct from accent) */
  --send-bg:       linear-gradient(135deg, #10b981, #059669);
  --send-glow:     rgba(16,185,129,0.35);

  /* Surfaces */
  --bg:            #f5f3ff;
  --surface:       #ffffff;
  --surface2:      #faf5ff;
  --surface3:      #f3f4f6;
  --border:        #e5e7eb;
  --border2:       #d1d5db;

  /* Text */
  --text:          #111827;
  --text2:         #4b5563;
  --text3:         #9ca3af;
  --text4:         #d1d5db;

  /* Status */
  --danger:        #ef4444;
  --danger-dark:   #dc2626;
  --warning:       #f59e0b;
  --info:          #3b82f6;
  --success:       #10b981;

  /* Shadows */
  --shadow-xs:     0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:     0 2px 8px rgba(124,58,237,.08);
  --shadow:        0 4px 20px rgba(124,58,237,.12);
  --shadow-lg:     0 20px 60px rgba(0,0,0,.15);
  --shadow-xl:     0 40px 80px rgba(0,0,0,.18);

  /* Shape */
  --radius-xs:     6px;
  --radius-sm:     10px;
  --radius:        14px;
  --radius-lg:     20px;
  --radius-xl:     28px;

  /* Layout */
  --hd-h:          58px;
  --safe-top:      env(safe-area-inset-top, 0px);
  --safe-bot:      env(safe-area-inset-bottom, 0px);

  /* Motion */
  --ease:          cubic-bezier(0.4, 0, 0.2, 1);
  --spring:        cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition:    0.22s var(--ease);

  /* Font */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text",
          "Helvetica Neue", "Noto Sans TC", "PingFang TC",
          "Microsoft JhengHei", sans-serif;

  /* Custom BG (overridden by JS) */
  --custom-bg-url: none;
  --custom-bg-opacity: 0.08;
}

/* ── Dark Mode ──────────────────────────────────── */
[data-theme="dark"] {
  --accent:        #a78bfa;
  --accent2:       #818cf8;
  --accent-dark:   #7c3aed;
  --accent-light:  rgba(167,139,250,0.12);
  --accent-glow:   rgba(167,139,250,0.2);
  --accent-grad:   linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  --send-glow:     rgba(52,211,153,0.3);
  --bg:            #0d0d1a;
  --surface:       #13131f;
  --surface2:      #1a1a2e;
  --surface3:      #1e1e30;
  --border:        #2a2a40;
  --border2:       #3a3a55;
  --text:          #f1f5f9;
  --text2:         #a0aec0;
  --text3:         #4a5568;
  --text4:         #2d3748;
  --shadow-sm:     0 2px 8px rgba(0,0,0,.4);
  --shadow:        0 4px 20px rgba(0,0,0,.5);
  --shadow-lg:     0 20px 60px rgba(0,0,0,.6);
}

/* ── Base ───────────────────────────────────────── */
html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
  line-height: 1.5;
}

/* custom background image */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--custom-bg-url);
  background-size: cover;
  background-position: center;
  opacity: var(--custom-bg-opacity);
  pointer-events: none;
  z-index: 0;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── App Shell ──────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  z-index: 1;
}

/* ── Header ─────────────────────────────────────── */
#header {
  flex-shrink: 0;
  background: var(--accent-grad);
  padding-top: var(--safe-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 16px;
  padding-right: 8px;
  min-height: calc(var(--hd-h) + var(--safe-top));
  position: relative;
  z-index: 30;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.hd-logo { display: flex; align-items: center; gap: 9px; }
.hd-logo-icon { font-size: 22px; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3)); }
.hd-logo-text { font-size: 18px; font-weight: 800; color: #fff; letter-spacing: -0.4px; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.hd-right { display: flex; align-items: center; gap: 2px; }
.hd-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: rgba(255,255,255,0.9);
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.hd-btn svg { width: 19px; height: 19px; }
.hd-btn:hover { background: rgba(255,255,255,0.28); color: #fff; }
.hd-btn:active { transform: scale(0.9); }

/* ── Category Bar ───────────────────────────────── */
#category-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  padding: 0 4px 0 0;
  position: relative;
  z-index: 20;
}

.cat-tabs {
  flex: 1;
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px 10px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text3);
  transition: var(--transition);
  white-space: nowrap;
  font-family: var(--font);
  margin-bottom: -2px;
}
.cat-tab:hover { color: var(--accent); background: var(--accent-light); }
.cat-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.cat-icon { font-size: 15px; }
.cat-name { }
.cat-count { font-size: 10px; background: var(--accent-light); color: var(--accent); padding: 1px 6px; border-radius: 10px; font-weight: 700; }
[data-theme="dark"] .cat-count { background: rgba(167,139,250,0.15); }

.cat-add-btn {
  flex-shrink: 0;
  background: var(--accent-light);
  border: 1.5px dashed var(--accent);
  color: var(--accent);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--spring);
  margin: 0 6px;
}
.cat-add-btn:hover { background: var(--accent); color: #fff; transform: scale(1.1) rotate(90deg); }
[data-theme="dark"] .cat-add-btn { background: rgba(167,139,250,0.1); }

/* ── Filter Row ─────────────────────────────────── */
.filter-row {
  flex-shrink: 0;
  display: flex;
  gap: 5px;
  padding: 8px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.filter-row::-webkit-scrollbar { display: none; }

.ftab {
  flex-shrink: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text3);
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: var(--font);
}
.ftab:hover { border-color: var(--accent); color: var(--accent); }
.ftab.active { background: var(--accent-grad); color: #fff; border-color: transparent; box-shadow: 0 2px 10px var(--accent-glow); }

/* ── Search Bar ─────────────────────────────────── */
.search-bar {
  flex-shrink: 0;
  padding: 9px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  animation: slideDown 0.2s var(--ease);
}
.search-bar.hidden { display: none; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.search-inner {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  transition: var(--transition);
}
.search-inner:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search-ico { width: 15px; height: 15px; color: var(--text3); flex-shrink: 0; }
#search-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: 15px; color: var(--text); padding: 10px 0; font-family: var(--font);
}
#search-input::placeholder { color: var(--text3); }
.search-close-btn { background: transparent; border: none; color: var(--text3); font-size: 14px; cursor: pointer; padding: 4px; transition: var(--transition); }
.search-close-btn:hover { color: var(--text); }

/* ── Stats Bar ──────────────────────────────────── */
.stats-bar {
  flex-shrink: 0;
  display: flex;
  padding: 10px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  animation: slideDown 0.2s ease;
  gap: 4px;
}
.stats-bar.hidden { display: none; }
.stats-bar::-webkit-scrollbar { display: none; }
.stat-item {
  flex: 1; min-width: 56px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer; transition: var(--transition);
}
.stat-item:hover { background: var(--accent-light); }
[data-theme="dark"] .stat-item:hover { background: rgba(167,139,250,0.08); }
.stat-num { font-size: 20px; font-weight: 800; color: var(--accent); line-height: 1; }
.stat-label { font-size: 10px; color: var(--text3); font-weight: 500; }

/* ── Selection Bar ──────────────────────────────── */
#sel-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--accent-grad);
  color: #fff;
  z-index: 20;
  animation: slideDown 0.2s ease;
}
#sel-bar.hidden { display: none; }
#sel-count { font-size: 14px; font-weight: 700; }
.sel-actions { display: flex; gap: 7px; }
.sel-actions button {
  padding: 6px 14px; border-radius: var(--radius); border: none;
  font-size: 12px; font-weight: 700; cursor: pointer; transition: var(--transition);
  font-family: var(--font);
}
#sel-cat-btn { background: rgba(255,255,255,0.2); color: #fff; }
#sel-cat-btn:hover { background: rgba(255,255,255,0.32); }
#sel-cancel { background: rgba(255,255,255,0.15); color: #fff; }
#sel-cancel:hover { background: rgba(255,255,255,0.28); }
#sel-delete { background: var(--danger); color: #fff; }
#sel-delete:hover { background: var(--danger-dark); }

/* ── Messages Area ──────────────────────────────── */
#msgs-area {
  flex: 1; overflow: hidden; position: relative;
  background: var(--bg);
}
/* decorative chat bg */
[data-theme="light"] #msgs-area {
  background-image: radial-gradient(circle at 20% 20%, rgba(124,58,237,0.04) 0%, transparent 60%),
                    radial-gradient(circle at 80% 80%, rgba(79,70,229,0.04) 0%, transparent 60%);
}
[data-theme="dark"] #msgs-area {
  background-image: radial-gradient(circle at 20% 20%, rgba(124,58,237,0.06) 0%, transparent 60%),
                    radial-gradient(circle at 80% 80%, rgba(79,70,229,0.06) 0%, transparent 60%);
}

#msgs-list {
  height: 100%; overflow-y: auto;
  padding: 12px 12px 8px;
  display: flex; flex-direction: column; gap: 4px;
  scroll-behavior: smooth;
}

/* ── Date Divider ───────────────────────────────── */
.date-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 0 8px;
}
.date-divider::before, .date-divider::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.date-divider span {
  font-size: 11px; font-weight: 700; color: var(--text3);
  background: var(--bg); padding: 3px 12px;
  border-radius: 20px; border: 1px solid var(--border);
  white-space: nowrap; letter-spacing: 0.5px;
}

/* ── Message Card ───────────────────────────────── */
.msg-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  animation: msgIn 0.28s var(--spring) both;
  position: relative;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.msg-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border2); transform: translateY(-1px); }
.msg-card.pinned { border-color: var(--accent); border-width: 1.5px; box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-sm); }
.msg-card.recorded { opacity: 0.68; }
.msg-card.starred .msg-footer::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--warning); border-radius: 0 0 0 var(--radius-lg); }
.msg-card.selected { border-color: var(--info); box-shadow: 0 0 0 3px rgba(59,130,246,0.2); }

/* Category indicator dot */
.msg-cat-dot {
  width: 5px; height: 5px; border-radius: 50%;
  display: inline-block; margin-right: 5px; vertical-align: middle;
}

/* Pin badge */
.pin-badge {
  font-size: 11px; font-weight: 700; color: var(--accent);
  background: var(--accent-light); padding: 4px 10px;
  border-bottom: 1px solid rgba(124,58,237,0.15); letter-spacing: 0.3px;
}
[data-theme="dark"] .pin-badge { background: rgba(167,139,250,0.1); }

/* ── Message Body ───────────────────────────────── */
.msg-body { padding: 12px 14px 8px; }

.msg-text {
  font-size: 15px; line-height: 1.65; color: var(--text);
  word-break: break-word; white-space: pre-wrap;
}

/* Long message collapse */
.msg-collapsible.collapsed {
  max-height: 13em;       /* ~8 lines at line-height 1.65 */
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}
.expand-btn {
  display: block; width: 100%;
  margin-top: 4px; padding: 4px 0 2px;
  background: none; border: none; cursor: pointer;
  font-size: 12px; font-weight: 600;
  color: var(--accent); text-align: center;
  letter-spacing: 0.3px; transition: opacity 0.2s;
}
.expand-btn:hover { opacity: 0.75; }

.msg-link { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); transition: var(--transition); }
.msg-link:hover { opacity: 0.8; }

.msg-img-wrap { margin: -12px -14px 0; overflow: hidden; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.msg-img { width: 100%; display: block; max-height: 360px; object-fit: cover; cursor: zoom-in; transition: transform 0.3s; }
.msg-img:hover { transform: scale(1.01); }

.msg-caption { font-size: 14px; color: var(--text2); margin-top: 8px; line-height: 1.55; word-break: break-word; }

/* Transcript */
.msg-transcript {
  margin-top: 10px;
  background: linear-gradient(135deg, rgba(124,58,237,0.06), rgba(79,70,229,0.06));
  border: 1px solid rgba(124,58,237,0.18);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.transcript-label {
  font-size: 10px; font-weight: 700; color: var(--accent); margin-bottom: 5px;
  text-transform: uppercase; letter-spacing: 0.8px;
}
.transcript-text { font-size: 13px; color: var(--text2); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

.msg-file-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.file-dl-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px;
  background: var(--accent-grad);
  color: #fff; border-radius: 20px; font-size: 13px; font-weight: 600;
  text-decoration: none; transition: var(--transition);
  box-shadow: 0 2px 8px var(--accent-glow);
}
.file-dl-btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* Audio player */
.audio-player {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface3); border-radius: var(--radius);
  padding: 12px 14px; border: 1px solid var(--border);
}
.audio-play-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-grad); color: #fff; border: none;
  font-size: 16px; cursor: pointer; flex-shrink: 0;
  box-shadow: 0 3px 12px var(--accent-glow); transition: var(--spring);
  display: flex; align-items: center; justify-content: center;
}
.audio-play-btn:hover { transform: scale(1.1); }
.audio-play-btn:active { transform: scale(0.95); }
.audio-info { flex: 1; min-width: 0; }
.audio-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audio-dur { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* File card */
.msg-file-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface3); border-radius: var(--radius);
  padding: 12px 14px; border: 1px solid var(--border);
}
.file-big-icon { font-size: 36px; flex-shrink: 0; }
.file-meta { flex: 1; min-width: 0; }
.file-nm { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-sz { font-size: 12px; color: var(--text3); margin-top: 2px; }
.msg-video { width: 100%; border-radius: var(--radius); max-height: 360px; background: #000; }

/* Tags */
.msg-tags { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 14px 8px; }
.tag {
  font-size: 11px; font-weight: 600; padding: 3px 9px;
  border-radius: 20px;
  background: var(--accent-light); color: var(--accent);
  border: 1px solid rgba(124,58,237,0.2);
}
[data-theme="dark"] .tag { background: rgba(167,139,250,0.1); color: var(--accent); }

/* ── Message Footer ─────────────────────────────── */
.msg-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px 10px; gap: 6px; flex-wrap: wrap;
  position: relative;
}
.rec-label { display: flex; align-items: center; gap: 6px; cursor: pointer; flex: 1; min-width: 0; }
.rec-check { position: absolute; opacity: 0; pointer-events: none; }
.rec-chk-icon { font-size: 15px; flex-shrink: 0; transition: var(--spring); }
.rec-check:checked ~ .rec-chk-icon { transform: scale(1.15); }
.rec-txt { font-size: 11px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: var(--transition); }
.msg-card.recorded .rec-txt { color: var(--success); font-weight: 600; }

.msg-actions { display: flex; align-items: center; gap: 1px; flex-shrink: 0; }
.msg-time { font-size: 10px; color: var(--text4); white-space: nowrap; padding: 0 4px; }
.icon-btn {
  background: transparent; border: none; cursor: pointer; font-size: 13px;
  padding: 5px 5px; border-radius: var(--radius-xs); transition: var(--transition);
  opacity: 0.5; line-height: 1;
}
.icon-btn:hover { opacity: 1; background: var(--surface3); transform: scale(1.12); }
.icon-btn:active { transform: scale(0.9); }
.del-btn:hover { color: var(--danger); background: rgba(239,68,68,0.08); }
.star-btn.active { opacity: 1; color: var(--warning); }
.pin-btn.active { opacity: 1; color: var(--accent); }

/* ── Selection overlay ──────────────────────────── */
.sel-overlay { position: absolute; inset: 0; background: rgba(59,130,246,0.08); z-index: 2; pointer-events: none; }
.sel-label { position: absolute; top: 10px; left: 10px; z-index: 5; }
.sel-check { width: 20px; height: 20px; accent-color: var(--info); cursor: pointer; }

/* ── Loading & Empty ────────────────────────────── */
.loading-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.loading-wrap.hidden { display: none; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; pointer-events: none; }
.empty.hidden { display: none; }
.empty-art { font-size: 72px; opacity: 0.5; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100%{transform:translateY(0)}50%{transform:translateY(-8px)} }
.empty-t { font-size: 18px; font-weight: 700; color: var(--text3); }
.empty-s { font-size: 14px; color: var(--text4); }

/* drag-over */
#app.drag-over::after {
  content: '⬇ 拖曳放置檔案';
  position: absolute; inset: 0;
  background: rgba(124,58,237,0.12);
  border: 3px dashed var(--accent);
  border-radius: var(--radius-xl);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: var(--accent);
  z-index: 100; pointer-events: none;
  animation: pulseGlow 0.8s ease-in-out infinite alternate;
}
@keyframes pulseGlow { from{background:rgba(124,58,237,.08)} to{background:rgba(124,58,237,.18)} }

/* ── Input Footer ───────────────────────────────── */
#input-footer {
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bot);
  z-index: 20;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.06);
}

/* File preview */
.file-preview {
  padding: 10px 12px 6px; background: var(--surface2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  animation: slideUp 0.2s ease;
}
.file-preview.hidden { display: none; }
@keyframes slideUp { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
#file-preview-content { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.fp-img { width: 48px; height: 48px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); flex-shrink: 0; }
.fp-icon { font-size: 32px; flex-shrink: 0; }
.fp-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.fp-size { font-size: 11px; color: var(--text3); white-space: nowrap; }
#fp-remove { background: transparent; border: none; color: var(--text3); font-size: 16px; cursor: pointer; padding: 6px; border-radius: 50%; transition: var(--transition); flex-shrink: 0; }
#fp-remove:hover { color: var(--danger); background: rgba(239,68,68,0.08); }

/* Templates */
.templates-row { display: flex; gap: 6px; padding: 8px 12px 4px; overflow-x: auto; scrollbar-width: none; animation: slideUp 0.2s ease; }
.templates-row.hidden { display: none; }
.templates-row::-webkit-scrollbar { display: none; }
.tmpl-btn {
  flex-shrink: 0; background: var(--surface3);
  border: 1.5px solid var(--border); color: var(--text2);
  border-radius: 20px; padding: 6px 14px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: var(--transition); white-space: nowrap; font-family: var(--font);
}
.tmpl-btn:hover { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
[data-theme="dark"] .tmpl-btn:hover { background: rgba(167,139,250,0.1); }

/* Input row */
.input-row { display: flex; align-items: flex-end; gap: 5px; padding: 8px 10px 10px; }
.ia-btn {
  flex-shrink: 0; background: transparent; border: none;
  color: var(--text3); padding: 7px; border-radius: 10px; cursor: pointer;
  transition: var(--transition); display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
}
.ia-btn svg { width: 20px; height: 20px; }
.ia-btn:hover { color: var(--accent); background: var(--accent-light); }
[data-theme="dark"] .ia-btn:hover { background: rgba(167,139,250,0.1); }
.ia-btn:active { transform: scale(0.9); }
.mic-btn.recording {
  color: var(--danger) !important; background: rgba(239,68,68,0.1) !important;
  animation: micPulse 1s ease-in-out infinite;
}
@keyframes micPulse { 0%,100%{box-shadow:0 0 0 0 rgba(239,68,68,0.3)} 50%{box-shadow:0 0 0 8px rgba(239,68,68,0)} }
.mic-btn.stt-active {
  color: var(--info) !important; background: rgba(59,130,246,0.1) !important;
  animation: sttPulse 1.2s ease-in-out infinite;
}
@keyframes sttPulse { 0%,100%{box-shadow:0 0 0 0 rgba(59,130,246,0.3)} 50%{box-shadow:0 0 0 8px rgba(59,130,246,0)} }

#txt-input {
  flex: 1; background: var(--surface3);
  border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  padding: 10px 14px; font-size: 15px; font-family: var(--font);
  color: var(--text); resize: none; outline: none; line-height: 1.5;
  max-height: 240px; transition: border-color 0.2s, box-shadow 0.2s; min-height: 42px;
  overflow-y: auto;
}
#txt-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); background: var(--surface); }
#txt-input::placeholder { color: var(--text4); }

.send-btn {
  flex-shrink: 0; width: 42px; height: 42px;
  background: var(--send-bg); color: #fff; border: none; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px var(--send-glow); transition: var(--spring);
}
.send-btn svg { width: 20px; height: 20px; }
.send-btn:hover { transform: scale(1.1); box-shadow: 0 6px 20px var(--send-glow); }
.send-btn:active { transform: scale(0.92); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.send-btn.sending { animation: sendPulse 0.5s ease-in-out infinite; }
@keyframes sendPulse { 0%,100%{opacity:1} 50%{opacity:0.55} }

/* ── Bottom Sheet ────────────────────────────────── */
.bottom-sheet { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.bottom-sheet.hidden { display: none; }
.bottom-sheet.visible .bs-backdrop, .bottom-sheet.visible .bs-content { pointer-events: auto; }
.bs-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 0.3s ease;
}
.bottom-sheet.visible .bs-backdrop { opacity: 1; }
.bs-content {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 0 20px calc(var(--safe-bot) + 20px);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.2);
  transform: translateY(100%); transition: transform 0.35s var(--spring);
  max-height: 85vh; overflow-y: auto;
}
.bottom-sheet.visible .bs-content { transform: translateY(0); }
.bs-handle { width: 40px; height: 4px; background: var(--border2); border-radius: 2px; margin: 14px auto 16px; }
.bs-title { font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 16px; }
.attach-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding-bottom: 8px; }
.att-opt {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 14px 8px; background: var(--surface3);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: var(--spring); font-family: var(--font);
}
.att-opt span:first-child { font-size: 26px; }
.att-opt span:last-child { font-size: 12px; font-weight: 600; color: var(--text2); }
.att-opt:hover { background: var(--accent-light); border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.att-opt:active { transform: scale(0.95); }
[data-theme="dark"] .att-opt:hover { background: rgba(167,139,250,0.1); }
.att-opt-lg { padding: 18px 12px; }
.att-opt-lg span:first-child { font-size: 32px; }
.att-opt-lg span:last-child { font-size: 13px; text-align: center; }
.attach-grid[style*="1fr 1fr"] .att-opt { grid-column: span 1; }

/* ── Lightbox ────────────────────────────────────── */
.lightbox { position: fixed; inset: 0; z-index: 90; }
.lightbox.hidden { display: none; }
.lb-bg { position: absolute; inset: 0; background: rgba(0,0,0,0.93); backdrop-filter: blur(20px); opacity: 0; transition: opacity 0.3s; }
.lightbox.visible .lb-bg { opacity: 1; }
.lb-wrap {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px; transform: scale(0.9); opacity: 0; transition: all 0.3s var(--spring);
}
.lightbox.visible .lb-wrap { transform: scale(1); opacity: 1; }
.lb-toolbar { position: absolute; top: calc(var(--safe-top)+12px); right: 16px; display: flex; gap: 8px; z-index: 91; }
.lb-btn {
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; padding: 8px 16px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; cursor: pointer; backdrop-filter: blur(8px);
  transition: var(--transition); font-family: var(--font);
}
.lb-btn:hover { background: rgba(255,255,255,0.25); }
#lb-img { max-width: 100%; max-height: calc(100vh - 120px); border-radius: var(--radius-lg); object-fit: contain; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }

/* ── Modal ───────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.modal.hidden { display: none; }
.modal.visible .modal-bg, .modal.visible .modal-sheet { pointer-events: auto; }
.modal-bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity 0.3s;
}
.modal.visible .modal-bg { opacity: 1; }
.modal-sheet {
  position: absolute; bottom: 0; left: 0; right: 0;
  max-width: 600px; margin: 0 auto;
  background: var(--surface); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding-bottom: calc(var(--safe-bot)+24px); box-shadow: 0 -8px 40px rgba(0,0,0,0.2);
  max-height: 90vh; overflow-y: auto;
  transform: translateY(100%); transition: transform 0.35s var(--spring);
}
.modal.visible .modal-sheet { transform: translateY(0); }
.modal-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 16px; font-size: 16px; font-weight: 800; color: var(--text);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-x {
  background: var(--surface3); border: none; color: var(--text3);
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 14px;
  transition: var(--transition); display: flex; align-items: center; justify-content: center;
}
.modal-x:hover { color: var(--text); background: var(--border2); }

.modal-form, .share-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.modal-desc { font-size: 14px; color: var(--text2); line-height: 1.55; }
.modal-label { font-size: 13px; font-weight: 700; color: var(--text2); }
.modal-input, .modal-select {
  width: 100%; background: var(--surface3);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 11px 14px; font-size: 15px; font-family: var(--font);
  color: var(--text); outline: none; transition: var(--transition);
}
.modal-input:focus, .modal-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.modal-divider { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

.modal-btn {
  width: 100%; padding: 13px; border: none; border-radius: var(--radius);
  font-size: 15px; font-weight: 700; cursor: pointer; font-family: var(--font);
  transition: var(--spring);
}
.modal-btn:active { transform: scale(0.97); }
.modal-btn.primary { background: var(--accent-grad); color: #fff; box-shadow: 0 4px 14px var(--accent-glow); }
.modal-btn.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.modal-btn.success { background: linear-gradient(135deg,#10b981,#059669); color:#fff; box-shadow:0 4px 12px rgba(16,185,129,.3); }
.modal-btn.warning { background: linear-gradient(135deg,#f59e0b,#d97706); color:#fff; }
.modal-btn.danger { background: transparent; border: 1.5px solid var(--danger); color: var(--danger); }
.modal-btn.danger:hover { background: rgba(239,68,68,.08); }

/* share */
.share-url-wrap { display: flex; gap: 8px; align-items: center; }
.share-url-input {
  flex: 1; background: var(--surface3); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px; font-size: 13px;
  font-family: var(--font); color: var(--text2); outline: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.copy-btn { flex-shrink: 0; background: var(--accent-grad); color:#fff; border:none; border-radius:var(--radius); padding:10px 16px; font-size:14px; font-weight:700; cursor:pointer; font-family:var(--font); transition:var(--transition); }
.copy-btn:hover { opacity: 0.88; }
.share-meta { font-size: 12px; color: var(--text3); padding: 4px 2px; }
.share-exp-row { display: flex; align-items: center; gap: 12px; }
.share-actions { display: flex; flex-direction: column; gap: 8px; }

/* Settings sections */
.settings-section { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.settings-section:last-child { border-bottom: none; }
.settings-section-title { font-size: 12px; font-weight: 700; color: var(--text3); letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 14px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; gap: 12px; }
.settings-row-label { font-size: 14px; color: var(--text); font-weight: 600; }
.settings-row-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }

/* Color swatches */
.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch {
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  transition: var(--spring); border: 3px solid transparent;
  position: relative;
}
.color-swatch:hover { transform: scale(1.2); }
.color-swatch.active { border-color: white; box-shadow: 0 0 0 3px var(--accent); }

/* Toggle switch */
.toggle {
  position: relative; width: 46px; height: 26px;
  background: var(--border2); border-radius: 13px;
  border: none; cursor: pointer; transition: var(--transition);
  flex-shrink: 0;
}
.toggle::after {
  content: ''; position: absolute; width: 20px; height: 20px;
  background: #fff; border-radius: 50%; top: 3px; left: 3px;
  transition: transform 0.25s var(--spring);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(20px); }

/* bg style options */
.bg-options { display: flex; gap: 10px; flex-wrap: wrap; }
.bg-opt {
  flex: 1; min-width: 80px; padding: 12px 8px;
  background: var(--surface3); border: 2px solid var(--border);
  border-radius: var(--radius); cursor: pointer; text-align: center;
  font-size: 12px; font-weight: 600; color: var(--text2);
  transition: var(--transition); font-family: var(--font);
}
.bg-opt:hover, .bg-opt.active { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
[data-theme="dark"] .bg-opt:hover, [data-theme="dark"] .bg-opt.active { background: rgba(167,139,250,0.1); }
.bg-opt-icon { font-size: 22px; display: block; margin-bottom: 4px; }

/* Category list in modal */
.cat-list { display: flex; flex-direction: column; gap: 8px; padding: 16px 20px; }
.cat-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--surface3);
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: var(--transition);
}
.cat-item:hover { border-color: var(--accent); }
.cat-item-icon { font-size: 24px; }
.cat-item-name { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); }
.cat-item-del {
  background: transparent; border: none; color: var(--text3);
  font-size: 16px; cursor: pointer; padding: 4px 6px;
  border-radius: var(--radius-xs); transition: var(--transition);
}
.cat-item-del:hover { color: var(--danger); background: rgba(239,68,68,0.08); }

/* Move category options */
.move-opts { display: flex; flex-direction: column; gap: 8px; padding: 16px 20px; }
.move-opt {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--surface3); border: 2px solid var(--border);
  border-radius: var(--radius); cursor: pointer; transition: var(--transition);
  font-family: var(--font);
}
.move-opt:hover, .move-opt.active { border-color: var(--accent); background: var(--accent-light); }
[data-theme="dark"] .move-opt:hover { background: rgba(167,139,250,0.1); }
.move-opt-icon { font-size: 22px; }
.move-opt-name { font-size: 14px; font-weight: 700; color: var(--text); }

/* ── Toast ───────────────────────────────────────── */
.toast {
  position: fixed; bottom: calc(var(--safe-bot)+88px); left: 50%;
  transform: translateX(-50%) translateY(0);
  padding: 11px 22px; border-radius: var(--radius-lg);
  font-size: 14px; font-weight: 600; white-space: nowrap; z-index: 100;
  pointer-events: none; max-width: calc(100vw - 40px);
  box-shadow: var(--shadow-lg); animation: toastIn 0.3s var(--spring);
  font-family: var(--font); backdrop-filter: blur(12px);
}
@keyframes toastIn { from{opacity:0;transform:translateX(-50%) translateY(12px)} to{opacity:1;transform:translateX(-50%) translateY(0)} }
.toast.hidden { display: none; }
.toast-info    { background: rgba(15,23,42,0.92); color: #fff; }
.toast-success { background: rgba(16,185,129,0.95); color: #fff; }
.toast-error   { background: rgba(239,68,68,0.95); color: #fff; }
.toast-warning { background: rgba(245,158,11,0.95); color: #fff; }

/* ── Recording Indicator ─────────────────────────── */
.rec-indicator {
  position: fixed; bottom: calc(var(--safe-bot)+82px); left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  background: var(--danger); color: #fff;
  padding: 10px 20px; border-radius: var(--radius-lg);
  font-size: 14px; font-weight: 600; z-index: 60; cursor: pointer;
  box-shadow: 0 4px 20px rgba(239,68,68,.5);
  animation: recSlide 0.3s var(--spring); font-family: var(--font);
}
@keyframes recSlide { from{opacity:0;transform:translateX(-50%) translateY(10px)} to{opacity:1;transform:translateX(-50%) translateY(0)} }
.rec-indicator.hidden { display: none; }
.rec-pulse { width: 10px; height: 10px; background: #fff; border-radius: 50%; animation: recBlink 1s ease-in-out infinite; }
@keyframes recBlink { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.4;transform:scale(0.8)} }

/* ── STT Indicator ───────────────────────────────── */
.stt-indicator {
  position: fixed; bottom: calc(var(--safe-bot)+82px); left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  background: var(--info); color: #fff;
  padding: 10px 20px; border-radius: var(--radius-lg);
  font-size: 14px; font-weight: 600; z-index: 60;
  box-shadow: 0 4px 20px rgba(59,130,246,.5);
  animation: recSlide 0.3s var(--spring); font-family: var(--font);
}
.stt-indicator.hidden { display: none; }
.stt-wave { display: flex; align-items: center; gap: 3px; }
.stt-wave span {
  display: block; width: 3px; height: 12px; background: #fff;
  border-radius: 2px; animation: sttBar 1.2s ease-in-out infinite;
}
.stt-wave span:nth-child(1){ animation-delay:0s }
.stt-wave span:nth-child(2){ animation-delay:.15s }
.stt-wave span:nth-child(3){ animation-delay:.3s }
.stt-wave span:nth-child(4){ animation-delay:.45s }
.stt-wave span:nth-child(5){ animation-delay:.6s }
@keyframes sttBar { 0%,100%{transform:scaleY(0.4)} 50%{transform:scaleY(1.4)} }
#stt-status { flex: 1; }
#stt-stop { background: rgba(255,255,255,0.25); border: none; color: #fff; padding: 5px 12px; border-radius: 20px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: var(--font); }
#stt-stop:hover { background: rgba(255,255,255,0.38); }

/* ── PIN Screen ──────────────────────────────────── */
.pin-screen {
  position: fixed; inset: 0; z-index: 200;
  background: linear-gradient(160deg,#1a0533 0%,#0d1b2e 50%,#0a1628 100%);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.pin-screen.hidden { display: none; }
.pin-inner { width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pin-avatar { font-size: 64px; filter: drop-shadow(0 4px 16px rgba(124,58,237,0.6)); animation: pinFloat 2.5s ease-in-out infinite; }
@keyframes pinFloat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
.pin-title { font-size: 26px; font-weight: 800; color: #fff; }
.pin-sub { font-size: 14px; color: rgba(255,255,255,0.55); min-height: 20px; transition: var(--transition); }
.pin-dots { display: flex; gap: 14px; margin: 8px 0; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.3); background: transparent; transition: var(--spring); }
.pin-dot.filled { background: var(--accent); border-color: var(--accent); transform: scale(1.2); box-shadow: 0 0 12px var(--accent-glow); }
.pin-keypad { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px; }
.pkey {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  color: #fff; font-size: 24px; font-weight: 600; cursor: pointer;
  transition: var(--transition); backdrop-filter: blur(8px); font-family: var(--font);
  display: flex; align-items: center; justify-content: center;
}
.pkey:hover { background: rgba(124,58,237,0.4); border-color: rgba(124,58,237,0.6); transform: scale(1.06); }
.pkey:active { background: rgba(124,58,237,0.6); transform: scale(0.95); }
.pkey-del { font-size: 18px; }

/* ── Remind badge ───────────────────────────────── */
.remind-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--warning);
  background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.25);
  padding: 2px 8px; border-radius: 10px; margin-top: 4px;
}

/* ── Category tag in card ───────────────────────── */
.cat-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 10px;
  margin-top: 4px;
}

/* ── Font size control ───────────────────────────── */
[data-font-size="sm"] .msg-text, [data-font-size="sm"] .msg-caption  { font-size: 13px; }
[data-font-size="md"] .msg-text, [data-font-size="md"] .msg-caption  { font-size: 15px; }
[data-font-size="lg"] .msg-text, [data-font-size="lg"] .msg-caption  { font-size: 17px; }
[data-font-size="xl"] .msg-text, [data-font-size="xl"] .msg-caption  { font-size: 19px; }

/* Font size settings buttons */
.font-size-row { display: flex; gap: 8px; padding: 4px 0; }
.fs-btn {
  flex: 1; padding: 10px 8px; background: var(--surface3);
  border: 2px solid var(--border); border-radius: var(--radius);
  cursor: pointer; font-family: var(--font); font-weight: 600;
  color: var(--text2); transition: var(--transition); text-align: center;
}
.fs-btn:hover, .fs-btn.active { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
[data-theme="dark"] .fs-btn:hover, [data-theme="dark"] .fs-btn.active { background: rgba(167,139,250,0.1); }

/* ── Checklist styles ────────────────────────────── */
.check-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.check-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 4px 2px; border-radius: var(--radius-xs);
  transition: var(--transition);
}
.check-item:hover { background: var(--surface3); }
.check-box { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.check-text {
  font-size: 15px; line-height: 1.5; color: var(--text); word-break: break-word;
}
.check-item.checked .check-text { text-decoration: line-through; color: var(--text3); }

/* ── Background pattern ──────────────────────────── */
body.bg-pattern #msgs-area {
  background-image:
    radial-gradient(circle at 20% 20%, rgba(124,58,237,0.04) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(79,70,229,0.04) 0%, transparent 60%),
    repeating-linear-gradient(0deg, transparent, transparent 28px, rgba(124,58,237,0.04) 28px, rgba(124,58,237,0.04) 29px);
}
[data-theme="dark"] body.bg-pattern #msgs-area {
  background-image:
    radial-gradient(circle at 20% 20%, rgba(124,58,237,0.08) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(79,70,229,0.08) 0%, transparent 60%),
    repeating-linear-gradient(0deg, transparent, transparent 28px, rgba(124,58,237,0.06) 28px, rgba(124,58,237,0.06) 29px);
}

/* ── Edit button ─────────────────────────────────── */
.edit-btn:hover { color: var(--info); background: rgba(59,130,246,0.08); }

/* ── PIN confirm button ──────────────────────────── */
.pkey-confirm {
  background: rgba(16,185,129,0.2) !important;
  border-color: rgba(16,185,129,0.4) !important;
  color: #34d399 !important;
  font-size: 20px !important;
}
.pkey-confirm:hover { background: rgba(16,185,129,0.4) !important; }

/* ── Responsive ──────────────────────────────────── */
@media(min-width:640px) {
  #msgs-list { padding: 16px 20px 12px; }
}
@media(max-width:380px) {
  .pkey { width: 62px; height: 62px; font-size: 20px; }
  .pin-keypad { gap: 10px; grid-template-columns: repeat(3, 62px); }
  .cat-tab { padding: 10px 12px; font-size: 12px; }
  .ftab { padding: 4px 10px; font-size: 11px; }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
