/* IB Studio: the pipeline page (30 Oct rework: easy to read, with sections). Loaded after pages.css. */
.pipe { --col-bg: rgba(17, 17, 19, .032); }
:root[data-theme="dark"] .pipe { --col-bg: rgba(255, 255, 255, .035); }

/* ---------------------------------------------------------------- right now */
.ptiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.ptile { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 11px 13px; border: 0; border-radius: 14px; background: var(--paper); color: var(--ink); text-align: left; box-shadow: var(--card-shadow); cursor: pointer; transition: box-shadow .15s, transform .15s var(--ease), opacity .15s; }
.ptile:hover { transform: translateY(-1px); box-shadow: var(--lift-shadow); }
.ptile:active { transform: scale(.985); }
.ptile:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.ptile__ic { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 10px; }
.ptile--blue .ptile__ic { background: var(--blue-soft); color: var(--blue-ink); }
.ptile--red .ptile__ic { background: var(--red-soft); color: var(--red-ink); }
.ptile--amber .ptile__ic { background: var(--amber-soft); color: var(--amber-ink); }
.ptile--slate .ptile__ic { background: var(--slate-soft); color: var(--slate-ink); }
.ptile__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ptile__text b { font-size: 13.5px; font-weight: 650; }
.ptile__text small { overflow: hidden; color: var(--muted); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
.ptile__n { flex: none; margin-left: auto; font-size: 24px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.ptile--red:not(.is-zero) .ptile__n { color: var(--red-ink); }
.ptile.is-zero .ptile__n { color: var(--faint); }
.ptile.is-on { box-shadow: 0 0 0 2px var(--ink), var(--card-shadow); }
.pnotes { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 14px; padding: 0 2px; color: var(--ink-2); font-size: 12.5px; list-style: none; }
.pnote { display: flex; align-items: flex-start; gap: 6px; }
.pnote .ic { flex: none; margin-top: 2px; }
.pnote--bad .ic { color: var(--red); }
.pnote--warn .ic { color: var(--amber); }

/* ---------------------------------------------------------------- the board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(216px, 1fr); gap: 10px; align-items: stretch; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; }
.col { display: flex; flex-direction: column; gap: 8px; min-height: 320px; padding: 10px 8px 12px; border-radius: 16px; background: var(--col-bg); scroll-snap-align: start; }
.col.is-over { box-shadow: inset 0 0 0 2px var(--blue); }
.col__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 2px; padding: 2px 2px 8px; border-bottom: 2px solid var(--slate); }
.col--write .col__head { border-color: var(--lilac); }
.col--make .col__head { border-color: var(--blue); }
.col--ready .col__head { border-color: var(--amber); }
.col--posted .col__head { border-color: var(--green); }
.col__head h2 { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink); font-size: 13px; font-weight: 650; white-space: nowrap; }
.col__head .ic { color: var(--slate); }
.col--write .col__head .ic { color: var(--lilac); }
.col--make .col__head .ic { color: var(--blue); }
.col--ready .col__head .ic { color: var(--amber); }
.col--posted .col__head .ic { color: var(--green); }
.col__head .count { flex: none; min-width: 22px; height: 20px; border-radius: 6px; background: none; box-shadow: 0 0 0 1px var(--line-strong); font-size: 11px; }
.col__late { flex: none; margin-left: auto; padding: 1px 7px; border-radius: 99px; background: var(--red-soft); color: var(--red-ink); font-size: 11px; font-weight: 650; }
.col__cards { display: flex; flex: 1; flex-direction: column; gap: 10px; min-height: 160px; }
.col__empty { padding: 18px 8px; color: var(--faint); font-size: 12.5px; text-align: center; }
.col__add { align-self: stretch; }
.col__note { padding: 0 4px; color: var(--muted); font-size: 11.5px; }
.col__more { align-self: center; }
.board-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.board-foot b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- sections: a column's steps */
.psec { display: flex; flex-direction: column; gap: 6px; border-radius: 12px; transition: box-shadow .12s; }
.psec.is-over { box-shadow: 0 0 0 2px var(--blue), 0 0 0 6px var(--blue-soft); }
.psec__head { display: flex; align-items: center; gap: 5px; width: 100%; padding: 3px 4px; border: 0; border-radius: 7px; background: none; color: var(--ink-2); font-size: 12px; font-weight: 650; text-align: left; cursor: pointer; transition: background .12s; }
.psec__head:hover { background: var(--hover); }
.psec__head .ic { flex: none; color: var(--muted); transition: transform .18s var(--ease); }
.psec.is-folded .psec__head .ic { transform: rotate(-90deg); }
.psec__n { margin-left: auto; color: var(--muted); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.psec__cards { display: flex; flex-direction: column; gap: 7px; }

/* ---------------------------------------------------------------- the card: platform, title, who, when */
.vcard { position: relative; display: flex; flex-direction: column; gap: 6px; overflow: hidden; padding: 9px 10px 12px 13px; border-radius: 12px; background: var(--paper); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, .04); cursor: grab; touch-action: pan-x pan-y; user-select: none; -webkit-user-select: none; transition: box-shadow .16s, transform .16s var(--ease), opacity .16s; }
.vcard:hover { box-shadow: 0 0 0 1px var(--line-strong), 0 4px 12px rgba(0, 0, 0, .10), 0 2px 4px rgba(0, 0, 0, .06); transform: translateY(-2px); }
.vcard:active { cursor: grabbing; }
.vcard.is-drag { opacity: .35; transform: none; }
.vcard.vcard--ghost { position: fixed; transition: none; }
body.is-dragging .board { scroll-snap-type: none; }
.vcard::before { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: var(--slate); }
.vcard--youtube::before { background: #ff0033; }
.vcard--instagram::before { background: linear-gradient(180deg, #feda75, #d62976, #4f5bd5); }
.vcard--tiktok::before { background: var(--ink); }
.vcard:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.page-enter .vcard { animation: card-in .32s var(--ease) both; animation-delay: calc(var(--i, 0) * 26ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(8px) scale(.97); filter: blur(3px); } }
.vcard__thumb { display: block; width: calc(100% + 23px); max-width: none; margin: -9px -10px 2px -13px; aspect-ratio: 16 / 7; object-fit: cover; object-position: top; user-select: none; -webkit-user-drag: none; }
.col--ready .vcard__thumb { aspect-ratio: 16 / 9; }
.vcard__line { display: flex; align-items: center; gap: 5px; min-height: 18px; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.vcard__line > span:first-of-type { overflow: hidden; text-overflow: ellipsis; }
.vcard__line .dot-flag { flex: none; margin-left: auto; }
.vcard__title { display: -webkit-box; overflow: hidden; color: var(--ink); font-size: 13.5px; font-weight: 600; line-height: 1.32; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }
.vcard__foot { position: relative; display: flex; align-items: center; gap: 6px; min-height: 24px; padding-right: 30px; }
.vcard__owner { display: inline-flex; align-items: center; gap: 5px; min-width: 0; color: var(--ink-2); font-size: 12px; }
.vcard__name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.vcard .chip--due { flex: none; height: 20px; margin-left: auto; padding: 0 7px; font-size: 11px; white-space: nowrap; }
.vcard .chip--due .ic { display: none; }
.vcard__next { position: absolute; top: 50%; right: 0; display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 5px; border: 0; border-radius: 99px; background: var(--paper); color: var(--ink-2); box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; transform: translateY(-50%); transition: background .15s, color .15s; }
.vcard__next span { max-width: 0; overflow: hidden; font-size: 11.5px; font-weight: 600; white-space: nowrap; transition: max-width .22s var(--ease), margin .22s var(--ease); }
.vcard__next:hover, .vcard__next:focus-visible { background: var(--ink); color: var(--paper); box-shadow: none; }
.vcard__next:hover span, .vcard__next:focus-visible span { max-width: 140px; margin: 0 4px 0 3px; }
.vcard__bar { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: var(--track); }
.vcard__bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--coral), var(--red)); }

/* posted: small and quiet, the numbers matter now */
.vcard--done { display: grid; grid-template-columns: 72px minmax(0, 1fr); column-gap: 9px; row-gap: 3px; padding: 9px 10px 9px 13px; }
.vcard--done > :not(.vcard__thumb) { grid-column: 2; }
.vcard--done .vcard__thumb { grid-row: 1 / span 4; width: 72px; margin: 0; aspect-ratio: 16 / 9; border-radius: 7px; }
.vcard--done .vcard__title { font-size: 12.5px; -webkit-line-clamp: 2; line-clamp: 2; }
.vcard--done .vcard__line { display: none; }
.vcard--done .vcard__views { display: flex; flex-direction: column; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.vcard--done .vcard__views b { color: var(--ink-2); font-weight: 600; }
.vcard--done .vcard__foot { display: none; }
.vcard--done:not(:has(.vcard__thumb)) { grid-template-columns: minmax(0, 1fr); }
.vcard--done:not(:has(.vcard__thumb)) > * { grid-column: 1; }
.vcard--done:not(:has(.vcard__thumb)) .vcard__line { display: flex; }

/* the list view's sections */
.tsec th { padding: 9px 14px; background: var(--paper-2); color: var(--ink); font-size: 12.5px; font-weight: 650; text-transform: none; letter-spacing: 0; }
.tsec th .ic { margin-right: 7px; vertical-align: -2px; color: var(--muted); }
.tsec th .psec__n { margin-left: 8px; }

@media (max-width: 900px) { .ptiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .board { grid-auto-columns: minmax(250px, 84vw); } .ptile__text small { white-space: normal; } .fgroup--end { margin-left: 0; } }
@media (hover: none) { .vcard__next { width: 28px; height: 28px; } }
@media (prefers-reduced-motion: reduce) { .page-enter .vcard { animation: none; } .vcard__next span { transition: none; } }
