/*
 * Settings, Notifications and Rules, from otv.today's InlineSettingsView and
 * InlineNotificationsView: a sticky header, then rounded bordered groups of
 * rows with gold icons; logout and delete sit in a red-edged group.
 */
.otv-settings { min-height: 100%; }
.otv-settings-header { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--otv-line); background: color-mix(in srgb, var(--bg-main) 85%, transparent); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); }
.otv-settings-header.is-split { justify-content: space-between; }
.otv-settings-header h1 { margin: 0; color: var(--text-primary); font-size: var(--fs-lg); font-weight: 700; letter-spacing: 0; }
.otv-settings-back { display: grid; place-items: center; padding: 8px; border: 0; border-radius: 50%; background: transparent; color: var(--text-primary); cursor: pointer; }
.otv-settings-back:hover { background: var(--otv-row-hover); }
.otv-settings-title { display: flex; align-items: center; gap: 12px; color: var(--text-primary); }
.otv-settings-title p { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }
.otv-settings-body { display: grid; gap: 16px; padding: 16px; }

.otv-settings-group { overflow: hidden; border: 1px solid var(--otv-line); border-radius: 16px; background: linear-gradient(135deg, var(--bg-card) 0%, color-mix(in srgb, var(--bg-card) 85%, var(--bg-main)) 100%); }
.otv-settings-group.is-danger { border-color: rgba(239, 68, 68, .3); }
.otv-settings .otv-settings-group:not(.otv-rules-section) > * + *,
.otv-settings .otv-settings-collapsible > .otv-settings-panel { border-top: 1px solid var(--otv-line); }
.otv-settings .otv-settings-group.is-danger > * + * { border-top-color: rgba(239, 68, 68, .3); }

.otv-settings-row { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 16px; border: 0; background: transparent; color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; transition: background-color .15s ease; }
.otv-settings-row:hover { background: color-mix(in srgb, var(--text-primary) 5%, transparent); }
.otv-settings-row:disabled { cursor: not-allowed; opacity: .6; }
.otv-settings-row:disabled:hover { background: transparent; }
.otv-settings-row-label { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; }
.otv-settings-row-label > svg { flex-shrink: 0; color: var(--otv-gold-text); }
.otv-settings-row-label > span { display: grid; gap: 4px; }
.otv-settings-row-label b { font-weight: 500; white-space: nowrap; }
.otv-settings-row-label small { color: var(--text-muted); font-size: var(--fs-xs); font-weight: 600; }
.otv-settings-theme select {
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit;
  color-scheme: light;
  cursor: pointer;
}
.dark .otv-settings-theme select { color-scheme: dark; }
.otv-settings-chevron { display: grid; color: var(--text-muted); }
.otv-settings-row.is-danger,
.otv-settings-row.is-danger .otv-settings-row-label > svg,
.otv-settings-row.is-danger .otv-settings-chevron { color: #f87171; }
.otv-settings-row.is-danger:hover { background: rgba(127, 29, 29, .1); }
.otv-settings-badge { min-width: 20px; padding: 2px 8px; border-radius: 999px; background: #ef4444; color: #fff; font-size: var(--fs-xs); font-weight: 700; text-align: center; }

.otv-settings-panel { display: grid; gap: 12px; padding: 16px; }
.otv-settings-hint { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }
.otv-settings-status { display: flex; align-items: center; gap: 8px; padding: 16px; border-radius: 8px; background: var(--otv-input-bg); color: var(--text-muted); font-size: var(--fs-sm); }
.otv-settings-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; border-radius: 8px; background: var(--otv-input-bg); }
.otv-settings-card.is-toggle { cursor: pointer; transition: background-color .15s ease; }
.otv-settings-card.is-toggle:hover { background: color-mix(in srgb, var(--text-primary) 8%, transparent); }
.otv-settings-card p { margin: 0 0 2px; color: var(--text-primary); font-weight: 500; }
.otv-settings-card p.is-on { color: #4ade80; }
.otv-settings-card small { color: var(--text-muted); font-size: var(--fs-sm); }
.otv-settings-switch { display: flex; align-items: center; justify-content: flex-start; flex-shrink: 0; width: 48px; height: 24px; padding: 0 4px; border-radius: 999px; background: color-mix(in srgb, var(--text-primary) 12%, transparent); transition: background-color .15s ease; }
.otv-settings-switch.is-on { justify-content: flex-end; background: var(--otv-gold); }
.otv-settings-switch.is-busy { opacity: .5; }
.otv-settings-switch i { width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); }
.otv-settings-message { display: flex; align-items: center; gap: 8px; padding: 12px; border: 1px solid; border-radius: 8px; }
.otv-settings-message p { margin: 0; font-size: var(--fs-sm); }
.otv-settings-message.is-success { border-color: rgba(34, 197, 94, .25); background: rgba(34, 197, 94, .15); color: #4ade80; }
.otv-settings-message.is-error { border-color: rgba(239, 68, 68, .25); background: rgba(239, 68, 68, .15); color: #f87171; }

.otv-settings-gold,
.otv-settings-outline,
.otv-settings-danger { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; border: 0; border-radius: 8px; font: inherit; font-weight: 500; white-space: nowrap; cursor: pointer; transition: opacity .15s ease; }
.otv-settings-gold { background: linear-gradient(135deg, var(--otv-gold), var(--otv-gold-2)); color: #111827; }
.otv-settings-outline { border: 1px solid var(--otv-input-border); background: color-mix(in srgb, var(--text-primary) 7%, transparent); color: var(--text-primary); }
.otv-settings-danger { background: linear-gradient(to right, #dc2626, #b91c1c); color: #fff; }
.otv-settings-gold:disabled,
.otv-settings-outline:disabled,
.otv-settings-danger:disabled { opacity: .5; cursor: not-allowed; }
.otv-settings-gold.is-wide { width: 100%; padding: 12px 16px; border-radius: 16px; font-weight: 600; }
.otv-settings-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: otvSpin 1s linear infinite; }
.otv-settings-spinner.is-large { width: 24px; height: 24px; color: var(--otv-gold-text); }
.otv-settings-status .otv-settings-spinner { color: var(--otv-gold-text); }

.otv-settings-signed-out { display: grid; justify-items: center; gap: 12px; padding: 40px 24px; color: var(--text-muted); text-align: center; }
.otv-settings-signed-out p { margin: 0; font-size: var(--fs-sm); }
.otv-settings-signed-out > div { display: flex; gap: 12px; }
.otv-settings-signed-out .otv-settings-gold,
.otv-settings-signed-out .otv-settings-outline { border-radius: 999px; font-weight: 600; }

/* Dialogs: change password, delete account */
.otv-settings-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.otv-settings-modal-backdrop { position: absolute; inset: 0; background: var(--window-scrim); -webkit-backdrop-filter: var(--window-scrim-filter); backdrop-filter: var(--window-scrim-filter); }
.otv-settings-dialog { position: relative; width: 100%; max-width: 448px; overflow: hidden; border: 1px solid var(--otv-line); border-radius: 16px; background: var(--window-glass); -webkit-backdrop-filter: var(--window-glass-filter); backdrop-filter: var(--window-glass-filter); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .4); color: var(--text-primary); }
.otv-settings-dialog.is-danger { border-color: rgba(239, 68, 68, .3); }
.otv-settings-dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--otv-line); }
.otv-settings-dialog-head h3 { margin: 0; font-size: var(--fs-lg); font-weight: 700; }
.otv-settings-dialog-head button { display: grid; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text-primary); cursor: pointer; }
.otv-settings-dialog-head.is-stacked { display: block; padding: 24px; border-bottom-color: rgba(239, 68, 68, .3); }
.otv-settings-dialog-head.is-stacked > div { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.otv-settings-dialog-head.is-stacked h3 { font-size: var(--fs-lg); }
.otv-settings-dialog-head.is-stacked p { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }
.otv-settings-danger-icon { display: grid; padding: 8px; border-radius: 8px; background: rgba(239, 68, 68, .15); color: #f87171; }
.otv-settings-dialog-body { display: grid; gap: 16px; padding: 16px 24px 24px; }
.otv-settings-dialog-foot { display: flex; flex-wrap: wrap; gap: 12px; padding: 24px; border-top: 1px solid rgba(239, 68, 68, .3); }
.otv-settings-dialog-foot :is(button, a) { flex: 1; padding: 12px 16px; text-decoration: none; }
.otv-settings-field { display: grid; gap: 8px; }
.otv-settings-field > span:first-child { color: var(--text-secondary); font-size: var(--fs-sm); font-weight: 600; }
.otv-settings-field b { color: #f87171; }
.otv-settings-input { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--otv-input-border); border-radius: 16px; background: var(--otv-input-bg); color: var(--text-muted); }
.otv-settings-input:focus-within { border-color: rgba(250, 204, 21, .5); }
.otv-settings-input.is-danger { border-color: rgba(239, 68, 68, .4); color: #f87171; }
.otv-settings-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: var(--fs-sm); }
.otv-settings-danger-box { padding: 16px; border: 1px solid rgba(239, 68, 68, .3); border-radius: 8px; background: rgba(239, 68, 68, .08); }
.otv-settings-danger-box p { margin: 0 0 12px; font-size: var(--fs-sm); }
.otv-settings-danger-box ul { margin: 0; padding-left: 20px; color: var(--text-secondary); font-size: var(--fs-sm); line-height: 1.6; }

/* Notifications */
.otv-settings-markall { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--otv-line); border-radius: 999px; background: var(--otv-input-bg); color: var(--text-primary); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.otv-settings-markall svg { width: 16px; height: 16px; }
.otv-settings-markall:disabled { opacity: .5; cursor: default; }
.otv-settings-loading { display: flex; justify-content: center; padding: 48px 0; }
.otv-settings-empty { display: grid; justify-items: center; gap: 12px; padding: 56px 24px; color: var(--text-muted); text-align: center; }
.otv-settings-empty svg { width: 40px; height: 40px; }
.otv-settings-empty p { margin: 0; }
.otv-notification { display: flex; gap: 12px; padding: 16px; color: var(--text-primary); text-decoration: none; }
.otv-notification + .otv-notification { border-top: 1px solid var(--otv-line); }
.otv-notification.is-unread { background: rgba(250, 204, 21, .05); }
.otv-notification:hover { background: var(--otv-row-hover); }
.otv-notification img,
.otv-notification-avatar { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: rgba(250, 204, 21, .2); color: var(--otv-gold-text); font-weight: 600; }
.otv-notification-avatar:not(.is-system) { background: var(--avatar-fallback-bg); color: var(--text-primary); }
.otv-notification-avatar.is-system { background: var(--otv-input-bg); color: var(--text-muted); }
.otv-notification > div { flex: 1; min-width: 0; }
.otv-notification-title { margin: 0; overflow: hidden; font-size: var(--fs-sm); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.otv-notification-text { margin: 2px 0 0; color: var(--text-muted); font-size: var(--fs-sm); }
.otv-notification small { display: block; margin-top: 4px; color: var(--text-muted); font-size: var(--fs-xs); }
.otv-notification-dot { flex-shrink: 0; width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: var(--otv-gold); }

/* Rules */
.otv-rules { display: grid; gap: 16px; padding: 16px; }
.otv-rules-section { padding: 20px; color: var(--text-secondary); font-size: var(--fs-md); line-height: 1.6; }
.otv-rules-section h2 { margin: 0 0 12px; color: var(--text-primary); font-size: var(--fs-lg); font-weight: 700; }
.otv-rules-section h3 { margin: 16px 0 8px; color: var(--text-primary); font-size: var(--fs-md); font-weight: 600; }
.otv-rules-section p { margin: 0 0 8px; }
.otv-rules-section ul { margin: 0; padding-left: 20px; }
.otv-rules-section li + li { margin-top: 6px; }
.otv-rules-section b { color: var(--text-primary); }
.otv-rules-section a { color: var(--secondary, #2563eb); text-decoration: underline; text-underline-offset: 2px; }
html.dark .otv-rules-section a { color: #93c5fd; }
.otv-rules-section .is-danger,
.otv-rules-section .is-danger b { color: #f87171; }
.otv-rules-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.otv-rules-facts > div { padding: 12px 16px; border-radius: 12px; background: var(--otv-input-bg); }
.otv-rules-facts p { margin: 4px 0 0; }

/* Setări stays out of the sidebar until someone is signed in. */
.nav-item[data-auth-only][hidden] { display: none !important; }
.otv-settings-panel[hidden],
.otv-settings-badge[hidden] { display: none; }
/* The back bar above Informații Legale when it is opened from Setări. */
.otv-legal-header { margin: -2rem -2rem 1.5rem; }
.otv-settings-title .otv-settings-back { margin-right: 4px; }

/* Group headings: Afișare, Informații, Cont. */
.otv-settings-group-title { margin: 22px 16px -8px; color: var(--text-muted); font-size: var(--fs-sm); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
/* The focus ring shows for keyboard use only, not after a click or tap. */
.otv-settings-row:focus:not(:focus-visible) { outline: none; box-shadow: none; }
.otv-settings-body > .otv-settings-group-title:first-child { margin-top: 8px; }

/* On/off switch for the display preferences. */
.otv-switch { position: relative; flex-shrink: 0; width: 44px; height: 26px; border-radius: 999px; background: color-mix(in srgb, var(--text-muted) 40%, transparent); transition: background-color .2s ease; }
.otv-switch > span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: translate .2s ease; }
[aria-checked="true"] > .otv-switch { background: var(--secondary); }
[aria-checked="true"] > .otv-switch > span { translate: 18px 0; }
@media (prefers-reduced-motion: reduce) { .otv-switch, .otv-switch > span { transition: none; } }

/* Newsletter without an account: email and button on one line. */
.otv-settings-newsletter { display: flex; gap: 10px; }
.otv-settings-newsletter input { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--border-light); border-radius: 999px; background: var(--bg-main); color: var(--text-primary); font: inherit; font-size: var(--fs-md); }
.otv-settings-newsletter input:focus { outline: 2px solid var(--secondary); outline-offset: 1px; }

/* The same identity as the native app, with the existing browser install flow. */
@media (min-width: 769px) {
  .otv-settings [data-section="install"] { display: none; }
}
.otv-install-card { flex-wrap: wrap; }
.otv-install-card > div { flex: 1; min-width: 150px; }
.otv-install-icon { flex: 0 0 72px; width: 72px; height: 72px; border-radius: 16px; box-shadow: 0 4px 16px rgba(0, 0, 0, .25); }
