/* Podlog: ontwerp "Sunlit Leisure" (zie DESIGN.md) */
:root {
  --bg: #FFFBF7;
  --container: #F6EFE9;
  --card: #FFFFFF;
  --card-alt: #FDF8F3;
  --ink: #2B211E;
  --muted: #6F625B;
  --placeholder: #8E827B;
  --primary: #F07865;
  --primary-ink: #A23D2F;
  --secondary: #8C7DBE;
  --secondary-ink: #5F4E96;
  --tertiary: #F7B267;
  --line: #EFE5DC;
  --line-card: #F2E8DF;
  --field-line: #EAE0D6;
  --field-bg: #FDF9F5;
  --track: #EADBCE;
  --star-off: #EAE1D8;
  --shadow-1: 0px 4px 20px -2px rgba(186, 120, 100, 0.08);
  --shadow-2: 0px 6px 24px -4px rgba(186, 120, 100, 0.12), 0px 2px 6px 0px rgba(43, 33, 30, 0.03);
  --shadow-3: 0px 16px 40px -8px rgba(92, 53, 44, 0.16);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.53 var(--font); }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 30px; line-height: 38px; font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: 20px; line-height: 28px; font-weight: 700; letter-spacing: -0.01em; }
a { color: var(--primary-ink); font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(240, 120, 101, 0.5); outline-offset: 2px; }

/* ---------- Knoppen ---------- */
button {
  background: var(--card); border: 1px solid var(--line); border-radius: 9999px;
  padding: 0.5rem 1rem; font-size: 13px; font-weight: 600; letter-spacing: 0.02em; cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease;
}
button:active { transform: scale(0.98); }
button:disabled { opacity: 0.5; cursor: default; }
button.primary { background: var(--primary); border-color: transparent; color: #fff; font-size: 14px; font-weight: 700; }
button.secondary { background: rgba(140, 125, 190, 0.15); border-color: transparent; color: var(--secondary-ink); font-weight: 700; }
button.ghost { background: transparent; border-color: transparent; color: var(--ink); }
button.ghost:hover { background: rgba(240, 120, 101, 0.1); }
button.danger { color: #BA1A1A; }
button.big { padding: 0.85rem 1.6rem; font-size: 15px; }

/* ---------- Beginscherm ---------- */
.hero { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; }
.hero-card { background: var(--card); border-radius: 3rem; padding: 2.5rem 2rem; max-width: 28rem; text-align: center; box-shadow: var(--shadow-2); }
.hero-card h1 { margin: 0.4rem 0 0.6rem; }
.hero-card p { color: var(--muted); margin-bottom: 1.5rem; }
.hero-card .sun { width: 64px; height: 64px; display: block; margin: 0 auto; }
.warn { color: #BA1A1A !important; margin: 1rem 0 0 !important; }

.sun {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: inline-block;
  background: radial-gradient(circle at 35% 35%, #FFE2B3, #F7B267 55%, #F07865);
  box-shadow: 0 0 0 6px rgba(247, 178, 103, 0.25), 0 6px 18px -4px rgba(240, 120, 101, 0.5);
}

/* ---------- Pagina ---------- */
#app { max-width: 1120px; margin: 0 auto; padding: 1.25rem 1.25rem 3.5rem; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.8rem; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.msg { color: var(--muted); font-size: 13px; min-height: 1.5em; margin: 0.6rem 0 0.4rem; }

.search input {
  width: 100%; height: 48px; border-radius: 9999px; border: 1px solid transparent; background: var(--container);
  padding: 0 1.25rem; font-size: 15px;
}
.search input::placeholder { color: var(--placeholder); }
.search input:focus { outline: none; border-color: rgba(240, 120, 101, 0.45); box-shadow: 0 0 0 4px rgba(240, 120, 101, 0.2); }

.chips-row { display: flex; gap: 0.5rem; overflow-x: auto; padding: 1rem 0 0.25rem; scrollbar-width: none; }
.chips-row::-webkit-scrollbar { display: none; }
.chips-row button { height: 32px; padding: 0 0.95rem; flex: none; background: var(--card); border-color: var(--line); color: var(--ink); }
.chips-row button.on { background: var(--primary); border-color: transparent; color: #fff; }
.chips-row span { opacity: 0.7; margin-left: 0.35rem; font-weight: 700; }

.filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; margin-top: 0.9rem; align-items: end; }
.sel { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.sel > span { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding-left: 0.9rem; }
select, .dir {
  height: 40px; border-radius: 9999px; border: 1px solid var(--line); background-color: var(--card);
  padding: 0 2.2rem 0 1rem; font-size: 13px; font-weight: 600; width: 100%; min-width: 0; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238A716D' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center; text-overflow: ellipsis;
}
.dir { background-image: none; padding: 0 1rem; text-align: left; }
select:focus, .dir:focus { outline: none; border-color: rgba(240, 120, 101, 0.5); box-shadow: 0 0 0 4px rgba(240, 120, 101, 0.2); }
#flt-clear { align-self: end; height: 40px; justify-self: start; color: var(--primary-ink); font-weight: 700; }

.count { margin-top: 1rem; font-size: 13px; color: var(--muted); font-weight: 500; }

/* ---------- Kaarten ---------- */
.grid { display: grid; grid-template-columns: 1fr; gap: 0.75rem; margin-top: 0.75rem; }
.card {
  display: flex; gap: 1rem; align-items: flex-start; text-align: left; width: 100%;
  background: var(--card); border: 1px solid transparent; border-radius: 2rem; padding: 1.25rem;
  box-shadow: var(--shadow-1); transition: box-shadow 0.2s ease, transform 0.12s ease; font-size: 15px; letter-spacing: 0; font-weight: 400;
}
.card:hover { box-shadow: var(--shadow-2); }
.cover { width: 84px; height: 84px; border-radius: 1.25rem; object-fit: cover; background: var(--container); flex: none; }
.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.card-title { font-weight: 700; font-size: 16px; line-height: 1.3; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.card-sub { color: var(--muted); font-size: 13px; font-weight: 500; line-height: 1.4; }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0 0.1rem; }
.pill {
  height: 26px; display: inline-flex; align-items: center; padding: 0 0.7rem; border-radius: 9999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; background: var(--container); color: var(--muted); white-space: nowrap;
}
.pill.wil { background: rgba(140, 125, 190, 0.15); color: var(--secondary-ink); }
.pill.bezig { background: rgba(240, 120, 101, 0.16); color: var(--primary-ink); }
.pill.uitgeluisterd { background: rgba(247, 178, 103, 0.32); color: #683D00; }
.pill.gestopt { background: var(--line); color: #56423E; }
.pill.cat { background: transparent; border: 1px solid rgba(140, 125, 190, 0.55); color: var(--secondary-ink); }
.pill.tag { background: rgba(140, 125, 190, 0.12); color: var(--secondary-ink); font-weight: 600; letter-spacing: 0.02em; }
.stars { font-size: 15px; letter-spacing: 1px; color: var(--star-off); line-height: 1.2; margin-top: 0.15rem; }
.stars i { font-style: normal; color: var(--tertiary); text-shadow: 0 0 8px rgba(247, 178, 103, 0.55); }
.prog { height: 6px; border-radius: 9999px; background: var(--track); overflow: hidden; margin: 0.55rem 0 0.25rem; }
.prog i { display: block; height: 100%; background: var(--primary); border-radius: 9999px; }
.empty { color: var(--muted); grid-column: 1 / -1; text-align: center; padding: 3rem 1rem; }

/* ---------- Dialogen ---------- */
dialog {
  border: none; border-radius: 2rem; background: var(--bg); color: var(--ink); box-shadow: var(--shadow-3);
  width: min(46rem, calc(100vw - 1.5rem)); max-height: 92vh; padding: 1.5rem; overflow: auto;
}
dialog::backdrop { background: rgba(43, 33, 30, 0.35); backdrop-filter: blur(2px); }
.d-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.1rem; }
.d-head .cover { width: 76px; height: 76px; }
.d-head p { color: var(--muted); font-size: 13px; font-weight: 500; }
.fields { display: grid; grid-template-columns: 1fr; gap: 0.8rem; }
.fields .full { grid-column: 1 / -1; }
dialog label { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; color: var(--muted); }
dialog label > * { margin-top: 0.3rem; }
dialog label .tag-edit, dialog label input, dialog label textarea, dialog label select { font-weight: 500; letter-spacing: 0; color: var(--ink); font-size: 14px; }
dialog input[type=text], dialog input[type=date], dialog input[type=number] {
  width: 100%; height: 44px; border-radius: 9999px; border: 1px solid var(--field-line); background: var(--field-bg); padding: 0 1.1rem;
}
dialog textarea { width: 100%; border-radius: 1.5rem; border: 1px solid var(--field-line); background: var(--field-bg); padding: 0.8rem 1.1rem; resize: vertical; }
dialog input:focus, dialog textarea:focus { outline: none; border-color: rgba(240, 120, 101, 0.5); box-shadow: 0 0 0 4px rgba(240, 120, 101, 0.2); }
dialog select { background-color: var(--field-bg); border-color: var(--field-line); height: 44px; font-size: 14px; }
.tag-edit { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; min-height: 44px; padding: 0.4rem 0.7rem; border: 1px solid var(--field-line); border-radius: 1.5rem; background: var(--field-bg); }
.tag-edit:focus-within { border-color: rgba(240, 120, 101, 0.5); box-shadow: 0 0 0 4px rgba(240, 120, 101, 0.2); }
.tag-edit input { flex: 1; min-width: 9rem; border: none !important; background: transparent !important; box-shadow: none !important; height: 30px !important; padding: 0 0.3rem !important; outline: none; }
.tag-edit .pill { height: 28px; padding-right: 0.25rem; gap: 0.15rem; }
.tag-edit .pill button { border: none; background: transparent; padding: 0 0.4rem; font-size: 15px; line-height: 1; color: var(--secondary-ink); }
.rate { display: flex; gap: 0.1rem; align-items: center; }
.rate button { border: none; background: none; font-size: 1.7rem; padding: 0 0.12rem; color: var(--star-off); line-height: 1; }
.rate button.on { color: var(--tertiary); text-shadow: 0 0 10px rgba(247, 178, 103, 0.55); }
dialog h3 { font-size: 15px; font-weight: 700; margin: 1.4rem 0 0.5rem; letter-spacing: -0.005em; }
dialog footer { display: flex; justify-content: space-between; margin-top: 1.25rem; }

.eps { max-height: 50vh; overflow: auto; border: 1px solid var(--line-card); border-radius: 1.5rem; background: var(--card-alt); }
.eps-msg { padding: 1rem; color: var(--muted); }
.eps-bar { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.4rem 0 0.7rem; }
.eps-bar button { height: 32px; padding: 0 0.85rem; }
.eps-bar button.on { background: var(--primary); border-color: transparent; color: #fff; }
.eps-bar span { opacity: 0.7; margin-left: 0.3rem; }
.eps-bar .ord { margin-left: auto; }
.ep { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line); font-size: 14px; }
.ep input[type=checkbox] { width: 18px; height: 18px; margin-top: 0.2rem; accent-color: var(--primary); flex: none; }
.ep-main { flex: 1; min-width: 0; }
.ep-title { display: block; font-weight: 600; overflow-wrap: anywhere; }
.ep small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.ep.done .ep-title { color: var(--muted); font-weight: 500; }
.ep.ign .ep-title { text-decoration: line-through; color: var(--muted); }
.ep-more { border: none; background: none; padding: 0 0.5rem; color: var(--muted); font-size: 1.2rem; line-height: 1; }
.ep-tools { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; padding: 0.7rem 0.9rem; background: var(--container); border-bottom: 1px solid var(--line); font-size: 13px; }
.ep-tools label { margin: 0; display: flex; align-items: center; gap: 0.4rem; }
.ep-tools label > * { margin-top: 0; }
.ep-tools input[type=date], .ep-tools input[type=number] { width: auto; height: 34px; }
.ep-tools input[type=number] { width: 4.8rem; }
.ep-tools button { height: 30px; padding: 0 0.75rem; font-size: 12px; }
h4.season {
  display: flex; gap: 0.6rem; align-items: center; margin: 0; padding: 0.55rem 0.9rem; font-size: 13px; font-weight: 700;
  background: rgba(140, 125, 190, 0.14); color: var(--secondary-ink); position: sticky; top: 0; z-index: 1; backdrop-filter: blur(6px);
}
h4.season small { font-weight: 500; margin-right: auto; }
h4.season button { height: 28px; padding: 0 0.7rem; font-size: 12px; background: var(--card); }

.results { list-style: none; margin: 0.9rem 0 0; padding: 0; max-height: 22rem; overflow: auto; }
.results li { display: flex; gap: 0.8rem; align-items: center; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.results img { width: 52px; height: 52px; border-radius: 0.9rem; object-fit: cover; background: var(--container); }
.results div { flex: 1; min-width: 0; }
.results b { font-weight: 700; }
.results small { display: block; color: var(--muted); font-size: 13px; }
#sdlg input[type=search] { width: 100%; height: 48px; border-radius: 9999px; border: 1px solid transparent; background: var(--container); padding: 0 1.25rem; margin-top: 0.8rem; }
#sdlg input[type=search]:focus { outline: none; box-shadow: 0 0 0 4px rgba(240, 120, 101, 0.2); }

/* ---------- Groter scherm ---------- */
@media (min-width: 600px) {
  .fields { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 768px) {
  h1 { font-size: 40px; line-height: 48px; letter-spacing: -0.03em; }
  #app { padding: 2rem 2rem 4rem; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
}
@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #flt-clear { grid-column: auto; }
}
@media (max-width: 599px) {
  dialog { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 2rem 2rem 0 0; padding: 1.25rem; max-height: 94vh; }
  .brand .sun { width: 28px; height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

dialog .lbl { font-size: 12px; font-weight: 700; letter-spacing: 0.02em; color: var(--muted); }
dialog .lbl > * { margin-top: 0.3rem; }

/* ---------- Voortgang, favorieten, informatie ---------- */
.sync { position: sticky; top: 0.6rem; z-index: 5; background: var(--card); border-radius: 1.5rem; padding: 0.8rem 1.1rem 0.85rem; margin: 0.4rem 0 0.6rem; box-shadow: var(--shadow-2); }
.sync .prog { margin: 0 0 0.5rem; height: 8px; }
.sync .prog i { transition: width 0.3s ease; }
.sync span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); overflow-wrap: anywhere; }
.favs { margin-top: 1rem; }
.favs h2 { font-size: 16px; margin-bottom: 0.6rem; }
.fav-row { display: flex; gap: 0.75rem; overflow-x: auto; padding: 0.2rem 0.1rem 0.8rem; scrollbar-width: none; }
.fav-row::-webkit-scrollbar { display: none; }
.fav-item { flex: none; width: 96px; display: flex; flex-direction: column; align-items: center; gap: 0.45rem; background: transparent; border: none; padding: 0; border-radius: 1.25rem; font-size: 12px; font-weight: 700; line-height: 1.25; text-align: center; letter-spacing: 0; }
.fav-item .cover { width: 96px; height: 96px; box-shadow: var(--shadow-1); }
.fav-item span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; width: 100%; }
.card { position: relative; cursor: pointer; }
.card-body { padding-right: 1.8rem; }
.pin { position: absolute; top: 0.9rem; right: 1rem; border: none; background: transparent; padding: 0.1rem 0.3rem; font-size: 20px; line-height: 1; color: var(--placeholder); }
.pin.on { color: var(--primary); }
.pin:hover { color: var(--primary); }
.d-actions { margin-top: 0.5rem; }
.d-actions button { height: 30px; padding: 0 0.85rem; }
.desc { color: var(--muted); font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.desc.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
#f-desc .ghost { margin-top: 0.3rem; padding-left: 0; font-weight: 700; color: var(--primary-ink); }
#f-desc h3 { margin-top: 0.4rem; }

.pill.lang { background: rgba(247, 178, 103, 0.22); color: #683D00; }
.pill.rec { background: var(--primary); color: #fff; }
dialog .plain { color: var(--muted); font-size: 14px; margin: 0.5rem 0 1rem; }
dialog footer .row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
dialog input[readonly] { color: var(--muted); }

/* ---------- Gedeelde lijst ---------- */
.share-page #app { padding-top: 2rem; }
.share-page .brand p { color: var(--muted); font-size: 13px; font-weight: 500; }
.share-page .card { cursor: default; }
.quote { background: var(--card-alt); border: 1px solid var(--line-card); border-radius: 1.25rem; padding: 0.7rem 0.9rem; margin: 0.6rem 0 0.2rem; font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.share-page details { margin-top: 0.4rem; font-size: 13px; color: var(--muted); }
.share-page summary { cursor: pointer; font-weight: 700; color: var(--secondary-ink); }
.share-page details p { margin-top: 0.4rem; white-space: pre-line; overflow-wrap: anywhere; }
a.btn { display: inline-flex; align-items: center; height: 32px; padding: 0 0.95rem; margin-top: 0.6rem; border-radius: 9999px; background: var(--primary); color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; align-self: flex-start; }
.share-foot { margin-top: 2.5rem; text-align: center; color: var(--muted); font-size: 12px; }
.quote.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.share-page dialog footer a.btn { margin-top: 0; }
.share-page dialog .stars { margin-top: 0.4rem; }
.share-page dialog h3 { margin-top: 1.1rem; }
.msg.alert { color: var(--primary-ink); font-weight: 600; background: rgba(240, 120, 101, 0.12); border-radius: 1.25rem; padding: 0.7rem 1rem; }
