/* Estilos do painel de edição. Reaproveita tokens e topbar/levelnav de styles.css. */

body.is-editor { padding-bottom: 96px; }

.btn {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s, opacity 0.2s;
  white-space: nowrap;
}

.btn:hover { border-color: var(--level-color); color: var(--text); }

.btn--primary {
  background: var(--level-color);
  border-color: var(--level-color);
  color: #0b0b0d;
}

.btn--primary:hover { color: #0b0b0d; filter: brightness(1.08); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; filter: none; }
.btn:disabled:hover { border-color: var(--border-strong); color: var(--text-dim); }
.btn--primary:disabled:hover { border-color: var(--level-color); color: #0b0b0d; }

.menu {
  position: absolute;
  right: 28px;
  top: 58px;
  z-index: 60;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-width: 240px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

.menu[hidden] { display: none; }

.menu button {
  background: transparent;
  border: none;
  color: var(--text-dim);
  text-align: left;
  font-family: var(--sans);
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: 5px;
  cursor: pointer;
}

.menu button:hover { background: var(--bg-card-hover); color: var(--text); }

.levelnav__tab .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tab-color);
  opacity: 0;
}

.levelnav__tab .dot.is-on { opacity: 1; }

/* ---------------- conteúdo ---------------- */

.ed { max-width: 940px; margin: 0 auto; padding: 40px 28px 40px; }

.ed__intro { color: var(--text-faint); font-size: 13.5px; line-height: 1.65; margin: 0 0 36px; max-width: 680px; }
.ed__intro strong { color: var(--text-dim); font-weight: 600; }

.ed-section__title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 20px;
}

.ed-section__title h1,
.ed-section__title h2 {
  font-family: var(--serif);
  font-weight: 600;
  margin: 0;
}

.ed-section__title h1 { font-size: 34px; }
.ed-section__title .kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--level-color);
}

.ed-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }

.ed-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.ed-field input[type="text"],
.ed-field input[type="password"],
.ed-field input[type="email"],
.ed-field textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 10px 12px;
  resize: vertical;
  transition: border-color 0.2s, background 0.2s;
}

.ed-field textarea { overflow: hidden; resize: none; min-height: 44px; }

.ed-field input:focus,
.ed-field textarea:focus {
  outline: none;
  border-color: var(--level-color);
  background: var(--bg-card-hover);
}

.ed-hint { color: var(--text-faint); font-size: 12px; line-height: 1.5; }

.ed-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }

.ed-color { display: flex; align-items: center; gap: 12px; }
.ed-color input[type="color"] {
  width: 44px;
  height: 36px;
  padding: 2px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  cursor: pointer;
}

.ed-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 26px 26px 10px;
  margin-bottom: 40px;
}

.ed-formats__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 8px 0 18px;
}

.ed-formats__head h2 { font-family: var(--serif); font-size: 24px; margin: 0; font-weight: 600; }
.ed-link { background: none; border: none; color: var(--text-faint); font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: var(--sans); }
.ed-link:hover { color: var(--level-color); }

details.ed-format {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 14px;
}

details.ed-format[open] { border-color: var(--border-strong); }

details.ed-format > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 18px 22px;
}

details.ed-format > summary::-webkit-details-marker { display: none; }

details.ed-format > summary .idx { font-family: var(--serif); font-size: 13px; font-weight: 600; color: var(--level-color); }
details.ed-format > summary .name { font-family: var(--serif); font-size: 19px; font-weight: 500; flex: 1; }
details.ed-format > summary .chev { color: var(--text-faint); font-size: 12px; transition: transform 0.2s; }
details.ed-format[open] > summary .chev { transform: rotate(180deg); }

.ed-format__body { padding: 4px 22px 14px; border-top: 1px solid var(--border); padding-top: 22px; }

.ed-subtitle {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--level-color);
  margin: 10px 0 16px;
}

.ed-video {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 14px;
}

.ed-video__side { display: flex; flex-direction: column; gap: 8px; }

.ed-preview {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 5px;
  border: 1px solid var(--border);
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 20% 0%, var(--level-soft), transparent 60%),
    linear-gradient(160deg, #1a1a1e 0%, #101012 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 11px;
  text-align: center;
  padding: 6px;
}

.ed-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.ed-chip {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-faint);
}

.ed-chip.is-ok { color: var(--level-color); }

.ed-video__fields .ed-field { margin-bottom: 14px; }
.ed-video__n { font-family: var(--serif); font-size: 13px; color: var(--text-faint); margin-bottom: 12px; }

.ed-row { display: flex; gap: 8px; align-items: stretch; }
.ed-row input { flex: 1; min-width: 0; }
.ed-row .btn { padding: 0 14px; border-radius: 6px; font-size: 12.5px; }

/* ---------------- barra de salvar / toast ---------------- */

.savebar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: rgba(11, 11, 13, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-strong);
}

.savebar__inner {
  max-width: 940px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.savebar__status { font-size: 13px; color: var(--text-faint); }
.savebar__status.is-dirty { color: var(--level-color); font-weight: 600; }
.savebar__actions { display: flex; gap: 10px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translate(-50%, 12px);
  background: var(--bg-card-hover);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13.5px;
  padding: 11px 18px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 70;
  max-width: calc(100vw - 32px);
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { border-color: #ef5d5d; color: #ffb4b4; }

@media (max-width: 700px) {
  .ed { padding: 28px 18px 32px; }
  .ed-card { padding: 20px 16px 6px; }
  .ed-grid2 { grid-template-columns: 1fr; }
  .ed-video { grid-template-columns: 1fr; padding: 14px; }
  .ed-video__side { flex-direction: row; align-items: center; }
  .ed-preview { width: 72px; flex-shrink: 0; }
  .ed-format__body { padding: 18px 14px 10px; }
  details.ed-format > summary { padding: 16px 16px; }
  .menu { right: 12px; top: 54px; }
  .savebar__inner { padding: 12px 16px; flex-wrap: wrap; }
  .savebar__actions { width: 100%; justify-content: flex-end; }
  .topbar__actions .btn { padding: 7px 12px; font-size: 12px; }
}
