/* share.spoolette.com: page styles on top of the portal kit (tokens.css + portal.css). */

/* .btn sets display, which beats the browser's own [hidden] rule. */
[hidden] { display: none !important; }

.band__mark span { overflow-wrap: anywhere; }

/* ---------- Watch page ---------- */

.watch { max-width: 88rem; }
.watch__grid { display: grid; gap: var(--sp-4); align-items: start; }
.watch__grid.has-transcript { grid-template-columns: minmax(0, 1fr) 22rem; }
@media (max-width: 1000px) {
	.watch__grid.has-transcript { grid-template-columns: minmax(0, 1fr); }
}

.stage {
	background: var(--stage);
	border-radius: var(--r-panel);
	overflow: hidden;
	line-height: 0;
}
.stage video {
	display: block;
	width: 100%;
	height: auto;
	max-height: 78vh;
	background: var(--stage);
}

.watch__head { margin: var(--sp-3) 0 var(--sp-2); display: grid; gap: 0.25rem; }
.watch__head .page__title { overflow-wrap: anywhere; }
.watch__meta { margin: 0; font-size: var(--fs-sm); }

.tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.speeds { display: inline-flex; border: var(--border-w) solid var(--line-strong); border-radius: var(--r-control); overflow: hidden; background: var(--surface); }
.speeds button {
	min-height: 2.5rem;
	min-width: 3.1rem;
	padding: 0 var(--sp-2);
	border: 0;
	border-left: var(--border-w) solid var(--line);
	background: transparent;
	color: var(--heading);
	font: var(--weight-bold) var(--fs-sm)/1 var(--font-ui);
	cursor: pointer;
}
.speeds button:first-child { border-left: 0; }
.speeds button:hover { background: var(--info-tint); }
.speeds button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.btn[aria-pressed="true"] { background: var(--info-tint); border-color: var(--accent); color: var(--accent); }

/* Transcript: beside the video on wide screens, under it on narrow ones. */
.transcript { padding: 0; display: flex; flex-direction: column; max-height: min(78vh, 46rem); }
.transcript__head { display: grid; gap: var(--sp-2); padding: var(--sp-3) var(--sp-3) var(--sp-2); border-bottom: var(--border-w) solid var(--line); }
.transcript__head .panel__title { margin: 0; }
.cues { list-style: none; margin: 0; padding: var(--sp-1); overflow-y: auto; overscroll-behavior: contain; }
.cue {
	display: grid;
	grid-template-columns: 3.4rem minmax(0, 1fr);
	gap: var(--sp-2);
	width: 100%;
	padding: 0.4rem var(--sp-2);
	border: var(--border-w) solid transparent;
	border-radius: var(--r-control);
	background: transparent;
	color: var(--text);
	font: var(--fs-sm)/var(--lh-ui) var(--font-ui);
	text-align: left;
	cursor: pointer;
}
.cue:hover { border-color: var(--line-strong); }
.cue.is-now { background: var(--info-tint); }
.cue__t { color: var(--link); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; }
.cue mark { background: var(--hilite); color: inherit; border-radius: 2px; }
@media (max-width: 1000px) {
	.transcript { max-height: 28rem; }
}

/* ---------- Messages, login ---------- */

.center { max-width: 30rem; margin: var(--sp-6) auto; padding: 0 16px; display: grid; gap: var(--sp-3); text-align: center; }
.center .panel { text-align: left; display: grid; gap: var(--sp-3); }
.error { color: var(--bad); font-weight: var(--weight-bold); margin: 0; }

/* ---------- Admin ---------- */

.lib__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3); }
.lib__head .page__title { margin-right: auto; }
.lib__head .input { width: min(22rem, 100%); }
.check { display: inline-flex; align-items: center; gap: 0.4rem; font-size: var(--fs-sm); color: var(--heading); cursor: pointer; }

.vid { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center; padding: var(--sp-2) var(--sp-3); }
.vid__thumb { width: 9.5rem; aspect-ratio: 16 / 9; border-radius: var(--r-control); background: var(--stage); object-fit: cover; display: block; }
.vid__main { display: grid; gap: 0.2rem; min-width: 0; }
.vid__title { font-weight: var(--weight-bold); color: var(--heading); overflow-wrap: anywhere; background: none; border: 0; padding: 0; font: inherit; font-weight: var(--weight-bold); text-align: left; cursor: pointer; }
.vid__title:hover { color: var(--link); text-decoration: underline; }
.vid__meta { font-size: var(--fs-sm); color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 0.2rem 0.75rem; align-items: center; }
.vid__actions { display: flex; flex-wrap: wrap; gap: var(--sp-1); justify-content: flex-end; }
.vid.is-deleted { opacity: 0.6; }
@media (max-width: 760px) {
	.vid { grid-template-columns: 6.5rem minmax(0, 1fr); }
	.vid__thumb { width: 6.5rem; }
	.vid__actions { grid-column: 1 / -1; justify-content: flex-start; }
}

.drawer {
	width: min(46rem, 100vw);
	max-width: 100vw;
	height: 100dvh;
	max-height: 100dvh;
	margin: 0 0 0 auto;
	padding: 0;
	border: 0;
	border-left: var(--border-w) solid var(--line);
	background: var(--ground);
	color: var(--text);
}
.drawer::backdrop { background: rgba(5, 18, 48, 0.4); }
.drawer__head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); background: var(--surface); border-bottom: var(--border-w) solid var(--line); }
.drawer__head h2 { font-size: var(--fs-xl); margin-right: auto; overflow-wrap: anywhere; }
.drawer__body { padding: var(--sp-3); display: grid; gap: var(--sp-3); }
.drawer video { width: 100%; height: auto; border-radius: var(--r-control); background: var(--stage); display: block; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: var(--sp-3); }
.inline { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.inline .input { flex: 1 1 12rem; width: auto; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { padding: 0.45rem 0.5rem; border-bottom: var(--border-w) solid var(--line); text-align: left; vertical-align: top; }
.table th { color: var(--heading); font-weight: var(--weight-bold); white-space: nowrap; }
.table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr.is-owner td { color: var(--text-muted); }

.links { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
.links li { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.links code { font-size: var(--fs-xs); color: var(--text-muted); overflow-wrap: anywhere; }

.toast {
	position: fixed;
	left: 50%;
	bottom: var(--sp-4);
	transform: translateX(-50%);
	z-index: 50;
	padding: 0.6rem 1rem;
	border-radius: var(--r-pill);
	background: var(--spool-indigo);
	color: #ffffff;
	font-size: var(--fs-sm);
	font-weight: var(--weight-bold);
}
