/* Slate app styles. Flat paper tiles, 1px hairlines, no shadows, no gradients, no accent colour. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 15px/1.45 var(--font-sans);
  padding-bottom: env(safe-area-inset-bottom);
  min-height: 100dvh; display: flex; flex-direction: column;
}
body > .hint { margin-top: auto; flex: none; }
body > main { flex: 1 0 auto; }

[hidden] { display: none !important; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 999px; z-index: 100; }
.skip:focus { top: 8px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* Mono labels */
.mono, .label, .pill, .btn, .frame, th {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
}
.label { color: var(--ink-2); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid var(--rule); border-radius: 999px; line-height: 1.3; background: transparent; white-space: nowrap; }
.pill.solid { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pill.on { border-color: var(--ink); }
button.pill { cursor: pointer; }
button.pill:hover { border-color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; border: 1px solid currentColor; display: inline-block; flex: none; }
.dot.on { background: currentColor; }

.btn { border: 1px solid var(--rule); background: transparent; border-radius: 999px; padding: 7px 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; min-height: 32px; transition: border-color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease), scale var(--dur-1) var(--ease); }
.btn:active:not(:disabled) { scale: .97; }
.btn:hover { border-color: var(--ink); }
.btn[aria-pressed="true"], .btn.solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.quiet { border-color: transparent; color: var(--ink-2); }
.btn.quiet:hover { color: var(--ink); border-color: var(--rule); }

input[type=text], input[type=search], input[type=date], input[type=datetime-local], input[type=time], select, textarea {
  background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; padding: 8px 12px; min-height: 36px; width: 100%;
}
select { width: auto; }
textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--ink); margin: 0; }

/* Shell */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--paper); border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.brand { font-family: var(--font-display); font-weight: 500; font-size: 20px; text-decoration: none; letter-spacing: -.01em; }
.crumbs { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.crumbs strong { color: var(--ink); font-weight: 500; }
.bar-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bar-tools input[type=search] { width: 200px; border-radius: 999px; font-size: 13px; min-height: 32px; padding: 5px 14px; }
.seg { display: inline-flex; gap: 4px; }
.hint { text-align: center; color: var(--ink-2); font: 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; padding: 32px 16px 56px; margin: 0; }
body.has-selbar > .hint { visibility: hidden; }
main { outline: none; }
.empty { color: var(--ink-2); padding: 40px 16px; text-align: center; font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.empty .btn { margin-top: 14px; }

.bottombar { display: none; }

/* Boards index */
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 32px 0 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 32px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.head-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.head-tools > .btn[data-act="import"] { min-height: 32px; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 0 0 24px; list-style: none; margin: 0; }
.board-card { border: 1px solid var(--rule); background: var(--paper-2); border-radius: var(--radius-tile); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-height: 168px; }
.board-card h2 { font-size: 20px; }
.board-card a.open { text-decoration: none; }
.board-card a.open:hover h2 { text-decoration: underline; text-underline-offset: 4px; }
.board-card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.board-card .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.new-board { display: flex; gap: 8px; padding: 0 0 24px; flex-wrap: wrap; }
.new-board input { max-width: 340px; }

/* Board toolbar */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 16px 0 8px; }
.toolbar select, .toolbar input { font-size: 13px; min-height: 32px; padding: 4px 12px; border-radius: 999px; }
.toolbar .grow { flex: 1; }
.title-row { display: flex; align-items: baseline; gap: 14px; padding-top: 24px; flex-wrap: wrap; }
.title-row h1 { font-size: 30px; }
.title-row h1 button { all: unset; cursor: text; }
.title-row h1 button:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 6px; }
.summary { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 10px; }

/* Lists and tiles */
.wall { display: flex; flex-direction: column; gap: 32px; padding: 20px 0 8px; }
.list { min-width: 0; }
.list-head { display: flex; align-items: baseline; gap: 12px; padding: 0 2px 10px; border-bottom: 1px solid var(--rule); margin-bottom: 12px; flex-wrap: wrap; }
.list-head h2 { font-size: 20px; }
.list-head h2 button { all: unset; cursor: text; }
.list-head h2 button:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 6px; }
.list-head .acts { margin-left: auto; display: flex; gap: 2px; flex-wrap: wrap; }
.list.archived { opacity: .7; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; align-items: start; min-height: 20px; }
.list-foot { grid-column: 1 / -1; color: var(--ink-2); padding: 6px 2px; }
.add-card { grid-column: 1 / -1; }
.add-card form { display: flex; gap: 8px; }
.composer { display: flex; gap: 8px; }

.tile {
  position: relative; border: 1px solid var(--rule); background: var(--paper-2); border-radius: var(--radius-tile);
  padding: 14px 16px 14px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; min-width: 0;
  user-select: none; -webkit-user-select: none;
  transition: border-color var(--dur-1) var(--ease), background-color var(--dur-2) var(--ease), scale var(--dur-1) var(--ease);
  touch-action: manipulation;
}
.tile:hover { border-color: var(--ink-2); }
.tile:active:not(.is-placeholder) { scale: .992; }
.tile:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.tile.archived { border-style: dashed; }
.tile .top { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.tile .top .grip { margin-left: auto; touch-action: none; cursor: grab; border: 0; background: none; color: var(--ink-2); padding: 4px 6px; border-radius: 8px; letter-spacing: .1em; }
.tile .cover { margin: -14px -16px 0; border-radius: var(--radius-tile) var(--radius-tile) 0 0; overflow: hidden; border-bottom: 1px solid var(--rule); aspect-ratio: 16 / 9; background: var(--paper); }
.tile .cover img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; opacity: 0; transition: opacity var(--dur-2) var(--ease); }
.tile .cover img.in { opacity: 1; }
.tile h3 { font-family: var(--font-sans); font-size: 15px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.tile .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* Lanes: horizontal */
.lanes { display: flex; gap: 16px; overflow-x: auto; padding: 20px 16px 16px; align-items: flex-start; }
.lanes .list { flex: 0 0 292px; border: 1px solid var(--rule); border-radius: var(--radius-tile); padding: 14px; }
.lanes .cards { grid-template-columns: 1fr; }
.lanes .list-head { margin-bottom: 12px; }

/* Compact list view */
.compact .cards { grid-template-columns: 1fr; gap: 6px; }
.compact .tile { flex-direction: row; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; flex-wrap: wrap; }
.compact .tile .cover { display: none; }
.compact .tile .top { order: 0; }
.compact .tile h3 { flex: 1; min-width: 160px; order: 1; }
.compact .tile .meta { order: 2; }

/* Table view */
.table-wrap { overflow-x: auto; padding: 20px 0; }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--rule); border-radius: var(--radius-tile); overflow: hidden; background: var(--paper-2); }
table.grid th, table.grid td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.grid th { color: var(--ink-2); font-weight: 400; white-space: nowrap; }
table.grid th button { all: unset; cursor: pointer; }
table.grid th button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover { background: var(--paper); }
table.grid tbody tr:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
table.grid td.t { min-width: 200px; font-weight: 500; }
table.grid .cell-pills { display: flex; gap: 4px; flex-wrap: wrap; }

/* Panel */
.scrim { position: fixed; inset: 0; z-index: 40; background: color-mix(in srgb, var(--ink) 28%, transparent); }
.panel {
  position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); overflow-y: auto;
  background: var(--paper); border-left: 1px solid var(--rule); padding: 18px 20px 40px;
  transition: transform var(--dur-3) var(--ease);
}
.panel.entering { transform: translateX(24px); }
.panel .p-head { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.panel .p-head .grow { flex: 1; }
.panel h2.title input { font-family: var(--font-display); font-size: 24px; font-weight: 500; border-color: transparent; background: transparent; padding: 6px 8px; margin-left: -8px; width: calc(100% + 8px); }
.panel h2.title input:hover { border-color: var(--rule); }
.panel section { border-top: 1px solid var(--rule); padding: 16px 0; }
.panel section > .label { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.panel .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.panel .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.panel .fields label { display: flex; flex-direction: column; gap: 4px; }
.panel .md { overflow-wrap: anywhere; }
.panel .md > :first-child { margin-top: 0; }
.panel .md > :last-child { margin-bottom: 0; }
.panel .md pre { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 12px; padding: 10px 12px; overflow-x: auto; }
.panel .md code { font-family: var(--font-mono); font-size: 12.5px; }
.panel .md blockquote { margin: 8px 0; padding-left: 12px; border-left: 1px solid var(--ink-2); color: var(--ink-2); }
.panel .md h1, .panel .md h2, .panel .md h3, .panel .md h4 { font-size: 17px; margin: 14px 0 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; }
.check.done span.txt { color: var(--ink-2); text-decoration: line-through; }
.check .txt { flex: 1; overflow-wrap: anywhere; }
.progress { height: 3px; background: var(--rule); border-radius: 2px; margin: 4px 0 10px; }
.progress i { display: block; height: 100%; background: var(--ink); border-radius: 2px; }
.cl { margin-bottom: 18px; }
.cl-head { display: flex; align-items: center; gap: 10px; }
.cl-head strong { font-weight: 500; flex: 1; }
.file { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.file:last-child { border-bottom: 0; }
.file .name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.file img { width: 48px; height: 36px; object-fit: cover; border-radius: 8px; border: 1px solid var(--rule); }
.comment { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.comment:last-of-type { border-bottom: 0; }
.comment .who { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { padding: 6px 0; display: flex; gap: 12px; align-items: baseline; border-bottom: 1px solid var(--rule); font-size: 13px; }
.activity li:last-child { border-bottom: 0; }
.activity time { color: var(--ink-2); white-space: nowrap; }
.error { border: 1px solid var(--ink); border-radius: 12px; padding: 8px 12px; margin: 10px 0; font-size: 13px; }

/* Phones: bottom bar, single column, sheet-style panel */
@media (max-width: 720px) {
  .bar { gap: 8px; padding: 8px 16px; }
  .crumbs { display: none; }
  .bar-tools { width: 100%; }
  .bar-tools input[type=search] { flex: 1; width: auto; }
  .bar-tools .seg { display: none; }
  .page-head h1, .title-row h1 { font-size: 26px; }
  .cards { grid-template-columns: 1fr; }
  .lanes .list { flex-basis: 84vw; }
  .panel { width: 100vw; border-left: 0; padding-bottom: 96px; }
  .panel .fields { grid-template-columns: 1fr; }
  .hint { display: none; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .bottombar {
    display: flex; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; background: var(--paper);
    border-top: 1px solid var(--rule); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); gap: 6px; justify-content: space-around;
  }
  .bottombar .btn { flex: 1; justify-content: center; }
}

/* Drag handle: visible on hover/focus for fine pointers, always for touch */
.tile .grip { opacity: 0; }
.tile:hover .grip, .tile:focus-visible .grip, .tile .grip:focus-visible { opacity: 1; }
@media (pointer: coarse) { .tile .grip { opacity: 1; padding: 10px 12px; } }

/* ---- page shell polish ---------------------------------------------------------------- */
.list-head { user-select: none; -webkit-user-select: none; }
.board-root { min-width: 0; }
.board-body { position: relative; }
.board-body.view-enter { animation: view-in var(--dur-3) var(--ease) backwards; }
.board-body[data-dir="1"] { --dx: 1; }
.board-body[data-dir="-1"] { --dx: -1; }
@keyframes view-in { from { opacity: 0; transform: translate3d(calc(var(--dx, 0) * 18px), 6px, 0); } to { opacity: 1; transform: none; } }
.fade-in { animation: fade-in var(--dur-2) var(--ease) backwards; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.tile-in { animation: tile-in var(--dur-2) var(--ease) backwards; }
@keyframes tile-in { from { opacity: 0; transform: translate3d(0, 8px, 0) scale(.98); } to { opacity: 1; transform: none; } }
.notice { margin: 8px 0 0; color: var(--ink-2); }
.empty { border: 1px dashed var(--rule); border-radius: var(--radius-tile); margin: 20px 0; }
main > .empty, main > .empty.wrap { border: 0; }
.board-card, .board-grid li { transition: border-color var(--dur-1) var(--ease), opacity var(--dur-2) var(--ease); }
.board-card:hover { border-color: var(--ink-2); }
.board-card a.open:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 8px; }
.tabs .btn, .seg .btn { min-height: 32px; }

/* Skeletons: same geometry as the real thing so nothing shifts when data arrives */
.sk { display: block; height: 12px; border-radius: 6px; background: var(--rule-strong); opacity: .22; animation: sk-pulse 1.1s var(--ease) infinite alternate; }
@keyframes sk-pulse { from { opacity: .14; } to { opacity: .34; } }
.sk.w30 { width: 30%; } .sk.w40 { width: 40%; } .sk.w50 { width: 50%; } .sk.w80 { width: 80%; }
.sk.h20 { height: 20px; } .sk.h30 { height: 34px; }
.sk.pillsk { display: inline-block; width: 84px; height: 22px; border-radius: 999px; }
.sk.pillsk.wide { width: 140px; height: 32px; }
.tile.skeleton { cursor: default; min-height: 112px; justify-content: flex-start; pointer-events: none; }
.board-head .summary .sk, .board-head .toolbar .sk { margin-right: 0; }
.board-card.skeleton { min-height: 168px; }

/* ---- tiles: selection, cover, tint, upload ------------------------------------------------- */
.tile[data-tinted] { background: color-mix(in srgb, rgb(var(--tint)) 15%, var(--paper-2)); }
.tile .top .sel-mark, .table-wrap .sel-mark { display: none; align-items: center; gap: 6px; color: var(--ink); }
.tile.selected { border-color: var(--ink); outline: 1px solid var(--ink); outline-offset: -5px; }
.tile.selected:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.tile.selected .top .sel-mark, tr.selected .sel-mark { display: inline-flex; }
.tile .sel-mark .dot { width: 7px; height: 7px; }
tr.selected td { background: var(--paper); }
tr.selected td:first-child { box-shadow: inset 2px 0 0 var(--ink); }
.tile.lifted { border-color: var(--ink); outline: 2px solid var(--ink); outline-offset: 3px; scale: 1.015; }
.tile.is-placeholder { border-style: dashed; border-color: var(--ink-2); background: transparent !important; outline: 0; }
.tile.is-placeholder > * { visibility: hidden; }
.tile.is-gathered { display: none; }
.list.is-placeholder-list { opacity: .4; }
.list.is-placeholder-list .list-head { border-bottom-style: dashed; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
body.is-dragging .tile:hover { border-color: var(--rule); }
.tile .grip { touch-action: none; }

.drop-note { display: none; position: absolute; inset: 0; z-index: 2; place-items: center; text-align: center; padding: 12px; border-radius: inherit; background: color-mix(in srgb, var(--paper) 94%, transparent); color: var(--ink); pointer-events: none; }
.tile.drop-target { border-style: dashed; border-color: var(--ink); }
.tile.drop-target .drop-note { display: grid; }
.tile .prog { display: none; position: absolute; left: 18px; right: 18px; bottom: 0; height: 2px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.tile .prog i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--ink); transition: width var(--dur-1) var(--ease); }
.tile.uploading .prog { display: block; }
.tile.uploading .cover img { opacity: .6; }

/* Drag ghost */
.ghost { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; will-change: transform; scale: 1; transition: scale var(--dur-1) var(--ease); }
.ghost.lifted { scale: 1.02; }
.ghost-body { position: relative; width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--paper-2); border: 1px solid var(--ink); border-radius: var(--radius-tile); cursor: grabbing; }
.ghost-body.tile { border-color: var(--ink); }
.ghost-body.tile[data-tinted] { background: color-mix(in srgb, rgb(var(--tint)) 15%, var(--paper-2)); }
.ghost-list .ghost-body { padding: 12px 16px; display: flex; align-items: baseline; gap: 12px; flex-wrap: nowrap; margin: 0; }
.ghost-list .ghost-body .acts { display: none; }
.ghost-under { position: absolute; inset: 0; border: 1px solid var(--rule); background: var(--paper-2); border-radius: var(--radius-tile); }
.ghost-under.u1 { transform: translate(7px, 7px); }
.ghost-under.u2 { transform: translate(14px, 14px); }
.ghost-count { position: absolute; z-index: 3; top: -10px; right: -10px; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: var(--ink); color: var(--paper); display: grid; place-items: center; font: 11px var(--font-mono); letter-spacing: .08em; }

/* Marquee */
.marquee { position: fixed; left: 0; top: 0; z-index: 80; pointer-events: none; will-change: transform; border: 1px solid var(--ink); border-radius: 6px; background: color-mix(in srgb, var(--ink) 6%, transparent); }
body.is-marquee, body.is-marquee * { user-select: none; -webkit-user-select: none; cursor: crosshair !important; }

/* Selection bar */
.selbar {
  position: fixed; z-index: 35; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); translate: -50% 0;
  display: flex; align-items: center; gap: 6px; padding: 8px 10px 8px 18px; background: var(--paper);
  border: 1px solid var(--ink); border-radius: 999px; max-width: calc(100vw - 24px);
  opacity: 0; transform: translate3d(0, 14px, 0); visibility: hidden;
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), visibility 0s linear var(--dur-2);
}
.selbar[data-on="1"] { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.selbar .selcount { margin-right: 6px; min-width: 62px; }
.selbar .btn { white-space: nowrap; }
.selpop { position: absolute; bottom: calc(100% + 10px); left: 0; min-width: 236px; max-width: min(320px, calc(100vw - 24px)); max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 12px; background: var(--paper); border: 1px solid var(--ink); border-radius: var(--radius-tile); }
.selpop .label { margin: 0 0 6px; }
.selpop .label.quiet { text-transform: none; letter-spacing: 0; font-family: var(--font-sans); font-size: 13px; }
.selpop .row { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer; transition: background-color var(--dur-1) var(--ease); }
.selpop .row:hover { background: var(--paper-2); }
.selpop .row:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.selpop .lbl { display: inline-flex; align-items: center; gap: 10px; }
.selpop .dot.half { border-width: 4px; }
.selpop .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.selpop input[type=date] { width: 100%; }

@media (max-width: 720px) {
  .selbar { bottom: calc(76px + env(safe-area-inset-bottom)); border-radius: var(--radius-tile); flex-wrap: wrap; justify-content: center; padding: 10px 12px; width: calc(100vw - 24px); }
  .selbar .selcount { width: 100%; text-align: center; margin: 0; }
  .selpop { left: 0 !important; right: 0; max-width: none; }
  .bottombar { gap: 4px; padding-left: 8px; padding-right: 8px; }
  .bottombar .btn { padding: 8px 4px; min-height: 42px; font-size: 10px; letter-spacing: .04em; }
  .tile .grip { padding: 12px 14px; }
}
@media (hover: none) {
  .tile:hover { border-color: var(--rule); }
}

/* Errors float over the page so they never push content around */
#toast { position: fixed; left: 50%; translate: -50% 0; top: 68px; z-index: 60; margin: 0; max-width: min(560px, calc(100vw - 24px)); background: var(--paper); animation: fade-in var(--dur-2) var(--ease) backwards; }
#note { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); translate: -50% 0; z-index: 60; padding: 9px 16px; border: 1px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink); font: 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; max-width: calc(100vw - 24px); pointer-events: none; opacity: 0; transition: opacity var(--dur-2) var(--ease), translate var(--dur-2) var(--ease); }
#note.in { opacity: 1; }
#note.out { opacity: 0; }
@media (max-width: 720px) { #note { bottom: calc(84px + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { #note { transition: none; } }
table.grid td .sel-mark { margin-left: 10px; }

/* Shared header: the same height and the same positions on every page, so nothing jumps when you navigate. */
.bar { min-height: 53px; flex-wrap: nowrap; box-sizing: border-box; }
.bar > * { flex: none; }
.bar > .crumbs { flex: 1 1 0; min-width: 0; }
.bar-nav { display: flex; gap: 4px; align-items: center; }
.bar-nav a { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; color: var(--ink-2); border: 1px solid transparent; border-radius: 999px; padding: 7px 13px; min-height: 32px; box-sizing: border-box; display: inline-flex; align-items: center; transition: color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease); }
.bar-nav a:hover { color: var(--ink); }
.bar-nav a[aria-current="page"] { color: var(--ink); border-color: var(--rule-strong); }
.bar-nav a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (max-width: 720px) { .bar { flex-wrap: wrap; } .bar-nav { order: 2; } }

/* Board reordering */
.board-card { position: relative; }
.board-grip { position: absolute; top: 10px; right: 10px; border: 0; background: none; color: var(--ink-2); padding: 6px 8px; border-radius: 8px; letter-spacing: .1em; font-size: 14px; line-height: 1; cursor: grab; touch-action: none; opacity: 0; transition: opacity var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.board-card:hover .board-grip, .board-grip:focus-visible, .board-grip[aria-pressed="true"] { opacity: 1; }
.board-grip:hover { color: var(--ink); }
.board-grip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.board-card.is-lifted { box-shadow: 0 0 0 1px var(--ink); z-index: 5; }
@media (pointer: coarse) { .board-grip { opacity: 1; padding: 10px 12px; } }

/* Visible select control on cards: click to add or remove a card from the selection */
.tile .top .sel-check { flex: none; width: 18px; height: 18px; padding: 0; margin: 0 8px 0 0; border: 1px solid var(--rule-strong); border-radius: 999px; background: transparent; cursor: pointer; opacity: 0; transition: opacity var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease); position: relative; }
.tile:hover .sel-check, .tile .sel-check:focus-visible, body.has-sel .tile .sel-check, .tile.selected .sel-check { opacity: 1; }
.tile .sel-check:hover { border-color: var(--ink); }
.tile .sel-check[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); }
.tile .sel-check[aria-pressed="true"]::after { content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid var(--paper); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.tile .sel-check:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (pointer: coarse) { .tile .top .sel-check { opacity: 1; width: 24px; height: 24px; } .tile .sel-check[aria-pressed="true"]::after { left: 8px; top: 4px; } }
.board-card:not(.skeleton) { cursor: grab; }
.board-card.dragging { opacity: .45; }
.board-ghost { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; will-change: transform; border: 1px solid var(--ink); background: var(--paper-2); border-radius: var(--radius-tile); padding: 10px 14px; display: grid; gap: 4px; }
.board-ghost strong { font: 500 15px var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-ghost-day { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
body.board-dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }
body.board-dragging * { cursor: grabbing !important; }
.board-drag-hint { margin: 4px 0 10px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
#home-calendar { min-height: 520px; }
.board-card:not(.skeleton) { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

/* Archived boards: tick several, then restore or delete them together */
.board-card { position: relative; }
.bsel { position: absolute; top: 14px; right: 14px; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 1px solid var(--ink-2); background: var(--paper); cursor: pointer; display: grid; place-items: center; }
.bsel:hover { border-color: var(--ink); }
.bsel[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); }
.bsel[aria-pressed="true"]::after { content: ""; width: 5px; height: 10px; border: solid var(--paper); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.bsel:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.board-card.picked { border-color: var(--ink); }
.arch-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; padding: 8px 10px 8px 16px; border: 1px solid var(--rule); border-radius: 999px; }
.arch-bar .arch-count { margin-right: 8px; min-width: 120px; }
.arch-bar .btn:disabled { opacity: .45; cursor: default; }

/* Phone header: brand and theme on one row, navigation under it, tools last */
@media (max-width: 720px) {
  .bar { row-gap: 4px; padding: 8px 16px 6px; }
  .bar > .brand { order: 0; }
  .bar > #who { order: 1; margin-left: auto; }
  .bar > [data-theme-toggle] { order: 1; margin-left: auto; }
  .bar > #who + [data-theme-toggle] { margin-left: 0; }
  .bar > .bar-nav { order: 2; width: 100%; margin: 0 -8px; gap: 0; }
  .bar > .bar-tools { order: 3; }
  .bar-nav a { padding: 6px 11px; }
}

/* Board due date in the board header: a pill that opens the date picker, plus a small remove button */
.board-due { display: inline-flex; align-items: center; gap: 4px; }
.board-due button.pill { font: inherit; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); cursor: pointer; min-height: 28px; }
.board-due button.pill.solid { color: var(--paper); }
.board-due button.pill:hover { border-color: var(--ink); color: var(--ink); }
.board-due button.pill.solid:hover { color: var(--paper); opacity: .9; }
.board-due button.pill:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.board-due .due-clear { padding: 3px 9px; }

/* Links in the header breadcrumb area (API, About) */
.crumbs a + a, .crumbs strong + a, .crumbs a + strong, .crumbs span + a, .crumbs span + strong { margin-left: 0; }
.crumbs a + a, .crumbs strong + a, .crumbs a + strong { margin-left: 16px; }
