/* OffRecord v2 — Dark/Light, Full Feature Set
   Fonts: Syne (headings) + DM Sans (body)
   Palette: Near-black base, warm off-white, electric amber
*/

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

/* ── DESIGN TOKENS — DARK ────────────────────────────── */
:root {
  --bg:           #0a0a0a;
  --bg-2:         #111111;
  --bg-3:         #181818;
  --bg-4:         #222222;
  --border:       rgba(255,255,255,0.07);
  --border-2:     rgba(255,255,255,0.12);
  --accent:       #f5a623;
  --accent-dim:   rgba(245,166,35,0.12);
  --accent-glow:  rgba(245,166,35,0.4);
  --green:        #34c759;
  --red:          #ff453a;
  --yellow:       #ffd60a;
  --text-1:       #f0ede8;
  --text-2:       rgba(240,237,232,0.55);
  --text-3:       rgba(240,237,232,0.28);
  --font-head:    'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --radius:       14px;
  --radius-sm:    8px;
  --shadow:       0 4px 24px rgba(0,0,0,0.4);
}

/* ── DESIGN TOKENS — LIGHT ───────────────────────────── */
[data-theme="light"] {
  --bg:       #f5f3f0;
  --bg-2:     #ffffff;
  --bg-3:     #eceae6;
  --bg-4:     #e0ddd8;
  --border:   rgba(0,0,0,0.08);
  --border-2: rgba(0,0,0,0.16);
  --text-1:   #1a1816;
  --text-2:   rgba(26,24,22,0.58);
  --text-3:   rgba(26,24,22,0.32);
  --shadow:   0 4px 24px rgba(0,0,0,0.10);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  transition: background 0.3s, color 0.3s;
}

/* ── NOISE ───────────────────────────────────────────── */
.noise-overlay {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 1000;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 128px;
}

/* ── TOP BAR ─────────────────────────────────────────── */
.top-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 54px;
  background: rgba(10,10,10,0.88);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
  transition: background 0.3s;
}
[data-theme="light"] .top-bar {
  background: rgba(245,243,240,0.88);
}
.top-bar-inner {
  height: 100%; max-width: 1440px; margin: 0 auto;
  padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.app-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px var(--accent-glow);
}
.logo-text { font-family: var(--font-head); font-size: 17px; font-weight: 700; letter-spacing: -0.4px; }

/* View tabs in top bar */
.top-bar-center { flex: 1; display: flex; justify-content: center; }
.view-tabs { display: flex; gap: 4px; background: var(--bg-3); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.view-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 14px;
  background: none; border: none; border-radius: 7px;
  color: var(--text-2); font-family: var(--font-body); font-size: 12px;
  font-weight: 500; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.view-tab svg { width: 14px; height: 14px; flex-shrink: 0; }
.view-tab:hover { background: var(--bg-4); color: var(--text-1); }
.view-tab.active { background: var(--accent); color: #000; font-weight: 600; }

.top-bar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Theme toggle */
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-2); cursor: pointer; transition: all 0.15s;
}
.theme-toggle:hover { background: var(--bg-4); color: var(--text-1); }
.theme-toggle svg { width: 15px; height: 15px; }

.privacy-pill {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.3px;
  color: var(--text-2); background: var(--bg-3);
  border: 1px solid var(--border); padding: 4px 12px; border-radius: 100px;
}
.pill-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 6px rgba(52,199,89,0.7);
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ── MAIN LAYOUT ─────────────────────────────────────── */
.main-layout { display: flex; height: 100vh; padding-top: 54px; }

/* ── LEFT PANEL ──────────────────────────────────────── */
.left-panel {
  width: 300px; min-width: 260px;
  background: var(--bg-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
  transition: background 0.3s;
}
.left-view { display: flex; flex-direction: column; flex: 1; overflow: hidden; }

.panel-top {
  padding: 18px 14px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.panel-heading {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.panel-heading h2 { font-family: var(--font-head); font-size: 20px; font-weight: 700; letter-spacing: -0.4px; }
.note-badge {
  background: var(--accent); color: #000; font-family: var(--font-head);
  font-size: 11px; font-weight: 700; min-width: 22px; height: 22px;
  border-radius: 11px; display: flex; align-items: center; justify-content: center; padding: 0 7px;
}

/* Search */
.search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 10px;
  transition: border-color 0.2s; margin-bottom: 10px;
}
.search-wrap:focus-within { border-color: var(--border-2); }
.search-icon { width: 14px; height: 14px; color: var(--text-3); flex-shrink: 0; }
.search-wrap input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-1); font-family: var(--font-body); font-size: 13px; padding: 8px 0;
}
.search-wrap input::placeholder { color: var(--text-3); }
.search-clear {
  background: none; border: none; cursor: pointer; color: var(--text-2);
  display: flex; align-items: center; padding: 3px; border-radius: 4px; transition: background 0.15s;
}
.search-clear svg { width: 14px; height: 14px; }
.search-clear:hover { background: var(--bg-4); }

/* Folder filter */
.folder-filter {
  display: flex; flex-wrap: wrap; gap: 5px; padding-top: 2px;
}
.folder-chip {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 500;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-2); cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.folder-chip:hover { background: var(--bg-4); color: var(--text-1); }
.folder-chip.active { background: var(--accent-dim); border-color: rgba(245,166,35,0.35); color: var(--accent); }
.folder-chip.add-folder { color: var(--text-3); border-style: dashed; }
.folder-chip.add-folder:hover { color: var(--accent); border-color: var(--accent); }

/* Notes list */
.notes-list {
  flex: 1; overflow-y: auto; padding: 8px 8px 20px;
  scrollbar-width: thin; scrollbar-color: var(--bg-4) transparent;
}
.notes-list::-webkit-scrollbar { width: 3px; }
.notes-list::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 2px; }

/* Empty state */
.empty-state { display: flex; flex-direction: column; align-items: center; padding: 40px 20px; text-align: center; }
.empty-glyph { width: 48px; height: 48px; margin-bottom: 14px; color: var(--text-3); }
.empty-title { font-family: var(--font-head); font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.empty-sub { font-size: 12px; color: var(--text-3); }

/* Note cards */
.note-card {
  border-radius: var(--radius-sm); padding: 11px 12px; margin-bottom: 5px;
  cursor: pointer; border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  animation: cardIn 0.25s ease;
}
@keyframes cardIn { from{opacity:0;transform:translateY(5px)} to{opacity:1;transform:translateY(0)} }
.note-card:hover { background: var(--bg-3); border-color: var(--border); }
.note-card.active { background: var(--accent-dim); border-color: rgba(245,166,35,0.3); }
.note-card.pinned-card { border-color: rgba(245,166,35,0.2); }

.note-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.note-card-title { font-family: var(--font-head); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.pin-indicator { font-size: 11px; flex-shrink: 0; margin-left: 4px; }
.tone-tag-small { font-size: 10px; color: var(--text-3); margin-bottom: 3px; display: block; }
.note-card-preview { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; margin-bottom: 4px; }
.note-card-footer { display: flex; align-items: center; justify-content: space-between; }
.note-card-date { font-size: 11px; color: var(--text-3); font-weight: 300; }
.audio-deleted-tag { font-size: 10px; color: var(--green); }

/* ── CALENDAR LEFT ───────────────────────────────────── */
.cal-nav {
  background: none; border: 1px solid var(--border); color: var(--text-2);
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.cal-nav:hover { background: var(--bg-4); color: var(--text-1); }
.cal-month-label { font-family: var(--font-head); font-size: 15px; font-weight: 700; }

.calendar-grid-wrap { padding: 12px 14px 0; flex-shrink: 0; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7,1fr); text-align: center; margin-bottom: 4px; }
.cal-weekdays span { font-size: 10px; color: var(--text-3); font-weight: 600; padding: 4px 0; }

.cal-days { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 12px; border-radius: 6px; cursor: pointer;
  color: var(--text-2); transition: all 0.15s;
}
.cal-day:not(.empty):hover { background: var(--bg-4); color: var(--text-1); }
.cal-day.empty { cursor: default; }
.cal-day.has-notes { position: relative; color: var(--text-1); font-weight: 600; }
.cal-day.has-notes::after {
  content: ''; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
}
.cal-day.today { background: var(--bg-4); color: var(--accent); font-weight: 700; }
.cal-day.selected { background: var(--accent); color: #000; font-weight: 700; }

.cal-day-notes { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.cal-day-label { font-size: 11px; color: var(--text-3); padding: 10px 14px 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; flex-shrink: 0; }
.cal-notes-list { flex: 1; overflow-y: auto; padding: 4px 8px 20px; }

/* ── CHAT LEFT ───────────────────────────────────────── */
.privacy-micro { font-size: 10px; color: var(--text-3); }
.chat-messages { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.chat-bubble { display: flex; gap: 8px; align-items: flex-start; animation: cardIn 0.2s ease; }
.chat-bubble.user { flex-direction: row-reverse; }
.chat-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent);
  color: #000; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-family: var(--font-head);
}
.chat-text {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 12px; padding: 9px 13px; font-size: 13px; line-height: 1.6;
  color: var(--text-1); max-width: 85%;
}
.chat-bubble.user .chat-text { background: var(--accent-dim); border-color: rgba(245,166,35,0.25); }
.chat-bubble.thinking .chat-text { color: var(--text-3); }

.chat-input-row { display: flex; gap: 6px; padding: 12px 14px; border-top: 1px solid var(--border); flex-shrink: 0; }
.chat-input-row input {
  flex: 1; background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-1); font-family: var(--font-body); font-size: 13px;
  padding: 8px 12px; outline: none; transition: border-color 0.2s;
}
.chat-input-row input:focus { border-color: var(--border-2); }
.chat-input-row input::placeholder { color: var(--text-3); }
.chat-send {
  width: 36px; height: 36px; border-radius: 8px; background: var(--accent);
  border: none; cursor: pointer; color: #000; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: opacity 0.15s;
}
.chat-send:hover { opacity: 0.85; }

/* ── RIGHT PANEL ─────────────────────────────────────── */
.right-panel {
  flex: 1; display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: var(--bg); position: relative; transition: background 0.3s;
}

/* ── RECORDER ────────────────────────────────────────── */
.recorder-section { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.recorder-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 22px; padding: 32px 20px; width: 100%; max-width: 380px; position: relative;
}
.record-status { text-align: center; }
.status-main { font-family: var(--font-head); font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.status-sub { font-size: 13px; color: var(--text-2); margin-top: 4px; font-weight: 300; }

/* Language selector */
.lang-selector { display: flex; gap: 6px; transition: opacity 0.2s; }
.lang-btn {
  padding: 5px 12px; border-radius: 100px; font-size: 12px; font-weight: 600;
  background: var(--bg-3); border: 1px solid var(--border); color: var(--text-2);
  cursor: pointer; transition: all 0.15s; font-family: var(--font-body);
}
.lang-btn:hover { background: var(--bg-4); color: var(--text-1); }
.lang-btn.active { background: var(--accent-dim); border-color: rgba(245,166,35,0.4); color: var(--accent); }

/* Timer */
.record-timer {
  font-family: var(--font-head); font-size: 48px; font-weight: 800;
  letter-spacing: -3px; color: var(--accent); font-variant-numeric: tabular-nums;
  animation: timerPulse 1s ease-in-out infinite alternate;
}
@keyframes timerPulse { from{opacity:.6} to{opacity:1} }

/* Waveform */
.waveform { display: flex; align-items: center; gap: 4px; height: 32px; }
.waveform .bar { width: 3px; background: var(--accent); border-radius: 2px; animation: wave 1.2s ease-in-out infinite; opacity: 0.8; }
.waveform .bar:nth-child(1){animation-delay:0s} .waveform .bar:nth-child(2){animation-delay:.1s}
.waveform .bar:nth-child(3){animation-delay:.2s} .waveform .bar:nth-child(4){animation-delay:.3s}
.waveform .bar:nth-child(5){animation-delay:.4s} .waveform .bar:nth-child(6){animation-delay:.3s}
.waveform .bar:nth-child(7){animation-delay:.2s} .waveform .bar:nth-child(8){animation-delay:.1s}
.waveform .bar:nth-child(9){animation-delay:0s}
@keyframes wave { 0%,100%{height:6px} 50%{height:28px} }

/* Record button */
.btn-cluster { position: relative; width: 96px; height: 96px; display: flex; align-items: center; justify-content: center; }
.btn-ring { position: absolute; inset: -12px; border-radius: 50%; border: 1.5px solid rgba(245,166,35,0.2); transition: all 0.3s; }
.btn-ring.active { animation: ringPulse 2s ease-out infinite; border-color: transparent; }
@keyframes ringPulse { 0%{inset:-12px;opacity:.8;border-color:var(--accent)} 100%{inset:-32px;opacity:0;border-color:var(--accent)} }

.record-btn {
  width: 96px; height: 96px; border-radius: 50%; background: #f52323;
  border: none; cursor: pointer; position: relative; z-index: 2;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 8px 32px rgba(245,35,35,0.35);
}
.record-btn:hover { transform: scale(1.06); box-shadow: 0 12px 40px rgba(245,35,35,0.45); }
.record-btn:active { transform: scale(0.94); }
.record-btn.recording { background: var(--red); box-shadow: 0 8px 32px rgba(255,69,58,0.4); }
.btn-inner { display: flex; align-items: center; justify-content: center; color: #fff; }
.icon-mic, .icon-stop { width: 28px; height: 28px; }
.record-hint { font-size: 11px; color: var(--text-3); text-align: center; letter-spacing: 0.4px; text-transform: uppercase; }

/* Pitch control */
.pitch-control { display: flex; flex-direction: column; align-items: center; gap: 6px; transition: opacity 0.2s; }
.pitch-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; }
.pitch-row { display: flex; align-items: center; gap: 10px; }
.pitch-tag { font-size: 11px; color: var(--text-3); }
.pitch-slider {
  -webkit-appearance: none; width: 120px; height: 4px;
  background: var(--bg-4); border-radius: 2px; outline: none; cursor: pointer;
}
.pitch-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 6px var(--accent-glow);
}
.pitch-value { font-size: 12px; color: var(--accent); font-weight: 600; }

/* Ammonization control */
.ammonization-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: opacity 0.2s;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 2px solid var(--text-3);
  border-radius: 4px;
  background: transparent;
  transition: all 0.2s;
  flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
  content: "✓";
  color: white;
  font-weight: bold;
  font-size: 12px;
}

.checkbox-text {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}

.checkbox-hint {
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
  margin: 0;
  letter-spacing: 0.3px;
}

/* Synthetic voice control */
.synthetic-voice-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: opacity 0.2s;
}

/* Synthetic audio player */
.synthetic-audio-section {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audio-player-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--accent-dim);
  border: 1px solid rgba(245,166,35,0.25);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  transition: all 0.2s;
}

.audio-player-card:hover {
  border-color: rgba(245,166,35,0.4);
  background: rgba(245,166,35,0.15);
}

.audio-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
}

.audio-label {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin: 0;
}

.audio-sublabel {
  font-size: 10px;
  color: var(--text-3);
  margin: 0;
}

#synthetic-audio-player {
  max-width: 200px;
  height: 28px;
}

/* Processing overlay */
.processing-wrap {
  position: absolute; inset: 0; background: rgba(10,10,10,0.9);
  backdrop-filter: blur(12px); display: flex; align-items: center; justify-content: center;
  border-radius: 20px; z-index: 20;
}
[data-theme="light"] .processing-wrap { background: rgba(245,243,240,0.92); }
.processing-card { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.proc-spinner {
  width: 40px; height: 40px; border: 2px solid var(--bg-4);
  border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to{transform:rotate(360deg)} }
.proc-label { font-family: var(--font-head); font-size: 15px; font-weight: 600; }
.proc-sub { font-size: 11px; color: var(--text-3); text-align: center; }

/* ── NOTE DETAIL ─────────────────────────────────────── */
.note-detail { width: 100%; height: 100%; display: flex; flex-direction: column; overflow: hidden; animation: slideIn 0.22s ease; }
@keyframes slideIn { from{opacity:0;transform:translateX(10px)} to{opacity:1;transform:translateX(0)} }

.detail-top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px 0; flex-shrink: 0; flex-wrap: wrap; gap: 8px;
}
.detail-top-left, .detail-top-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.pill-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-2); padding: 6px 12px; border-radius: 100px;
  font-family: var(--font-body); font-size: 12px; cursor: pointer; transition: all 0.15s;
  white-space: nowrap;
}
.pill-btn:hover { background: var(--bg-4); color: var(--text-1); }
.pill-btn.danger:hover { background: rgba(255,69,58,0.1); border-color: rgba(255,69,58,0.3); color: var(--red); }
.pill-btn.accent { background: var(--accent-dim); border-color: rgba(245,166,35,0.35); color: var(--accent); }
.pill-btn.accent:hover { background: rgba(245,166,35,0.2); }

.folder-select-wrap { position: relative; }
.folder-select {
  background: var(--bg-3); border: 1px solid var(--border); color: var(--text-2);
  padding: 5px 10px; border-radius: 100px; font-family: var(--font-body);
  font-size: 12px; cursor: pointer; outline: none; transition: all 0.15s;
}
.folder-select:hover { border-color: var(--border-2); }

.detail-scroll {
  flex: 1; overflow-y: auto; padding: 20px 28px 60px;
  scrollbar-width: thin; scrollbar-color: var(--bg-4) transparent;
}
.detail-scroll::-webkit-scrollbar { width: 3px; }
.detail-scroll::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 2px; }

.detail-meta-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.detail-title {
  font-family: var(--font-head); font-size: 26px; font-weight: 800;
  letter-spacing: -0.6px; line-height: 1.2; margin-bottom: 6px;
}
.detail-title[contenteditable="true"] { outline: none; border-bottom: 2px solid var(--accent); padding-bottom: 2px; }
.detail-date { font-size: 11px; color: var(--text-3); font-weight: 300; letter-spacing: 0.3px; text-transform: uppercase; }
.detail-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }

.tone-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--accent-dim); border: 1px solid rgba(245,166,35,0.25);
  color: var(--accent); padding: 4px 10px; border-radius: 100px; font-size: 12px; font-weight: 500;
}
.audio-deleted-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(52,199,89,0.1); border: 1px solid rgba(52,199,89,0.25);
  color: var(--green); padding: 4px 10px; border-radius: 100px; font-size: 11px; font-weight: 500;
}

/* Tags */
.tags-section { margin-bottom: 18px; }
.tags-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 10px; }
.tag-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-2); padding: 3px 8px 3px 10px; border-radius: 100px; font-size: 12px;
}
.tag-remove {
  background: none; border: none; color: var(--text-3); cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0 2px; transition: color 0.15s;
}
.tag-remove:hover { color: var(--red); }
.tags-input-row { display: flex; gap: 6px; }
.tags-input-row input {
  flex: 1; max-width: 200px; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-1); font-family: var(--font-body);
  font-size: 12px; padding: 5px 10px; outline: none; transition: border-color 0.2s;
}
.tags-input-row input:focus { border-color: var(--border-2); }
.tags-input-row input::placeholder { color: var(--text-3); }
.tag-add-btn {
  width: 28px; height: 28px; border-radius: 7px; background: var(--bg-3);
  border: 1px solid var(--border); color: var(--text-2); cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.tag-add-btn:hover { background: var(--accent-dim); border-color: rgba(245,166,35,0.3); color: var(--accent); }

/* Edit bar */
.edit-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--accent-dim); border: 1px solid rgba(245,166,35,0.25);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px;
}
.edit-info { font-size: 12px; color: var(--text-2); flex: 1; }

/* Insight cards */
.insight-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 10px;
  transition: background 0.3s;
}
.insight-label {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-head); font-size: 10px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-2); margin-bottom: 12px;
}
.label-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.label-dot.yellow { background: var(--yellow); box-shadow: 0 0 6px rgba(255,214,10,0.5); }
.label-dot.green  { background: var(--green);  box-shadow: 0 0 6px rgba(52,199,89,0.5); }
.label-dot.red    { background: var(--accent);  box-shadow: 0 0 6px var(--accent-glow); }

.insight-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.insight-list li {
  font-size: 14px; line-height: 1.6; color: var(--text-1);
  padding-left: 16px; position: relative; font-weight: 300;
}
.insight-list li::before {
  content: ''; position: absolute; left: 3px; top: 9px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: 0.6;
}
.insight-list li.editable {
  outline: none; background: var(--bg-3); border-radius: 5px;
  padding: 4px 4px 4px 16px; cursor: text;
}

/* Transcript */
.transcript-block { margin-top: 12px; }
.transcript-toggle {
  display: flex; align-items: center; gap: 7px; width: 100%;
  background: none; border: 1px solid var(--border); color: var(--text-2);
  font-family: var(--font-body); font-size: 11px; padding: 8px 12px;
  border-radius: var(--radius-sm); cursor: pointer; text-align: left;
  transition: all 0.15s; letter-spacing: 0.3px; text-transform: uppercase;
}
.transcript-toggle:hover { background: var(--bg-3); color: var(--text-1); }
.transcript-body { margin-top: 8px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; animation: fadeUp 0.2s ease; }
@keyframes fadeUp { from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:translateY(0)} }
.transcript-body p { font-size: 13px; line-height: 1.8; color: var(--text-2); white-space: pre-wrap; font-weight: 300; }

/* ── CALENDAR RIGHT ──────────────────────────────────── */
.calendar-right { width: 100%; height: 100%; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 40px 32px; }
.cal-right-inner { width: 100%; max-width: 600px; }
.cal-right-header { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.cal-right-title { font-family: var(--font-head); font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.cal-right-sub { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.cal-right-empty { text-align: center; padding: 40px; color: var(--text-3); font-size: 13px; }
.cal-right-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 10px; cursor: pointer; transition: all 0.15s;
  animation: cardIn 0.2s ease;
}
.cal-right-card:hover { border-color: var(--border-2); transform: translateY(-1px); box-shadow: var(--shadow); }
.cal-right-card-title { font-family: var(--font-head); font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.cal-right-card-preview { font-size: 13px; color: var(--text-2); margin-top: 4px; line-height: 1.5; }
.cal-right-card-time { font-size: 11px; color: var(--text-3); margin-top: 8px; }

/* ── CHAT RIGHT (placeholder) ────────────────────────── */
.chat-right {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 28px 32px;
}
.chat-right-inner {
  width: 100%;
  max-width: 980px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: linear-gradient(180deg, rgba(245,166,35,0.05), transparent 18%), var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.chat-right-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(245,166,35,0.08), rgba(245,166,35,0.02));
}
.chat-right-header h2 {
  font-family: var(--font-head);
  font-size: 24px;
  color: var(--text-1);
  margin-bottom: 4px;
}
.chat-right-header p {
  font-size: 13px;
  color: var(--text-2);
}
.chat-right .privacy-micro {
  flex-shrink: 0;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-3);
}
.chat-right .chat-messages {
  padding: 20px 24px;
}
.chat-right .chat-input-row {
  padding: 16px 24px 20px;
  background: rgba(0,0,0,0.06);
}

/* ── MODAL ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(8px);
  z-index: 200; display: flex; align-items: center; justify-content: center;
}
[data-theme="light"] .modal-overlay { background: rgba(0,0,0,0.25); }
.modal-card {
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius);
  padding: 28px; width: 320px; box-shadow: var(--shadow);
}
.modal-card h3 { font-family: var(--font-head); font-size: 17px; margin-bottom: 16px; }
.modal-card input {
  width: 100%; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-1); font-family: var(--font-body);
  font-size: 14px; padding: 9px 13px; outline: none; margin-bottom: 16px;
  transition: border-color 0.2s;
}
.modal-card input:focus { border-color: var(--accent); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── TOAST ───────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--bg-3); color: var(--text-1); border: 1px solid var(--border-2);
  padding: 10px 20px; border-radius: 100px; font-family: var(--font-body);
  font-size: 13px; font-weight: 500; backdrop-filter: blur(20px);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
  opacity: 0; z-index: 999; pointer-events: none; white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 768px) {
  html, body { overflow: auto; }
  .main-layout { flex-direction: column; height: auto; }
  .left-panel { width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: 60vh; }
  .right-panel { min-height: 520px; justify-content: flex-start; padding-top: 20px; }
  .detail-top-bar { padding: 14px 16px 0; }
  .detail-scroll { padding: 16px 16px 40px; }
  .view-tabs { gap: 2px; }
  .view-tab { padding: 4px 10px; font-size: 11px; }
  .detail-meta-row { flex-direction: column; }
  .detail-badges { flex-direction: row; align-items: flex-start; }
  .top-bar-inner { padding: 0 12px; gap: 8px; }
  .privacy-pill span:last-child { display: none; }
  .calendar-right { padding: 20px 16px; }
  .chat-right { padding: 20px 16px; }
  .chat-right-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .view-tab span { display: none; }
  .view-tab { padding: 5px 8px; }
  .detail-top-right { flex-wrap: wrap; }
}


