/* =========================================================
 * Smooky - style.css
 * Theme : sombre, calme, premium, productivite
 * ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #0f1117;
  --bg-2: #14171f;
  --bg-3: #1a1e29;
  --surface: #1c2030;
  --surface-2: #232839;
  --border: #2a3047;
  --border-strong: #3a4262;
  --text: #e8eaf3;
  --text-muted: #8a92a8;
  --text-dim: #5d6478;
  --primary: #5b6cff;
  --primary-hover: #6e7dff;
  --primary-soft: rgba(91, 108, 255, 0.12);
  --success: #2dd4bf;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow: 0 4px 16px rgba(0,0,0,0.25);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);
  --sidebar-w: 240px;
  --topbar-h: 60px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
button { font-family: inherit; font-size: inherit; }

/* ========================== APP LAYOUT ========================== */

.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 50;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.brand-link { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand-mark {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--primary), #8a99ff);
  color: #fff;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(91,108,255,0.4);
}
.brand-mark.big { width: 48px; height: 48px; font-size: 22px; border-radius: 12px; }
.brand-name { font-weight: 600; letter-spacing: -0.01em; }
.brand-name.big { font-size: 26px; margin: 0; }

.sidebar-toggle, .sidebar-open {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
}
.sidebar-open { display: none; padding: 6px; }

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.sidebar-bottom { padding: 8px 8px 12px; border-top: 1px solid var(--border); }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin: 2px 0;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 13.5px;
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.nav-item.active svg { color: var(--primary); }
.nav-item svg { color: var(--text-dim); flex-shrink: 0; }
.nav-item.active svg, .nav-item:hover svg { color: inherit; }
.nav-cta { background: var(--primary); color: #fff !important; margin-bottom: 4px; }
.nav-cta:hover { background: var(--primary-hover); }
.nav-cta svg { color: #fff !important; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.user-meta { min-width: 0; flex: 1; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main {
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
  min-height: 100vh;
}
.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  background: rgba(15,17,23,0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.search-wrap { flex: 1; position: relative; max-width: 520px; }
#global-search {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13.5px;
}
#global-search:focus { outline: none; border-color: var(--primary); }
.search-results {
  position: absolute;
  top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  z-index: 100;
}
.search-result {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: var(--surface-2); }
.search-result .r-title { font-weight: 500; }
.search-result .r-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.search-empty { padding: 16px; color: var(--text-muted); font-size: 13px; text-align: center; }

.topbar-cta { margin-left: auto; }
.topbar-cta span { display: none; }
@media (min-width: 700px) { .topbar-cta span { display: inline; } }

.content { padding: 28px 32px 60px; max-width: 1200px; }

/* ========================== TYPO & BASE ========================== */

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.page-subtitle { color: var(--text-muted); margin: 4px 0 0; font-size: 14px; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { font-size: 13px; color: var(--text-muted); display: inline-block; margin-bottom: 6px; }

.muted { color: var(--text-muted); }
.prose h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin: 22px 0 8px; }
.prose ul { padding-left: 20px; }
.prose li { margin: 4px 0; }
.prose p { margin: 0 0 10px; }

/* ========================== BUTTONS ========================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); border-color: var(--primary); color: var(--text); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-danger-ghost { background: transparent; border-color: var(--border); color: var(--danger); }
.btn-danger-ghost:hover { background: rgba(239, 68, 68, 0.08); border-color: var(--danger); }
.btn-block { display: flex; width: 100%; justify-content: center; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-sm { padding: 5px 9px; font-size: 12px; }

/* ========================== CARDS ========================== */

.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title { margin: 0 0 12px; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }

.empty-state { padding: 40px 20px; text-align: center; }
.empty-state p { color: var(--text-muted); margin-bottom: 16px; }

/* ========================== STATS ========================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color 0.15s;
}
.stat-card:hover { border-color: var(--border-strong); }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); font-weight: 600; }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -0.02em; }

/* ========================== FILTERS / CHIPS ========================== */

.filters-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.chip {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 12.5px;
  white-space: nowrap;
  background: transparent;
  font-weight: 500;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }

/* ========================== NOTE LIST ========================== */

.note-list { list-style: none; padding: 0; margin: 0; }
.note-row { border-bottom: 1px solid var(--border); }
.note-row:last-child { border-bottom: 0; }
.note-link {
  display: block;
  padding: 14px 16px;
  margin: 0 -16px;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}
.note-link:hover { background: var(--surface); color: var(--text); }
.note-row-main { display: flex; flex-direction: column; gap: 6px; }
.note-title { font-weight: 500; font-size: 14.5px; }
.note-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.note-project, .note-date { color: var(--text-muted); }

/* Badges par type de note */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge-personal { background: rgba(91,108,255,0.12); color: #8a99ff; border-color: rgba(91,108,255,0.25); }
.badge-meeting_client { background: rgba(45,212,191,0.12); color: #2dd4bf; border-color: rgba(45,212,191,0.25); }
.badge-meeting_internal { background: rgba(99,102,241,0.12); color: #818cf8; border-color: rgba(99,102,241,0.25); }
.badge-business_idea { background: rgba(245,158,11,0.12); color: #fbbf24; border-color: rgba(245,158,11,0.25); }
.badge-time_note { background: rgba(168,85,247,0.12); color: #c084fc; border-color: rgba(168,85,247,0.25); }
.badge-tech_brief { background: rgba(14,165,233,0.12); color: #38bdf8; border-color: rgba(14,165,233,0.25); }
.badge-commercial { background: rgba(236,72,153,0.12); color: #f472b6; border-color: rgba(236,72,153,0.25); }
.badge-project_follow { background: rgba(34,197,94,0.12); color: #4ade80; border-color: rgba(34,197,94,0.25); }
.badge-training { background: rgba(132,204,22,0.12); color: #a3e635; border-color: rgba(132,204,22,0.25); }
.badge-interview { background: rgba(217,70,239,0.12); color: #e879f9; border-color: rgba(217,70,239,0.25); }
.badge-brainstorm { background: rgba(251,113,133,0.12); color: #fb7185; border-color: rgba(251,113,133,0.25); }
.badge-free { background: rgba(148,163,184,0.12); color: #cbd5e1; border-color: rgba(148,163,184,0.25); }

.status {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-dim);
  font-weight: 500;
}
.status-completed { background: rgba(45,212,191,0.12); color: var(--success); }
.status-error { background: rgba(239,68,68,0.12); color: var(--danger); }
.status-transcribing, .status-summarizing, .status-mindmap_generating { background: rgba(245,158,11,0.12); color: var(--warning); }

.tag-list { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tag {
  display: inline-block;
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ========================== FORMS ========================== */

.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.field-hint { display: block; font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number],
.field select, .field textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.12s;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.form-grid button { grid-column: 1 / -1; justify-self: start; }

.settings-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 900px) { .settings-grid { grid-template-columns: 1fr 1fr; } }

/* ========================== ALERTS ========================== */

.alert { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 13.5px; }
.alert-error { background: rgba(239,68,68,0.12); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.alert-success { background: rgba(45,212,191,0.12); color: var(--success); border: 1px solid rgba(45,212,191,0.3); }

/* ========================== AUTH PAGE ========================== */

.auth-body {
  background: radial-gradient(circle at 30% 20%, rgba(91,108,255,0.15) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(45,212,191,0.08) 0%, transparent 50%),
              var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-wrap { width: 100%; max-width: 420px; }
.auth-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-lg);
}
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.auth-subtitle { color: var(--text-muted); margin: 6px 0 26px; }
.auth-form .field { margin-bottom: 16px; }
.auth-forgot { margin-top: 18px; }
.auth-forgot summary { cursor: pointer; font-size: 13px; color: var(--text-muted); }
.auth-back { margin-top: 22px; text-align: center; font-size: 13px; }

/* ========================== RECORDER ========================== */

.recorder-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 900px) { .recorder-grid { grid-template-columns: 1.1fr 1fr; } }

.recorder-card { padding: 28px; }
.recorder-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.recorder-visual {
  position: relative;
  width: 160px;
  height: 160px;
  display: grid;
  place-items: center;
}
.pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0;
}
.recorder-visual.recording .pulse-ring { animation: pulse 2s ease-out infinite; }
.recorder-visual.recording .pulse-ring.delay { animation-delay: 1s; }
@keyframes pulse {
  0% { transform: scale(0.7); opacity: 0.7; }
  100% { transform: scale(1.4); opacity: 0; }
}
.record-btn {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, var(--primary), #8a99ff);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(91,108,255,0.4);
  transition: transform 0.15s;
  position: relative;
  z-index: 2;
}
.record-btn:hover { transform: scale(1.04); }
.record-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.recorder-visual.recording .record-btn { background: linear-gradient(135deg, var(--danger), #fb7185); }
.record-btn .icon-stop { display: none; }
.recorder-visual.recording .record-btn .icon-idle { display: none; }
.recorder-visual.recording .record-btn .icon-stop { display: block; }

.recorder-time { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.recorder-actions { display: flex; gap: 8px; }
.recorder-divider {
  text-align: center;
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  position: relative;
  margin: 6px 0;
  width: 100%;
}
.recorder-divider::before, .recorder-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 35%;
  border-top: 1px solid var(--border);
}
.recorder-divider::before { left: 0; }
.recorder-divider::after { right: 0; }
.import-btn input { display: none; }
.recorder-filename { font-size: 12px; color: var(--text-muted); min-height: 18px; }

.highlight-list { list-style: none; padding: 0; margin: 18px 0 0; max-height: 140px; overflow-y: auto; }
.highlight-list li { display: flex; justify-content: space-between; padding: 6px 8px; font-size: 13px; border-bottom: 1px solid var(--border); }
.highlight-list li:last-child { border-bottom: 0; }

.form-card { padding: 24px; }

/* ========================== PROGRESS OVERLAY ========================== */

.progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,17,23,0.85);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 200;
}
.progress-overlay[hidden] { display: none !important; }
.modal[hidden] { display: none !important; }
.progress-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 90%;
  max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.progress-spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--surface-2);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 18px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-step { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.progress-bar { height: 4px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin: 14px 0 8px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #8a99ff); width: 0%; transition: width 0.4s; border-radius: 4px; }
.progress-muted { font-size: 12px; color: var(--text-muted); }

/* ========================== NOTE DETAIL ========================== */

.note-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; margin-top: 8px; }
.note-audio-bar { margin-bottom: 18px; }
.note-audio-bar audio { width: 100%; max-width: 600px; }
.note-audio-bar audio::-webkit-media-controls-panel { background: var(--surface); }

.tabs { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: visible; }

/* ===== Desktop par defaut : barre horizontale ===== */
.tabs-menu { position: relative; border-bottom: 1px solid var(--border); }
.tabs-menu-btn { display: none; } /* Le bouton burger est cache en desktop */

.tabs-nav {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  background: var(--bg-3);
}
.tabs-nav[hidden] { display: flex !important; } /* En desktop, [hidden] n'a pas d'effet : on garde la barre visible */

.tab {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 500;
  font-size: 13.5px;
  border-bottom: 2px solid transparent;
  border-left: 0;
  white-space: nowrap;
  text-align: center;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  font-family: inherit;
}
.tab:hover { color: var(--text); background: transparent; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); background: transparent; border-left-color: transparent; }

.tab-panel { display: none; padding: 22px; }
.tab-panel.active { display: block; }

/* ===== Mobile uniquement : menu burger deroulant ===== */
@media (max-width: 768px) {
  .tabs-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-3);
    border: 0;
    color: var(--text);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
  }
  .tabs-menu-btn:hover { background: var(--surface); }
  .tabs-menu-btn svg { color: var(--text-muted); flex-shrink: 0; }
  .tabs-menu-btn .tabs-menu-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 12px;
    color: var(--text-muted);
  }
  .tabs-menu-btn .tabs-menu-current {
    color: var(--primary);
    font-weight: 600;
  }
  .tabs-menu-btn .tabs-menu-caret {
    margin-left: auto;
    transition: transform 0.2s;
  }
  .tabs-menu-btn[aria-expanded="true"] .tabs-menu-caret { transform: rotate(180deg); }

  .tabs-nav {
    display: flex;
    flex-direction: column;
    background: var(--bg-3);
    border-top: 1px solid var(--border);
    overflow: visible;
  }
  .tabs-nav[hidden] { display: none !important; }

  .tab {
    padding: 12px 18px;
    text-align: left;
    border-bottom: 0;
    border-left: 3px solid transparent;
    white-space: normal;
  }
  .tab:hover { background: var(--surface); }
  .tab.active { border-bottom-color: transparent; border-left-color: var(--primary); background: var(--primary-soft); }
}

.transcription-text { background: var(--bg-3); padding: 16px; border-radius: var(--radius-sm); max-height: 500px; overflow-y: auto; line-height: 1.7; font-size: 14px; }

.task-list { list-style: none; padding: 0; margin: 0; }
.task-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.task-item:last-child { border-bottom: 0; }
.task-check { position: relative; flex-shrink: 0; cursor: pointer; }
.task-check input { position: absolute; opacity: 0; width: 20px; height: 20px; cursor: pointer; }
.task-check span {
  display: block;
  width: 20px; height: 20px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  transition: all 0.15s;
  position: relative;
}
.task-check input:checked + span { background: var(--primary); border-color: var(--primary); }
.task-check input:checked + span::after {
  content: '';
  position: absolute;
  left: 6px; top: 2px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.task-body { flex: 1; }
.task-desc { font-size: 14px; }
.task-meta { display: flex; gap: 10px; font-size: 12px; margin-top: 3px; color: var(--text-muted); }

.copy-block {
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 500px;
  overflow-y: auto;
}
.quick-copy { display: flex; justify-content: flex-end; margin-bottom: 8px; }

/* Mind map */
#mindmap-container {
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  min-height: 420px;
  position: relative;
  overflow: hidden;
}
.mindmap-empty { display: grid; place-items: center; min-height: 420px; }
.mindmap-text-fallback { margin-top: 12px; }
.mindmap-text-fallback summary { font-size: 12px; cursor: pointer; padding: 8px 0; }
.mindmap-text-fallback pre { background: var(--bg-3); padding: 12px; border-radius: var(--radius-sm); font-size: 12px; max-height: 300px; overflow: auto; }

/* Ask my note */
.ask-box { display: flex; flex-direction: column; gap: 14px; }
.ask-history { max-height: 400px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.ask-bubble { background: var(--bg-3); border-radius: var(--radius-sm); padding: 14px 16px; }
.ask-bubble.user { background: var(--primary-soft); border-left: 3px solid var(--primary); }
.ask-bubble.assistant { background: var(--bg-3); }
.ask-bubble-role { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
.ask-bubble-content { white-space: pre-wrap; line-height: 1.6; }
.ask-form { display: flex; gap: 8px; }
.ask-form input { flex: 1; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); padding: 10px 14px; border-radius: var(--radius-sm); font-family: inherit; font-size: 14px; }
.ask-form input:focus { outline: none; border-color: var(--primary); }
.ask-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.suggestion {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}
.suggestion:hover { color: var(--text); border-color: var(--primary); }

/* Export */
.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.export-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-3);
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}
.export-card:hover { border-color: var(--primary); transform: translateY(-2px); color: var(--text); }
.export-icon { font-weight: 700; color: var(--primary); font-size: 13px; letter-spacing: 0.06em; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 200;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
}
.modal-card h2 { margin: 0 0 18px; font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* Timeline */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-date { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 600; margin: 22px 0 10px; }
.timeline-item { display: flex; gap: 14px; padding: 12px 0; position: relative; color: var(--text); }
.timeline-dot { position: absolute; left: -24px; top: 18px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); border: 2px solid var(--bg); }
.timeline-content { background: var(--bg-2); border: 1px solid var(--border); padding: 12px 16px; border-radius: var(--radius-sm); flex: 1; transition: border-color 0.15s; }
.timeline-item:hover .timeline-content { border-color: var(--primary); }
.timeline-time { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.timeline-title { font-weight: 500; margin: 2px 0 4px; }
.timeline-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--text-muted); align-items: center; }

/* Data table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.data-table tr:hover td { background: var(--surface); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.dot-ok { background: var(--success); }
.dot-off { background: var(--text-dim); }
.inline-form { display: inline-block; margin-right: 4px; }

/* ========================== LANDING ========================== */

.landing { background: var(--bg); min-height: 100vh; }
.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  border-bottom: 1px solid var(--border);
}
.landing-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; }

.landing-hero {
  position: relative;
  padding: 90px 32px 120px;
  text-align: center;
  overflow: hidden;
}
.landing-hero-inner { max-width: 780px; margin: 0 auto; position: relative; z-index: 2; }
.landing-hero h1 {
  font-size: clamp(34px, 5vw, 56px);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 18px;
  font-weight: 700;
}
.landing-hero-sub {
  font-size: clamp(15px, 1.8vw, 18px);
  color: var(--text-muted);
  margin-bottom: 36px;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}
.hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(91,108,255,0.25) 0%, transparent 60%);
  pointer-events: none;
}

.landing-section { padding: 70px 32px; max-width: 1100px; margin: 0 auto; }
.landing-section.alt { background: var(--bg-2); max-width: none; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.landing-section h2 {
  font-size: clamp(26px, 3.5vw, 36px);
  letter-spacing: -0.02em;
  text-align: center;
  margin: 0 0 50px;
  font-weight: 700;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.step {
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: var(--radius);
  position: relative;
}
.step-num {
  position: absolute;
  top: -12px; left: 24px;
  width: 28px; height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 13px;
}
.step h3 { font-size: 16px; margin: 6px 0 8px; }
.step p { color: var(--text-muted); margin: 0; font-size: 13.5px; }

.features {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.feature {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 28px;
  border-radius: var(--radius);
}
.feature-icon {
  width: 48px; height: 48px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 12px;
  display: grid; place-items: center;
  margin-bottom: 16px;
}
.feature h3 { font-size: 17px; margin: 0 0 8px; }
.feature p { color: var(--text-muted); margin: 0; font-size: 14px; }

.landing-footer {
  display: flex;
  justify-content: space-between;
  padding: 24px 32px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

/* ========================== RESPONSIVE ========================== */

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 45;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle, .sidebar-open { display: block; }
  .sidebar-backdrop.show { display: block; }
  .main { margin-left: 0; width: 100%; }
  .topbar { padding: 0 14px; gap: 8px; }
  .content { padding: 18px 14px 60px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .recorder-grid { grid-template-columns: 1fr; }
  .topbar-cta { padding: 7px 10px; }
}
