/* Casco do protótipo: não substitui as telas oficiais, só a navegação Atual/Proposta. */
:root {
  --studio-font-ui: "Inter", system-ui, sans-serif;
  --studio-font-display: "Space Grotesk", system-ui, sans-serif;
  /* WCAG AA: #DC542E no creme fica em 3,86:1. Texto no creme usa o vermelho do sistema. */
  --proto-danger-text: var(--studio-palette-danger-700, #A63827);
}
body {
  min-height: 100%;
  background: var(--studio-surface-page);
  color: var(--studio-text-primary);
  font-family: var(--studio-font-ui);
}
:focus-visible {
  outline: 2px solid var(--studio-focus-ring);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.proto-shell { min-height: 100vh; display: flex; flex-direction: column; }
.proto-topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 6px 16px;
  background: color-mix(in srgb, var(--studio-surface-page) 92%, transparent);
  border-bottom: 1px solid var(--studio-border-subtle);
  backdrop-filter: blur(10px);
}
.proto-shell.is-editor .proto-topbar {
  background: color-mix(in srgb, var(--studio-palette-night-900, #142421) 92%, transparent);
  border-bottom-color: var(--studio-palette-night-700, #2C4640);
  color: var(--studio-track-fg, #FFF9EE);
}
.proto-brand { display: flex; flex-direction: column; text-decoration: none; color: inherit; min-height: 44px; justify-content: center; }
.proto-brand small {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--studio-palette-forest-800, #254C46);
}
.proto-shell.is-editor .proto-brand small { color: #A9D6B1; }
.proto-brand b { font-family: var(--studio-font-display); font-size: 15px; line-height: 18px; }
.proto-seg {
  display: inline-flex; padding: 3px; border: 1px solid var(--studio-border-subtle);
  border-radius: 999px; background: var(--studio-surface-raised);
}
.proto-shell.is-editor .proto-seg { background: #1E332F; border-color: #2C4640; }
.proto-seg button {
  min-height: 38px; padding: 0 14px; border: 0; border-radius: 999px;
  background: transparent; color: inherit; font-size: 13px; font-weight: 600;
}
.proto-seg button[aria-pressed="true"] {
  background: var(--studio-palette-forest-800, #254C46);
  color: var(--studio-palette-cream-50, #FFFDF7);
}
.proto-page { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 48px; }
.proto-back {
  display: inline-flex; align-items: center; min-height: 36px; margin: 0 0 16px;
  padding: 0; border: 0; background: none; color: var(--studio-text-secondary);
  font-size: 14px; font-weight: 600; text-decoration: none;
}
.proto-back:hover { color: var(--studio-text-primary); }
.proto-kicker {
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--studio-feedback-success-fg); margin: 0 0 8px;
}
.proto-kicker.is-warn { color: var(--studio-feedback-warning-fg); }
.proto-cards { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 32px; }
@media (min-width: 720px) { .proto-cards { grid-template-columns: 1fr 1fr; } }
.proto-card {
  display: flex; flex-direction: column; gap: 8px; min-height: 160px; padding: 20px;
  border: 1px solid var(--studio-border-subtle); border-radius: var(--studio-radius-panel);
  background: var(--studio-surface-raised); text-decoration: none; color: inherit;
}
.proto-card:hover { box-shadow: 0 12px 40px #14242126; }
.proto-card p { margin: 0; color: var(--studio-text-secondary); font-size: 14px; line-height: 20px; }
.proto-card .go { margin-top: auto; padding-top: 12px; font-size: 13px; font-weight: 600; color: var(--studio-palette-forest-800); }
.proto-badge {
  display: inline-flex; align-self: flex-start; padding: 4px 10px; border-radius: 999px;
  background: var(--studio-feedback-warning-bg); color: var(--studio-feedback-warning-fg);
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
}
.proto-screen { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.proto-note {
  margin: 0 16px 0; padding: 10px 14px; border-radius: 12px;
  background: var(--studio-feedback-success-bg); color: var(--studio-guide-fg);
  border: 1px solid var(--studio-guide-border); font-size: 13px; line-height: 20px;
}
.proto-note.is-warn {
  background: var(--studio-feedback-warning-bg); color: var(--studio-feedback-warning-fg);
  border-color: #E8C98A;
}
.proto-note.is-error {
  background: var(--studio-feedback-error-bg); color: var(--proto-danger-text);
  border-color: #E8B6A8;
}
/* Aviso em texto sobre creme: nunca usar o coral #DC542E. */
.proto-danger-text, .erro-box, .gv-empty .proto-danger-text {
  color: var(--proto-danger-text);
}
.toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 90;
  max-width: min(360px, calc(100% - 32px));
  padding: 14px 16px; border-radius: 14px;
  background: var(--studio-palette-ink-900); color: var(--studio-palette-cream-50);
  font-size: 14px;
}

/* Timeline oficial + ímã / cauda */
.editor-proto { display: flex; flex-direction: column; min-height: calc(100vh - 56px); background: #142421; color: #FFF9EE; }
.editor-proto-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 48px; padding: 0 12px; border-bottom: 1px solid #2C4640; font-size: 13px; font-weight: 600;
}
.editor-proto-body { display: grid; grid-template-columns: 280px 1fr; flex: 1; min-height: 0; }
@media (max-width: 800px) {
  .editor-proto-body { grid-template-columns: 1fr; }
  .editor-library-col { order: 3; border-top: 1px solid #2C4640; max-height: 50vh; overflow: auto; }
}
.editor-stage-col { display: flex; flex-direction: column; min-width: 0; }
.editor-preview-box {
  display: flex; align-items: center; justify-content: center;
  min-height: 220px; padding: 16px; background: #1A2422;
}
.editor-preview-card {
  width: min(180px, 42vw); aspect-ratio: 9/16; border-radius: 8px;
  background: #1E3A6E; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 12px; color: #fff; text-align: center; position: relative;
}
.editor-preview-card .prod {
  flex: 1; margin: 16px 16px 8px; background: linear-gradient(#7B8F3A, #2F6B55);
  border-radius: 4px;
}
.editor-preview-card p { margin: 0; font-size: 11px; }
.editor-transport-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 12px;
}
.tl-official { position: relative; overflow-x: auto; background: #162823; padding: 0 0 12px; }
.tl-ruler {
  display: flex; font-size: 10px; color: #9BB0A6; padding: 6px 0 6px 132px; gap: 0;
  border-bottom: 1px solid #2C4640;
}
.tl-ruler span { flex: 0 0 48px; }
.tl-row { display: flex; align-items: stretch; min-height: 44px; border-bottom: 1px solid #243832; }
.tl-meta {
  flex: 0 0 132px; display: flex; align-items: center; gap: 6px;
  padding: 0 8px; font-size: 11px; color: #C5D4CC; background: #142421;
}
.tl-meta button {
  width: 28px; height: 28px; border: 0; background: transparent; color: inherit;
  display: grid; place-items: center; border-radius: 6px;
}
.tl-lane {
  position: relative; flex: 1; min-width: 480px; background-image:
    linear-gradient(to right, transparent 47px, #243832 47px, #243832 48px);
  background-size: 48px 100%;
}
.tl-clip {
  position: absolute; top: 6px; height: calc(100% - 12px); border-radius: 6px;
  overflow: hidden; color: #fff; font-size: 11px; padding: 4px 8px;
  background-color: #214F49; background-repeat: no-repeat; background-size: cover;
  display: flex; flex-direction: column; justify-content: center; pointer-events: none;
}
.tl-clip.is-audio { background-color: #3B465E; }
.tl-clip.is-music { background-color: #3B465E; }
.tl-clip.is-text { background-color: #655087; }
.tl-clip b { font-weight: 600; }
.tl-tail {
  position: absolute; top: 6px; height: calc(100% - 12px); background: #070808;
  border-radius: 0 6px 6px 0; pointer-events: none;
}
.tl-guide {
  position: absolute; top: 0; bottom: 0; width: 2px; background: #B6D6A3;
  pointer-events: none; z-index: 3;
}
.tl-head {
  position: absolute; top: 0; bottom: 0; width: 2px; background: #F6A547;
  z-index: 4; pointer-events: none; transform: translateX(-1px);
}
.tl-head.is-snap { background: #B6D6A3; }
.tl-head::before {
  content: ""; position: absolute; top: -1px; left: 50%; width: 10px; height: 10px;
  margin-left: -5px; border-radius: 50%; background: inherit;
}
.tl-lane[data-drag] { touch-action: none; cursor: ew-resize; }
.tl-vol {
  position: absolute; right: 8px; bottom: 4px; left: 8px; height: 6px;
  border-radius: 99px; background: #2C4640; z-index: 2;
}
.tl-vol > i { display: block; height: 100%; border-radius: inherit; background: #F6A547; }
.tl-vol input { position: absolute; inset: -12px 0; opacity: 0; cursor: pointer; width: 100%; }

/* Capas propostas sobre a foto oficial */
.capa-live {
  position: relative; display: block; width: 100%; min-height: 210px;
  border-radius: 7px; overflow: hidden; background: #1A2422 center/cover no-repeat;
  color: #FFF9EE; text-align: left;
}
.capa-live .txt { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.capa-live .k { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #BDCBBF; }
.capa-live h4 { margin: 0; font-family: var(--studio-font-display); font-size: 16px; line-height: 1.15; }
.capa-live .offer { align-self: flex-start; background: #F4C34F; color: #181820; border-radius: 999px; padding: 2px 8px; font-size: 10px; font-weight: 600; }

.config-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.config-chips button {
  min-height: 40px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--studio-border-subtle); background: var(--studio-surface-raised);
  font-size: 13px; font-weight: 600;
}
.config-chips button[aria-pressed="true"] {
  background: var(--studio-palette-forest-800); border-color: var(--studio-palette-forest-800);
  color: var(--studio-palette-cream-50);
}

.ob-page { background: var(--studio-surface-page); padding: 24px 20px 40px; max-width: 720px; margin: 0 auto; }

.fav-btn {
  min-width: 44px; min-height: 36px; border-radius: 10px;
  border: 1px solid #2C4640; background: transparent; color: #BDCBBF;
  font-size: 12px; font-weight: 600;
}
.fav-btn[aria-pressed="true"] { border-color: #F6A547; color: #F6A547; }

@media (max-width: 519px) {
  .proto-page { width: calc(100% - 24px); }
  .proto-topbar { padding-inline: 12px; }
  .palco-action-buttons, .linha-botoes { flex-wrap: wrap; }
}

/* Sem a sidebar oficial, a barra de ações ocupa a largura da tela — também no celular. */
.palco-actions {
  left: 16px !important;
  right: 16px !important;
  display: flex !important;
  z-index: 45;
}
@media (max-width: 700px) {
  .palco-actions {
    flex-direction: column;
    align-items: stretch;
    bottom: 8px !important;
    padding: 12px !important;
  }
  .palco-action-buttons { display: flex; flex-direction: column; }
  .palco-action-buttons .btn { width: 100%; min-height: 44px; }
}

.editor-proto-body { grid-template-columns: 1fr !important; }

/* Biblioteca no paleta noturna do editor, como no print do Rafael. */
.editor-music-library {
  --studio-surface-stage: #1E332F;
  --studio-surface-raised: #162823;
  --studio-text-primary: #FFF9EE;
  --studio-text-secondary: #BDCBBF;
  --studio-border-subtle: #2C4640;
  --studio-action-primary-fg: #243B3B;
  color: #FFF9EE;
}
.editor-music-library .editor-music-card {
  background: #1E332F;
  border-color: #2C4640;
  color: #FFF9EE;
}
.editor-music-library .editor-asset__action {
  color: #FFF9EE;
  border: 1px solid #C5D4CC;
  background: transparent;
  border-radius: 10px;
  min-height: 36px;
  padding: 6px 10px;
}
.editor-library-tabs button[aria-selected="true"] {
  background: #294E41;
  color: #A9D6B1;
}
