/* BC TV — Painel da TV (/admin/)
   Identidade BC Construtora: vermelho como acento, cinzas neutros, Titillium Web.
   Só tema claro. Funciona a partir de 360 px de largura. */

/* ===== Tokens ===== */
:root {
  color-scheme: light;

  --red: #99040F;
  --red-strong: #7A030C;
  --red-tint: #FBF1F2;
  --ink: #0A0A0A;
  --gray-50: #F4F4F4;
  --gray-100: #EBEBEB;
  --gray-300: #B2B2B2;
  --gray-500: #6E6E6E;
  --gray-700: #3A3A3A;
  --white: #FFFFFF;
  --surface-soft: #FAFAFA;

  --green: #1D7A3B;
  --amber: #B06A00;
  --amber-tint: #FFF6E6;

  --radius: 6px;
  --radius-lg: 8px;
  --font: "Titillium Web", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ===== Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--gray-50);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] {
  display: none !important;
}

h1, h2, h3, p, ul, ol, dl, dd {
  margin: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--red);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--red-strong);
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

::selection {
  background: rgba(153, 4, 15, 0.16);
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.noscript {
  max-width: 480px;
  margin: 48px auto;
  padding: 16px;
  background: var(--white);
  border-left: 3px solid var(--red);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--white);
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
  color: var(--white);
}

.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ===== Botões ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn-primary {
  background: var(--red);
  color: var(--white);
}

.btn-primary:hover:not(:disabled),
.btn-primary:active:not(:disabled) {
  background: var(--red-strong);
  color: var(--white);
}

.btn-secondary {
  background: var(--white);
  border-color: var(--gray-300);
  color: var(--ink);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--gray-500);
  color: var(--ink);
}

.btn-ghost {
  color: var(--gray-700);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--gray-50);
  color: var(--ink);
}

.btn-delete {
  color: var(--gray-700);
}

.btn-delete:hover:not(:disabled) {
  background: var(--red-tint);
  color: var(--red);
}

.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 14px;
}

.btn-lg {
  min-height: 48px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--gray-700);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--gray-300);
  color: var(--ink);
}

.icon-btn:disabled {
  background: transparent;
  color: var(--gray-300);
  cursor: default;
}

@media (pointer: coarse) {
  .btn,
  .btn-sm {
    min-height: 44px;
  }

  .icon-btn {
    width: 44px;
    height: 44px;
  }
}

/* ===== Campos ===== */
.label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
}

.input {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 16px;
  line-height: 1.4;
  transition: border-color 0.15s ease;
}

.input:hover:not(:disabled) {
  border-color: var(--gray-500);
}

.input:focus {
  border-color: var(--ink);
}

.input:focus-visible {
  outline-offset: 1px;
}

.input:disabled {
  background: var(--gray-50);
  color: var(--gray-500);
}

.field-error {
  margin-top: 8px;
  color: var(--red);
  font-size: 14px;
  font-weight: 600;
}

.field-error:empty {
  margin-top: 0;
}

/* ===== Login ===== */
.login-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 32px 16px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 32px 32px 32px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-top: 3px solid var(--red);
  border-radius: var(--radius-lg);
}

.login-logo {
  width: 176px;
  height: auto;
  margin: -14px auto 0;
}

.login-title {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.login-lead {
  margin: 6px 0 28px;
  color: var(--gray-500);
  font-size: 15px;
  text-align: center;
}

.password-row {
  position: relative;
}

.password-row .input {
  padding-right: 96px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  min-height: 36px;
}

.login-form .btn-primary {
  margin-top: 20px;
}

.login-foot {
  color: var(--gray-500);
  font-size: 13px;
}

@media (max-width: 420px) {
  .login-card {
    padding: 28px 20px 24px;
  }
}

/* ===== Cabeçalho ===== */
.app-header {
  background: var(--white);
  border-top: 3px solid var(--red);
  border-bottom: 1px solid var(--gray-100);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  flex: none;
  border-radius: 4px;
}

.brand img {
  width: auto;
  height: 46px;
  margin-left: -6px;
}

.header-sep {
  flex: none;
  width: 1px;
  height: 28px;
  background: var(--gray-100);
}

.header-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.header-title:focus {
  outline: none;
}

.header-logout {
  flex: none;
  margin-right: -8px;
}

/* ===== Conteúdo ===== */
.app-main {
  display: grid;
  gap: 24px;
  padding-top: 32px;
  padding-bottom: 48px;
}

.app-main:focus {
  outline: none;
}

.panel {
  min-width: 0;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  min-height: 36px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}

.panel-title::before {
  content: "";
  flex: none;
  width: 4px;
  height: 18px;
  background: var(--red);
  border-radius: 1px;
}

.panel-title:focus {
  outline: none;
}

.panel-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.panel-meta {
  color: var(--gray-500);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.panel-intro {
  margin: 4px 0 20px;
  color: var(--gray-500);
  font-size: 14px;
  max-width: 68ch;
}

@media (max-width: 599px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .header-inner {
    gap: 12px;
    min-height: 56px;
  }

  .brand img {
    height: 38px;
    margin-left: -5px;
  }

  .header-sep {
    height: 24px;
  }

  .header-title {
    font-size: 16px;
  }

  .app-main {
    gap: 16px;
    padding-top: 16px;
    padding-bottom: 32px;
  }

  .panel {
    padding: 20px 16px;
  }

  .panel-title {
    font-size: 18px;
  }
}

/* ===== Barras de progresso ===== */
.progress {
  height: 6px;
  overflow: hidden;
  background: var(--gray-100);
  border-radius: 3px;
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--red);
  border-radius: 3px;
  transition: width 0.25s linear;
}

/* ===== Avisos em linha ===== */
.notices {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 0;
  list-style: none;
}

.notices:empty {
  display: none;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--gray-50);
  border-left: 3px solid var(--gray-500);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.notice > .icon {
  flex: none;
  margin-top: 1px;
  color: var(--gray-500);
}

.notice-warn {
  background: var(--amber-tint);
  border-left-color: var(--amber);
}

.notice-warn > .icon {
  color: var(--amber);
}

.notice-error {
  background: var(--red-tint);
  border-left-color: var(--red);
}

.notice-error > .icon {
  color: var(--red);
}

/* ===== 1. Status da TV ===== */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.status-dot {
  flex: none;
  width: 12px;
  height: 12px;
  background: var(--gray-500);
  border-radius: 50%;
}

.status-indicator[data-state="loading"] .status-dot {
  background: var(--gray-300);
}

.status-indicator[data-state="online"] .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(29, 122, 59, 0.15);
}

.status-indicator[data-state="late"] .status-dot {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(176, 106, 0, 0.15);
}

.status-indicator[data-state="error"] .status-dot {
  background: var(--red);
}

.status-text {
  min-width: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.status-sub {
  margin-top: 2px;
  padding-left: 24px;
  color: var(--gray-500);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.status-sub:empty {
  display: none;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
  border-top: 1px solid var(--gray-100);
}

.fact {
  min-width: 0;
  padding: 14px 16px 0 0;
}

.fact + .fact {
  padding-left: 16px;
  border-left: 1px solid var(--gray-100);
}

.fact dt {
  color: var(--gray-500);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fact dd {
  margin-top: 2px;
  font-size: 16px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.fact-sub {
  display: block;
  color: var(--gray-500);
  font-size: 13px;
  font-weight: 400;
}

@media (max-width: 719px) {
  .facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .fact,
  .fact + .fact {
    padding: 12px 0;
    border-left: 0;
  }

  .fact + .fact {
    border-top: 1px solid var(--gray-100);
  }

  .fact:last-child {
    padding-bottom: 0;
  }
}

.tv-download {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--gray-50);
  border-radius: var(--radius);
}

.tv-download-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 14px;
}

.tv-download-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tv-download-pct {
  flex: none;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tv-details {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-100);
}

.tv-details summary {
  width: fit-content;
  padding: 4px 0;
  color: var(--gray-700);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.tv-details summary:hover {
  color: var(--ink);
}

.details-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 20px;
  margin-top: 10px;
  font-size: 14px;
}

.details-list dt {
  color: var(--gray-500);
}

.details-list dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.details-errors {
  margin: 0;
  padding-left: 18px;
}

@media (max-width: 479px) {
  .details-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .details-list dd {
    margin-bottom: 10px;
  }
}

/* ===== 2. Adicionar vídeos ===== */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 24px;
  background: var(--surface-soft);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.dropzone:hover {
  border-color: var(--gray-500);
}

.dropzone.is-over {
  background: var(--red-tint);
  border-color: var(--red);
  border-style: solid;
}

.dz-icon {
  margin-bottom: 2px;
  color: var(--gray-500);
}

.dropzone.is-over .dz-icon {
  color: var(--red);
}

.dz-title {
  font-size: 17px;
  font-weight: 600;
}

.dz-or {
  color: var(--gray-500);
  font-size: 14px;
}

.dz-hint {
  margin-top: 4px;
  color: var(--gray-500);
  font-size: 13px;
}

.only-touch {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .only-pointer {
    display: none;
  }

  .only-touch {
    display: inline;
  }

  .dropzone {
    padding: 24px 16px;
  }
}

.queue {
  margin-top: 24px;
}

.queue-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 8px;
}

.queue-title {
  font-size: 16px;
  font-weight: 700;
}

.queue-summary {
  color: var(--gray-500);
  font-size: 14px;
}

.queue-list {
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--gray-100);
}

.q-item {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-100);
}

.q-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 128px;
  height: 72px;
  overflow: hidden;
  background: var(--gray-100);
  border-radius: 4px;
  color: var(--gray-500);
}

.q-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.q-body {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.q-file {
  color: var(--gray-500);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.q-field .label {
  margin-bottom: 4px;
  font-size: 13px;
}

.q-title-input {
  min-height: 40px;
  padding: 8px 10px;
}

.q-body .notices {
  margin-top: 0;
}

.q-status {
  color: var(--gray-700);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.q-item[data-status="done"] .q-status {
  color: var(--green);
  font-weight: 600;
}

.q-item[data-status="error"] .q-status,
.q-item[data-status="invalid"] .q-status {
  color: var(--red);
  font-weight: 600;
}

.q-item[data-status="done"] .progress-fill {
  background: var(--green);
}

.q-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.q-actions:empty {
  display: none;
}

@media (max-width: 519px) {
  .q-item {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
  }

  .q-thumb {
    width: 88px;
    height: 50px;
  }
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-top-color: var(--gray-700);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== 3. Playlist ===== */
.save-state {
  min-height: 20px;
}

.save-state[data-state="saving"] {
  color: var(--gray-700);
}

.shuffle-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin: 0 0 12px;
  padding: 10px 14px;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 8px;
}

.shuffle-row[hidden] {
  display: none;
}

.shuffle-hint {
  flex: 1 1 260px;
  color: var(--gray-700);
  font-size: 14px;
  line-height: 1.4;
}

.playlist-summary {
  margin: -8px 0 16px;
  color: var(--gray-700);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.quota-notice {
  margin-bottom: 16px;
}

.playlist-state {
  padding: 28px 16px;
  color: var(--gray-500);
  text-align: center;
  border-top: 1px solid var(--gray-100);
}

.playlist-error {
  display: grid;
  justify-items: center;
  gap: 12px;
  color: var(--gray-700);
}

.playlist {
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--gray-100);
}

.pl-row {
  position: relative;
  display: grid;
  grid-template-columns: 20px 28px 112px minmax(0, 1fr) auto;
  grid-template-areas: "grip num thumb main actions";
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
}

.pl-grip {
  grid-area: grip;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  color: var(--gray-300);
  cursor: grab;
  touch-action: none;
}

.pl-grip:hover {
  color: var(--gray-700);
}

.pl-grip:active {
  cursor: grabbing;
}

.pl-num {
  grid-area: num;
  color: var(--gray-500);
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pl-thumb {
  grid-area: thumb;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 63px;
  overflow: hidden;
  background: var(--ink);
  border-radius: 4px;
}

.pl-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.15s ease;
}

.thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--gray-100);
  color: var(--gray-500);
}

.pl-main {
  grid-area: main;
  min-width: 0;
}

.pl-title {
  display: block;
  width: calc(100% + 8px);
  min-height: 36px;
  margin: 0 0 0 -8px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  text-overflow: ellipsis;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.pl-title:hover {
  border-color: var(--gray-300);
}

.pl-title:focus {
  border-color: var(--ink);
  background: var(--white);
  text-overflow: clip;
}

.pl-meta {
  margin-top: 2px;
  color: var(--gray-500);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.pl-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pl-move {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.pl-row.is-off .pl-thumb img {
  opacity: 0.4;
  filter: grayscale(1);
}

.pl-row.is-off .pl-title {
  color: var(--gray-500);
}

.pl-row.is-dragging {
  opacity: 0.45;
}

.pl-row.drop-before::before,
.pl-row.drop-after::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--red);
  pointer-events: none;
}

.pl-row.drop-before::before {
  top: -1px;
}

.pl-row.drop-after::after {
  bottom: -1px;
}

/* Telas de toque: sem alça de arrastar (reordenar pelos botões). */
@media (hover: none), (pointer: coarse) {
  .pl-grip {
    display: none;
  }

  .pl-row {
    grid-template-columns: 28px 112px minmax(0, 1fr) auto;
    grid-template-areas: "num thumb main actions";
  }

  .pl-title {
    border-color: var(--gray-100);
  }
}

/* Telas estreitas: ações em uma segunda linha. */
@media (max-width: 759px) {
  .pl-grip {
    display: none;
  }

  .pl-row {
    grid-template-columns: 24px 88px minmax(0, 1fr);
    grid-template-areas:
      "num thumb main"
      "actions actions actions";
    row-gap: 10px;
    column-gap: 12px;
  }

  .pl-thumb {
    width: 88px;
    height: 50px;
  }

  .pl-title {
    border-color: var(--gray-100);
  }
}

/* Chave "Na TV" */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.switch-input {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  margin: 0;
  background: var(--gray-500);
  border-radius: 12px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color 0.15s ease;
}

.switch-input::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--white);
  border-radius: 50%;
  transition: transform 0.15s ease;
}

.switch-input:checked {
  background: var(--red);
}

.switch-input:checked::before {
  transform: translateX(16px);
}

@media (forced-colors: active) {
  .switch-input {
    border: 1px solid CanvasText;
  }

  .switch-input::before {
    background: CanvasText;
  }

  .switch-input:checked {
    background: Highlight;
  }
}

/* ===== 4. Rodapé ===== */
.app-footer {
  padding: 24px 0 32px;
  background: var(--white);
  border-top: 1px solid var(--gray-100);
}

.footer-inner {
  display: grid;
  gap: 12px;
}

.player-url-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  min-width: 0;
}

.player-url-label {
  color: var(--gray-700);
  font-size: 14px;
  font-weight: 600;
}

.player-url {
  min-width: 0;
  padding: 4px 10px;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 4px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-note {
  color: var(--gray-500);
  font-size: 13px;
}

/* ===== Toasts ===== */
.toasts {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(400px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 6px 10px 14px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-left: 4px solid var(--gray-700);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(10, 10, 10, 0.12);
  font-size: 14px;
  line-height: 1.45;
  pointer-events: auto;
  animation: toast-in 0.18s ease-out;
}

.toast-success {
  border-left-color: var(--green);
}

.toast-error {
  border-left-color: var(--red);
}

.toast-text {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
  overflow-wrap: anywhere;
}

.toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--gray-500);
  cursor: pointer;
}

.toast-close:hover {
  background: var(--gray-50);
  color: var(--ink);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 599px) {
  .toasts {
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
  }
}

/* ===== Diálogo de confirmação ===== */
.dialog {
  width: min(440px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  background: var(--white);
  color: var(--ink);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(10, 10, 10, 0.24);
}

.dialog::backdrop {
  background: rgba(10, 10, 10, 0.55);
}

.dialog-body {
  padding: 24px;
}

.dialog-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.dialog-text {
  margin-top: 8px;
  color: var(--gray-700);
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

@media (max-width: 400px) {
  .dialog-actions {
    flex-direction: column-reverse;
  }

  .dialog-actions .btn {
    width: 100%;
  }
}

/* ===== Movimento reduzido ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
