/* v6.1: a compact, mobile-first control surface using the existing CarYou identity. */
:root { --home-accent:#ff6a72; --home-surface:#101827; --home-outline:#293246; --home-radius:24px; --home-motion:180ms; --grad:linear-gradient(135deg,#c5162d,#d62a27); }
html[data-theme="light"] { --home-accent:#bc1730; --home-surface:#fff; --home-outline:#d5dce8; --accent:#d1122c; --grad:linear-gradient(135deg,#c5162d,#d62a27); }
html { scroll-padding-top:104px; scroll-padding-bottom:110px; }
body { background:var(--bg); }
.wrap { max-width:680px; }
.home-active .wrap { max-width:1000px; }
.skip-link { position:fixed; inset-block-start:8px; inset-inline-start:12px; z-index:100000; padding:12px 18px; border-radius:12px; background:var(--text); color:var(--bg); transform:translateY(-150%); }
.skip-link:focus { transform:none; }
.topbar { box-shadow:none; background:var(--bg); border:0; border-radius:0; padding:4px 0 12px; margin-bottom:24px; border-bottom:1px solid var(--border); }
.home-active .topbar { display:flex; flex-wrap:nowrap; gap:12px; }
.home-active .topbar .brand { margin-inline-end:auto; }
.brand small { margin-top:3px; }
.topbar .logo { background:var(--ui-panel); box-shadow:none; }
.home-active .topbar .account-actions { display:flex; }
.topbar .profile-preferences { display:flex; gap:6px; padding:8px 4px 12px; margin:0 0 6px; border-block-end:1px solid var(--border); }
.profile-menu .profile-preferences button { display:flex; justify-content:center; padding:8px; flex:1; width:44px; min-width:44px; min-height:44px; color:var(--text); background:var(--ui-panel-soft); }
.profile-menu > button:last-child { color:var(--err); }
#appView { outline:none; }
#appView > .card { background:var(--home-surface); box-shadow:none; border-radius:var(--home-radius); padding:20px; margin-bottom:16px; }
.welcome-strip { display:block; margin:0 0 24px; }
.welcome-strip h2 { font-size:26px; letter-spacing:-.4px; line-height:1.5; }
.welcome-caption { margin:4px 0 0; font-size:15px; color:var(--muted); line-height:1.6; }
.screen-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
.screen-heading > span { display:flex; align-items:center; gap:6px; font-size:14px; font-weight:700; color:var(--muted); }
.screen-heading i { color:var(--home-accent); }
.screen-heading .status-pill { margin:0; max-width:none; padding:6px 10px; gap:6px; font-size:12px; background:var(--ui-panel-soft); border:0; }
.status-pill .dot { width:6px; height:6px; box-shadow:none!important; }
.status-card .status-box { margin:0; padding:0; border:0; background:transparent; }
.screen-media { display:grid; grid-template-columns:96px minmax(0,1fr); gap:14px; align-items:center; }
.screen-art { width:96px; aspect-ratio:16/11; object-fit:cover; border-radius:14px; background:var(--ui-panel-soft); }
.screen-placeholder { display:grid; place-items:center; color:var(--muted); font-size:26px; }
.screen-copy { min-width:0; }
.screen-copy h3 { margin:0 0 4px; font-size:17px; line-height:1.6; font-weight:800; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.screen-copy p { margin:0; font-size:13px; line-height:1.7; color:var(--muted); }
.status-box.error .screen-copy p,.screen-expired { color:var(--err); }
.status-card .source-details { margin-top:14px; padding:0; }
.status-card .source-details summary { font-size:12px; }
.screen-updated { display:block; font-size:12px; color:var(--muted); margin:8px 0; }
.status-card .timer { margin:14px 0; padding:12px; background:var(--ui-panel-soft); border:0; }
.status-card .now-box { border:0; background:none; box-shadow:none; padding:12px 0 0; margin:0; }
.status-card .now-box h3,.status-card #nowTitle { display:none; }
.status-card .now-box .controls-row { margin-top:8px; }
.status-card .now-sub { font-size:13px; line-height:1.7; }
.status-card .btn-next { box-shadow:none; background:var(--ui-panel-soft); color:var(--text); min-height:44px; }
.queue-peek { width:100%; display:flex; align-items:center; gap:12px; text-align:start; margin-top:14px; padding:14px 0 0; border:0; border-top:1px solid var(--border); background:transparent; color:var(--text); font:inherit; cursor:pointer; min-height:60px; }
.peek-icon { display:grid; place-items:center; width:36px; height:36px; border-radius:12px; background:var(--ui-panel-soft); color:var(--muted); flex:none; }
.peek-icon i { margin:0; }
.queue-peek strong,.queue-peek small { display:block; }
.queue-peek strong { font-size:14px; font-weight:700; }
.queue-peek small { font-size:12px; color:var(--muted); margin-top:4px; line-height:1.5; }
.peek-arrow { margin-inline-start:auto; color:var(--muted); font-size:12px; }
html[dir="ltr"] .peek-arrow { transform:rotate(180deg); }
#appView #ytCard,#appView #broadcastCard { background:linear-gradient(140deg,var(--accent-soft),transparent 70%),var(--home-surface); border-color:var(--home-outline); }
#ytCard > h3,#broadcastCard > h3 { font-size:20px!important; line-height:1.6; margin:0 0 16px!important; }
#ytCard .field,#broadcastCard .field { margin-bottom:12px; }
#ytCard .yt-btns,#broadcastCard .yt-btns { display:flex; gap:10px; }
#ytCard .yt-btns > button,#broadcastCard .yt-btns > .btn { flex:1; min-width:96px; min-height:48px; margin:0; padding:12px; }
.search-options { margin-top:8px; }
.search-options summary { min-height:44px; display:flex; align-items:center; gap:8px; color:var(--muted); font-size:13px; cursor:pointer; list-style:none; }
.search-options summary::after { content:"+"; font-size:18px; margin-inline-start:auto; }
.search-options[open] summary::after { content:"−"; }
.search-options summary::-webkit-details-marker { display:none; }
.search-options .yt-btns { margin-top:4px; }
#ytMsg:empty,#setMsg:empty,.media-content .msg:empty { display:none; }
#appView .hero-card { border-color:var(--border); background:var(--home-surface); }
.hero-title { margin-bottom:12px; font-size:18px; }
.hero-card .field-label { color:var(--muted); font-size:13px; margin-bottom:8px; }
.hero-card .add-row { gap:10px; margin-bottom:10px; }
.hero-card .add-row > button { min-height:48px; font-size:15px; }
.hero-card .add-row > select { width:94px; flex:none; min-height:48px; }
.hero-card > .btn-soft { display:flex; align-items:center; justify-content:center; width:100%; min-height:44px; margin:0; background:transparent; border:1px solid var(--border); color:var(--text); border-radius:14px; }
.field input { min-width:0; min-height:52px; }
.field input:focus { border-color:var(--home-accent); }
input:focus-visible,select:focus-visible,textarea:focus-visible { outline:2px solid var(--home-accent); outline-offset:2px; }
button:focus-visible,a:focus-visible,summary:focus-visible { outline-color:var(--home-accent); }
button:disabled { cursor:default; opacity:.45; }
button:not(:disabled) { transition:background var(--home-motion),opacity var(--home-motion),transform var(--home-motion); }
.connection-card > summary,.media-card > summary,.guest-card > summary { display:flex; align-items:center; gap:12px; cursor:pointer; list-style:none; min-height:48px; }
.connection-card > summary::-webkit-details-marker,.media-card > summary::-webkit-details-marker { display:none; }
.disclosure-icon { width:42px; height:42px; display:grid; place-items:center; background:var(--ui-panel-soft); border-radius:14px; flex:none; color:var(--home-accent); }
.disclosure-icon i { margin:0; }
.connection-card summary strong,.media-card summary strong,.guest-card summary strong { display:block; font-size:16px; font-weight:700; }
.connection-card summary small,.media-card summary small,.guest-card summary small { display:block; font-size:12px; color:var(--muted); margin-top:5px; line-height:1.6; }
.connection-card summary > i,.media-card summary > i,.guest-card summary > i { margin-inline-start:auto; font-size:12px; color:var(--muted); transition:transform var(--home-motion); }
.connection-card[open] summary > i,.media-card[open] summary > i,.guest-card[open] summary > i { transform:rotate(180deg); }
.connection-content,.media-content { margin-top:20px; padding-top:16px; border-top:1px solid var(--border); }
.connection-content .links-box { border:0; background:transparent; padding:0; margin:0; box-shadow:none; }
.connection-content .links-box + .links-box { margin-top:24px; padding-top:20px; border-top:1px solid var(--border); }
.connection-content .links-box h3 { font-size:15px; line-height:1.6; }
.connection-content .cartv-steps { font-size:13px; }
.link-row { min-width:0; }
.link-row input { min-width:0; font-size:13px; }
.link-row button { min-width:56px; min-height:48px; }
.media-content > .hint { margin-top:0; }
.media-card input:disabled + .media-file-label { opacity:.45; cursor:default; }
.guest-card summary { min-height:48px; }
.guest-card summary small { font-size:13px; line-height:1.7; }
.home-active .quote { margin:28px auto 12px!important; font-size:12px; max-width:58ch!important; }
.home-active .footer { margin-bottom:10px; }
.home-dock { --dock-scale:1; position:fixed; z-index:35; bottom:calc(12px + env(safe-area-inset-bottom,0px)); left:max(12px,env(safe-area-inset-left,0px)); right:max(12px,env(safe-area-inset-right,0px)); transform:translateZ(0) scale(var(--dock-scale)); transform-origin:50% 100%; display:flex; width:auto; max-width:420px; margin-left:auto; margin-right:auto; box-sizing:border-box; gap:4px; padding:6px; border:1px solid var(--home-outline); border-radius:25px; background:var(--ui-panel); box-shadow:0 12px 38px #0004; transition:transform .34s cubic-bezier(.16,1,.3,1),opacity .2s,box-shadow .34s cubic-bezier(.16,1,.3,1),background-color .3s; isolation:isolate; overflow:visible; will-change:transform; }
.home-dock.is-scrolled { box-shadow:0 9px 28px #0005; }
.home-dock .cy-dock-orbit { position:absolute; inset:-3px; width:calc(100% + 6px); height:calc(100% + 6px); overflow:visible; pointer-events:none; z-index:4; color:var(--accent); filter:drop-shadow(0 0 5px color-mix(in srgb,var(--accent) 58%,transparent)); }
.home-dock .cy-dock-orbit rect { transition:stroke-dashoffset .08s linear,opacity .2s ease; }
.home-dock > button { z-index:2; }

.home-dock button { position:relative; display:flex; flex:1; min-width:0; flex-direction:column; align-items:center; justify-content:center; gap:6px; min-height:58px; padding:5px 2px; background:transparent; color:var(--muted); font:inherit; font-size:12px; border:0; border-radius:19px; cursor:pointer; }
.home-dock button i { font-size:19px; margin:0; }
.home-dock button.selected { color:var(--text); background:var(--ui-panel-soft); }
.home-dock button.selected i { color:var(--home-accent); }
.home-dock small { position:absolute; top:2px; inset-inline-end:12px; padding:1px 5px; border-radius:20px; background:var(--home-accent); color:var(--bg); font:700 10px/1.4 system-ui; }
.home-active { padding-bottom:calc(110px + env(safe-area-inset-bottom,0px)); }
.yt-active .home-dock,.scroll-lock .home-dock { display:none; }
.text-entry .home-dock { display:none; }
.home-active #toastStack { bottom:calc(100px + env(safe-area-inset-bottom,0px)); }
.text-entry #toastStack { bottom:18px; }
.yt-main { scroll-padding-bottom:112px; }
.q-controls button { min-width:44px; }
@media(min-width:780px) {
  .home-active #appView { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; align-items:start; }
  .home-active #appView > .card { margin:0; padding:24px; }
  .welcome-strip,.notice-banner { grid-column:1 / -1; margin-bottom:0; }
  .home-active .topbar { margin-bottom:32px; }
  .home-active { padding-bottom:32px; }
  .home-dock { display:none; }
  .home-active #toastStack { bottom:24px; }
  .screen-media { grid-template-columns:112px minmax(0,1fr); }
  .screen-art { width:112px; }
}
@media(max-width:380px) {
  #appView > .card { padding:18px 16px; }
  .screen-media { grid-template-columns:80px minmax(0,1fr); gap:12px; }
  .screen-art { width:80px; }
  .screen-copy h3 { font-size:16px; }
}
@media(max-height:500px) and (max-width:779px) { .home-dock { position:static; transform:none!important; width:100%; margin:24px auto 0; } .home-dock .cy-dock-orbit{display:none} .home-active { padding-bottom:24px; } }
@media(prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  *,*::before,*::after { animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; }
}

/* Matching native disclosure rows and durable contrast in both themes. */
html[data-theme="light"] body { background:var(--bg); }
#ytCard .btn:not(.secondary),#broadcastCard .btn:not(.secondary),.hero-card .btn { box-shadow:0 6px 16px #b511241a; }
#ytCard .btn:not(.secondary):hover,#broadcastCard .btn:not(.secondary):hover,.hero-card .btn:hover { box-shadow:0 8px 20px #b5112426; }
.text-entry .yt-bottom { display:none; }
.media-card summary,.connection-card summary,.guest-card summary { scroll-margin-top:104px; }
#appView > .card { scroll-margin-top:104px; }

.drawer-details > summary { display:flex; align-items:center; gap:8px; color:var(--text); font-size:15px; font-weight:700; min-height:44px; list-style:none; cursor:pointer; }
.drawer-details > summary::-webkit-details-marker { display:none; }
.drawer-details > summary::after { content:"+"; margin-inline-start:auto; color:var(--muted); font-size:20px; }
.drawer-details[open] > summary::after { content:"−"; }
.drawer-details[open] > summary { margin-bottom:14px; }
.drawer-details .field-label { font-size:13px; }

.yt-active > .skip-link { display:none; }
@media(min-width:780px) {
  #appView #ytCard { grid-column:2; grid-row:2 / span 2; }
  #appView .status-card,#appView .hero-card { grid-column:1; }
  #ytList { max-height:430px; overflow:auto; overscroll-behavior:contain; scrollbar-width:thin; }
}
@media(min-width:780px) {
  #appView #noticeBanner:not(.hidden) ~ #ytCard { grid-row:3 / span 2; }
  #appView #ytCard.hidden ~ .hero-card { grid-column:2; }
}

#broadcastCard .yt-btns a { display:flex; align-items:center; justify-content:center; text-decoration:none; }
#broadcastCard .broadcast-sections { display:flex; gap:8px; flex-wrap:wrap; margin-top:14px; }
#broadcastCard .broadcast-sections a { display:flex; align-items:center; padding:10px 18px; border-radius:16px; background:var(--ui-panel-soft); border:1px solid var(--border); color:var(--text); text-decoration:none; min-height:44px; }
.logo img,.foot-logo { object-fit:contain; border-radius:8px; }
.auth-logo { height:auto; aspect-ratio:1; object-fit:contain; border-radius:20px; }

/* Requested reading order, including desktop and dynamic Live/media cards. */
@media(min-width:780px){.home-active #appView #broadcastCard,.home-active #appView #ytCard,.home-active #appView .hero-card,.home-active #appView #webBrowserCard{grid-column:1 / -1;grid-row:auto}#appView #noticeBanner:not(.hidden) ~ #ytCard{grid-row:auto}}
#iptvDrawerCard p{font-size:14px;line-height:1.8;margin:10px 0 18px}
.iptv-drawer-links{display:grid;gap:10px}.iptv-drawer-links a{display:flex;gap:12px;align-items:center;min-height:50px;padding:12px 16px;border:1px solid var(--border);border-radius:15px;color:var(--text);background:var(--ui-panel);text-decoration:none;font-weight:700}.iptv-drawer-links i{color:var(--home-accent)}
#iptvDrawerCard .iptv-backup{margin-top:16px;width:100%;justify-content:center}
.share-instructions{padding:16px 0 0;font-size:14px;line-height:1.9}.share-instructions h4{margin:18px 0 8px}.share-instructions ol{padding-inline-start:24px}.share-instructions li{margin-bottom:10px}.share-instructions summary{cursor:pointer;min-height:44px;padding-top:12px}.share-instructions label{display:block;margin:12px 0 6px;font-weight:700}
.help-copy-row{display:flex;gap:8px;min-width:0}.help-copy-row input{min-width:0;flex:1;direction:ltr;text-align:left;font-size:14px;padding:12px;background:var(--ui-panel);color:var(--text);border:1px solid var(--border);border-radius:12px}.help-copy-row button{min-height:48px;min-width:60px}
#setBtn.cy-send-interactive{display:flex;align-items:center;justify-content:center;gap:10px;min-height:54px;flex:1;width:auto;min-width:0;padding:6px 56px;background:var(--grad);border:0;border-radius:17px;color:#fff;position:relative}
#setBtn.cy-send-interactive .cy-send-circle{position:absolute;inset-inline-start:auto;inset-inline-end:7px;top:50%;width:40px;height:40px;display:grid;place-items:center;transform:translateY(-50%);background:#ffffff24;color:#fff}
#setBtn.cy-send-interactive .cy-send-circle i{margin:0;line-height:1}
#setBtn.cy-send-interactive .cy-send-label{display:block;padding:0;line-height:1.4;text-align:center;color:inherit}
#setBtn.cy-send-interactive.is-sending{width:auto;min-width:0;color:#fff;opacity:.75}
#setBtn.cy-send-interactive.is-sending .cy-send-circle{inset-inline-start:auto;inset-inline-end:7px;transform:translateY(-50%);background:#ffffff24}
.topbar .logo,.web-brand img{background:transparent;box-shadow:none;border:0}.logo img,.foot-logo{border-radius:0}.auth-logo{aspect-ratio:auto;border-radius:0;background:transparent}
