/* The board: lists, cards, table, calendar, the card view, notes and the files gallery.
   No inline styles are needed anywhere, so the strict security policy holds. */

/* labels and people */
.lbl { display: inline-block; border-radius: 6px; padding: 1px 8px; font-size: .72rem; font-weight: 700; color: #fff; line-height: 1.55; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbl.green { background: #2c7a4b; } .lbl.yellow { background: #9a6b00; } .lbl.orange { background: #bf5b12; } .lbl.red { background: #b03035; }
.lbl.purple { background: #7442a8; } .lbl.blue { background: #1d5fa3; } .lbl.teal { background: #0d7f81; } .lbl.gray { background: #5b6b7f; }
.av { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: .66rem; font-weight: 800; color: #fff; background: #5b6b7f; flex: none; }
.av.c0 { background: #1d5fa3; } .av.c1 { background: #2c7a4b; } .av.c2 { background: #7442a8; } .av.c3 { background: #bf5b12; } .av.c4 { background: #0d7f81; } .av.c5 { background: #b0436b; }
.avs { display: inline-flex; }
.avs .av { margin-left: -6px; border: 2px solid var(--card); box-sizing: content-box; width: 22px; height: 22px; }
.avs .av:first-child { margin-left: 0; }

/* the work area */
.viewbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 14px; }
.filters .field { min-width: 130px; }
.filters input[type="search"] { min-width: 170px; }
.filters .check { display: flex; gap: 6px; align-items: center; font-size: .85rem; min-height: 42px; }
.filters input[type="checkbox"], .check-row input[type="checkbox"], label.row input[type="checkbox"] { width: auto; min-height: 0; }

/* board: any number of lists */
.board { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 12px; grid-template-columns: none; }
.column { flex: 0 0 280px; max-width: 86vw; }
.column.add-list { background: transparent; border: 2px dashed var(--line); min-height: 0; }
.column h3 { align-items: center; gap: 8px; }
.column h3 .name { flex: 1; text-align: left; overflow-wrap: anywhere; }
.column h3 .count { font-weight: 600; }
.column h3 button { font: inherit; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 6px; padding: 2px 6px; }
.column h3 button:hover { background: var(--card); color: var(--ink); }
.column .donecue { color: var(--good); font-size: .7rem; text-transform: none; letter-spacing: 0; font-weight: 700; }
.task .labels { display: flex; flex-wrap: wrap; gap: 4px; }
.task .foot { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: space-between; }
.task .badges { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.mini { display: inline-flex; gap: 4px; align-items: center; font-size: .76rem; color: var(--muted); white-space: nowrap; }
.mini.good { color: var(--good); } .mini.bad { color: var(--bad); font-weight: 700; }
.task.complete .title { text-decoration: line-through; color: var(--muted); }
.task.drop-before { box-shadow: 0 -4px 0 var(--brand); }
.column.drop-end { outline: 2px dashed var(--brand); }
.tick { width: 18px; height: 18px; min-height: 0; margin: 0; flex: none; }
.task .head-line { display: flex; gap: 8px; align-items: flex-start; }
.hint.center { text-align: center; }

/* table view */
.group-head td { background: var(--soft); font-weight: 700; color: var(--ink); }
.table-wrap td.title { white-space: normal; min-width: 220px; overflow-wrap: anywhere; }
.table-wrap td.title button { font: inherit; font-weight: 600; color: var(--brand); background: none; border: 0; cursor: pointer; text-align: left; padding: 0; }
.table-wrap tr.complete td.title button { text-decoration: line-through; color: var(--muted); }
.table-wrap select { min-height: 34px; padding: 4px 8px; }
th button.sort { all: unset; cursor: pointer; font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; }
th button.sort:focus-visible { outline: 3px solid var(--brand); }
th button.sort::after { content: ' \2195'; }
th[aria-sort="ascending"] button.sort::after { content: ' \2191'; }
th[aria-sort="descending"] button.sort::after { content: ' \2193'; }

/* calendar view */
.cal-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.cal-head h2 { min-width: 11ch; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal .dow { background: var(--card); text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); padding: 6px 2px; }
.cal .day { background: var(--card); min-height: 104px; padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal .day.other { background: var(--bg); }
.cal .day .n { font-size: .75rem; font-weight: 700; color: var(--muted); width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; }
.cal .day.today .n { background: var(--brand); color: var(--brand-ink); }
.cal .chip-card { font: inherit; font-size: .74rem; text-align: left; border: 0; border-left: 3px solid var(--brand); background: var(--soft); color: var(--ink); border-radius: 4px; padding: 2px 5px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.cal .chip-card.late { border-left-color: var(--bad); background: var(--bad-bg); }
.cal .chip-card.complete { border-left-color: var(--good); text-decoration: line-through; color: var(--muted); }
.cal .more { font-size: .72rem; color: var(--muted); }
@media (max-width: 700px) { .cal .day { min-height: 70px; } .cal .chip-card { font-size: .66rem; } }

/* the card view */
dialog.card-dialog { width: min(900px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: auto; }
.cd { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.cd-top { display: flex; gap: 10px; align-items: flex-start; }
.cd-top .grow { min-width: 0; }
.cd-top .tick { width: 22px; height: 22px; min-height: 0; margin: 9px 0 0; flex: none; }
.cd-top select { width: auto; min-height: 32px; padding: 4px 8px; }
.cd-top .btn { flex: none; }
.cd-top .row { gap: 6px; margin-top: 2px; }
.cd-title { font-size: 1.3rem; font-weight: 700; border-color: transparent; background: transparent; padding: 4px 8px; }
.cd-title:hover, .cd-title:focus { border-color: var(--line); background: var(--card); }
.cd-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 20px; }
@media (max-width: 760px) { .cd-grid { grid-template-columns: 1fr; } dialog.card-dialog { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; } }
.cd section { display: flex; flex-direction: column; gap: 8px; }
.cd h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cd aside { display: flex; flex-direction: column; gap: 16px; }
.pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pick label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; font-size: .85rem; }
.pick input { width: auto; min-height: 0; }
.pick .lbl-pick { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; opacity: .45; border: 0; background: none; padding: 0; font: inherit; }
.pick .lbl-pick[aria-pressed="true"] { opacity: 1; }
.pick .lbl-pick[aria-pressed="true"] .lbl { outline: 2px solid var(--ink); outline-offset: 1px; }
.check-row { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.check-row input[type="checkbox"] { width: 18px; height: 18px; flex: none; }
.check-row .text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.check-row.done .text { text-decoration: line-through; color: var(--muted); }
.check-row button { font: inherit; border: 0; background: none; color: var(--muted); cursor: pointer; }
.attach { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.attach:last-child { border-bottom: 0; }
.attach img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.attach .mark { width: 54px; height: 54px; border-radius: 8px; background: var(--soft); display: grid; place-items: center; font-size: .7rem; font-weight: 800; color: var(--muted); flex: none; }
.attach .what { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.history li { padding: 6px 0; font-size: .85rem; }

/* notes */
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.note-card { text-align: left; font: inherit; color: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.note-card:hover { border-color: var(--brand); }
.note-card .snip { color: var(--muted); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-body { white-space: pre-wrap; overflow-wrap: anywhere; }
textarea.note-edit { min-height: 260px; }

/* files */
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; }
.dropzone.over { border-color: var(--brand); background: var(--soft); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.thumb { padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--soft); cursor: pointer; aspect-ratio: 1 / 1; position: relative; display: block; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .cap { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(10, 15, 22, .72); color: #fff; font-size: .72rem; padding: 3px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
dialog.lightbox { width: min(1000px, calc(100vw - 16px)); }
.lightbox img { max-width: 100%; max-height: 72vh; display: block; margin: 0 auto; border-radius: 8px; }
.kindmark { display: inline-block; width: 40px; text-align: center; font-size: .66rem; font-weight: 800; color: var(--muted); background: var(--soft); border-radius: 6px; padding: 3px 0; margin-right: 8px; }
.meter { display: flex; flex-direction: column; gap: 4px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-row button { font: inherit; font-size: .85rem; font-weight: 600; border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.chips-row button[aria-pressed="true"] { background: var(--soft); color: var(--brand); border-color: var(--brand); }
.pending-files { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.pending-files li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }

/* quieter scrollbars for the sideways-scrolling bars on small screens */
.nav, .tabs, .board, .table-wrap { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* submissions: work handed in for review */
.submission { display: flex; flex-direction: column; gap: 10px; }
.submission h3 { font-size: 1.05rem; overflow-wrap: anywhere; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.sub-links { margin: 4px 0 0; padding-left: 18px; font-size: .9rem; overflow-wrap: anywhere; }
.sub-actions { flex-wrap: wrap; gap: 8px; }
.review { border-left: 4px solid var(--line); background: var(--soft); border-radius: 8px; padding: 8px 12px; font-size: .92rem; }
.review.approved { border-left-color: var(--good); }
.review.changes_requested { border-left-color: var(--warn); }
.review p { margin: 6px 0 0; }
