/* Track library pages (library.html, save-track.html), on the Groove Dog brand: the
   tokens come from brand.css (linked first), as on the home page and the Scribe. Light or dark
   with them (theme.js); the few colours of the library's own are set for both below. */
:root {
	--tl-bg: var(--bn-stage);
	--tl-surface: var(--bn-surface);
	--tl-surface-2: var(--bn-surface-2);
	--tl-border: var(--bn-line);
	--tl-text: var(--bn-text);
	--tl-muted: var(--bn-muted);
	--tl-accent: var(--bn-brass);
	--tl-accent-fill: var(--bn-brass-fill);
	--tl-accent-dim: #c7963a;
	--tl-danger: #e85d5d;
	--tl-warn: var(--bn-warn);
	--tl-radius: 8px;
	--tl-shadow: 0 8px 32px var(--bn-shadow);
	--tl-danger-line: #633;
	--tl-danger-text: #fcc;
	--tl-chip: var(--bn-olive);
	--tl-chip-text: var(--bn-olive-ink);
	--tl-shimmer: var(--bn-surface-2);
	--page-max: 1200px;
	--gutter: clamp(1rem, 3vw, 2rem);
}

:root[data-theme="light"] {
	--tl-accent-dim: #a9781c;
	--tl-danger: var(--bn-danger-text);
	--tl-danger-line: #e2b4ab;
	--tl-danger-text: var(--bn-danger-text);
	--tl-shimmer: var(--bn-surface);
}

* {
	box-sizing: border-box;
}

body.track-library-page {
	margin: 0;
	min-height: 100vh;
	font: 400 1rem/1.5 var(--bn-body);
	background: var(--tl-bg);
	color: var(--tl-text);
}

/* Controls use the page's Barlow, not the browser's default font. */
body.track-library-page button,
body.track-library-page input,
body.track-library-page select,
body.track-library-page textarea {
	font-family: inherit;
}

body.track-library-page :focus-visible {
	outline: 3px solid var(--bn-brass);
	outline-offset: 2px;
}

.tl-shell {
	max-width: var(--page-max);
	margin: 0 auto;
	padding: clamp(1.75rem, 5vw, 3rem) max(var(--gutter), env(safe-area-inset-right, 0px))
		calc(3rem + env(safe-area-inset-bottom, 0px)) max(var(--gutter), env(safe-area-inset-left, 0px));
}

.tl-topbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.tl-topbar h1 {
	margin: 0;
	font: 700 clamp(2.2rem, 5vw, 3.2rem)/1.05 var(--bn-display);
	letter-spacing: 0.01em;
}

.tl-topbar p {
	margin: 0.15rem 0 0;
	color: var(--tl-muted);
	font-size: 0.9rem;
}

.tl-topbar-main {
	flex: 1;
	min-width: 200px;
}

.tl-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.tl-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.55rem 0.95rem;
	border-radius: var(--bn-radius);
	border: 1.5px solid var(--bn-outline);
	background: transparent;
	color: var(--tl-text);
	font: 600 0.95rem/1.2 var(--bn-body);
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
}

.tl-btn:hover {
	background: var(--tl-surface-2);
	border-color: var(--tl-text);
}

.tl-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.tl-btn-primary {
	background: var(--tl-accent-fill);
	border-color: var(--tl-accent-fill);
	color: var(--bn-brass-ink);
}

.tl-btn-primary:hover {
	background: var(--bn-brass-fill-hover);
	border-color: var(--bn-brass-fill-hover);
}

.tl-btn-ghost {
	background: transparent;
}

.tl-btn-danger {
	border-color: var(--tl-danger-line);
	color: var(--tl-danger-text);
}

.tl-btn-danger:hover {
	background: var(--bn-danger-bg);
}

.tl-tabs {
	display: flex;
	gap: 0.2rem;
	border-bottom: 1px solid var(--tl-border);
	margin-bottom: 1.25rem;
	overflow-x: auto; /* phones: the tabs scroll rather than overflow */
}

.tl-tab {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.7rem 1rem;
	border: none;
	background: transparent;
	color: var(--tl-muted);
	font-size: 0.95rem;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
	border-bottom: 3px solid transparent;
	margin-bottom: -1px;
	transition: color 0.15s, border-color 0.15s;
}

/* A dot on a tab (Backup & key: no backup yet) */

.tl-tab-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--tl-warn);
}

.tl-tab:hover {
	color: var(--tl-text);
}

.tl-tab-active {
	color: var(--tl-text);
	border-color: var(--tl-accent);
}

.tl-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-bottom: 0.9rem;
}

/* View switcher and label filters share one row */
.tl-filter-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem 1.5rem;
	margin-bottom: 1rem;
}

.tl-search {
	flex: 1;
	min-width: 220px;
	padding: 0.65rem 0.85rem;
	border-radius: var(--tl-radius);
	border: 1px solid var(--tl-border);
	background: var(--tl-surface);
	color: var(--tl-text);
	font-size: 1rem;
}

.tl-search:focus {
	outline: 2px solid var(--tl-accent);
	outline-offset: 1px;
}

.tl-label-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
}

.tl-chip {
	display: inline-flex;
	align-items: center;
	padding: 0.3rem 0.65rem;
	border-radius: 999px;
	font-size: 0.8rem;
	border: 1px solid var(--tl-border);
	background: var(--tl-surface);
	color: var(--tl-muted);
	cursor: pointer;
	transition: all 0.15s;
}

.tl-chip:hover {
	border-color: var(--tl-accent);
	color: var(--tl-text);
}

.tl-chip-active,
.tl-chip[aria-pressed="true"] {
	background: var(--tl-accent-fill);
	border-color: var(--tl-accent-fill);
	color: var(--bn-brass-ink);
	font-weight: 600;
}

/* Shared pieces for the redesign: a small button, a card, a native <dialog>. */
.tl-btn-sm {
	min-height: 34px;
	padding: 0.25rem 0.65rem;
	font-size: 0.9rem;
}

.tl-panel-card {
	background: var(--tl-surface);
	border: 1px solid var(--tl-border);
	border-radius: var(--tl-radius);
	padding: 1rem 1.1rem;
	margin-bottom: 1rem;
}

.tl-panel-card h2 {
	margin: 0 0 0.4rem;
	font: 700 1.4rem/1.1 var(--bn-display);
	letter-spacing: 0.03em;
}

dialog.tl-dialog {
	width: min(480px, 92vw);
	padding: 1.1rem 1.2rem;
	background: var(--tl-surface);
	color: var(--tl-text);
	border: 1px solid var(--bn-control-line);
	border-radius: 10px;
}

dialog.tl-dialog::backdrop {
	background: var(--bn-backdrop);
}

.tl-list-summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 0.6rem;
	font-size: 0.92rem;
	color: var(--tl-muted);
}

/* "Pick up where you left off": up to four recently opened grooves */
.tl-section-h {
	margin: 0 0 0.7rem;
	font: 600 0.92rem/1.2 var(--bn-body);
	color: var(--tl-muted);
}

.tl-labels-h {
	margin-right: 0.1rem;
	font-size: 0.85rem;
	color: var(--tl-muted);
}

.tl-section-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	cursor: pointer;
}

.tl-section-toggle:hover {
	color: var(--tl-text);
}

.tl-section-toggle[aria-expanded="true"] .tl-chevron {
	transform: rotate(90deg);
}

.tl-recent {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 0.7rem;
	margin-bottom: 1.2rem;
}

.tl-recent-card {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	min-width: 0;
	padding: 0.7rem 0.8rem;
	background: var(--tl-surface);
	border: 1px solid var(--tl-border);
	border-radius: var(--tl-radius);
}

.tl-recent-name,
.tl-recent-path {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.tl-recent-name {
	font-weight: 600;
	color: inherit;
	text-decoration: none;
}

.tl-recent-name:hover,
.tl-recent-name:focus-visible {
	color: var(--tl-accent);
	text-decoration: underline;
}

.tl-recent-path {
	font-size: 0.85rem;
	color: var(--tl-muted);
}

.tl-recent-meta {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.2rem;
}

.tl-recent-meta .tl-hint {
	margin: 0;
	font-size: 0.85rem;
}

.tl-recent-meta .tl-btn {
	margin-left: auto;
}

/* By artist · All grooves · Shared with me */
.tl-views {
	display: inline-flex;
	flex-wrap: wrap;
}

.tl-views button {
	min-height: 34px;
	padding: 0.3rem 0.8rem;
	margin-left: -1px;
	border: 1px solid var(--tl-border);
	background: transparent;
	color: var(--tl-muted);
	font: 600 0.88rem var(--bn-body);
	cursor: pointer;
}

.tl-views button:first-child {
	margin-left: 0;
	border-radius: var(--tl-radius) 0 0 var(--tl-radius);
}

.tl-views button:last-child {
	border-radius: 0 var(--tl-radius) var(--tl-radius) 0;
}

.tl-views button[aria-pressed="true"] {
	position: relative;
	z-index: 1;
	background: var(--tl-surface);
	border-color: var(--tl-accent);
	color: var(--tl-accent);
}

/* The artist tree: compact rows, an artist's grooves listed beneath it */
.tl-track-list {
	display: flex;
	flex-direction: column;
}

.tl-artist-block {
	border-bottom: 1px solid var(--tl-border);
}

.tl-artist-divider {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	border-radius: 6px;
}

.tl-artist-divider-focused {
	outline: 2px solid var(--tl-accent);
	outline-offset: -2px;
}

.tl-artist-toggle {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	flex: 1;
	min-width: 0;
	min-height: 56px;
	padding: 0.6rem 0.3rem;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.tl-artist-toggle:hover {
	background: var(--bn-tint);
}

.tl-chevron {
	flex: none;
	width: 14px;
	height: 14px;
	color: var(--tl-muted);
	transition: transform 0.12s;
}

.tl-artist-toggle[aria-expanded="true"] .tl-chevron {
	transform: rotate(90deg);
}

.tl-artist-header-text {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0 0.5rem;
	min-width: 0;
	flex: 1;
}

.tl-artist-title {
	font: 700 1.35rem/1.1 var(--bn-display);
	letter-spacing: 0.02em;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.tl-artist-meta {
	font-size: 0.88rem;
	color: var(--tl-muted);
}

.tl-song-count {
	flex-shrink: 0;
	font-size: 0.8rem;
	color: var(--tl-muted);
	border: 1px solid var(--tl-border);
	border-radius: 999px;
	padding: 0.1rem 0.6rem;
	white-space: nowrap;
}

.tl-artist-songs {
	padding-bottom: 0.4rem;
}

.tl-song-header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.4rem 0.3rem 0.2rem 2.1rem;
}

.tl-song-header .tl-hint {
	margin: 0;
	font-size: 0.9rem;
}

.tl-song-title-sub {
	margin: 0;
	min-width: 0;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--tl-text);
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.tl-more {
	padding: 0.3rem 0.3rem 0.7rem 2.1rem;
}

.tl-track-row {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.7rem;
	padding: 0.55rem 0.3rem 0.55rem 2.1rem;
	border-top: 1px solid var(--bn-tint);
}

.tl-track-row-flat {
	padding-left: 0.3rem;
}

.tl-track-row-selected {
	background: color-mix(in srgb, var(--bn-olive) 45%, transparent);
}

.tl-track-row-focused {
	outline: 2px solid var(--tl-accent);
	outline-offset: -2px;
}

.tl-track-row-dragging {
	opacity: 0.4;
}

.tl-track-row-drop-before {
	box-shadow: inset 0 2px 0 var(--tl-accent);
}

.tl-track-row-drop-after {
	box-shadow: inset 0 -2px 0 var(--tl-accent);
}

/* The drag handle sits in the row's indent, so rows line up with or without one */
.tl-row-handle {
	position: absolute;
	left: 0.6rem;
	color: var(--tl-muted);
	font-size: 1rem;
	line-height: 1;
	cursor: grab;
}

.tl-row-handle:active {
	cursor: grabbing;
}

.tl-check {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: var(--tl-accent-fill);
	cursor: pointer;
}

/* ▶ preview */
.tl-preview {
	flex: none;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1.5px solid var(--tl-accent);
	border-radius: 50%;
	background: transparent;
	color: var(--tl-accent);
	cursor: pointer;
}

.tl-preview[aria-pressed="true"] {
	background: var(--tl-accent-fill);
	color: var(--bn-brass-ink);
}

.tl-preview svg {
	width: 14px;
	height: 14px;
}

.tl-row-main {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 0;
	flex: 1;
}

.tl-row-title {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	color: var(--tl-text);
}

.tl-row-title-text {
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	color: inherit;
	text-decoration: none;
}

/* The name opens the groove; its hit area stretches over the whole text column */
.tl-row-title-text::after {
	content: "";
	position: absolute;
	inset: 0;
}

.tl-row-main:hover .tl-row-title-text,
.tl-row-title-text:focus-visible {
	color: var(--tl-accent);
	text-decoration: underline;
}

.tl-row-meta {
	margin: 0;
	font-size: 0.85rem;
	color: var(--tl-muted);
}

.tl-track-row mark {
	padding: 0 1px;
	border-radius: 2px;
	background: color-mix(in srgb, var(--tl-accent) 35%, transparent);
	color: inherit;
}

.tl-row-actions {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	flex-shrink: 0;
}

/* Select mode's actions stay in reach at the bottom of the screen */
.tl-bulk-bar {
	position: sticky;
	bottom: calc(10px + env(safe-area-inset-bottom, 0px));
	z-index: 4;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem;
	margin-top: 1rem;
	padding: 0.6rem 0.8rem;
	border: 1px solid var(--tl-accent);
	border-radius: var(--tl-radius);
	background: var(--tl-surface-2);
	box-shadow: 0 8px 24px var(--bn-shadow);
}

.tl-bulk-count {
	margin-right: auto;
}

.tl-bulk-select-all {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-size: 0.9rem;
	cursor: pointer;
}

.tl-dialog-label {
	display: block;
	margin: 0.6rem 0 0.3rem;
	font-size: 0.92rem;
	color: var(--tl-muted);
}

dialog.tl-dialog h2 {
	margin: 0;
	font: 700 1.4rem/1.1 var(--bn-display);
}

dialog.tl-dialog input[type="text"] {
	width: 100%;
	box-sizing: border-box;
}

/* Phones: a groove's labels and buttons wrap under its name */
@media (max-width: 600px) {
	.tl-track-row {
		flex-wrap: wrap;
		padding-left: 0.3rem;
	}

	.tl-row-main {
		flex-basis: calc(100% - 60px);
	}

	.tl-row-actions {
		margin-left: auto;
	}

	.tl-row-handle {
		display: none;
	}

	.tl-song-header,
	.tl-more {
		padding-left: 0.3rem;
	}
}

.tl-card-labels {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	min-height: 1.4rem;
}

.tl-tag {
	font-size: 0.72rem;
	padding: 0.15rem 0.5rem;
	border-radius: 4px;
	background: var(--tl-chip);
	color: var(--tl-chip-text);
}

.tl-card-menu {
	position: relative;
}

.tl-menu-toggle {
	padding: 0.55rem 0.75rem;
	font-size: 1.1rem;
	line-height: 1;
	letter-spacing: 0.1em;
}

.tl-card-menu-open .tl-menu-toggle {
	background: var(--tl-surface-2);
	border-color: var(--bn-outline);
}

.tl-menu-dropdown {
	position: absolute;
	right: 0;
	bottom: calc(100% + 0.4rem);
	z-index: 10;
	display: flex;
	flex-direction: column;
	min-width: 150px;
	width: max-content;
	max-width: calc(100vw - 2rem);
	padding: 0.35rem;
	background: var(--tl-surface-2);
	border: 1px solid var(--tl-border);
	border-radius: 8px;
	box-shadow: var(--tl-shadow);
}

.tl-card-menu-down .tl-menu-dropdown {
	bottom: auto;
	top: calc(100% + 0.4rem);
}

.tl-menu-item {
	display: block;
	width: 100%;
	padding: 0.5rem 0.6rem;
	border: none;
	border-radius: 6px;
	background: transparent;
	color: var(--tl-text);
	font: inherit;
	font-size: 0.9rem;
	line-height: 1.25;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

.tl-menu-sep {
	margin: 0.3rem 0.4rem;
	border: 0;
	border-top: 1px solid var(--tl-border);
}

.tl-menu-item:hover {
	background: var(--tl-surface);
}

.tl-menu-item:disabled {
	opacity: 0.5;
	cursor: default;
}

.tl-menu-item-danger {
	color: var(--tl-danger-text);
}

.tl-menu-item-danger:hover {
	background: var(--bn-danger-bg);
}

.tl-empty,
.tl-message {
	text-align: center;
	padding: 3rem 1rem;
	color: var(--tl-muted);
}

.tl-empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	text-align: center;
	padding: 3.5rem 1rem;
}

.tl-empty-state .tl-btn {
	margin-top: 0.75rem;
}

.tl-empty-heading {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--tl-text);
}

.tl-skeleton-group {
	pointer-events: none;
}

.tl-skel {
	border-radius: 4px;
	background: linear-gradient(90deg, var(--tl-surface-2) 25%, var(--tl-shimmer) 37%, var(--tl-surface-2) 63%);
	background-size: 400% 100%;
	animation: tl-skel-shimmer 1.4s ease infinite;
}

.tl-skel-artist-title {
	width: 35%;
	height: 1.2rem;
	margin-bottom: 0.4rem;
}

.tl-skel-artist-meta {
	width: 20%;
	height: 0.95rem;
}

.tl-skel-row-title {
	width: 45%;
	height: 1rem;
}

.tl-skel-row-actions {
	width: 5.5rem;
	height: 2.1rem;
	margin-left: auto;
}

@keyframes tl-skel-shimmer {
	0% {
		background-position: 100% 0;
	}
	100% {
		background-position: 0 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tl-skel {
		animation: none;
	}

	body.track-library-page *,
	body.track-library-page *::before,
	body.track-library-page *::after {
		transition: none !important;
		animation: none !important;
	}
}

.tl-error {
	color: var(--tl-danger);
	background: color-mix(in srgb, var(--tl-danger) 12%, transparent);
	border: 1px solid var(--tl-danger-line);
	border-radius: var(--tl-radius);
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
}

.tl-notice {
	color: var(--tl-text);
	background: var(--bn-tint);
	border: 1px solid var(--tl-border);
	border-radius: var(--tl-radius);
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
}

.tl-form {
	max-width: 560px;
	margin: 0 auto;
	background: var(--tl-surface);
	border: 1px solid var(--tl-border);
	border-radius: var(--tl-radius);
	padding: 1.5rem;
	box-shadow: var(--tl-shadow);
}

.tl-field {
	margin-bottom: 1.25rem;
}

.tl-field label {
	display: block;
	font-size: 0.85rem;
	font-weight: 600;
	margin-bottom: 0.4rem;
	color: var(--tl-muted);
}

.tl-field input[type='text'] {
	width: 100%;
	padding: 0.65rem 0.85rem;
	border-radius: 8px;
	border: 1px solid var(--tl-border);
	background: var(--tl-bg);
	color: var(--tl-text);
	font-size: 1rem;
}

.tl-label-editor {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	padding: 0.5rem;
	border-radius: 8px;
	border: 1px solid var(--tl-border);
	background: var(--tl-bg);
	min-height: 2.75rem;
	align-items: center;
}

.tl-label-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.25rem 0.5rem;
	border-radius: 6px;
	background: color-mix(in srgb, var(--tl-accent) 25%, transparent);
	border: 1px solid var(--tl-accent-dim);
	font-size: 0.85rem;
}

.tl-label-chip button {
	border: none;
	background: transparent;
	color: var(--tl-text);
	cursor: pointer;
	padding: 0;
	line-height: 1;
	font-size: 1rem;
	opacity: 0.7;
}

.tl-label-chip button:hover {
	opacity: 1;
}

.tl-label-input {
	flex: 1;
	min-width: 120px;
	border: none;
	background: transparent;
	color: var(--tl-text);
	font-size: 0.95rem;
	outline: none;
}

.tl-suggestions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-top: 0.5rem;
}

.tl-suggestion {
	font-size: 0.78rem;
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	border: 1px dashed var(--tl-border);
	color: var(--tl-muted);
	cursor: pointer;
}

.tl-suggestion:hover {
	border-color: var(--tl-accent);
	color: var(--tl-text);
}

.tl-form-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1.5rem;
}

.tl-hint {
	font-size: 0.8rem;
	color: var(--tl-muted);
	margin-top: 0.35rem;
}

.tl-badge {
	display: inline-flex;
	align-self: flex-start;
	font-size: 0.72rem;
	padding: 0.15rem 0.5rem;
	border-radius: 4px;
	background: color-mix(in srgb, var(--tl-accent) 18%, transparent);
	border: 1px solid var(--tl-accent-dim);
	color: var(--tl-accent);
	margin: -0.35rem 0 0;
}

.tl-row-badge {
	align-self: center;
	flex-shrink: 0;
	margin: 0;
}

.tl-roster-picks {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0.5rem 0 1rem;
}

.tl-version-list {
	list-style: none;
	margin: 0.5rem 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.tl-version-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.6rem 0.85rem;
	border: 1px solid var(--tl-border);
	border-radius: 8px;
	background: var(--tl-bg);
}

.tl-version-info {
	min-width: 0;
}

.tl-version-title {
	margin: 0;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tl-version-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-shrink: 0;
}

.tl-share-new {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid var(--tl-border);
}

.tl-share-new label {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--tl-muted);
}

.tl-share-new input[type='text'] {
	padding: 0.65rem 0.85rem;
	border-radius: 8px;
	border: 1px solid var(--tl-border);
	background: var(--tl-bg);
	color: var(--tl-text);
	font-size: 0.95rem;
}

.tl-modal-backdrop {
	position: fixed;
	inset: 0;
	background: var(--bn-backdrop);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	z-index: 100;
}

.tl-modal {
	width: 100%;
	max-width: 480px;
	max-height: 85vh;
	overflow-y: auto;
	background: var(--tl-surface);
	border: 1px solid var(--tl-border);
	border-radius: var(--tl-radius);
	padding: 1.5rem;
	box-shadow: var(--tl-shadow);
}

.tl-modal h2 {
	margin: 0 0 0.75rem;
	font: 700 1.6rem/1.1 var(--bn-display);
	letter-spacing: 0.02em;
}

.tl-modal-confirm {
	max-width: 380px;
}

.tl-modal-confirm .tl-form-actions {
	margin-top: 1.25rem;
	justify-content: flex-end;
}

@media (max-width: 600px) {
	.tl-shell {
		padding: 1rem max(1rem, env(safe-area-inset-right, 0px)) calc(1rem + env(safe-area-inset-bottom, 0px))
			max(1rem, env(safe-area-inset-left, 0px));
	}
}

/* People: your ID card, adding a contact, the contact list */
.tl-panel-card .tl-hint {
	margin: 0 0 0.6rem;
}

.tl-field {
	display: grid;
	gap: 0.3rem;
	margin-bottom: 0.7rem;
}

.tl-field label {
	font-size: 0.92rem;
	font-weight: 500;
	color: var(--tl-muted);
}

.tl-field p {
	margin: 0;
}

.tl-inline-form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.tl-inline-form input {
	flex: 1 1 200px;
}

.tl-mono {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	letter-spacing: 0.04em;
}

.tl-id-box {
	display: inline-block;
	max-width: 100%;
	padding: 0.6rem 0.9rem;
	border: 1.5px solid var(--bn-kick);
	border-radius: var(--tl-radius);
	background: var(--tl-bg);
	font: 600 1.5rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
	letter-spacing: 0.04em;
	overflow-wrap: anywhere;
}

.tl-found {
	margin: 0.3rem 0 0.6rem;
	color: var(--bn-kick);
	font-weight: 500;
}

.tl-people-search {
	width: 100%;
	margin-bottom: 0.6rem;
}

.tl-contacts,
.tl-pick-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tl-contact {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.8rem;
	padding: 0.7rem 0;
	border-top: 1px solid var(--tl-border);
}

.tl-contact:first-child {
	border-top: 0;
}

.tl-avatar {
	flex: none;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--bn-olive);
	color: var(--bn-olive-ink);
	font: 700 1.2rem var(--bn-display);
}

.tl-contact-main {
	display: flex;
	flex-direction: column;
	flex: 1 1 200px;
	min-width: 0;
}

.tl-contact-main b {
	font-weight: 600;
	overflow-wrap: anywhere;
}

.tl-contact-main .tl-hint {
	margin: 0;
}

.tl-contact-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.tl-pick-list {
	max-height: 50vh;
	margin: 0.6rem 0;
	overflow-y: auto;
}

.tl-pick-list label {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	padding: 0.45rem 0.2rem;
	border-top: 1px solid var(--tl-border);
	cursor: pointer;
}

.tl-pick-list li:first-child label {
	border-top: 0;
}

/* Backup & key */
.tl-status-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem 1rem;
	margin-bottom: 1rem;
	padding: 0.8rem 1rem;
	border: 1px solid var(--tl-warn);
	border-left-width: 4px;
	border-radius: var(--tl-radius);
	background: color-mix(in srgb, var(--tl-warn) 10%, var(--tl-surface));
}

.tl-status-bar.tl-status-ok {
	border-color: var(--bn-kick);
	background: color-mix(in srgb, var(--bn-kick) 8%, var(--tl-surface));
}

.tl-status-bar p {
	flex: 1 1 280px;
	margin: 0;
}

.tl-drop {
	padding: 1.2rem;
	border: 2px dashed var(--bn-control-line);
	border-radius: var(--tl-radius);
	color: var(--tl-muted);
	text-align: center;
}

.tl-drop-over {
	border-color: var(--tl-accent);
	background: color-mix(in srgb, var(--tl-accent) 8%, transparent);
}

.tl-danger-box {
	padding: 0.7rem 0.9rem;
	border: 1px solid var(--tl-danger);
	border-radius: var(--tl-radius);
	background: color-mix(in srgb, var(--tl-danger) 10%, transparent);
}

.tl-steps {
	margin: 0.8rem 0;
	padding-left: 1.3rem;
	color: var(--tl-muted);
}

.tl-steps li + li {
	margin-top: 0.25rem;
}

.tl-link-box {
	flex: 1 1 260px;
	min-width: 0;
	padding: 0.55rem 0.75rem;
	border: 1.5px solid var(--bn-control-line);
	border-radius: var(--tl-radius);
	background: var(--tl-bg);
	overflow-wrap: anywhere;
}

/* Play together: the chain, in order, with repeats */
.tl-chain-dialog {
	width: min(560px, 94vw);
}

.tl-chain-list {
	margin: 0.6rem 0;
	padding: 0;
	list-style: none;
	counter-reset: chain;
}

.tl-chain-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.8rem;
	padding: 0.55rem 0;
	border-top: 1px solid var(--tl-border);
	counter-increment: chain;
}

.tl-chain-row:first-child {
	border-top: 0;
}

.tl-chain-row::before {
	content: counter(chain);
	flex: none;
	width: 1.6rem;
	color: var(--tl-muted);
	font: 700 1.1rem var(--bn-display);
}

.tl-chain-main {
	display: flex;
	flex-direction: column;
	flex: 1 1 200px;
	min-width: 0;
}

.tl-chain-main .tl-hint {
	margin: 0;
	font-size: 0.85rem;
}

.tl-chain-controls {
	display: flex;
	align-items: center;
	gap: 0.3rem;
}

.tl-chain-controls select {
	min-height: 34px;
}

.tl-rule {
	margin: 1.1rem 0;
	border: 0;
	border-top: 1px solid var(--tl-border);
}

.tl-subheading {
	margin: 0 0 0.4rem;
	font: 700 1.15rem/1.1 var(--bn-display);
	letter-spacing: 0.02em;
}

/* This browser's private link was replaced on another device */
.tl-replaced {
	border-color: var(--tl-warn);
}

/* The Journal page (/journal/, Journal/vue/journal_page.js): what was played, when. One column:
   the cards across the top (this week, twelve weeks, the calendar), pick up where you left off,
   your tracks (cards from 641px, a plain list on a phone), then the sessions. */
.tl-journal-side {
	margin-bottom: 2rem;
}

.tl-journal-week {
	padding: 1.1rem 1.2rem;
}

.tl-journal-week .tl-section-h {
	margin-bottom: 0.7rem;
}

.tl-journal-week p {
	margin: 0;
}

/* The big numbers: this week's time, and one track's totals */
.tl-journal-num {
	display: block;
	font: 700 2.1rem/1 var(--bn-display);
	letter-spacing: 0.02em;
	white-space: nowrap;
}

.tl-journal-lbl {
	display: block;
	margin-top: 0.35rem;
	font-size: 0.9rem;
	color: var(--tl-muted);
}

/* Monday to Sunday: filled when practised, ringed today, faint when still to come */
.tl-journal-week-days {
	display: flex;
	gap: 0.35rem;
	margin: 1rem 0 0.2rem;
}

.tl-journal-week-day {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.75rem;
	height: 1.75rem;
	border: 1px solid var(--tl-border);
	border-radius: 50%;
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--tl-muted);
}

.tl-journal-week-day-on {
	background: var(--tl-accent-fill);
	border-color: var(--tl-accent-fill);
	color: var(--bn-brass-ink);
}

.tl-journal-week-day-today {
	outline: 2px solid var(--tl-accent);
	outline-offset: 2px;
}

.tl-journal-week-day-later {
	opacity: 0.45;
}

/* Your tracks: "All practice", then each track; the one being shown is marked */
.tl-journal-tracks .tl-section-h {
	margin: 0 0 0.4rem 0.75rem;
}

.tl-journal-tracks ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tl-journal-tracks li {
	display: flex;
	align-items: center;
	gap: 0.3rem;
}

.tl-journal-track-link {
	display: flex;
	flex: 1;
	flex-direction: column;
	justify-content: center;
	gap: 0.1rem;
	min-width: 0;
	min-height: 44px;
	padding: 0.4rem 0.75rem;
	border-radius: var(--tl-radius);
	color: var(--tl-text);
	text-decoration: none;
}

.tl-journal-track-link:hover {
	background: var(--bn-tint);
}

.tl-journal-track-link[aria-current] {
	background: var(--tl-surface);
	box-shadow: inset 3px 0 0 var(--tl-accent);
}

.tl-journal-track-name {
	overflow: hidden;
	font-weight: 600;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.tl-journal-track-meta {
	overflow: hidden;
	font-size: 0.82rem;
	color: var(--tl-muted);
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* Practise: straight to the track in the Studio */
.tl-journal-track-play {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	color: var(--tl-muted);
}

.tl-journal-track-play svg {
	box-sizing: content-box;
	width: 12px;
	height: 12px;
	padding: 9px;
	border: 1px solid var(--tl-border);
	border-radius: 50%;
	fill: currentColor;
}

.tl-journal-track-play:hover {
	color: var(--tl-accent);
}

.tl-journal-track-play:hover svg {
	border-color: var(--tl-accent);
}

.tl-journal-more {
	margin: 0.4rem 0 0 0.3rem;
}

.tl-journal-section {
	margin-bottom: 1.6rem;
}

.tl-journal-heading {
	margin: 0 0 0.6rem;
	font: 700 1.4rem/1.1 var(--bn-display);
	letter-spacing: 0.03em;
}

/* One track (?track=) */
.tl-journal-back {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	margin-bottom: 0.3rem;
	color: var(--tl-muted);
	text-decoration: none;
}

.tl-journal-back:hover {
	color: var(--tl-text);
}

/* On a phone, one track's practice replaces the week and the track list ("All practice" goes back). */
.tl-journal-on-track .tl-journal-side {
	display: none;
}

.tl-journal-track-card {
	padding: 1.2rem 1.3rem;
	margin-bottom: 1.6rem;
}

.tl-journal-track-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.8rem 1rem;
}

.tl-journal-track-head h2,
.tl-journal-track-head .tl-hint {
	margin: 0;
}

.tl-journal-track-head .tl-hint {
	margin-top: 0.3rem;
	font-size: 0.9rem;
}

.tl-journal-stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem 1.5rem;
	margin-top: 1.2rem;
}

.tl-journal-stat {
	min-width: 0;
}

.tl-journal-stats .tl-journal-num {
	font-size: 1.7rem;
}

.tl-journal-chart {
	margin-top: 1.4rem;
	padding-top: 1.1rem;
	border-top: 1px solid var(--bn-tint);
}

/* The fastest and slowest tempo, at the top and bottom of the line */
.tl-journal-chart-plot {
	display: flex;
	gap: 0.6rem;
}

.tl-journal-chart-axis {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 0.1rem 0;
	font-size: 0.78rem;
	font-variant-numeric: tabular-nums;
	text-align: right;
	color: var(--tl-muted);
}

@media (min-width: 900px) {
	/* The track cards stay above one track's practice on a wide screen. */
	.tl-journal-on-track .tl-journal-side {
		display: block;
	}

	/* The track list is beside it: no need for a way back. */
	.tl-journal-back {
		display: none;
	}

	.tl-journal-heading {
		margin-top: 0.2rem;
	}
}

/* A library track row's "Practised 2 days ago": a link to that track here, above the row's
   stretched title link */
.tl-row-practised {
	position: relative;
	z-index: 1;
	color: inherit;
}

.tl-row-practised:hover {
	color: var(--tl-accent);
}

.tl-journal-logging {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	color: var(--tl-muted);
	cursor: pointer;
}

.tl-journal-logging input {
	accent-color: var(--tl-accent-fill);
}

/* A week of sessions: its name and totals over a line, then its days */
.tl-journal-weekly + .tl-journal-weekly {
	margin-top: 2rem;
}

.tl-journal-week-h {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.2rem 1rem;
	margin-bottom: 0;
}

.tl-journal-week-total {
	font: 400 0.9rem/1.2 var(--bn-body);
	letter-spacing: 0;
	font-variant-numeric: tabular-nums;
	color: var(--tl-muted);
}

.tl-journal-day {
	padding: 0.9rem 0 0;
}

.tl-journal-day .tl-section-h {
	margin-bottom: 0.1rem;
	color: var(--tl-text);
}

.tl-journal-total {
	color: var(--tl-muted);
	font-weight: 400;
}

.tl-journal-total::before {
	content: "· ";
}

/* A day's rows share a card, with a faint line between them */
.tl-journal-day-sessions.tl-panel-card {
	margin: 0;
	padding: 0;
}

.tl-journal-day .tl-journal-row {
	gap: 1rem;
	padding: 0.85rem 1rem;
}

.tl-journal-day .tl-journal-row:first-child {
	border-top: 0;
}

.tl-journal-row {
	align-items: flex-start;
}

/* The title alone is the link: the note (and its form) below it must stay clickable. */
.tl-journal-row .tl-row-title-text::after {
	content: none;
}

.tl-journal-row .tl-row-title {
	flex-wrap: wrap;
	gap: 0.1rem 0.5rem;
}

.tl-journal-row .tl-row-meta,
.tl-journal-total {
	font-variant-numeric: tabular-nums;
}

/* "4/4 · 16th notes · 2 bars", beside the name of a groove that isn't a library track */
.tl-journal-kind {
	font-size: 0.85rem;
	font-weight: 400;
	white-space: nowrap;
	color: var(--tl-muted);
}

/* "3 sessions": opens a row to show each one */
.tl-journal-plays-toggle {
	padding: 0.2rem 0;
	border: 0;
	background: none;
	font: inherit;
	white-space: nowrap;
	color: var(--tl-text);
	cursor: pointer;
}

.tl-journal-plays-toggle::after {
	content: "";
	display: inline-block;
	width: 0.38em;
	height: 0.38em;
	margin-left: 0.45em;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-0.15em) rotate(-45deg);
}

.tl-journal-plays-toggle[aria-expanded="true"]::after {
	transform: translateY(-0.25em) rotate(45deg);
}

.tl-journal-plays-toggle:hover {
	color: var(--tl-accent);
}

/* A row's sessions: the one (its facts, note and controls), or each of several under the totals */
.tl-journal-plays {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tl-journal-play {
	display: flex;
	align-items: flex-start;
	gap: 0.8rem;
}

.tl-journal-play-main {
	flex: 1;
	min-width: 0;
}

.tl-journal-row-many .tl-journal-plays {
	margin: 0.35rem 0 0.2rem;
	padding-left: 0.8rem;
	border-left: 2px solid var(--bn-tint);
}

.tl-journal-row-many .tl-journal-play {
	align-items: center;
	min-height: 2.1rem;
}

.tl-journal-play-time {
	flex: none;
	min-width: 2.8rem;
	font-size: 0.85rem;
	font-variant-numeric: tabular-nums;
	color: var(--tl-muted);
}

.tl-journal-time {
	flex: 0 0 auto;
	min-width: 3.2rem;
	white-space: nowrap;
	padding-top: 0.1rem;
	font-variant-numeric: tabular-nums;
	color: var(--tl-muted);
}

.tl-journal-note {
	margin: 0.3rem 0 0;
	padding-left: 0.6rem;
	border-left: 2px solid var(--tl-accent-dim);
	white-space: pre-wrap;
}

.tl-journal-note-form textarea {
	width: 100%;
	margin-top: 0.4rem;
	padding: 0.45rem 0.55rem;
	border: 1px solid var(--tl-border);
	border-radius: var(--tl-radius);
	background: var(--tl-surface-2);
	color: var(--tl-text);
	resize: vertical;
}

.tl-journal-actions {
	align-items: center;
}

.tl-journal-stars {
	display: inline-flex;
}

.tl-journal-star {
	padding: 0 0.1rem;
	border: 0;
	background: none;
	font-size: 1.05rem;
	line-height: 1;
	color: var(--tl-border);
	cursor: pointer;
}

.tl-journal-star-on {
	color: var(--tl-accent);
}

.tl-journal-chart svg {
	display: block;
	flex: 1;
	min-width: 0;
	height: auto;
	color: var(--tl-accent);
}

.tl-journal-chart circle {
	fill: currentColor;
}

@media (min-width: 900px) {
	/* A row with one session: its controls at the row's top right, beside the title. */
	.tl-journal-row:not(.tl-journal-row-many) .tl-journal-actions {
		position: absolute;
		top: 0;
		right: 0;
	}
}

/* With a mouse, a row's controls wait until it's pointed at (or tabbed into): the stars given
   stay, the empty ones and the buttons appear. Touch screens keep them all in view. */
@media (hover: hover) and (min-width: 900px) {
	.tl-journal-quiet,
	.tl-journal-star:not(.tl-journal-star-on) {
		opacity: 0;
		transition: opacity 0.12s;
	}

	.tl-journal-play:hover .tl-journal-quiet,
	.tl-journal-play:focus-within .tl-journal-quiet,
	.tl-journal-play:hover .tl-journal-star,
	.tl-journal-play:focus-within .tl-journal-star {
		opacity: 1;
	}

	.tl-journal-row:hover {
		background: var(--bn-tint);
		border-radius: var(--tl-radius);
	}

	/* The stars sit at the row's end, where the eye finds a rating; the buttons appear before them. */
	.tl-journal-stars {
		order: 1;
		margin-left: 0.3rem;
	}
}

/* Across the top: this week, the last twelve weeks, the calendar. One column on a phone,
   week | weeks with the calendar underneath from 640px, three across from 1000px. */
.tl-journal-hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1rem;
	margin-bottom: 2rem;
}

.tl-journal-hero.tl-journal-on-track {
	display: none;
}

.tl-journal-hero .tl-panel-card {
	margin: 0;
	padding: 1.1rem 1.2rem;
}

.tl-journal-hero .tl-section-h {
	margin-bottom: 0.7rem;
}

.tl-journal-hero p {
	margin: 0;
}

.tl-journal-streak {
	margin-top: 0.9rem !important;
	padding-top: 0.8rem;
	border-top: 1px solid var(--bn-tint);
	font-size: 0.9rem;
	color: var(--tl-muted);
}

.tl-journal-streak-n {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.6rem;
	height: 1.6rem;
	margin-right: 0.35rem;
	padding: 0 0.4rem;
	border-radius: 999px;
	background: var(--tl-accent-fill);
	font-weight: 700;
	color: var(--bn-brass-ink);
}

/* What a bar or a calendar day stands for, when pointed at */
.tl-journal [data-tip] {
	position: relative;
}

.tl-journal [data-tip]:hover::after {
	content: attr(data-tip);
	position: absolute;
	z-index: 5;
	bottom: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%);
	padding: 0.3rem 0.55rem;
	border-radius: 6px;
	background: var(--tl-text);
	font: 500 0.78rem/1.2 var(--bn-body);
	white-space: nowrap;
	color: var(--bn-stage);
	pointer-events: none;
}

/* A bar a week, this week's in the accent */
.tl-journal-bars {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	height: 112px;
	border-bottom: 1px solid var(--tl-border);
}

.tl-journal-bar-col {
	display: flex;
	flex: 1;
	align-items: flex-end;
	justify-content: center;
	height: 100%;
}

.tl-journal-bar {
	width: 100%;
	max-width: 26px;
	border-radius: 4px 4px 0 0;
	background: var(--tl-muted);
	opacity: 0.45;
}

.tl-journal-bar-col:hover .tl-journal-bar {
	opacity: 0.8;
}

.tl-journal-bar-now .tl-journal-bar {
	background: var(--tl-accent-fill);
	opacity: 1;
}

.tl-journal-bar-axis {
	display: flex;
	gap: 6px;
	margin-top: 0.35rem;
	font-size: 0.72rem;
	color: var(--tl-muted);
}

.tl-journal-bar-axis span {
	flex: 1;
	text-align: center;
	white-space: nowrap;
}

.tl-journal-all {
	margin-top: 0.8rem !important;
	font-variant-numeric: tabular-nums;
}

.tl-journal-all b {
	color: var(--tl-text);
}

/* Twelve weeks of days, Monday at the top: darker for a longer day, today ringed */
.tl-journal-cal {
	display: flex;
	gap: 4px;
	max-width: 22rem;
}

.tl-journal-cal-days,
.tl-journal-cal-week {
	display: grid;
	flex: 1;
	grid-template-rows: repeat(7, 1fr);
	gap: 4px;
}

.tl-journal-cal-days {
	flex: 0 0 1rem;
	align-items: center;
	font-size: 0.68rem;
	color: var(--tl-muted);
}

.tl-journal-cell {
	display: block;
	aspect-ratio: 1;
	border-radius: 4px;
	background: var(--bn-tint);
	box-shadow: inset 0 0 0 1px var(--tl-border);
}

.tl-journal-cell-1,
.tl-journal-cell-2,
.tl-journal-cell-3,
.tl-journal-cell-4 {
	background: color-mix(in srgb, var(--tl-accent-fill) var(--tl-cell-mix), transparent);
	box-shadow: none;
}

.tl-journal-cell-1 { --tl-cell-mix: 30%; }
.tl-journal-cell-2 { --tl-cell-mix: 55%; }
.tl-journal-cell-3 { --tl-cell-mix: 78%; }
.tl-journal-cell-4 { --tl-cell-mix: 100%; }

.tl-journal-cell-today {
	outline: 2px solid var(--tl-text);
	outline-offset: 1px;
}

.tl-journal-cell-later {
	visibility: hidden;
}

.tl-journal-cal-key {
	display: flex;
	align-items: center;
	gap: 4px;
	max-width: 22rem;
	margin-top: 0.6rem !important;
	justify-content: flex-end;
	font-size: 0.72rem;
	color: var(--tl-muted);
}

.tl-journal-cal-key .tl-journal-cell {
	width: 11px;
}

/* Beside one track's practice on a wide screen, as the track list is. */
@media (min-width: 900px) {
	.tl-journal-hero.tl-journal-on-track {
		display: grid;
	}
}

@media (min-width: 640px) {
	.tl-journal-hero {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
	}

	.tl-journal-cal-card {
		grid-column: 1 / -1;
	}
}

@media (min-width: 1000px) {
	.tl-journal-hero {
		grid-template-columns: 300px minmax(0, 1fr) 300px;
	}

	.tl-journal-cal-card {
		grid-column: auto;
	}
}

/* A track's fastest tempo, session by session */
.tl-journal-spark {
	flex: none;
	width: 44px;
	height: 20px;
}

.tl-journal-spark polyline {
	fill: none;
	stroke: var(--tl-muted);
	stroke-width: 1.5;
	stroke-linejoin: round;
	stroke-linecap: round;
}

.tl-journal-tracks-none .tl-hint {
	margin: 0;
	font-size: 0.9rem;
}

/* Your tracks as cards, from 641px: the first bar, the name, the totals, a line of the tempo.
   (A phone keeps the plain list above.) */
.tl-journal-tracks .tl-journal-heading {
	margin-left: 0;
}

/* "Toto · Half-time shuffle": whose it is and which part, under a track's name */
.tl-journal-track-hint {
	overflow: hidden;
	font-size: 0.85rem;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* A library track offered beside the practised ones */
.tl-journal-track-new .tl-journal-track-meta {
	font-style: italic;
}

.tl-journal-track-all .tl-journal-track-meta {
	display: none;
}

@media (min-width: 641px) {
	.tl-journal-tracks ul {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
		gap: 0.8rem;
	}

	.tl-journal-tracks li {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-rows: 1fr auto;
		align-items: center;
		gap: 0;
		border: 1px solid var(--tl-border);
		border-radius: var(--tl-radius);
		background: var(--tl-surface);
	}

	.tl-journal-track-link {
		grid-column: 1 / -1;
		justify-content: flex-start;
		gap: 0.25rem;
		padding: 0.75rem 0.85rem 0.3rem;
	}

	.tl-journal-track-all .tl-journal-track-link {
		grid-row: 1 / -1;
		padding-bottom: 0.75rem;
	}

	.tl-journal-track-link:hover {
		background: none;
	}

	.tl-journal-tracks li:hover {
		border-color: var(--tl-accent-dim);
	}

	/* "All practice" and four tracks: one line */
	@media (min-width: 1000px) {
		.tl-journal-tracks ul {
			grid-template-columns: repeat(5, minmax(0, 1fr));
		}
	}

	.tl-journal-track-link[aria-current] {
		background: none;
		box-shadow: none;
	}

	.tl-journal-tracks li:has([aria-current]) {
		border-color: var(--tl-accent);
		box-shadow: inset 0 0 0 1px var(--tl-accent);
	}

	.tl-journal-track-link .tl-journal-thumb {
		width: 100%;
		margin-bottom: 0.35rem;
	}

	.tl-journal-track-meta {
		white-space: normal;
	}

	.tl-journal-track-all .tl-journal-track-link {
		justify-content: center;
	}

	.tl-journal-track-all .tl-journal-track-meta {
		display: block;
	}

	/* Under the name and totals: the tempo line on the left, Practise on the right */
	.tl-journal-spark {
		grid-column: 1;
		width: 64px;
		margin-left: 0.85rem;
	}

	.tl-journal-track-play {
		grid-column: 2;
		margin: 0 0.2rem 0.2rem 0;
	}
}

/* The first bar of a groove's notation, on paper */
.tl-journal-thumb {
	display: block;
	width: 150px;
	aspect-ratio: 150 / 52;
	border-radius: 6px;
	background: #fff;
	object-fit: cover;
	object-position: left top;
}

.tl-journal-thumb-link {
	flex: none;
}

.tl-journal-thumb-lg {
	width: 250px;
}

/* Pick up where you left off: the last groove played */
.tl-journal-resume {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem 1.3rem;
	margin: 0 0 2rem;
	padding: 1rem 1.2rem;
}

.tl-journal-resume-main {
	flex: 1;
	min-width: 12rem;
}

.tl-journal-resume h2 {
	margin: 0.15rem 0 0;
	font: 700 1.5rem/1.1 var(--bn-display);
	letter-spacing: 0.02em;
}

.tl-journal-resume p {
	margin: 0;
}

.tl-journal-eyebrow {
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--tl-muted);
}

/* A row's figures: Time, Tempo, Times through, each under its name */
.tl-journal-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.8rem;
	margin: 0.4rem 0 0;
	font-variant-numeric: tabular-nums;
}

.tl-journal-facts dt {
	font-size: 0.75rem;
	color: var(--tl-muted);
}

.tl-journal-facts dd {
	margin: 0.05rem 0 0;
	font-size: 1.05rem;
	font-weight: 600;
	white-space: nowrap;
}

.tl-journal-facts small {
	font-size: 0.75rem;
	font-weight: 400;
	color: var(--tl-muted);
}

.tl-journal-facts .tl-journal-plays-toggle {
	padding: 0;
	font-weight: 600;
}

.tl-journal-settings {
	margin-top: 2rem;
	padding-top: 1rem;
	border-top: 1px solid var(--tl-border);
}

.tl-journal-settings-body {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.8rem 1rem;
}

.tl-journal-settings-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

@media (max-width: 640px) {
	/* One track's three numbers: smaller, so they stay side by side. */
	.tl-journal-stats {
		gap: 0.8rem;
	}

	.tl-journal-stats .tl-journal-num {
		font-size: 1.35rem;
	}

	.tl-journal-row {
		flex-wrap: wrap;
	}

	/* The time stays beside the title; the stars and buttons go underneath. */
	.tl-journal-row .tl-row-main {
		flex: 1 1 0;
		min-width: 0;
	}

	/* The notation goes under the row's text, in line with it. */
	.tl-journal-thumb-link {
		order: 3;
		flex: 0 0 100%;
		padding-left: 4.2rem;
	}

	.tl-journal-thumb-lg {
		width: 100%;
		max-width: 320px;
	}

	.tl-journal-resume .tl-btn {
		width: 100%;
		justify-content: center;
		text-align: center;
	}

	.tl-journal-play,
	.tl-journal-row-many .tl-journal-play {
		flex-wrap: wrap;
		align-items: flex-start;
		gap: 0.2rem 0.8rem;
	}

	.tl-journal-actions {
		width: 100%;
		justify-content: flex-end;
	}
}

/* A plain text link inside a card (the People tab's "Change your name"). */
.tl-link { color: var(--bn-brass); }
.tl-link:hover { color: var(--bn-brass-hover); }

/* People tab, signed in (Library/vue/people_signed_in.js): what happened after inviting. */
.tl-link-btn { background: none; border: 0; padding: 0; color: var(--bn-brass); font: inherit; text-decoration: underline; cursor: pointer; }
.tl-link-btn:disabled { color: var(--bn-muted); cursor: default; }
.tl-invite-done { margin: .75rem 0 0; }
.tl-inline-form .tl-class-size { width: 6rem; flex: none; }
.tl-invite-done p { margin: 0 0 .5rem; }
.tl-invite-link { display: flex; align-items: center; gap: .5rem; max-width: 100%; }
.tl-invite-link .tl-mono { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: .45rem .6rem; border: 1px solid var(--bn-line); border-radius: var(--bn-radius); background: var(--bn-surface-2); font-size: .85rem; }
/* Room above the parts of a card (Add students, Class link, Waiting to be accepted). */
.tl-people-signed-in .tl-subheading { margin-top: 1.5rem; }
.tl-people-signed-in .tl-panel-card > .tl-field { margin-top: 1rem; }


/* Sharing live (Library/vue/share_dialog.js, shared_with_me.js). */
.tl-share-dialog { max-width: 32rem; }
.tl-share-dialog .tl-subheading { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--bn-line); }
.tl-share-people { list-style: none; margin: .5rem 0 1rem; padding: 0; max-height: 16rem; overflow-y: auto; }
.tl-share-pick { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; cursor: pointer; }
.tl-share-all { padding: .5rem 0; border-bottom: 1px solid var(--bn-line); }
.tl-shared-live .tl-panel-card { margin-top: .75rem; }
.tl-shared-live .tl-subheading { display: flex; align-items: center; gap: .5rem; }
