/* Ajustes finales aprobados para la carta de imprenta. */
.psd-template .print-content {
  width: 87%;
}

/* Los primeros mantienen el margen del logotipo vertical. */
.psd-template .print-content > .menu-list:first-child {
  width: 83.35%;
}

/* Los segundos aprovechan el ancho libre y saltan de línea más tarde. */
.psd-template .print-content > .menu-list:last-child {
  width: 100%;
}

/* Aproximadamente un punto más para el texto castellano. */
.psd-template .menu-dish span,
.psd-template.dense .menu-dish span,
.psd-template.extra-dense .menu-dish span {
  font-size: 1.99cqw;
}

@media screen and (min-width: 651px) {
  .dish-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dish-fields > label:first-child {
    grid-column: 1 / -1;
  }

}

@media screen and (min-width: 1051px) {
  .workspace {
    grid-template-columns: minmax(760px, 1fr) 520px;
  }
}

/* Los textos largos de RRSS reciben más espacio vertical y, solo cuando
   hace falta, reducen tipografía e interlineado de forma uniforme. */
.social-list.social-dense .social-dish p {
  font-size: 2.82cqw;
  line-height: .92;
}

.social-list.social-dense .social-dish span {
  font-size: 2.48cqw;
  line-height: .92;
}

.social-list.social-extra-dense .social-dish p {
  font-size: 2.48cqw;
  line-height: .9;
}

.social-list.social-extra-dense .social-dish span {
  font-size: 2.2cqw;
  line-height: .9;
}

.social-list.social-dense .social-allergen img,
.social-list.social-extra-dense .social-allergen img {
  width: 5.2cqw;
  height: 5.2cqw;
}

.social-list .social-dish {
  min-height: 0;
  overflow: hidden;
}

.print-page + .print-page {
  margin-top: 24px;
}

.history-modal {
  max-height: min(720px, 90vh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.history-list {
  overflow: auto;
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.history-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 14px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.history-item:hover {
  background: var(--soft);
}

.history-item span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-item strong {
  font-size: 16px;
}

.history-item small {
  color: var(--muted);
}

.history-item > b {
  color: var(--olive);
}

.history-empty {
  color: var(--muted);
  padding: 20px 0;
}

.screen-hidden {
  display: none !important;
}

.print-preview-tabs,
.print-language-tabs {
  display: flex;
  gap: 6px;
  margin: 10px 0;
}

.print-preview-tabs button,
.print-language-tabs button {
  flex: 1;
  border: 1px solid #d7d9d1;
  border-radius: 8px;
  background: #fff;
  color: #73796d;
  padding: 9px;
  font-size: 12px;
  font-weight: 800;
}

.print-preview-tabs button.active,
.print-language-tabs button.active {
  color: #fff;
  border-color: var(--olive);
  background: var(--olive);
}

.readable-a5-preview {
  aspect-ratio: 144 / 206;
  width: 100%;
  background: #fff;
  overflow: hidden;
  container-type: size;
  box-shadow: 0 12px 35px #26323b20;
}

.readable-a5-preview > .mini-menu {
  width: 100%;
  height: 100%;
}

@media screen and (max-width: 1050px) {
  .header-actions .ghost {
    display: block;
  }
}

/* Pulido tipográfico exclusivo de las cartas A5 de imprenta. */
.mini-menu.psd-template,
.mini-menu.psd-template.dense,
.mini-menu.psd-template.extra-dense {
  font-family: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
}

.psd-template .print-hero h2,
.psd-template.dense .print-hero h2,
.psd-template.extra-dense .print-hero h2 {
  font-size: 5.44cqw;
  letter-spacing: -0.16cqw;
  line-height: .95;
}

.psd-template .menu-date,
.psd-template.dense .menu-date,
.psd-template.extra-dense .menu-date {
  top: 8.25%;
  font-size: 2.45cqw;
  line-height: 1;
}

.psd-template .menu-dish,
.psd-template.dense .menu-dish,
.psd-template.extra-dense .menu-dish {
  line-height: .96;
}

.psd-template .menu-dish + .menu-dish,
.psd-template.dense .menu-dish + .menu-dish,
.psd-template.extra-dense .menu-dish + .menu-dish {
  margin-top: .48cqw;
}

.psd-template .menu-dish p,
.psd-template.dense .menu-dish p,
.psd-template.extra-dense .menu-dish p,
.psd-template .menu-dish span,
.psd-template.dense .menu-dish span,
.psd-template.extra-dense .menu-dish span {
  line-height: .96;
}

.psd-template .allergen img,
.psd-template.dense .allergen img,
.psd-template.extra-dense .allergen img {
  width: 5.45cqw;
  height: 5.45cqw;
}

/* Separación real y uniforme: el alto lo determina el texto del plato,
   no una celda de altura variable. */
.psd-template .menu-dish,
.psd-template.dense .menu-dish,
.psd-template.extra-dense .menu-dish {
  flex: 0 0 auto;
  margin: 0;
}

.psd-template .menu-dish + .menu-dish,
.psd-template.dense .menu-dish + .menu-dish,
.psd-template.extra-dense .menu-dish + .menu-dish {
  margin-top: .9cqw;
}

.social-list,
.social-list.social-dense,
.social-list.social-extra-dense {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.social-list {
  gap: 1.15cqw;
}

.social-list.social-dense {
  gap: .78cqw;
}

.social-list.social-extra-dense {
  gap: .45cqw;
}

.social-list .social-dish {
  flex: 0 0 auto;
}

/* RRSS: flujo continuo, legible y sin huecos artificiales entre secciones. */
.social-content {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.social-list,
.social-list.social-dense,
.social-list.social-extra-dense {
  flex: 0 0 auto;
}

.social-divider {
  flex: 0 0 auto;
  margin: 2.15cqw 0;
}

.social-list .social-dish p {
  font-size: 3.45cqw;
  line-height: .96;
}

.social-list .social-dish span {
  font-size: 3cqw;
  line-height: .96;
}

.social-list {
  gap: 1.35cqw;
}

.social-list.social-dense {
  gap: 1.05cqw;
}

.social-list.social-dense .social-dish p {
  font-size: 3.18cqw;
  line-height: .94;
}

.social-list.social-dense .social-dish span {
  font-size: 2.76cqw;
  line-height: .94;
}

.social-list.social-extra-dense {
  gap: .72cqw;
}

.social-list.social-extra-dense .social-dish p {
  font-size: 2.88cqw;
  line-height: .92;
}

.social-list.social-extra-dense .social-dish span {
  font-size: 2.52cqw;
  line-height: .92;
}

/* Imprenta: más anchura útil y jerarquía con aire constante. */
.psd-template .print-content {
  width: 91%;
  height: 65%;
  grid-template-rows: 41.5% 5% 53.5%;
}

.psd-template .print-content > .menu-list:first-child {
  width: 86.5%;
}

.psd-template .print-hero p,
.psd-template.dense .print-hero p,
.psd-template.extra-dense .print-hero p {
  margin-top: 5.8cqw;
}

.psd-template .menu-date,
.psd-template.dense .menu-date,
.psd-template.extra-dense .menu-date {
  top: 8.55%;
}

.psd-template .menu-dish p,
.psd-template.dense .menu-dish p,
.psd-template.extra-dense .menu-dish p {
  font-size: 2.25cqw;
}

.psd-template .menu-dish span,
.psd-template.dense .menu-dish span,
.psd-template.extra-dense .menu-dish span {
  font-size: 2.18cqw;
}

.psd-template .allergen img,
.psd-template.dense .allergen img,
.psd-template.extra-dense .allergen img {
  width: 4.8cqw;
  height: 4.8cqw;
}

.psd-template .section-divider,
.psd-template.dense .section-divider,
.psd-template.extra-dense .section-divider {
  align-self: center;
  margin: 1.15cqw 0;
}

.psd-template .menu-included b,
.psd-template.dense .menu-included b,
.psd-template.extra-dense .menu-included b {
  font-size: 2.25cqw;
  line-height: .96;
}

.psd-template .menu-included em,
.psd-template.dense .menu-included em,
.psd-template.extra-dense .menu-included em {
  font-size: 2.18cqw;
  line-height: .96;
}

@media print {
  .print-preview-tabs,
  .print-language-tabs,
  .readable-a5-preview {
    display: none !important;
  }

  .print-page.screen-hidden {
    display: grid !important;
  }

  .print-page {
    break-after: page;
    page-break-after: always;
  }

  .print-page:last-of-type {
    break-after: auto;
    page-break-after: auto;
  }

  .print-page + .print-page {
    margin-top: 0;
  }

  .psd-template .menu-dish span,
  .psd-template.dense .menu-dish span,
  .psd-template.extra-dense .menu-dish span {
    font-size: 2.18cqw;
  }
}
