:root {
  color-scheme: light;
  font: 100%/1.5 "Inter", system-ui, sans-serif;
  color: #171c32;
  background: #f3f5fb;
  --accent: #394cc9;
  --muted: #59637b;
  --border: #dce1ee;
  --surface: #fff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
:focus-visible { outline: 3px solid #5568ed; outline-offset: 3px; }
input {
  width: 100%; min-width: 0; padding: .7rem .85rem;
  background: var(--surface); color: inherit;
  border: 1px solid #aeb8ce; border-radius: .65rem;
}
label { display: block; color: var(--muted); font-weight: 600; font-size: .875rem; margin-bottom: .35rem; }
h1, h2, p { margin: 0; }
button {
  color: inherit; background: var(--surface); border: 1px solid var(--border);
  padding: .5rem .8rem; border-radius: .65rem;
}
button:hover:enabled { border-color: var(--accent); }
.brand-icon {
  display: inline-grid; place-items: center; flex: 0 0 auto; width: 2.25rem; height: 2.25rem;
  border-radius: .65rem; background: #dce3ff; color: #293cae; font-size: 1.45rem;
}
.login-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .85fr);
  max-width: 57rem; margin: min(16vh, 9rem) auto 2rem; width: calc(100% - 2rem);
  border-radius: 1.5rem; overflow: hidden; border: 1px solid var(--border);
  background: var(--surface); box-shadow: 0 20px 75px #17214719;
}
.login-intro {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  min-height: 24rem; padding: clamp(1.5rem, 5vw, 3.7rem);
  color: white; background: radial-gradient(ellipse at 95% 0%, #4358bf 0%, transparent 57%), #192345;
}
.login-intro h1 { margin: 1.2rem 0 .45rem; font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -.055em; }
.login-intro p { color: #dfe5ff; max-width: 22rem; }
#login-form { padding: clamp(1.5rem, 5vw, 3.25rem); align-self: center; }
#login-form h2 { margin-bottom: 1.4rem; }
#login-form input { margin-bottom: 1rem; }
.primary { background: var(--accent); color: white; width: 100%; font-weight: 650; margin-top: .35rem; }
.error { color: #9b2734; }
.error:not(:empty) { margin-bottom: .55rem; }
.startup { margin: 20vh auto; width: fit-content; padding: 1rem; }
.shell { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  background: #192345; color: white; padding: 1.55rem 1.1rem;
  display: flex; flex-direction: column; gap: 2.2rem; min-width: 0;
}
.brand { display: flex; align-items: center; gap: .65rem; font-weight: 750; letter-spacing: -.02em; }
.sidebar h2 { padding: 0 .55rem .6rem; font-size: .875rem; color: #c0caed; font-weight: 650; }
.collection-list { display: grid; gap: .35rem; }
.collection-list button, .quiet {
  background: transparent; color: #e4e9ff; border-color: transparent; text-align: left;
  overflow-wrap: anywhere;
}
.collection-list button[aria-current] { background: #324477; color: white; border-color: #586aa2; }
.account { margin-top: auto; border-top: 1px solid #495476; padding: .65rem .2rem 0; display: grid; }
#account-name { color: #c0caed; font-size: .875rem; padding: .25rem .55rem; overflow-wrap: anywhere; }
.content { width: 100%; max-width: 96rem; margin: 0 auto; padding: clamp(1rem, 4vw, 3.5rem); }
.library-header {
  display: flex; gap: 1rem 2rem; align-items: flex-end; justify-content: space-between;
  border-radius: 1.35rem; padding: clamp(1.2rem, 3vw, 2.4rem);
  background: linear-gradient(115deg, #e0e6ff, #edf0fc 74%); border: 1px solid #dbe1f5;
}
.section-label { color: #44538c; font-size: .875rem; font-weight: 650; }
.library-header h1 { font-size: clamp(1.9rem, 4vw, 3.4rem); letter-spacing: -.06em; overflow-wrap: anywhere; }
.search { width: min(100%, 20rem); flex-shrink: 0; }
.controls {
  padding-block: 1.25rem .35rem; display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: .75rem;
}
.breadcrumbs, .filters { display: flex; flex-wrap: wrap; gap: .35rem; }
.breadcrumbs button { border-color: transparent; background: transparent; color: #344590; overflow-wrap: anywhere; }
.breadcrumbs button[aria-current] { color: #273044; font-weight: 650; }
.filters button[aria-pressed="true"] { background: #e0e6ff; color: #273ca7; border-color: #b4c0ee; }
.status, #empty-library { color: var(--muted); margin: .6rem 0 1rem; }
.cards { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); }
.card {
  display: grid; grid-template-rows: auto 1fr; min-width: 0; padding: 0;
  text-align: left; overflow: hidden; box-shadow: 0 4px 16px #17214708;
}
.card-art {
  display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden;
  font-size: 2rem; font-weight: 650; color: #2c4295; background: #e0e7ff;
}
.card[data-kind="music"] .card-art { color: #485a32; background: #e9efdf; }
.card[data-kind="video"] .card-art { color: #633979; background: #efe5f5; }
.card[data-kind="folder"] .card-art { color: #795522; background: #f8edda; }
.card-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-info { display: grid; gap: .25rem; padding: .8rem .85rem; }
.card-name { font-weight: 650; overflow-wrap: anywhere; }
.card-detail { color: var(--muted); font-size: .875rem; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; }
dialog {
  width: min(92vw, 65rem); max-height: 88dvh; padding: 1rem; color: #eef1ff;
  background: #18213b; border: 1px solid #63708c; border-radius: 1rem;
}
dialog::backdrop { background: #0a1128c7; }
.viewer-header { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: .8rem; }
.viewer-header h2 { font-size: 1rem; overflow-wrap: anywhere; }
.viewer-header button { color: #18213b; }
#player { display: grid; justify-items: center; }
#player img, #player video { display: block; max-width: 100%; max-height: 68dvh; object-fit: contain; }
#player audio { width: min(100%, 40rem); margin: 1.25rem 0; }
#viewer-status { padding-top: .75rem; color: #f6ced7; }
@media (max-width: 950px) {
  .library-header { flex-wrap: wrap; }
}
@media (max-width: 680px) {
  .shell { display: block; }
  .sidebar { gap: .8rem; padding: .85rem 1rem; }
  .collection-list { display: flex; flex-wrap: wrap; }
  .collection-list button { padding: .4rem .55rem; }
  .account { display: flex; align-items: center; justify-content: space-between; }
  .login-layout { grid-template-columns: 1fr; margin-top: 1rem; }
  .login-intro { min-height: auto; }
}
