/* Shared geometry with the cabinet; the board uses horizontal space for work. */
body:has(.ag-board) .stage { --stage-max: 1600px; max-width: 1600px; }
@media(min-width:768px) {
  body:has(.ag-board) { --dock-left:max(20px,calc((100vw - 1600px)/2 + 8px)); }
}
.ag-board { min-width: 0; display: grid; grid-template-columns:minmax(0,1fr); gap: 18px; }
.ag-board > * { min-width:0; }
.ag-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.ag-toolbar h2 { font-size:20px; letter-spacing:-.025em; }
.ag-caption { color:var(--ink-3); font-size:12px; line-height:1.5; }
.ag-actions, .ag-filters, .ag-bulk { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.ag-filters input, .ag-filters select, .ag-bulk select, .ag-mobile-column select,
.ag-dialog input:not([type=checkbox]), .ag-dialog select, .ag-dialog textarea {
  font:inherit; font-size:14px; color:var(--ink); background:var(--surface);
  border:1px solid var(--hairline-strong); border-radius:var(--r-control);
  min-height:42px; padding:10px 12px; min-width:0; max-width:100%;
}
.ag-filters .ag-search { flex:1 1 200px; }
.ag-filters select { max-width:210px; }
.ag-filter-toggle { display:none; }
.ag-filter-extra { display:contents; }
.ag-filters .chip { min-height:42px; }
.ag-message, .ag-dialog-error { background:var(--accent-tint); color:var(--ink); padding:12px 16px; border-radius:var(--r-control); font-size:14px; }
.ag-columns { display:flex; align-items:stretch; gap:16px; overflow-x:auto; padding:2px 2px 20px; scroll-snap-type:x proximity; }
.ag-column { flex:0 0 272px; min-width:0; background:var(--surface-muted); border:1px solid var(--hairline); border-radius:var(--r-card); padding:8px; scroll-snap-align:start; }
.ag-column-head { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:8px 6px 16px; }
.ag-column-head h3 { font-size:14px; font-weight:650; }
.ag-count { border-radius:8px; padding:2px 7px; color:var(--ink-3); background:var(--surface-sunken); font-size:12px; }
.ag-count.is-full { color:var(--warn); background:var(--warn-soft); }
.ag-cards { display:flex; flex-direction:column; gap:8px; min-height:100px; }
.ag-card { background:var(--surface); border:1px solid var(--hairline); border-radius:12px; box-shadow:var(--shadow-row); transition:border-color var(--dur-fast),box-shadow var(--dur-fast); overflow:hidden; }
.ag-card.is-selected { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent); }
.ag-card-open { display:flex; flex-direction:column; gap:10px; padding:14px; width:100%; border:0; background:none; text-align:left; cursor:pointer; border-radius:inherit; }
.ag-card-open:active { transform:scale(.99); }
.ag-card-title { font-size:14px; line-height:1.4; font-weight:600; overflow-wrap:anywhere; }
.ag-card-footer { display:flex; align-items:flex-end; justify-content:space-between; gap:10px; width:100%; }
.ag-author { color:var(--ink-3); font-size:11px; line-height:1.35; overflow-wrap:anywhere; }
.ag-tags, .ag-card-meta, .ag-people { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.ag-tags:empty { display:none; }
.ag-card-meta { font-size:11px; color:var(--ink-3); gap:6px 10px; }
.ag-tag { display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:550; padding:3px 8px; border-radius:7px; background:var(--surface-sunken); color:var(--ink-2); }
.ag-violet { background:#eee9fa; color:#60508f; }.ag-blue{background:#e7f0ff;color:#315e99;}
.ag-green{background:#e5f3eb;color:#33694b;}.ag-amber{background:#fff1d9;color:#835e1b;}
.ag-rose{background:#fce9ef;color:#964360;}.ag-gray{background:#eceef1;color:#555e6c;}
.ag-priority { font-weight:650; color:var(--accent-ink); }
.ag-overdue { color:#a43c3c; font-weight:600; }
.ag-avatar { width:26px; height:26px; display:grid; place-items:center; background:var(--accent-tint); color:var(--accent-ink); border-radius:9px; font-size:10px; font-weight:650; }
.ag-add { border:0; background:none; border-radius:12px; width:100%; text-align:left; padding:12px; margin-top:8px; color:var(--ink-3); cursor:pointer; }
.ag-add { min-height:44px; }
.ag-empty { padding:24px 12px; color:var(--ink-3); font-size:13px; text-align:center; }
.ag-archive-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:12px; }
.ag-pick { display:flex; gap:8px; align-items:center; padding:10px 14px 0; font-size:12px; color:var(--ink-2); }
input[type=checkbox] { accent-color:var(--accent-strong); }
.ag-bulk { padding:12px; border:1px solid var(--accent-soft); background:var(--accent-tint); border-radius:var(--r-control); font-size:13px; }
.ag-requests { padding:12px 16px; border:1px solid var(--hairline); background:var(--surface); border-radius:var(--r-control); font-size:13px; }
.ag-requests summary { cursor:pointer; font-weight:600; }
.ag-request { display:block; padding:10px 0; border:0; background:none; text-align:left; color:var(--accent-ink); cursor:pointer; width:100%; }
.ag-mobile-column { display:none; }

.ag-dialog { border:1px solid var(--hairline); border-radius:var(--r-island); padding:0; color:var(--ink); background:var(--surface); box-shadow:var(--shadow-float); width:min(640px,calc(100vw - 40px)); max-height:calc(100dvh - 40px); }
.ag-dialog::backdrop { background:rgba(35,41,54,.22); }
.ag-dialog.is-task { position:fixed; inset:12px 12px 12px auto; margin:0; width:min(600px,calc(100vw - 32px)); height:calc(100dvh - 24px); max-height:none; }
.ag-dialog-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:20px 24px; border-bottom:1px solid var(--hairline); position:sticky; top:0; background:var(--surface); z-index:2; }
.ag-dialog-head h2 { font-size:20px; line-height:1.3; letter-spacing:-.025em; overflow-wrap:anywhere; }
.ag-close { display:grid; place-items:center; border:0; border-radius:var(--r-control); background:var(--surface-muted); color:var(--ink-2); min-width:36px; min-height:36px; cursor:pointer; font-size:20px; }
.ag-dialog-body { padding:20px 24px 28px; }
.ag-dialog.is-task .ag-dialog-body { min-height:0; }
.ag-dialog-error { margin:12px 16px 0; }
.ag-task-summary { display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:space-between; margin-bottom:16px; }
.ag-task-tabs { display:flex; border-bottom:1px solid var(--hairline); gap:4px; margin-bottom:20px; }
.ag-task-tab { flex:1; min-height:44px; padding:6px; border:0; border-bottom:2px solid transparent; border-radius:8px 8px 0 0; background:none; color:var(--ink-3); font-size:13px; cursor:pointer; }
.ag-task-tab[aria-selected=true] { color:var(--accent-ink); border-bottom-color:var(--accent); background:var(--accent-soft); font-weight:650; }
.ag-form, .ag-form>fieldset { display:flex; flex-direction:column; gap:16px; }
.ag-task-section { display:flex; flex-direction:column; gap:18px; }
.ag-task-facts { padding:12px 0; border-top:1px solid var(--hairline); border-bottom:1px solid var(--hairline); }
.ag-task-facts div { display:flex; justify-content:space-between; gap:16px; font-size:13px; }
.ag-task-facts div + div { margin-top:10px; }
.ag-task-facts dt { color:var(--ink-3); }
.ag-task-facts dd { font-weight:600; text-align:right; }
.ag-dialog fieldset { border:0; padding:0; margin:0; min-width:0; }
.ag-field { display:flex; flex-direction:column; gap:6px; font-size:12px; color:var(--ink-2); }
.ag-field textarea, .ag-dialog textarea { resize:vertical; min-height:110px; width:100%; }
.ag-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.ag-check-group { display:flex; flex-direction:column; gap:8px; max-height:220px; overflow-y:auto; }
.ag-check-group legend { font-size:12px; color:var(--ink-2); margin-bottom:8px; }
.ag-check-group label { display:flex; gap:8px; align-items:center; min-height:32px; font-size:13px; }
.ag-check-group input, .ag-checklist input { width:18px; height:18px; flex:none; }
.ag-form fieldset:disabled { opacity:.75; }
.ag-comments { display:flex; flex-direction:column; gap:16px; }
.ag-comments h3, .ag-followers h3 { font-size:14px; }
.ag-followers { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px; border:1px solid var(--hairline); border-radius:var(--r-row); background:var(--surface-muted); }
.ag-followers > div { min-width:0; flex:1; }
.ag-comment { padding:12px 0; border-bottom:1px solid var(--hairline); }
.ag-comment header { display:flex; flex-wrap:wrap; gap:6px 10px; align-items:baseline; font-size:12px; margin-bottom:8px; }
.ag-comment time { color:var(--ink-3); font-size:11px; }
.ag-comment p { font-size:14px; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.55; }
.ag-comment footer { display:flex; gap:6px; align-items:center; flex-wrap:wrap; margin-top:10px; }
.ag-comment-actions, .ag-file-actions, .ag-check-actions { display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
.ag-comment.is-pinned { padding:14px; border-radius:var(--r-row); border:1px solid var(--accent-soft); background:var(--accent-tint); margin-bottom:16px; }
.ag-reaction { min-width:36px; min-height:30px; padding:3px 7px; border:1px solid var(--hairline); border-radius:8px; background:var(--surface); cursor:pointer; font-size:12px; }
.ag-reaction[aria-pressed=true] { background:var(--accent-tint); border-color:var(--accent); }
.ag-inline { border:0; background:none; color:var(--accent-ink); cursor:pointer; font-size:12px; padding:6px; }
.ag-danger { color:#a43c3c; }
.ag-composer { display:flex; flex-direction:column; gap:8px; position:sticky; bottom:-28px; padding:14px 0 20px; margin-top:16px; background:var(--surface); border-top:1px solid var(--hairline); }
.ag-composer textarea { min-height:80px; }
.ag-mention-row { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.ag-mention-row select { max-width:200px; }
[data-agile-mentioned] { font-size:11px; color:var(--accent-ink); }
.ag-mention-menu { display:flex; flex-direction:column; padding:6px; border:1px solid var(--hairline); border-radius:var(--r-control); background:var(--surface); box-shadow:var(--shadow-card); }
.ag-mention-option { min-height:40px; padding:8px 10px; border:0; border-radius:8px; background:none; color:var(--ink); text-align:left; cursor:pointer; }
.ag-mention-option:hover, .ag-mention-option:focus-visible { background:var(--accent-tint); }
.ag-files, .ag-related { margin:20px 0; }
.ag-files h3, .ag-related h3, .ag-config h3 { font-size:14px; margin-bottom:10px; }
.ag-file { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:8px 0; font-size:13px; overflow-wrap:anywhere; }
.ag-file > div:first-child { min-width:0; }
.ag-file a { color:var(--accent-ink); }
.ag-upload { position:relative; cursor:pointer; margin-top:8px; overflow:hidden; }
.ag-upload input { position:absolute; inset:0; opacity:0; cursor:pointer; width:100%; }
.ag-upload:focus-within { outline:2px solid var(--accent); outline-offset:2px; }
.ag-inline-form, .ag-move-form { display:flex; gap:8px; align-items:center; margin:12px 0; flex-wrap:wrap; }
.ag-inline-form input { flex:1; }
.ag-move-form select { flex:1; }
.ag-move-note { padding:12px; border-radius:var(--r-control); background:var(--warn-soft); font-size:13px; margin-bottom:16px; }
.ag-move-note button { margin:8px 4px 0 0; }
.ag-check-progress { display:flex; flex-direction:column; gap:8px; font-size:13px; margin-bottom:18px; }
.ag-check-progress progress { width:100%; accent-color:var(--accent); height:6px; }
.ag-checklist li { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 0; border-bottom:1px solid var(--hairline); }
.ag-checklist li[draggable=true] { cursor:grab; }
.ag-checklist label { display:flex; align-items:center; gap:10px; font-size:14px; overflow-wrap:anywhere; }
.ag-checklist .is-done { text-decoration:line-through; color:var(--ink-3); }
.ag-check-mobile { display:none; place-items:center; width:36px; height:36px; border:1px solid var(--hairline); border-radius:9px; background:var(--surface); color:var(--ink-2); }
.ag-check-edit { display:flex; gap:8px; width:100%; flex-wrap:wrap; }
.ag-check-edit input { flex:1 1 180px; }
.ag-history { display:flex; flex-direction:column; gap:18px; }
.ag-history li { display:flex; flex-direction:column; gap:4px; padding-left:14px; border-left:2px solid var(--accent-tint); font-size:13px; }
.ag-history span { font-size:12px; color:var(--ink-3); }
.ag-config { display:flex; flex-direction:column; gap:14px; }
.ag-config h3 { margin-top:8px; }
.ag-column-form { display:flex; flex-wrap:wrap; gap:8px; align-items:flex-end; padding-bottom:12px; border-bottom:1px solid var(--hairline); }
.ag-column-form .ag-field:first-child { flex:1 1 160px; }.ag-column-form .ag-field:nth-child(2) { width:80px; }
@media(hover:hover) { .ag-card:hover { border-color:var(--accent);box-shadow:var(--shadow-card); } .ag-add:hover { background:var(--surface-sunken); } }
@media(max-width:767px) {
  .ag-column { display:none; flex:1; width:100%; }
  .ag-column.is-current { display:block; }
  .ag-columns { overflow:visible; padding-bottom:0; }
  .ag-mobile-column { display:flex; flex-direction:column; gap:6px; font-size:12px; color:var(--ink-3); }
  .ag-toolbar .ag-actions { width:100%; }
  .ag-toolbar button,.ag-mobile-column select,.ag-dialog button { min-height:44px; }
  .ag-filter-toggle { display:inline-flex; }
  .ag-filter-extra { display:none; }
  .ag-filter-extra.is-open { display:flex; flex-wrap:wrap; gap:8px; width:100%; }
  .ag-filters select { flex:1 1 150px; min-width:min(100%,150px); max-width:100%; }
  .ag-dialog, .ag-dialog.is-task { inset:0; margin:0; width:100%; max-width:none; height:100dvh; max-height:none; border:0; border-radius:0; }
  .ag-dialog-head { padding:calc(16px + var(--safe-t)) 16px 16px; }
  .ag-dialog .ag-close { min-width:44px; min-height:44px; }
  .ag-dialog-body { padding:16px 16px calc(20px + var(--safe-b)); }
  .ag-dialog input:not([type=checkbox]),.ag-dialog textarea,.ag-dialog select { font-size:16px; }
  .ag-task-tab { font-size:12px; padding-inline:4px; }
  .ag-task-tabs { overflow-x:auto; scrollbar-width:none; }
  .ag-task-tab { flex:0 0 auto; padding-inline:12px; }
  .ag-followers, .ag-file { align-items:flex-start; }
  .ag-file { flex-direction:column; }
  .ag-checklist li { align-items:flex-start; }
  .ag-check-actions { justify-content:flex-end; }
  .ag-check-mobile { display:grid; min-width:44px; min-height:44px; }
  .ag-composer { bottom:calc(-20px - var(--safe-b)); padding-bottom:calc(16px + var(--safe-b)); }
  .ag-form-grid { grid-template-columns:1fr; }
  .ag-archive-grid { grid-template-columns:1fr; }
}
@media(prefers-reduced-motion:reduce) { .ag-card { transition:none; } }
