:root {
  --bg: #121717;
  --surface: rgba(18, 23, 23, 0.76);
  --surface-strong: rgba(18, 23, 23, 0.92);
  --surface-hover: rgba(18, 23, 23, 0.82);
  --line: rgba(112, 184, 165, 0.14);
  --line-strong: rgba(242, 244, 241, 0.33);
  --text: #F2F4F1;
  --muted: #70B8A5;
  --dim: #7c6e65;
  --yellow: #70B8A5;
  --yellow-soft: rgba(112, 184, 165, 0.16);
  --blue: #70B8A5;
  --danger: #ff5d68;
  --success: #70B8A5;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 8% 12%, rgba(18, 23, 23, 0.25), transparent 30%),
    radial-gradient(circle at 93% 78%, rgba(18, 23, 23, 0.18), transparent 32%),
    linear-gradient(145deg, #121717 0%, #121717 48%, #030202 100%);
  font-family: "Outfit", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* Keep detail screens on the same compact TV scale as settings.html. */
  font-size: 14px;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: repeating-linear-gradient(90deg, rgba(242, 244, 241, 0.014) 0 1px, transparent 1px 7px);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 82%);
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

.detail-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.detail-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  height: clamp(56px, 7.5vh, 75px);
  min-height: 0;
  padding: 0 clamp(20px, 3.5vw, 55px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: linear-gradient(to bottom, rgba(18, 23, 23, 0.78) 0%, rgba(18, 23, 23, 0.35) 60%, transparent 100%);
}

.header-left {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.4vw, 20px);
}

.header-right {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.8vw, 22px);
}

.back-pill,
.home-pill,
.header-avatar {
  height: clamp(36px, 3.5vw, 44px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #F2F4F1;
  text-decoration: none;
  border: 1px solid var(--line-strong);
  background: linear-gradient(145deg, rgba(35, 49, 46, 0.77), rgba(18, 23, 23, 0.86));
  box-shadow: inset 0 1px rgba(242, 244, 241, 0.17), 0 10px 26px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  cursor: pointer;
  outline: none;
  transition: transform 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.back-pill {
  width: clamp(36px, 3.5vw, 44px);
  min-width: 0;
  padding: 0;
  border: 1.5px solid rgba(242, 244, 241, 0.18);
  border-radius: 50%;
  background: rgba(18, 23, 23, 0.85);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.home-pill,
.header-avatar {
  width: clamp(36px, 3.5vw, 44px);
  border-radius: 50%;
}

.back-pill span,
.home-pill {
  display: none;
}

.source-status-pill {
  min-height: 0;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #F2F4F1;
  border: 1px solid rgba(242, 244, 241, 0.16);
  border-radius: 20px;
  background: rgba(18, 23, 23, 0.8);
  box-shadow: inset 0 1px rgba(242, 244, 241, 0.05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  outline: none;
  font-size: clamp(12px, 1vw, 14px);
  font-weight: 500;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.source-status-pill:hover,
.source-status-pill:focus-visible {
  border-color: var(--yellow);
  background: rgba(18, 23, 23, 0.92);
  box-shadow: 0 0 16px rgba(112, 184, 165, 0.16);
  transform: translateY(-1px);
}

.source-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 9px rgba(112, 184, 165, 0.75);
}

.source-switch-icon {
  width: 15px;
  height: 15px;
  margin-left: 2px;
  opacity: 0.72;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-avatar {
  position: relative;
  padding: 0;
  overflow: visible;
  font-size: 0;
  background:
    radial-gradient(circle at 32% 24%, rgba(112, 184, 165, 0.24), transparent 42%),
    linear-gradient(145deg, rgba(18, 23, 23, 0.96), rgba(18, 23, 23, 0.98));
  border: 1.5px solid rgba(242, 244, 241, 0.18);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.header-avatar img {
  display: none;
}

.home-pill svg {
  display: none;
}

.home-pill::before,
.header-avatar::before {
  content: "";
  width: 23px;
  height: 23px;
  display: block;
  background: currentColor;
}

.home-pill::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M2.8 10.7 12 3l9.2 7.7-1.5 1.8-.9-.7v7.4c0 1-.8 1.8-1.8 1.8H7c-1 0-1.8-.8-1.8-1.8v-7.4l-.9.7-1.5-1.8ZM10 15v6h4v-6h-4Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M2.8 10.7 12 3l9.2 7.7-1.5 1.8-.9-.7v7.4c0 1-.8 1.8-1.8 1.8H7c-1 0-1.8-.8-1.8-1.8v-7.4l-.9.7-1.5-1.8ZM10 15v6h4v-6h-4Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.header-avatar::before {
  width: 25px;
  height: 25px;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm-7 9a7 7 0 0 1 14 0H5Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm-7 9a7 7 0 0 1 14 0H5Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.header-avatar::after {
  content: "";
  position: absolute;
  right: 1px;
  bottom: 4px;
  width: 9px;
  height: 9px;
  border: 3px solid #121717;
  border-radius: 50%;
  background: var(--success);
}

.back-pill svg,
.home-pill svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.back-pill:hover,
.back-pill:focus-visible,
.home-pill:hover,
.home-pill:focus-visible,
.header-avatar:hover,
.header-avatar:focus-visible {
  color: var(--yellow);
  border-color: rgba(112, 184, 165, 0.72);
  box-shadow: 0 0 25px rgba(112, 184, 165, 0.16), 0 10px 26px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.detail-title-wrap {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  min-width: 0;
  text-align: center;
}

.detail-eyebrow {
  display: none;
  margin-bottom: 2px;
  color: var(--yellow);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.7px;
  text-transform: uppercase;
}

.detail-title {
  margin: 0;
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 700;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.header-clock {
  color: rgba(242, 244, 241, 0.86);
  font-size: clamp(16px, 1.6vw, 21px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

.header-weather {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-weather svg {
  width: clamp(23px, 2.3vw, 28px);
  height: clamp(23px, 2.3vw, 28px);
}

.weather-temp {
  color: #F2F4F1;
  font-size: clamp(14.5px, 1.4vw, 19px);
  font-weight: 500;
}

.detail-main {
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(12px, 1.7vw, 22px) 0 52px;
}

.page-intro {
  position: relative;
  margin-bottom: 32px;
  padding: clamp(24px, 4vw, 42px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    linear-gradient(130deg, rgba(18, 23, 23, 0.6), rgba(18, 23, 23, 0.8)),
    repeating-linear-gradient(90deg, rgba(242, 244, 241, 0.02) 0 1px, transparent 1px 7px);
  box-shadow: inset 0 1px rgba(242, 244, 241, 0.13), 0 24px 60px rgba(0, 0, 0, 0.3);
}

.page-intro::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -120px;
  width: 290px;
  height: 290px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(112, 184, 165, 0.19), transparent 66%);
}

.page-intro-icon {
  width: 58px;
  height: 58px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(242, 244, 241, 0.18);
  border-radius: 18px;
  color: var(--yellow);
  background: rgba(18, 23, 23, 0.62);
  box-shadow: inset 0 1px rgba(242, 244, 241, 0.1), 0 12px 28px rgba(0, 0, 0, 0.28);
}

.page-intro-icon svg {
  width: 28px;
  height: 28px;
}

.page-intro h2 {
  position: relative;
  z-index: 1;
  margin: 0 0 8px;
  font-size: clamp(27px, 3vw, 42px);
  line-height: 1;
  letter-spacing: -1px;
}

.page-intro p {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0;
  color: rgba(242, 244, 241, 0.72);
  font-size: 15px;
  line-height: 1.6;
}

.settings-sections {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 1.8vw, 21px);
}

.settings-group {
  min-width: 0;
}

.group-label {
  display: block;
  margin: 0 0 7px 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.group-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background:
    linear-gradient(130deg, rgba(18, 23, 23, 0.72), rgba(18, 23, 23, 0.8)),
    repeating-linear-gradient(90deg, rgba(242, 244, 241, 0.018) 0 1px, transparent 1px 7px);
  box-shadow: inset 0 1px rgba(242, 244, 241, 0.08), 0 18px 42px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.setting-row {
  position: relative;
  width: 100%;
  min-height: clamp(54px, 6.4vh, 62px);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  border: 0;
  border-bottom: 1px solid rgba(242, 244, 241, 0.065);
  background: transparent;
  cursor: default;
  outline: none;
  transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

button.setting-row,
a.setting-row,
.setting-row.is-action {
  cursor: pointer;
}

.setting-row:last-child {
  border-bottom: 0;
}

button.setting-row:hover,
a.setting-row:hover,
.setting-row:focus-within,
.setting-row:focus-visible {
  background: linear-gradient(90deg, rgba(35, 49, 46, 0.24), rgba(242, 244, 241, 0.035));
  box-shadow: inset 3px 0 var(--yellow);
}

button.setting-row:active,
a.setting-row:active {
  transform: scale(0.994);
}

.row-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.row-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(242, 244, 241, 0.13);
  border-radius: 10px;
  color: #B8C2BD;
  background: rgba(242, 244, 241, 0.055);
}

.row-icon svg {
  width: 16px;
  height: 16px;
}

.row-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.row-title {
  color: var(--text);
  font-size: clamp(13px, 1.05vw, 14.5px);
  font-weight: 600;
}

.row-subtitle {
  color: var(--muted);
  font-size: clamp(10.5px, 0.85vw, 12px);
  font-weight: 400;
}

.row-right {
  min-width: 0;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.row-value {
  max-width: 320px;
  overflow: hidden;
  color: #70B8A5;
  font-size: clamp(11px, 0.9vw, 12.5px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-chevron {
  width: 15px;
  height: 15px;
  color: #86786f;
  transition: color 0.16s ease, transform 0.16s ease;
}

.row-chevron svg {
  width: 100%;
  height: 100%;
}

button.setting-row:hover .row-chevron,
a.setting-row:hover .row-chevron,
.setting-row:focus-visible .row-chevron {
  color: var(--yellow);
  transform: translateX(3px);
}

.zen-toggle {
  position: relative;
  width: 42px;
  height: 24px;
  display: inline-block;
  flex: 0 0 auto;
  cursor: pointer;
}

.zen-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.zen-toggle span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(242, 244, 241, 0.13);
  border-radius: 999px;
  background: rgba(242, 244, 241, 0.11);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.zen-toggle span::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #F2F4F1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.34);
  transition: transform 0.18s ease;
}

.zen-toggle input:checked + span {
  border-color: rgba(112, 184, 165, 0.75);
  background: rgba(112, 184, 165, 0.76);
}

.zen-toggle input:checked + span::before {
  transform: translateX(18px);
}

.zen-toggle input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(112, 184, 165, 0.2);
}

.primary-btn,
.secondary-btn,
.danger-btn,
.chip-btn {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: #F2F4F1;
  background: rgba(18, 23, 23, 0.78);
  cursor: pointer;
  outline: none;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.primary-btn {
  color: #121717;
  border-color: var(--yellow);
  background: var(--yellow);
  font-weight: 800;
}

.danger-btn {
  color: #F2F4F1;
  border-color: rgba(255, 93, 104, 0.45);
  background: rgba(255, 67, 81, 0.14);
}

.primary-btn:hover,
.primary-btn:focus-visible,
.secondary-btn:hover,
.secondary-btn:focus-visible,
.danger-btn:hover,
.danger-btn:focus-visible,
.chip-btn:hover,
.chip-btn:focus-visible {
  border-color: var(--yellow);
  box-shadow: 0 0 22px rgba(112, 184, 165, 0.16);
  transform: translateY(-2px);
}

.form-card {
  padding: clamp(16px, 2.2vw, 22px);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

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

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  min-height: 43px;
  padding: 0 12px;
  color: #F2F4F1;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(18, 23, 23, 0.72);
  outline: none;
}

.field input::placeholder {
  color: #77695f;
}

.field input:focus,
.field select:focus {
  border-color: rgba(112, 184, 165, 0.8);
  box-shadow: 0 0 0 3px rgba(112, 184, 165, 0.1);
}

.form-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(18, 23, 23, 0.58);
}

.segmented .chip-btn {
  flex: 1;
  border-color: transparent;
  background: transparent;
}

.segmented .chip-btn.active {
  color: #121717;
  border-color: var(--yellow);
  background: var(--yellow);
  font-weight: 800;
}

.multiscreen-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-height: min(56vw, 540px);
  padding: 12px;
}

.multiscreen-preview[data-count="3"] .screen:first-child {
  grid-row: span 2;
}

.screen {
  appearance: none;
  position: relative;
  min-height: 170px;
  overflow: hidden;
  padding: 0;
  display: block;
  color: #F2F4F1;
  text-align: left;
  border: 1px solid rgba(242, 244, 241, 0.14);
  border-radius: 14px;
  background:
    radial-gradient(circle at 66% 34%, rgba(112, 184, 165, 0.2), transparent 35%),
    linear-gradient(145deg, #121717, #121717);
  box-shadow: inset 0 1px rgba(242, 244, 241,.07), 0 12px 30px rgba(0, 0, 0,.2);
  cursor: pointer;
  outline: none;
  transform: translateZ(0);
  transition: transform .24s cubic-bezier(.16,1,.3,1), border-color .2s ease, box-shadow .24s ease;
}

.screen:hover,
.screen:focus-visible {
  z-index: 2;
  border-color: rgba(112, 184, 165,.85);
  box-shadow: inset 0 1px rgba(242, 244, 241,.12), 0 18px 38px rgba(0, 0, 0,.34), 0 0 24px rgba(112, 184, 165,.12);
  transform: translateY(-3px) scale(1.008);
}

.screen-media,
.screen-shade {
  position: absolute;
  inset: 0;
}

.screen-media {
  display: grid;
  place-items: center;
  background: #121717;
}

.screen-video,
.screen-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.screen-video {
  z-index: 1;
  object-fit: cover;
  opacity: 0;
  background: #000;
  transition: opacity .34s ease;
}

.screen-poster {
  z-index: 2;
  display: grid;
  place-items: center;
  opacity: 1;
  transition: opacity .34s ease, transform .46s cubic-bezier(.16,1,.3,1);
}

.screen.is-stream-live .screen-video { opacity: 1; }
.screen.is-stream-live .screen-poster { opacity: 0; }
.screen.is-stream-error .screen-poster { opacity: .72; }

.screen-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .72;
  transition: opacity .24s ease, transform .46s cubic-bezier(.16,1,.3,1);
}

.screen:hover .screen-media img,
.screen:focus-visible .screen-media img {
  opacity: .88;
  transform: scale(1.035);
}

.screen-monogram {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  color: rgba(242, 244, 241,.82);
  border: 1px solid rgba(112, 184, 165,.2);
  border-radius: 50%;
  background: rgba(18, 23, 23,.48);
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 0 34px rgba(112, 184, 165,.15);
}

.screen-shade {
  z-index: 3;
  background: linear-gradient(180deg, rgba(18, 23, 23,.08), rgba(18, 23, 23,.2) 36%, rgba(18, 23, 23,.92));
  pointer-events: none;
}

.screen-zone-number {
  position: absolute;
  top: 12px;
  left: 12px;
  min-width: 34px;
  height: 29px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  color: var(--yellow);
  border: 1px solid rgba(112, 184, 165,.28);
  border-radius: 999px;
  background: rgba(18, 23, 23,.72);
  font-size: 11px;
  font-weight: 800;
  backdrop-filter: blur(10px);
  z-index: 5;
}

.screen-live-state {
  position: absolute;
  z-index: 5;
  top: 12px;
  left: 56px;
  min-height: 29px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #B8C2BD;
  border: 1px solid rgba(242, 244, 241,.13);
  border-radius: 999px;
  background: rgba(18, 23, 23,.72);
  font-size: 9.5px;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.screen-live-state i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #70B8A5;
  box-shadow: 0 0 0 0 rgba(112, 184, 165,.38);
  animation: multiscreenPulse 1.25s ease-out infinite;
}

.screen.is-stream-live .screen-live-state i {
  background: #70B8A5;
  box-shadow: 0 0 12px rgba(112, 184, 165,.62);
  animation: none;
}

.screen.is-stream-error .screen-live-state { color: #ffd5d5; border-color: rgba(255, 108, 108,.28); }
.screen.is-stream-error .screen-live-state i { background: #ff6c6c; box-shadow: 0 0 10px rgba(255, 108, 108,.48); animation: none; }

@keyframes multiscreenPulse {
  70% { box-shadow: 0 0 0 7px rgba(112, 184, 165,0); }
  100% { box-shadow: 0 0 0 0 rgba(112, 184, 165,0); }
}

.screen-copy {
  position: absolute;
  right: 14px;
  bottom: 13px;
  left: 14px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 5;
}

.screen-copy strong,
.screen-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-copy strong { font-size: clamp(13px,1.25vw,17px); font-weight: 650; }
.screen-copy small { color: #70B8A5; font-size: 10.5px; }

.screen-change {
  position: absolute;
  top: 12px;
  right: 12px;
  min-height: 29px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #B8C2BD;
  border: 1px solid rgba(242, 244, 241,.13);
  border-radius: 999px;
  background: rgba(18, 23, 23,.7);
  font-size: 10px;
  font-weight: 700;
  backdrop-filter: blur(10px);
  z-index: 5;
}

.screen-change svg { width: 12px; height: 12px; }
.screen.is-empty .screen-change { color: var(--yellow); border-color: rgba(112, 184, 165,.28); }

.multiscreen-card { overflow: visible; }

.multiscreen-help {
  padding: 0 14px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.multiscreen-help > span { display: inline-flex; align-items: center; gap: 7px; }
.multiscreen-help svg { width: 15px; height: 15px; color: #70B8A5; }

.multiscreen-picker {
  width: min(1040px, 100%);
  max-height: min(860px, calc(100vh - 40px));
  padding: clamp(16px,2.2vw,24px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(18, 23, 23,.985), rgba(18, 23, 23,.99));
  box-shadow: inset 0 1px rgba(242, 244, 241,.12), 0 36px 100px rgba(0, 0, 0,.7);
  animation: detailDialogIn .34s cubic-bezier(.16,1,.3,1) both;
}

.multiscreen-picker-head,
.multiscreen-picker-tools,
.multiscreen-picker-meta,
.multiscreen-picker-foot {
  display: flex;
  align-items: center;
}

.multiscreen-picker-head { justify-content: space-between; gap: 18px; }
.multiscreen-picker-head > div { min-width: 0; }
.multiscreen-picker-head span { color: #70B8A5; font-size: 10px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.multiscreen-picker-head h3 { margin: 3px 0 2px; color: #F2F4F1; font-size: clamp(21px,2.2vw,30px); }
.multiscreen-picker-head p { margin: 0; color: var(--muted); font-size: 11px; }
.multiscreen-picker-head .source-icon-btn { width: 42px; height: 42px; flex: 0 0 auto; }
.multiscreen-picker-head .source-icon-btn svg { width: 19px; height: 19px; }

.multiscreen-picker-tools { margin-top: 18px; gap: 10px; }

.multiscreen-search {
  min-height: 46px;
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(18, 23, 23,.66);
}

.multiscreen-search:focus-within { border-color: rgba(112, 184, 165,.7); box-shadow: 0 0 0 3px rgba(112, 184, 165,.08); }
.multiscreen-search svg { width: 17px; height: 17px; flex: 0 0 auto; color: #70B8A5; }
.multiscreen-search input { width: 100%; color: #F2F4F1; border: 0; background: transparent; outline: 0; font: inherit; }
.multiscreen-search input::placeholder { color: #8b7b71; }

.multiscreen-group { min-width: min(260px, 32%); display: flex; flex-direction: column; gap: 3px; }
.multiscreen-group > span { color: var(--dim); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.multiscreen-group select { min-height: 40px; padding: 0 34px 0 10px; color: #F2F4F1; border: 1px solid var(--line); border-radius: 10px; background: #121717; outline: none; }
.multiscreen-group select:focus { border-color: var(--yellow); }

.multiscreen-picker-meta { padding: 10px 2px 8px; justify-content: space-between; color: var(--dim); font-size: 9.5px; }

.multiscreen-channel-grid {
  min-height: 180px;
  padding: 2px 4px 8px 2px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  align-content: start;
  gap: 8px;
  scrollbar-color: rgba(112, 184, 165,.32) transparent;
}

.multiscreen-channel-choice {
  min-width: 0;
  min-height: 68px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #F2F4F1;
  text-align: left;
  border: 1px solid rgba(242, 244, 241,.1);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(18, 23, 23,.75), rgba(18, 23, 23,.84));
  cursor: pointer;
  outline: none;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.multiscreen-channel-choice:hover,
.multiscreen-channel-choice:focus-visible { border-color: var(--yellow); background: linear-gradient(135deg, rgba(55, 65, 42,.74), rgba(18, 23, 23,.9)); transform: translateY(-2px); }
.multiscreen-channel-choice:disabled { opacity: .42; cursor: not-allowed; }

.channel-choice-art {
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(242, 244, 241,.1);
  border-radius: 10px;
  color: #70B8A5;
  background: rgba(18, 23, 23,.68);
  font-weight: 800;
}

.channel-choice-art img { width: 100%; height: 100%; object-fit: contain; }
.channel-choice-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.channel-choice-copy strong,
.channel-choice-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-choice-copy strong { font-size: 12.5px; font-weight: 600; }
.channel-choice-copy small { color: var(--muted); font-size: 9.5px; }
.channel-choice-state { flex: 0 0 auto; color: var(--yellow); font-size: 9px; font-weight: 700; }
.channel-choice-state svg { width: 16px; height: 16px; }

.multiscreen-picker-empty { grid-column: 1/-1; min-height: 180px; display: grid; place-items: center; align-content: center; gap: 7px; color: var(--muted); text-align: center; }
.multiscreen-picker-empty svg { width: 34px; height: 34px; color: #70B8A5; }
.multiscreen-picker-empty strong { color: #F2F4F1; font-size: 14px; }
.multiscreen-picker-empty span { font-size: 11px; }
.multiscreen-picker-foot { min-height: 49px; padding-top: 10px; justify-content: space-between; gap: 10px; }

.language-grid,
.profile-grid,
.source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 11px;
}

/* Language is a compact selector, not a gallery of oversized cards. */
.language-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px 16px;
  padding: 10px;
}

.language-card {
  min-height: 48px;
  padding: 7px 10px;
  border-color: transparent;
  border-radius: 9px;
  background: transparent;
}

.language-flag {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  font-size: 18px;
}

.language-card .card-copy small {
  display: none;
}

.language-card,
.profile-card,
.source-card {
  min-height: 70px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #F2F4F1;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(242, 244, 241, 0.035);
  cursor: pointer;
  outline: none;
}

.language-card:hover,
.language-card:focus-visible,
.profile-card:hover,
.profile-card:focus-visible,
.source-card:hover,
.source-card:focus-visible,
.language-card.active,
.profile-card.active,
.source-card.active {
  border-color: rgba(112, 184, 165, 0.72);
  background: var(--yellow-soft);
}

.language-flag,
.profile-avatar,
.source-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(242, 244, 241, 0.14);
  border-radius: 11px;
  background: rgba(18, 23, 23, 0.75);
  font-size: 19px;
}

.profile-avatar {
  color: #121717;
  background: linear-gradient(145deg, #70B8A5, #70B8A5);
  font-weight: 900;
}

.card-copy {
  min-width: 0;
  flex: 1;
}

.card-copy strong,
.card-copy small {
  display: block;
}

.card-copy strong {
  margin-bottom: 3px;
  font-size: 14px;
}

.card-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-mark {
  color: var(--yellow);
  font-size: 17px;
  font-weight: 800;
}

.empty-state,
.confirmation-card,
.legal-document {
  padding: clamp(23px, 4vw, 44px) 20px;
  text-align: center;
}

.empty-state-icon,
.confirmation-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  color: var(--yellow);
  background: rgba(242, 244, 241, 0.045);
}

.empty-state-icon svg,
.confirmation-icon svg {
  width: 25px;
  height: 25px;
}

.empty-state h3,
.confirmation-card h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

.empty-state p,
.confirmation-card p,
.legal-document p {
  max-width: 580px;
  margin: 0 auto 22px;
  color: var(--muted);
  line-height: 1.6;
}

.inbox-item {
  cursor: pointer;
}

.inbox-item.unread::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 10px rgba(112, 184, 165, 0.7);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(112, 184, 165, 0.28);
  border-radius: 999px;
  color: #70B8A5;
  background: rgba(112, 184, 165, 0.1);
  font-size: 11px;
  font-weight: 700;
}

.status-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.legal-document {
  text-align: left;
}

.legal-document h3 {
  margin: 0 0 14px;
  color: #F2F4F1;
  font-size: 18px;
}

.legal-document p {
  max-width: none;
  margin-bottom: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  transform: translate(-50%, 16px);
  padding: 11px 16px;
  color: #F2F4F1;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(18, 23, 23, 0.94);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 23, 23, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.dialog-card {
  width: min(400px, 100%);
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(18, 23, 23, 0.98), rgba(18, 23, 23, 0.98));
  box-shadow: inset 0 1px rgba(242, 244, 241, 0.14), 0 30px 80px rgba(0, 0, 0, 0.62);
}

.dialog-card h3 {
  margin: 0 0 7px;
  font-size: 20px;
}

.dialog-card p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
}

/* ========================================================================== 
   Netflix / Zen Profile Experience
   ========================================================================== */
.profiles-stage {
  min-height: calc(100vh - 112px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 64px;
  text-align: center;
}

.profiles-heading { margin-bottom: 38px; }

.profiles-heading p {
  max-width: 520px;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.profiles-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--yellow);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.8px;
}

.profiles-heading h2 {
  margin: 0;
  color: #F2F4F1;
  font-size: clamp(32px, 4.2vw, 56px);
  font-weight: 500;
  letter-spacing: -.01em;
  text-shadow: 0 4px 16px rgba(0, 0, 0, .6);
}

.source-setup-intro h2,
.source-manager-head h2 {
  margin: 0 0 7px;
  color: #F2F4F1;
  font-size: clamp(25px, 2.7vw, 38px);
  font-weight: 500;
  letter-spacing: -.7px;
}

.source-setup-intro p,
.source-manager-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.profile-picker-grid {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  gap: 28px;
}

.profile-picker-card {
  width: clamp(110px, 12vw, 145px);
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: #808080;
  border: 0;
  background: transparent;
  cursor: pointer;
  outline: none;
  transition: transform .22s cubic-bezier(.33, 1, .68, 1), color .18s ease;
}

.profile-face-wrap {
  position: relative;
  width: clamp(110px, 12vw, 145px);
  height: clamp(110px, 12vw, 145px);
}

.profile-face {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #F2F4F1;
  border: 3.5px solid transparent;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.profile-face.blue { background: linear-gradient(135deg, #70B8A5, #23312E); }
.profile-face.yellow { background: linear-gradient(135deg, #70B8A5, #23312E); }
.profile-face.red { background: linear-gradient(135deg, #ef5261, #a71638); }
.profile-face.teal { background: linear-gradient(135deg, #70B8A5, #121717); }
.profile-face.green { background: linear-gradient(135deg, #2ecc71, #196f3d); }
.profile-face.purple { background: linear-gradient(135deg, #B8C2BD, #23312E); }
.profile-face.pink { background: linear-gradient(135deg, #ff75ad, #a72d68); }
.profile-face.orange { background: linear-gradient(135deg, #70B8A5, #23312E); }
.profile-face.cyan { background: linear-gradient(135deg, #70B8A5, #23312E); }
.profile-face.slate { background: linear-gradient(135deg, #23312E, #121717); }
.profile-face.gold { background: linear-gradient(135deg, #70B8A5, #121717); }
.profile-face.ruby { background: linear-gradient(135deg, #e94162, #83152f); }

.netflix-face-svg {
  width: 80%;
  height: 80%;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .3));
}

.profile-picker-card:hover,
.profile-picker-card:focus-visible { color: #F2F4F1; }

.profile-picker-card:hover .profile-face,
.profile-picker-card:focus-visible .profile-face {
  border-color: #F2F4F1;
  transform: scale(1.06);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .7);
}

.profile-picker-card.active .profile-face { border-color: var(--yellow); }

.profile-picker-card strong {
  font-size: 16px;
  font-weight: 500;
  color: inherit;
}

.profile-picker-card > small {
  margin-top: -10px;
  color: rgba(242, 244, 241, .48);
  font-size: 10px;
  font-weight: 500;
}

.profile-security-note {
  margin: 23px 0 0;
  color: rgba(242, 244, 241, .58);
  font-size: 11px;
}

.profile-security-note.warning { color: #70B8A5; }

.kids-access-card { padding: 0 !important; overflow: hidden; }

.kids-access-intro {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(112, 184, 165, .08), transparent 70%);
}

.kids-access-intro strong { color: #F2F4F1; font-size: 15px; }
.kids-access-intro span { color: var(--muted); font-size: 11px; line-height: 1.5; }

.kids-access-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }

.kids-access-column { min-width: 0; border-right: 1px solid var(--line); }
.kids-access-column:last-child { border-right: 0; }

.kids-access-heading {
  min-height: 66px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  column-gap: 9px;
  border-bottom: 1px solid var(--line);
  background: rgba(242, 244, 241, .025);
}

.kids-access-heading > span {
  grid-row: 1 / 3;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--yellow);
}

.kids-access-heading svg { width: 21px; height: 21px; }
.kids-access-heading strong { color: #F2F4F1; font-size: 13px; }
.kids-access-heading small { color: var(--muted); font-size: 9px; }

.kids-access-options { max-height: 280px; overflow: auto; scrollbar-width: thin; }

.kids-access-option {
  min-height: 54px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(242, 244, 241, .055);
  cursor: pointer;
  transition: background .18s ease;
}

.kids-access-option:hover { background: rgba(242, 244, 241, .045); }
.kids-access-option input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--yellow); }
.kids-access-option span { min-width: 0; }
.kids-access-option strong,
.kids-access-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kids-access-option strong { color: rgba(242, 244, 241, .88); font-size: 11px; font-weight: 600; }
.kids-access-option small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.kids-access-empty { padding: 20px 14px; color: var(--muted); font-size: 11px; }
.parent-lock-card { min-height: min(460px, calc(100vh - 180px)); display: grid; place-content: center; }

.profile-active-check {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 3;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  color: #141414;
  border: 2px solid rgba(18, 23, 23, .75);
  border-radius: 50%;
  background: var(--yellow);
  font-size: 12px;
  font-weight: 900;
}

.profile-edit-layer {
  position: absolute;
  inset: 3.5px;
  z-index: 2;
  display: grid;
  place-items: center;
  color: #F2F4F1;
  border-radius: 5px;
  background: rgba(0, 0, 0, .65);
}

.profile-edit-layer svg { width: 32px; height: 32px; }

.profile-picker-add .profile-face {
  color: rgba(242, 244, 241, .48);
  border: 2px dashed rgba(242, 244, 241, .28);
  background: rgba(242, 244, 241, .04);
  box-shadow: none;
}

.profile-picker-add .profile-face svg { width: 44px; height: 44px; }
.profile-picker-add:hover .profile-face { color: #F2F4F1; background: rgba(242, 244, 241, .12); }

.profile-manage-actions { margin-top: 50px; }

.profile-manage-btn {
  padding: 11px 32px;
  color: #808080;
  border: 1px solid rgba(242, 244, 241, .4);
  border-radius: 4px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
}

.profile-manage-btn:hover,
.profile-manage-btn:focus-visible { color: #F2F4F1; border-color: #F2F4F1; }
.profile-manage-btn.active { color: #141414; border-color: #F2F4F1; background: #F2F4F1; }

/* Add/Edit is a full Netflix-style page, not a dialog card. */
.netflix-profile-page {
  position: fixed;
  inset: 0;
  z-index: 300;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 42%, #121717 0%, #121717 48%, #121717 100%);
}

.netflix-profile-form {
  width: 100%;
  max-width: 580px;
  margin: auto;
  color: #F2F4F1;
  text-align: left;
  animation: profilePageIn .28s ease both;
}

@keyframes profilePageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.netflix-profile-form > h2 {
  margin: 0 0 6px;
  font-size: clamp(34px, 4.5vw, 54px);
  font-weight: 500;
  letter-spacing: -.01em;
}

.netflix-profile-subtitle {
  margin: 0 0 28px;
  padding-bottom: 16px;
  color: #808080;
  border-bottom: 1px solid rgba(242, 244, 241, .15);
  font-size: 15px;
}

.netflix-profile-body {
  margin-bottom: 36px;
  display: flex;
  align-items: flex-start;
  gap: 28px;
}

.netflix-avatar-column {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #808080;
  font-size: 13px;
}

.netflix-avatar-button {
  position: relative;
  width: 110px;
  height: 110px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

#profileAvatarPreview {
  width: 110px;
  height: 110px;
  display: block;
}

#profileAvatarPreview .profile-face.large {
  width: 110px;
  height: 110px;
  display: flex;
}

.netflix-avatar-button:hover .profile-face,
.netflix-avatar-button:focus-visible .profile-face {
  border-color: #F2F4F1;
  transform: scale(1.06);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .7);
}

.netflix-avatar-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #121717;
  border: 2px solid #141414;
  border-radius: 50%;
  background: #F2F4F1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .4);
}

.netflix-avatar-badge svg { width: 15px; height: 15px; }

.netflix-profile-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.netflix-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #808080;
  font-size: 13px;
  font-weight: 500;
}

.netflix-field input,
.netflix-select-button {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  color: #F2F4F1;
  border: 1px solid rgba(242, 244, 241, .2);
  border-radius: 4px;
  background: rgba(242, 244, 241, .08);
  outline: none;
  font-size: 15px;
  transition: border-color .2s ease, background .2s ease;
}

.netflix-select-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.netflix-select-button svg { width: 17px; height: 17px; }
.netflix-field input:focus,
.netflix-select-button:hover,
.netflix-select-button:focus-visible { border-color: #F2F4F1; background: rgba(242, 244, 241, .12); }

.netflix-kids-row {
  margin-top: 6px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(242, 244, 241, .1);
  border-radius: 4px;
  background: rgba(242, 244, 241, .03);
  cursor: pointer;
}

.netflix-kids-row input { width: 20px; height: 20px; accent-color: var(--yellow); cursor: pointer; }
.netflix-kids-row strong,
.netflix-kids-row small { display: block; }
.netflix-kids-row strong { font-size: 14px; }
.netflix-kids-row small { margin-top: 2px; color: #808080; font-size: 12px; }

.netflix-profile-actions {
  padding-top: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-top: 1px solid rgba(242, 244, 241, .15);
}

.netflix-save-button,
.netflix-cancel-button,
.netflix-delete-button {
  padding: 11px 28px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
}

.netflix-save-button {
  color: #121717;
  border: 1px solid #70B8A5;
  background: linear-gradient(120deg, #70B8A5, #70B8A5);
}
.netflix-save-button:hover { background: #70B8A5; }
.netflix-cancel-button {
  color: #F2F4F1;
  border: 1px solid rgba(112, 184, 165, .4);
  background: #121717;
}
.netflix-cancel-button:hover { color: #F2F4F1; border-color: #70B8A5; background: #121717; }
.netflix-save-button,
.netflix-cancel-button { min-height: 44px; }
.netflix-save-button:focus-visible,
.netflix-cancel-button:focus-visible {
  outline: 2px solid #70B8A5;
  outline-offset: 3px;
}
.netflix-delete-button { margin-left: auto; color: #ff5d68; border: 1px solid rgba(255, 93, 104, .45); background: transparent; }
.netflix-delete-button:hover { border-color: #ff5d68; background: rgba(255, 93, 104, .12); }

.netflix-choice-page {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow-y: auto;
  padding: 38px 28px 56px;
  background: radial-gradient(circle at 50% 42%, #121717 0%, #121717 48%, #121717 100%);
}

.netflix-choice-page.is-hidden { display: none !important; }
.netflix-choice-inner { width: min(860px, 100%); margin: 0 auto; text-align: center; }
.netflix-choice-inner h2 { margin: 30px 0 38px; color: #F2F4F1; font-size: clamp(34px, 4vw, 52px); font-weight: 500; }

.netflix-choice-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  float: left;
  padding: 9px 14px;
  color: #b8b8b8;
  border: 1px solid rgba(242, 244, 241, .25);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.netflix-choice-back:hover { color: #F2F4F1; border-color: #F2F4F1; }
.netflix-choice-back svg { width: 18px; height: 18px; }

.netflix-avatar-grid {
  clear: both;
  display: grid;
  grid-template-columns: repeat(6, minmax(90px, 1fr));
  gap: 24px 20px;
}

.netflix-avatar-option {
  min-width: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  color: #808080;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.netflix-avatar-option .profile-face { width: 100%; height: auto; aspect-ratio: 1; }
.netflix-avatar-option > span:last-child { font-size: 12px; }
.netflix-avatar-option:hover { color: #F2F4F1; }
.netflix-avatar-option:hover .profile-face { border-color: #F2F4F1; transform: scale(1.04); }
.netflix-avatar-option.selected .profile-face { border-color: var(--yellow); }

.netflix-language-choice { width: min(520px, 100%); }
.netflix-language-list { clear: both; border-top: 1px solid rgba(242, 244, 241, .14); }
.netflix-language-option {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #aaa;
  border: 0;
  border-bottom: 1px solid rgba(242, 244, 241, .1);
  background: transparent;
  font-size: 16px;
  cursor: pointer;
}
.netflix-language-option:hover,
.netflix-language-option.selected { color: #F2F4F1; }
.netflix-language-option.selected span:last-child { color: var(--yellow); }

/* ========================================================================== 
   Full IPTV Source Setup & Manager
   ========================================================================== */
.source-setup-intro,
.source-manager-head {
  margin-bottom: 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.source-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.source-type-card {
  position: relative;
  min-height: 94px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #F2F4F1;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(18, 23, 23,.73), rgba(18, 23, 23,.82));
  cursor: pointer;
  outline: none;
  transition: border-color .18s ease, transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.source-type-card:hover,
.source-type-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(242, 244, 241,.34);
}

.source-type-card.selected {
  border-color: rgba(112, 184, 165,.8);
  background: linear-gradient(145deg, rgba(67, 74, 38,.55), rgba(18, 23, 23,.92));
  box-shadow: 0 0 22px rgba(112, 184, 165,.1);
}

.source-type-icon,
.source-manager-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--yellow);
  border: 1px solid rgba(112, 184, 165,.2);
  border-radius: 11px;
  background: rgba(112, 184, 165,.08);
}

.source-type-icon svg,
.source-manager-icon svg {
  width: 19px;
  height: 19px;
}

.source-type-card strong,
.source-type-card small {
  display: block;
}

.source-type-card strong { margin-bottom: 4px; font-size: 13px; font-weight: 600; }
.source-type-card small { color: var(--muted); font-size: 10.5px; line-height: 1.25; }

.source-type-check {
  position: absolute;
  top: 9px;
  right: 9px;
  color: var(--yellow);
  font-size: 13px;
  font-weight: 900;
}

.source-content-options .setting-row {
  min-height: 56px;
}

.source-setup-actions {
  margin-top: -4px;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.source-setup-actions button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.source-setup-actions svg {
  width: 15px;
  height: 15px;
}

.source-manager-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.source-manager-card {
  min-height: 72px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(18, 23, 23,.7), rgba(18, 23, 23,.82));
  box-shadow: inset 0 1px rgba(242, 244, 241,.06), 0 10px 28px rgba(0, 0, 0,.18);
}

.source-manager-card.active {
  border-color: rgba(112, 184, 165,.5);
  background: linear-gradient(145deg, rgba(48, 61, 39,.5), rgba(18, 23, 23,.9));
}

.source-manager-main {
  min-width: 0;
  flex: 1;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #F2F4F1;
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.source-manager-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.source-manager-copy strong { font-size: 14px; font-weight: 600; }
.source-manager-copy small { overflow: hidden; color: var(--muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.source-manager-copy > span { color: var(--dim); font-size: 9.5px; }

.source-manager-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
}

.source-active-badge {
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #70B8A5;
  border: 1px solid rgba(112, 184, 165,.25);
  border-radius: 999px;
  background: rgba(112, 184, 165,.09);
  font-size: 10px;
  font-weight: 700;
}

.source-active-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 7px rgba(112, 184, 165,.75);
}

.source-mini-btn,
.source-icon-btn {
  height: 32px;
  color: #F2F4F1;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(242, 244, 241,.055);
  cursor: pointer;
}

.source-mini-btn { padding: 0 11px; font-size: 11px; font-weight: 600; }
.source-icon-btn { width: 32px; display: grid; place-items: center; }
.source-icon-btn svg { width: 15px; height: 15px; }
.source-icon-btn:hover, .source-mini-btn:hover { border-color: rgba(112, 184, 165,.65); color: var(--yellow); }
.source-icon-btn:focus-visible, .source-mini-btn:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
  border-color: rgba(112, 184, 165,.75);
  color: var(--yellow);
}
.source-icon-btn:disabled, .source-mini-btn:disabled {
  opacity: .42;
  cursor: not-allowed;
  filter: saturate(.4);
}
.source-icon-btn.danger { color: #ff7a83; border-color: rgba(255, 93, 104,.22); }
.source-icon-btn.testing { color: var(--yellow); }
.source-icon-btn.success { color: var(--success); }

.recording-actions {
  flex-wrap: nowrap;
}

.recording-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.recording-play-btn svg {
  width: 15px;
  height: 15px;
}

.recording-player-open {
  overflow: hidden;
}

.recording-player-overlay {
  padding: clamp(14px, 3vw, 36px);
}

.recording-player-card {
  width: min(920px, 100%);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(18, 23, 23, .98), rgba(18, 23, 23, .99)),
    repeating-linear-gradient(90deg, rgba(242, 244, 241, .018) 0 1px, transparent 1px 7px);
  box-shadow: inset 0 1px rgba(242, 244, 241, .13), 0 34px 100px rgba(0, 0, 0, .72);
  animation: detailDialogIn .34s cubic-bezier(.16, 1, .3, 1) both;
}

.recording-player-head {
  min-height: 78px;
  padding: 15px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.recording-player-head h3 {
  margin: 3px 0 1px;
  color: var(--text);
  font-size: clamp(18px, 2.2vw, 26px);
  line-height: 1.1;
}

.recording-player-head p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.recording-player-head [data-recording-close] {
  flex: 0 0 auto;
  font-size: 24px;
  line-height: 1;
}

.recording-player-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-top: 1px solid var(--line);
  background: #121717;
}

.recording-player-frame video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
  outline: none;
}

.recording-player-frame video:focus-visible {
  box-shadow: inset 0 0 0 3px var(--yellow);
}

.recording-player-status {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  padding: 7px 11px;
  color: #B8C2BD;
  border: 1px solid rgba(242, 244, 241, .12);
  border-radius: 999px;
  background: rgba(18, 23, 23, .78);
  font-size: 10px;
  pointer-events: none;
}

.source-manager-note {
  margin-top: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--dim);
  font-size: 10px;
}

.source-manager-note svg {
  width: 13px;
  height: 13px;
}

.account-summary {
  padding-top: 18px;
}

.account-summary h3 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: clamp(21px, 2vw, 28px);
}

.account-summary p {
  margin: 0;
  color: var(--muted);
}

.diagnostic-grid .row-value {
  color: #70B8A5;
}

.setting-row .source-mini-btn,
.setting-row .source-icon-btn {
  flex: 0 0 auto;
}

@media (max-width: 760px) {
  /* Keep every Settings action comfortably tappable even in WebViews that
     do not expose a reliable coarse-pointer media query. */
  .detail-main button,
  .detail-main a[href] {
    min-height: 44px;
  }

  .detail-main .source-icon-btn {
    min-width: 44px;
  }

  .kids-access-grid { grid-template-columns: 1fr; }
  .kids-access-column { border-right: 0; border-bottom: 1px solid var(--line); }
  .kids-access-options { max-height: 220px; }
  .detail-header {
    position: sticky;
    height: auto;
    min-height: 60px;
    padding: max(10px, env(safe-area-inset-top)) 14px 10px;
    gap: 8px;
    background: linear-gradient(to bottom, rgba(18, 23, 23, .98), rgba(18, 23, 23, .92));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .back-pill {
    min-width: 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
  }

  .back-pill span,
  .header-clock,
  .home-pill {
    display: none;
  }

  .source-status-pill {
    display: none;
  }

  .header-weather {
    display: none;
  }

  .header-avatar {
    width: 40px;
    height: 40px;
  }

  .detail-title {
    max-width: 62vw;
    overflow: hidden;
    font-size: 18px;
    text-overflow: ellipsis;
  }

  .detail-main {
    width: calc(100% - 28px);
    padding: 16px 0 calc(38px + env(safe-area-inset-bottom));
  }

  .page-intro {
    margin-bottom: 20px;
    padding: 22px;
    border-radius: 20px;
  }

  .page-intro-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 14px;
  }

  .setting-row {
    min-height: 62px;
    padding: 10px 11px;
    gap: 9px;
  }

  .row-icon {
    width: 34px;
    height: 34px;
    display: grid;
    border-radius: 9px;
  }

  .row-icon svg { width: 17px; height: 17px; }
  .row-left { gap: 9px; }
  .row-title { font-size: 13.5px; }
  .row-subtitle { font-size: 10.5px; line-height: 1.25; }

  .row-value {
    max-width: 92px;
    font-size: 10.5px;
  }

  .setting-row:has(.source-mini-btn, .source-icon-btn) .row-value {
    display: none;
  }

  .recording-row {
    align-items: flex-start;
  }

  .recording-actions {
    align-self: center;
    gap: 6px;
  }

  .recording-play-btn span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .recording-play-btn {
    width: 44px;
    justify-content: center;
    padding: 0;
  }

  .recording-player-overlay {
    padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
  }

  .recording-player-card {
    border-radius: 15px;
  }

  .recording-player-head {
    min-height: 66px;
    padding: 10px 12px;
  }

  .field-grid,
  .profile-grid,
  .source-grid {
    grid-template-columns: 1fr;
  }

  .language-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .group-card { border-radius: 13px; }
  .settings-sections { gap: 18px; }
  .group-label { margin-left: 5px; }
  .form-card { padding: 14px; }
  .field input,
  .field select { min-height: 46px; }
  .form-actions { flex-wrap: wrap; }

  .profiles-stage {
    min-height: auto;
    padding: 30px 0 46px;
  }

  .profiles-heading { margin-bottom: 28px; }
  .profiles-heading h2 { font-size: 34px; }

  .profile-picker-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-picker-card {
    width: 100%;
  }

  .profile-manage-actions { margin-top: 34px; }

  .netflix-profile-page {
    align-items: flex-start;
    padding: calc(34px + env(safe-area-inset-top)) 18px calc(32px + env(safe-area-inset-bottom));
  }

  .netflix-profile-form > h2 { font-size: 36px; }
  .netflix-profile-subtitle { margin-bottom: 22px; font-size: 13px; }

  .netflix-profile-body {
    flex-direction: column;
  }

  .netflix-avatar-column {
    align-self: center;
  }

  .netflix-profile-fields {
    width: 100%;
  }

  .netflix-profile-actions {
    flex-wrap: wrap;
  }

  .netflix-save-button,
  .netflix-cancel-button { flex: 1; min-width: 120px; }

  .netflix-delete-button {
    width: 100%;
    margin-left: 0;
  }

  .netflix-avatar-grid {
    grid-template-columns: repeat(3, minmax(82px, 1fr));
    gap: 18px 12px;
  }

  .netflix-choice-page { padding: calc(22px + env(safe-area-inset-top)) 14px calc(36px + env(safe-area-inset-bottom)); }
  .netflix-choice-inner h2 { margin: 24px 0 30px; font-size: 34px; }

  .source-setup-intro,
  .source-manager-head,
  .source-manager-card {
    align-items: stretch;
    flex-direction: column;
  }

  .source-type-grid {
    grid-template-columns: 1fr;
  }

  .source-manager-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
    width: 100%;
  }

  .source-setup-actions { flex-wrap: wrap; }
  .source-setup-actions button { flex: 1; justify-content: center; min-height: 44px; }
  .source-manager-main { width: 100%; }

  .multiscreen-preview {
    min-height: 430px;
  }

  .screen {
    min-height: 120px;
  }

  .dialog-overlay { padding: 14px; }
  .dialog-card { border-radius: 14px; }
}

/* ========================================================================== 
   Detail Motion System — clear hierarchy without slowing down TV navigation
   ========================================================================== */
body.detail-page-mounted .detail-header {
  animation: detailHeaderIn 0.56s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.detail-ui-ready .page-intro,
body.detail-ui-ready .profiles-heading,
body.detail-ui-ready .source-setup-intro {
  animation: detailIntroIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

body.detail-ui-ready .group-card,
body.detail-ui-ready .language-card,
body.detail-ui-ready .profile-picker-card,
body.detail-ui-ready .source-manager-card,
body.detail-ui-ready .multiscreen-preview,
body.detail-ui-ready .legal-document,
body.detail-ui-ready .empty-state,
body.detail-ui-ready .confirmation-card {
  animation: detailCardIn 0.48s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  animation-delay: calc(60ms + min(var(--detail-motion-index, 0), 8) * 38ms);
}

.group-card,
.language-card,
.profile-picker-card,
.source-manager-card,
.multiscreen-preview,
.legal-document,
.confirmation-card {
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.24s ease;
}

.group-card:focus-within,
.source-manager-card:focus-within,
.multiscreen-preview:focus-within {
  border-color: rgba(112, 184, 165, 0.38);
  box-shadow: inset 0 1px rgba(242, 244, 241, 0.09), 0 20px 48px rgba(0, 0, 0, 0.28), 0 0 24px rgba(112, 184, 165, 0.08);
}

.setting-row::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(242, 244, 241, 0.075) 49%, transparent 68%);
  transform: translateX(-55%);
}

button.setting-row:hover::after,
a.setting-row:hover::after,
.setting-row:focus-visible::after,
.setting-row:focus-within::after {
  animation: detailRowSheen 0.62s cubic-bezier(0.16, 1, 0.3, 1) both;
}

button:active,
.back-pill:active,
.home-pill:active,
.header-avatar:active,
.source-status-pill:active {
  transform: scale(0.965);
  transition-duration: 80ms;
}

.row-icon,
.source-manager-icon,
.page-intro-icon {
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

button.setting-row:hover .row-icon,
a.setting-row:hover .row-icon,
.setting-row:focus-visible .row-icon,
.setting-row:focus-within .row-icon {
  color: var(--yellow);
  border-color: rgba(112, 184, 165, 0.35);
  background: rgba(112, 184, 165, 0.09);
  transform: scale(1.08) rotate(-3deg);
}

.zen-toggle span::before {
  transition-timing-function: cubic-bezier(0.16, 1.35, 0.3, 1);
  transition-duration: 0.26s;
}

.dialog-card {
  animation: detailDialogIn 0.34s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.netflix-profile-page {
  animation: detailOverlayIn 0.28s ease both;
}

.netflix-profile-form,
.netflix-choice-inner {
  animation: detailDialogIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.profile-picker-card:hover .profile-face,
.profile-picker-card:focus-visible .profile-face {
  animation: detailAvatarSettle 0.46s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes detailHeaderIn {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes detailIntroIn {
  from { opacity: 0; transform: translate3d(0, 14px, 0); filter: blur(5px); }
  to { opacity: 1; transform: translate3d(0, 0, 0); filter: blur(0); }
}

@keyframes detailCardIn {
  from { opacity: 0; transform: translate3d(0, 18px, 0) scale(0.982); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes detailRowSheen {
  0% { opacity: 0; transform: translateX(-55%); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: translateX(55%); }
}

@keyframes detailDialogIn {
  from { opacity: 0; transform: translate3d(0, 18px, 0) scale(0.965); filter: blur(4px); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); filter: blur(0); }
}

@keyframes detailOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes detailAvatarSettle {
  0% { transform: scale(0.94) rotate(-3deg); }
  70% { transform: scale(1.045) rotate(1.5deg); }
  100% { transform: scale(1) rotate(0); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 900px) {
  .multiscreen-channel-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 620px) {
  .multiscreen-preview { min-height: 360px; gap: 7px; padding: 8px; }
  .multiscreen-preview[data-count="3"] .screen:first-child { grid-column: 1 / -1; grid-row: auto; }
  .screen { min-height: 108px; border-radius: 12px; }
  .screen-zone-number { top: 8px; left: 8px; height: 26px; }
  .screen-change { top: 8px; right: 8px; min-height: 26px; font-size: 0; }
  .screen-change svg { width: 14px; height: 14px; }
  .screen-copy { right: 10px; bottom: 9px; left: 10px; }
  .screen-copy small { display: none; }
  .multiscreen-help { align-items: stretch; flex-direction: column; }
  .multiscreen-help .secondary-btn { width: 100%; }
  .multiscreen-picker-overlay { padding: 0; place-items: stretch; }
  .multiscreen-picker { width: 100%; max-height: 100dvh; min-height: 100dvh; padding: calc(16px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)); border: 0; border-radius: 0; }
  .multiscreen-picker-tools { align-items: stretch; flex-direction: column; }
  .multiscreen-group { width: 100%; min-width: 0; }
  .multiscreen-channel-grid { grid-template-columns: 1fr; }
  .multiscreen-channel-choice { min-height: 66px; }
  .multiscreen-picker-foot { position: sticky; bottom: 0; background: linear-gradient(180deg, transparent, rgba(18, 23, 23,.98) 24%); }
}

/* Profile selection stays in place while the shell changes routes. */
body[data-setting-page='profiles'].detail-ui-ready :is(.profiles-heading,.profile-picker-card) {animation:none}

/* Avoid staggered re-entry and shifting controls when settings routes are reused. */
body.detail-page-mounted .detail-header,
body.detail-ui-ready :is(.page-intro,.profiles-heading,.source-setup-intro,.group-card,.language-card,.profile-picker-card,.source-manager-card,.multiscreen-preview,.legal-document,.empty-state,.confirmation-card) {
 animation: none !important;
 filter: none;
 transform: none;
}

/* Keep playlist setup inside the Settings content card. */
.source-wizard-open [data-guide-tools] { display: none !important; }
.source-wizard { padding: clamp(20px, 3vw, 44px); color: var(--text); }
.source-wizard header { display: flex; align-items: center; gap: 24px; margin-bottom: 28px; }
.source-wizard h2 { margin: 0; font-size: clamp(24px, 2vw, 36px); }
.source-wizard p { color: var(--muted); line-height: 1.5; }
.source-wizard-choices { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; margin-top: 28px; }
.source-wizard-choices.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.source-wizard-choice { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 28px 18px; min-height: 210px; border: 1px solid var(--line); border-radius: 16px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.source-wizard-choice svg { width: 44px; height: 44px; }
.source-wizard-choice strong { font-size: 20px; }
.source-wizard-choice span { font-size: 16px; line-height: 1.5; color: var(--muted); }
.source-wizard-choice:hover, .source-wizard-choice:focus-visible { border-color: #70b8a5; background: rgba(112,184,165,.12); outline: 2px solid #70b8a5; outline-offset: 2px; }
.source-wizard #sourceForm { max-width: 640px; margin: 24px auto 0; }
.source-wizard .field { margin-bottom: 18px; }
.source-wizard #sourceForm > .primary-btn { width: 100%; margin-top: 12px; }
.source-wizard [hidden] { display: none !important; }
.source-wizard-file { border: 1px dashed var(--line-strong); border-radius: 14px; padding: 24px; }
.source-wizard-loading, .source-wizard-success { text-align: center; padding: 48px 16px; }
.source-wizard-success > span { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; color: #082827; background: #70b8a5; font-size: 40px; }
.source-wizard-spinner { display: inline-block; width: 60px; height: 60px; border: 5px solid rgba(112,184,165,.2); border-top-color: #70b8a5; border-radius: 50%; animation: source-connecting 1s linear infinite; }
.source-wizard-pair { display: grid; grid-template-columns: minmax(140px,240px) 1fr; align-items: center; gap: 32px; }
.source-wizard-pair svg { display: block; width: 100%; height: auto; background: white; }
.source-wizard-pair a { color: inherit; }
.source-wizard-pair strong { font-size: 28px; letter-spacing: .1em; }
@keyframes source-connecting { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .source-wizard-spinner { animation: none; } }
@media (max-width: 900px) { .source-wizard-choices, .source-wizard-choices.two, .source-wizard-pair { grid-template-columns: 1fr; } .source-wizard-choice { min-height: 140px; } }
.source-wizard .field label { font-size: 16px; }
.source-wizard .field input { font-size: 16px; min-height: 48px; }
.source-wizard .primary-btn, .source-wizard .secondary-btn { font-size: 16px; }
