/* V-dala låtarkiv. Ändra färger via variablerna nedan. */
.vdl-arkiv, .vdl-single, .vdl-player, .vdl-form, .vdl-switch {
	--vdl-accent: #8a2b1d;
	--vdl-accent-soft: #f6e9e6;
	--vdl-line: #ddd6cf;
	--vdl-muted: #6b625c;
	--vdl-bg: #fff;
	--vdl-zebra: #faf7f4;
	--vdl-text: #222;
}
/* Egna färger på knappar/fält så att temats knappstil (t.ex. vit text) inte slår igenom. */
.vdl-arkiv button, .vdl-arkiv select, .vdl-arkiv input, .vdl-arkiv summary { color: var(--vdl-text); font-family: inherit; }
.vdl-reset, .vdl-filter-toggle, .vdl-colpick summary { background: var(--vdl-bg) !important; color: var(--vdl-text) !important; border: 1px solid var(--vdl-line) !important; box-shadow: none !important; text-shadow: none !important; }
.vdl-reset:hover, .vdl-filter-toggle:hover, .vdl-colpick summary:hover { background: var(--vdl-zebra) !important; }
.vdl-play, .vdl-file { background: var(--vdl-bg) !important; color: var(--vdl-accent) !important; }
.vdl-play.is-playing { background: var(--vdl-accent) !important; color: #fff !important; }
.vdl-play:hover, .vdl-file:hover { background: var(--vdl-accent-soft) !important; }
.vdl-table thead th button { color: var(--vdl-text) !important; background: none !important; }
.vdl-arkiv { max-width: 100%; }

.vdl-tools { display: grid; gap: .6rem; margin: 0 0 1rem; }
.vdl-search { width: 100%; padding: .6rem .8rem; font-size: 1rem; border: 1px solid var(--vdl-line); border-radius: 6px; box-sizing: border-box; }
.vdl-filters { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.vdl-filters select, .vdl-reset { padding: .35rem .5rem; border: 1px solid var(--vdl-line); border-radius: 6px; background: var(--vdl-bg); font-size: .9rem; max-width: 14rem; }
.vdl-reset { cursor: pointer; }
.vdl-filter-toggle { display: none; }
.vdl-only-audio { font-size: .9rem; white-space: nowrap; }
.vdl-count { margin: 0; color: var(--vdl-muted); font-size: .85rem; }

.vdl-table-wrap { overflow-x: auto; }
.vdl-table { width: 100%; border-collapse: collapse; font-size: .92rem; table-layout: auto; margin: 0; }
.vdl-table th, .vdl-table td { text-align: left; vertical-align: top; padding: .5rem .55rem; border: 0; border-bottom: 1px solid var(--vdl-line); }
.vdl-table tbody tr:nth-child(even) { background: var(--vdl-zebra); }
.vdl-table tbody th { font-weight: 600; min-width: 11rem; }
.vdl-table tbody th a { text-decoration: none; }
.vdl-table tbody th a:hover { text-decoration: underline; }
.vdl-table thead th { position: sticky; top: 0; background: var(--vdl-bg); z-index: 1; white-space: nowrap; border-bottom: 2px solid var(--vdl-accent); padding: 0; }
.vdl-table thead th.vdl-col-files { padding: .5rem .55rem; font-weight: 600; }
.vdl-table thead th button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: .5rem 1.4rem .5rem .55rem; cursor: pointer; font-weight: 600; position: relative; }
.vdl-table thead th button:focus-visible { outline: 2px solid var(--vdl-accent); outline-offset: -2px; }
.vdl-table thead th button::after { content: "↕"; position: absolute; right: .4rem; opacity: .3; font-weight: 400; }
.vdl-table thead th[aria-sort="ascending"] button::after { content: "▲"; opacity: 1; color: var(--vdl-accent); }
.vdl-table thead th[aria-sort="descending"] button::after { content: "▼"; opacity: 1; color: var(--vdl-accent); }
.vdl-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.vdl-table td.vdl-files { min-width: 12rem; }

/* Knappar för filer */
.vdl-files { display: flex; flex-wrap: wrap; gap: .3rem; }
.vdl-table td.vdl-files { display: table-cell; }
.vdl-table td.vdl-files > * { margin: 0 .3rem .3rem 0; }
.vdl-play, .vdl-file {
	display: inline-flex; align-items: center; gap: .3rem;
	padding: .2rem .55rem; border-radius: 999px; font-size: .8rem; line-height: 1.5;
	border: 1px solid var(--vdl-accent); background: var(--vdl-bg); color: var(--vdl-accent);
	cursor: pointer; text-decoration: none; white-space: nowrap; font-family: inherit;
}
.vdl-play:hover, .vdl-file:hover { background: var(--vdl-accent-soft); }
.vdl-play.is-playing { background: var(--vdl-accent); color: #fff; }
.vdl-files-long { margin: 1rem 0 1.5rem; }
.vdl-files-long h2 { flex-basis: 100%; font-size: 1.1rem; margin: 0 0 .3rem; }
.vdl-files-long .vdl-play, .vdl-files-long .vdl-file { font-size: .95rem; padding: .35rem .8rem; }

/* Enskild låt */
.vdl-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .6rem 1.2rem; margin: 0 0 1rem; padding: .9rem 1rem; background: var(--vdl-zebra); border-radius: 8px; }
.vdl-meta div { margin: 0; }
.vdl-meta dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--vdl-muted); margin: 0; }
.vdl-meta dd { margin: 0; font-weight: 600; }
/* Tillbaka-länk */
.vdl-back { margin: 0 0 1rem; }
.vdl-back-bottom { margin-top: 2rem; }
.vdl-back a { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .9rem; border-radius: 999px; background: var(--vdl-accent-soft, #f6e9e6); color: var(--vdl-accent, #8a2b1d); font-weight: 600; text-decoration: none; }
.vdl-back a:hover { background: var(--vdl-accent, #8a2b1d); color: #fff; }

/* Ikoner i knapparna */
.vdl-play svg, .vdl-file svg { width: 1.05em; height: 1.05em; flex: none; fill: currentColor; }
.vdl-play .vdl-i-pause, .vdl-play.is-playing .vdl-i-play { display: none; }
.vdl-play.is-playing .vdl-i-pause { display: inline; }
.vdl-play small { opacity: .8; font-weight: 400; }
.vdl-play.is-broken { opacity: .5; text-decoration: line-through; }

/* Verktygsrad: antal, sortering (mobil), kolumnval */
.vdl-bar { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; }
.vdl-sort-mobile { display: none; font-size: .9rem; }
.vdl-sort-mobile select { margin-left: .3rem; padding: .3rem; border: 1px solid var(--vdl-line); border-radius: 6px; }
.vdl-colpick { position: relative; font-size: .9rem; }
.vdl-colpick summary { cursor: pointer; padding: .3rem .7rem; border: 1px solid var(--vdl-line); border-radius: 6px; list-style: none; user-select: none; }
.vdl-colpick summary::-webkit-details-marker { display: none; }
.vdl-colpick summary::after { content: " ▾"; }
.vdl-colpick[open] > div { position: absolute; right: 0; z-index: 5; margin-top: .3rem; background: var(--vdl-bg); border: 1px solid var(--vdl-line); border-radius: 8px; padding: .5rem .8rem; box-shadow: 0 6px 18px rgba(0,0,0,.12); display: grid; gap: .25rem; min-width: 11rem; }
.vdl-colpick label { white-space: nowrap; cursor: pointer; }

/* Tydligt att tabellen går att scrolla i sidled */
.vdl-scroll-hint { margin: 0 0 .3rem; font-size: .8rem; color: var(--vdl-muted); text-align: right; }
.vdl-table-outer { position: relative; }
.vdl-table-outer::before, .vdl-table-outer::after { content: ""; position: absolute; top: 0; bottom: 0; width: 28px; pointer-events: none; opacity: 0; transition: opacity .2s; z-index: 2; }
.vdl-table-outer::before { left: 0; background: linear-gradient(to right, rgba(0,0,0,.14), transparent); }
.vdl-table-outer::after { right: 0; background: linear-gradient(to left, rgba(0,0,0,.14), transparent); }
.vdl-table-outer.can-left::before, .vdl-table-outer.can-right::after { opacity: 1; }
.vdl-table-wrap { scrollbar-width: thin; }

/* Spelare */
.vdl-player {
	max-width: none !important; margin: 0 !important; box-sizing: border-box;
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999;
	background: var(--vdl-bg); border-top: 2px solid var(--vdl-accent);
	box-shadow: 0 -4px 16px rgba(0,0,0,.12);
	padding: .5rem 1rem calc(.5rem + env(safe-area-inset-bottom));
	display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(14rem, 2fr) auto; gap: .4rem 1rem; align-items: center;
	font-size: .9rem;
}
.vdl-player[hidden] { display: none; }
.vdl-player-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vdl-player audio { width: 100%; height: 40px; }
.vdl-player-tools { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.vdl-player-tools select { padding: .15rem; }
.vdl-close { background: none; border: 0; font-size: 1.2rem; cursor: pointer; padding: .2rem .4rem; color: inherit; }
body.vdl-player-open { padding-bottom: 6.5rem; }

@media (max-width: 760px) {
	.vdl-table thead { display: none; }
	.vdl-table, .vdl-table tbody, .vdl-table tr, .vdl-table th, .vdl-table td { display: block; width: auto; }
	.vdl-table tbody tr { border: 1px solid var(--vdl-line); border-radius: 8px; margin: 0 0 .7rem; padding: .4rem .2rem; background: var(--vdl-bg) !important; }
	.vdl-table tbody tr[hidden] { display: none; }
	.vdl-table tbody th, .vdl-table td { border: 0; padding: .15rem .6rem; min-width: 0; }
	.vdl-table tbody th { font-size: 1.05rem; padding-top: .3rem; }
	.vdl-table td:empty { display: none; }
	.vdl-table td::before { content: attr(data-label) ": "; color: var(--vdl-muted); font-size: .8rem; }
	.vdl-table td.vdl-files { display: block; padding-top: .4rem; padding-bottom: .4rem; }
	.vdl-table td.vdl-files::before { display: none; }
	.vdl-play, .vdl-file { font-size: .9rem; padding: .35rem .75rem; }
	.vdl-filters select { flex: 1 1 45%; max-width: none; }
	.vdl-sort-mobile { display: block; }
	.vdl-filter-toggle { display: block; padding: .5rem .8rem; border: 1px solid var(--vdl-line); border-radius: 6px; background: var(--vdl-bg); font-size: 1rem; text-align: left; cursor: pointer; }
	.vdl-arkiv:not(.filters-open) .vdl-filters { display: none; }
	.vdl-colpick[open] > div { right: auto; left: 0; }
	.vdl-player { grid-template-columns: 1fr; padding-left: .6rem; padding-right: .6rem; }
	.vdl-player-tools { justify-content: space-between; }
	body.vdl-player-open { padding-bottom: 10rem; }
}

/* Formulär */
.vdl-form { max-width: 36rem; }
.vdl-form .vdl-field { margin: 0 0 1rem; }
.vdl-form label.vdl-l { display: block; font-weight: 600; margin-bottom: .25rem; }
.vdl-form .vdl-help { display: block; font-size: .8rem; color: var(--vdl-muted); margin-top: .2rem; }
.vdl-form input[type=text], .vdl-form input[type=date], .vdl-form select, .vdl-form textarea {
	width: 100%; box-sizing: border-box; padding: .65rem .7rem; font-size: 16px; border: 1px solid var(--vdl-line); border-radius: 6px; background: var(--vdl-bg);
}
.vdl-form .vdl-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.vdl-form fieldset { border: 1px solid var(--vdl-line); border-radius: 8px; padding: .8rem 1rem; margin: 0 0 1rem; }
.vdl-form legend { font-weight: 600; padding: 0 .3rem; }
.vdl-form .vdl-radio { display: inline-flex; gap: .3rem; margin-right: 1rem; align-items: center; }
.vdl-pick { display: block; text-align: center; padding: 1rem; border: 2px dashed var(--vdl-accent); border-radius: 8px; color: var(--vdl-accent); font-weight: 600; cursor: pointer; }
.vdl-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.vdl-filelist { list-style: none; margin: .6rem 0 0; padding: 0; }
.vdl-filelist li { display: grid; grid-template-columns: 1fr auto auto; gap: .4rem; align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--vdl-line); }
.vdl-filelist .vdl-fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.vdl-filelist select { width: auto; padding: .35rem; font-size: 15px; }
.vdl-filelist button { background: none; border: 0; font-size: 1.1rem; cursor: pointer; }
.vdl-filelist .vdl-label-txt { grid-column: 1 / -1; padding: .45rem .6rem; font-size: 16px; border: 1px solid var(--vdl-line); border-radius: 6px; }
.vdl-submit { display: block; width: 100%; padding: .9rem; font-size: 1.1rem; font-weight: 600; background: var(--vdl-accent); color: #fff; border: 0; border-radius: 8px; cursor: pointer; }
.vdl-submit[disabled] { opacity: .6; }
.vdl-progress { height: 8px; background: var(--vdl-line); border-radius: 4px; overflow: hidden; margin: .6rem 0; }
.vdl-progress > div { height: 100%; width: 0; background: var(--vdl-accent); transition: width .2s; }
.vdl-msg { padding: .8rem 1rem; border-radius: 8px; margin: 0 0 1rem; }
.vdl-msg-ok { background: #e7f4e8; }
.vdl-msg-err { background: #fbe5e1; }
.vdl-more summary { cursor: pointer; font-weight: 600; margin-bottom: .8rem; }

/* Slinga (beta) */
/* Slinga (beta) */
.vdl-player { --vdl-tap: #e8772e; --vdl-tap-dark: #c85f1a; max-height: 85vh; overflow-y: auto; }
.vdl-player.vdl-looping .vdl-repeat { display: none; }
.vdl-loop-tools { grid-column: 1 / -1; display: flex; flex-direction: column; gap: .55rem; font-size: .95rem; padding-top: .45rem; border-top: 1px dashed var(--vdl-line); }
.vdl-loop-tools button { padding: .3rem .6rem; border: 1px solid var(--vdl-line) !important; border-radius: 8px; background: var(--vdl-bg) !important; color: var(--vdl-text) !important; cursor: pointer; font: inherit; line-height: 1.2; box-shadow: none !important; text-shadow: none !important; min-width: 0; }
.vdl-loop-tools button:hover { background: var(--vdl-zebra) !important; }
.vdl-loop-head { display: flex; align-items: center; gap: .5rem; }
.vdl-loop-tools .vdl-loop-toggle { border: 0 !important; padding: .2rem .1rem; font-weight: 600; background: none !important; }
.vdl-loop-caret { display: inline-block; transition: transform .15s; }
.vdl-loop-tools.is-collapsed .vdl-loop-caret { transform: rotate(-90deg); }
.vdl-loop-summary { font-weight: 400; color: var(--vdl-accent); font-variant-numeric: tabular-nums; margin-left: .3rem; }
.vdl-player button, .vdl-player summary { text-transform: none !important; letter-spacing: normal !important; }
.vdl-loop-tools .vdl-loop-help { margin-left: auto; text-transform: none !important; font-variant: normal !important; width: 1.9rem; height: 1.9rem; padding: 0; border-radius: 50% !important; font-family: Georgia, serif; font-style: italic; font-weight: 700; color: var(--vdl-accent) !important; border-color: var(--vdl-accent) !important; }
.vdl-loop-helptext { background: var(--vdl-zebra); border-radius: 8px; padding: .5rem .8rem; font-size: .9rem; line-height: 1.4; }
.vdl-loop-helptext ol { margin: 0; padding-left: 1.3rem; }
.vdl-loop-helptext li + li { margin-top: .3rem; }
.vdl-loop-tools.is-collapsed .vdl-loop-body { display: none; }
.vdl-loop-body { display: flex; flex-direction: column; gap: .6rem; }
.vdl-loop-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .5rem 1.2rem; }
.vdl-loop-pair { display: inline-flex; align-items: stretch; }
.vdl-loop-pair button { border-radius: 0 !important; margin-left: -1px; }
.vdl-loop-pair button:first-child { border-radius: 8px 0 0 8px !important; margin-left: 0; }
.vdl-loop-pair button:last-child { border-radius: 0 8px 8px 0 !important; }
.vdl-loop-tools .vdl-nudge { color: var(--vdl-muted) !important; font-size: 1.15rem; padding: .25rem .7rem; }
.vdl-loop-move { gap: .5rem; }
.vdl-loop-info { min-width: 10rem; text-align: center; font-variant-numeric: tabular-nums; color: var(--vdl-muted); }
.vdl-loop-tools.is-active .vdl-loop-info { color: var(--vdl-accent); font-weight: 600; }
.vdl-beta-badge { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; background: #fff3c4; color: #7a5b00; padding: .1rem .4rem; border-radius: 4px; }

/* Tidslinje med markerad slinga */
.vdl-loop-track { position: relative; height: 1.6rem; margin: .4rem 1rem 0; border-radius: 6px; background: var(--vdl-zebra); border: 1px solid var(--vdl-line); cursor: pointer; touch-action: none; }
.vdl-loop-range { position: absolute; top: 0; bottom: 0; background: var(--vdl-accent-soft); border-left: 2px solid var(--vdl-accent); border-right: 2px solid var(--vdl-accent); box-sizing: border-box; }
.vdl-loop-tools.is-active .vdl-loop-range { background: color-mix(in srgb, var(--vdl-accent) 22%, transparent); }
.vdl-loop-pos { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--vdl-text); pointer-events: none; }
.vdl-loop-flag { position: absolute; top: -.55rem; transform: translateX(-50%); min-width: 1.3rem; height: 1.1rem; line-height: 1.1rem; border-radius: 4px; background: var(--vdl-accent); color: #fff; font-size: .75rem; font-weight: 700; text-align: center; cursor: ew-resize; user-select: none; }
.vdl-loop-flag[hidden] { display: none; }

/* Takter */
.vdl-bars { border: 1px solid var(--vdl-line); border-radius: 8px; background: var(--vdl-bg); }
.vdl-bars > summary { cursor: pointer; padding: .5rem .8rem; font-weight: 600; list-style: none; }
.vdl-bars > summary::-webkit-details-marker { display: none; }
.vdl-bars > summary::before { content: "▸"; display: inline-block; margin-right: .45rem; color: var(--vdl-accent); transition: transform .15s; }
.vdl-bars[open] > summary::before { transform: rotate(90deg); }
.vdl-bars > summary:hover { background: var(--vdl-zebra); border-radius: 8px; }
.vdl-bars-summary { font-weight: 400; color: var(--vdl-muted); font-size: .85rem; }
.vdl-bars-inner { display: flex; align-items: center; gap: 1rem; padding: .2rem .8rem .7rem; }
.vdl-bars-fields { display: flex; flex-direction: column; gap: .45rem; }
.vdl-bars input, .vdl-bars select { padding: .3rem; font-size: 1rem; }
.vdl-bars input { width: 6rem; }
.vdl-loop-tools .vdl-tap { margin-left: auto; width: 6.5rem; height: 6.5rem; flex: none; border-radius: 14px !important; background: var(--vdl-tap) !important; border-color: var(--vdl-tap-dark) !important; color: #fff !important; font-weight: 700; font-size: 1.05rem; touch-action: manipulation; user-select: none; }
.vdl-loop-tools .vdl-tap:hover { background: var(--vdl-tap-dark) !important; }
.vdl-tap.is-hit { animation: vdl-hit .15s ease-out; }
@keyframes vdl-hit { from { transform: scale(.92); } to { transform: scale(1); } }

@media (max-width: 760px) {
	.vdl-loop-tools { font-size: 1rem; }
	.vdl-loop-tools button { padding: .55rem .8rem; }
	.vdl-loop-tools .vdl-nudge { padding: .55rem .95rem; font-size: 1.3rem; }
	.vdl-loop-tools .vdl-set-a, .vdl-loop-tools .vdl-set-b { min-width: 5.2rem; }
	.vdl-loop-ab { flex-direction: column; gap: .5rem; }
	.vdl-loop-track { height: 2.2rem; }
	.vdl-loop-flag { height: 1.4rem; line-height: 1.4rem; min-width: 1.7rem; top: -.75rem; font-size: .85rem; }
	.vdl-loop-tools .vdl-tap { width: 7.5rem; height: 7.5rem; font-size: 1.15rem; }
	.vdl-loop-info { min-width: 0; flex: 1 1 auto; }
}

/* Växla mellan gammal och ny låtsida, och beta-raden */
.vdl-switch { display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: center; justify-content: space-between; margin: 0 0 1rem; padding: .45rem .8rem; border: 1px solid var(--vdl-line); border-radius: 8px; background: var(--vdl-zebra); color: var(--vdl-muted); font-size: .85rem; }
.vdl-switch a { color: var(--vdl-accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
.vdl-switch a:hover { text-decoration: underline; }
.vdl-beta-notice { background: #fff3c4; border-color: #e8d48a; color: #7a5b00; }
