/* ═══════════════════════════════════════════════════════════════════
   Jarvis v6.1 — Layout rail + panneaux latéraux
   ═══════════════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────────────── */
:root {
  --bg:        #0b1220;
  --panel:     rgba(15, 23, 42, 0.92);
  --panel-2:   rgba(17, 24, 39, 0.94);
  --line:      rgba(148, 163, 184, 0.16);
  --line-s:    rgba(148, 163, 184, 0.28);
  --text:      #e5eefc;
  --muted:     #94a3b8;
  --blue:      #2563eb;
  --blue-2:    #1d4ed8;
  --shadow:    0 18px 40px rgba(0,0,0,.28);
  --radius:    18px;
  --radius-sm: 12px;
  --rail-w:    56px;
  --panel-w:   340px;
}

/* ── Scrollbars globales ─────────────────────────────────────────── */
/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 130, 180, 0.28) transparent;
}
/* Webkit (Chrome, Edge, Safari) */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(99, 130, 180, 0.28);
  border-radius: 99px;
  transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 130, 180, 0.55);
}
::-webkit-scrollbar-corner {
  background: transparent;
}

body.theme-light * {
  scrollbar-color: rgba(71, 85, 105, 0.25) transparent;
}
body.theme-light ::-webkit-scrollbar-thumb {
  background: rgba(71, 85, 105, 0.25);
}
body.theme-light ::-webkit-scrollbar-thumb:hover {
  background: rgba(71, 85, 105, 0.48);
}

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(37,99,235,.14), transparent 28%),
    radial-gradient(circle at top left,  rgba(59,130,246,.08), transparent 22%),
    var(--bg);
  color: var(--text);
}
button, input, select, textarea { font: inherit; }
button {
  cursor: pointer; border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  transition: transform .12s, background .18s, border-color .18s, opacity .18s;
}
button:hover   { transform: translateY(-1px); }
button:active  { transform: translateY(0); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.primary { background: linear-gradient(135deg, var(--blue), var(--blue-2)); color: #fff; }
.ghost   { background: rgba(30,41,59,.9); color: var(--text); border: 1px solid var(--line); }
.ghost.small { padding: 6px 11px; font-size: .84rem; }
.full { width: 100%; }

/* ── App shell ──────────────────────────────────────────────────── */
.app-shell { max-width: 1440px; margin: 0 auto; padding: 20px; }

/* ── Topbar ─────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.topbar h1 { margin: 4px 0 6px; }
.topbar p, .muted, .helper-text { color: var(--muted); }
.eyebrow, .section-kicker {
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #7dd3fc;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.section-head.compact { margin-bottom: 10px; }
.section-head h2 { margin: 4px 0; }

/* Status pill */
.status-pill {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(15,23,42,.78);
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: 999px;
}
.dot {
  width: 10px; height: 10px; border-radius: 999px;
  background: #22c55e; box-shadow: 0 0 10px rgba(34,197,94,.6);
  transition: background .3s, box-shadow .3s;
  animation: dot-pulse 2.4s ease-in-out infinite;
}
.dot.dot-busy  { background:#f59e0b; box-shadow:0 0 10px rgba(245,158,11,.7); animation:dot-pulse-fast .7s ease-in-out infinite; }
.dot.dot-error { background:#ef4444; box-shadow:0 0 10px rgba(239,68,68,.7);  animation:none; }
@keyframes dot-pulse      { 0%,100%{opacity:1} 50%{opacity:.55} }
@keyframes dot-pulse-fast { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.7;transform:scale(1.2)} }
.live-clock {
  font-size: .82rem; font-variant-numeric: tabular-nums; color: var(--muted);
  padding-left: 6px; border-left: 1px solid var(--line);
}

/* ── Panel base ─────────────────────────────────────────────────── */
.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

/* ═══════════════════════════════════════════════════════════════════
   WORKSPACE : chat-area | side-panels | icon-rail
   ═══════════════════════════════════════════════════════════════════ */
.workspace {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  min-height: 0;
}

/* ── Zone chat ──────────────────────────────────────────────────── */
.chat-area {
  order: 1;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-chat {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Panneau commandes (sous le chat) ───────────────────────────── */
.panel-commands {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.command-bar { display: flex; flex-direction: column; gap: 10px; }
.category-tabs {
  display: flex; gap: 8px;
  overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap;
  scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 2px;
}
.category-tabs::-webkit-scrollbar { display: none; }
.category-tab {
  background: rgba(30,41,59,.72); color: var(--text);
  border: 1px solid var(--line);
  white-space: nowrap; flex-shrink: 0; padding: 8px 14px;
}
.category-tab.active {
  background: rgba(37,99,235,.18); border-color: rgba(59,130,246,.6); color: #dbeafe;
}
.command-picker {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px;
}
.command-picker select, .composer input {
  width: 100%; background: rgba(2,6,23,.8); color: #fff;
  border: 1px solid var(--line-s); border-radius: var(--radius-sm);
  padding: 11px 14px; outline: none;
}
.settings-api-key-input {
  font-family: Consolas, "Courier New", monospace;
  letter-spacing: .02em;
}
.command-picker select:focus, .composer input:focus {
  border-color: rgba(59,130,246,.65); box-shadow: 0 0 0 3px rgba(37,99,235,.18);
}
.helper-text { margin: 6px 0 0; min-height: 20px; font-size: .84rem; color: var(--muted); }

/* ── Panneaux latéraux ──────────────────────────────────────────── */
.side-panels {
  order: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 0;
  overflow: hidden;
  transition: width .3s ease;
  flex-shrink: 0;
}
.side-panels.has-open {
  width: var(--panel-w);
  overflow: visible;
}
.side-panels.has-agenda-open {
  width: min(340px, calc(100vw - 248px));
}
.side-panels.has-agenda-open #panel-agenda {
  width: 100%;
}

/* Chat masqué → les panneaux prennent toute la largeur */
.workspace.chat-hidden .chat-area {
  display: none;
}
.workspace.chat-hidden .side-panels {
  flex: 1;
  width: auto !important;
  overflow: visible;
}
.workspace.chat-hidden .side-panel {
  width: 100%;
}
.workspace.chat-hidden .panel-inner {
  padding: 20px 24px;
}
.workspace.chat-hidden #panel-agenda .agenda-calendar-card {
  max-width: min(760px, 100%);
  padding: 18px;
}
.workspace.chat-hidden #panel-agenda .agenda-month-bar {
  gap: 12px;
}
.workspace.chat-hidden #panel-agenda .agenda-month-bar .ghost.small {
  min-width: 44px;
  min-height: 40px;
}
.workspace.chat-hidden #panel-agenda .agenda-month-label {
  font-size: 18px;
}
.workspace.chat-hidden #panel-agenda .agenda-weekdays {
  gap: 8px;
  margin: 16px 0 10px;
  font-size: 12px;
  letter-spacing: .07em;
}
.workspace.chat-hidden #panel-agenda .agenda-search-row {
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 12px;
  margin: 16px 0 10px;
}
.workspace.chat-hidden #panel-agenda .agenda-search-input,
.workspace.chat-hidden #panel-agenda #btn-agenda-clear-search {
  min-height: 46px;
  font-size: 14px;
}
.workspace.chat-hidden #panel-agenda .agenda-calendar-grid {
  gap: 8px;
}
.workspace.chat-hidden #panel-agenda .agenda-day {
  min-height: 104px;
  border-radius: 18px;
  padding: 10px 9px;
  gap: 8px;
}
.workspace.chat-hidden #panel-agenda .agenda-day-number {
  width: 32px;
  height: 32px;
  font-size: 14px;
}
.workspace.chat-hidden #panel-agenda .agenda-day-events {
  gap: 6px;
  min-height: 46px;
}
.workspace.chat-hidden #panel-agenda .agenda-day-pill,
.workspace.chat-hidden #panel-agenda .agenda-day-more {
  font-size: 11px;
}
.workspace.chat-hidden #panel-agenda .agenda-day-pill {
  width: auto;
  height: auto;
  padding: 4px 9px;
  font-size: 11px;
  background: rgba(59,130,246,.16);
  color: #dbeafe;
}
.workspace.chat-hidden #panel-agenda .agenda-day-empty {
  height: 18px;
}
/* Joueur plus grand */
.workspace.chat-hidden .player-main {
  grid-template-columns: minmax(0,1fr) 200px;
}

.workspace.chat-hidden .media-container {
  width: 100%;
  margin: 0;
}

.workspace.chat-hidden .player-stats-row {
  grid-template-columns: repeat(3, minmax(110px, 1fr));
}

.workspace.chat-hidden .notes-list {
  max-height: 520px;
}

.side-panel {
  width: var(--panel-w);
  animation: panel-in-right .22s ease;
}
@keyframes panel-in-right { from{opacity:0;transform:translateX(12px)} to{opacity:1;transform:none} }
@keyframes panel-in-left  { from{opacity:0;transform:translateX(-12px)} to{opacity:1;transform:none} }

.panel-inner {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

/* ── Rail d'icônes ──────────────────────────────────────────────── */
.icon-rail {
  order: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: var(--rail-w);
  flex-shrink: 0;
  padding: 8px 0;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 20px;
}
.icon-rail::-webkit-scrollbar { display: none; }
.rail-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  background: transparent;
  border: 1px solid transparent;
  transition: background .18s, border-color .18s, transform .12s;
  position: relative;
}
.rail-btn:hover { background: rgba(255,255,255,.07); border-color: var(--line); }
.rail-btn.active {
  background: rgba(37,99,235,.22);
  border-color: rgba(59,130,246,.55);
  box-shadow: 0 0 0 2px rgba(37,99,235,.15);
}
.rail-divider {
  width: 28px; height: 1px;
  background: var(--line);
  margin: 2px 0;
}
#rail-sortable { display: contents; }
#rail-sortable .rail-btn[draggable="true"] { cursor: grab; }
#rail-sortable .rail-btn[draggable="true"]:active { cursor: grabbing; }
.rail-btn--dragging { opacity: .35; transform: scale(.9); }
.rail-btn--drag-over {
  background: rgba(37,99,235,.18);
  border-color: rgba(59,130,246,.5);
  transform: scale(1.08);
}

/* Tooltip au survol */
.rail-btn::after {
  content: attr(title);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%; transform: translateY(-50%);
  background: rgba(15,23,42,.97);
  border: 1px solid var(--line-s);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: .78rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  z-index: 100;
}
.rail-btn:hover::after { opacity: 1; }

.workspace.rail-left .chat-area { order: 3; }
.workspace.rail-left .side-panels { order: 2; }
.workspace.rail-left .icon-rail { order: 1; }
.workspace.rail-left .side-panel { animation-name: panel-in-left; }
.workspace.rail-left .rail-btn::after {
  right: auto;
  left: calc(100% + 10px);
}

/* ── Conversation ───────────────────────────────────────────────── */
.conversation {
  display: flex; flex-direction: column; gap: 12px;
  padding-right: 4px; min-height: 60px; max-height: 70vh;
  overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(99,130,180,.35) transparent;
}
.conversation::-webkit-scrollbar       { width: 5px; }
.conversation::-webkit-scrollbar-track { background: transparent; }
.conversation::-webkit-scrollbar-thumb { background: rgba(99,130,180,.35); border-radius: 99px; }

/* ── Messages ───────────────────────────────────────────────────── */
.message { display: flex; flex-direction: column; gap: 5px; }
.msg-header { display: flex; align-items: baseline; gap: 8px; }
.message strong {
  font-size: .76rem; letter-spacing: .05em;
  text-transform: uppercase; color: #93c5fd;
}
.msg-time { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.message .content {
  width: fit-content; max-width: min(100%, 780px);
  padding: 11px 14px; line-height: 1.5;
  border-radius: 16px; border: 1px solid var(--line);
  background: rgba(30,41,59,.9);
  white-space: pre-wrap; word-break: break-word;
}
.message-text {
  white-space: pre-wrap;
  word-break: break-word;
}
.message.user { align-items: flex-end; }
.message.user strong { color: #c4b5fd; }
.message.user .content { background: rgba(37,99,235,.16); border-color: rgba(99,102,241,.25); }
.message.assistant .content,
.message.welcome   .content {
  border-color: rgba(52,211,153,.25); background: rgba(6,78,59,.18);
  color: #a7f3d0; backdrop-filter: blur(6px);
}
.message-sources {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.message-sources-title {
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(167, 243, 208, .78);
}
.message-source-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: rgba(15, 23, 42, .38);
  border: 1px solid rgba(148, 163, 184, .18);
  transition: transform .12s, background .18s, border-color .18s;
}
.message-source-link:hover {
  transform: translateY(-1px);
  background: rgba(15, 23, 42, .55);
  border-color: rgba(125, 211, 252, .35);
}
.message-source-name {
  color: #e0f2fe;
  font-weight: 600;
  line-height: 1.35;
}
.message-source-desc {
  color: rgba(226, 232, 240, .82);
  font-size: .82rem;
  line-height: 1.4;
}
body.theme-light .message-sources-title {
  color: rgba(5, 150, 105, .8);
}
body.theme-light .message-source-link {
  background: rgba(255, 255, 255, .72);
  border-color: rgba(148, 163, 184, .28);
}
body.theme-light .message-source-link:hover {
  background: rgba(255, 255, 255, .95);
  border-color: rgba(37, 99, 235, .35);
}
body.theme-light .message-source-name {
  color: #0f172a;
}
body.theme-light .message-source-desc {
  color: #475569;
}

/* ── Composer + toolbar ─────────────────────────────────────────── */
.composer { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
.toolbar  { display: flex; justify-content: flex-start; align-items: center; flex-wrap: wrap; gap: 8px; }

/* ── Voice bar ──────────────────────────────────────────────────── */
.voice-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 0 2px;
}
.voice-bar .ghost.small { padding: 5px 9px; font-size: .88rem; }
.voice-bar[data-voice-unavailable="true"] {
  align-items: flex-start;
  opacity: .9;
}
.voice-bar[data-voice-unavailable="true"] .ghost.small {
  cursor: not-allowed;
  opacity: .45;
}
.voice-indicator {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239,68,68,.5);
  animation: voice-pulse 1.1s ease-in-out infinite;
  display: none;
  flex-shrink: 0;
}
@keyframes voice-pulse {
  0%   { transform: scale(1);   box-shadow: 0 0 0 0    rgba(239,68,68,.5); }
  60%  { transform: scale(1.1); box-shadow: 0 0 0 6px  rgba(239,68,68,0);  }
  100% { transform: scale(1);   box-shadow: 0 0 0 0    rgba(239,68,68,0);  }
}
.voice-status {
  font-size: .76rem; color: var(--muted);
  margin-left: 2px; letter-spacing: .01em;
}
.voice-rec-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 28px; }
.rec-dot { width: 11px; height: 11px; border-radius: 50%; background: #ef4444; flex-shrink: 0; }
.voice-rec-btn.active .rec-dot { animation: voice-pulse 1.1s ease-in-out infinite; }
.voice-mic-btn { display: inline-flex; align-items: center; justify-content: center; }
.voice-mic-btn .mic-icon { pointer-events: none; }
.voice-mic-btn[title="Réactiver le micro"] .mic-icon { opacity: .45; }
.toggle   { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; }

/* ── Lecteur musique ────────────────────────────────────────────── */
.player-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: start;
}

.player-meta {
  min-width: 0;
}

.player-meta p {
  margin: 0;
}

.player-meta h3 {
  font-size: 1rem;
  margin: 0 0 2px;
  line-height: 1.35;
}

.player-thumbnail {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  background: rgba(15,23,42,.7);
  border: 1px solid var(--line);
}

.media-container {
  width: min(145px, 100%);
  margin: 0 auto;
}

.player-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player-stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.info-chip {
  min-width: 0;
  background: rgba(15,23,42,.6);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.info-chip span {
  font-size: .7rem;
  color: var(--muted);
}

.info-chip strong {
  font-size: .85rem;
  display: block;
}

.info-chip-query strong {
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}

.info-chip-compact strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transport-card { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.transport-row  { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.secondary-actions-row .icon-btn { opacity: .72; font-size: .9rem; padding: 7px 11px; }
.secondary-actions-row .icon-btn:hover { opacity: 1; }
.icon-btn {
  background: rgba(30,41,59,.9); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 9px 13px; font-size: 1rem; line-height: 1;
  transition: background .18s, border-color .18s, color .18s, transform .12s, box-shadow .18s;
}

/* Play / Pause — bleu actif */
.primary-icon {
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  border-color: transparent; color: #fff;
}
.primary-icon:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 0 12px rgba(59,130,246,.45);
}

/* Stop — rouge au survol et quand actif */
#btn-stop:hover {
  background: rgba(239,68,68,.18);
  border-color: rgba(239,68,68,.6);
  color: #f87171;
  box-shadow: 0 0 10px rgba(239,68,68,.25);
}
#btn-stop.is-stopped {
  background: rgba(239,68,68,.22);
  border-color: rgba(239,68,68,.7);
  color: #f87171;
}

/* Fermer — rouge (danger existant) + hover renforcé */
.icon-btn.danger { border-color: rgba(220,38,38,.45); color: #fecaca; }
.icon-btn.danger:hover {
  background: rgba(220,38,38,.18);
  border-color: rgba(220,38,38,.7);
  color: #f87171;
  box-shadow: 0 0 10px rgba(220,38,38,.25);
}

/* Précédente, Suivante, Rejouer — bleu au survol */
#btn-prev:hover,
#btn-next:hover,
#btn-restart:hover {
  background: rgba(37,99,235,.2);
  border-color: rgba(59,130,246,.6);
  color: #93c5fd;
  box-shadow: 0 0 10px rgba(37,99,235,.2);
}

/* ── Notes ──────────────────────────────────────────────────────── */
.notes-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.notes-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 10px; border-radius: 10px; font-size: .84rem; font-weight: 600;
  background: rgba(30,41,59,.72); color: var(--muted); border: 1px solid var(--line);
  cursor: pointer; transition: background .18s, border-color .18s, color .18s;
}
.notes-tab.active { background: rgba(37,99,235,.18); border-color: rgba(59,130,246,.55); color: #dbeafe; }
.notes-tab.active .counter-badge { background: rgba(37,99,235,.35); border-color: rgba(59,130,246,.7); }
.notes-tab:not(.active) .counter-badge { background: rgba(100,116,139,.25); border-color: rgba(100,116,139,.4); color: var(--muted); }
.notes-list {
  display: flex; flex-direction: column; gap: 9px;
  max-height: 340px; overflow-y: auto; padding-right: 4px;
  scrollbar-width: thin; scrollbar-color: rgba(99,130,180,.35) transparent;
}
.notes-list::-webkit-scrollbar       { width: 5px; }
.notes-list::-webkit-scrollbar-track { background: transparent; }
.notes-list::-webkit-scrollbar-thumb { background: rgba(99,130,180,.35); border-radius: 99px; }
.note-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: rgba(15,23,42,.62);
}
.note-item.is-archived { border-color: rgba(245,158,11,.25); background: rgba(120,53,15,.15); }
.note-body  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.note-index {
  width: 26px; height: 26px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(37,99,235,.22); color: #dbeafe;
  font-size: .82rem; flex: none;
}
.note-item.is-archived .note-index { background: rgba(180,83,9,.28); color: #fde68a; }
.note-head-row {
  display: block;
}
.note-main {
  flex: 1;
  min-width: 0;
}
.note-title   { font-weight: 700; margin-bottom: 3px; font-size: .9rem; }
.note-content { white-space: pre-wrap; line-height: 1.4; color: #dbe7f5; font-size: .87rem; }
.note-content-standalone { margin-top: 1px; }
.note-date    {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: .73rem;
  color: var(--muted);
  margin-top: 1px;
}
.note-archived-meta { font-size: .72rem; color: #d97706; margin-top: 2px; }
.note-actions { display: flex; gap: 5px; flex-shrink: 0; }
.note-actions button { padding: 5px 7px; font-size: .82rem; }
.note-action-row {
  margin-top: 2px;
  flex-wrap: wrap;
}
.note-actions-inline {
  align-self: flex-start;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.btn-note-restore { color: #6ee7b7; }
.btn-note-restore:hover { color: #34d399; }
.counter-badge {
  min-width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: rgba(37,99,235,.2); border: 1px solid rgba(59,130,246,.45);
  color: #dbeafe; font-weight: 700; font-size: .8rem;
}
.counter-badge.archived { background: rgba(180,83,9,.22); border-color: rgba(245,158,11,.45); color: #fde68a; }
.archived-footer { margin-top: 8px; display: flex; justify-content: flex-end; }
.note-confirm { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.note-confirm span { flex: 1 1 100%; margin-bottom: 2px; }
.btn-confirm-yes {
  background: rgba(239,68,68,.18); border: 1px solid rgba(239,68,68,.45);
  color: #fca5a5; padding: 4px 10px; border-radius: 8px; font-size: .8rem; cursor: pointer;
}
.btn-confirm-yes:hover { background: rgba(239,68,68,.32); }
.btn-confirm-no {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: 4px 10px; border-radius: 8px; font-size: .8rem; cursor: pointer;
}
.btn-confirm-no:hover { background: rgba(255,255,255,.05); }
.danger-ghost { border-color: rgba(239,68,68,.4) !important; color: #fca5a5 !important; }
.danger-ghost:hover { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.6) !important; }

/* ── Volume ─────────────────────────────────────────────────────── */
.volume-stack { display: flex; flex-direction: column; gap: 10px; }
.volume-card  { border: 1px solid var(--line); background: rgba(15,23,42,.55); border-radius: 14px; padding: 12px 14px; }
.volume-topline { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.volume-label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.volume-value { font-size: 1.05rem; font-weight: 700; margin: 3px 0; }
.volume-slider { width: 100%; margin-top: 8px; accent-color: var(--blue); cursor: pointer; }
.volume-slider:focus { outline: none; }
.mute-btn {
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 9px; font-size: .95rem; transition: background .15s;
}
.mute-btn:hover   { background: rgba(255,255,255,.06); }
.mute-btn.is-muted { background: rgba(239,68,68,.15); border-color: rgba(239,68,68,.45); color: #fca5a5; }

/* ── Toast ──────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  align-items: flex-end;
}
.toast {
  min-width: 220px;
  max-width: min(320px, calc(100vw - 36px));
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  line-height: 1.45;
  font-weight: 500;
  white-space: normal;
  word-break: break-word;
  border: 1px solid var(--line);
  background: rgba(15,23,42,.96);
  backdrop-filter: blur(8px);
  color: var(--text);
  pointer-events: none;
  animation: toast-in .22s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
@media (max-width: 900px) {
  .toast-container {
    right: 18px;
    left: 18px;
    bottom: 18px;
    align-items: stretch;
  }
  .toast {
    max-width: none;
    min-width: 0;
  }
}
.toast.toast-success { border-color: rgba(52,211,153,.45); color: #6ee7b7; }
.toast.toast-error   { border-color: rgba(239,68,68,.45);  color: #fca5a5; }
.toast.toast-info    { border-color: rgba(59,130,246,.45); color: #dbeafe; }
.toast.toast-out     { animation: toast-out .25s ease forwards; }
@keyframes toast-in  { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:none} }
@keyframes toast-out { from{opacity:1;transform:none} to{opacity:0;transform:translateY(10px)} }

/* ── Modale ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 8000;
  background: rgba(0,0,0,.65); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
  background: #0f172a; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; width: 100%; max-width: 480px;
  display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.7); animation: modal-in .2s ease;
}
@keyframes modal-in { from{opacity:0;transform:scale(.96) translateY(8px)} to{opacity:1;transform:none} }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.modal-textarea {
  width: 100%; min-height: 120px; padding: 12px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  border-radius: 10px; color: var(--text); font-size: .9rem; line-height: 1.5;
  resize: vertical;
}
.modal-textarea:focus { outline: none; border-color: rgba(59,130,246,.55); }
.modal-field { display: flex; flex-direction: column; gap: 6px; }
.modal-field-label {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--muted);
}
.modal-input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
}
.modal-input:focus {
  outline: none;
  border-color: rgba(59,130,246,.55);
  box-shadow: 0 0 0 3px rgba(37,99,235,.14);
}
.due-modal-box { max-width: 420px; }
.due-modal-toggle { margin-top: -4px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ── Empty state ────────────────────────────────────────────────── */
.empty-state {
  padding: 20px 14px; text-align: center; color: var(--muted);
  background: rgba(15,23,42,.32); border-radius: 14px; font-size: .88rem;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --panel-w: 280px; }
}

@media (max-width: 700px) {
  .app-shell { padding: 12px; }
  .workspace { flex-direction: column; }
  .workspace .icon-rail { order: 1; }
  .workspace .chat-area { order: 2; }
  .workspace .side-panels { order: 3; }
  .rail-btn[data-panel="panel-volume"] { display: none !important; }
  #panel-volume { display: none !important; }
  .panel,
  .modal-box { padding: 16px; }
  .modal-overlay { padding: 12px; }
  .modal-box,
  .agenda-modal-box,
  .confirm-modal-box,
  .user-modal-box,
  .auth-modal-box,
  .due-modal-box {
    width: min(100%, calc(100vw - 24px));
    max-width: min(100%, calc(100vw - 24px));
  }
  .modal-input,
  .modal-textarea,
  .settings-select,
  .command-picker select,
  .composer input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .modal-input[type="date"],
  .modal-input[type="time"],
  .modal-input[type="datetime-local"] {
    font-size: 16px;
    line-height: 1.2;
  }
  .modal-actions {
    flex-wrap: wrap;
    justify-content: stretch;
  }
  .modal-actions > * {
    flex: 1 1 100%;
  }
  .icon-rail {
    flex-direction: row;
    width: 100%;
    position: static;
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .rail-btn,
  .rail-divider {
    flex: 0 0 auto;
  }
  .rail-btn::after { display: none; }
  .side-panels.has-open { width: 100%; }
  .side-panels.has-agenda-open { width: 100%; }
  .side-panel { width: 100%; }

  .player-main { grid-template-columns: 1fr; }

  .player-stats-row {
    grid-template-columns: 1fr 1fr;
  }
  .player-stats-row .info-chip-compact:last-child { display: none; }

  .composer { grid-template-columns: 1fr; }
}

/* ── Contrôles conversation ─────────────────────────────────────── */
.conv-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}



.conv-select:focus {
  border-color: rgba(59,130,246,.55);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

@media (max-width: 560px) {
  .conv-controls { flex-wrap: wrap; }
  .conv-select   { max-width: 100%; width: 100%; }
  .modal-head {
    align-items: flex-start;
    gap: 10px;
  }
  .command-picker,
  .notes-toolbar {
    grid-template-columns: 1fr;
  }
  .custom-select-trigger,
  .custom-select-list {
    min-width: 0;
    max-width: 100%;
  }
}

.btn-new-conv:hover { color: #4ade80; border-color: rgba(74,222,128,.45); background: rgba(74,222,128,.08); }

/* Icône + select conversations */






/* Bouton supprimer toutes les conversations */
.btn-clear-all-conv:hover {
  color: #f87171;
  border-color: rgba(248, 113, 113, .45);
  background: rgba(248, 113, 113, .08);
}

/* ── Custom dropdown conversations ─────────────────────────────── */
.custom-select {
  position: relative;
}

.custom-select-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #0a0f1e;
  color: #e5eefc;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: .83rem;
  cursor: pointer;
  min-width: 220px;
  max-width: 320px;
  text-align: left;
  transition: border-color .18s, box-shadow .18s;
}
.custom-select-trigger:hover {
  border-color: rgba(59, 130, 246, .45);
}
.custom-select.open .custom-select-trigger {
  border-color: rgba(59, 130, 246, .65);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.conv-select-icon  { font-size: 1rem; flex-shrink: 0; }
.custom-select-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.custom-select-arrow { font-size: .7rem; color: #94a3b8; flex-shrink: 0; transition: transform .2s; }
.custom-select.open .custom-select-arrow { transform: rotate(180deg); }

.custom-select-list {
  position: absolute;
  top: calc(100% + 6px);
  bottom: auto;
  left: 0;
  min-width: 100%;
  max-width: 400px;
  max-height: 280px;
  overflow-y: auto;
  background: #0a0f1e;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: var(--radius-sm);
  box-shadow: 0 -8px 24px rgba(0,0,0,.6);
  z-index: 1000;
  list-style: none;
  margin: 0;
  padding: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(99,130,180,.4) transparent;
}
.custom-select-list::-webkit-scrollbar { width: 5px; }
.custom-select-list::-webkit-scrollbar-thumb { background: rgba(99,130,180,.4); border-radius: 99px; }

.custom-select-list li {
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: #e5eefc;
  font-size: .82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .15s;
}
.custom-select-list li:hover     { background: rgba(37, 99, 235, .2); }
.custom-select-list li.active    { background: rgba(37, 99, 235, .28); color: #dbeafe; font-weight: 600; }
.custom-select-list li.empty     { color: #94a3b8; font-style: italic; cursor: default; }
.custom-select-list li.empty:hover { background: transparent; }

/* ═══════════════════════════════════════════════════════════════════
   Notes — toolbar recherche / tri / tags
   ═══════════════════════════════════════════════════════════════════ */
.notes-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
}
.notes-search-input {
  background: rgba(2,6,23,.8);
  color: var(--text);
  border: 1px solid var(--line-s);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: .84rem;
  outline: none;
  width: 100%;
}
.notes-search-input:focus {
  border-color: rgba(59,130,246,.6);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.notes-sort-select {
  background: rgba(2,6,23,.8);
  color: var(--text);
  border: 1px solid var(--line-s);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: .82rem;
  outline: none;
  cursor: pointer;
  color-scheme: dark;
}
.notes-tags-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
  min-height: 0;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 600;
  background: rgba(37,99,235,.15);
  border: 1px solid rgba(59,130,246,.35);
  color: #93c5fd;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  user-select: none;
}
.tag-chip:hover { background: rgba(37,99,235,.28); border-color: rgba(59,130,246,.6); }
.tag-chip.active { background: rgba(37,99,235,.4); border-color: rgba(59,130,246,.8); color: #dbeafe; }

/* Tags sur les notes */
.note-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.note-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  background: rgba(37,99,235,.15);
  border: 1px solid rgba(59,130,246,.3);
  color: #93c5fd;
}
/* Bouton édition tags dans la note */
.btn-note-tags {
  color: #7dd3fc;
  font-size: .78rem;
  padding: 4px 7px;
}
.btn-note-tags:hover { color: #38bdf8; }

/* ═══════════════════════════════════════════════════════════════════
   Panneau paramètres
   ═══════════════════════════════════════════════════════════════════ */
.settings-panel { display: flex; flex-direction: column; gap: 0; }

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.settings-group:last-of-type { border-bottom: none; }

.settings-label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #7dd3fc;
}

.settings-range-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-range-value {
  font-size: .82rem;
  color: var(--muted);
  font-weight: 600;
}

.settings-row { display: flex; gap: 8px; flex-wrap: wrap; }
.settings-row a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: .84rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(30,41,59,.9);
  color: var(--text);
  border: 1px solid var(--line);
  transition: background .18s, border-color .18s, transform .12s;
}
.settings-row a:hover { background: rgba(37,99,235,.18); border-color: rgba(59,130,246,.5); transform: translateY(-1px); }

.settings-select {
  background: #0a0f1e;
  color: var(--text);
  border: 1px solid var(--line-s);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: .85rem;
  outline: none;
  cursor: pointer;
  color-scheme: dark;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.settings-select:focus { border-color: rgba(59,130,246,.6); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

.settings-range {
  width: 100%;
  accent-color: var(--blue);
  cursor: pointer;
}

.settings-range-labels {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 2px;
  font-size: .62rem;
  color: var(--muted);
}

.settings-range-labels span {
  text-align: center;
  white-space: nowrap;
}

.settings-textarea {
  background: rgba(2,6,23,.8);
  color: var(--text);
  border: 1px solid var(--line-s);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: .84rem;
  resize: vertical;
  min-height: 90px;
  outline: none;
  width: 100%;
  line-height: 1.5;
}
.settings-textarea:focus { border-color: rgba(59,130,246,.6); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

/* Toggle switch */
.settings-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.settings-toggle input { display: none; }
.toggle-track {
  width: 40px; height: 22px;
  border-radius: 999px;
  background: rgba(100,116,139,.35);
  border: 1px solid var(--line);
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.settings-toggle input:checked + .toggle-track { background: rgba(37,99,235,.55); border-color: rgba(59,130,246,.6); }
.toggle-thumb {
  width: 16px; height: 16px;
  border-radius: 999px;
  background: #fff;
  position: absolute;
  top: 2px; left: 2px;
  transition: left .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.settings-toggle input:checked + .toggle-track .toggle-thumb { left: 20px; }

/* Boutons thème */
.theme-btn,
.rail-position-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(30,41,59,.72);
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: .85rem;
  transition: all .18s;
}
.theme-btn.active,
.rail-position-btn.active { background: rgba(37,99,235,.22); border-color: rgba(59,130,246,.6); color: #dbeafe; }
.theme-btn:hover:not(.active),
.rail-position-btn:hover:not(.active) { background: rgba(255,255,255,.05); color: var(--text); }

.rail-position-row {
  gap: 10px;
  justify-content: center;
  align-items: center;
}

.rail-position-btn {
  width: 54px;
  height: 46px;
  padding: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: transform .12s, background .18s, border-color .18s, color .18s, box-shadow .18s;
}

.rail-position-btn.active {
  box-shadow: 0 0 0 2px rgba(37,99,235,.16);
}

.rail-position-icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.settings-hint {
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.4;
}

.settings-save {
  width: 100%;
  padding: 10px;
  margin-top: 4px;
}
.settings-divider {
  height: 1px;
  background: var(--line);
  margin: 6px 0;
}

/* ═══════════════════════════════════════════════════════════════════
   Thème clair — version complète et cohérente
   ═══════════════════════════════════════════════════════════════════ */
body.theme-light {
  --bg:      #f0f4f8;
  --panel:   rgba(255, 255, 255, 0.95);
  --panel-2: rgba(248, 250, 252, 0.98);
  --line:    rgba(71, 85, 105, 0.15);
  --line-s:  rgba(71, 85, 105, 0.30);
  --text:    #0f172a;
  --muted:   #475569;
  --shadow:  0 4px 24px rgba(0,0,0,.1);
  background: linear-gradient(135deg, #e2e8f0 0%, #f0f4f8 100%);
  color: #0f172a;
}

/* Structure */
body.theme-light .panel,
body.theme-light .panel-inner {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.98));
  border-color: rgba(71,85,105,.15);
  box-shadow: 0 2px 20px rgba(0,0,0,.07);
}
body.theme-light .icon-rail {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.98));
  border-color: rgba(71,85,105,.2);
  box-shadow: 0 2px 20px rgba(0,0,0,.08);
}

/* Boutons */
body.theme-light .ghost {
  background: rgba(255,255,255,.9);
  color: #1e293b;
  border-color: rgba(71,85,105,.25);
}
body.theme-light .ghost:hover {
  background: rgba(241,245,249,1);
  border-color: rgba(37,99,235,.4);
  color: #1d4ed8;
}
body.theme-light .primary { box-shadow: 0 2px 8px rgba(37,99,235,.3); }

/* Rail */
body.theme-light .rail-btn { color: #475569; }
body.theme-light .rail-btn:hover { background: rgba(241,245,249,1); border-color: rgba(71,85,105,.3); color: #0f172a; }
body.theme-light .rail-btn.active {
  background: rgba(37,99,235,.12);
  border-color: rgba(59,130,246,.5);
  color: #1d4ed8;
}
body.theme-light .rail-btn::after {
  background: rgba(255,255,255,.98);
  border-color: rgba(71,85,105,.2);
  color: #0f172a;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

/* Conversation */
body.theme-light .conversation { color: #0f172a; }
body.theme-light .message .content {
  background: rgba(255,255,255,.9);
  color: #1e293b;
  border-color: rgba(71,85,105,.2);
}
body.theme-light .message.user .content {
  background: rgba(37,99,235,.08);
  color: #1e3a8a;
  border-color: rgba(59,130,246,.25);
}
body.theme-light .message.assistant .content,
body.theme-light .message.welcome   .content {
  background: rgba(20,184,166,.08);
  color: #0f766e;
  border-color: rgba(20,184,166,.3);
}
body.theme-light .message.assistant.error .content {
  background: rgba(239,68,68,.08);
  color: #b91c1c;
  border-color: rgba(239,68,68,.3);
}
body.theme-light .message strong { color: #3b82f6; }
body.theme-light .message.user strong { color: #7c3aed; }
body.theme-light .msg-time { color: #94a3b8; }
body.theme-light .thinking-dots span { background: #0d9488; }

/* Composer */
body.theme-light .composer input {
  background: rgba(255,255,255,.95);
  color: #0f172a;
  border-color: rgba(71,85,105,.3);
}
body.theme-light .composer input:focus {
  border-color: rgba(59,130,246,.6);
}
body.theme-light .composer input::placeholder { color: #94a3b8; }

/* Toolbar */
body.theme-light .toggle { color: #475569; }

/* Tabs catégorie */
body.theme-light .category-tab {
  background: rgba(241,245,249,.9);
  color: #475569;
  border-color: rgba(71,85,105,.2);
}
body.theme-light .category-tab.active {
  background: rgba(37,99,235,.1);
  border-color: rgba(59,130,246,.5);
  color: #1d4ed8;
}

/* Selects / inputs settings */
body.theme-light .command-picker select,
body.theme-light .notes-search-input,
body.theme-light .notes-sort-select,
body.theme-light .settings-select,
body.theme-light .settings-textarea {
  background: rgba(255,255,255,.95);
  color: #0f172a;
  border-color: rgba(71,85,105,.3);
}
body.theme-light .notes-search-input::placeholder { color: #94a3b8; }

/* Notes */
body.theme-light .note-item {
  background: rgba(255,255,255,.85);
  border-color: rgba(71,85,105,.15);
}
body.theme-light .note-item.is-archived {
  background: rgba(254,243,199,.5);
  border-color: rgba(217,119,6,.2);
}
body.theme-light .note-title   { color: #0f172a; }
body.theme-light .note-content { color: #334155; }
body.theme-light .note-date, body.theme-light .muted, body.theme-light .helper-text { color: #64748b; }
body.theme-light .note-index   { background: rgba(37,99,235,.12); color: #1d4ed8; }
body.theme-light .note-item.is-archived .note-index { background: rgba(217,119,6,.15); color: #92400e; }
body.theme-light .note-archived-meta { color: #b45309; }
body.theme-light .note-tag  { background: rgba(37,99,235,.08); color: #1d4ed8; border-color: rgba(59,130,246,.25); }
body.theme-light .notes-tab { background: rgba(241,245,249,.9); color: #475569; border-color: rgba(71,85,105,.2); }
body.theme-light .notes-tab.active { background: rgba(37,99,235,.1); color: #1d4ed8; border-color: rgba(59,130,246,.45); }
body.theme-light .tag-chip  { background: rgba(37,99,235,.08); color: #1d4ed8; border-color: rgba(59,130,246,.25); }
body.theme-light .tag-chip.active { background: rgba(37,99,235,.2); border-color: rgba(59,130,246,.6); }
body.theme-light .counter-badge { background: rgba(37,99,235,.12); border-color: rgba(59,130,246,.4); color: #1d4ed8; }
body.theme-light .counter-badge.archived { background: rgba(217,119,6,.12); border-color: rgba(217,119,6,.35); color: #92400e; }
body.theme-light .notes-tab:not(.active) .counter-badge { background: rgba(71,85,105,.1); border-color: rgba(71,85,105,.25); color: #64748b; }
body.theme-light .empty-state { background: rgba(241,245,249,.7); color: #64748b; }

/* Transport */
body.theme-light .icon-btn { background: rgba(241,245,249,.9); color: #334155; border-color: rgba(71,85,105,.2); }
body.theme-light .icon-btn:hover { background: rgba(226,232,240,1); }
body.theme-light .primary-icon { color: #fff; }
body.theme-light .info-chip { background: rgba(241,245,249,.8); border-color: rgba(71,85,105,.15); }
body.theme-light .info-chip span  { color: #64748b; }
body.theme-light .info-chip strong { color: #0f172a; }

/* Volume */
body.theme-light .volume-card  { background: rgba(241,245,249,.8); border-color: rgba(71,85,105,.15); }
body.theme-light .volume-label { color: #64748b; }
body.theme-light .volume-value { color: #0f172a; }
body.theme-light .mute-btn { border-color: rgba(71,85,105,.25); color: #475569; }

/* Paramètres */
body.theme-light .settings-label { color: #3b82f6; }
body.theme-light .settings-group { border-bottom-color: rgba(71,85,105,.12); }
body.theme-light .theme-btn,
body.theme-light .rail-position-btn { background: rgba(241,245,249,.9); color: #475569; border-color: rgba(71,85,105,.2); }
body.theme-light .theme-btn.active,
body.theme-light .rail-position-btn.active { background: rgba(37,99,235,.1); color: #1d4ed8; border-color: rgba(59,130,246,.45); }
body.theme-light .settings-range-value,
body.theme-light .settings-range-labels { color: #64748b; }
body.theme-light .settings-row a { background: rgba(241,245,249,.9); color: #334155; border-color: rgba(71,85,105,.2); }
body.theme-light .toggle-track { background: rgba(71,85,105,.2); border-color: rgba(71,85,105,.3); }
body.theme-light input:checked + .toggle-track { background: rgba(37,99,235,.45); }
body.theme-light .settings-divider { background: rgba(71,85,105,.12); }

/* Toasts */
body.theme-light .toast { background: rgba(255,255,255,.97); color: #0f172a; box-shadow: 0 4px 20px rgba(0,0,0,.12); }
body.theme-light .toast.toast-success { border-color: rgba(20,184,166,.5); color: #0f766e; }
body.theme-light .toast.toast-error   { border-color: rgba(239,68,68,.4);  color: #b91c1c; }
body.theme-light .toast.toast-info    { border-color: rgba(59,130,246,.4); color: #1d4ed8; }

/* Dropdown conv */
body.theme-light .custom-select-trigger {
  background: rgba(255,255,255,.95);
  color: #0f172a;
  border-color: rgba(71,85,105,.3);
}
body.theme-light .custom-select-list {
  background: rgba(255,255,255,.99);
  border-color: rgba(71,85,105,.25);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
body.theme-light .custom-select-list li { color: #0f172a; }
body.theme-light .custom-select-list li:hover  { background: rgba(37,99,235,.08); }
body.theme-light .custom-select-list li.active { background: rgba(37,99,235,.12); color: #1d4ed8; }
body.theme-light .custom-select-list li.empty  { color: #94a3b8; }
body.theme-light .conv-select-icon { border-right-color: rgba(71,85,105,.2); }

/* Modale */
body.theme-light .modal-overlay { background: rgba(15,23,42,.5); }
body.theme-light .modal-box { background: #fff; border-color: rgba(71,85,105,.2); }
body.theme-light .modal-textarea { background: rgba(241,245,249,.8); color: #0f172a; border-color: rgba(71,85,105,.25); }
body.theme-light .modal-head h3 { color: #0f172a; }

/* Confirmation inline */
body.theme-light .note-confirm { color: #64748b; }
body.theme-light .btn-confirm-no { border-color: rgba(71,85,105,.25); color: #475569; }

/* Section kicker */
body.theme-light .section-kicker,
body.theme-light .eyebrow,
body.theme-light .tile-kicker { color: #3b82f6; }

/* Météo inline */
body.theme-light .weather-inline span { color: #0f766e; }
body.theme-light .weather-inline { border-top-color: rgba(20,184,166,.25); }

/* Status pill */
body.theme-light .status-pill { background: rgba(255,255,255,.9); border-color: rgba(71,85,105,.2); }
body.theme-light .live-clock  { color: #64748b; border-left-color: rgba(71,85,105,.2); }


/* ── Indicateur "en cours de traitement" ────────────────────────── */
.thinking-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 14px 18px !important;
  width: fit-content;
}
.thinking-dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #6ee7b7;
  opacity: .4;
  animation: think-pulse 1.2s ease-in-out infinite;
}
.thinking-dots span:nth-child(2) { animation-delay: .2s; }
.thinking-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes think-pulse { 0%,100%{opacity:.4;transform:scale(1)} 50%{opacity:1;transform:scale(1.25)} }

/* ── Message d'erreur Jarvis ────────────────────────────────────── */
.message.assistant.error .content {
  border-color: rgba(239, 68, 68, .35);
  background: rgba(127, 29, 29, .18);
  color: #fca5a5;
}

/* ── Input désactivé pendant traitement ────────────────────────── */
.composer input:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.composer button:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

/* ── Mini-card météo inline ─────────────────────────────────────── */
.weather-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(52, 211, 153, .2);
}
.weather-inline span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .84rem;
  color: #a7f3d0;
}
body.theme-light .weather-inline span { color: #065f46; }
body.theme-light .weather-inline { border-top-color: rgba(52,211,153,.3); }

.settings-voice-hint {
  font-size: .75rem;
  color: var(--muted);
  font-style: italic;
  align-self: center;
}

/* ── Message en attente de réponse (dialogue interactif) ─────────── */
.message.assistant.awaiting-input .content {
  border-color: rgba(251, 191, 36, .5);
  background: rgba(78, 42, 0, .2);
  color: #fde68a;
  animation: awaiting-pulse 2s ease-in-out infinite;
}
@keyframes awaiting-pulse {
  0%,100% { border-color: rgba(251,191,36,.4); }
  50%      { border-color: rgba(251,191,36,.8); box-shadow: 0 0 8px rgba(251,191,36,.2); }
}
body.theme-light .message.assistant.awaiting-input .content {
  border-color: rgba(217,119,6,.5);
  background: rgba(254,243,199,.6);
  color: #92400e;
}
/* Input focus plus visible pendant dialogue */
.composer input:focus {
  border-color: rgba(251,191,36,.6) !important;
  box-shadow: 0 0 0 3px rgba(251,191,36,.12) !important;
}


/* ── Notes & Tâches : bascule + création ───────────────────────── */
.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.mode-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(30,41,59,.72);
  color: var(--muted);
  border: 1px solid var(--line);
  cursor: pointer;
  font-weight: 700;
  transition: background .18s, border-color .18s, color .18s;
}
.mode-switch-btn.active {
  background: rgba(37,99,235,.18);
  border-color: rgba(59,130,246,.55);
  color: #dbeafe;
}
.quick-create-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 10px;
}
.todo-item.is-done { opacity: .9; }
.todo-title { margin-bottom: 0; }
.todo-actions-inline { gap: 4px; }
.todo-actions-inline button { padding: 4px 6px; }
.todo-section { display: flex; flex-direction: column; gap: 8px; }
.todo-section + .todo-section { margin-top: 12px; }
.todo-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.counter-badge.todo {
  background: rgba(16,185,129,.18);
  border-color: rgba(16,185,129,.45);
  color: #bbf7d0;
}
.counter-badge.todo.done {
  background: rgba(100,116,139,.24);
  border-color: rgba(148,163,184,.35);
  color: #cbd5e1;
}
.empty-state.compact { padding: 12px 10px; font-size: .8rem; }
body.theme-light .mode-switch-btn {
  background: rgba(241,245,249,.9);
  color: #475569;
  border-color: rgba(71,85,105,.2);
}
body.theme-light .mode-switch-btn.active {
  background: rgba(37,99,235,.1);
  color: #1d4ed8;
  border-color: rgba(59,130,246,.45);
}
body.theme-light .counter-badge.todo {
  background: rgba(16,185,129,.12);
  border-color: rgba(16,185,129,.3);
  color: #047857;
}
body.theme-light .counter-badge.todo.done {
  background: rgba(148,163,184,.12);
  border-color: rgba(148,163,184,.25);
  color: #475569;
}

/* ── Agenda ────────────────────────────────────────────────────── */
.agenda-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.agenda-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.agenda-layout {
  display: block;
}
.agenda-layout-single {
  display: block;
}
.agenda-calendar-card,
.agenda-card {
  background: rgba(15,23,42,.38);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: 0 16px 40px rgba(15,23,42,.18);
}
.agenda-calendar-card {
  width: 100%;
  max-width: 288px;
  margin-inline: auto;
}
.agenda-side {
  display: grid;
  gap: 14px;
}
.agenda-month-bar,
.agenda-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.agenda-month-bar .ghost.small {
  min-width: 28px;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.agenda-month-label {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  text-transform: capitalize;
}
.agenda-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  margin: 8px 0 4px;
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.agenda-weekdays span { text-align: center; }
.agenda-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px;
  gap: 5px;
  margin: 8px 0 4px;
  align-items: stretch;
}
.agenda-search-input {
  min-height: 32px;
  padding-inline: 8px;
  font-size: 11px;
}
#btn-agenda-clear-search {
  min-height: 32px;
  border-radius: 10px;
  font-size: 10px;
}
.agenda-search-results {
  display: grid;
  gap: 5px;
  margin-bottom: 6px;
}
.agenda-search-result {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(15,23,42,.28);
  color: var(--text);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.agenda-search-result:hover {
  border-color: rgba(59,130,246,.42);
  background: rgba(30,41,59,.52);
  transform: translateY(-1px);
}
.agenda-search-result-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.agenda-search-result-main strong {
  font-size: 11px;
  color: var(--text);
}
.agenda-search-result-main span {
  font-size: 10px;
  color: var(--muted);
}
.agenda-search-result-open {
  color: #93c5fd;
  font-size: 10px;
  white-space: nowrap;
}
.agenda-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}
.agenda-day {
  min-height: 46px;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 10px;
  background: rgba(15,23,42,.28);
  color: var(--text);
  padding: 4px 3px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.agenda-day:hover {
  transform: translateY(-1px);
  border-color: rgba(59,130,246,.42);
  background: rgba(30,41,59,.54);
}
.agenda-day.is-outside { opacity: .46; }
.agenda-day.is-selected {
  border-color: rgba(96,165,250,.78);
  background: rgba(30,64,175,.18);
  box-shadow: inset 0 0 0 1px rgba(96,165,250,.25);
}
.agenda-day.is-today .agenda-day-number {
  background: rgba(14,165,233,.18);
  color: #bae6fd;
}
.agenda-day-number {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 10px;
}
.agenda-day-events {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 3px;
  min-height: 8px;
  align-items: center;
  overflow: hidden;
}
.agenda-day-pill,
.agenda-day-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  border-radius: 999px;
  padding: 0;
  font-size: 8px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agenda-day-pill {
  width: 6px;
  height: 6px;
  background: rgba(96,165,250,.92);
  color: transparent;
  font-size: 0;
}
.agenda-day-more {
  color: var(--muted);
  font-size: 7px;
}
.agenda-day-empty {
  height: 6px;
  display: block;
}
.agenda-form {
  display: grid;
  gap: 12px;
}
.agenda-panel .modal-input,
.agenda-panel .settings-select,
.agenda-panel .modal-textarea,
.agenda-modal-box .modal-input,
.agenda-modal-box .settings-select,
.agenda-modal-box .modal-textarea {
  border-radius: 14px;
  border: 1px solid rgba(96,165,250,.18);
  background:
    linear-gradient(180deg, rgba(15,23,42,.82), rgba(15,23,42,.64));
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.03),
    0 8px 22px rgba(15,23,42,.12);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.agenda-panel .modal-input:hover,
.agenda-panel .settings-select:hover,
.agenda-panel .modal-textarea:hover,
.agenda-modal-box .modal-input:hover,
.agenda-modal-box .settings-select:hover,
.agenda-modal-box .modal-textarea:hover {
  border-color: rgba(96,165,250,.34);
}
.agenda-panel .modal-input:focus,
.agenda-panel .settings-select:focus,
.agenda-panel .modal-textarea:focus,
.agenda-modal-box .modal-input:focus,
.agenda-modal-box .settings-select:focus,
.agenda-modal-box .modal-textarea:focus {
  border-color: rgba(96,165,250,.72);
  box-shadow:
    0 0 0 4px rgba(59,130,246,.12),
    0 14px 28px rgba(15,23,42,.16);
  transform: translateY(-1px);
}
.agenda-panel .settings-select {
  appearance: none;
  background-image:
    linear-gradient(180deg, rgba(15,23,42,.82), rgba(15,23,42,.64)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, calc(100% - 12px) 50%;
  background-size: auto, 14px 14px;
  padding-right: 36px;
}
.agenda-modal-box .settings-select {
  appearance: none;
  background-image:
    linear-gradient(180deg, rgba(15,23,42,.82), rgba(15,23,42,.64)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, calc(100% - 12px) 50%;
  background-size: auto, 14px 14px;
  padding-right: 36px;
}
.agenda-panel .settings-select option {
  background: #0f172a;
  color: #e2e8f0;
}
.agenda-modal-box .settings-select option {
  background: #0f172a;
  color: #e2e8f0;
}
.agenda-panel .modal-input[type="datetime-local"],
.agenda-modal-box .modal-input[type="datetime-local"],
.agenda-panel .settings-select,
.agenda-modal-box .settings-select {
  color-scheme: dark;
}
.agenda-panel .modal-input[type="datetime-local"],
.agenda-modal-box .modal-input[type="datetime-local"] {
  min-height: 48px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding-right: 12px;
  background-clip: padding-box;
  cursor: pointer;
  overflow: hidden;
}
.agenda-panel .modal-input[type="datetime-local"]::-webkit-date-and-time-value,
.agenda-modal-box .modal-input[type="datetime-local"]::-webkit-date-and-time-value {
  text-align: left;
  color: inherit;
  min-width: 0;
}
.agenda-panel .modal-input[type="datetime-local"]::-webkit-datetime-edit,
.agenda-modal-box .modal-input[type="datetime-local"]::-webkit-datetime-edit,
.agenda-panel .modal-input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper,
.agenda-modal-box .modal-input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper,
.agenda-panel .modal-input[type="datetime-local"]::-webkit-datetime-edit-text,
.agenda-modal-box .modal-input[type="datetime-local"]::-webkit-datetime-edit-text,
.agenda-panel .modal-input[type="datetime-local"]::-webkit-datetime-edit-minute-field,
.agenda-modal-box .modal-input[type="datetime-local"]::-webkit-datetime-edit-minute-field,
.agenda-panel .modal-input[type="datetime-local"]::-webkit-datetime-edit-hour-field,
.agenda-modal-box .modal-input[type="datetime-local"]::-webkit-datetime-edit-hour-field,
.agenda-panel .modal-input[type="datetime-local"]::-webkit-datetime-edit-day-field,
.agenda-modal-box .modal-input[type="datetime-local"]::-webkit-datetime-edit-day-field,
.agenda-panel .modal-input[type="datetime-local"]::-webkit-datetime-edit-month-field,
.agenda-modal-box .modal-input[type="datetime-local"]::-webkit-datetime-edit-month-field,
.agenda-panel .modal-input[type="datetime-local"]::-webkit-datetime-edit-year-field,
.agenda-modal-box .modal-input[type="datetime-local"]::-webkit-datetime-edit-year-field {
  color: inherit;
  background: transparent;
  min-width: 0;
}
.agenda-panel .modal-input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  opacity: .9;
  cursor: pointer;
  filter: invert(85%) sepia(13%) saturate(244%) hue-rotate(182deg) brightness(97%) contrast(90%);
}
.agenda-modal-box .modal-input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  opacity: .9;
  cursor: pointer;
  filter: invert(85%) sepia(13%) saturate(244%) hue-rotate(182deg) brightness(97%) contrast(90%);
}
.agenda-modal-box {
  max-width: 980px;
}
.agenda-modal-content {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: start;
}
.agenda-modal-day-card,
.agenda-modal-form-card {
  height: 100%;
}
.agenda-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.agenda-form-row-compact { align-items: end; }
.agenda-textarea { min-height: 84px; }
.agenda-notify-toggle {
  height: 100%;
  min-height: 44px;
}
.agenda-form-actions {
  display: flex;
  justify-content: flex-end;
}
.agenda-events-list,
.agenda-upcoming-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.agenda-event-card,
.agenda-upcoming-item {
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 14px;
  background: rgba(15,23,42,.22);
}
.agenda-event-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
}
.agenda-event-main { min-width: 0; }
.agenda-event-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.agenda-event-head strong {
  font-size: 14px;
  color: var(--text);
}
.agenda-event-time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.agenda-event-description {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.agenda-event-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.agenda-event-badge {
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(51,65,85,.65);
  color: var(--text);
  font-size: 11px;
}
.agenda-event-badge.muted { color: var(--muted); }
.agenda-event-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.agenda-upcoming-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.agenda-upcoming-item:hover {
  transform: translateY(-1px);
  border-color: rgba(59,130,246,.42);
  background: rgba(30,41,59,.38);
}
.agenda-upcoming-item strong {
  display: block;
  font-size: 13px;
  color: var(--text);
}
.agenda-upcoming-date {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}
.agenda-upcoming-arrow { color: var(--muted); }

@media (max-width: 1100px) {
  .agenda-modal-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  #panel-agenda .panel-inner {
    padding: 12px;
  }
  .agenda-panel {
    gap: 12px;
    min-width: 0;
  }
  #panel-agenda .section-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .agenda-head-actions,
  .agenda-month-bar,
  .agenda-card-head {
    flex-direction: column;
    align-items: stretch;
  }
  .agenda-head-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .agenda-head-actions .ghost.small {
    width: 100%;
    min-height: 40px;
  }
  .agenda-calendar-card {
    max-width: none;
    width: 100%;
    padding: 12px;
    border-radius: 16px;
    margin-inline: 0;
  }
  .agenda-month-bar {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    align-items: center;
    gap: 8px;
  }
  .agenda-month-bar .ghost.small {
    min-width: 40px;
    min-height: 40px;
  }
  .agenda-month-label {
    text-align: center;
    font-size: 15px;
    line-height: 1.3;
    min-width: 0;
  }
  .agenda-search-row,
  .agenda-form-row {
    grid-template-columns: 1fr;
  }
  .agenda-search-row {
    gap: 8px;
    margin: 10px 0 8px;
  }
  .agenda-search-input,
  #btn-agenda-clear-search {
    min-height: 42px;
    font-size: 16px;
  }
  .agenda-weekdays {
    gap: 4px;
    margin: 12px 0 8px;
    font-size: 10px;
  }
  .agenda-calendar-grid {
    gap: 4px;
  }
  .agenda-day {
    min-height: 72px;
    padding: 6px 4px;
    border-radius: 12px;
    gap: 4px;
    overflow: hidden;
  }
  .agenda-day-number {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  .agenda-day-events {
    display: grid;
    gap: 4px;
    width: 100%;
    min-height: 0;
    align-content: start;
  }
  .agenda-day-pill {
    width: 100%;
    height: auto;
    padding: 3px 6px;
    border-radius: 999px;
    justify-content: flex-start;
    background: rgba(59,130,246,.16);
    color: #dbeafe;
    font-size: 9px;
  }
  .agenda-day-more {
    font-size: 9px;
    justify-content: flex-start;
  }
  .agenda-search-results {
    gap: 8px;
  }
  .agenda-modal-box {
    padding: 14px;
    width: min(100%, calc(100vw - 16px));
    max-width: min(100%, calc(100vw - 16px));
    max-height: calc(100dvh - 16px);
    overflow: hidden;
  }
  .agenda-modal-content {
    grid-template-columns: 1fr;
    gap: 12px;
    overflow-y: auto;
    padding-right: 2px;
  }
  .agenda-modal-day-card,
  .agenda-modal-form-card,
  .agenda-card,
  .agenda-event-main {
    min-width: 0;
  }
  .agenda-panel .modal-input[type="datetime-local"],
  .agenda-modal-box .modal-input[type="datetime-local"],
  .agenda-panel .settings-select,
  .agenda-modal-box .settings-select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .agenda-panel .modal-input[type="datetime-local"],
  .agenda-modal-box .modal-input[type="datetime-local"] {
    padding-inline: 8px;
    padding-right: 8px;
    font-size: 15px;
    letter-spacing: -.01em;
  }
  .agenda-form-row .modal-field {
    min-width: 0;
    overflow: hidden;
  }
  #agenda-selected-label,
  #agenda-form-title-label,
  .agenda-event-head strong,
  .agenda-search-result-main strong {
    overflow-wrap: anywhere;
  }
  #btn-agenda-clear-search {
    width: 100%;
  }
  .agenda-event-card {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 8px;
  }
  .agenda-event-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .agenda-event-time {
    white-space: normal;
  }
  .agenda-event-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .agenda-event-actions .ghost.small,
  .agenda-event-actions .danger-ghost {
    width: 100%;
  }
  .agenda-form-actions {
    justify-content: stretch;
  }
  .agenda-form-actions .primary.small {
    width: 100%;
    min-height: 42px;
  }
}

@media (max-width: 560px) {
  .agenda-head-actions {
    grid-template-columns: 1fr;
  }
  .agenda-month-label {
    font-size: 14px;
  }
  .agenda-weekdays {
    font-size: 9px;
  }
  .agenda-day {
    min-height: 64px;
  }
  .agenda-day-pill {
    font-size: 8px;
    padding: 2px 5px;
  }
}
body.theme-light .agenda-calendar-card,
body.theme-light .agenda-card {
  background: rgba(255,255,255,.92);
  border-color: rgba(100,116,139,.18);
  box-shadow: 0 20px 40px rgba(148,163,184,.16);
}
body.theme-light .agenda-day {
  background: rgba(248,250,252,.95);
  border-color: rgba(100,116,139,.16);
}
body.theme-light .agenda-day:hover {
  background: rgba(241,245,249,1);
}
body.theme-light .agenda-search-result {
  background: rgba(248,250,252,.95);
  border-color: rgba(100,116,139,.16);
}
body.theme-light .agenda-day.is-selected {
  background: rgba(37,99,235,.08);
}
body.theme-light .agenda-day-pill {
  background: rgba(37,99,235,.1);
  color: #1d4ed8;
}
body.theme-light .agenda-event-card,
body.theme-light .agenda-upcoming-item {
  background: rgba(248,250,252,.95);
  border-color: rgba(100,116,139,.15);
}
body.theme-light .agenda-panel .modal-input,
body.theme-light .agenda-panel .settings-select,
body.theme-light .agenda-panel .modal-textarea,
body.theme-light .agenda-modal-box .modal-input,
body.theme-light .agenda-modal-box .settings-select,
body.theme-light .agenda-modal-box .modal-textarea {
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96));
  border-color: rgba(148,163,184,.28);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.8),
    0 10px 24px rgba(148,163,184,.12);
}
body.theme-light .agenda-panel .modal-input[type="datetime-local"],
body.theme-light .agenda-modal-box .modal-input[type="datetime-local"],
body.theme-light .agenda-panel .settings-select,
body.theme-light .agenda-modal-box .settings-select {
  color-scheme: light;
}
body.theme-light .agenda-panel .settings-select {
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
body.theme-light .agenda-modal-box .settings-select {
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
body.theme-light .agenda-panel .settings-select option {
  background: #ffffff;
  color: #0f172a;
}
body.theme-light .agenda-modal-box .settings-select option {
  background: #ffffff;
  color: #0f172a;
}
body.theme-light .agenda-panel .modal-input[type="datetime-local"]::-webkit-calendar-picker-indicator,
body.theme-light .agenda-modal-box .modal-input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(30%) sepia(9%) saturate(905%) hue-rotate(175deg) brightness(96%) contrast(87%);
}


.confirm-modal-box { max-width: 360px; }
.confirm-modal-content { justify-content: center; text-align: center; padding: 4px 4px 0; font-size: .92rem; }
.confirm-modal-content span { margin: 0; }
.confirm-modal-box .modal-actions { justify-content: center; }
body.theme-light .confirm-modal-content { color: #475569; }

/* ── Lecteur vidéo inline ───────────────────────────────────────── */
.media-container {
  position: relative;
  width: min(145px, 100%);
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
}
.media-container:hover .media-btn-bar {
  opacity: 1;
}
.player-thumbnail,
.music-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}
.music-video {
  aspect-ratio: unset;
  object-fit: contain;
  background: #000;
}
/* Mode vidéo : ratio 16/9 */
.media-container.video-mode {
  aspect-ratio: 16 / 9;
  cursor: default;
}
/* Mode étendu (chat masqué) */
.workspace.chat-hidden .media-container.video-mode {
  aspect-ratio: 16 / 9;
  max-height: 340px;
}
/* Mode grand panneau */
.media-container.video-expanded {
  aspect-ratio: 16 / 9;
  width: 100%;
  max-height: 480px;
}
.media-btn-bar {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .2s;
  z-index: 10;
}
.media-btn {
  background: rgba(0,0,0,.65);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  color: #fff;
  font-size: .8rem;
  padding: 4px 8px;
  cursor: pointer;
  transition: background .15s;
  line-height: 1;
}
.media-btn:hover {
  background: rgba(0,0,0,.9);
}
/* Effet hover supprimé sur la vignette musique */

/* Sécurité : vidéo cachée par défaut, visible seulement en mode vidéo */
.music-video {
  display: none !important;
  visibility: hidden;
}
.media-container.video-mode .music-video {
  display: block !important;
  visibility: visible;
}
.media-container.video-mode .player-thumbnail {
  display: none !important;
  visibility: hidden;
}

/* ── Vidéo agrandie quand le chat est masqué ──────────────────────── */
/* Overlay sombre plein écran derrière la vidéo */
.video-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 198;
}
.video-overlay.active { display: block; }

.media-container.video-mode.video-chat-hidden {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(88vw, calc(80vh * 16 / 9));
  aspect-ratio: 16 / 9;
  max-height: 85vh;
  z-index: 199;
  border-radius: 14px;
  box-shadow: 0 12px 60px rgba(0,0,0,.8);
}

/* ── Playlists popup ────────────────────────────────────────────── */
.playlist-head-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.playlist-modal-box {
  max-width: 980px;
  min-height: min(80vh, 720px);
}

.playlist-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.playlist-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
}

.playlist-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.playlist-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.playlist-inline-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.playlist-search-input {
  flex: 1 1 220px;
  min-width: 180px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(15,23,42,.55);
  color: var(--text);
}

.playlist-search-input:focus {
  outline: none;
  border-color: rgba(59,130,246,.55);
}

.playlist-list,
.playlist-track-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 140px;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 4px;
}

.playlist-item {
  text-align: left;
  background: rgba(15,23,42,.55);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  cursor: pointer;
  transition: background .18s, border-color .18s, transform .12s;
}

.playlist-item:hover {
  background: rgba(30,41,59,.85);
  border-color: rgba(59,130,246,.4);
  transform: translateY(-1px);
}

.playlist-item.is-active {
  background: rgba(37,99,235,.18);
  border-color: rgba(59,130,246,.55);
}

.playlist-item.is-archived {
  border-color: rgba(245,158,11,.25);
  background: rgba(120,53,15,.15);
}

.playlist-item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.playlist-item-name {
  font-weight: 700;
}

.playlist-item-meta {
  display: block;
  margin-top: 4px;
  font-size: .74rem;
  color: var(--muted);
}

.playlist-badge {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(37,99,235,.18);
  border: 1px solid rgba(59,130,246,.45);
  color: #dbeafe;
  font-weight: 700;
  font-size: .8rem;
}

.playlist-track-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15,23,42,.62);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.playlist-track-item:not(.is-archived):hover {
  background: rgba(37,99,235,.1);
  border-color: rgba(99,130,180,.35);
}

.playlist-track-item.is-archived {
  border-color: rgba(245,158,11,.25);
  background: rgba(120,53,15,.15);
  cursor: default;
}

.playlist-track-thumb {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.playlist-track-thumb-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37,99,235,.22);
  color: #dbeafe;
  font-size: .82rem;
  border-radius: 6px;
  flex-shrink: 0;
}

.playlist-track-play-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(99,130,180,.3);
  background: rgba(37,99,235,.18);
  color: #93c5fd;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  flex-shrink: 0;
  transition: background .15s, transform .1s;
}

.playlist-track-play-btn:hover {
  background: rgba(37,99,235,.38);
  transform: scale(1.1);
}

.playlist-track-main {
  flex: 1;
  min-width: 0;
}

.playlist-track-title {
  font-weight: 700;
  margin-bottom: 3px;
  font-size: .9rem;
}

.playlist-track-meta {
  font-size: .74rem;
  color: var(--muted);
  word-break: break-all;
}

.playlist-track-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.playlist-empty-state {
  padding: 20px 14px;
  text-align: center;
  color: var(--muted);
  background: rgba(15,23,42,.32);
  border-radius: 14px;
  font-size: .88rem;
}

@media (max-width: 900px) {
  .playlist-grid {
    grid-template-columns: 1fr;
  }

  .playlist-modal-box {
    max-width: 100%;
    min-height: 0;
  }

  .playlist-list,
  .playlist-track-list {
    max-height: 30vh;
  }
}

#playlist-popup {
  z-index: 8050;
}

#note-edit-modal,
#due-date-modal,
#confirm-modal {
  z-index: 8100;
}

#playlist-popup.playlist-popup-under-modal {
  pointer-events: none;
}

/* ── Weather Panel ──────────────────────────────────────────────────────────── */
.weather-current {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1rem;
  background: var(--surface2);
  border-radius: var(--radius);
  margin-bottom: .75rem;
}

.weather-current-top {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.weather-big-emoji {
  font-size: 3rem;
  line-height: 1;
  flex-shrink: 0;
}

.weather-current-temps {
  display: flex;
  flex-direction: column;
}

.weather-temp {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}

.weather-feels {
  font-size: .8rem;
  color: var(--text2);
  margin-top: .2rem;
}

.weather-current-label {
  font-size: .95rem;
  color: var(--text2);
  text-transform: capitalize;
}

.weather-current-details {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.weather-detail-pill {
  font-size: .8rem;
  padding: .2rem .55rem;
  background: var(--surface3);
  border-radius: 999px;
  color: var(--text2);
}

/* ── 7-day forecast strip ──────────────────────────────────────────────────── */
.weather-forecast-strip {
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  padding-bottom: .25rem;
  margin-bottom: .75rem;
  scrollbar-width: thin;
}

.wfc-card {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  padding: .5rem .45rem;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px solid transparent;
  min-width: 56px;
  font-size: .75rem;
  color: var(--text2);
}

.wfc-card.wfc-today {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface2));
}

.wfc-day {
  font-size: .7rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.wfc-emoji {
  font-size: 1.3rem;
  line-height: 1;
}

.wfc-label {
  font-size: .65rem;
  color: var(--text3, var(--text2));
  text-align: center;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wfc-temps {
  display: flex;
  gap: .3rem;
  align-items: baseline;
}

.wfc-max {
  font-weight: 700;
  color: var(--text);
}

.wfc-min {
  color: var(--text2);
}

.wfc-rain {
  font-size: .65rem;
  color: #60a5fa;
}

/* ── City search row ──────────────────────────────────────────────────────── */
.weather-search-row {
  display: flex;
  gap: .4rem;
  align-items: center;
}

.weather-search-row .notes-search-input {
  flex: 1;
}

/* Light theme overrides */
body.theme-light .weather-current,
body.theme-light .wfc-card {
  background: rgba(241,245,249,1);
}

body.theme-light .weather-detail-pill {
  background: rgba(226,232,240,1);
}

body.theme-light .wfc-card.wfc-today {
  background: color-mix(in srgb, var(--accent) 12%, #fff);
}

/* ═══════════════════════════════════════════════════════════════════
   Feature additions: todos tags, due dates, timer, drag-drop, health, music
   ═══════════════════════════════════════════════════════════════════ */

/* ── Timer display ─────────────────────────────────────────────── */
.timer-display {
  font-size: .95rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 999px;
  padding: 6px 14px;
  letter-spacing: .04em;
  animation: timer-pulse 1s ease-in-out infinite;
}
@keyframes timer-pulse { 0%,100%{opacity:1} 50%{opacity:.7} }

/* ── Todo due date ─────────────────────────────────────────────── */
.todo-due-date {
  font-size: .75rem;
  color: var(--muted);
  margin-left: 0;
}
.todo-due-date.overdue {
  color: #f87171;
  font-weight: 600;
}
.todo-item.todo-overdue .note-title {
  color: #f87171;
}

/* ── Drag and drop ─────────────────────────────────────────────── */
.note-item[draggable], .todo-item[draggable] {
  cursor: grab;
}
.note-item.dragging, .todo-item.dragging {
  opacity: 0.45;
  cursor: grabbing;
}
.note-item.drag-over, .todo-item.drag-over {
  border-color: rgba(59, 130, 246, 0.7) !important;
  background: rgba(37, 99, 235, 0.08) !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* ── Lyrics panel ──────────────────────────────────────────────── */
.music-lyrics-panel {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,.18);
  max-height: 320px;
  overflow-y: auto;
  padding: 12px 14px;
  font-size: .85rem;
  line-height: 1.7;
}

.lyrics-loading {
  color: var(--muted);
  font-style: italic;
  text-align: center;
  padding: 12px 0;
}

.lyrics-empty {
  color: var(--muted);
  text-align: center;
  padding: 12px 0;
  font-size: .82rem;
}

.lyrics-header {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: .8rem;
}

.lyrics-artist {
  font-weight: 700;
  color: var(--text);
}

.lyrics-sep {
  color: var(--muted);
}

.lyrics-song {
  color: var(--muted);
  font-style: italic;
}

.lyrics-body {
  white-space: pre-wrap;
  color: #dbe7f5;
  line-height: 1.75;
}

body.theme-light .music-lyrics-panel {
  background: rgba(241,245,249,.8);
}
body.theme-light .lyrics-body {
  color: #1e293b;
}

/* ── Music queue / history ─────────────────────────────────────── */
.music-section-toggle {
  margin-top: 8px;
}
.transport-card + .music-lyrics-panel + .music-section-toggle,
.transport-card + .music-section-toggle {
  margin-top: 18px;
}
.music-queue-list {
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-height: 200px;
  overflow-y: auto;
  background: rgba(0,0,0,.12);
}
.queue-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: .82rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  transition: background .15s;
}
.queue-item:last-child { border-bottom: none; }
.queue-item-clickable {
  cursor: pointer;
}
.queue-item-clickable:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--text);
}
.queue-item-active {
  background: rgba(37, 99, 235, 0.14);
  color: #93c5fd;
  font-weight: 600;
}
.queue-item-active:hover {
  background: rgba(37, 99, 235, 0.22);
}
.queue-item-index {
  min-width: 18px;
  text-align: right;
  font-size: .72rem;
  color: var(--muted);
  flex-shrink: 0;
}
.queue-item-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.queue-item-playing {
  font-size: .65rem;
  color: #60a5fa;
  flex-shrink: 0;
}
.queue-item-date {
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.queue-item-thumb {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  opacity: .85;
}

/* ── Health dashboard ──────────────────────────────────────────── */
.health-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.health-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.health-card-label {
  font-size: .75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}
.health-card-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #7dd3fc;
  line-height: 1.1;
}
.health-card-sub {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 2px;
}

body.theme-light .health-card {
  background: rgba(241, 245, 249, 0.9);
  border-color: rgba(71, 85, 105, 0.15);
}
body.theme-light .health-card-value { color: #1d4ed8; }

/* ── Import notes modal ────────────────────────────────────────── */
#import-notes-modal .modal-box {
  max-width: 520px;
}

/* ── Toast reminder ────────────────────────────────────────────── */
.toast.toast-reminder {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(30, 41, 59, 0.96);
}

/* ── Topbar droite ──────────────────────────────────────────────── */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}
.topbar-status {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* garde la compatibilité si .topbar-actions existe encore ailleurs */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── User menu (trigger + dropdown) ────────────────────────────── */
.user-menu-wrapper {
  position: relative;
}
.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text);
  max-width: 200px;
  position: relative;
}
.user-menu-trigger:hover { background: rgba(148,163,184,0.1); }
.user-menu-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(37,99,235,0.3);
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth-user-name {
  font-size: 12px;
  color: var(--muted);
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-arrow {
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
}
.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  background: var(--panel-2);
  border: 1px solid var(--line-s);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 1200;
  overflow: hidden;
}

/* User head section */
.umenu-user-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 10px;
}
.umenu-avatar-lg {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(37,99,235,0.3);
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.umenu-user-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.umenu-user-info strong {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.umenu-username {
  font-size: 11px;
  color: var(--muted);
}
.umenu-divider {
  height: 1px;
  background: var(--line);
  margin: 0;
}

/* Status row inside menu */
.umenu-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  gap: 8px;
}
.umenu-status-row .status-pill {
  font-size: 11px;
}
.live-clock {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Notifications inside menu */
.umenu-notif-section {
  display: flex;
  flex-direction: column;
  max-height: 280px;
}
.umenu-notif-section .notif-header {
  padding: 8px 12px;
}
.umenu-notif-section .notif-list {
  overflow-y: auto;
  max-height: 220px;
  flex: 1;
}

/* Logout button */
.umenu-logout {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border-radius: 0;
  font-size: 12px;
  color: var(--muted);
}
.umenu-logout:hover { background: rgba(239,68,68,0.08); color: #f87171; }

/* ── Notification bell ─────────────────────────────────────────── */
.notif-wrapper {
  position: relative;
}
.notif-bell {
  position: relative;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.notif-bell:hover,
.notif-bell.has-unread { color: var(--text); }
.notif-bell.has-unread svg { color: #f59e0b; }
.notif-badge {
  min-width: 16px;
  height: 16px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
  flex-shrink: 0;
}
.notif-wrapper .notif-badge {
  position: absolute;
  top: 2px;
  right: 0;
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 420px;
  background: var(--panel-2);
  border: 1px solid var(--line-s);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.notif-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.notif-actions-head { display: flex; gap: 4px; }
.notif-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 4px 0;
}
.notif-empty {
  padding: 20px 16px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 6px;
  margin: 2px 4px;
}
.notif-item:hover { background: rgba(148, 163, 184, 0.08); }
.notif-item.notif-unread { background: rgba(37, 99, 235, 0.06); }
.notif-item.notif-unread .notif-message { color: var(--text); font-weight: 500; }
.notif-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.notif-body { flex: 1; min-width: 0; }
.notif-message { font-size: 12.5px; line-height: 1.4; color: var(--muted); margin: 0; word-break: break-word; }
.notif-time { font-size: 10px; color: rgba(148,163,184,0.55); display: block; margin-top: 2px; }
.notif-delete {
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
  font-size: 10px;
  width: 18px;
  height: 18px;
  padding: 0;
}
.notif-item:hover .notif-delete { opacity: 1; }

/* ── Auth area ─────────────────────────────────────────────────── */
.auth-btn { font-size: 11px; white-space: nowrap; }
.auth-modal-box { max-width: 360px; }

/* ── Lockscreen (fond flou quand non connecté) ──────────────────── */
.auth-lockscreen {
  position: fixed;
  inset: 0;
  z-index: 1100;
  backdrop-filter: blur(12px) brightness(0.4);
  -webkit-backdrop-filter: blur(12px) brightness(0.4);
  background: rgba(7, 11, 20, 0.55);
  pointer-events: all;
}
body.auth-locked #auth-modal {
  z-index: 1200;
}
.auth-error {
  color: #f87171;
  font-size: 12px;
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 6px;
}

/* Topbar light theme adjustments */
body.theme-light .notif-bell { color: #64748b; }
body.theme-light .notif-bell.has-unread { color: #1e293b; }
body.theme-light .notif-dropdown { background: #fff; border-color: rgba(100,116,139,0.2); }
body.theme-light .notif-item.notif-unread { background: rgba(37,99,235,0.05); }
body.theme-light .auth-user-name { color: #64748b; }

/* ── User management panel ──────────────────────────────────────── */
.users-toolbar {
  margin-bottom: 14px;
}
.users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: background 0.15s;
}
.user-card:hover { background: rgba(148, 163, 184, 0.09); }
.user-card-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-card-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.25);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-card-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.user-card-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-card-login { font-size: 11px; color: var(--muted); }
.user-card-tags { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.user-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 1px 6px;
  border-radius: 99px;
}
.user-tag-admin { background: rgba(37,99,235,0.15); color: #60a5fa; }
.user-tag-user  { background: rgba(148,163,184,0.12); color: var(--muted); }
.user-tag-me    { background: rgba(16,185,129,0.15); color: #34d399; }
.user-card-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* User modal */
.user-modal-box { max-width: 400px; }
.modal-field-hint {
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 6px;
}

/* Rail admin button styling */
.rail-btn-admin { opacity: 0.85; }
.rail-btn-admin:hover { opacity: 1; }

/* Light theme */
body.theme-light .user-card { background: rgba(100,116,139,0.05); }
body.theme-light .user-card:hover { background: rgba(100,116,139,0.09); }
body.theme-light .user-card-avatar { background: rgba(37,99,235,0.1); }
body.theme-light .user-tag-admin { background: rgba(37,99,235,0.1); color: #2563eb; }
body.theme-light .user-tag-me    { background: rgba(16,185,129,0.1); color: #059669; }
