/* The TV surface is scoped so the computer, account and rules keep their layout. */
#panel-tv .tv{border:1px solid #d5e1e8;border-radius:24px;background:#fff;overflow:hidden;box-shadow:0 12px 36px #163b5010}
#panel-tv .tv-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:26px 26px 18px;background:#f8fbfd;color:#142f48}
#panel-tv .tv-head h1{font-size:1.8rem;line-height:1.18;margin:7px 0 10px;overflow-wrap:anywhere}
#panel-tv .tv-head .eyebrow{font-size:.68rem;letter-spacing:.14em;margin:0;color:#557589}
#panel-tv .tv-current{margin:0;color:#577084;font-size:.84rem;overflow-wrap:anywhere}
#panel-tv .tv-status{display:inline-flex;align-items:center;gap:7px;flex-shrink:0;font-size:.72rem;line-height:1.4;font-weight:650;background:#edf1f4;color:#536774;border:1px solid #d9e2e8;border-radius:20px;padding:8px 11px;max-width:190px}
#panel-tv .tv-status:before{content:'';height:7px;width:7px;flex-shrink:0;border-radius:50%;background:#8596a1}
#panel-tv .tv-status[data-state=online]{background:#e7f4ee;border-color:#cce6d9;color:#146349}
#panel-tv .tv-status[data-state=online]:before{background:#278d68}
#panel-tv .tv-status[data-state=pairing]{background:#fff3d8;border-color:#eedba9;color:#795e18}
#panel-tv .tv-status[data-state=pairing]:before{background:#b89535}
#panel-tv .tv-summary{display:flex;align-items:center;gap:28px;padding:18px 26px;background:#f8fbfd;border-top:1px solid #e3ebf0}
#panel-tv .tv-summary-item{display:grid;gap:3px;min-width:0}
#panel-tv .tv-summary-item>span{font-size:.7rem;color:#627b8c}
#panel-tv .tv-summary-item strong{font-size:1.25rem;font-variant-numeric:tabular-nums;color:#1a3f53}
#panel-tv .tv-rules-link{margin-left:auto;color:#126653;font-size:.8rem;font-weight:650;line-height:1.5;text-align:right}
#panel-tv .tv-schedule{margin:0;padding:12px 26px;color:#526f81;background:#eef5f8;border-top:1px solid #e0eaf0;font-size:.75rem;line-height:1.55}
#panel-tv .message{margin:0;padding:12px 26px;background:#fff0e9;color:#91432e;font-size:.8rem;line-height:1.5}
#panel-tv .tv-body{padding:26px}
#panel-tv .tv-layout{display:grid;grid-template-columns:minmax(250px,288px) minmax(0,1fr);gap:26px;align-items:start}
#panel-tv .remote-shell{padding:20px 18px 15px;border:1px solid #cbd8e2;border-radius:38px;background:linear-gradient(150deg,#f9fbfd,#e7eef4);box-shadow:0 14px 30px #254c6218,inset 0 2px 2px #fff;min-width:0;max-width:288px;width:100%}
#panel-tv .remote-top{display:flex;justify-content:space-between;align-items:center;padding:0 2px 18px}
#panel-tv .remote-brand{color:#617d91;font-size:.68rem;letter-spacing:.2em;font-weight:750}
#panel-tv .tv-key{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:44px;min-height:48px;padding:10px 12px;margin:0;border:1px solid #d4dfe8;border-radius:12px;background:#fff;color:#204658;box-shadow:0 2px 0 #d5e1e7;font-size:.8rem;line-height:1.25;font-weight:650;cursor:pointer;touch-action:manipulation;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
#panel-tv .tv-key svg,#panel-tv .remote-touchpad svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
#panel-tv .tv-key:disabled{opacity:.38;cursor:not-allowed;box-shadow:none}
#panel-tv .tv-key:not(:disabled):active{transform:translateY(2px);box-shadow:none;background:#dceae7}
#panel-tv .remote-power{flex-direction:column;gap:4px;min-height:64px;padding:8px 11px;border-radius:20px;background:#f8e8e4;color:#9b4436;border-color:#ebcfc5;font-size:.65rem;box-shadow:0 2px 0 #e5c9bf}
#panel-tv .remote-power[data-power=on]{background:#a74a3b;color:#fff;border-color:#984334;box-shadow:0 2px 0 #87392e}
#panel-tv .remote-modes{display:flex;gap:3px;padding:4px;background:#dfe8ee;border-radius:13px;margin:0 0 20px}
#panel-tv .remote-modes button{flex:1;min-height:40px;margin:0;padding:8px;background:transparent;color:#4b6577;font-size:.77rem;border-radius:9px;box-shadow:none}
#panel-tv .remote-modes button[aria-selected=true]{background:#fff;color:#1c4b5b;box-shadow:0 1px 4px #20445915}
#panel-tv .remote-modes button:disabled{cursor:not-allowed}
#panel-tv .remote-dpad{width:228px;height:228px;display:grid;grid-template-columns:repeat(3,76px);grid-template-rows:repeat(3,76px);border:1px solid #c7d5df;border-radius:50%;background:#e1e9ef;box-shadow:inset 0 2px 6px #21445712,0 2px 1px #fff;margin:0 auto 20px;overflow:hidden}
#panel-tv .dpad-key{padding:0;border:0;box-shadow:none;background:transparent;border-radius:0}
#panel-tv .dpad-key svg{width:29px;height:29px;stroke-width:2}
#panel-tv .remote-up{grid-area:1/2}
#panel-tv .remote-left{grid-area:2/1}
#panel-tv .remote-right{grid-area:2/3}
#panel-tv .remote-down{grid-area:3/2}
#panel-tv .remote-ok{grid-area:2/2;align-self:center;justify-self:center;width:66px;height:66px;border-radius:50%;background:#194b58;color:white;font-size:1rem;box-shadow:0 3px 0 #123844,inset 0 1px 0 #ffffff20}
#panel-tv .remote-ok:not(:disabled):active{background:#256371}
#panel-tv .dpad-key:not(.remote-ok) .key-label,#panel-tv .remote-rocker .key-label,#panel-tv .remote-media .key-label,#panel-tv .remote-colors .key-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
#panel-tv .remote-touch{width:228px;height:228px;margin:0 auto 20px}
#panel-tv .remote-touchpad{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;width:100%;height:100%;border:1px solid #b9ceda;border-radius:27px;color:#497688;background-color:#e2edf1;background-image:radial-gradient(#a9c2cc 1px,transparent 1px);background-size:14px 14px;box-shadow:inset 0 2px 6px #1b4b5712;touch-action:none;user-select:none;-webkit-user-select:none;cursor:crosshair}
#panel-tv .remote-touchpad svg{width:38px;height:38px;stroke-width:1.6;filter:drop-shadow(0 1px 1px #fff)}
#panel-tv .remote-touchpad .touchpad-caption{font-size:.75rem;font-weight:650;background:#e2edf1df;padding:4px 8px;border-radius:8px}
#panel-tv .remote-touchpad.is-dragging{background-color:#c6e4dd;border-color:#4b9f8c;color:#215f50}
#panel-tv .remote-touchpad[aria-disabled=true]{opacity:.45;cursor:not-allowed}
#panel-tv .remote-pointer-help{font-size:.7rem;line-height:1.5;color:#587487;margin:-8px 0 15px;text-align:center}
#panel-tv .remote-shortcuts{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
#panel-tv .remote-shortcuts .tv-key{flex-direction:column;gap:5px;min-height:62px;font-size:.65rem;padding:8px 6px;border-radius:15px}
#panel-tv .remote-rockers{display:grid;grid-template-columns:1fr 1fr 1fr;align-items:center;gap:10px;margin:18px 0}
#panel-tv .remote-rocker{display:grid;justify-items:stretch;background:#dce6ed;border-radius:24px;border:1px solid #cbd9e2;padding:3px;overflow:hidden}
#panel-tv .remote-rocker .tv-key{background:#f8fbfd;border:0;border-radius:20px;min-height:45px;box-shadow:none}
#panel-tv .rocker-label{display:block;text-align:center;padding:8px 1px;font-size:.65rem;color:#49677b;font-weight:750;white-space:nowrap;font-variant-numeric:tabular-nums}
#panel-tv .remote-mute{flex-direction:column;gap:6px;border-radius:20px;padding:12px 3px;min-height:72px;font-size:.61rem}
#panel-tv .remote-mute[aria-pressed=true]{background:#d6eae1;color:#1d6953;border-color:#a9cebd}
#panel-tv .remote-media{display:grid;grid-template-columns:repeat(5,1fr);gap:5px;padding-top:17px;border-top:1px solid #cfdde7}
#panel-tv .remote-media .tv-key{padding:8px 0;min-width:0;min-height:46px;border-radius:11px}
#panel-tv .remote-media svg{width:19px;height:19px}
#panel-tv .remote-activity{font-size:.69rem;text-align:center;line-height:1.45;min-height:2.9em;margin:14px 0 0;color:#5e798b;overflow-wrap:anywhere}
#panel-tv .remote-activity[data-state=busy]{color:#126653}
#panel-tv .remote-activity[data-state=error]{color:#a34d37}
#panel-tv .tv-side{min-width:0}
#panel-tv .tv-sources{background:#f7fafc;border:1px solid #dde7ee;border-radius:20px;padding:18px}
#panel-tv .tv-section-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:16px}
#panel-tv .tv-section-title h2{font-size:1rem;line-height:1.3;margin:0}
#panel-tv .tv-refresh{background:transparent;box-shadow:none;padding:7px;border-color:#d4e2ea;min-width:44px;min-height:44px}
#panel-tv .tv-refresh .key-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
#panel-tv .source-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:end;margin-top:14px}
#panel-tv label{font-size:.78rem;color:#4c697c;line-height:1.5;margin:14px 0 8px}
#panel-tv .source-row label{min-width:0;margin:0}
#panel-tv select,#panel-tv input{display:block;width:100%;max-width:100%;min-width:0;padding:11px 10px;margin-top:6px;font:inherit;font-size:.86rem;border:1px solid #bfcfdb;border-radius:10px;background:#fff;color:#21495c;min-height:46px}
#panel-tv .source-launch{min-width:56px;min-height:46px;padding:10px;font-size:.7rem;box-shadow:none;background:#e3efe9;border-color:#c8ded3;color:#1f6650}
#panel-tv .source-launch svg{display:none}
#panel-tv .tv-sources .small{font-size:.72rem;line-height:1.6;margin-bottom:0}
#panel-tv .tv-connection-hint{font-size:.75rem;line-height:1.6;margin:16px 2px;color:#5d788a}
#panel-tv .tv-disclosure{padding:17px 0;margin:0;border-top:1px solid #dce6ee}
#panel-tv .tv-disclosure summary{font-size:.87rem;font-weight:650;color:#294e61;cursor:pointer;line-height:1.4;min-height:24px}
#panel-tv .tv-disclosure>p,#panel-tv .tv-disclosure .small{font-size:.75rem;line-height:1.6}
#panel-tv .tv-disclosure>.tv-key{margin-top:10px;margin-right:5px}
#panel-tv .actions{display:flex;flex-wrap:wrap;gap:7px;margin:12px 0}
#panel-tv .actions .tv-key{font-size:.72rem;padding:10px;box-shadow:none}
#panel-tv .inline-control{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:8px;margin-top:10px}
#panel-tv .inline-control label{margin:0}
#panel-tv .inline-control .tv-key{box-shadow:none;font-size:.75rem}
#panel-tv .remote-digits{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin:17px 0}
#panel-tv .remote-digits .tv-key{font-size:1rem;box-shadow:none}
#panel-tv .remote-digits .tv-key:last-child{grid-column:2}
#panel-tv .remote-colors{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:12px}
#panel-tv .remote-colors .tv-key{min-height:44px;box-shadow:none;border:0}
#panel-tv .color-red{background:#d66d68}
#panel-tv .color-green{background:#66a580}
#panel-tv .color-yellow{background:#dcbb61}
#panel-tv .color-blue{background:#688ebb}
#panel-tv .tv-subtle{background:#f1f5f7;color:#5f7889;box-shadow:none}
#panel-tv .history-row{display:flex;justify-content:space-between;gap:14px;padding:8px 0;border-bottom:1px solid #e5ecf3;font-size:.78rem}
#panel-tv .tv-preview-note{padding:12px;border-radius:12px;background:#edf3f7;color:#496a7f}
#lg-notice:empty{display:none}
#lg-notice:not(:empty){padding:12px 16px;background:#fff1d6;color:#765820;border-radius:12px;font-size:.82rem;line-height:1.55}
#lg-updated{font-size:.72rem;margin:0 0 12px;text-align:right}
@media(hover:hover){#panel-tv .tv-key:not(:disabled):hover{background:#e7f1ec;border-color:#accdc0}#panel-tv .remote-ok:not(:disabled):hover{background:#246171;color:white}#panel-tv .remote-power[data-power=on]:not(:disabled):hover{background:#b45645;color:white}}
@media(max-width:690px){#panel-tv .tv-head{padding:22px 20px 16px;gap:12px}#panel-tv .tv-head h1{font-size:1.5rem}#panel-tv .tv-status{font-size:.67rem;max-width:140px;padding:7px 9px}#panel-tv .tv-summary{padding:16px 20px;gap:18px;flex-wrap:wrap}#panel-tv .tv-summary-item strong{font-size:1.12rem}#panel-tv .tv-rules-link{font-size:.74rem}#panel-tv .tv-schedule{padding:12px 20px;font-size:.72rem}#panel-tv .tv-body{padding:22px 20px}#panel-tv .tv-layout{grid-template-columns:minmax(0,1fr);gap:26px}#panel-tv .remote-shell{justify-self:center}#panel-tv .tv-sources{padding:18px}#panel-tv .source-launch{min-width:74px}#panel-tv .tv-disclosure summary{min-height:30px;padding:3px 0}#panel-tv .message{padding:12px 20px}}
@media(max-width:370px){#panel-tv .tv-head{display:block}#panel-tv .tv-status{margin-top:13px;max-width:none}#panel-tv .tv-body{padding:20px 12px}#panel-tv .tv-summary{gap:16px}#panel-tv .tv-rules-link{margin-left:0;text-align:left;flex-basis:100%}#panel-tv .remote-shell{padding:17px 14px}#panel-tv .tv-sources{padding:14px}}
@media(prefers-reduced-motion:no-preference){#panel-tv .tv-key{transition:background .12s,box-shadow .12s,transform .12s}}
/* 0.11: natychmiastowa reakcja przycisku pilota (polecenie leci w tle, bez blokowania pozostałych) */
.tv-key.is-sent{transform:scale(.94);filter:brightness(1.1)}
.tv-key{-webkit-touch-callout:none}
