.settings-view {
  padding: 40px 60px;
  overflow-y: auto;
  height: 100%;
  background: var(--bg-primary);
}

.settings-title {
  font-size: 36px;
  margin-bottom: 32px;
  color: var(--accent-text);
}

.settings-back {
  margin-bottom: 20px;
}

.settings-section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.settings-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 12px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.settings-field.wide {
  flex: 2;
}

.settings-field label {
  font-size: 18px;
  color: var(--text-secondary);
}

.settings-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 22px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.settings-input::placeholder {
  color: var(--text-muted);
}

.settings-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
}

.settings-about {
  margin-top: 32px;
  text-align: center;
  font-size: 18px;
  color: var(--text-muted);
}

.empty-hint {
  font-size: 20px;
  color: var(--text-muted);
  padding: 16px;
}

.upload-section {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

.upload-box {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  min-width: 0;
}

.upload-box-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  color: var(--text-secondary);
  line-height: 1.5;
}

.upload-box-list {
  display: flex;
  flex-direction: column;
}

.upload-box-list .upload-entries {
  flex: 1;
}

.upload-entries .settings-field label {
  font-size: inherit;
  color: var(--text-primary);
}

.upload-qr {
  width: 200px;
  height: 200px;
  padding: 12px;
  background: #fff;
  border-radius: var(--radius);
  image-rendering: pixelated;
}

.upload-url {
  color: var(--accent-text);
  font-weight: 600;
  word-break: break-all;
}

.playlist-header-row {
  margin-bottom: 4px;
}

.playlist-header-row .settings-field label {
  margin: 0;
}

.playlist-header-spacer {
  flex: 0 0 auto;
  width: 120px;
}

#playlist-entries .settings-row > .settings-field:nth-child(1) { flex: 3; }
#playlist-entries .settings-row > .settings-field:nth-child(2) { flex: 7; }

/* Xtream-login row: the 3 credential fields share the URL column. */
.xtream-fields {
  flex: 7;
  display: flex;
  gap: 8px;
}

.xtream-fields .settings-input { width: 100%; }

.playlist-add-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-toggle-row {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-toggle-row > label {
  flex: 1;
  font-size: 22px;
  color: var(--text-secondary);
}

/* Connected buttons; no overflow:hidden so the focus glow isn't clipped. */
.settings-toggle-row > .toggle-group {
  flex: 0 0 auto;
  display: inline-flex;
}

.toggle-option {
  min-width: 120px;
  padding: 10px 24px;
  font-size: 22px;
  text-align: center;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.toggle-option:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.toggle-option:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.toggle-option + .toggle-option { margin-left: -2px; } /* collapse the shared edge into one divider */

.toggle-option.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
  font-weight: 600;
  z-index: 1; /* lift the accent border above the neighbouring option */
}

/* Avisos + Trocar Lista: card rows inside .settings-section, reusing
   .settings-row's spacing but laid out as a column instead of a form row. */
.announcement-row,
.playlist-choice-row {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 18px 20px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
}

.playlist-choice-row {
  cursor: pointer;
  transition: var(--transition);
}

.playlist-choice-row.active {
  border-color: var(--accent);
}

.announcement-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 22px;
}

.announcement-level {
  flex: 0 0 auto;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 18px;
  font-weight: 700;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.announcement-warning .announcement-level {
  background: var(--warning);
  color: #1a1a1a;
}

.announcement-critical .announcement-level {
  background: var(--danger);
  color: #fff;
}

.announcement-body {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.announcement-date {
  font-size: 18px;
  color: var(--text-muted);
}
