/* Harmonise le studio sombre avec la palette satinée générale sans perdre son contraste vidéo. */
html body #appDialog.analysis-mode {
  background: #09120e !important;
}

html body #appDialog.analysis-mode .studio-main,
html body #appDialog.analysis-mode .video-mock {
  background: #07100c !important;
}

html body #appDialog.analysis-mode.course-outline-open:not(.editing-cut) .spot-list,
html body #appDialog.analysis-mode .spot-list #savedSpots {
  background: #17221c !important;
  color: #f6f0e4 !important;
  border-color: #526156 !important;
}

html body #appDialog.analysis-mode .spot-list .spot {
  color: #f8f2e7 !important;
  border-color: #46554b !important;
  background: #202c25 !important;
}

html body #appDialog.analysis-mode .spot-list .spot.active {
  border-color: #c49a56 !important;
  background: #29372f !important;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .24) !important;
}

html body #appDialog.analysis-mode .spot-list-head > div small,
html body #appDialog.analysis-mode .spot-list .spot small,
html body #appDialog.analysis-mode .spot-list .spot em {
  color: #d8c7a7 !important;
}

html body #appDialog.analysis-mode.editing-cut .question-builder:not([hidden]) {
  background: #f3f2ed !important;
  color: #17241e !important;
  border-left: 1px solid #d5c6a9 !important;
}

label.icon-composer-button[for="studentChatAttachment"] {
  font-size: 0 !important;
}

label.icon-composer-button[for="studentChatAttachment"]::before {
  content: "📎";
  font-size: 18px;
}

.send-message-button,
#studentChatForm .primary {
  font-weight: 800 !important;
}

#studentChatForm .primary::before {
  content: "➤ ";
}

/* Mise en page centrée et respirante sur toutes les vues. */
main,
.student-main {
  box-sizing: border-box !important;
  padding-left: clamp(28px, 4vw, 72px) !important;
  padding-right: clamp(28px, 4vw, 72px) !important;
}

.view,
.student-main > section,
.student-main > .student-layout,
.student-topbar,
.topbar {
  width: 100% !important;
  max-width: 1540px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.student-corrected-library,
.upload-panel {
  padding: clamp(24px, 3vw, 44px) !important;
}

/* Comportement et ambiance visuelle proches de WhatsApp. */
.messages,
.student-chat-conversation > section {
  gap: 8px !important;
  background-color: #eef3ef !important;
  background-image: radial-gradient(circle at 20px 20px, rgba(48, 94, 69, .035) 1.5px, transparent 1.5px) !important;
  background-size: 32px 32px !important;
  padding: 24px 28px !important;
}

.message,
.student-chat-message {
  position: relative !important;
  max-width: min(72%, 760px) !important;
  padding: 10px 38px 9px 13px !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 2px rgba(21, 43, 31, .12) !important;
}

.message.theirs,
.student-chat-message.coach {
  border-top-left-radius: 3px !important;
  background: #fff !important;
}

.message.mine,
.student-chat-message.mine {
  margin-left: auto !important;
  border-top-right-radius: 3px !important;
  background: #d9fdd3 !important;
}

.message time,
.student-chat-message time {
  margin-top: 4px !important;
  text-align: right !important;
  font-size: 9px !important;
}

.delete-chat-message {
  opacity: 0;
  transition: opacity .15s;
}

.message:hover .delete-chat-message,
.student-chat-message:hover .delete-chat-message {
  opacity: 1;
}

.composer-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  border-top: 1px solid #d9e1dc;
  background: #f5f8f6;
  color: #263b30;
}

.composer-preview > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.composer-preview img {
  width: 68px;
  height: 58px;
  object-fit: cover;
  border-radius: 8px;
}

.composer-preview small,
.composer-preview strong {
  display: block;
}

.composer-preview small {
  color: #50806a;
  font-size: 9px;
  font-weight: 800;
}

.composer-preview strong {
  max-width: 560px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-preview audio {
  width: min(420px, 60vw);
}

.composer-preview > button {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid #d3ddd7;
  border-radius: 50%;
  background: #fff;
  color: #7e4a46;
  font-size: 20px;
}

@media (max-width: 760px) {
  main,
  .student-main { padding-left: 16px !important; padding-right: 16px !important; }
  .message,
  .student-chat-message { max-width: 88% !important; }
}

/* Bibliothèque de clips : finition produit, cohérente avec la messagerie. */
#appDialog:has(.clip-database) .dialog-card {
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid #cfdbd4 !important;
  border-radius: 22px !important;
}

.clip-database > header {
  margin: 0 !important;
  padding: 26px 30px 20px !important;
  background: linear-gradient(120deg, #f9fbfa, #edf4f0) !important;
  border-bottom: 1px solid #d8e2dc !important;
}

.clip-database > header small {
  color: #3b795b !important;
  font-weight: 900 !important;
  letter-spacing: 1.1px !important;
}

.clip-database > header h2 {
  margin: 5px 0 4px !important;
  font-size: 30px !important;
}

.clip-database > header p {
  color: #738079 !important;
}

.clip-review-tabs {
  display: flex !important;
  gap: 9px !important;
  padding: 18px 30px 0 !important;
}

.clip-review-tabs button {
  min-height: 42px !important;
  padding: 9px 17px !important;
  border: 1px solid #d5ddd8 !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #34463c !important;
  font-weight: 800 !important;
}

.clip-review-tabs button.active {
  background: linear-gradient(135deg, #4b9a66, #327750) !important;
  border-color: #5ca876 !important;
  color: #fff !important;
  box-shadow: 0 7px 17px rgba(48, 117, 77, .2) !important;
}

.clip-filter-bar {
  margin: 16px 30px !important;
  padding: 18px !important;
  border: 1px solid #d8e1dc !important;
  border-radius: 16px !important;
  background: #f7f9f8 !important;
  box-shadow: 0 10px 24px rgba(31, 61, 44, .06) !important;
}

.clip-filter-bar input,
.clip-filter-bar select,
.clip-filter-bar button {
  min-height: 44px !important;
  border-radius: 11px !important;
}

.clip-selection-actions button {
  background: #fff !important;
  border-color: #d5ddd8 !important;
}

.clip-training-launch {
  padding-top: 14px !important;
  border-top: 1px solid #dbe3de !important;
}

.clip-training-launch .primary,
#startClipQuiz {
  min-height: 48px !important;
  padding: 12px 20px !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #4da16b, #2d724d) !important;
  box-shadow: 0 9px 22px rgba(41, 111, 72, .22) !important;
}

.clip-database-count {
  padding: 0 30px 8px !important;
  color: #345d49 !important;
  font-size: 18px !important;
  font-weight: 800 !important;
}

.clip-database-grid {
  gap: 18px !important;
  padding: 0 30px 30px !important;
}

.clip-database-grid > article,
.clip-database-grid > div {
  overflow: hidden !important;
  border: 1px solid #d7e0db !important;
  border-radius: 17px !important;
  background: #fff !important;
  box-shadow: 0 12px 28px rgba(31, 57, 43, .08) !important;
  transition: transform .18s, box-shadow .18s, border-color .18s !important;
}

.clip-database-grid > article:hover,
.clip-database-grid > div:hover {
  transform: translateY(-3px) !important;
  border-color: #8fb7a1 !important;
  box-shadow: 0 18px 36px rgba(31, 73, 49, .14) !important;
}

.clip-database-grid video {
  display: block !important;
  width: 100% !important;
  border-radius: 13px !important;
  background: #08110c !important;
}

.clip-database-grid .tag,
.clip-database-grid [class*="review"] {
  border-radius: 999px !important;
}

/* Système commun à tous les formulaires et cartes coach/élève. */
.field,
.new-course-dialog > label,
.hand-data > label,
.hand-fields > label { gap: 8px !important; }

.field label,
.new-course-dialog label,
.hand-data label,
.question-builder label,
.course-picker > span {
  color: #4b715e !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: .75px !important;
  text-transform: uppercase !important;
}

.field input,
.field textarea,
.field select,
.new-course-dialog input,
.new-course-dialog select,
.hand-data input,
.hand-data select,
.question-builder input,
.question-builder textarea,
.question-builder select,
.course-picker select {
  min-height: 46px !important;
  padding: 11px 13px !important;
  border: 1px solid #d2ddd6 !important;
  border-radius: 11px !important;
  background: #fff !important;
  box-shadow: inset 0 1px 2px rgba(25, 51, 37, .035) !important;
  transition: border-color .15s, box-shadow .15s !important;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.new-course-dialog input:focus,
.hand-data input:focus,
.question-builder input:focus,
.question-builder textarea:focus,
.course-picker select:focus {
  outline: 0 !important;
  border-color: #69a181 !important;
  box-shadow: 0 0 0 4px rgba(78, 153, 103, .12) !important;
}

.capture-options { gap: 14px !important; }
.capture-card { min-height: 96px !important; padding: 17px !important; border-radius: 15px !important; transition: transform .18s, box-shadow .18s, border-color .18s !important; }
.capture-card:hover { transform: translateY(-2px) !important; border-color: #80ad95 !important; box-shadow: 0 15px 30px rgba(34, 77, 51, .12) !important; }
.capture-card .capture-icon { width: 44px !important; height: 44px !important; border-radius: 13px !important; }
.course-month-group { overflow: hidden !important; border-radius: 16px !important; }
.course-month-group > summary { padding: 18px 20px !important; background: linear-gradient(120deg, #f1f6f3, #f8faf9) !important; }
.student-corrected-course { margin: 0 !important; padding: 22px !important; border-width: 1px 0 0 !important; border-radius: 0 !important; }
.session-card,.student-card,.stat-card,.anki-card { transition: transform .18s, box-shadow .18s, border-color .18s !important; }
.session-card:hover,.student-card:hover,.stat-card:hover,.anki-card:hover { transform: translateY(-2px) !important; border-color: #8fb5a1 !important; box-shadow: 0 17px 34px rgba(32, 72, 48, .11) !important; }

/* Direction artistique finale : maîtrise, stratégie, accompagnement haut de gamme. */
:root {
  --bg: #efeee9 !important;
  --surface: #faf9f5 !important;
  --ink: #1d2832 !important;
  --muted: #68727a !important;
  --line: #d8d9d5 !important;
  --green: #253746 !important;
  --green-dark: #131e27 !important;
  --green-soft: #e5e9ec !important;
  --nav: #121c24 !important;
  --gold: #b56f4d !important;
}

html,
body,
.app-shell,
.student-app,
main,
.student-main {
  background: radial-gradient(circle at 84% 0, rgba(181, 111, 77, .055), transparent 30%), #efeee9 !important;
  color: #1d2832 !important;
}

body,
button,
input,
textarea,
select {
  font-family: "Segoe UI", Inter, Arial, sans-serif !important;
}

h1,h2,h3,h4,
.brand strong,
.section-heading h2,
.panel-head h3,
.conversation-head strong,
.student-chat-conversation > header h2 {
  font-family: Georgia, "Times New Roman", serif !important;
  color: #18232d !important;
  letter-spacing: -.018em !important;
}

.sidebar,
.student-sidebar,
.chat-list,
.student-chat-list {
  background: linear-gradient(175deg, #1a2833, #101920) !important;
  border-color: #344550 !important;
}

.sidebar .nav-item:hover,
.sidebar .nav-item.active,
.student-sidebar nav button:hover,
.student-sidebar nav button.active {
  background: rgba(181, 111, 77, .16) !important;
  border-color: #a86849 !important;
}

.brand-mark,
.student-chat-brand > span {
  color: #b97856 !important;
}

.brand small,
.student-chat-brand small {
  color: #c7b2a7 !important;
}

.panel,
.stat-card,
.session-card,
.student-card,
.card-summary > div,
.finance-hero > div,
.anki-card,
.upload-panel,
.student-corrected-library,
.course-month-group,
.course-month-content,
.course-editor,
.clip-database,
.video-library,
.hand-analyzer,
.student-replayers,
.student-corrected-course,
.capture-card,
.replayer-link-send,
.course-picker,
.dialog-card {
  background: #faf9f5 !important;
  border-color: #d8d9d5 !important;
  color: #1d2832 !important;
  box-shadow: 0 12px 30px rgba(22, 31, 38, .075) !important;
  border-radius: 13px !important;
}

.primary,
.hero-button,
.student-room-btn,
.premium-composer .primary,
.student-chat-conversation > form .primary,
#startClipQuiz {
  background: linear-gradient(135deg, #2e4352, #1b2d3a) !important;
  border-color: #415968 !important;
  color: #fff !important;
  box-shadow: 0 7px 16px rgba(23, 39, 51, .17) !important;
}

.primary:hover,
.hero-button:hover,
.student-room-btn:hover {
  transform: translateY(-1px) !important;
  background: linear-gradient(135deg, #b87452, #9c5a3d) !important;
  border-color: #c48768 !important;
}

.secondary,
.chip,
.icon-button,
.text-button,
.attachment-button {
  background: #f7f6f2 !important;
  border-color: #d7d8d4 !important;
  color: #2a3b48 !important;
}

.hero,
.student-hero {
  background: radial-gradient(circle at 82% 18%, rgba(181, 111, 77, .2), transparent 28%), linear-gradient(125deg, #1b2b37, #2c414f) !important;
  border-color: #6e5c52 !important;
}

.hero h2,.hero p,.student-hero h2,.student-hero p { color: #fff !important; }

input,
textarea,
select,
.field input,
.field textarea,
.field select,
.question-builder input,
.question-builder textarea,
.question-builder select {
  background: #fffefb !important;
  border-color: #d6d8d5 !important;
  color: #1f2c36 !important;
}

input:focus,
textarea:focus,
select:focus {
  outline: 0 !important;
  border-color: #b56f4d !important;
  box-shadow: 0 0 0 3px rgba(181, 111, 77, .12) !important;
}

.section-kicker,
.live-pill,
.field label,
.question-builder label,
.course-picker > span {
  color: #9b6044 !important;
  letter-spacing: .9px !important;
}

.chat-topic-tabs button:nth-child(1).active,
.student-chat-conversation > nav button:nth-child(1).active {
  background: #2d4351 !important;
  border-color: #455d6c !important;
}

.chat-topic-tabs button:nth-child(2).active,
.student-chat-conversation > nav button:nth-child(2).active {
  background: #e7edf2 !important;
  border-color: #cbd7e0 !important;
  color: #314d61 !important;
}

.chat-topic-tabs button:nth-child(3).active,
.student-chat-conversation > nav button:nth-child(3).active,
#addChatTopic {
  background: #f6eae4 !important;
  border-color: #e5c5b5 !important;
  color: #9c5637 !important;
}

.message.mine,
.student-chat-message.mine {
  background: #e1e8ec !important;
  border-color: #cad6dc !important;
}

.course-summary {
  background: #f2ece8 !important;
  border-color: #d8b7a7 !important;
  color: #684132 !important;
}

.clip-review-tabs button.active {
  background: #2b414f !important;
  border-color: #415967 !important;
}

.clip-database > header,
.course-month-group > summary {
  background: linear-gradient(120deg, #f5f4f0, #eceff0) !important;
}

.session-card:hover,.student-card:hover,.stat-card:hover,.anki-card:hover,.capture-card:hover,
.clip-database-grid > article:hover,.clip-database-grid > div:hover {
  border-color: #bf896f !important;
  box-shadow: 0 16px 32px rgba(38, 45, 50, .11) !important;
}

html body #appDialog.analysis-mode.editing-cut .question-builder input,
html body #appDialog.analysis-mode.editing-cut .question-builder textarea,
html body #appDialog.analysis-mode.editing-cut .question-builder select {
  background: #fcfcf8 !important;
  color: #17241e !important;
  border-color: #d8cbb4 !important;
}

html body #appDialog.analysis-mode.editing-cut #createSpot {
  background: #356f54 !important;
  color: #fff !important;
}

html body #appDialog.analysis-mode.editing-cut #deletePreparedCard {
  border-color: #a85145 !important;
  color: #8f352d !important;
  background: #fff8f4 !important;
}

html body #appDialog.analysis-mode.editing-cut #cancelPreparation {
  border-color: #c6a36a !important;
  color: #5a4523 !important;
  background: #f3ead9 !important;
}

/* Le chat élève reprend désormais la même composition premium que le chat coach. */
#appDialog.student-chat-mode .dialog-card {
  padding: 0 !important;
  background: #f3f2ed !important;
}

.student-chat {
  display: grid !important;
  grid-template-columns: 320px minmax(0, 1fr) !important;
  height: 100% !important;
  overflow: hidden !important;
}

.student-chat-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 18px;
  color: #f6f2e8;
  background: radial-gradient(circle at 25% 82%, rgba(202, 161, 78, .15), transparent 28%), linear-gradient(175deg, #174f3c, #0a392c) !important;
  border-right: 1px solid #5c796d;
}

.student-chat-brand,
.student-chat-person {
  display: flex;
  align-items: center;
  gap: 11px;
}

.student-chat-brand > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #fff7e5;
  background: linear-gradient(145deg, #d0aa61, #9b672c);
  font-size: 22px;
}

.student-chat-brand strong,
.student-chat-brand small,
.student-chat-person strong,
.student-chat-person small {
  display: block;
}

.student-chat-brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
}

.student-chat-brand small,
.student-chat-person small {
  margin-top: 3px;
  color: #cfddd7;
  font-size: 8px;
  letter-spacing: .6px;
}

.student-chat-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid #78998c;
  border-radius: 12px;
  color: #e3bd70;
  background: rgba(255, 255, 255, .08);
}

.student-chat-search input {
  width: 100%;
  padding: 0;
  border: 0 !important;
  outline: 0;
  color: #fff !important;
  background: transparent !important;
}

.student-chat-search input::placeholder { color: #d4ded9 !important; }

.student-chat-person {
  padding: 14px;
  border: 1px solid #c8a45e;
  border-radius: 12px;
  background: rgba(255, 255, 255, .13);
}

.student-chat-person div { flex: 1; }
.student-chat-person time { color: #c7d5cf; font-size: 9px; }

.student-chat-motto {
  margin-top: auto;
  padding: 18px 12px;
  border-top: 1px solid rgba(220, 187, 121, .32);
  color: #e3bd70;
  text-align: center;
}

.student-chat-motto > span { font-size: 34px; opacity: .38; }
.student-chat-motto p { color: #e7ded0; font: 12px/1.65 Georgia, serif; }

.student-chat-conversation {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #f3f2ed;
}

.student-chat-conversation > header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 14px;
  border-bottom: 1px solid #d4cfc3;
}

.student-chat-conversation > header h2 {
  margin: 4px 0 0;
  font-size: 24px;
}

.student-chat-conversation > header small { color: #3d765d; font-weight: 800; letter-spacing: .9px; }

.student-chat-conversation > nav {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  padding: 12px 24px;
  border-bottom: 1px solid #d4cfc3;
}

.student-chat-conversation > nav button {
  padding: 9px 14px;
  border: 1px solid #d0c8b9;
  border-radius: 999px;
  color: #38443d;
  background: #eae8e1;
  font-weight: 800;
}

.student-chat-conversation > nav button.active {
  color: #fff;
  border-color: #52846d;
  background: #2f7054;
}

.student-chat-conversation > section {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 28px;
  border: 0;
  border-radius: 0;
  background: radial-gradient(circle at 72% 0, rgba(93, 124, 106, .07), transparent 32%), #efeee9 !important;
}

.student-chat-conversation > form {
  display: flex !important;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 14px 18px;
  border-top: 1px solid #d4cfc3;
  background: #f7f6f1;
}

.student-chat-conversation > form #studentChatInput {
  height: 48px !important;
  background: #fcfcf8 !important;
  border-color: #d1cabc !important;
}

@media (max-width: 760px) {
  .student-chat { grid-template-columns: 1fr !important; }
  .student-chat-list { display: none; }
  .student-chat-conversation > header { padding: 14px; }
  .student-chat-conversation > nav { padding: 10px 14px; overflow-x: auto; }
  .student-chat-conversation > section { padding: 16px; }
}

/* Identité globale : mêmes matières et contrastes que la bibliothèque vidéo. */
:root {
  --bg: #e8e9e4 !important;
  --surface: #f5f5f0 !important;
  --ink: #17211c !important;
  --muted: #69726c !important;
  --line: #cbd0c8 !important;
  --green: #235f47 !important;
  --green-dark: #0b3024 !important;
  --green-soft: #dce7df !important;
  --nav: #0b2118 !important;
  --gold: #b89555 !important;
}

html,
body,
.student-app {
  background: radial-gradient(circle at 78% -10%, rgba(70, 103, 84, .1), transparent 30%), linear-gradient(135deg, #e5e7e2, #f1f1ec) !important;
}

.sidebar,
.student-sidebar {
  background: radial-gradient(circle at 25% 82%, rgba(184, 149, 85, .12), transparent 27%), linear-gradient(170deg, #10271d, #07150f) !important;
  border-color: #3d584a !important;
}

.brand strong,
.sidebar .profile strong,
.student-sidebar strong {
  font-family: Georgia, "Times New Roman", serif !important;
}

main,
.student-main {
  color: #17211c !important;
}

.panel,
.stat-card,
.session-card,
.student-card,
.card-summary > div,
.finance-hero > div,
.anki-card,
.upload-panel,
.student-corrected-library,
.course-month-group,
.course-month-content,
.course-editor,
.clip-database,
.video-library,
.hand-analyzer,
.student-replayers,
.dialog-card {
  background: linear-gradient(145deg, #f7f7f2, #eeeeea) !important;
  border-color: #cbd0c8 !important;
  box-shadow: 0 16px 38px rgba(25, 42, 33, .09) !important;
}

input,
textarea,
select,
.composer input,
.premium-composer input {
  background: #fcfcf9 !important;
  border-color: #c9cec7 !important;
}

.hero,
.student-hero {
  background: radial-gradient(circle at 80% 18%, rgba(184, 149, 85, .2), transparent 27%), linear-gradient(125deg, #10271d, #23523e) !important;
  border-color: #7f795e !important;
}

.primary {
  background: linear-gradient(135deg, #39765a, #24563f) !important;
  border-color: #668d79 !important;
}

.section-heading h2,
.topbar h1,
.student-topbar h1,
.session-card h3,
.student-card h3,
.student-corrected-library h2,
.upload-panel h2 {
  font-family: Georgia, "Times New Roman", serif !important;
  color: #17211c !important;
}

.chat-layout,
.conversation-head,
.chat-topic-tabs,
.composer,
.premium-composer {
  background: #f3f3ee !important;
  border-color: #cbd0c8 !important;
}

.messages {
  background: radial-gradient(circle at 72% 0, rgba(66, 103, 82, .07), transparent 30%), #ecece7 !important;
}

.message.theirs,
.student-chat-message.coach {
  background: #fafaf6 !important;
  border-color: #cbd0c8 !important;
}

.message.mine,
.student-chat-message.mine {
  background: #dbe7de !important;
}

/* V362 — la bibliothèque sombre devient l'identité visuelle de toute l'application. */
:root {
  --bg: #111a15 !important;
  --surface: #1b2720 !important;
  --ink: #f7f4e9 !important;
  --muted: #b8c4bd !important;
  --line: #485b50 !important;
  --green: #62a980 !important;
  --green-dark: #0b1b13 !important;
  --green-soft: #263c30 !important;
  --nav: #09130e !important;
}

html,
body,
.app-shell,
.student-app,
main,
.student-main {
  background: radial-gradient(circle at 82% 0, rgba(54, 105, 76, .14), transparent 30%), #101813 !important;
  color: #f7f4e9 !important;
}

.topbar,
.student-topbar,
.view,
.student-layout {
  color: #f7f4e9 !important;
}

.topbar h1,
.student-topbar h1,
.section-heading h2,
.panel-head h3,
.session-card h3,
.student-card h3,
.student-corrected-library h2,
.upload-panel h2,
.dialog-card h2,
.conversation-head strong {
  color: #fffdf4 !important;
}

.topbar p,
.student-topbar p,
.section-heading p,
.panel-head p,
.session-card p,
.student-card p,
.upload-panel p {
  color: #b8c4bd !important;
}

.view > .section-heading,
.topbar,
.student-topbar {
  border-color: #34463c !important;
}

.panel,
.stat-card,
.session-card,
.student-card,
.card-summary > div,
.finance-hero > div,
.anki-card,
.upload-panel,
.student-corrected-library,
.course-month-group,
.course-month-content,
.course-editor,
.clip-database,
.video-library,
.hand-analyzer,
.student-replayers,
.student-corrected-course,
.capture-card,
.replayer-link-send,
.course-picker,
.dialog-card {
  background: linear-gradient(145deg, #202d25, #18231d) !important;
  border: 1px solid #495d51 !important;
  color: #f7f4e9 !important;
  box-shadow: 0 16px 38px rgba(0, 0, 0, .22) !important;
}

.panel *,
.stat-card *,
.session-card *,
.student-card *,
.upload-panel *,
.student-corrected-library *,
.course-editor *,
.clip-database *,
.video-library *,
.hand-analyzer *,
.student-replayers * {
  text-shadow: none !important;
}

.secondary,
.chip,
.icon-button,
.text-button,
.attachment-button {
  background: #26332c !important;
  border-color: #5b6c62 !important;
  color: #f4f1e7 !important;
}

.chip.active,
.tag.ready {
  background: #304a3b !important;
  border-color: #6b9a7f !important;
  color: #ddf5e6 !important;
}

input,
textarea,
select,
.composer input,
.premium-composer input,
.student-chat-conversation > form #studentChatInput {
  background: #222e27 !important;
  border-color: #58695f !important;
  color: #fffdf4 !important;
}

input::placeholder,
textarea::placeholder {
  color: #9eaaa3 !important;
}

.chat-layout,
.conversation,
.conversation-head,
.chat-topic-tabs,
.composer,
.premium-composer,
.student-chat-conversation,
.student-chat-conversation > header,
.student-chat-conversation > nav,
.student-chat-conversation > form,
#appDialog.student-chat-mode .dialog-card {
  background: #17221c !important;
  border-color: #43564b !important;
  color: #f7f4e9 !important;
}

.messages,
.student-chat-conversation > section {
  background: radial-gradient(circle at 70% 0, rgba(65, 118, 86, .1), transparent 30%), #111a15 !important;
}

.message.theirs,
.student-chat-message.coach,
.course-summary,
.hand-message {
  background: #202c25 !important;
  border-color: #485b50 !important;
  color: #f7f4e9 !important;
}

.message.mine,
.student-chat-message.mine {
  background: #294636 !important;
  border-color: #57836a !important;
  color: #fffdf4 !important;
}

.chat-topic-tabs button,
.student-chat-conversation > nav button {
  background: #26332c !important;
  border-color: #53665b !important;
  color: #e8eee9 !important;
}

.chat-topic-tabs button.active,
.student-chat-conversation > nav button.active {
  background: #3c7256 !important;
  border-color: #73a287 !important;
  color: #fff !important;
}

.student-chat-message time,
.message time,
.day-label,
.course-summary p {
  color: #afbbb4 !important;
}

.app-version {
  background: #e9f1ec !important;
  border-color: #f4faf6 !important;
  color: #17432f !important;
}

.danger-link,
.delete-prepared-card,
#deletePreparedCard {
  color: #ff9b95 !important;
  border-color: #a95854 !important;
  background: #2c2422 !important;
}

.sidebar .nav-item,
.student-sidebar nav button {
  background: transparent !important;
  border-color: transparent !important;
  color: #dce8e1 !important;
}

.sidebar .nav-item:hover,
.sidebar .nav-item.active,
.student-sidebar nav button:hover,
.student-sidebar nav button.active {
  background: #26332c !important;
  border-color: #b18f4f !important;
  color: #fffdf4 !important;
}

.sidebar .nav-item:disabled,
.student-sidebar nav button:disabled {
  background: #1c2922 !important;
  border-color: #405249 !important;
  color: #8fa097 !important;
  opacity: .75;
}

.chat-image-lightbox {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(3, 9, 6, .86);
  backdrop-filter: blur(6px);
}

.chat-image-lightbox-card {
  position: relative;
  display: grid;
  place-items: center;
  width: min(1120px, 96vw);
  height: min(860px, 92vh);
  padding: 64px 24px 24px;
  border: 1px solid #62766a;
  border-radius: 16px;
  background: #121d17;
  box-shadow: 0 30px 100px rgba(0, 0, 0, .65);
}

.chat-image-lightbox-card img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.chat-image-lightbox-close {
  position: absolute;
  top: 14px;
  right: 16px;
  padding: 10px 14px;
  border: 1px solid #76877e;
  border-radius: 9px;
  background: #26342c;
  color: #fff;
  font-weight: 800;
}

/* Messagerie claire validée : mêmes composants, avec la typographie River Coaching Poker. */
#coachChatAttachment,
#studentChatAttachment {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.chat-layout,
.conversation,
.conversation-head,
.chat-topic-tabs,
.composer,
.premium-composer,
.student-chat-conversation,
.student-chat-conversation > header,
.student-chat-conversation > nav,
.student-chat-conversation > form,
#appDialog.student-chat-mode .dialog-card {
  background: #fbfcfb !important;
  border-color: #dfe5e1 !important;
  color: #1a2821 !important;
}

.conversation-head strong,
.student-chat-conversation > header h2 {
  color: #15231c !important;
  font-family: Georgia, "Times New Roman", serif !important;
}

.conversation-head small,
.student-chat-conversation > header small {
  color: #668074 !important;
}

.messages,
.student-chat-conversation > section {
  background: #fff !important;
  color: #1b2922 !important;
}

.message.theirs,
.student-chat-message.coach {
  background: #f0f3f5 !important;
  border-color: #e4e8e6 !important;
  color: #24312b !important;
}

.message.mine,
.student-chat-message.mine {
  background: #def2e7 !important;
  border-color: #c5e4d3 !important;
  color: #20352a !important;
}

.course-summary {
  background: linear-gradient(135deg, #f8f6ff, #f0eeff) !important;
  border-color: #c9c0ff !important;
  color: #322b7b !important;
}

.hand-message,
.replayer-link-message,
.chat-attachment-message {
  background: #fff !important;
  border-color: #e0e5e2 !important;
  color: #26322c !important;
  box-shadow: 0 7px 20px rgba(24, 49, 36, .06) !important;
}

.chat-topic-tabs button,
.student-chat-conversation > nav button {
  background: #f2f5f3 !important;
  border-color: #e2e7e4 !important;
  color: #34443c !important;
}

.chat-topic-tabs button:nth-child(1).active,
.student-chat-conversation > nav button:nth-child(1).active {
  background: #3d9b5d !important;
  border-color: #56ac70 !important;
  color: #fff !important;
}

.chat-topic-tabs button:nth-child(2).active,
.student-chat-conversation > nav button:nth-child(2).active {
  background: #edf2ff !important;
  border-color: #d8e2ff !important;
  color: #345ce0 !important;
}

.chat-topic-tabs button:nth-child(3).active,
.student-chat-conversation > nav button:nth-child(3).active {
  background: #fff0e9 !important;
  border-color: #f5d2c3 !important;
  color: #db5a35 !important;
}

#addChatTopic {
  background: #fffaf0 !important;
  border-color: #ead8ae !important;
  color: #a47725 !important;
}

.premium-composer,
.student-chat-conversation > form {
  padding: 12px 16px !important;
  gap: 10px !important;
  border-top: 1px solid #e0e5e2 !important;
  box-shadow: 0 -7px 20px rgba(23, 48, 35, .04) !important;
}

.premium-composer input,
.student-chat-conversation > form #studentChatInput {
  height: 48px !important;
  background: #fff !important;
  border-color: #dfe5e1 !important;
  color: #24312b !important;
  box-shadow: 0 4px 14px rgba(31, 55, 43, .06) !important;
}

.premium-composer .icon-composer-button,
.student-chat-conversation .icon-composer-button {
  width: 46px !important;
  height: 46px !important;
  flex: 0 0 46px !important;
  border-radius: 13px !important;
  background: #f6f8f7 !important;
  border-color: #dfe5e1 !important;
  color: #264d3a !important;
}

.premium-composer .primary,
.student-chat-conversation > form .primary {
  min-width: 104px !important;
  height: 46px !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #4ca36a, #287b4b) !important;
  border-color: #62ac79 !important;
  color: #fff !important;
}

.message time,
.student-chat-message time,
.day-label,
.course-summary p {
  color: #718079 !important;
}

.open-student-replayer {
  margin-top: 9px;
  padding: 7px 10px;
  border: 1px solid #8cb79e;
  border-radius: 8px;
  background: #f7fbf8;
  color: #276444;
  font-weight: 800;
}

/* Direction finale : interface claire, douce pour les yeux, typographie de la bibliothèque. */
:root {
  font-family: Georgia, "Times New Roman", serif !important;
  --bg: #edf0ee !important;
  --surface: #f8f9f7 !important;
  --ink: #213028 !important;
  --muted: #6f7d76 !important;
  --line: #d7ded9 !important;
}

body,
button,
input,
textarea,
select,
.app-shell,
.student-app {
  font-family: Georgia, "Times New Roman", serif !important;
}

html,
body,
.app-shell,
.student-app,
main,
.student-main {
  background: radial-gradient(circle at 82% 0, rgba(87, 126, 104, .07), transparent 31%), #edf0ee !important;
  color: #213028 !important;
}

.topbar,
.student-topbar,
.view,
.student-layout {
  color: #213028 !important;
}

.topbar h1,
.student-topbar h1,
.section-heading h2,
.panel-head h3,
.session-card h3,
.student-card h3,
.student-corrected-library h2,
.upload-panel h2,
.dialog-card h2 {
  color: #1b2922 !important;
}

.topbar p,
.student-topbar p,
.section-heading p,
.panel-head p,
.session-card p,
.student-card p,
.upload-panel p {
  color: #6f7d76 !important;
}

.panel,
.stat-card,
.session-card,
.student-card,
.card-summary > div,
.finance-hero > div,
.anki-card,
.upload-panel,
.student-corrected-library,
.course-month-group,
.course-month-content,
.course-editor,
.clip-database,
.video-library,
.hand-analyzer,
.student-replayers,
.student-corrected-course,
.capture-card,
.replayer-link-send,
.course-picker,
.dialog-card {
  background: linear-gradient(145deg, #fafbf9, #f4f6f4) !important;
  border-color: #d5ddd8 !important;
  color: #213028 !important;
  box-shadow: 0 14px 34px rgba(31, 58, 43, .08) !important;
}

.secondary,
.chip,
.icon-button,
.text-button,
.attachment-button {
  background: #f7f9f7 !important;
  border-color: #d5ddd8 !important;
  color: #294b3a !important;
}

input,
textarea,
select {
  background: #fdfefc !important;
  border-color: #d5ddd8 !important;
  color: #223129 !important;
}

.brand-mark i { display: none !important; }
.brand-mark b { display: block !important; }
.brand-mark {
  width: 42px !important;
  height: 42px !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #c3a15e !important;
  box-shadow: none !important;
  font-size: 38px !important;
}

.brand strong {
  color: #f8f5ea !important;
  font-size: 17px !important;
}

.brand small {
  color: #d8c9a9 !important;
  letter-spacing: 1px !important;
}

/* Les outils vidéo conservent leur contraste sombre. */
html body #appDialog.analysis-mode,
html body #appDialog.analysis-mode .studio-main,
html body #appDialog.analysis-mode .video-mock {
  background: #07100c !important;
  color: #f7f4e9 !important;
}

html body #appDialog.analysis-mode.course-outline-open:not(.editing-cut) .spot-list,
html body #appDialog.analysis-mode .spot-list #savedSpots,
html body #appDialog.analysis-mode .spot-list .spot {
  background: #1b2821 !important;
  color: #f7f4e9 !important;
  border-color: #4c6154 !important;
}

html body #appDialog.analysis-mode.editing-cut .question-builder:not([hidden]) {
  background: #f1f3f0 !important;
  color: #213028 !important;
}
