/* Exports, toast, dialog and print. */

.json-export {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-top: 16px; padding: 18px 20px;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-l);
}
.json-copy h3 { font: 700 var(--fs-m)/1.4 var(--display); }
.json-copy p { max-width: 420px; margin-top: 4px; font-size: var(--fs-s); color: var(--muted); }
.json-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.json-actions select { width: 170px; font-size: var(--fs-s); }
.json-actions button { white-space: nowrap; min-height: 42px; padding-inline: 20px; }

.other-exports { margin-top: 8px; padding: 12px 4px; border-bottom: 1px solid var(--rule); }
.other-exports summary { font-size: var(--fs-s); font-weight: 600; color: var(--ink-soft); }
.export-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 12px; }
/* PNG: options beside a live preview of the chosen template. */
.image-export {
  display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 20px; align-items: start;
  margin: 16px 0 8px; padding-bottom: 16px; border-bottom: 1px solid var(--rule-soft);
}
.image-options { display: grid; gap: 12px; }
.image-options .primary { justify-self: start; min-height: 42px; padding-inline: 20px; }
.brand-image-field { display: grid; gap: 8px; }
.image-preview {
  margin: 0; display: grid; gap: 8px;
  max-height: 560px; overflow: auto; padding: 12px;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-m);
}
.image-preview img { display: block; width: 100%; height: auto; border-radius: 4px; box-shadow: 0 0 0 1px var(--rule-soft); }
.image-preview figcaption { font-size: var(--fs-xs); color: var(--muted); }
.export-controls button { font-size: var(--fs-s); }
.other-exports textarea { font-size: var(--fs-s); }

.toast {
  display: flex; align-items: center; gap: 16px;
  position: fixed; z-index: 10; left: 50%; bottom: 24px;
  width: max-content; max-width: min(90vw, 640px);
  transform: translateX(-50%);
  padding: 13px 20px;
  background: var(--ink); color: var(--paper);
  border-radius: 10px; box-shadow: 0 6px 24px rgb(10 10 13 / .25);
  font-size: 13px;
}
.toast.error { background: var(--danger); color: #fff; }
.toast button {
  min-height: 32px; padding: 4px 12px;
  background: transparent; border-color: rgb(244 243 238 / .4); color: inherit; font-size: var(--fs-s);
}
.toast button:hover { background: rgb(255 255 255 / .12); border-color: var(--paper); }

dialog { max-width: min(90vw, 440px); padding: 28px; border: 1px solid var(--rule); border-radius: var(--r-l); }
dialog::backdrop { background: rgb(10 10 13 / .45); }
dialog h2 { font-size: var(--fs-xl); }
dialog p { margin: 12px 0 24px; color: var(--muted); line-height: 1.7; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

noscript { display: block; padding: 30px; }

@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in 180ms ease-out; }
  @keyframes toast-in { from { opacity: 0; transform: translate(-50%, 6px); } }
}

@media (max-width: 1180px) {
  .json-export { flex-direction: column; align-items: stretch; gap: 14px; }
  .json-actions select { flex: 1; }
}

@media (max-width: 900px) {
  .image-export { grid-template-columns: 1fr; }
  .image-preview { max-height: 420px; }
  .toast { bottom: 88px; }
  .json-export { padding: 16px; }
  .json-actions { flex-wrap: wrap; }
  .json-actions select { min-width: 120px; }
  .json-actions button { flex: 1; }
}

@media print {
  .masthead, .slate-tools, .day-strip, .editor, .sheet-toolbar, .json-export, .other-exports, .site-footer, .mobile-nav { display: none; }
  .workspace { display: block; }
  .sheet { border: 0; }
  .board-scroll { max-height: none; overflow: visible; }
  .set { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
