/* ==== citation‑styles.css ==== */

/* 1) Variables de tema */
:root {
    --gov-blue:       #233359;
    --gov-light:      #f7f9fc;
    --gov-lighter:    #e6eaf3;
    --gov-border:     #ccc;
    --gov-text:       #333;
    --gov-radius:     6px;
    --gov-transition: 0.25s ease-out;
    --font-base:      Verdana, sans-serif;
    --font-small:     10px;
    --font-medium:    12px;
  }
  
  /* 2) Link Definitions (<details> “1 referencia”) */
  details.webchat__link-definitions {
    font-family: var(--font-base);
    font-size: var(--font-small);
    border: 1px solid var(--gov-blue);
    background: var(--gov-lighter);
    border-radius: var(--gov-radius);
    margin: 1em 0;
    overflow: hidden;
  }
  details.webchat__link-definitions > summary {
    display: flex;
    align-items: center;
    padding: 0.6em 1em;
    background: var(--gov-blue);
    color: #fff;
    font-size: var(--font-medium);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--gov-transition);
  }
  details.webchat__link-definitions > summary:hover {
    background: #1a2852;
  }
  details.webchat__link-definitions > summary:focus {
    outline: 3px solid #4d6ca3;
  }
  .webchat__link-definitions__header-chevron {
    margin-left: auto;
    transition: transform 0.3s;
    fill: #fff;
  }
  details.webchat__link-definitions[open]
    .webchat__link-definitions__header-chevron {
    transform: rotate(180deg);
  }
  .webchat__link-definitions__list {
    background: #fff;
    padding: 0.75em 1em;
  }
  .webchat__link-definitions__list-item-box {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.6em;
    border: 1px solid var(--gov-border);
    border-radius: var(--gov-radius);
    margin-bottom: 0.6em;
    background: var(--gov-light);
    transition: background var(--gov-transition);
  }
  .webchat__link-definitions__list-item-box:hover,
  .webchat__link-definitions__list-item-box:focus {
    background: var(--gov-lighter);
    box-shadow: 0 0 0 3px rgba(35,51,89,0.3);
  }
  .webchat__link-definitions__badge {
    min-width: 1.6em;
    height: 1.6em;
    line-height: 1.6em;
    font-size: 0.85em;
    background: var(--gov-blue);
    color: #fff;
    border-radius: 50%;
    text-align: center;
    margin-right: 0.75em;
  }
  .webchat__link-definitions__list-item-text {
    font-size: var(--font-small);
    color: var(--gov-blue);
  }
  
  /* 3) Modal de cita (<dialog>) */
  @keyframes fadeInScale {
    from {
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.97);
    }
    to {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }
  }
  dialog.webchat__citation-modal-dialog {
    /* destruye estilos nativos */
    margin: 0;
    padding: 0;
    border: none;
    background: none;
  }
  /* overlay semitransparente */
  dialog.webchat__citation-modal-dialog::backdrop {
    background: rgba(0, 0, 0, 0.3);
  }
  dialog.webchat__citation-modal-dialog .webchat__modal-dialog__box {
    /* caja centrada y animada */
    position: fixed;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    display: flex;
    flex-direction: column;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: #fff;
    border: 2px solid var(--gov-blue);
    border-radius: var(--gov-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: fadeInScale var(--gov-transition);
    z-index: 1000;
  }
  dialog.webchat__citation-modal-dialog
    .webchat__modal-dialog__close-button {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    transition: color var(--gov-transition);
  }
  dialog.webchat__citation-modal-dialog
    .webchat__modal-dialog__close-button:focus {
    outline: 3px solid var(--gov-blue) !important;
  }
  dialog.webchat__citation-modal-dialog
    .webchat__modal-dialog__close-button-image {
    fill: var(--gov-text) !important;
    width: 1.2em;
    height: 1.2em;
  }
  dialog.webchat__citation-modal-dialog
    .webchat__modal-dialog__close-button:hover
    .webchat__modal-dialog__close-button-image {
    fill: var(--gov-blue) !important;
  }
  dialog.webchat__citation-modal-dialog
    .webchat__modal-dialog__body {
    flex: 1;
    padding: 1em;
    overflow-y: auto;
    line-height: 1.4;
    font-family: var(--font-base);
    color: var(--gov-text);
    font-size: var(--font-small);
  }
  dialog.webchat__citation-modal-dialog
    .webchat__citation-modal-dialog__header {
    margin: 0 0 0.75em;
    font-size: var(--font-medium);
    font-weight: bold;
    color: var(--gov-blue);
  }
  /* párrafos y enlaces */
  dialog.webchat__citation-modal-dialog
    .webchat__render-markdown--citation p {
    margin-bottom: 1em;
  }
  dialog.webchat__citation-modal-dialog
    .webchat__render-markdown--citation a {
    color: var(--gov-blue);
    text-decoration: underline;
  }
  /* bloques <pre> con scroll interno */
  dialog.webchat__citation-modal-dialog
    .webchat__citation-modal-dialog__body pre {
    background: var(--gov-light) !important;
    border: 1px solid var(--gov-border) !important;
    border-radius: var(--gov-radius) !important;
    padding: 8px !important;
    max-height: 200px !important;
    overflow: auto !important;
    white-space: pre-wrap !important;
    font-family: monospace;
    font-size: 9px;
    margin-bottom: 1em !important;
  }
  