/* Groups / boards. Uses the same tokens, glass and radii as style.css. */
/* The page keeps the site's 1120px column, so the rail and title line up on every page. The board alone
   scrolls sideways out to the window's right edge, starting on the page's left edge. */
body { overflow-x: clip; }
.seg button i { margin-right: 2px; }

.board-bar { display: flex; gap: var(--sp-sm); align-items: center; margin-bottom: var(--sp-md); }
/* The group switcher hugs its tabs (scrolling when there are many); New group sits at the far end. */
.board-bar .seg { flex: 0 1 auto; min-width: 0; margin: 0; }
.board-bar .btn { flex: none; min-height: 44px; margin-left: auto; padding: 0 var(--sp-md); }
.board-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-sm) var(--sp-md); margin-bottom: var(--sp-md); }
.board-head h2 { flex: 1; margin: 0; font-size: 28px; letter-spacing: -.02em; min-width: 0; overflow-wrap: anywhere; }

.avatars { display: flex; }
.avatar { width: 32px; height: 32px; margin-left: -8px; box-shadow: 0 0 0 1px var(--glass-edge); display: grid; place-items: center; border-radius: 50%; font-size: 13px; font-weight: 700; color: var(--accent-fill); background: rgb(102 162 215 / .28); border: 2px solid var(--bg); }
.avatar:first-child { margin-left: 0; }
.avatar.sm { width: 24px; height: 24px; margin: 0; font-size: 11px; border-width: 1px; border-color: var(--glass-edge); }
@media (prefers-color-scheme: dark) { .avatar { color: var(--brand); } }

/* Columns scroll sideways, like Trello */
.board { display: flex; gap: var(--sp-md); align-items: flex-start; overflow-x: auto; margin-right: calc((100% - 100vw) / 2); padding-right: var(--sp-md); padding-bottom: var(--sp-md); scroll-snap-type: x proximity; overscroll-behavior-x: contain; scrollbar-color: var(--faint) transparent; scrollbar-width: thin; }
.col { flex: 1 1 280px; min-width: min(280px, 84vw); scroll-snap-align: start; padding: 6px; display: grid; gap: var(--sp-sm); max-height: calc(100dvh - 220px); grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
.col.add-col { flex: 0 0 min(280px, 84vw); }
.col-head { display: flex; align-items: center; gap: var(--sp-xs); padding: var(--sp-xs) var(--sp-xs) 0; }
.col-title { flex: 1; min-width: 0; font: inherit; font-weight: 700; color: var(--fg); background: transparent; border: 0; border-radius: 8px; padding: 6px 8px; }
.col-title { transition: background-color 160ms, box-shadow 160ms; }
.col-title:focus-visible { background: var(--field); outline: none; box-shadow: var(--ring); }
.count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--line); font-size: 12px; font-weight: 600; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.cards { display: grid; gap: var(--sp-sm); align-content: start; overflow-y: auto; overscroll-behavior: contain; padding: 2px; min-height: 8px; border-radius: var(--r-control); transition: background-color 160ms var(--ease-out); }
.cards.over { background: color-mix(in srgb, var(--pg, var(--brand)) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pg, var(--brand)) 50%, transparent); }

.card { display: grid; gap: 6px; padding: 10px 12px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-control); box-shadow: var(--shadow-sm); cursor: grab; transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .card:hover { transform: translateY(-1px); box-shadow: var(--glass-shadow); } }
.card:active { cursor: grabbing; }
.card.dragging { opacity: .45; transform: scale(.98); user-select: none; -webkit-user-select: none; }
.card .title { overflow-wrap: anywhere; }
.card.done .title { color: var(--muted); text-decoration: line-through; }
.card-foot { display: flex; font-variant-numeric: tabular-nums; align-items: center; gap: var(--sp-sm); min-height: 24px; }
.card-foot .grow { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; color: #fff; width: fit-content; }
.chip.due { background: transparent; color: var(--muted); padding: 2px 0; font-weight: 600; }
.chip.due.over { color: var(--bad); }
.chip.due.ok { background: var(--good); color: var(--on-good); padding: 2px 8px; }
/* Label colors are data colors, picked from the label text */
.lab-0 { background: #b05a14; } .lab-1 { background: #217044; } .lab-2 { background: #7345b8; }
.lab-3 { background: #2f6da3; } .lab-4 { background: #b03459; } .lab-5 { background: #536b7a; }

.add-card { display: flex; align-items: center; gap: var(--sp-sm); width: 100%; min-height: 40px; padding: 0 var(--sp-sm); border-radius: var(--r-control); color: var(--muted); font-weight: 600; transition: background-color 160ms, color 160ms, transform 160ms var(--ease-out); }
.add-card:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) { .add-card:hover { background: var(--line); color: var(--fg); } }
.inline-add { display: grid; gap: var(--sp-sm); animation: panel-in 160ms var(--ease-out) both; }
.inline-add .field { min-height: 40px; }
.inline-add .row { display: flex; gap: var(--sp-sm); align-items: center; }

/* Dialogs: modals stay centered. Enter is a little slower than exit (180ms vs 130ms), both ease-out. */
dialog {
  color: var(--fg); padding: var(--sp-lg); width: min(420px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  overflow-y: auto; overscroll-behavior: contain;
  opacity: 0; transform: scale(.96) translateY(6px);
  transition: opacity 130ms var(--ease-out), transform 130ms var(--ease-out), overlay 130ms allow-discrete, display 130ms allow-discrete;
}
dialog[open] { opacity: 1; transform: none; transition-duration: 180ms; }
@starting-style { dialog[open] { opacity: 0; transform: scale(.96) translateY(6px); } }
dialog::backdrop { background: rgb(10 15 25 / 0); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); transition: background-color 130ms, backdrop-filter 130ms, overlay 130ms allow-discrete, display 130ms allow-discrete; }
dialog[open]::backdrop { background: rgb(10 15 25 / .42); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); transition-duration: 180ms; }
@starting-style { dialog[open]::backdrop { background: rgb(10 15 25 / 0); backdrop-filter: blur(0); } }
@media (prefers-reduced-transparency: reduce) { dialog.glass { background: var(--bg); } }
dialog form { display: grid; gap: var(--sp-sm); }
dialog h3 { margin: 0 0 var(--sp-xs); font-size: 22px; letter-spacing: -.01em; }
dialog label, .label-s { font-size: 13px; font-weight: 600; color: var(--muted); }
.label-s { margin-top: var(--sp-sm); text-transform: uppercase; letter-spacing: .04em; font-size: 12px; font-weight: 800; }
dialog select.field { appearance: auto; }
.row-check { display: flex; align-items: center; gap: var(--sp-sm); color: var(--fg); font-size: 15px; margin-top: var(--sp-xs); }
.row-check input { width: 20px; height: 20px; accent-color: var(--good); }
dialog .actions { display: flex; align-items: center; gap: var(--sp-sm); margin-top: var(--sp-md); }
.grow { flex: 1; }
.btn.ghost { background: var(--line); color: var(--fg); box-shadow: none; }
.btn.danger-btn { background: transparent; color: var(--bad); padding: 0 var(--sp-md); box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .btn.danger-btn:hover { background: var(--line); filter: none; } }
.list-plain { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-xs); }
.list-plain li { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.list-plain .person { flex: none; }
.list-plain .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.list-plain .tag { font-size: 12px; color: var(--muted); }
.btn.small { min-height: 34px; padding: 0 var(--sp-md); font-size: 14px; }

@media (max-width: 640px) {
  .board-head h2 { flex-basis: 100%; }
  .col { max-height: none; }
}

.toast { position: fixed; box-shadow: var(--glass-shadow); left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 10px 18px; border-radius: 999px; font-weight: 600; z-index: 10; display: flex; align-items: center; gap: var(--sp-md); animation: toast-in 220ms var(--ease-out) both; }
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(8px); } }
.toast-action { font-weight: 700; color: var(--brand); padding: 2px 4px; border-radius: 8px; }
@media (hover: hover) and (pointer: fine) { .toast-action:hover { text-decoration: underline; text-underline-offset: 3px; } }

.avatar, .person { overflow: hidden; }
.avatar img, .person img { width: 100%; height: 100%; object-fit: cover; display: block; }

.finished-mark { color: var(--good); font-size: 20px; display: grid; place-items: center; padding-left: var(--sp-xs); }
.inline-add select.field, dialog select.field { appearance: auto; }

/* The card being carried under a finger (touch drag) */
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 30; margin: 0; pointer-events: none; cursor: grabbing; box-shadow: var(--glass-shadow); transition: none; }
@media (pointer: coarse) { .card { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } }

/* My to-dos tray */
.tray { padding: 10px; }
.tray-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-sm); }
.tray-list:empty { display: none; }
.tray-item { display: flex; align-items: center; gap: 6px; max-width: min(100%, 320px); padding: 8px 12px 8px 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-control); box-shadow: var(--shadow-sm); cursor: grab; touch-action: manipulation; transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out); }
.tray-item:active { cursor: grabbing; }
.tray-item.dragging { opacity: .45; transform: scale(.98); }
.tray-item .grip { color: var(--faint); font-size: 18px; }
.tray-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray-due { flex: none; font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.tray-due.over { color: var(--bad); }
@media (hover: hover) and (pointer: fine) { .tray-item:hover { transform: translateY(-1px); box-shadow: var(--glass-shadow); } }
@media (pointer: coarse) { .tray-item { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } }

/* Reordering lists */
.col-grip { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--faint); font-size: 18px; cursor: grab; touch-action: manipulation; transition: background-color 160ms, color 160ms; }
.col-grip:active { cursor: grabbing; }
@media (hover: hover) and (pointer: fine) { .col-grip:hover { background: var(--line); color: var(--fg); } }
@media (pointer: coarse) { .col-grip { width: 36px; height: 36px; -webkit-touch-callout: none; user-select: none; } }
.col.dragging-col { opacity: .5; }
.col.drop-before { box-shadow: -6px 0 0 0 var(--brand), var(--glass-shadow); }
.col.drop-after { box-shadow: 6px 0 0 0 var(--brand), var(--glass-shadow); }

/* Settings: gear in the bottom-right corner opens the dialog */
.settings-fab { position: fixed; right: max(var(--sp-md), env(safe-area-inset-right)); bottom: max(var(--sp-md), env(safe-area-inset-bottom)); z-index: 15; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border-radius: 999px; color: var(--muted); font-size: 22px; transition: transform 160ms var(--ease-out), color 160ms; }
.settings-fab:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) { .settings-fab:hover { color: var(--fg); } }
.setting-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.setting-row .body { flex: 1; min-width: 0; }
.setting-row .meta { font-size: 13px; color: var(--muted); margin-top: 2px; text-wrap: pretty; }

/* List colors: a tint over the glass, set by data-hue on the column */
.col { position: relative; }
.col[data-hue] { background: linear-gradient(rgb(var(--tint) / .16), rgb(var(--tint) / .16)), var(--glass); border-color: rgb(var(--tint) / .38); }
.col[data-hue] .count { background: rgb(var(--tint) / .22); }
[data-hue="blue"] { --tint: 102 162 215; }
[data-hue="teal"] { --tint: 45 160 150; }
[data-hue="green"] { --tint: 60 170 110; }
[data-hue="amber"] { --tint: 215 160 40; }
[data-hue="orange"] { --tint: 225 120 50; }
[data-hue="red"] { --tint: 215 75 70; }
[data-hue="pink"] { --tint: 210 90 140; }
[data-hue="purple"] { --tint: 140 100 210; }
[data-hue="gray"] { --tint: 130 140 155; }
@media (prefers-reduced-transparency: reduce) { .col[data-hue] { background: linear-gradient(rgb(var(--tint) / .16), rgb(var(--tint) / .16)), var(--bg); } }

.col-color { width: 28px; height: 28px; font-size: 17px; }
@media (pointer: coarse) { .col-color { width: 36px; height: 36px; } }
.hue-pop { position: absolute; top: 44px; right: 6px; z-index: 6; background: color-mix(in srgb, var(--bg) 86%, #fff 14%); -webkit-backdrop-filter: none; backdrop-filter: none; display: grid; grid-template-columns: repeat(5, 28px); gap: 8px; padding: 10px; border-radius: var(--r-control); animation: panel-in 140ms var(--ease-out) both; }
.swatch { width: 28px; height: 28px; border-radius: 999px; background: rgb(var(--tint)); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15); transition: transform 160ms var(--ease-out); }
.swatch:active { transform: scale(.9); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg); }
.swatch.none { background: var(--field); box-shadow: inset 0 0 0 1px var(--faint); position: relative; }
.swatch.none::after { content: ""; position: absolute; left: 50%; top: 4px; bottom: 4px; width: 2px; margin-left: -1px; background: var(--faint); transform: rotate(45deg); border-radius: 1px; }
.swatch.none[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg); }
@media (pointer: coarse) { .hue-pop { grid-template-columns: repeat(5, 36px); } .swatch { width: 36px; height: 36px; } }
@media (hover: hover) and (pointer: fine) { .swatch:hover { transform: scale(1.08); } }

/* Public TV link controls */
.link-row { display: flex; gap: var(--sp-sm); align-items: center; margin-top: var(--sp-sm); }
.link-row .field { min-height: 40px; font-size: 13px; text-overflow: ellipsis; }
.link-actions { display: flex; align-items: center; gap: var(--sp-sm); margin-top: var(--sp-sm); }
a.btn { text-decoration: none; }
#publicOff { margin-top: var(--sp-sm); }
#slugRow { margin-top: var(--sp-md); }
.slug-prefix { flex: none; color: var(--muted); font-size: 13px; }

/* Cards for everyone in the group */
.avatar.everyone { background: var(--line); color: var(--fg); box-shadow: 0 0 0 1px var(--glass-edge); }
.avatar.sm.everyone i { font-size: 14px; }

/* Sort control in the board header */
.sort-by { flex: none; display: flex; align-items: center; gap: var(--sp-sm); font-size: 13px; font-weight: 700; color: var(--muted); }
.sort-by .field { flex: none; min-height: 36px; padding: 0 var(--sp-sm); font-size: 14px; font-weight: 600; }
.inline-add .field { width: 100%; }
@media (max-width: 480px) { .sort-by span { display: none; } }

.person-order { padding: 0; margin: 0; list-style: none; display: grid; gap: var(--sp-xs); }
.person-order-row { display: flex; align-items: center; gap: var(--sp-sm); }
.person-order-row > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.person-order-row button:disabled { opacity: .35; cursor: default; }

#calendarDetails { display: grid; gap: var(--sp-sm); }
.calendar-actions { display: flex; flex-wrap: wrap; gap: var(--sp-sm); }

#googleCalendarDetails { display: grid; gap: var(--sp-sm); }
#calendarSubscription summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; }
#calendarSubscription > .setting-row { margin-top: var(--sp-sm); }

.filter-section { border: 0; padding: 0; margin: var(--sp-xs) 0; min-width: 0; display: grid; gap: var(--sp-sm); }
.filter-section legend { padding: 0; margin-bottom: var(--sp-sm); font-weight: 700; }
.filter-options { display: grid; gap: var(--sp-xs); max-height: 180px; overflow-y: auto; }
.filter-options .row-check { margin: 0; min-height: 36px; overflow-wrap: anywhere; }
.filter-dates { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-sm); }
.filter-dates label { display: grid; gap: var(--sp-xs); min-width: 0; }
.filter-dates .field { width: 100%; min-width: 0; }
#boardFilterBtn.on { box-shadow: inset 0 0 0 1px var(--brand, #1d5fd8); }
