.abrir-editor {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 44px;
  background: transparent;
  color: inherit;
  font-weight: 700;
}
html:has(.folha-editor[open]) {
  overflow: hidden;
}
dialog.folha-editor {
  --altura: min(
    92dvh,
    calc(var(--visivel, 100dvh) - env(safe-area-inset-top) - 8px)
  );
  width: min(430px, 100%);
  height: min(510px, var(--altura));
  max-height: var(--altura);
  max-width: 100%;
  border: 0;
  padding: 0;
  margin: auto 24px auto auto;
  border-radius: 22px;
  overflow: hidden;
  bottom: var(--teclado, 0px);
  background: #faf9f1;
}
.folha-editor::backdrop {
  background: #11252280;
}
form.editor-modelo {
  --margem-editor: clamp(16px, 5vw, 22px);
  --verde-editor: #203a37;
  --campo-editor: #ecece3;
  background: #faf9f1;
  color: var(--verde-editor);
  color-scheme: light;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  gap: 0;
  text-align: left;
}
.abrir-editor .editor-modelo {
  position: absolute;
  inset: 100% 0 auto auto;
  width: min(100%, 430px);
  height: 80svh;
}
.abrir-editor .editor-modelo :is(.abas-editor, [data-fechar-editor]) {
  display: none;
}
.editor-modelo [hidden] {
  display: none !important;
}
.editor-modelo header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  padding: 14px var(--margem-editor) 10px;
}
.editor-modelo h2 {
  font:
    400 2rem/1 DMSerif,
    Georgia,
    serif;
  letter-spacing: -0.045em;
  margin: 0;
}
.editor-modelo button {
  border: 0;
  color: inherit;
}
.editor-modelo [data-fechar-editor] {
  width: 44px;
  height: 44px;
  background: var(--campo-editor);
  border-radius: 13px;
}
.editor-modelo [data-fechar-editor] svg {
  width: 16px;
  height: 16px;
}
.abas-editor {
  margin-inline: var(--margem-editor);
  flex: none;
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 13px;
  background: var(--campo-editor);
  overflow-x: auto;
  scrollbar-width: none;
}
.abas-editor button {
  flex: 1;
  min-height: 44px;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 10px;
}
.abas-editor button[aria-selected='true'] {
  background: var(--verde-editor);
  color: #fff;
}
.abas-editor :focus-visible {
  outline-offset: -4px;
}
.campos-editor {
  flex: 1;
  min-height: 0;
  padding: 16px var(--margem-editor);
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-block: 12px;
}
.editor-modelo [role='tabpanel'] {
  display: grid;
  gap: 14px;
}
.previa-pagina {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  min-height: 104px;
  overflow: hidden;
  isolation: isolate;
  border-radius: 14px;
  color: var(--tinta);
  background: var(--papel);
}
.previa-pagina > img {
  height: 100%;
  width: 100%;
  min-height: 0;
  max-height: 120px;
  object-fit: cover;
}
.previa-pagina > div {
  padding: 14px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  justify-content: center;
}
.previa-pagina strong {
  display: flex;
  gap: 6px;
  align-items: center;
  font:
    400 1.6rem/1 DMSerif,
    serif;
  letter-spacing: -0.03em;
}
.oficina .previa-pagina strong {
  font:
    800 1.7rem/1 Barlow,
    sans-serif;
  text-transform: uppercase;
}
.portfolio .previa-pagina strong {
  font-style: italic;
}
.previa-pagina strong svg {
  width: 1.1em;
  height: 1.1em;
}
.previa-pagina [data-previa-botao] {
  background: var(--acento, var(--tom));
  color: var(--sobre-acento, var(--sobre-botao));
  font-weight: 700;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 30px;
  max-width: 100%;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.acoes-editor {
  flex: none;
  padding: 9px var(--margem-editor) max(16px, env(safe-area-inset-bottom));
}
.acoes-editor button {
  background: var(--verde-editor);
  color: white;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  border-radius: 14px;
  font-weight: 700;
}
.acoes-editor svg {
  color: #f3ed49;
}
.editor-modelo label {
  margin: 0;
  font-size: 0.9rem;
}
.editor-modelo :is(input:not([type]), textarea, select) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  font:
    400 1rem/1.3 DM,
    sans-serif;
  border: 0;
  border-radius: 9px;
  background: var(--campo-editor);
  color: inherit;
}
.editor-modelo textarea {
  resize: vertical;
}
.editor-modelo fieldset {
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0;
}
.editor-modelo legend {
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0 0 6px;
}
.editor-modelo .pacotes-icones > div {
  grid-template-columns: repeat(2, 1fr);
}
.editor-modelo .pacotes-icones span {
  font-size: 1.4rem;
}
.editor-modelo .pacotes-icones label {
  min-height: 85px;
}
.editor-modelo [data-superficie] {
  position: relative;
  cursor: pointer;
}
.editor-modelo [data-superficie] input[type='radio'] {
  position: absolute;
  inset: 0;
  border: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.editor-modelo label:has(input:focus-visible) {
  outline: 3px solid #2671bb;
  outline-offset: 2px;
}
.fontes-capa > div,
.opcoes-foto {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.fontes-capa label,
.opcoes-foto label {
  display: grid;
  justify-items: center;
  align-content: start;
  text-align: center;
  background: var(--campo-editor);
  border-radius: 10px;
  padding: 8px 4px;
  font-size: 0.82rem;
}
.editor-modelo label:has(input:checked) {
  background: var(--verde-editor);
  color: white;
}
.fontes-capa b {
  font:
    400 1.7rem/1 DMSerif,
    serif;
}
.fontes-capa [data-fonte='compacta'] b {
  font-family: Barlow, sans-serif;
  font-weight: 800;
}
.fontes-capa [data-fonte='classica'] b {
  font-family: Georgia, serif;
}
.editor-modelo details summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  font-weight: 700;
  background: var(--campo-editor);
  border-radius: 12px;
}
.editor-modelo details summary::after {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  margin: -4px 4px 0 auto;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.editor-modelo details[open] summary::after {
  transform: rotate(225deg);
  margin-top: 4px;
}
.grupo-capa label {
  margin-top: 12px;
}
.escolher-foto summary small {
  display: block;
  font-weight: 400;
}
.escolher-foto summary img,
.escolher-foto summary i {
  display: block;
  width: 62px;
  height: 52px;
}
.escolher-foto img {
  object-fit: cover;
  border-radius: 7px;
}
.sem-foto {
  display: grid;
  place-items: center;
}
.sem-foto::after {
  content: '—';
}
.opcoes-foto {
  margin-top: 8px;
}
.opcoes-foto label {
  padding: 5px;
}
.opcoes-foto img,
.opcoes-foto i {
  width: 100%;
  height: 56px;
}
@media (max-width: 700px) {
  dialog.folha-editor {
    width: 100%;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }
}
@media (max-height: 480px) {
  dialog.folha-editor {
    margin: auto;
    max-width: 465px;
  }
  .editor-modelo header {
    padding-block: 2px;
  }
  .editor-modelo h2 {
    font-size: 1.5rem;
  }
  .acoes-editor {
    padding-block: 4px max(6px, env(safe-area-inset-bottom));
  }
}

#titulo-personalizar:focus {
  outline: none;
}
