/* TV setup and device management; independent of the full-screen TV player. */
#screensView {
  --screen-surface: #fff;
  --screen-soft: #f7f9fc;
  --screen-border: #dfe6ef;
  --screen-accent: #0866ff;
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 24px;
  padding: 28px 28px 104px;
}
#screensView .screens-page-header { display: flex; align-items: center; justify-content: space-between; gap: 28px; min-height: 130px; }
#screensView h1 { margin: 0 0 10px; font-size: 1.8rem; letter-spacing: -.04em; }
#screensView p { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.65; }
#screensView .screens-page-header p { font-size: .9375rem; }
.screen-illustration { flex: 0 0 210px; padding: 2px 12px 0; }
.screen-illustration-display { position: relative; padding: 12px; border: 4px solid #263d57; border-radius: 10px; background: #071a2c; transform: rotate(-3deg); }
.screen-illustration-display img { display: block; width: 61px; height: auto; margin-bottom: 10px; }
.screen-illustration-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; }
.screen-illustration-now { padding: 10px; border-radius: 4px; background: #132f46; }
.screen-illustration-now i { display: block; width: 18px; height: 4px; margin-bottom: 8px; background: #5cc4d2; border-radius: 1px; }
.screen-illustration-now b { display: block; width: 85%; height: 4px; margin: 4px 0; background: #d9e7f0; border-radius: 1px; }
.screen-illustration-now b + b { width: 60%; }
.screen-illustration-now span { display: block; width: 45%; height: 3px; margin-top: 9px; background: #54758c; }
.screen-illustration-queue { display: grid; gap: 5px; }
.screen-illustration-queue i { display: block; border-left: 2px solid #7390b5; border-radius: 3px; background: #183044; }
.screen-illustration-stand { position: relative; width: 30px; height: 13px; margin: -2px auto 0; background: #a6b6c8; transform: rotate(-3deg); }
.screen-illustration-stand::after { content: ''; position: absolute; width: 64px; height: 4px; left: -17px; bottom: -3px; border-radius: 4px 4px 0 0; background: #7f94ab; }
#screensView .screen-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
#screensView .screen-card { min-width: 0; border: 1px solid var(--screen-border); border-radius: 14px; background: var(--screen-surface); padding: 24px; }
#screensView .screen-local-card, #screensView .screen-connect-card { display: flex; flex-direction: column; }
#screensView .screen-card-heading { display: flex; align-items: flex-start; gap: 13px; padding-bottom: 24px; }
#screensView .screen-card-heading > svg { flex: 0 0 24px; width: 24px; height: 24px; color: var(--screen-accent); margin-top: 2px; }
#screensView h2 { margin: 0; font-size: 1.0625rem; line-height: 1.5; letter-spacing: -.02em; }
#screensView .screen-card-heading p { margin-top: 4px; font-size: .8125rem; line-height: 1.55; }
#screensView .field { margin: 0; min-width: 0; }
#screensView .screen-local-settings { display: grid; gap: 20px; flex: 1; align-content: start; }
#screensView .screen-field-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
#screensView .screen-field-heading > span, #screensView .field > label { font-size: .8125rem; font-weight: 600; color: var(--ink); }
#screensView .screen-text-button { border: 0; background: none; box-shadow: none; padding: 0; color: var(--screen-accent); font: inherit; font-size: .75rem; font-weight: 500; cursor: pointer; line-height: 1.5; }
#screensView .screen-text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
#screensView [hidden] { display: none; }
#screensView :is(button, select, summary):focus-visible { outline: 2px solid #0866ff; outline-offset: 4px; }
#screensView #localTvSectors { border: 0; border-radius: 8px; background: var(--screen-soft); padding: 10px; gap: 4px 8px; max-height: 160px; }
#screensView #localTvSectors label { display: flex; align-items: center; min-width: 0; gap: 9px; padding: 6px 3px; margin: 0; font-size: .8125rem; font-weight: 400; color: var(--ink); cursor: pointer; }
#screensView #localTvSectors label span { overflow-wrap: anywhere; }
#screensView #localTvSectors input { width: 16px; height: 16px; min-height: 16px; flex: 0 0 16px; padding: 0; margin: 0; accent-color: #0866ff; }
#screensView #localTvSectors.is-empty { display: block; padding: 16px; }
.screen-sectors-empty { display: block; grid-column: 1 / -1; color: var(--muted); font-size: .8125rem; line-height: 1.55; }
.screen-sectors-empty strong, .screen-sectors-empty span { display: block; }
.screen-sectors-empty strong { color: var(--ink); font-weight: 500; margin-bottom: 4px; }
#screensView .field > small { display: block; font-size: .75rem; line-height: 1.5; color: var(--muted); margin-top: 9px; }
#screensView .screen-text-size { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
#screensView .screen-text-size label { margin: 0; }
#screensView .screen-text-size select { width: 142px; min-height: 40px; padding: 8px 12px; font-size: .875rem; border-radius: 7px; border-color: var(--screen-border); }
#screensView .screen-card-footer { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--screen-border); display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; }
#screensView .screen-card-footer > span { color: var(--muted); font-size: .75rem; }
#screensView .btn { min-height: 40px; padding: 10px 14px; border-radius: 7px; box-shadow: none; font-size: .8125rem; font-weight: 600; gap: 10px; line-height: 1.4; }
#screensView .btn svg { width: 16px; height: 16px; }
#screensView .btn:disabled { opacity: .48; cursor: not-allowed; }
#screensView .screen-card-footer .btn { min-height: 42px; }
#screensView .screen-connection-options { border-top: 1px solid var(--screen-border); }
#screensView details { padding: 16px 0; }
#screensView details + details { border-top: 1px solid var(--screen-border); padding-bottom: 0; }
#screensView summary { cursor: pointer; color: var(--ink); font-size: .875rem; font-weight: 500; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
#screensView summary::-webkit-details-marker { display: none; }
#screensView summary::after { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin-right: 3px; }
#screensView details[open] summary::after { transform: rotate(225deg); }
#screensView details p { margin: 18px 0; font-size: .8125rem; }
#screensView .screen-connection-steps { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 15px; counter-reset: connection; }
#screensView .screen-connection-steps li { counter-increment: connection; display: flex; align-items: baseline; gap: 12px; color: var(--muted); font-size: .8125rem; line-height: 1.55; }
#screensView .screen-connection-steps li::before { content: counter(connection, decimal-leading-zero); font-size: .6875rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--screen-accent); }
#screensView .screen-connection-steps strong { display: block; color: var(--ink); font-size: .875rem; font-weight: 600; }
#screensView .screens-devices-card { padding: 0; overflow: hidden; }
#screensView .screens-list-heading { padding: 22px 24px; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
#screensView .tv-plan-usage { margin: 5px 0 0; color: var(--muted); font-weight: 400; font-size: .75rem; line-height: 1.5; max-width: 510px; }
#screensView .screens-list-actions { display: flex; align-items: center; flex-shrink: 0; gap: 18px; }
#screensView .tv-devices-list { margin: 0; gap: 0; }
#screensView .tv-device-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 16px; padding: 20px 24px; border: 0; border-top: 1px solid var(--screen-border); border-radius: 0; background: transparent; }
#screensView .tv-device-icon { width: 26px; height: 26px; color: var(--muted); }
#screensView .tv-device-info { min-width: 0; }
#screensView .tv-device-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 5px; }
#screensView .tv-device-title strong { font-size: .875rem; font-weight: 600; overflow-wrap: anywhere; }
#screensView .tv-device-title .tv-device-status { font-size: .6875rem; font-weight: 400; margin: 0; }
#screensView .tv-device-info > span { overflow-wrap: anywhere; font-size: .75rem; line-height: 1.5; }
#screensView .tv-device-info > .tv-device-last-seen { font-size: .6875rem; }
#screensView .tv-device-actions { display: flex; gap: 6px; align-items: center; }
#screensView .tv-device-actions .icon-btn { width: 34px; height: 34px; padding: 8px; border-radius: 6px; box-shadow: none; }
#screensView .tv-device-actions .icon-btn svg { width: 16px; height: 16px; }
#screensView .tv-device-actions .btn { min-height: 34px; padding: 7px 10px; font-size: .75rem; }
#screensView .screens-empty { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 32px 24px; border-top: 1px solid var(--screen-border); background: var(--screen-soft); }
#screensView .screens-empty svg { width: 38px; height: 38px; color: #8195ad; flex-shrink: 0; }
#screensView .screens-empty strong { display: block; font-size: .875rem; font-weight: 500; margin-bottom: 5px; }
#screensView .screens-empty p { font-size: .8125rem; max-width: 450px; }
html[data-interface-theme="dark"] #screensView { --screen-surface: #192535; --screen-soft: #14202e; --screen-border: #34445a; --screen-accent: #8cb9ff; }
@media (max-width: 1100px) {
  #screensView { padding: 24px 24px 100px; }
  #screensView .screen-options { gap: 16px; }
  #screensView .screen-card { padding: 20px; }
  #screensView .screens-devices-card { padding: 0; }
  #screensView .screen-card-heading { gap: 10px; }
  #screensView .screen-card-heading > svg { width: 20px; height: 20px; flex-basis: 20px; }
  #screensView .screen-card-footer { gap: 10px; }
  #screensView .screen-card-footer > span { display: none; }
  #screensView .screens-list-heading, #screensView .tv-device-row { padding: 20px; }
}
@media (max-width: 900px) {
  #screensView .screen-options { grid-template-columns: 1fr; }
  #screensView .screen-card-footer > span { display: block; }
}
@media (max-width: 600px) {
  #screensView { gap: 18px; padding: 20px 16px 96px; }
  #screensView .screens-page-header { min-height: 0; gap: 0; padding: 6px 2px; }
  #screensView .screens-page-header p { font-size: .8125rem; }
  #screensView h1 { font-size: 1.6rem; }
  #screensView .screen-illustration { display: none; }
  #screensView .screens-list-heading { flex-direction: column; gap: 16px; }
  #screensView .screens-list-actions { justify-content: space-between; width: 100%; }
  #screensView .tv-device-row { grid-template-columns: 24px minmax(0, 1fr); gap: 12px; }
  #screensView .tv-device-actions { grid-column: 2; flex-wrap: wrap; }
  #screensView .tv-device-actions .icon-btn { width: 40px; height: 40px; }
  #screensView .tv-device-actions .btn { min-height: 40px; }
  #screensView .screens-empty { justify-content: flex-start; align-items: flex-start; padding: 24px 20px; gap: 14px; }
  #screensView .screens-empty svg { width: 28px; height: 28px; }
}
