/* Preferences page — tabbed settings */
.yal-preferences-mount {
  min-height: 60vh;
}

.yal-pref-shell {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.yal-pref-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.yal-pref-tabs button {
  flex: 1 1 auto;
  min-width: max-content;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.9rem 1rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  background: transparent;
}

.yal-pref-tabs button.active {
  color: var(--text);
  border-bottom-color: var(--blue);
}

.yal-pref-panel {
  padding: 1rem;
  display: none;
}

.yal-pref-panel.active {
  display: block;
}

.yal-pref-panel h4 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.yal-pref-panel .yal-pref-desc {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.yal-pref-field-group {
  margin-bottom: 0.5rem;
}

.yal-pref-subhead {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.yal-pref-hint {
  margin: -0.35rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.yal-pref-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.yal-pref-field label,
.yal-pref-check {
  font-size: 0.92rem;
}

.yal-pref-field input[type="text"],
.yal-pref-field input[type="url"],
.yal-pref-field input[type="date"],
.yal-pref-field input[type="email"],
.yal-pref-field select,
.yal-pref-field textarea {
  width: 100%;
}

.yal-pref-field textarea {
  min-height: 88px;
  resize: vertical;
}

.yal-pref-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
  cursor: pointer;
}

.yal-pref-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--blue);
}

.yal-pref-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.yal-pref-save {
  background: var(--text);
  color: #000;
  border: none;
  font-weight: 700;
  padding: 0.55rem 1.2rem;
}

.yal-pref-save:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.yal-pref-status {
  font-size: 0.88rem;
  color: var(--muted);
}

.yal-pref-status.ok {
  color: #20bf55;
}

.yal-pref-status.err {
  color: #ef233c;
}

.yal-pref-block-search {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.yal-pref-block-search input {
  flex: 1;
}

.yal-pref-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.yal-pref-user-row strong {
  display: block;
}

.yal-pref-user-row span.muted {
  color: var(--muted);
  font-size: 0.88rem;
}

.yal-pref-user-row button {
  flex-shrink: 0;
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
}

/* Hide legacy injected privacy panel on preferences */
.yal-preferences-mount ~ .yal-privacy-panel,
.yal-preferences-mount .yal-privacy-panel {
  display: none !important;
}

/* Two-factor authentication */
.yal-2fa-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-top: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
}

.yal-2fa-card.yal-2fa-ok {
  border-color: rgba(0, 186, 124, 0.5);
}

.yal-2fa-card p {
  margin: 0.35rem 0;
}

.yal-2fa-secret {
  margin: 0.5rem 0;
}

.yal-2fa-secret code {
  display: inline-block;
  font-size: 1.15rem;
  letter-spacing: 0.18em;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: rgba(29, 155, 240, 0.12);
  color: var(--text, #e7e9ea);
  word-break: break-all;
}

.yal-2fa-uri {
  word-break: break-all;
  color: var(--muted);
  font-size: 0.82rem;
}

.yal-2fa-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0.75rem 0;
}

.yal-2fa-codes code {
  font-size: 1rem;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  text-align: center;
}

.yal-2fa-cancel {
  margin-left: 0.6rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text, #e7e9ea);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
}

.yal-2fa-danger {
  background: #f4212e !important;
}

.yal-2fa-status {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.88rem;
  min-height: 1.1em;
}

.yal-2fa-status.err {
  color: #f4212e;
}

.yal-2fa-status.ok {
  color: #00ba7c;
}
