/* HQ layout adapter; shared tokens and native controls remain separate. */
body.a11y-unified {
  --bg: var(--a11y-ui-bg); --paper: var(--a11y-ui-surface); --panel: var(--a11y-ui-raised);
  --ink: var(--a11y-ui-fg); --muted: var(--a11y-ui-muted); --line: var(--a11y-ui-border);
  --brand-blue: var(--a11y-ui-accent); --brand-blue-dark: var(--a11y-ui-accent);
  --brand-red: var(--a11y-ui-danger); --brand-cyan: var(--a11y-ui-focus-color);
  --shadow: 0 18px 48px #0008; --tight-shadow: none;
}
.app-shell { width: min(1600px, 100%); }
.topbar { padding: 18px 24px; background: var(--bg); border-color: var(--line); backdrop-filter: none; }
h1 { font: 600 22px/1.3 "Segoe UI", system-ui, sans-serif; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
.brand-icon { width: 42px; height: 42px; border: 0; border-radius: 0; box-shadow: none; }
.brand-lockup .eyebrow { display: none; }
.eyebrow, .rail-title { color: var(--muted); font-size: 11px; font-weight: 600; }
.layout { grid-template-columns: 216px minmax(0, 1fr); padding: 12px 24px 24px; gap: 24px; }
.team-rail { height: auto; max-height: calc(100vh - 32px); overflow-y: auto; padding: 8px 16px 8px 2px; }
.team-list { gap: 6px; }
.a11y-unified .team-button { background: transparent; border-color: transparent; border-left: 3px solid var(--team-color); grid-template-columns: 32px minmax(0, 1fr); padding: 10px 8px; }
.a11y-unified .team-button.is-active { background: var(--panel); border-color: var(--line); border-left-color: var(--team-color); }
.avatar { width: 32px; height: 32px; font-weight: 600; font-size: 12px; }
.team-name { font-weight: 600; font-size: 14px; }
.team-hint { font-size: 11px; }
.workspace { gap: 16px; align-content: start; }
.workspace-nav { display: flex; flex-wrap: wrap; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0 0 12px; box-shadow: none; }
.a11y-unified .workspace-tab { min-height: 44px; display: block; padding: 10px 16px; background: transparent; }
.workspace-tab span { display: none; }
.a11y-unified .workspace-tab.is-active { background: var(--a11y-ui-accent-soft); border-color: var(--brand-blue); color: var(--ink); box-shadow: none; }
.welcome-panel { padding: 6px 0 16px; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.welcome-panel p { margin-bottom: 0; color: var(--muted); }
.metric-row { grid-template-columns: repeat(3, minmax(85px, 1fr)); gap: 20px; }
.metric { background: transparent; border: 0; border-left: 1px solid var(--line); border-radius: 0; padding: 0 14px; }
.metric strong { font-size: 24px; color: var(--ink); font-weight: 600; }
.metric span { font-size: 12px; color: var(--muted); }
.daily-briefing { margin: 0; padding: 10px 0 10px 14px; background: transparent; border: 0; border-left: 2px solid var(--brand-cyan); border-radius: 0; box-shadow: none; }
.briefing-copy strong { font-size: 14px; font-weight: 600; }
.briefing-queue { flex-wrap: wrap; }
.a11y-unified .briefing-task { background: var(--panel); color: var(--ink); white-space: normal; }
.task-filters { grid-template-columns: repeat(3, minmax(120px, 1fr)) auto auto; gap: 10px; padding: 0 0 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.task-filters label, .field-label, .task-dialog label span { font-size: 12px; font-weight: 600; text-transform: none; }
.a11y-unified .add-task-button, .a11y-unified #task-save-btn { background: var(--brand-blue); color: white; box-shadow: none; }
.task-board { grid-template-columns: minmax(0, 1fr); gap: 24px; }
.active-task-lanes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; min-width: 0; }
.active-task-lanes > .bucket { min-width: 0; }
.bucket, .bucket.ordered, .completed-bucket, .database-panel, .gallery-panel, .workload-panel, .resilience-panel { border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
.bucket-header, .section-head { padding: 0 0 12px; border: 0; }
.bucket-header .eyebrow { display: none; }
.count-pill { background: var(--panel); color: var(--muted); min-width: 28px; min-height: 28px; font-size: 12px; font-weight: 600; border-radius: 6px; }
.task-list, .documents-list, .gallery-list { padding: 0; gap: 8px; }
.completed-list { grid-template-columns: minmax(0, 1fr); }
.task-item, .document-item, .gallery-item { padding: 14px; background: var(--paper); border-color: var(--line); }
.task-item { min-height: 0; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; animation: none; transition: border-color 110ms ease, background-color 110ms ease; }
.task-item:hover, .task-item:focus-within { background: var(--paper); border-color: var(--brand-blue); box-shadow: none; }
.task-item:active { transform: none; }
.order-number, .backlog-dot, .completed-check { width: 36px; height: 36px; border-radius: 6px; font-size: 15px; font-weight: 600; background: var(--a11y-ui-accent-soft); color: var(--ink); }
.completed-check { background: #123a2d; color: var(--a11y-ui-success); }
.backlog-dot { background: var(--panel); }
.task-title { font-size: 16px; font-weight: 600; }
.task-description-preview { color: var(--muted); font-size: 14px; line-height: 1.5; -webkit-line-clamp: 2; }
.task-description-preview.is-expanded { max-height: none; color: var(--ink); }
.task-actions { gap: 6px; margin-top: 10px; }
.task-actions button[data-action="toggle-description"] { background: var(--panel); }
.task-actions button[data-action="toggle-description"]::after { display: none; }
.task-meta { align-items: center; font-size: 12px; }
.task-meta :is(.priority, .task-type, .project-chip, .work-state-chip, .overdue-chip, .needs-barry-chip, .completed-chip) { font-weight: 500; padding: 3px 7px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); background: var(--panel); }
.task-meta .task-type { border-left: 3px solid var(--task-type-color, var(--brand-blue)); }
.task-meta :is(.priority.high, .overdue-chip, .needs-barry-chip, .work-state-chip.blocked) { background: #331824; color: #ffa4b6; border-color: #68404e; }
.task-meta :is(.completed-chip, .work-state-chip.started) { background: #123a2d; color: #67e8b6; border-color: #295442; }
.a11y-unified .segmented-control { background: var(--paper); border-radius: 6px; }
.a11y-unified .segmented-control button { background: transparent; border-color: transparent; }
.a11y-unified .segmented-control button.is-active { background: var(--a11y-ui-accent-soft); color: var(--ink); border-color: var(--brand-blue); box-shadow: none; }
.closing-comment-bubble, .closing-comment-bubble:hover, .closing-comment-bubble[open], .closing-comment-bubble:focus-within { background: var(--bg); border-color: var(--line); box-shadow: none; }
.closing-comment-bubble summary { color: var(--a11y-ui-success); font-size: 14px; font-weight: 600; min-height: 44px; }
.closing-comment-reveal p, .doc-body, .path-line, .readonly-field { color: var(--ink); }
.task-completion-panel { background: var(--bg); border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 16px 0; }
.completion-status, .completion-status.is-completed { background: var(--panel); color: var(--ink); font-size: 12px; }
.needs-barry-toggle { background: var(--paper); color: var(--ink); }
.task-dialog { border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.task-dialog::backdrop { background: var(--a11y-ui-backdrop); }
.task-dialog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.task-dialog-grid > label:first-child { grid-column: 1 / -1; }
.task-dialog textarea { min-height: 100px; }
.task-dialog #task-description-input { min-height: 180px; }
.task-dialog .closing-comment-toggle input { min-height: 20px; }
.task-dialog-actions { padding-top: 14px; border-top: 1px solid var(--line); }
.task-dialog label { font-weight: 600; }
.workload-row, .resilience-item { background: var(--paper); }
.workload-metrics > span { background: var(--panel); }
.load-state.heavy { background: #331824; color: #ffa4b6; }
.load-state.watch { background: #352c1a; color: #f6b94a; }
.load-state.balanced { background: #123a2d; color: #67e8b6; }
.a11y-unified .tab-button.active { background: var(--a11y-ui-accent-soft); border-color: var(--brand-blue); }
.doc-form, .gallery-toolbar { padding: 0 0 16px; }
.service-status { background: #331824; color: var(--ink); border-color: var(--brand-red); }
.toast { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.codex-usage { background: var(--paper); border-color: var(--line); box-shadow: none; }
.codex-usage-heading { font-weight: 600; }
.codex-usage-heading strong { color: var(--a11y-ui-success); }
.codex-usage-track { background: var(--panel); }
.codex-usage-track span { background: var(--a11y-ui-success); }
.codex-usage small { color: var(--muted); white-space: normal; }
.date-cluster label { color: var(--muted); font-size: 12px; font-weight: 600; }
.date-cluster { grid-template-columns: minmax(145px, 1fr) 44px; width: 235px; }
.unified-footer { width: min(1600px, 100%); margin: auto; padding: 12px 24px 18px; border-top: 1px solid var(--line); }
@media (max-width: 1200px) {
  .task-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .welcome-panel { grid-template-columns: 1fr; }
  .metric-row { width: auto; justify-content: start; }
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .team-rail { position: static; max-height: none; border: 0; padding: 0; }
  .team-list { display: flex; overflow-x: auto; padding: 3px 2px 8px; }
  .a11y-unified .team-button { flex: 0 0 190px; min-width: 190px; }
  .workload-row { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .active-task-lanes { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .topbar, .layout { padding: 16px; }
  .topbar-controls { display: grid; grid-template-columns: 1fr; }
  .date-cluster { width: 100%; }
  .codex-usage-heading { display: flex; }
  .workspace-nav { flex-wrap: nowrap; overflow-x: auto; padding: 3px 2px 10px; }
  .a11y-unified .workspace-tab { min-width: auto; flex: 0 0 auto; }
  .task-filters { grid-template-columns: 1fr 1fr; }
  .task-filters label:first-child, .task-filters .add-task-button { grid-column: 1 / -1; }
  .metric-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .metric-row .metric:last-child { grid-column: auto; }
  .metric { padding: 0 8px; }
  .bucket-header { flex-direction: row; align-items: center; }
  .completed-bucket .bucket-header { flex-direction: column; align-items: stretch; }
  .completed-header-controls { flex-wrap: wrap; justify-content: space-between; }
  .task-item { grid-template-columns: minmax(0, 1fr); }
  .task-meta, .task-actions { display: flex; flex-wrap: wrap; }
  .task-actions button { width: auto; }
  .task-dialog-grid, .task-capsule-grid { grid-template-columns: 1fr; }
  .task-dialog-head h2 { font-size: 18px; }
  .resilience-grid { grid-template-columns: 1fr; padding: 0; }
  .closing-comment-bubble summary { flex-direction: row; }
}
