.chunk__footer { display: none; }
[hidden] { display: none !important; }
:root {
  color-scheme: light dark;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: #11151c;
  color: #f0f4f8;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: 1.25rem 2rem 1rem;
  background: linear-gradient(135deg, #1f2933, #323f4b);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

h1 {
  margin: 0;
  font-size: 1.8rem;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.header-language-form {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #d9e2ec;
}

.header-language-form label {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.header-language-form label,
.header-language-form select {
  display: inline-block;
}

.header-language-form select {
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.35);
  color: #f0f4f8;
  font-size: 0.95rem;
}

.header-language-form select:focus {
  outline: none;
  border-color: #56e6d6;
  box-shadow: 0 0 0 2px rgba(86, 230, 214, 0.25);
}

main {
  display: grid;
  grid-template-columns: 320px 1fr;
  grid-template-rows: auto 1fr;
  gap: 1.5rem;
  padding: 1.5rem 2rem 2.5rem;
  flex: 1;
}

#transcription-panel {
  grid-column: 2;
  grid-row: 1 / -1;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: #6e7f97;
  margin-left: auto;
}

.status[data-status='success'] {
  color: #2ec4b6;
}

.status[data-status='error'] {
  color: #ff6b6b;
}

.panel {
  background-color: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.panel h2 {
  margin-top: 0;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}

#language-form {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: nowrap;
}

#language-form label {
  margin: 0;
}

#transcription-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: calc(100vh - 240px);
  overflow-y: auto;
}

.chunk {
  background: transparent;
  border: none;
  padding: 0.3rem 0;
}

.chunk__header {
  display: none;
}


@media (max-width: 960px) {
  main {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  #glossary-panel,
  #transcription-panel {
    grid-column: 1;
  }

  #glossary-panel {
    grid-row: 1;
  }

  #transcription-panel {
    grid-row: 2;
  }
}

.chunk__section {
  margin-top: 0.35rem;
  padding: 0;
  background: transparent;
  border: none;
}

.chunk__section--original {
  border-left: none;
}

.chunk__section--original::before {
  content: '🎤 Transcription originale';
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #56e6d6;
}

.chunk__section--translations::before {
  content: '🌍 Traductions';
  display: block;
  margin-bottom: 0.65rem;
  margin-top: 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9fb3c8;
}

.chunk__section-title {
  margin: 0 0 0.45rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: #9fb3c8;
}

.chunk__section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.chunk__section-title-row .chunk__section-title {
  margin: 0;
}

.chunk__edit {
  padding: 4px 8px;
  font-size: 0.7rem;
  border: 1px solid rgba(86, 230, 214, 0.35);
  background: rgba(46, 196, 182, 0.12);
  color: #56e6d6;
  border-radius: 8px;
  cursor: pointer;
}
.chunk__edit:hover {
  background: rgba(46, 196, 182, 0.2);
}

.chunk__text {
  margin: 0;
  line-height: 1.5;
  color: #e0e8f9;
}

.chunk__translations {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

/* Ligne originale compacte avec bouton Corriger à la suite du texte */
.original-line {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.original-line .chunk__text {
  flex: 0 1 auto;
  font-size: 1.05rem;
  font-weight: 500;
}
.original-line .chunk__edit {
  padding: 4px 8px;
  font-size: 0.7rem;
}

/* Compatibilité avec l'ancien nom */
.fr-line {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.fr-line .chunk__text {
  flex: 0 1 auto;
}
.fr-line .chunk__edit {
  padding: 4px 8px;
  font-size: 0.7rem;
}

.chunk__modified-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ffb020;
  background: rgba(255, 184, 77, 0.16);
  border: 1px solid rgba(255, 184, 77, 0.35);
  border-radius: 999px;
}
.chunk__modified-badge::before {
  content: '●';
  color: #ffb020;
  font-size: 0.65rem;
  line-height: 1;
}

.translation-line {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.translation-line__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(94, 234, 212, 0.16);
  color: #56e6d6;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  min-width: 3.2rem;
  text-align: center;
}

.translation-line__text {
  margin: 0;
  line-height: 1.5;
  color: #56e6d6;
}

.chunk__translation-empty {
  margin: 0;
  font-style: italic;
  color: #8899b0;
}

/* Logo Avignon - taille raisonnable et images dans le corps */
.brand-logo {
  height: 18px;
  width: auto;
  vertical-align: middle;
  margin-right: 8px;
  border-radius: 4px;
}

main img:not(.brand-logo) {
  max-height: 56px;
  height: auto;
  width: auto;
}

@media (max-width: 640px) {
  .brand-logo { height: 14px; }
  main img:not(.brand-logo) { max-height: 44px; }
}

/* 5x sizes per request */
.brand-logo {
  height: 90px;
  width: auto;
}
main img:not(.brand-logo) {
  max-height: 280px;
}
@media (max-width: 640px) {
  .brand-logo { height: 50px; }
  main img:not(.brand-logo) { max-height: 220px; }
}

@media (max-width: 640px) {
  header {
    padding: 0.75rem 1rem 0.5rem;
  }

  h1 {
    font-size: 1.1rem;
    line-height: 1.2;
  }

  .header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .header-language-form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.5rem;
  }

  .header-language-form label {
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .header-language-form select {
    flex: 1;
    min-width: 0;
  }

  .status {
    margin-left: 0;
    font-size: 0.75rem;
  }

  main {
    padding: 1.25rem 1.25rem 1.75rem;
  }

  .panel {
    padding: 1.1rem;
  }
}

/* Glossaire collaboratif */
#glossary-panel {
  grid-column: 1;
  font-size: 0.7em; /* -30% */
}

#glossary-form {
  margin-bottom: 1rem;
}

.glossary-input-row {
  display: grid;
  grid-template-columns: 1fr auto; /* single input + button */
  gap: 0.5rem;
  align-items: center;
}

.glossary-input-row input {
  padding: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.5);
  color: #e2e8f0;
  font-size: 0.9rem;
}

.glossary-input-row input:focus {
  outline: none;
  border-color: #2ec4b6;
  box-shadow: 0 0 0 2px rgba(46, 196, 182, 0.18);
}

.glossary-input-row button {
  padding: 0.5rem 0.9rem;
  background: rgba(46, 196, 182, 0.16);
  color: #56e6d6;
  border: 1px solid rgba(86, 230, 214, 0.35);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}

.glossary-input-row button:hover {
  background: rgba(46, 196, 182, 0.24);
}

#glossary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 250px;
  overflow-y: auto;
}

.glossary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 8px;
  font-size: 0.85rem;
}

.glossary-item__content {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}

.glossary-item__term {
  font-weight: 600;
  color: #e2e8f0;
}

.glossary-item__arrow {
  color: #9fb3c8;
}

.glossary-item__translation {
  color: #cbd5e1;
}

.glossary-item__delete {
  padding: 0.25rem 0.5rem;
  background: rgba(244, 63, 94, 0.18);
  color: #ff8899;
  border: 1px solid rgba(255, 136, 153, 0.35);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
}

.glossary-item__delete:hover {
  background: rgba(244, 63, 94, 0.26);
}
