:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  color: #f4f8fb;
  background: #10171e;
  accent-color: #9ee5d4;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body { margin: 0; }
main { max-width: 66rem; margin: auto; padding: clamp(1.25rem, 6vw, 3.5rem) clamp(1rem, 4vw, 2rem); }
header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.75rem; }
.brand { font-size: 1.05rem; font-weight: 700; margin: 0; }
nav { display: flex; gap: 1.25rem; }
nav a { display: block; padding: .6rem .2rem; color: #b7c7d2; text-decoration: none; font-weight: 650; border-bottom: 2px solid transparent; }
nav a:hover, nav a[aria-current="page"] { color: #9ee5d4; }
nav a[aria-current="page"] { border-color: currentColor; }
h1 { margin: 0 0 1.1rem; letter-spacing: -.045em; font-size: clamp(2.25rem, 8vw, 3.75rem); line-height: 1.1; }
h2 { font-size: 1.2rem; margin: 0 0 .85rem; }
.note, .optional { color: #b7c7d2; }
.note { margin: 0 0 .85rem; font-size: .9rem; line-height: 1.45; }
.panel { padding: clamp(1rem, 4vw, 1.5rem); background: #19242e; border: 1px solid #344451; border-radius: .9rem; }
#connection { max-width: 36rem; }
form { display: grid; gap: .85rem; }
label { display: grid; gap: .38rem; font-size: .95rem; font-weight: 600; }
label .optional { display: inline; font-weight: 400; }
#folder { margin-top: -.12rem; }
input, button { font: inherit; min-height: 2.75rem; border-radius: .45rem; }
input { width: 100%; border: 1px solid #657889; padding: .5rem .7rem; background: #10171e; color: #f4f8fb; }
button { padding: .45rem .85rem; border: 1px solid transparent; background: #9ee5d4; color: #10271f; font-weight: 650; cursor: pointer; justify-self: start; }
button.secondary { color: #e3eff5; background: transparent; border-color: #657889; }
button:hover { filter: brightness(1.15); }
button:disabled { cursor: wait; opacity: .62; }
:focus-visible { outline: 2px solid #9ee5d4; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.catalogue-search { min-height: 3rem; padding: .65rem .9rem; background: #19242e; }
.catalogue-search::placeholder { color: #b7c7d2; }
.catalogue-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: clamp(1rem, 3vw, 1.8rem); margin-top: 1.25rem; align-items: start; }
.saved { border-left: 1px solid #344451; padding-left: clamp(1rem, 3vw, 1.8rem); }
#catalogue-results { display: grid; gap: .7rem; }
#catalogue-results li { display: grid; grid-template-columns: clamp(3.75rem, 12vw, 7rem) minmax(0, 1fr); gap: .85rem; align-items: start; padding: .85rem; background: #19242e; border: 1px solid #344451; border-radius: .6rem; }
.cover { position: relative; display: grid; place-items: center; aspect-ratio: 2 / 3; overflow: hidden; border-radius: .35rem; background: #10171e; color: #b7c7d2; font-size: .8rem; text-align: center; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #10171e; }
.result-title { margin: 0; font-size: 1.05rem; }
.result-meta { margin: .25rem 0 0; color: #b7c7d2; font-size: .9rem; }
.result-description { margin: .55rem 0 0; line-height: 1.45; white-space: pre-line; }
.result-action { margin-top: .7rem; text-align: left; }
.result-action[aria-disabled="true"] { color: #b7c7d2; background: transparent; border-color: #657889; cursor: default; }
.toolbar { display: flex; gap: .55rem; flex-wrap: wrap; margin: 1rem 0 0; }
.toolbar button { font-size: .875rem; }
details { margin-top: 1rem; }
summary { width: fit-content; padding: .35rem 0; color: #b7c7d2; cursor: pointer; }
#add { margin-top: .5rem; }
ul { list-style: none; padding: 0; margin: 0; }
li { overflow-wrap: anywhere; }
#saved-list li { display: flex; justify-content: space-between; align-items: center; gap: .65rem; padding: .2rem 0; border-bottom: 1px solid #344451; }
button.remove { flex-shrink: 0; padding: .3rem .15rem .3rem .45rem; background: transparent; color: #b7c7d2; font-size: .875rem; }
button.remove:hover { text-decoration: underline; }
.status { margin: .65rem 0 0; overflow-wrap: anywhere; }
.status:empty { margin: 0; }
.status[data-error="true"] { color: #ffb8a6; }
@media (max-width: 45rem) {
  .catalogue-layout { grid-template-columns: 1fr; }
  .saved { border-left: 0; padding: 1.2rem 0 0; border-top: 1px solid #344451; }
}
