:root{color-scheme:dark;--bg:#0e191f;--surface:#16252e;--surface-hover:#20343e;--border:#304550;--text:#eff4f6;--muted:#adbec7;--mint:#8de1cf;--ink:#10221f;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:16px}

*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--text)}
a{color:var(--mint);text-underline-offset:4px}
a:hover{color:#c0f7ea}
button,input,select{font:inherit}
button,.button{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;border:1px solid transparent;border-radius:8px;padding:.75rem 1.05rem;background:var(--mint);color:var(--ink);font-weight:650;text-decoration:none;cursor:pointer;min-height:44px}
button:hover,.button:hover{background:#acf0df;color:var(--ink)}
button:disabled{opacity:.5;cursor:not-allowed}
.secondary{background:var(--surface);border-color:var(--border);color:var(--text)}
.secondary:hover{background:var(--surface-hover);color:var(--text)}
.danger{background:#48272c;color:#ffd4d6;border-color:#854c54}
.text-button{background:none;color:var(--muted);padding:.3rem;border:0}
.text-button:hover{background:transparent;color:var(--text)}
input:not([type=checkbox]):not([type=radio]),select{width:100%;min-width:0;min-height:46px;padding:.75rem .9rem;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--text)}
input::placeholder{color:var(--muted)}
input[type=checkbox],input[type=radio]{accent-color:var(--mint);width:1.1rem;height:1.1rem}
input[type=checkbox]{vertical-align:middle;margin-right:.4rem}
label{line-height:1.5}
label>input:not([type=checkbox]):not([type=radio]),label>select{margin-top:.4rem}
form{display:grid;gap:1rem;max-width:36rem;margin:1.2rem 0}
h1,h2,h3{line-height:1.2;letter-spacing:-.025em}
h1{font-size:clamp(2rem,3.3vw,2.65rem);margin:0 0 .6rem;font-weight:750}
h2{font-size:1.35rem;margin:0 0 .75rem}
h3{font-size:1.08rem;margin:0 0 .5rem}
p{color:var(--muted);line-height:1.65;margin:.6rem 0 1rem}
main{max-width:46rem;margin:10vh auto;padding:2rem}
.small{font-size:.875rem}
.muted{color:var(--muted)}
.eyebrow{color:var(--mint);font-weight:650}
.error,.form-error{color:#ffbec4}
.notice{border-left:3px solid var(--mint);padding:1rem 1.2rem;background:var(--surface);border-radius:0 8px 8px 0}
.error{border-left:3px solid currentColor;padding-left:1rem}
:focus-visible{outline:3px solid #ffd98e;outline-offset:4px}
[hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.skip-link{position:absolute;left:1rem;top:-6rem;padding:1rem;background:var(--mint);color:var(--ink);z-index:20}
.skip-link:focus{top:1rem}

.site-header{border-bottom:1px solid var(--border);background:var(--bg)}
.header-inner{max-width:1440px;margin:auto;padding:0 2.5rem;display:flex;gap:3rem;align-items:center;min-height:80px}
.brand{display:flex;align-items:center;gap:.85rem;text-decoration:none;color:var(--text);font-size:1.1rem;font-weight:750;white-space:nowrap}
.brand-mark{display:grid;place-items:center;width:36px;height:32px;background:var(--mint);color:var(--ink);border-radius:8px;font-size:.9rem}
.header-inner nav{display:flex;gap:2rem;align-self:stretch}
.header-inner nav a{display:flex;align-items:center;text-decoration:none;color:var(--muted);border-bottom:3px solid transparent;padding-top:3px}
.header-inner a[aria-current=page]{color:var(--mint);border-bottom-color:var(--mint)}
.account-nav{margin-left:auto;display:flex;gap:1rem;align-items:center;font-size:.85rem}
.account-nav>a{color:var(--muted);text-decoration:none}
.account-nav form{margin:0}
.dashboard{max-width:1440px;margin:0 auto;padding:2.8rem 2.5rem 2rem;min-height:70vh}
.page-heading{display:flex;align-items:center;justify-content:space-between;gap:1.5rem;margin-bottom:2rem}
.page-heading p{margin:0}
.dashboard section{margin:2rem 0}
.site-footer{max-width:1440px;margin:auto;padding:1.5rem 2.5rem 2rem;display:flex;justify-content:space-between;gap:1rem;color:var(--muted);font-size:.8rem}
.site-footer a{color:var(--muted)}

.video-filters{max-width:none;margin:0;gap:.85rem}
.filter-primary{display:flex;gap:.75rem;align-items:center;flex-wrap:wrap}
.filter-primary .search-field{flex:1 1 20rem}
.filter-primary>div:not(.search-field){flex:0 1 15rem}
.filter-reset{display:inline-flex;align-items:center;min-height:44px;padding:.5rem}
.view-toggle{display:flex;border:1px solid var(--border);border-radius:8px;padding:3px;margin:0;min-width:0}
.view-toggle label{position:relative;cursor:pointer}
.view-toggle input{position:absolute;opacity:0;width:100%;height:100%;margin:0;cursor:pointer}
.view-toggle span{display:block;padding:.45rem .7rem;border-radius:5px;font-size:.85rem}
.view-toggle input:checked+span{background:var(--surface-hover);color:var(--mint)}
.view-toggle input:focus-visible+span{outline:3px solid #ffd98e;outline-offset:2px}
details{margin-top:1rem}
summary{cursor:pointer;min-height:36px;line-height:1.6;color:var(--text)}
details[open]>summary{margin-bottom:.75rem}
.filter-details{margin:0}
.filter-details summary{font-size:.85rem;color:var(--muted);width:fit-content}
.date-fields{display:flex;flex-wrap:wrap;gap:1rem;align-items:end;padding:1rem;background:var(--surface);border-radius:8px}
.date-fields label{flex:1;min-width:10rem}
.library-tools{display:flex;justify-content:space-between;gap:1rem;align-items:baseline;margin:1.5rem 0 .5rem;font-size:.85rem}
.library-tools p{margin:0}
.actions{display:flex;flex-wrap:wrap;align-items:center;gap:.85rem}
.preferences{position:relative;margin:0}
.preferences summary{font-size:.85rem;color:var(--muted)}
.preferences-panel{position:absolute;right:0;top:2.5rem;width:19rem;padding:1.25rem;background:var(--surface);border:1px solid var(--border);border-radius:10px;z-index:3;box-shadow:0 12px 30px #0005}
.preferences-panel form{margin-bottom:0}
.dashboard .library{margin-top:1rem}
.video-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2rem 1.25rem}
.video-card{min-width:0;overflow-wrap:anywhere}
.video-player{border-radius:10px;overflow:hidden;background:#1b303b;min-height:200px}
.video-player button{position:relative;display:block;padding:0;width:100%;min-height:200px;aspect-ratio:16/9;background:#1b303b;border:0;border-radius:10px;overflow:hidden}
.video-player button:hover{background:#233e4b}
.video-player img{width:100%;height:100%;object-fit:cover;display:block;aspect-ratio:16/9}
.play-icon{position:absolute;inset:50% auto auto 50%;transform:translate(-50%,-50%);display:grid;place-items:center;width:58px;height:58px;padding-left:3px;border-radius:50%;background:#101820db;color:white;font-size:1.3rem;box-shadow:0 0 0 1px #ffffff35}
.video-player button:hover .play-icon{background:var(--mint);color:var(--ink)}
.player-hint{position:absolute;bottom:10px;left:10px;background:#101820e8;color:white;border-radius:5px;font-size:.72rem;padding:.25rem .6rem;white-space:nowrap}
.video-player iframe{display:block;width:100%;height:auto;min-height:200px;aspect-ratio:16/9;border:0}
.video-copy{padding:.85rem .1rem 0}
.video-copy h3{font-size:1rem;line-height:1.45;margin:0 0 .7rem;letter-spacing:-.015em}
.video-meta{display:flex;align-items:center;gap:.65rem;font-size:.8rem;line-height:1.6;margin:0 0 .55rem}
.video-meta time{font-size:.75rem}
.avatar{display:inline-grid;place-items:center;flex-shrink:0;width:30px;height:30px;border-radius:50%;background:#29414a;color:#b1f0df;font-weight:650}
.avatar.large{width:46px;height:46px;font-size:1.2rem}
.video-duration{position:absolute;bottom:10px;right:10px;background:#080d12ed;color:#fff;border-radius:4px;padding:.2rem .4rem;font-size:.75rem;font-weight:700;font-variant-numeric:tabular-nums;line-height:1.2;pointer-events:none}
.pagination{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:1.5rem;margin:2.5rem 0 1rem;color:var(--muted);font-size:.9rem}
.video-grid.is-list{grid-template-columns:1fr}
.is-list .video-card{display:grid;grid-template-columns:minmax(240px,350px) 1fr;gap:1.5rem;padding-bottom:1.5rem;border-bottom:1px solid var(--border)}
.is-list .video-copy{padding-top:.4rem}
.is-list h3{font-size:1.2rem}
.empty-state{text-align:center;border:1px dashed var(--border);padding:3.5rem 1.5rem;border-radius:12px}
.empty-state p{max-width:36rem;margin:.75rem auto 1.5rem}
.empty-state>a{margin:.5rem}
.empty-symbol{font-size:3rem;color:var(--mint);display:block;margin-bottom:1rem}

.panel,.channel-card{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:1.5rem;min-width:0;overflow-wrap:anywhere}
.channel-add-panel{max-width:none}
.channel-add{display:flex;max-width:48rem;align-items:center}
.channel-add input{flex:1}
.channel-add button{flex-shrink:0}
.preview{border-color:var(--mint);margin:1.5rem 0}
.preview h2{margin-top:1rem}
.section-heading{display:flex;justify-content:space-between;gap:1rem;align-items:center}
.section-heading>a{font-size:.85rem}
.channel-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.25rem;margin:1.5rem 0}
.channel-heading{display:flex;gap:.8rem;align-items:center;margin-bottom:1.2rem}
.channel-heading h3{margin:0;line-height:1.4}
.channel-heading p{margin:.2rem 0 0}
.badges{display:flex;gap:.5rem;flex-wrap:wrap}
.badge{display:inline-block;font-size:.75rem;border-radius:20px;padding:.35rem .7rem;background:#24453f;color:#b1efdf}
.badge.neutral{background:#263942;color:#d0dbe0}
.badge.warning{background:#453923;color:#f5d69c}
.channel-options{border-top:1px solid var(--border);padding-top:.85rem}
.channel-options summary{font-size:.9rem}
.remove-channel summary{color:#f0b6bb}
.channel-card .actions{font-size:.85rem}
.help-layout{display:grid;grid-template-columns:230px minmax(0,1fr);gap:3rem;max-width:1100px}
.help-sidebar{padding-top:1rem}
.help-sidebar h2{font-size:.85rem;color:var(--muted);font-weight:500}
.help-sidebar nav{display:grid;gap:1.1rem;margin:1.5rem 0 2rem}
.help-sidebar nav a{text-decoration:none;color:var(--muted);font-size:.9rem}
.help-topics{min-width:0}
.help-topic{border:1px solid var(--border);border-radius:12px;background:var(--surface);margin:0 0 1rem;padding:1.2rem 1.5rem;scroll-margin-top:1rem}
.help-topic summary{font-size:1.1rem;font-weight:650}
.help-topic p,.help-topic dd{font-size:.95rem}
.help-topic>div{padding-top:.4rem}
.help-definitions dt{font-weight:650;margin:1rem 0 .35rem}
.help-definitions dd{margin:0;color:var(--muted);line-height:1.7}
.help-callout{padding:2rem 0}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:1rem}
.stats div{padding:1.2rem;background:var(--surface);border-radius:10px}
.stats dt{font-size:.85rem;color:var(--muted)}
.stats dd{font-size:2rem;margin:.6rem 0 0}
.table-scroll{overflow-x:auto}
table{width:100%;border-collapse:collapse;margin:1rem 0;font-size:.85rem}
th,td{padding:.8rem;text-align:left;border-bottom:1px solid var(--border);vertical-align:top}
caption{text-align:left;padding:.5rem 0;color:var(--muted)}
li{line-height:1.7;margin:.5rem 0}
#accounts-title{scroll-margin-top:1rem}

@media(min-width:1600px){.video-grid{gap:2rem 1.5rem}
}

@media(max-width:1050px){.header-inner{gap:1.8rem}
.header-inner nav{gap:1.25rem}
.video-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.library-tools{align-items:start;flex-direction:column}
.filter-primary{grid-template-columns:minmax(12rem,1fr) minmax(9rem,12rem) auto}
.view-toggle{grid-column:1/-1;width:fit-content}
.help-layout{grid-template-columns:180px minmax(0,1fr);gap:1.5rem}
}

@media(max-width:720px){.header-inner{padding:1rem 1.25rem 0;flex-wrap:wrap;gap:.75rem 1.5rem}
.brand{font-size:1rem}
.account-nav{font-size:.75rem}
.header-inner nav{order:3;width:100%;min-height:48px;gap:1.75rem}
.dashboard{padding:2rem 1.25rem}
.page-heading{align-items:flex-start;gap:1rem;flex-wrap:wrap}
.page-heading .button{font-size:.85rem}
.filter-primary{grid-template-columns:1fr auto}
.search-field{grid-column:1/-1}
.view-toggle{grid-column:auto}
.channel-list{grid-template-columns:1fr}
.help-layout{grid-template-columns:1fr}
.help-sidebar nav{display:flex;flex-wrap:wrap;gap:1rem}
.help-sidebar .button{display:none}
.section-heading{align-items:start;flex-direction:column}
.site-footer{padding:1.5rem 1.25rem;flex-wrap:wrap}
.preferences-panel{left:0;right:auto;max-width:calc(100vw - 3rem)}
.channel-add{flex-wrap:wrap}
.channel-add input{flex-basis:100%}
.channel-add button{width:100%}
.is-list .video-card{grid-template-columns:1fr;gap:.5rem}
.video-grid{gap:1.75rem 1rem}
.video-player,.video-player button{min-height:200px}
.brand-mark{width:30px;height:28px}
}

@media(max-width:540px){.video-grid{grid-template-columns:1fr}
.page-heading h1{font-size:2rem}
.help-topic{padding:1rem}
.account-nav{margin-left:0}
.library-tools .actions{gap:.8rem}
.panel,.channel-card{padding:1.2rem}
.preferences-panel{position:static;width:100%;margin-top:.5rem}
.preferences[open]{flex-basis:100%}
}

@media(prefers-reduced-motion:no-preference){button,a{transition:background-color .15s,color .15s}
}

.video-player:focus-within{outline:3px solid #ffd98e;outline-offset:4px}

@media(forced-colors:active){.view-toggle input:checked+span{outline:2px solid Highlight}
.play-icon{border:1px solid ButtonText}
}

/* Administration uses independent pages, not hidden panels. */
.admin-dashboard{margin-top:0;padding-top:1.5rem}
.admin-dashboard .page-heading{margin-bottom:1.25rem}
.admin-menu{display:flex;flex-wrap:wrap;gap:.4rem;border-bottom:1px solid var(--border);padding-bottom:.75rem}
.admin-menu a{display:flex;align-items:center;min-height:44px;padding:.65rem 1rem;border-radius:8px;text-decoration:none;color:var(--muted);font-weight:650}
.admin-menu a:hover{background:var(--surface-hover);color:var(--text)}
.admin-menu a[aria-current=page]{background:var(--mint);color:var(--ink)}
.admin-identity{margin:.8rem 0;color:var(--muted)}
.admin-dashboard .stats.admin-stats{grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}
.admin-summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:1rem;margin:1.25rem 0}
.admin-detail{margin:1rem 0}
.admin-detail>summary,.admin-create>summary{font-weight:650;cursor:pointer}
.admin-event{border-top:1px solid var(--border);padding:.85rem 0;overflow-wrap:anywhere}
.admin-section-title{margin-top:2rem}
.admin-dashboard td{overflow-wrap:anywhere}
.admin-dashboard td details{min-width:10rem;max-width:32rem}
.admin-dashboard .channel-list{grid-template-columns:repeat(auto-fit,minmax(min(100%,360px),1fr))}
.admin-dashboard .pagination{gap:1rem;flex-wrap:wrap}

/* Compact owned subscriptions; account cards retain their separate layout. */
.channels-dashboard{padding-top:1.5rem}
.channels-dashboard .page-heading{margin-bottom:1.25rem}
.channels-dashboard .channel-add-panel{padding:.6rem 1rem;margin:0 0 1rem}
.channels-dashboard .channel-add-panel>summary{min-height:44px;align-content:center;color:var(--mint);font-weight:650}
.channels-dashboard .channel-add-panel h2{font-size:1.1rem;margin-top:.75rem}
.channels-dashboard section{margin:1.25rem 0}
.channels-dashboard .section-heading{flex-wrap:wrap}
.channels-dashboard .section-heading h2{margin:0;font-size:1.1rem}
.subscription-list{display:grid;gap:.5rem;margin:1rem 0}
.subscription-row{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;column-gap:1.25rem;min-height:80px;padding:.75rem 7.5rem .75rem 1rem;border:1px solid var(--border);border-radius:10px;background:var(--surface);overflow-wrap:anywhere}
.subscription-row .channel-heading{margin:0;min-width:0}
.subscription-row .channel-heading h3{font-size:.95rem}
.subscription-row .channel-heading p{font-size:.8rem;margin:0}
.subscription-row .channel-browse{grid-column:3;display:inline-flex;align-items:center;min-height:44px;font-size:.875rem}
.subscription-row .badges:empty{display:none}
.subscription-manage{grid-column:1/-1;min-width:0}
.subscription-manage>summary{position:absolute;right:1rem;top:1rem;min-height:44px;align-content:center;font-size:.875rem;color:var(--mint)}
.subscription-controls{margin-top:.75rem;padding-top:.75rem;border-top:1px solid var(--border)}
.subscription-controls .actions{margin:.75rem 0}
.subscription-controls .remove-channel{margin-top:.75rem}
@media(max-width:700px){
.subscription-row{grid-template-columns:minmax(0,1fr) auto;column-gap:.75rem;padding-right:1rem}
.subscription-row .channel-heading{grid-column:1;padding-right:0}
.subscription-row .badges{grid-column:1;grid-row:2;margin-top:.35rem}
.subscription-row .channel-browse{grid-column:2;grid-row:2;justify-self:end}
.subscription-manage>summary{top:.75rem}
.subscription-row .channel-heading{margin-right:5.5rem;grid-column:1/-1}
.subscription-controls{padding-right:0}
}
/* Manual watched state remains legible without relying on colour alone. */
.video-card-footer{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:.65rem}.video-card-footer .video-meta{margin:0;min-width:0}.video-card-footer .video-meta>span:last-child{min-width:0;overflow-wrap:anywhere}.watch-form{display:flex;align-items:center;margin:0;max-width:none}
.watch-badge{min-height:32px;padding:.25rem .55rem;white-space:nowrap;border-radius:20px;background:#48545c;color:#fff;font-size:.7rem;font-weight:650;border:1px solid #64717a}
.watch-badge:hover{background:#596770;color:#fff}
.watch-badge.is-watched{background:#17683e;border-color:#32865a;color:#fff}
.watch-badge.is-watched:hover{background:#205936;color:#fff}
.watched-filter{display:inline-flex;align-items:center;min-height:44px;white-space:nowrap;font-size:.875rem}
.watch-feedback{grid-column:1/-1;margin-top:.4rem}
.watch-feedback:empty{display:none}

.account-nav .logout-button{background:#862e38;color:#fff;border-color:#a64a54;padding:.4rem .8rem;min-height:38px}.account-nav .logout-button:hover{background:#a23a46;color:#fff}
