    :root { --gutter: 16px; }
    /* html, body { height:100%; margin:0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; } */

    /* Split en 2 colonnes */
    .wrap {
      display: grid;
      grid-template-columns: 1fr 1fr;
      column-gap: 0;
      min-height: 100vh;
      width: 100%;
    }

    .left {
      border-right: 1px solid #eee;
      /* min-height: 100vh; */
      /* empêche tout débordement horizontal de Mirador */
      overflow: hidden;
      position: relative;
    }

    /* Le conteneur Mirador ne doit occuper QUE la colonne gauche */
    #mirador {
      position: relative;
      width: 100% !important;      /* override 100vw éventuel */
      height: 100vh !important;    /* occupe la hauteur de la colonne */
      max-width: 100% !important;  /* sécurité */
      overflow: hidden;
    }

    /* Forcer la hiérarchie Mirador à respecter la hauteur du parent */
    .mirador-viewer,
    .mirador-workspace,
    .mirador-window,
    .mirador-osd {
      height: 100% !important;
      max-height: 100% !important;
    }

    .right {
      padding: var(--gutter);
      overflow: auto;
    }

    .anno-item { border:1px solid #eee; border-radius:8px; padding:12px; margin-bottom:10px; }
    .anno-item h4 { margin:0 0 8px 0; font-size:14px; color:#444; }
    .anno-body { font-size:14px; line-height:1.35; }
    .muted { color:#666; font-size:12px; }
    .toolbar { display:flex; gap:12px; align-items:center; margin:12px 0; flex-wrap: wrap; }
    .toolbar form { display:inline-flex; gap:6px; align-items:center; }
    input[type="text"] { padding:6px 8px; border:1px solid #ccc; border-radius:6px; }
    /* button { padding:6px 10px; border:1px solid #333; background:#111; color:#fff; border-radius:6px; cursor:pointer; } */
    button.secondary { background:#fff; color:#111; border:1px solid #bbb; }
    .small { font-size:12px; color:#777; }
    .section-title {
        margin: 16px 0 8px;
        font-size: 1.5rem;
    }
    header { padding:10px var(--gutter); border-bottom:1px solid #eee; }
    h1 { margin:12px var(--gutter) 0; }

.entity-section-label {
  font-size: 1.05rem;
  font-weight: 600;
  color: #444;
  margin-bottom: .5rem;
}


.entity-pill-input {
  display: flex;
  align-items: center;
  border: 1px solid #d8d8d8;
  border-radius: 999px;
  background: #f8f9fa;
  overflow: hidden;
  max-width: 100%;
}

.entity-pill-field {
  flex: 1;
  border: 0;
  background: transparent;
  padding: .45rem .8rem;
  min-width: 0;
}

.entity-pill-field:focus {
  outline: none;
}

.entity-pill-remove {
  border: 0;
  background: transparent;
  color: #888;
  padding: .45rem .75rem;
  cursor: pointer;
}

.entity-pill-remove:hover {
  color: #b00020;
  background: #f1f1f1;
}

.entity-pill-input {
    display: flex;
    align-items: center;
    border: 1px solid #d9d9d9;
    border-radius: 999px;
    background: #fff;
    transition: .15s;
}

.entity-pill-input:focus-within {
    border-color: #0d6efd;
    box-shadow: 0 0 0 .15rem rgba(13,110,253,.15);
}

.entity-pill-field {
    flex: 1;
    border: 0;
    background: transparent;
    padding: .55rem .9rem;
}

.entity-pill-field:focus {
    outline: none;
}

.entity-pill-remove {
    border: 0;
    background: transparent;
    color: #888;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    margin-right: 4px;
}

.entity-pill-remove:hover {
    background: #f5f5f5;
    color: #dc3545;
}
    .ent-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ent-delete {
  /* background: none;
  border: none;
  cursor: pointer; */
  font-size: 14px;
  /* opacity: 0.6; */
}

.ent-delete:hover { opacity: 1; }

.ent-row.deleted .ent-label {
  text-decoration: line-through;
  opacity: 0.5;
}


.tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

 .tag-delete {
 /* background: none;
  border: none;
  cursor: pointer; */
  font-size: 14px;
  /* opacity: 0.6; */
}

.tag-delete:hover { opacity: 1; }

.tag-row.deleted .tag-label {
  text-decoration: line-through;
  opacity: 0.5;
}


/* Dropdown Wikidata */
.wd-wrap { position: relative; }
.wd-dd {
  position: absolute;
  z-index: 9999;
  left: 0; right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
  max-height: 240px;
  overflow: auto;
  display: none;
}

.wd-item {
  padding: 8px 10px;
  cursor: pointer;
  border-bottom: 1px solid #f1f1f1;
}
.wd-item:last-child { border-bottom: none; }
.wd-item:hover { background: #f7f7f7; }

.wd-title { font-size: 13px; color: #111; }
.wd-meta  { font-size: 12px; color: #666; margin-top: 2px; }
.wd-qid   { font-size: 12px; color: #444; margin-left: 6px; }

.w100 { width: 100%; }

.ent-grid{
  display: grid;
  grid-template-columns: 1fr 110px; /* gauche (2 champs), droite (QID) */
  gap: 8px;
  align-items: start;
}

.ent-stack{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ent-qid{
  width: 110px;
  text-align: center;
  opacity: .85;
}


/* Par défaut (lecture) : on cache tout ce qui est "edit-only" */
.edit-only { display: none !important; }

/* Quand le body est en mode édition : on montre */
body.is-editing .edit-only { display: block !important; }

/* Option : pour les lignes flex, plutôt que block */
body.is-editing .edit-only.flex { display: flex !important; }

.readonly-field { background:#f4f4f4; color:#555; cursor:not-allowed; }



#btn-edit, #btn-save{
  background-color: #D20A11;
  border: #D20A11;
  color: white;

}

 .btn-add, #btn-add-tag-picker, #btn-add-free-tag {
  background-color: white;
  border: 1px solid #D20A11;
  color: #D20A11;
  display:block;
  margin-left:auto;
}

.btn-add:hover, #btn-add-tag-picker:hover, #btn-add-free-tag:hover {
  background-color: #D20A11;
  border: 1px solid #D20A11;
  color: white;
}

.tag-delete, .ent-delete {
color: #D20A11;
}

.tag-delete:hover, .ent-delete:hover {
box-shadow: none;

}


.tag-taxonomy-editor {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.tag-choice-section {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.tag-choice-section h5 {
  margin: 0 0 10px 0;
  font-weight: 700;
}

.tag-choice-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tag-choice-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tag-choice-section {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  margin-top: 10px;
}

.tag-choice-section h5 {
  margin: 0 0 10px 0;
  font-weight: 700;
}

.tag-accordion-item {
  margin: 4px 0;
}

.tag-accordion-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}

.tag-accordion-toggle {
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 24px;
  color: #D20A11;
  font-weight: 700;
}

.tag-accordion-spacer {
  display: inline-block;
  width: 24px;
}

.tag-choice-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.tag-accordion-level {
  margin-left: 24px;
  padding-left: 10px;
  border-left: 1px dashed #ddd;
}

.canvas-sticky-zone {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: white;
  z-index: 10;
  padding-top: 1rem;
}

.canvas-main-layout {
  height: calc(100vh - 120px);
  overflow: hidden;
}

.left {
  height: 100%;
  overflow: hidden;
}

.right {
  height: 100%;
  overflow-y: auto;
  padding-right: 1rem;
}

.tag-choice-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tag-accordion-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: start;
  column-gap: 6px;
  min-height: 28px;
}

.tag-accordion-toggle,
.tag-accordion-spacer {
  width: 24px;
  min-width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.tag-accordion-toggle {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #D20A11;
  font-weight: 700;
}

.tag-choice-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  column-gap: 8px;
  margin: 0;
  line-height: 1.3;
}

.tag-choice-option input[type="checkbox"] {
  margin-top: 2px;
}

.tag-choice-option label {
  margin: 0;
}