* { box-sizing: border-box; }

:root {
	--page: #f2f2f2;
	--paper: #fcfcfc;
	--paper-top: #ffffff;
	--paper-bottom: #f1f1f1;
	--blue-0: #eff6fa;
	--blue-1: #dcecf5;
	--blue-2: #b9d8ea;
	--blue-3: #8fc0dc;
	--blue-4: #6ba7ca;
	--blue-5: #3f7fa7;
	--green: #76a866;
	--ink: #33383b;
	--muted: #777c80;
	--line: #cccccc;
	--line-dark: #b5b5b5;
	--link: #377ca5;
	--danger: #a34747;
	--shadow: rgba(40, 40, 40, .13);
}

html {
	background: var(--page);
	color: var(--ink);
	color-scheme: light;
	font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

body {
	background: linear-gradient(#fdfdfd 0, #f6f6f6 132px, var(--page) 330px);
	margin: 0;
	min-height: 100vh;
}

body::before {
	background: linear-gradient(#e4e4e4, #cfcfcf);
	border-bottom: 1px solid #bdbdbd;
	content: "";
	display: block;
	height: 3px;
}

[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; }

/* login */
.setup-shell {
	display: grid;
	min-height: calc(100vh - 4px);
	padding: 90px 18px 50px;
	place-items: start center;
}

.setup-card {
	background: linear-gradient(var(--paper-top), var(--paper-bottom));
	border: 1px solid var(--line-dark);
	border-radius: 3px;
	box-shadow: 0 1px 3px var(--shadow), inset 0 1px #fff;
	display: grid;
	gap: 10px;
	max-width: 390px;
	padding: 20px;
	width: 100%;
}

.setup-card h1 {
	color: #46555d;
	font-size: 21px;
	font-weight: 600;
	letter-spacing: -.2px;
	margin: 0 0 7px;
	text-shadow: 0 1px #fff;
}

.setup-card label,
.edit-card label {
	display: grid;
	gap: 4px;
}

.setup-card label span,
.edit-card label span,
.settings-field label {
	color: #555b5f;
	font-size: 12px;
	font-weight: 600;
}

.setup-card input,
.edit-card input,
.edit-card textarea,
.settings-field input {
	background: #fff;
	border: 1px solid #b7bec2;
	border-radius: 2px;
	box-shadow: inset 0 1px 2px rgba(52, 63, 69, .08);
	color: var(--ink);
	min-height: 33px;
	outline: none;
	padding: 6px 8px;
	width: 100%;
}

.setup-card input:focus,
.edit-card input:focus,
.edit-card textarea:focus,
.settings-field input:focus {
	border-color: var(--blue-4);
}

.advanced {
	border-top: 1px solid #e1ebf0;
	margin-top: 2px;
	padding-top: 7px;
}

.advanced summary {
	color: var(--muted);
	cursor: pointer;
	font-size: 12px;
}

.advanced label { margin-top: 8px; }

.primary-button {
	background: linear-gradient(#8fc5e2, #5f9fc5);
	border: 1px solid #4e88aa;
	border-radius: 3px;
	box-shadow: inset 0 1px rgba(255, 255, 255, .5), 0 1px 1px rgba(40, 40, 40, .12);
	color: #fff;
	font-weight: 700;
	min-height: 34px;
	padding: 6px 12px;
	text-shadow: 0 -1px rgba(40, 80, 105, .55);
}

.primary-button:hover,
.primary-button:focus-visible {
	background: linear-gradient(#9bcdea, #6ca9cd);
	border-color: #447d9f;
}

.text-button {
	background: linear-gradient(#fff, #eeeeee);
	border: 1px solid var(--line);
	border-radius: 2px;
	box-shadow: inset 0 1px #fff;
	color: var(--link);
	min-height: 30px;
	padding: 5px 9px;
}

.text-button:hover,
.text-button:focus-visible {
	background: linear-gradient(#8fc5e2, #609fc5);
	border-color: #4e88aa;
	color: #fff;
	text-shadow: 0 -1px rgba(40, 80, 105, .45);
}

.setup-status {
	color: var(--danger);
	font-size: 12px;
	margin: 10px 0 0;
	max-width: 390px;
	width: 100%;
}

/* shared site header */
.site-shell,
.watch-site {
	margin: 0 auto;
	max-width: 1080px;
	padding: 15px 18px 55px;
}

.site-header {
	align-items: center;
	background: linear-gradient(#fff, #eeeeee);
	border: 1px solid var(--line-dark);
	border-radius: 3px;
	box-shadow: 0 1px 2px var(--shadow), inset 0 1px #fff;
	display: flex;
	min-height: 46px;
	padding: 0 10px;
}

.site-brand {
	color: #45494c;
	font-size: 18px;
	font-weight: 600;
	letter-spacing: -.2px;
	margin-right: 22px;
	text-decoration: none;
	text-shadow: 0 1px #fff;
}

.site-brand:hover { text-decoration: none; }

.site-nav {
	display: flex;
	gap: 0;
}

.site-nav a {
	border-left: 1px solid #d5dadd;
	color: #5a666c;
	font-size: 13px;
	padding: 15px 13px 14px;
	text-decoration: none;
	text-shadow: 0 1px #fff;
}

.site-nav a:last-child { border-right: 1px solid #d5dadd; }
.site-nav a:hover {
	background: linear-gradient(#8fc5e2, #609fc5);
	color: #fff;
	text-shadow: 0 -1px rgba(40, 80, 105, .45);
}

.site-search {
	flex: 0 1 260px;
	margin-left: auto;
	min-width: 120px;
}

.site-search input {
	background: linear-gradient(#fff, #f5f5f5);
	border: 1px solid #bcbcbc;
	border-radius: 2px;
	box-shadow: inset 0 1px 2px rgba(50, 50, 50, .08);
	color: var(--ink);
	height: 28px;
	outline: none;
	padding: 4px 8px;
	width: 100%;
}

.site-search input:focus {
	background: #fff;
	border-color: #5f9fc5;
	box-shadow: inset 0 1px 2px rgba(50, 50, 50, .08), 0 0 0 1px rgba(95, 159, 197, .18);
}

.profile-actions {
	align-items: center;
	display: flex;
	gap: 5px;
	margin-left: 8px;
	position: relative;
}

.profile-name {
	color: #666b6e;
	font-size: 12px;
	max-width: 140px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.profile-toggle {
	align-items: center;
	background: transparent;
	border: 0;
	display: flex;
	height: 32px;
	justify-content: center;
	padding: 4px;
	width: 32px;
}

.profile-toggle:hover,
.profile-toggle:focus-visible,
.profile-toggle[aria-expanded="true"] {
	background: linear-gradient(#8fc5e2, #609fc5);
	border-radius: 2px;
}
.profile-toggle img { height: 16px; width: 16px; }

.settings-menu {
	background: #fbfcfc;
	border: 1px solid var(--line-dark);
	border-radius: 2px;
	box-shadow: 0 2px 5px rgba(49, 60, 66, .18), inset 0 1px #fff;
	display: grid;
	min-width: 190px;
	padding: 3px;
	position: absolute;
	right: 0;
	top: 36px;
	z-index: 50;
}

.settings-menu > a,
.settings-menu > button,
.settings-field > button {
	background: #fff;
	border: 0;
	color: var(--ink);
	display: block;
	font-size: 13px;
	padding: 7px 9px;
	text-align: left;
	text-decoration: none;
	width: 100%;
}

.settings-menu > a:hover,
.settings-menu > button:hover,
.settings-menu > a:focus-visible,
.settings-menu > button:focus-visible,
.settings-field > button:hover,
.settings-field > button:focus-visible {
	background: linear-gradient(#8fc5e2, #609fc5);
	color: #fff;
	text-decoration: none;
	text-shadow: 0 -1px rgba(40, 80, 105, .45);
}

.settings-field {
	border-bottom: 1px solid #e2e2e2;
	border-top: 1px solid #e2e2e2;
	display: grid;
	gap: 5px;
	margin: 3px 0;
	padding: 8px 7px;
}

.settings-field input { font-size: 12px; min-height: 29px; }
.settings-field > button { border: 1px solid var(--line); padding: 5px 7px; }

/* homepage: restrained old-Chromium matte UI */
.home-page { margin-top: 12px; }
.home-layout {
	display: grid;
	gap: 14px;
	grid-template-columns: minmax(0, 1fr) 245px;
}
.home-main,
.home-side { display: grid; align-content: start; gap: 14px; }

.content-box {
	background: #fbfcfc;
	border: 1px solid var(--line);
	border-radius: 3px;
	box-shadow: 0 1px 2px rgba(56, 68, 75, .07), inset 0 1px #fff;
	overflow: hidden;
}

.content-box > h2 {
	background: linear-gradient(#fff, #eeeeee);
	border-bottom: 1px solid #c8c8c8;
	color: #505457;
	font-size: 14px;
	font-weight: 600;
	margin: 0;
	padding: 8px 10px;
	text-shadow: 0 1px #fff;
}

.home-grid {
	display: grid;
	gap: 10px;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	padding: 10px;
}

.home-watch-card {
	background: linear-gradient(#fff, #f0f0f0);
	border: 1px solid #c8c8c8;
	border-radius: 2px;
	box-shadow: 0 1px 1px rgba(45, 45, 45, .06);
	color: #444a4e;
	display: grid;
	grid-template-rows: 88px auto 3px;
	min-width: 0;
	overflow: hidden;
	text-decoration: none;
}

.home-watch-card::before {
	align-items: center;
	background: linear-gradient(#f7f7f7, #e8e8e8);
	color: #7d8a91;
	content: "video";
	display: flex;
	font-size: 11px;
	grid-column: 1;
	grid-row: 1;
	justify-content: center;
}

.home-watch-card.has-image::before { display: none; }
.home-watch-card img {
	grid-column: 1;
	grid-row: 1;
	height: 88px;
	object-fit: cover;
	width: 100%;
}
.home-watch-card:hover {
	border-color: #8faebb;
	box-shadow: 0 1px 3px rgba(55, 71, 79, .12);
	text-decoration: none;
}
.home-watch-title {
	font-size: 12px;
	font-weight: 600;
	overflow: hidden;
	padding: 6px 7px;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.watch-progress { background: #d9dee1; display: block; height: 3px; }
.watch-progress span { background: #79a995; display: block; height: 100%; }
.home-empty { color: var(--muted); font-size: 12px; margin: 0; padding: 12px; }

.account-box p { font-size: 13px; margin: 0; padding: 10px; }
.account-box p + p { border-top: 1px solid #ededed; padding-top: 7px; }
.muted { color: var(--muted); }
.home-library-links { display: grid; }
.home-library-links a {
	border-bottom: 1px solid #ededed;
	font-size: 13px;
	padding: 7px 10px;
}
.home-library-links a:last-child { border-bottom: 0; }

/* library */
.library-shell {
	background: #fbfcfc;
	border: 1px solid var(--line);
	border-radius: 3px;
	box-shadow: 0 1px 2px rgba(56, 68, 75, .07), inset 0 1px #fff;
	margin-top: 12px;
	padding: 0 14px 18px;
	overflow: hidden;
}

.library-heading {
	align-items: baseline;
	background: linear-gradient(#fff, #eeeeee);
	border-bottom: 1px solid #c8c8c8;
	display: flex;
	justify-content: space-between;
	margin: 0 -14px 13px;
	padding: 9px 12px;
}
.library-heading h1 {
	color: #505457;
	font-size: 15px;
	margin: 0;
	text-shadow: 0 1px #fff;
}
#status { color: var(--muted); font-size: 11px; margin: 0; }

.path-nav {
	color: var(--muted);
	font-size: 12px;
	margin: 0 0 11px;
}
.path-nav a { color: var(--link); }

.search-empty {
	color: var(--muted);
	font-size: 12px;
	grid-column: 1 / -1;
	padding: 14px 2px;
}

.title-grid {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.title-card {
	aspect-ratio: 16 / 11;
	background: linear-gradient(#fafafa, #e9e9e9);
	border: 1px solid #c2c2c2;
	border-radius: 2px;
	box-shadow: 0 1px 2px rgba(50, 62, 68, .08);
	min-width: 0;
	overflow: hidden;
	position: relative;
}
.title-card:hover,
.title-card:focus-within {
	border-color: #839fab;
	box-shadow: 0 1px 4px rgba(50, 69, 77, .15);
}
.title-card > a { inset: 0; position: absolute; text-indent: -9999px; z-index: 5; }
.directory-card {
	aspect-ratio: 16 / 11;
	background: linear-gradient(#fcfcfc, #e7e7e7);
}
.card-art,
.card-art-image { inset: 0; position: absolute; }
.card-art-image { height: 100%; object-fit: cover; width: 100%; z-index: 0; }
.card-glow { display: none; }
.card-mark {
	align-items: center;
	color: #555c60;
	display: flex;
	font-size: 17px;
	font-weight: 600;
	height: 100%;
	justify-content: center;
	padding: 12px;
	position: absolute;
	text-align: center;
	text-shadow: 0 1px #fff;
	width: 100%;
	z-index: 2;
}
.title-card.has-image .card-mark { display: none; }

.title-card.has-image .card-art,
.title-card.has-image .card-art-image {
	bottom: 0;
}
.card-copy {
	background: linear-gradient(
		transparent,
		rgba(46, 51, 54, .16) 20%,
		rgba(32, 36, 39, .66) 68%,
		rgba(23, 26, 28, .84)
	);
	bottom: 0;
	display: grid;
	gap: 2px;
	left: 0;
	min-height: 52px;
	padding: 18px 8px 7px;
	position: absolute;
	right: 0;
	z-index: 3;
}
.title-card:not(.has-image) .card-copy { display: none; }
.card-eyebrow,
.card-meta {
	color: #dde3e6;
	font-size: 10px;
	font-weight: 700;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.card-title {
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	overflow: hidden;
	text-overflow: ellipsis;
	text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
	white-space: nowrap;
}
.card-description { display: none; }

.art-upload-button {
	background: linear-gradient(#fff, #e9e9e9);
	border: 1px solid #ababab;
	border-radius: 2px;
	display: grid;
	height: 24px;
	opacity: 0;
	padding: 0;
	place-items: center;
	position: absolute;
	right: 5px;
	top: 5px;
	width: 24px;
	z-index: 8;
}
.title-card:hover .art-upload-button,
.title-card:focus-within .art-upload-button { opacity: 1; }
.art-upload-button img { height: 11px; width: 11px; }

.library-watch-progress {
	background: rgba(213, 219, 222, .96);
	bottom: 0;
	height: 3px;
	left: 0;
	position: absolute;
	right: 0;
	z-index: 9;
}
.library-watch-progress span { background: #79a995; display: block; height: 100%; }
.watched-badge {
	background: #edf5eb;
	border: 1px solid #91ad88;
	color: #56784d;
	font-size: 10px;
	padding: 2px 4px;
	position: absolute;
	bottom: 5px;
	right: 5px;
	z-index: 10;
}

/* edit dialog: no title row */
.edit-popover {
	align-items: center;
	background: rgba(40, 40, 40, .34);
	display: grid;
	inset: 0;
	padding: 18px;
	position: fixed;
	z-index: 200;
}
.edit-card {
	background: linear-gradient(#fff, #eeeeee);
	border: 1px solid var(--line-dark);
	border-radius: 3px;
	box-shadow: 0 3px 10px rgba(40, 51, 57, .22), inset 0 1px #fff;
	display: grid;
	gap: 9px;
	margin: auto;
	max-width: 500px;
	padding: 16px;
	width: 100%;
}
.edit-card textarea { min-height: 82px; resize: vertical; }
.edit-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

/* watch page */
.watch-shell {
	background: #fbfcfc;
	border: 1px solid var(--line);
	border-radius: 3px;
	box-shadow: 0 1px 2px rgba(56, 68, 75, .07), inset 0 1px #fff;
	margin-top: 12px;
	padding: 0 14px 16px;
	overflow: hidden;
}
.watch-heading {
	align-items: baseline;
	background: linear-gradient(#fff, #eeeeee);
	border-bottom: 1px solid #c8c8c8;
	display: flex;
	justify-content: space-between;
	margin: 0 -14px 14px;
	padding: 9px 12px;
}
.watch-heading h1 { color: #505457; font-size: 15px; margin: 0; text-shadow: 0 1px #fff; }
.watch-heading p { color: var(--muted); font-size: 11px; margin: 0; }
.watch-player { background: #000; position: relative; width: 100%; }
.watch-player .plyr { width: 100%; }
.watch-player .plyr--video { aspect-ratio: 16 / 9; }
.external-player-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	padding-top: 7px;
}
.external-player-group {
	align-items: center;
	display: inline-flex;
	gap: 2px;
}
.external-player-button {
	align-items: center;
	background: transparent;
	border: 0;
	display: inline-flex;
	height: 30px;
	justify-content: center;
	padding: 0;
	text-decoration: none;
	width: 30px;
}
.external-player-button:hover,
.external-player-button:focus-visible {
	opacity: .7;
	text-decoration: none;
}
.external-player-button img {
	display: block;
	height: 19px;
	width: 19px;
}
.external-player-copy {
	background: transparent;
	border: 0;
	color: var(--muted);
	cursor: pointer;
	font: inherit;
	font-size: 11px;
	padding: 3px 2px;
}
.external-player-copy:hover,
.external-player-copy:focus-visible {
	color: #333;
	text-decoration: underline;
}
.resume-note {
	background: linear-gradient(#fdfdfd, #eeeeee);
	border: 1px solid var(--line);
	border-radius: 2px;
	color: #5d6265;
	font-size: 11px;
	margin-top: 8px;
	padding: 5px 7px;
}

.audio-track-control { display: inline-block; height: 35px; position: relative; width: 35px; }
.audio-track-icon {
	filter: brightness(0) invert(1);
	height: 17px;
	left: 50%;
	pointer-events: none;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 17px;
}
.audio-track-select {
	appearance: none;
	background: transparent;
	border: 0;
	cursor: pointer;
	height: 35px;
	opacity: 0;
	width: 35px;
}
.audio-track-select option { color: #111; }
video::cue { background: transparent; color: #fff; text-shadow: 0 1px 2px #000, 0 0 5px #000; }
.error { color: var(--danger) !important; }

@media (max-width: 760px) {
	.site-shell,
	.watch-site { padding: 10px 8px 35px; }
	.site-header { padding-left: 9px; padding-right: 7px; }
	.site-brand { font-size: 16px; margin-right: 10px; }
	.site-nav a { padding: 16px 8px; }
	.site-search { flex-basis: 200px; }
	.home-layout { grid-template-columns: 1fr; }
	.home-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.title-grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 8px; }
}


@media (max-width: 460px) {
	.setup-shell { padding-top: 45px; }
	.home-side { grid-template-columns: 1fr; }
	.site-nav { display: none; }
	.site-search { flex: 1 1 auto; margin-left: 0; min-width: 0; }
	.profile-name { display: none; }
	.home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
