/* Muziekbibliotheek · Han van den Heuvel
   Licht thema in de huisstijl (antraciet + antiek goud), donker volgt het systeem. */

@font-face { font-family: "Jost"; src: url("fonts/jost-latin-wght-normal.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("fonts/playfair-display-latin-wght-normal.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("fonts/playfair-display-latin-wght-italic.woff2") format("woff2"); font-weight: 400 800; font-style: italic; font-display: swap; }

:root {
  --paper: #F7F5F0;      /* achtergrond */
  --surface: #FFFFFF;    /* kaarten */
  --ink: #26272B;        /* tekst, 13.7:1 op paper */
  --ink-2: #5E6068;      /* secundair, 5.8:1 */
  --line: #E3DED3;
  --line-strong: #CFC8B9;
  --gold: #9A7B3C;       /* alleen decoratie (notenbalk) */
  --gold-ink: #7A5F27;   /* goud voor tekst/knoppen, 5.5:1 */
  --on-gold: #FFFFFF;
  --gold-soft: #F1EADB;
  --danger: #A32A1F;
  --danger-soft: #FBEDEA;
  --ok: #2F6B3A;
  --ok-soft: #EAF3EA;
  --warn: #8A5A00;
  --warn-soft: #FBF1DD;
  --focus: #2F5FD0;
  --shadow: 0 1px 2px rgba(38, 39, 43, .06), 0 4px 14px rgba(38, 39, 43, .05);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Jost", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --tabbar-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #18191C;
    --surface: #222327;
    --ink: #F1EEE8;
    --ink-2: #ADAAA3;
    --line: #34353A;
    --line-strong: #47484E;
    --gold: #C9A55C;
    --gold-ink: #D4B26A;
    --on-gold: #18191C;
    --gold-soft: #2E2A22;
    --danger: #F08A7E;
    --danger-soft: #3A2220;
    --ok: #8FD19B;
    --ok-soft: #1F2E22;
    --warn: #E9C072;
    --warn-soft: #33291A;
    --focus: #8AB0FF;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

@media (prefers-contrast: more) {
  :root { --ink-2: var(--ink); --line: var(--line-strong); }
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font); /* 17px */
  -webkit-font-smoothing: antialiased;
}
body.has-tabs { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--gold-ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { display: block; }
code { font-family: var(--mono); font-size: .9em; background: var(--gold-soft); padding: .1em .35em; border-radius: 5px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--paper); padding: .6rem 1rem; border-radius: 8px; z-index: 50; }
.skip:focus { top: 1rem; }
.muted { color: var(--ink-2); }
.small, small { font-size: .875rem; }
.mono { font-family: var(--mono); letter-spacing: .08em; }
.ico { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left)); }
.main { padding-block: 1.75rem 2.5rem; }

h1 { font: 600 clamp(1.75rem, 4vw, 2.25rem)/1.15 var(--serif); letter-spacing: -.01em; }
.h3 { font: 600 1.125rem/1.3 var(--font); display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; }

/* ---------- Kop met notenbalk (het kenmerkende element) ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.brand { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; line-height: 1.1; padding-block: .75rem; }
.brand-kicker { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.brand-name { font: 600 1.35rem/1.2 var(--serif); }

/* Vijf dunne gouden lijnen: een notenbalk die de bibliotheek "draagt" */
.staff {
  height: 17px;
  background: repeating-linear-gradient(to bottom, var(--gold) 0 1px, transparent 1px 4px);
  opacity: .45;
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.topbar .staff { position: absolute; left: 0; right: 0; bottom: -9px; pointer-events: none; }
.staff-inline { margin: 1rem 0 1.25rem; }

.topnav { display: none; align-items: center; gap: .25rem; }
.topnav a, .linkbtn {
  color: var(--ink-2); text-decoration: none; font: 500 .975rem var(--font);
  padding: .55rem .8rem; border-radius: 999px; min-height: 40px; display: inline-flex; align-items: center;
}
.topnav a:hover, .linkbtn:hover { color: var(--ink); background: var(--gold-soft); }
.topnav a[aria-current="page"] { color: var(--ink); background: var(--gold-soft); }
.linkbtn { background: none; border: 0; cursor: pointer; }
.inline { display: inline; }

/* ---------- Tabbalk (mobiel) ---------- */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-top: 1px solid var(--line);
}
@media (prefers-reduced-transparency: reduce) { .tabbar { background: var(--surface); backdrop-filter: none; } }
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-2); text-decoration: none; font-size: .75rem; font-weight: 500; min-height: 44px;
}
.tabbar .ico { width: 26px; height: 26px; }
.tabbar a[aria-current="page"] { color: var(--gold-ink); }
.tabbar a[aria-current="page"] .ico { stroke-width: 2.1; }

@media (min-width: 760px) {
  .topnav { display: flex; }
  .tabbar { display: none; }
  body.has-tabs { padding-bottom: 0; }
}

/* ---------- Knoppen ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .55rem 1.05rem;
  font: 500 1rem/1.2 var(--font); color: var(--ink); text-decoration: none;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--ink-2); }
.btn-primary { background: var(--gold-ink); border-color: var(--gold-ink); color: var(--on-gold); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--gold-ink); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-small { min-height: 38px; padding: .4rem .8rem; font-size: .925rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Meldingen ---------- */
.flash { border-radius: var(--radius-sm); padding: .8rem 1rem; margin-bottom: 1.25rem; border: 1px solid; }
.flash-success { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: var(--ink); }
.flash-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--ink); }
.flash-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--ink); }
.flash .pw { font-size: 1.05rem; padding: .15em .5em; user-select: all; }

/* ---------- Paginakop ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head .muted { margin-top: .3rem; }
.back { margin-bottom: 1rem; }
.back a { display: inline-flex; align-items: center; gap: .2rem; text-decoration: none; font-weight: 500; min-height: 44px; }
.back .ico { width: 1.1em; height: 1.1em; }

/* ---------- Zoeken en filters ---------- */
.toolbar { display: flex; gap: .6rem; margin-bottom: .9rem; flex-wrap: wrap; }
.search {
  flex: 1 1 260px; display: flex; align-items: center; gap: .55rem;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 0 .5rem 0 1rem; min-height: 50px; box-shadow: var(--shadow);
}
.search:focus-within { border-color: var(--gold-ink); outline: 3px solid color-mix(in srgb, var(--gold-ink) 25%, transparent); }
.search .ico { color: var(--ink-2); }
.search input { flex: 1; border: 0; background: transparent; color: var(--ink); font: inherit; min-height: 48px; outline: none; min-width: 0; }
.search input::placeholder { color: var(--ink-2); opacity: 1; }
.search-compact { min-height: 44px; margin-bottom: 1rem; box-shadow: none; }
.search-compact input { min-height: 42px; }
.kbd-hint { display: none; font: 500 .8rem var(--mono); color: var(--ink-2); border: 1px solid var(--line-strong); border-radius: 6px; padding: .05rem .4rem; margin-right: .5rem; }
@media (hover: hover) and (min-width: 760px) { .kbd-hint { display: inline-block; } }

.select-wrap select {
  appearance: none; -webkit-appearance: none;
  min-height: 50px; padding: 0 2.4rem 0 1rem; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237A5F27' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right .8rem center / 18px;
  color: var(--ink); font: inherit; cursor: pointer;
}

.chips { display: flex; gap: .45rem; overflow-x: auto; padding: .15rem .1rem .6rem; margin-bottom: .6rem; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; min-height: 38px; padding: .3rem .95rem;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); text-decoration: none; font-size: .95rem; font-weight: 500;
}
.chip[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- Lijst met stukken ---------- */
.pieces { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.piece + .piece { border-top: 1px solid var(--line); }
.piece-link { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.15rem; color: inherit; text-decoration: none; min-height: 72px; }
.piece-link:hover { background: color-mix(in srgb, var(--gold-soft) 55%, transparent); }
.piece-main { flex: 1; min-width: 0; }
.piece-title { font: 600 1.2rem/1.3 var(--serif); }
.piece-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; color: var(--ink-2); font-size: .925rem; margin-top: .2rem; }
.piece-meta a { color: var(--ink-2); }
.piece-note { color: var(--ink-2); font-size: .925rem; margin-top: .35rem; font-style: italic; overflow-wrap: anywhere; }
.piece-counts { display: flex; gap: .9rem; color: var(--gold-ink); font-weight: 500; flex: none; }
.count { display: inline-flex; align-items: center; gap: .25rem; font-variant-numeric: tabular-nums; }
.count.is-zero { color: var(--line-strong); }

.tag { display: inline-flex; align-items: center; font: 500 .78rem/1 var(--font); padding: .3rem .55rem; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.tag-new { background: var(--gold-ink); border-color: var(--gold-ink); color: var(--on-gold); vertical-align: .2em; font-family: var(--font); }
.tag-gold { background: var(--gold-soft); color: var(--gold-ink); border-color: transparent; }
.tag-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

.empty { text-align: center; padding: 3rem 1.25rem; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty h1, .empty h2 { font: 600 1.4rem/1.3 var(--serif); margin-bottom: .5rem; }
.empty p { color: var(--ink-2); max-width: 46ch; margin: 0 auto .6rem; }
.empty .btn { margin-top: .6rem; }
.pieces + .empty { margin-top: 1rem; }

/* ---------- Detailpagina ---------- */
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.detail-title { font-size: clamp(2rem, 5vw, 2.75rem); }
.detail-composer { font: italic 400 1.25rem/1.4 var(--serif); color: var(--ink-2); margin-top: .3rem; }
.detail-head .piece-meta { margin-top: .7rem; }

.note { background: var(--gold-soft); border-left: 3px solid var(--gold-ink); border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin-bottom: 1.75rem; }
.note-label { font: 600 .78rem/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); margin-bottom: .5rem; }
.note p { overflow-wrap: anywhere; }

.block { margin-bottom: 2rem; }
.block-title { font: 600 1.15rem/1.3 var(--font); display: flex; align-items: center; gap: .5rem; margin-bottom: .8rem; }
.block-title .ico { color: var(--gold-ink); }
.filelist { display: grid; gap: .75rem; }
.file { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow); }
.file-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.file-label { font-weight: 600; font-size: 1.05rem; }
.file-info { color: var(--ink-2); font-size: .85rem; margin-top: .15rem; }
.file-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.file audio { width: 100%; margin-top: .7rem; height: 44px; }

/* ---------- Formulieren ---------- */
.stack { display: grid; gap: 1rem; align-content: start; }
.field { display: grid; gap: .35rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend { font-weight: 500; font-size: .95rem; padding: 0; }
.field small { color: var(--ink-2); }
.field input, .field textarea, .row-form input {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: .7rem .85rem; min-height: 48px;
}
.field textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.field input:focus, .field textarea:focus { outline: 3px solid color-mix(in srgb, var(--gold-ink) 28%, transparent); border-color: var(--gold-ink); }
.row-form { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.row-form .grow { flex: 1 1 220px; }
.grow { flex: 1; }
.form-actions { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.grid-2 { display: grid; gap: 1rem; }
.grid-2 .card { margin: 0; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.check { display: inline-flex; align-items: center; gap: .55rem; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--gold-ink); margin: 0; }
.check-danger span { color: var(--danger); font-size: .925rem; }
.checkgrid { display: flex; flex-wrap: wrap; gap: .1rem 1.4rem; }

.segmented { display: inline-flex; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; flex-wrap: wrap; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 1rem; border-radius: 999px; font-weight: 500; }
.segmented input:checked + span { background: var(--surface); box-shadow: var(--shadow); color: var(--gold-ink); }
.segmented input:focus-visible + span { outline: 3px solid var(--focus); }

.edit-files { display: grid; gap: .5rem; margin: 0 0 .9rem; padding: 0; list-style: none; }
.edit-files li { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.edit-files .field input { min-height: 44px; }
.edit-files li { background: var(--surface); border-radius: var(--radius-sm); transition: box-shadow .15s; }
.edit-files .handle {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; min-height: 44px;
  color: var(--ink-2); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.edit-files .handle .ico { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.edit-files .pos { font: 600 .9rem var(--font); color: var(--gold-ink); min-width: 1.2rem; text-align: center; font-variant-numeric: tabular-nums; }
.edit-files .move { display: inline-flex; gap: .25rem; }
.edit-files.is-sorting { cursor: grabbing; }
.edit-files li.is-dragging { box-shadow: 0 6px 20px rgba(38, 39, 43, .18); outline: 2px solid var(--gold-ink); position: relative; z-index: 2; }
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer;
}
.iconbtn:hover:not([disabled]) { border-color: var(--gold-ink); color: var(--gold-ink); }
.iconbtn[disabled] { opacity: .35; cursor: default; }
.hint { font-size: .9rem; margin: -.3rem 0 .6rem; }
.ico-inline { display: inline-block; vertical-align: -.2em; width: 1.1em; height: 1.1em; fill: currentColor; stroke: none; }
@media (max-width: 560px) {
  .edit-files li { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; column-gap: .4rem; }
  .edit-files li .field { grid-column: 3 / -1; }
  .edit-files li .file-info { grid-column: 1 / 3; }
  .edit-files li .move { grid-column: 3; }
  .edit-files li .check { grid-column: 4; }
  .edit-files li:not(:has(.handle)) { grid-template-columns: 1fr auto; }
  .edit-files li:not(:has(.handle)) .field { grid-column: 1 / -1; }
  .edit-files li:not(:has(.handle)) .file-info { grid-column: 1; }
  .edit-files li:not(:has(.handle)) .check { grid-column: 2; }
}

/* ---------- Inloggen met code, versie-melding, changelog ---------- */
.mt { margin-top: 1rem; }
.code-input { font-size: 1.5rem !important; text-align: center; letter-spacing: .3em; text-transform: uppercase; min-height: 60px !important; }
.code-input::placeholder { letter-spacing: .3em; opacity: .35; }
.who { margin-left: auto; color: var(--ink-2); font-size: .9rem; font-weight: 500; text-align: right; }
@media (min-width: 760px) { .who { margin-right: .5rem; } }
.flash-news { display: flex; align-items: center; gap: .55rem; background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold-ink) 30%, transparent); }
.flash-news .ico { color: var(--gold-ink); }
.flash-news a { font-weight: 600; }

.changelog { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.release { margin: 0; }
.release.is-current { border-color: color-mix(in srgb, var(--gold-ink) 45%, var(--line)); }
.release-head { margin-bottom: .9rem; }
.release-title { font: 600 1.3rem/1.3 var(--serif); }
.release-version { display: block; font: 600 .78rem/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); margin-bottom: .45rem; }
.release-items { display: grid; gap: .65rem; }
.release-items li { display: grid; grid-template-columns: 6.5rem 1fr; gap: .75rem; align-items: baseline; }
.kind { font: 600 .75rem/1 var(--font); padding: .32rem .55rem; border-radius: 999px; text-align: center; white-space: nowrap; }
.kind-new { background: var(--gold-ink); color: var(--on-gold); }
.kind-changed { background: var(--gold-soft); color: var(--gold-ink); }
.kind-removed { background: var(--paper); color: var(--ink-2); border: 1px solid var(--line-strong); }
.kind-fixed { background: var(--ok-soft); color: var(--ok); }
@media (max-width: 480px) { .release-items li { grid-template-columns: 1fr; gap: .3rem; } .kind { justify-self: start; } }

.drop {
  position: relative; display: block; border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
  padding: 1.2rem; text-align: center; cursor: pointer; background: var(--paper); transition: border-color .15s, background .15s;
}
.drop:hover, .drop.is-over { border-color: var(--gold-ink); background: var(--gold-soft); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.drop-text strong { color: var(--gold-ink); }
.drop-text small { color: var(--ink-2); }
.drop-list { display: block; margin-top: .4rem; font-size: .925rem; }
.drop-list:empty { display: none; }

.sticky-actions {
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); z-index: 5;
  background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line);
  border-radius: 999px; padding: .4rem; box-shadow: var(--shadow); margin-top: .5rem;
  width: fit-content; margin-left: auto;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
@media (min-width: 760px) { .sticky-actions { bottom: 12px; } }
.danger-zone { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.button-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .9rem; }

/* ---------- Koren ---------- */
.choirs { display: grid; gap: 0; }
.choir-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }
.choir-name { font: 600 1.3rem/1.3 var(--serif); }
.code-box { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .35rem .3rem 1rem; }
.code-label { font-size: .8rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .1em; }
.code { font-size: 1.1rem; font-weight: 600; }
.choir-edit { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.choir-edit summary, .add-member summary { cursor: pointer; font-weight: 500; color: var(--gold-ink); min-height: 44px; display: flex; align-items: center; gap: .4rem; list-style: none; }
.choir-edit summary::-webkit-details-marker, .add-member summary::-webkit-details-marker { display: none; }
.choir-edit summary::after, .add-member summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); margin-left: .35rem; transition: transform .15s; }
details[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.choir-edit .row-form { margin-top: .5rem; }
.add-member summary { margin: 0; }
.add-member[open] summary { margin-bottom: .8rem; }
.db-card { margin-top: 2rem; }
.db-card p { margin-bottom: .9rem; }

/* ---------- Leden ---------- */
.members { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.members li + li { border-top: 1px solid var(--line); }
.member { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .85rem 1.1rem; color: inherit; text-decoration: none; min-height: 64px; align-items: center; }
.member:hover { background: color-mix(in srgb, var(--gold-soft) 55%, transparent); }
.member-main { display: grid; min-width: 0; }
.member-name { font-weight: 600; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.member-mail { color: var(--ink-2); font-size: .925rem; overflow-wrap: anywhere; }
.member-side { display: grid; justify-items: end; gap: .25rem; }
.member-last { color: var(--ink-2); font-size: .85rem; }
@media (max-width: 560px) { .member-side { justify-items: start; } }

/* ---------- Inloggen ---------- */
body.bare { background:
  radial-gradient(ellipse at top, color-mix(in srgb, var(--gold-soft) 80%, transparent), transparent 60%), var(--paper); }
.auth { min-height: calc(100vh - 140px); display: grid; place-items: center; padding-block: 1rem; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 2rem 1.5rem; box-shadow: var(--shadow); }
.auth-card.wide { max-width: 560px; }
.auth-kicker { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.auth-title { margin-top: .25rem; }
.auth-card > .muted { margin-bottom: 1.25rem; }
.auth-alt { text-align: center; margin-top: 1.1rem; }
.auth-alt + .auth-alt { margin-top: .4rem; }
.checks { display: grid; gap: .4rem; margin-bottom: 1.25rem; }
.checks li span { font: 600 .75rem var(--font); padding: .2rem .5rem; border-radius: 999px; margin-right: .4rem; }
.checks .ok span { background: var(--ok-soft); color: var(--ok); }
.checks .bad span { background: var(--danger-soft); color: var(--danger); }

/* ---------- Voet ---------- */
.foot { padding-block: 1.5rem 2rem; color: var(--ink-2); font-size: .875rem; text-align: center; }
.foot a { color: var(--ink-2); }

@media (max-width: 560px) {
  .piece-link { align-items: flex-start; padding: .9rem 1rem; }
  .piece-counts { flex-direction: column; gap: .3rem; padding-top: .2rem; }
  .page-head .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  .topbar, .tabbar, .toolbar, .chips, .foot, .btn { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- 1.02: menu-stip, wat is nieuw onder Account ---------- */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-ink); margin-left: .35rem; vertical-align: .45em; box-shadow: 0 0 0 2px var(--surface); }
.tab-ico { position: relative; display: inline-flex; }
.tab-ico .dot { position: absolute; top: -1px; right: -4px; margin: 0; }
.section-title { font: 600 1.4rem/1.3 var(--serif); margin-bottom: .8rem; }
.release details > summary { list-style: none; cursor: pointer; display: grid; gap: .1rem; }
.release details > summary::-webkit-details-marker { display: none; }
.release details > summary .release-title { display: block; }
.release details > summary::after { content: ""; justify-self: end; margin-top: -1.6rem; width: 8px; height: 8px; border-right: 2px solid var(--gold-ink); border-bottom: 2px solid var(--gold-ink); transform: rotate(45deg); transition: transform .15s; }
.release details[open] > summary::after { transform: rotate(-135deg); }
.release details[open] > summary { margin-bottom: .9rem; }

/* ---------- Dashboard ---------- */
.filters { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1rem; }
.filters .chips { margin: 0; padding-bottom: .15rem; }
.filters select { min-height: 44px; }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); display: grid; gap: .15rem; }
.kpi-label { font-size: .85rem; font-weight: 500; color: var(--ink-2); }
.kpi-value { font: 600 2.1rem/1.1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi-sub { font-size: .8rem; color: var(--ink-2); }

.chart-wrap { position: relative; }
.chart-grid { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 200px auto; column-gap: .5rem; }
.y-axis { position: relative; width: 2.2rem; font-size: .75rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.y-axis span { position: absolute; right: 0; transform: translateY(-50%); }
.y-top { top: 0; } .y-mid { top: 50%; } .y-0 { top: 100%; }
.plot { position: relative; }
.chart { display: block; width: 100%; height: 200px; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .hit { fill: transparent; }
.chart .bar { fill: var(--gold); }
.chart .col.is-active .bar { fill: var(--gold-ink); }
.chart .col.is-active .hit { fill: color-mix(in srgb, var(--gold-soft) 70%, transparent); }
.x-axis { grid-column: 2; display: flex; justify-content: space-between; font-size: .75rem; color: var(--ink-2); padding-top: .4rem; }
.chart-tip {
  position: absolute; top: -.5rem; transform: translate(-50%, -100%); pointer-events: none; z-index: 3;
  background: var(--ink); color: var(--paper); font-size: .85rem; font-weight: 500; padding: .35rem .6rem; border-radius: 8px; white-space: nowrap;
}
.table-toggle { margin-top: 1rem; }
.table-toggle summary { cursor: pointer; color: var(--gold-ink); font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; }

.table-scroll { overflow-x: auto; margin: 0 -1.2rem; padding: 0 1.2rem; }
table.data { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.data th, table.data td { padding: .6rem .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.data thead th { font-size: .8rem; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; border-bottom-color: var(--line-strong); white-space: nowrap; }
table.data tbody th { font-weight: 600; }
table.data tbody th a { color: var(--ink); text-decoration: none; }
table.data tbody th a:hover { color: var(--gold-ink); text-decoration: underline; }
table.data tbody tr:last-child > * { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .sub { display: block; font-weight: 400; font-size: .85rem; color: var(--ink-2); }
table.data .sub a { color: var(--ink-2); }
.meter { display: inline-block; width: 64px; height: 6px; margin-right: .5rem; vertical-align: middle; }
.meter-track { fill: var(--gold-soft); }
.meter-fill { fill: var(--gold); }
@media (max-width: 560px) { .meter { display: none; } }
.stat-inline { color: var(--gold-ink); }
table.data tbody th { min-width: 9.5rem; }

/* ---------- 1.04: koorwachtwoord, instelling Nieuw ---------- */
.field > label { font-weight: 500; font-size: .95rem; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 5rem; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  min-height: 40px; min-width: 64px; padding: 0 .75rem; border: 0; border-radius: 8px;
  background: transparent; color: var(--gold-ink); font: 600 .9rem var(--font); cursor: pointer;
}
.pw-toggle:hover { background: var(--gold-soft); }
.code-box .code { word-break: break-all; letter-spacing: .02em; }
.setting-row { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.setting-row select {
  appearance: none; -webkit-appearance: none; min-height: 48px; padding: 0 2.4rem 0 .85rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--ink); font: inherit;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237A5F27' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right .7rem center / 18px;
}
