/* UBIAP components: buttons, forms, cards, badges, AI blocks, tables, charts.
   Tokens only (tokens.css). Approved design proposal v0.1, 2026-11-14. */

/* ---- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: var(--lh-tight); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-3xl); font-weight: var(--fw-extrabold); }
h2 { font-size: var(--fs-2xl); font-weight: var(--fw-bold); }
h3 { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
h4 { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
p { margin: 0; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a.sr-only:focus { position: fixed; top: 8px; left: 8px; width: auto; height: auto; clip: auto; padding: 8px 12px; background: var(--surface); z-index: 100; border-radius: var(--radius-md); }
/* honeypot field of public forms: invisible to people and screen readers, filled in by spam robots */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-family: var(--font-text); }
.eyebrow { font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }

/* ---- Layout helpers ------------------------------------------------------ */
.stack { display: flex; flex-direction: column; gap: var(--gap, var(--sp-4)); }
.row { display: flex; align-items: center; gap: var(--gap, var(--sp-3)); flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: var(--gap, var(--sp-4)); grid-template-columns: repeat(var(--cols, 12), minmax(0, 1fr)); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
@media (max-width: 1100px) { .span-3 { grid-column: span 6; } .span-4, .span-5, .span-7, .span-8 { grid-column: span 12; } }
@media (max-width: 640px) { .span-2, .span-3, .span-6 { grid-column: span 12; } }

/* ---- Icons (inline SVG injected by static/js/icons.js) --------------------------- */
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; } .icon.lg { width: 22px; height: 22px; }

/* ---- Buttons -------------------------------------------------------------- */
.btn {
  --h: 38px;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: var(--h); padding: 0 var(--sp-4);
  border: 1px solid transparent; border-radius: var(--radius-md);
  font-weight: var(--fw-semibold); font-size: var(--fs-md); line-height: 1;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.btn.sm { --h: 32px; padding: 0 var(--sp-3); font-size: var(--fs-sm); }
.btn.lg { --h: 46px; padding: 0 var(--sp-6); font-size: var(--fs-base); }
.btn.icon-only { width: var(--h); padding: 0; }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #FFFFFF; }
.btn-ai { background: var(--ai-gradient); color: #FFFFFF; }
.btn-ai:hover { filter: brightness(1.06); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn .spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Forms ---------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.field .hint { font-size: var(--fs-xs); color: var(--text-muted); }
.field .error-text { font-size: var(--fs-xs); color: var(--danger); display: flex; gap: 4px; align-items: center; }
.req::after { content: " *"; color: var(--danger); }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 var(--sp-3);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.textarea { height: auto; min-height: 88px; padding: var(--sp-2) var(--sp-3); resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--slate-400); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.input[disabled] { background: var(--surface-2); color: var(--text-muted); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .icon { position: absolute; left: 11px; color: var(--text-subtle); pointer-events: none; }
.input-group .input { padding-left: 36px; }
.input-group .suffix { position: absolute; right: 10px; font-size: var(--fs-xs); color: var(--text-subtle); }
.select { appearance: none; padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
.check { display: inline-flex; align-items: center; gap: var(--sp-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.switch { position: relative; display: inline-flex; align-items: center; gap: var(--sp-2); cursor: pointer; }
.switch input { position: relative; flex: none; appearance: none; width: 36px; height: 20px; border-radius: var(--radius-pill); background: var(--slate-200); transition: background var(--dur-fast); cursor: pointer; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #FFFFFF; transition: transform var(--dur-fast) var(--ease); box-shadow: var(--shadow-sm); }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(16px); }

/* ---- Cards ---------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: var(--sp-5); }
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: var(--fs-base); }
.card-body { padding: var(--sp-5); }

/* KPI tile */
.kpi { padding: var(--sp-4) var(--sp-5); display: flex; flex-direction: column; gap: 6px; }
.kpi .kpi-label { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-muted); font-weight: var(--fw-medium); }
.kpi .kpi-value { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: var(--fw-extrabold); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .kpi-meta { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--text-muted); }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: var(--fw-semibold); font-size: var(--fs-xs); }
.delta.up { color: var(--success); } .delta.down { color: var(--danger); }
/* Dashboard cards: KPI tiles fit as many columns as there is room for; wide (chart) cards go full width earlier */
.kpi-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi-grid .kpi-meta { flex-wrap: wrap; }
.dash-wide { grid-column: span 6; }
@media (max-width: 1100px) { .dash-wide { grid-column: span 12; } }

/* ---- Badges / status -------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: var(--fw-semibold); white-space: nowrap; background: var(--surface-2); color: var(--text-muted); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.posted { background: var(--posted-bg); color: var(--posted-text); }

/* AI badge: always on AI-generated content */
.ai-badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px 0 6px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ai); background: var(--ai-soft); border: 1px solid var(--ai-border); white-space: nowrap; }
.ai-badge .icon { width: 13px; height: 13px; }

/* AI insight block: dashed border, never styled like a record */
.ai-card { position: relative; border: 1px dashed var(--ai-border); background: var(--ai-soft); border-radius: var(--radius-lg); padding: var(--sp-4) var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); }
.ai-card .ai-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; font-size: var(--fs-xs); color: var(--text-muted); }
.ai-card ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }

/* Approval card (agent action awaiting a human) */
.approval { display: grid; grid-template-columns: auto 1fr auto; gap: var(--sp-3); align-items: center; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.approval .who { width: 34px; height: 34px; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--surface-2); color: var(--text-muted); }
.approval .who.agent { background: var(--ai-soft); color: var(--ai); }
.approval .title { font-weight: var(--fw-semibold); }
.approval .meta { font-size: var(--fs-xs); color: var(--text-muted); }
@media (max-width: 560px) { .approval { grid-template-columns: auto 1fr; } .approval .actions { grid-column: 1 / -1; } }

/* Attached files */
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.file-row { display: grid; grid-template-columns: auto 1fr auto; gap: var(--sp-3); align-items: center; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text-muted); }
.file-row .file-main { min-width: 0; color: var(--text); }
.file-row .file-main a { overflow-wrap: anywhere; }

/* Numbered instructions (import centre) */
.steps-list { margin: 0; padding-inline-start: var(--sp-5); display: grid; gap: var(--sp-1); font-size: var(--fs-sm); }

/* Alerts */
.alert { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-md); border: 1px solid transparent; font-size: var(--fs-sm); }
.alert.info { background: var(--info-soft); color: var(--text); border-color: var(--ai-border); }
.alert.warning { background: var(--warning-soft); color: var(--text); }
.alert.danger { background: var(--danger-soft); color: var(--text); }
.alert.success { background: var(--success-soft); color: var(--text); }
.alert .icon { margin-top: 2px; }
.alert.warning .icon { color: var(--warning); } .alert.danger .icon { color: var(--danger); } .alert.success .icon { color: var(--success); } .alert.info .icon { color: var(--info); }

/* ---- Tables ----------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border-radius: inherit; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-md); }
.table th { position: sticky; top: 0; background: var(--surface-2); color: var(--text-muted); text-align: left; font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: 0.04em; text-transform: uppercase; padding: 10px var(--sp-4); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px var(--sp-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .r { text-align: right; font-variant-numeric: tabular-nums; }
.table .sel { width: 40px; }
.table tr.selected td { background: var(--primary-soft); }
.table.compact td { padding: 8px var(--sp-4); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text-muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--surface); font-size: var(--fs-sm); color: var(--text); cursor: pointer; }
.chip.active { background: var(--primary-soft); border-color: transparent; color: var(--primary-soft-text); font-weight: var(--fw-semibold); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: var(--fs-xs); font-weight: var(--fw-bold); background: var(--navy-700); color: #FFFFFF; flex: none; }
.avatar.e { background: var(--emerald-700); } .avatar.b { background: var(--blue-600); } .avatar.s { background: var(--slate-500); }
.cell-main { display: flex; align-items: center; gap: var(--sp-3); }
.cell-main .t { font-weight: var(--fw-semibold); }
.cell-main .s { font-size: var(--fs-xs); color: var(--text-muted); }
.progress { height: 6px; border-radius: var(--radius-pill); background: var(--surface-3); overflow: hidden; min-width: 80px; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }

/* Tabs */
.tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { padding: 10px var(--sp-3); border: 0; background: none; color: var(--text-muted); font-weight: var(--fw-semibold); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--primary); }

/* Segmented control */
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: var(--radius-md); border: 1px solid var(--border); }
.segmented button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-muted); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---- Charts (inline SVG mockups) --------------------------------------------- */
.chart { width: 100%; height: auto; }
.chart .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis { fill: var(--text-muted); font-size: 11px; font-family: var(--font-text); }
.legend { display: flex; gap: var(--sp-4); flex-wrap: wrap; font-size: var(--fs-xs); color: var(--text-muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }


/* Logo marks never shrink inside flex rows */
[data-logo] { display: inline-flex; flex: none; }
[data-logo] svg { max-width: none; }

/* ---- Dialog (native <dialog>; focus trap and Esc come from the browser) ---- */
.dialog { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0; width: min(560px, calc(100vw - 2 * var(--sp-4))); max-height: calc(100vh - 2 * var(--sp-8)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.dialog.wide { width: min(760px, calc(100vw - 2 * var(--sp-4))); }
.dialog.xwide { width: min(1080px, calc(100vw - 2 * var(--sp-4))); }

/* Journal lines grid: inputs fill their cells; totals line up under the amount columns */
.jv-lines .table td { padding: var(--sp-1) var(--sp-2); vertical-align: middle; }
.jv-lines .input, .jv-lines .select { width: 100%; min-width: 0; }
.jv-lines .input.r { text-align: right; }
.jv-lines tfoot td { font-weight: 600; border-top: 2px solid var(--border-strong); }
.jv-lines tfoot tr + tr td { border-top: 0; font-weight: 400; }
.kb-hit { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--sp-3) var(--sp-4); background: var(--surface); }
.kb-hit .meta { font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: var(--sp-1); }
.report-out > p { padding: var(--sp-3) var(--sp-4) 0; margin: 0 0 var(--sp-2); }
.report-out .table td:first-child { min-width: 240px; }
/* Invoice lines: stock item and warehouse under the line text */
.inv-stock { margin-top: var(--sp-1); }
.inv-stock .select { flex: 1; min-width: 0; font-size: var(--fs-xs); }
.warn-text { color: var(--warning); font-weight: var(--fw-bold); }
.po-progress { display: inline-flex; gap: 4px; flex-wrap: wrap; }
/* AI invoice reader: the file beside the reading */
.reader-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.reader-file { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2, var(--surface)); min-height: 320px; overflow: hidden; }
.reader-file img { display: block; width: 100%; height: auto; }
.reader-file iframe { display: block; width: 100%; height: 70vh; border: 0; }
.reader-file > p { padding: var(--sp-4); margin: 0; }
@media (max-width: 860px) { .reader-split { grid-template-columns: 1fr; } .reader-file iframe { height: 50vh; } }
.dialog::backdrop { background: rgb(10 26 33 / 0.55); }
.dialog > form { display: flex; flex-direction: column; max-height: inherit; }
.dialog .dialog-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.dialog .dialog-head h2 { font-size: var(--fs-lg); }
.dialog .dialog-body { padding: var(--sp-5); overflow: auto; display: flex; flex-direction: column; gap: var(--sp-4); }
.dialog .dialog-body > * { flex-shrink: 0; }   /* the body scrolls; a tall form must not crush a lines table */
.dialog .dialog-foot { display: flex; justify-content: flex-end; gap: var(--sp-2); flex-wrap: wrap; padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.secret-once { font-family: var(--font-mono); font-size: var(--fs-lg); letter-spacing: 0.06em; padding: var(--sp-3) var(--sp-4); background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius-md); user-select: all; word-break: break-all; }

/* ---- Tree (organisation structure) ---- */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: var(--sp-5); border-left: 1px dashed var(--border-strong); padding-left: var(--sp-3); }
.tree .node { display: flex; align-items: center; gap: var(--sp-2); padding: 6px 8px; border-radius: var(--radius-sm); }
.tree .node:hover { background: var(--surface-2); }
.tree .node .icon { color: var(--text-muted); flex: none; }
.tree .node .code { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); }
.tree .node .acts { margin-left: auto; display: flex; gap: 2px; opacity: 0.6; }
.tree .node:hover .acts, .tree .node:focus-within .acts { opacity: 1; }

/* ---- Permission matrix ---- */
.perm-group { border: 1px solid var(--border); border-radius: var(--radius-md); }
.perm-group > h4 { padding: var(--sp-2) var(--sp-3); background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: var(--fs-sm); border-radius: var(--radius-md) var(--radius-md) 0 0; }
.perm-group .perm { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); border-top: 1px solid var(--border); }
.perm-group .perm:first-of-type { border-top: 0; }
.perm-group .perm .mono { font-size: var(--fs-xs); color: var(--text-muted); }

/* ---- CRM (Sprint 9): timelines, pipeline board -------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.timeline li { display: grid; grid-template-columns: 26px 1fr; gap: var(--sp-3); align-items: start; }
.timeline .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-muted); }
.timeline li.done .dot { background: var(--success-soft); color: var(--success); }
.timeline li.overdue .dot { background: var(--danger-soft); color: var(--danger); }
.timeline .title { font-weight: var(--fw-semibold); display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.timeline .meta { font-size: var(--fs-xs); color: var(--text-muted); }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: var(--sp-3); overflow-x: auto; padding-bottom: var(--sp-2); }
.board-col { background: var(--surface-2); border-radius: var(--radius-lg); padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); min-height: 200px; }
.board-col.drop { outline: 2px dashed var(--primary); outline-offset: -2px; }
.board-col header { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); }
.board-col header h2 { font-size: var(--fs-sm); margin: 0; }
.board-col header .sum { font-size: var(--fs-xs); color: var(--text-muted); text-align: end; }
.board-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--sp-3); display: grid; gap: 4px; cursor: grab; box-shadow: var(--shadow-sm); }
.board-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.board-card .t { font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
.board-card .m { font-size: var(--fs-xs); color: var(--text-muted); display: flex; justify-content: space-between; gap: var(--sp-2); }
.board-card select { margin-top: 4px; }

/* website portfolio: choosing the cover picture */
.cover-pick { margin-top: var(--sp-4); display: grid; gap: var(--sp-2); }
.cover-pick h4 { margin: 0; font-size: var(--fs-md); }
.cover-pick p { margin: 0; font-size: var(--fs-sm); }
.cover-grid { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-3); }
.cover-opt { position: relative; display: grid; gap: 4px; padding: 6px; border: 2px solid var(--border); border-radius: var(--radius-md); cursor: pointer; font-size: var(--fs-xs); color: var(--text-muted); }
.cover-opt img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; border-radius: var(--radius-sm); background: var(--surface-2); }
.cover-opt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-opt input { position: absolute; top: 10px; left: 10px; accent-color: var(--primary); width: 18px; height: 18px; }
.cover-opt:has(input:checked) { border-color: var(--primary); color: var(--text); }
.cover-opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Website portfolio: reel links per video */
.reel-row { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--sp-3); margin: 0 0 var(--sp-3); }
.reel-row legend { padding: 0 var(--sp-1); display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: baseline; font-size: var(--fs-sm); }
.reel-row legend .muted { font-size: var(--fs-xs); }
.cover-grid:disabled .cover-opt { cursor: default; opacity: 0.7; }
