/* SCF Sale Calendar: the drawer (sale editor and draft), checklist, creatives, comments, activity, and the board view.
   One continuous sheet with hairlines between sections. No cards, no shadows except --shadow-drawer and --shadow-drag.
   Only transform and opacity animate; curves are --ease and --spring. */

/* 1. Drawer frame */
#drawer.dw-root { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
#drawer.dw-root:not(.is-ready) { visibility: hidden; }
.dw-backdrop {
  position: absolute; inset: 0;
  background: var(--veil);
  opacity: 0; transition: opacity 200ms var(--ease);
}
.dw {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: var(--drawer-w); max-width: 100vw;
  display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  box-shadow: var(--shadow-drawer);
  transform: translateX(100%); opacity: 0;
  transition: transform 200ms var(--ease), opacity 200ms var(--ease);
  outline: none;
}
#drawer.is-open { pointer-events: auto; }
#drawer.is-open .dw-backdrop { opacity: 1; }
#drawer.is-open .dw { transform: translateX(0); opacity: 1; transition: transform 260ms var(--ease), opacity 260ms var(--ease); }
.dw.is-dropping::after {
  content: ''; position: absolute; inset: 6px; pointer-events: none; z-index: 5;
  border: 2px dashed var(--accent-strong); border-radius: var(--r-lg);
}
.dw.is-pending .dw-scroll { opacity: .6; }

/* 2. Header */
.dw-head { flex: none; padding: 16px 24px 16px; border-bottom: 1px solid var(--rule); }
.dw-head-row { display: flex; align-items: center; gap: 12px; }
.dw-save { margin-left: auto; font: 500 12.5px/1 var(--f-ui); color: var(--muted); white-space: nowrap; }
.dw-save.is-loading { color: var(--ink-2); }
.dw-title {
  display: block; width: 100%; margin-top: 12px; padding: 4px 0;
  border: 0; border-bottom: 1px solid transparent; border-radius: 0; background: transparent;
  font: 700 22px/1.15 var(--f-display); letter-spacing: -.01em; color: var(--ink);
}
.dw-title::placeholder { color: var(--ghost); }
.dw-title:focus { outline: none; border-bottom-color: var(--ink); }
.dw-title:focus-visible { outline: none; }
.dw-head-meta { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.dw-status { flex: none; }
.dw-status select { width: auto; min-width: 118px; }
/* Long strings fade out over their last 18px instead of ending in a glyph; the right padding matches the fade so
   text that fits is never touched. The same recipe serves every truncating line in the drawer. */
.dw-range, .dw-slot-body .dw-slot-name, .dw-slot-meta, .dw-chooser-name, .cchip-title {
  white-space: nowrap; overflow: hidden; text-overflow: clip; padding-right: 18px;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 18px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 18px), transparent);
}
.dw-range { min-width: 0; }
.dw-ready { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.dw-ready-text { flex: none; font: 700 13px/1 var(--f-display); color: var(--ink); min-width: 96px; }
/* No track behind the fill: an empty grey rule reads as a scoring bar and says nothing true.
   The fill sits straight on the surface, so a sale with nothing ready draws nothing at all.
   A done sale turns the fill --good rather than faking a full width, so the rule and the
   figure beside it never disagree. */
.dw-ready-rule { flex: 1; height: 3px; border-radius: 2px; overflow: hidden; }
.dw-ready-fill { display: block; height: 100%; background: var(--accent-strong); transform-origin: left center; transform: scaleX(0); transition: transform 300ms linear; }
.dw-ready-rule.is-done .dw-ready-fill { background: var(--good); }

/* Kind chip and its menu */
.kchip {
  --kc: var(--k-other); --ki: var(--k-other-ink);
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px 0 12px; border-radius: 999px;
  background: var(--kc); color: var(--ki);
  font: 700 11px/1 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  transition: transform 120ms var(--ease);
}
.kchip .ic { width: 14px; height: 14px; }
.kchip:active { transform: scale(.97); }
.kchip-sm { height: 22px; padding: 0 8px; font-size: 10px; letter-spacing: .06em; }
.dw-kind:focus-visible { outline: 2px solid var(--ki); outline-offset: 2px; }
.dw-kind-wrap { position: relative; }
.dw-kind-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 3;
  min-width: 200px; padding: 6px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md);
  display: flex; flex-direction: column; gap: 2px;
  transform-origin: top left;
}
/* Each row carries its kind colour as a 3px left rule, the same device as the quarter view's group labels. */
.dw-kind-menu > button {
  --kc: var(--k-other); --ki: var(--k-other-ink);
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 10px; border-radius: var(--r-sm);
  border-left: 3px solid var(--kc);
  font: 500 13.5px/1 var(--f-ui); color: var(--ink); text-align: left;
}
.dw-kind-menu > button[aria-checked="true"] { background: var(--linen-2); }

/* 3. Scroll body and sections */
.dw-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent; }
.dw-sec { padding: 20px 24px; border-bottom: 1px solid var(--rule); }
.dw-sec > .eyebrow, .dw-sec-head { margin-bottom: 12px; }
.dw-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.dw-sec-head .eyebrow { margin: 0; }
.dw-sec-count { font: 700 12px/1 var(--f-display); color: var(--muted); }
.dw-empty { color: var(--muted); font-size: 13.5px; padding: 6px 0; margin: 0; list-style: none; }

/* Fields inside the drawer: label above, compact input */
.dw-f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.dw-f-label { font: 500 12px/1.2 var(--f-ui); color: var(--muted); }
.input-sm { height: 34px; padding: 0 10px; font-size: 13.5px; }
select.input-sm { padding-right: 28px; }
/* Dates on one row, times on the next: a native time control needs about 130px for "07:15 AM" and four across a 512px measure clipped it. */
.dw-grid4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.dw-grid4 .input-sm { padding: 0 6px 0 8px; font-size: 13px; }
.dw-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dw-grid-offer { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dw-grid-dup { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dw-f-wide { grid-column: 1 / -1; }
.dw-f-grow { flex: 1; }
.dw-when-line { margin-top: 10px; color: var(--muted); font-size: 13px; }
.dw-when-line:empty { display: none; }
.dw-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.dw-inline-err { margin: 8px 0 0; }
.dw-inline-err:empty { display: none; }

/* 4. Offer: scope and collections */
.dw-scope { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.dw-colls { margin-top: 12px; }
.dw-coll-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dw-coll-none { font-size: 13px; color: var(--muted); }
.cchip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 4px 0 10px; border-radius: 999px;
  background: var(--linen-2); border: 1px solid var(--rule);
  font: 500 12.5px/1 var(--f-ui); color: var(--ink);
  max-width: 100%;
}
.cchip-title { margin-right: -10px; }
.cchip-x { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; color: var(--muted); transition: transform 120ms var(--ease); }
.cchip-x .ic { width: 12px; height: 12px; }
.cchip-x:active { transform: scale(.9); }
.dw-coll-search { position: relative; }
.dw-coll-ic { position: absolute; left: 10px; top: 9px; color: var(--muted); display: flex; pointer-events: none; }
.dw-coll-q { padding-left: 32px; }
.dw-coll-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 4;
  max-height: 280px; overflow-y: auto; padding: 4px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md);
}
.dw-coll-results > button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; padding: 8px 10px; border-radius: var(--r-sm); text-align: left;
}
.dw-coll-results > button[aria-selected="true"] { background: var(--linen-2); }
.dw-coll-title { font: 500 13.5px/1.2 var(--f-ui); color: var(--ink); }
.dw-coll-sub { font: 400 12px/1.2 var(--f-ui); color: var(--muted); }
.dw-coll-empty { padding: 8px 10px; font-size: 13px; color: var(--muted); }

/* 5. Channel toggle chips. Each chip carries the fixed channel colour of contract 13.3 in --chc, the same
      value calendar.css gives that channel's bubble, so the drawer and the grid agree about what colour
      Meta ads is. The literal is only a fallback for a page loaded without calendar.css. */
.dw-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tchip {
  --chc: var(--rule-2);
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px 0 10px; border-radius: 999px;
  border: 1px solid var(--rule-2); background: transparent; color: var(--ink-2);
  font: 500 13px/1 var(--f-ui);
  transition: transform 120ms var(--ease);
}
.tchip[data-channel="email"] { --chc: var(--ch-email, #2F6099); }
.tchip[data-channel="sms"] { --chc: var(--ch-sms, #5F7D6A); }
.tchip[data-channel="site"] { --chc: var(--ch-site, #8A6A1F); }
.tchip[data-channel="meta"] { --chc: var(--ch-meta, #B34A38); }
.tchip[data-channel="instagram"] { --chc: var(--ch-instagram, #7A4A7E); }
.tchip[data-channel="google"] { --chc: var(--ch-google, #4A7C8C); }
.tchip .ic { width: 15px; height: 15px; }
.tchip:active { transform: scale(.97); }
/* Selected: a 3px left rule in the channel colour, a hairline of the same hue and a faint wash of it.
   The left padding drops by the 2px the rule gains, so the icon never moves when a chip is switched on. */
.tchip[aria-pressed="true"] {
  background: color-mix(in srgb, var(--chc) 14%, transparent);
  border-color: var(--chc); border-left-width: 3px; padding-left: 8px;
  color: var(--ink);
}
.tchip[aria-pressed="true"] .ic { color: var(--chc); }

/* 6. Owner */
.dw-owner-row { display: flex; align-items: center; gap: 12px; }
/* Nobody owns it yet, so no chip is drawn and the row does not carry an empty disc. */
.dw-owner-chip:empty { display: none; }
.dw-owner-row .chip { width: 34px; height: 34px; font-size: 12px; }

/* 7. Checklist */
.dw-task-list { list-style: none; margin: 0 -8px; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.dw-task {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 8px; border-radius: var(--r-sm);
  background: var(--paper);
  transition: transform 160ms var(--ease);
}
.dw-task-list.is-reordering .dw-task { transition: transform 160ms var(--ease); }
.dw-task.is-dragging { position: relative; z-index: 2; box-shadow: var(--shadow-drag); transition: none; background: var(--paper); }
.dw-task-grip { display: flex; align-items: center; justify-content: center; width: 20px; height: 24px; margin-left: -4px; color: var(--ghost); cursor: grab; touch-action: none; border-radius: var(--r-sm); flex: none; }
.dw-task-grip .ic { width: 16px; height: 16px; }
.dw-task.is-dragging .dw-task-grip { cursor: grabbing; }
.dw-task-check {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 18px; height: 18px; margin: 3px 0 0; border-radius: var(--r-sm);
  border: 1.5px solid var(--rule-2); background: var(--paper);
  display: inline-grid; place-content: center; cursor: pointer;
  transition: transform 120ms var(--ease);
}
.dw-task-check::before {
  content: ''; width: 10px; height: 10px;
  background: var(--linen);
  clip-path: polygon(14% 44%, 0 62%, 40% 100%, 100% 22%, 84% 8%, 40% 66%);
  transform: scale(.4); opacity: 0; transition: transform 140ms var(--spring), opacity 100ms var(--ease);
}
.dw-task-check:checked { background: var(--ink); border-color: var(--ink); }
.dw-task-check:checked::before { transform: scale(1); opacity: 1; }
.dw-task-check:active { transform: scale(.9); }
.dw-task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dw-task-label { display: block; width: 100%; text-align: left; font: 400 14px/1.45 var(--f-ui); color: var(--ink); border-radius: var(--r-sm); padding: 1px 4px; margin-left: -4px; }
.dw-task.is-done .dw-task-label { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--rule-2); }
.dw-task-meta { font: 400 12px/1.2 var(--f-ui); color: var(--muted); }
.dw-task-edit { height: 30px; }
.dw-task-del { opacity: 0; flex: none; color: var(--muted); width: 28px; height: 28px; }
.dw-task:focus-within .dw-task-del, .dw-task-del:focus-visible { opacity: 1; }
.dw-task-add { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 4px 0 0; }
.dw-task-add-ic { display: flex; color: var(--muted); width: 20px; justify-content: center; }
.dw-task-add-input { flex: 1; min-width: 0; height: 34px; border: 0; border-bottom: 1px solid var(--rule); background: transparent; padding: 0 4px; font: 400 14px/1 var(--f-ui); color: var(--ink); }
.dw-task-add-input::placeholder { color: var(--ghost); }
.dw-task-add-input:focus { outline: none; border-bottom-color: var(--ink); }
.dw-task-add-btn { opacity: 0; }
.dw-task-add:focus-within .dw-task-add-btn { opacity: 1; }

/* 8. Creatives */
.dw-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dw-slot { position: relative; border: 1px solid var(--rule); border-radius: var(--r-md); overflow: hidden; background: var(--paper); min-width: 0; }
.dw-slot-prog { position: absolute; left: 0; right: 0; top: 0; height: 2px; z-index: 2; pointer-events: none; }
.dw-slot-prog i { display: block; height: 100%; background: var(--accent-strong); transform-origin: left center; transform: scaleX(0); transition: transform 120ms linear; opacity: 0; }
.dw-slot-prog i.is-live { opacity: 1; }
.dw-slot.is-empty { border-style: dashed; border-color: var(--rule-2); }
.dw-slot-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 150px; padding: 16px 12px; text-align: center; cursor: pointer;
  transition: transform 120ms var(--ease);
}
.dw-slot-drop:active { transform: scale(.985); }
.dw-slot.is-empty:focus-within { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.dw-slot-ic { display: flex; color: var(--ghost); margin-bottom: 4px; }
.dw-slot-ic .ic { width: 20px; height: 20px; }
.dw-slot-name { font: 700 13px/1.2 var(--f-display); color: var(--ink); max-width: 100%; }
.dw-slot.is-empty .dw-slot-name { white-space: normal; overflow-wrap: anywhere; }
.dw-slot-hint { font: 400 12px/1.2 var(--f-ui); color: var(--muted); }
.dw-slot-cta { margin-top: 6px; font: 500 12px/1.2 var(--f-ui); color: var(--accent-strong); }
.dw-slot.is-pending-upload .dw-slot-cta { color: var(--muted); }
.dw-slot-media { display: block; aspect-ratio: 4 / 3; background: var(--linen-2); overflow: hidden; }
.dw-slot-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dw-slot-glyph { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--muted); }
.dw-slot-glyph .ic { width: 36px; height: 36px; }
.dw-slot-body { padding: 10px 10px 10px; display: flex; flex-direction: column; gap: 3px; }
.dw-slot-meta { font: 400 11.5px/1.3 var(--f-ui); color: var(--muted); }
.dw-slot-row { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.dw-slot-status { flex: 1; min-width: 0; height: 30px; padding: 0 24px 0 8px; font-size: 12.5px; background-position: right 6px center; }
.dw-slot-row .btn-icon { width: 30px; height: 30px; color: var(--muted); }
.dw-slot-err { padding: 0 10px 8px; }
.dw-slot-err:empty { display: none; }
.dw-cre-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.dw-cre-hint { font-size: 12.5px; color: var(--muted); }
.dw-link-form, .dw-chooser { margin-top: 12px; padding: 14px; border: 1px solid var(--rule); border-radius: var(--r-md); }
.dw-link-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dw-link-form .dw-form-actions, .dw-link-form .dw-inline-err { grid-column: 1 / -1; margin-top: 0; }
.dw-chooser-file { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font: 500 13px/1.3 var(--f-ui); color: var(--ink); }
.dw-chooser-ic { display: flex; color: var(--muted); }
.dw-chooser-name { flex: 1; min-width: 0; }
.dw-chooser-count { color: var(--muted); font-size: 12px; }

/* 9. Notes */
.dw-notes-input { min-height: 72px; resize: none; overflow: hidden; }

/* 10. Comments */
.dw-comment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.dw-comment { display: flex; gap: 10px; }
/* A comment the server has not answered on yet: readable, plainly not landed, and no delete button on it. */
.dw-comment.is-pending { opacity: .55; }
.dw-comment-chip .chip { width: 28px; height: 28px; }
.dw-comment-main { flex: 1; min-width: 0; }
.dw-comment-head { display: flex; align-items: baseline; gap: 8px; }
.dw-comment-name { font: 700 13px/1.2 var(--f-display); color: var(--ink); }
.dw-comment-time { font: 400 12px/1.2 var(--f-ui); color: var(--muted); }
.dw-comment-del { margin-left: auto; opacity: 0; color: var(--muted); display: inline-flex; padding: 2px; border-radius: var(--r-sm); }
.dw-comment-del .ic { width: 14px; height: 14px; }
.dw-comment:focus-within .dw-comment-del, .dw-comment-del:focus-visible { opacity: 1; }
.dw-comment-body { margin-top: 2px; overflow-wrap: anywhere; }
.dw-composer { display: flex; align-items: flex-end; gap: 10px; margin-top: 16px; }
.dw-composer-chip .chip { width: 28px; height: 28px; margin-bottom: 3px; }
.dw-composer-input { flex: 1; min-width: 0; min-height: 40px; height: 40px; padding: 9px 12px; resize: none; overflow: hidden; }
.dw-composer-hint { margin-top: 6px; padding-left: 38px; font-size: 12px; color: var(--muted); }

/* 11. Activity */
.dw-activity { border-bottom: 0; }
.dw-activity-toggle { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; margin-left: -10px; border-radius: var(--r-sm); font: 500 13px/1 var(--f-ui); color: var(--ink-2); transition: transform 120ms var(--ease); }
.dw-activity-toggle:active { transform: scale(.97); }
.dw-activity-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; }
.dw-act { display: flex; gap: 12px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--rule); font: 400 13px/1.4 var(--f-ui); color: var(--ink-2); }
.dw-act:first-child { border-top: 0; }
.dw-act-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dw-act-time { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* 12. Footer */
.dw-foot { flex: none; padding: 12px 24px; border-top: 1px solid var(--rule); background: var(--paper); }
.dw-foot-row { display: flex; align-items: center; gap: 8px; }
.dw-foot-gap { flex: 1; }
.dw-delete { color: var(--bad); }
.dw-dup-panel { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rule); }
.dw-dup-panel > .dw-f-label { margin-bottom: 10px; color: var(--ink-2); }

/* 13. Draft mode */
.dw-head-draft .dw-draft-h { margin-top: 12px; }
.dw-draft { padding: 20px 24px 32px; display: flex; flex-direction: column; gap: 16px; }
.dw-kind-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
/* Six buttons at full strength: an unchosen kind is paper with a hairline and its colour as a 3px left rule,
   the chosen one takes the kind fill. */
.dw-kind-pick {
  --kc: var(--k-other); --ki: var(--k-other-ink);
  display: flex; align-items: flex-end; min-height: 76px; padding: 12px 14px;
  border-radius: var(--r-md); border: 1px solid var(--rule); border-left: 3px solid var(--kc);
  background: var(--paper); color: var(--ink);
  font: 700 15px/1.15 var(--f-display); letter-spacing: -.01em; text-align: left;
  transition: transform 120ms var(--ease);
}
.dw-kind-pick[aria-checked="true"] { background: var(--kc); color: var(--ki); border-color: var(--kc); }
.dw-kind-pick:active { transform: scale(.97); }
.dw-draft-range { min-height: 20px; }
.dw-draft-note { font-size: 12.5px; color: var(--muted); }

/* 14. Board view: every column is a well on linen 2, cards sit on paper inside it with no border,
       and each card carries its kind as a 3px left rule. */
.board-root { display: flex; flex-direction: column; min-height: calc(100vh - var(--topbar-h)); }
.bd-scroll { flex: 1; overflow-x: auto; overflow-y: hidden; padding: 20px 24px 24px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent; }
.bd-cols { display: flex; gap: 16px; align-items: flex-start; min-height: calc(100vh - var(--topbar-h) - 44px); }
.bd-col {
  flex: 0 0 236px; display: flex; flex-direction: column;
  min-height: 100%; max-height: calc(100vh - var(--topbar-h) - 44px);
  padding: 8px; border-radius: var(--r-md); background: var(--linen-2);
  transition: opacity 120ms var(--ease);
}
.bd-col-head { display: flex; align-items: center; gap: 8px; padding: 6px 6px 12px; text-align: left; width: 100%; }
.bd-col-name { font: 700 11px/1.2 var(--f-ui); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.bd-col-count { font: 700 12px/1 var(--f-display); color: var(--ink); }
.bd-col[data-status="live"] .bd-col-name { color: var(--accent-strong); }
.bd-col[data-status="done"] .bd-col-name { color: var(--good); }
.bd-col-toggle { border-radius: var(--r-sm); }
.bd-col-toggle .ic { margin-left: auto; color: var(--muted); width: 16px; height: 16px; }
.bd-col-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 0 4px; scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent; }
.bd-col.is-over { outline: 2px dashed var(--accent-strong); outline-offset: 2px; }
/* Cancelled folds to a narrow well that is only its header, read the same way as every other column. */
.bd-col-cancelled.is-collapsed { flex: 0 0 auto; min-height: 0; }
.bd-col-cancelled.is-collapsed .bd-col-head { padding-bottom: 6px; gap: 10px; }
.bd-col-cancelled.is-collapsed .bd-col-body { display: none; }
.bd-col-cancelled .bd-card { opacity: .6; }
.bd-col-cancelled .bd-title { text-decoration: line-through; }
.bd-empty { margin: 2px 6px 6px; font: 400 13px/1.4 var(--f-ui); color: var(--ghost); }
.bd-skel { height: 96px; border-radius: var(--r-sm); background: var(--paper); }
.bd-card {
  --kc: var(--k-other); --ki: var(--k-other-ink);
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 12px 10px 14px; border: 0; border-radius: var(--r-sm);
  background: var(--paper); cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none;
  outline: 1px solid transparent; outline-offset: 0;
  transition: opacity 160ms var(--ease);
}
.bd-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--kc); border-radius: var(--r-sm) 0 0 var(--r-sm); }
.bd-card:focus-visible { outline: 1px solid var(--accent-strong); outline-offset: 0; }
.bd-card.is-dragging { z-index: 3; cursor: grabbing; box-shadow: var(--shadow-drag); transition: none; }
.bd-card.is-settling { transition: transform 200ms var(--spring); }
.bd-card.is-dim { opacity: .15; }
.bd-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bd-files { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; font: 700 12px/1 var(--f-display); color: var(--muted); }
.bd-files .ic { width: 14px; height: 14px; }
.bd-title { margin: 2px 0 0; font: 700 15px/1.2 var(--f-display); letter-spacing: -.01em; color: var(--ink); overflow-wrap: anywhere; }
.bd-dates { font: 500 12.5px/1.3 var(--f-ui); color: var(--ink-2); }
/* The bubble row of contract 13.6. The bubbles themselves are drawn by ui.channelBubbles and styled once in
   calendar.css, so a channel reads the same on a card as it does in the month grid. */
.bd-marks { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 1px; }
.bd-foot { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.bd-ready { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.bd-ready-text { font: 700 12px/1 var(--f-display); color: var(--muted); }
.bd-ready-rule { display: block; height: 3px; border-radius: 2px; overflow: hidden; }
.bd-ready-rule i { display: block; height: 100%; background: var(--accent-strong); transform-origin: left center; transform: scaleX(0); }
.bd-ready-rule.is-done i { background: var(--good); }
.bd-foot .chip { width: 24px; height: 24px; font-size: 9.5px; }
.board-root.is-dragging .bd-card:not(.is-dragging) { pointer-events: none; }

/* 15. Hover states, fine pointers only */
@media (hover: hover) and (pointer: fine) {
  .dw-kind-menu > button:hover { background: var(--linen-2); }
  .dw-coll-results > button:hover { background: var(--linen-2); }
  .cchip-x:hover { background: var(--rule); color: var(--ink); }
  .tchip:not([aria-pressed="true"]):hover { border-color: var(--ink); color: var(--ink); }
  .tchip[aria-pressed="true"]:hover { background: color-mix(in srgb, var(--chc) 24%, transparent); }
  .dw-task:hover { background: var(--linen-2); }
  .dw-task:hover .dw-task-del { opacity: 1; }
  .dw-task-label:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
  .dw-task.is-done .dw-task-label:hover { text-decoration: line-through underline; }
  .dw-task-grip:hover { color: var(--ink-2); }
  .dw-slot.is-empty:hover { border-color: var(--accent-strong); }
  .dw-slot-media:hover .dw-slot-img { opacity: .92; }
  .dw-comment:hover .dw-comment-del { opacity: 1; }
  .dw-comment-del:hover { color: var(--bad); }
  .dw-activity-toggle:hover { background: var(--linen-2); color: var(--ink); }
  .dw-delete:hover { background: var(--bad-soft); }
  .bd-card:hover { outline-color: var(--accent-strong); }
  .bd-col-toggle:hover { background: var(--paper); }
  .dw-kind-pick:not([aria-checked="true"]):hover { background: var(--linen-2); border-color: var(--rule-2); border-left-color: var(--kc); }
  .dw-kind:hover { background: color-mix(in srgb, var(--kc) 82%, var(--ink)); }
}

/* 16. Narrow screens: full screen drawer, tighter grids */
@media (max-width: 1023.98px) {
  .dw { width: 100%; max-width: none; box-shadow: none; }
  .dw-head, .dw-sec, .dw-foot { padding-left: 16px; padding-right: 16px; }
  .dw-grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dw-foot-row .btn span { display: none; }
  .dw-foot-row .btn-secondary, .dw-foot-row .btn-ghost { width: 40px; padding: 0; }
  .dw-task-del, .dw-comment-del, .dw-task-add-btn { opacity: 1; }
  .bd-scroll { padding: 12px; }
  .bd-col { flex-basis: 216px; }
  body.drawer-open { overflow: hidden; }
}
@media (max-width: 479.98px) {
  .dw-slots { grid-template-columns: 1fr; }
  .dw-grid-offer, .dw-link-form, .dw-grid-dup { grid-template-columns: 1fr; }
  .dw-kind-grid { grid-template-columns: 1fr; }
}

/* 17. Reduced motion: remove travel, keep opacity */
@media (prefers-reduced-motion: reduce) {
  .dw { transform: none; transition: opacity 160ms var(--ease); }
  #drawer.is-open .dw { transform: none; transition: opacity 200ms var(--ease); }
  .dw-ready-fill, .dw-slot-prog i, .bd-ready-rule i { transition: none; }
  .dw-task, .dw-task-list.is-reordering .dw-task { transition: none; }
  .dw-task-check::before { transition: none; }
  .kchip:active, .tchip:active, .cchip-x:active, .dw-task-check:active, .dw-slot-drop:active, .dw-activity-toggle:active, .dw-kind-pick:active { transform: none; }
  .bd-card.is-settling { transition: none; }
  .dw-save.is-loading { animation: none; opacity: .7; }
}
