:root {
  color-scheme: dark;
  font: 16px/1.45 system-ui, sans-serif;
  color: #e8edf5;
  background: #161c25;
  --muted: #aebbd0;
  --line: #3d495d;
  --surface: #232c39;
  --panel: #1b222d;
  --blue: #215bb5;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea { border: 1px solid var(--line); border-radius: .45rem; color: inherit; background: #19212d; }
button, select { cursor: pointer; }
button { padding: .45rem .75rem; }
button:hover { background: #36445a; }
button:disabled { cursor: wait; opacity: .6; }
a { color: #a9caff; }
:focus-visible { outline: 2px solid #9bc5ff; outline-offset: 2px; }
input, select, textarea { min-width: 0; width: 100%; padding: .45rem .6rem; }
input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: #8cbaff; }
[hidden] { display: none !important; }
.primary { background: var(--blue); border-color: #497bc8; font-weight: 650; }
.primary:hover { background: #2d70cf; }
.error { color: #ffd4ce; background: #461f23; border-radius: .45rem; padding: .6rem .8rem; }

.login-page { min-height: 100dvh; display: grid; place-items: center; padding: 1rem; }
.login-panel { width: min(100%, 26rem); padding: clamp(1.25rem, 5vw, 2rem); background: var(--panel); border: 1px solid var(--line); border-radius: .8rem; }
.login-panel img { width: 11rem; max-width: 100%; height: auto; }
.login-panel h1 { margin: 1rem 0 1.5rem; font-size: 1.7rem; }
.login-panel form { display: grid; gap: .55rem; }
.login-panel button { justify-self: start; margin-top: .35rem; }

.board-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.site-bar { padding: .6rem 1rem; background: #19212d; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .8rem; }
.brand { flex: none; display: flex; }
.brand img { width: 6.6rem; height: 2.35rem; object-fit: contain; }
.site-bar h1 { margin: 0; min-width: 0; flex: 1; font-size: clamp(1.05rem, 3vw, 1.45rem); overflow-wrap: anywhere; }
#schedule-board { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--board-background, #1c3550) center / cover; }
.board-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: .6rem 1rem; padding: .75rem 1rem; background: rgba(19, 29, 42, .9); }
.filter-field { display: grid; gap: .2rem; color: var(--muted); font-size: .875rem; }
.filter-field :is(input, select) { font-size: 1rem; color: #e8edf5; }
.filter-check { display: flex; align-items: center; gap: .38rem; min-height: 2.3rem; font-size: .9rem; }
.board-toolbar > button { margin-left: auto; }
.availability { margin: .9rem 1rem; color: var(--muted); }
.lists { flex: 1; min-height: 0; display: flex; align-items: flex-start; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; gap: .8rem; padding: .85rem 1rem; }
.list { display: flex; flex: 0 0 min(18.5rem, 84vw); flex-direction: column; max-height: 100%; padding: .7rem; border: 1px solid #475568; border-radius: .65rem; background: var(--panel); }
.list > :is(header, button) { flex-shrink: 0; }
.list > header { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin-bottom: .5rem; }
.list h2 { font-size: 1rem; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.list-count { color: var(--muted); font-size: .875rem; margin-left: .35rem; }
.list-tools { display: flex; flex: none; gap: .25rem; }
.list-tools button { font-size: .875rem; padding: .26rem .42rem; }
.list > button { margin: .45rem 0 0; text-align: left; }
.cards { min-height: 0; overflow-y: auto; scrollbar-color: #526584 transparent; margin: 0; padding: 0; list-style: none; }
.card { display: flex; position: relative; flex-direction: column; padding: .55rem; margin-bottom: .45rem; gap: .35rem; border: 1px solid transparent; border-radius: .45rem; background: var(--surface); overflow-wrap: anywhere; }
.card:hover, .card:focus-within { border-color: #7989a1; }
.card-open { width: 100%; text-align: left; border: 0; padding: 0; color: inherit; background: transparent; }
.card-open:hover { background: transparent; text-decoration: underline; }
.card-meta { color: var(--muted); font-size: .875rem; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; }
.card-meta button { padding: .2rem .35rem; font-size: .875rem; }
.card-meta .complete { color: #b8f2d2; border-color: #477765; }
.cover { display: block; width: 100%; max-height: 9rem; min-height: .45rem; object-fit: cover; border-radius: .3rem; }
.cover-swatch { min-height: .45rem; }
.labels { display: flex; flex-wrap: wrap; gap: .3rem; }
.tag { border: 1px solid var(--label-color, var(--line)); border-radius: .3rem; padding: 0 .4rem; font-size: .875rem; }

dialog { width: min(40rem, calc(100vw - 1.5rem)); border: 1px solid var(--line); border-radius: .7rem; padding: 0; color: inherit; background: var(--panel); }
dialog::backdrop { background: #080c14bb; }
.editor { padding: 1rem; display: grid; gap: .55rem; }
.editor header, .editor footer { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.editor header h2 { font-size: 1.2rem; margin: 0; }
.editor footer { justify-content: flex-end; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: .4rem .65rem; }
.fields:not(.two) label { display: grid; gap: .2rem; }
#card-details:empty { display: none; }
#card-details h3 { margin: .65rem 0 .25rem; font-size: 1rem; }
#card-details p { margin: .25rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.attachments { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .6rem; }
.attachments a { overflow-wrap: anywhere; }
.attachments :is(img, video) { width: 100%; border-radius: .4rem; max-height: 15rem; object-fit: contain; background: #11151c; }
@media (max-width: 600px) {
  .brand img { width: 4.4rem; }
  .site-bar, .board-toolbar { padding-inline: .6rem; }
  .board-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .4rem .6rem; }
  .board-toolbar > button { margin-left: 0; }
  .board-toolbar :is(button, select, input[type="search"]), .board-toolbar .filter-check,
  .site-bar button, .list button, .editor button, .login-panel button { min-height: 44px; }
  .list-tools button { min-width: 44px; }
  .lists { padding-inline: .6rem; }
  dialog { max-height: calc(100vh - 1.5rem); max-height: calc(100dvh - 1.5rem); overflow-y: auto; }
}
