/* a template and its live preview (the owner, 1. 12. 2026: „šablony v nastavení 1:1 jak jsou v e-mailech“): on a computer the fields and the
   e-mail side by side, on a phone the e-mail under the fields. The e-mail stays as it comes (light) also in the dark mode, in a frame. */
html.sd .tpl-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
@media (min-width: 1100px) {
  html.sd .tpl-split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}
html.sd .tpl-preview {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #f4f4f4;
}
html.sd .tpl-subj {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
  font-weight: 700;
  overflow-wrap: anywhere;
}
html.sd .tpl-subj > i {
  color: var(--accent);
}
html.sd .tpl-frame {
  display: block;
  width: 100%;
  min-height: 320px;
  border: 0;
  background: #f4f4f4;
  color-scheme: light;
}
/* no empty places (the owner, 1. 12. 2026: „bez prázdných míst telefon a PC“): on a computer the e-mail column is as wide as the e-mail (600 px
   and its frame), the fields take the rest and the text field is as high as the e-mail beside it */
@media (min-width: 1100px) {
  html.sd .tpl-split {
    grid-template-columns: minmax(0, 1fr) 642px;
    align-items: stretch;
  }
  /* the frame as wide as the e-mail in pixels, never a percent: Safari with the zoom of the page drew a percent narrower than its box and left an
     empty strip beside the e-mail (the owner, 2. 12. 2026) */
  html.sd .tpl-frame {
    width: 640px;
    max-width: 100%;
    margin: 0 auto;
  }
  html.sd .tpl-split > :first-child {
    display: flex;
    flex-direction: column;
  }
  html.sd .tpl-split > :first-child > label:last-child {
    flex: 1 1 auto;
  }
  html.sd .tpl-split > :first-child > label:last-child > .emo-field {
    flex: 1 1 auto;
  }
  html.sd .tpl-split > :first-child > label:last-child textarea {
    align-self: stretch;
    height: auto;
    min-height: 220px;
  }
}
/* the words of the fields in the fields' own row, as a mail program (the owner, 1. 12. 2026: „věci typu nadpisů dát rovnou do textu“): Předmět on
   the left of its field, the text field without a heading above it */
html.sd .tpl-subj-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
html.sd .tpl-subj-row > .emo-field {
  flex: 1 1 auto;
  min-width: 0;
}
html.sd .tpl-subj-word {
  flex: none;
  font-weight: 600;
}
/* an opened e-mail of the history on a computer: a row of its own under its row (public/js/mailframe.js), the files and the e-mail side by side */
html.sd tr.mail-open-row > td {
  /* never glued to the line of its row (the owner, 1. 12. 2026: „ať hlavně není nic nalepené“) */
  padding-top: 12px;
  padding-bottom: 16px;
}
html.sd .mail-open {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 12px 20px;
}
html.sd .mail-open > .mail-frame {
  flex: none;
  max-width: 100%;
  margin-top: 0;
}

/* how a kind of e-mail goes out, at the card of its template (the owner, 1. 12. 2026): the sender, the replies, the English pair and the
   copies side by side on a computer, under each other on a phone */
html.sd .em-route-grid {
  display: grid;
  gap: 12px;
}
@media (min-width: 900px) {
  html.sd .em-route-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}
html.sd .em-route-grid input {
  width: 100%;
}
/* the flag of the language of a pair of addresses (CZ, EN) before its word */
html.sd .route-flag {
  width: 18px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: -1px;
}
