/*
 * DAComply authenticated app redesign — presentation and local workspace layer.
 *
 * The selectors below intentionally sit above the existing application styles.
 * Runtime IDs, event hooks, persistence controls and analysis contracts remain in
 * index.html; this layer maps those controls onto the approved Claude/Fable shell
 * and styles the transitional project-state task experience.
 */

:root,
[data-theme="light"] {
  --rebrand-ink: #0a111e;
  --rebrand-paper: #f7f6f2;
  --rebrand-paper-raised: #fcfcfb;
  --rebrand-steel: #5e728d;
  --rebrand-brass: #c6902c;
  --rebrand-brass-deep: #8a6316;
  --rebrand-cool: #e4e8ee;
  --rebrand-line: #d9dee6;
  --rebrand-text: #1e2836;
  --rebrand-muted: #65748a;
  --rebrand-red: #a8453d;
  --rebrand-green: #3f755f;

  --bg: var(--rebrand-paper);
  --bg-card: var(--rebrand-paper-raised);
  --bg-section: #f1f2ef;
  --bg-subtle: #f1f3f5;
  --bg-hover: #eeeee9;
  --bg-input: #fff;
  --bg-panel: var(--rebrand-ink);
  --text: var(--rebrand-text);
  --text-primary: var(--rebrand-text);
  --text-muted: #46536a;
  --text-secondary: var(--rebrand-steel);
  --text-subtle: #8591a2;
  --border: var(--rebrand-cool);
  --border-medium: var(--rebrand-line);
  --border-strong: #bcc5d1;
  --header-bg: var(--rebrand-paper-raised);
  --header-border: var(--rebrand-cool);
  --amber: var(--rebrand-brass);
  --amber-hover: #ab7924;
  --amber-text: var(--rebrand-brass-deep);
  --amber-dim: #fbf3e3;
  --amber-border: #e8d3a6;
  --font-sans: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --shadow-sm: 0 1px 2px rgba(10, 17, 30, 0.04);
  --shadow-md: 0 8px 24px rgba(10, 17, 30, 0.07);
  --shadow-lg: 0 24px 64px rgba(10, 17, 30, 0.18);
}

[data-theme="dark"] {
  --rebrand-paper: #101824;
  --rebrand-paper-raised: #151f2d;
  --rebrand-cool: #2a3546;
  --rebrand-line: #334054;
  --rebrand-text: #edf1f5;
  --rebrand-muted: #a7b1c0;
  --bg: var(--rebrand-paper);
  --bg-card: var(--rebrand-paper-raised);
  --bg-section: #111b29;
  --bg-hover: #1b2737;
  --bg-input: #111b29;
  --text: var(--rebrand-text);
  --text-primary: var(--rebrand-text);
  --text-muted: #d0d7e0;
  --text-secondary: #9eabbc;
  --text-subtle: #78869a;
  --border: var(--rebrand-cool);
  --border-medium: var(--rebrand-line);
  --border-strong: #516077;
  --header-bg: #111a27;
  --header-border: #283446;
  --amber: #d3a342;
  --amber-hover: #e0b75f;
  --amber-text: #e1b75c;
  --amber-dim: rgba(198, 144, 44, 0.13);
  --amber-border: rgba(198, 144, 44, 0.4);
}

.dacomply-design-v2 {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  letter-spacing: -0.005em;
}

.dacomply-design-v2 button,
.dacomply-design-v2 input,
.dacomply-design-v2 select,
.dacomply-design-v2 textarea {
  font-family: inherit;
}

.dacomply-design-v2 :focus-visible {
  outline: 3px solid rgba(198, 144, 44, 0.35);
  outline-offset: 2px;
}

/* ── Global authenticated shell ─────────────────────────────────────────── */
.dacomply-design-v2 header {
  height: 64px;
  padding: 0 22px 0 0;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  box-shadow: none;
  gap: 22px;
}

.dacomply-design-v2 .logo {
  align-self: stretch;
  width: 232px;
  flex: 0 0 232px;
  justify-content: center;
  padding: 0 20px;
  background: var(--rebrand-ink);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.dacomply-design-v2 .brand-lockup {
  width: 146px;
  height: auto;
  max-width: 100%;
}
.dacomply-design-v2 .brand-mark-mobile { display: none; }

.header-context {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.header-context-projects {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
}

.header-context-projects:hover { color: var(--rebrand-brass-deep); }
.header-context-separator { color: #b4bdc9; }
#headerContextProject {
  max-width: min(42vw, 520px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dacomply-design-v2 .header-actions { gap: 10px; }
.dacomply-design-v2 .header-env {
  color: var(--text-secondary);
  border-color: var(--border);
  background: var(--bg-section);
}

.dacomply-design-v2 .header-projects-btn {
  min-height: 38px;
  padding: 0 17px;
  border-radius: 6px;
  border: 1px solid var(--rebrand-ink);
  background: var(--rebrand-ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.dacomply-design-v2 .header-projects-btn:hover {
  border-color: var(--rebrand-brass);
  background: #152235;
  color: #fff;
}

.dacomply-design-v2 .theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  border-color: var(--border-medium);
  background: var(--bg-card);
  color: var(--text-secondary);
}

/* ── Projects ───────────────────────────────────────────────────────────── */
.dacomply-design-v2 #dashboardView { min-height: calc(100vh - 64px); }
.dacomply-design-v2 .dash-shell {
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}

.dacomply-design-v2 .dash-sidebar,
.dacomply-design-v2 .input-panel {
  top: 64px;
  height: calc(100vh - 64px);
  background: var(--rebrand-ink);
  border-right-color: rgba(255, 255, 255, 0.07);
}

.dacomply-design-v2 .dash-sidebar {
  padding: 25px 18px 20px;
}

.dacomply-design-v2 .dash-sidebar-head {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--rebrand-brass);
  letter-spacing: 0.14em;
}

.dacomply-design-v2 .dash-sidebar-item {
  width: 100%;
  border: 0;
  font-family: var(--font-sans);
  text-align: left;
  background: transparent;
  color: rgba(247, 246, 242, 0.64);
  border-radius: 6px;
}

.dacomply-design-v2 .dash-sidebar-item.active {
  border-left: 2px solid var(--rebrand-brass);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.dacomply-design-v2 .dash-workspace { padding: 40px 48px 72px; }
.dacomply-design-v2 .dash-header,
.dacomply-design-v2 .dash-sections,
.dacomply-design-v2 .dash-sync-status { max-width: 1240px; }
.dacomply-design-v2 .dash-eyebrow { display: none; }
.dacomply-design-v2 .dash-title {
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 600;
  letter-spacing: -0.045em;
}
.dacomply-design-v2 .dash-subtitle { max-width: 660px; font-size: 14px; }
.dacomply-design-v2 .dash-new-btn {
  border-radius: 6px;
  border-color: var(--rebrand-ink);
  background: var(--rebrand-ink);
  color: #fff;
  box-shadow: none;
}
.dacomply-design-v2 .dash-new-btn:hover {
  border-color: var(--rebrand-brass);
  background: #152235;
  box-shadow: none;
}
.dacomply-design-v2 .dash-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.dacomply-design-v2 .dash-card {
  border-radius: 8px;
  box-shadow: none;
}
.dacomply-design-v2 .dash-card:hover { transform: none; border-color: #aeb8c5; }
.dacomply-design-v2 .dash-address { font-size: 17px; }
.dacomply-design-v2 .dash-card-ring { width: 52px; height: 52px; }
.dacomply-design-v2 .dash-card-ring svg { width: 52px; height: 52px; }
.dacomply-design-v2 .dash-open-btn {
  border-radius: 5px;
  background: var(--rebrand-ink);
  border-color: var(--rebrand-ink);
  color: #fff;
}
.dacomply-design-v2 .dash-cloud-open-btn { border-radius: 5px; }

/* ── Project workspace shell ────────────────────────────────────────────── */
.dacomply-design-v2 .app {
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}

.dacomply-design-v2 .app:has(.input-panel.sidebar-mode-project) {
  grid-template-columns: 232px minmax(0, 1fr);
}

.dacomply-design-v2 .input-panel {
  padding: 24px 18px 28px;
}

.dacomply-design-v2 .input-panel.sidebar-mode-project {
  width: auto;
  padding: 25px 16px 22px;
}

.dacomply-design-v2 .proj-sidebar-block { gap: 16px; }
.dacomply-design-v2 .proj-label-main { font-size: 18px; }
.dacomply-design-v2 .proj-mini-meta { border-left-color: var(--rebrand-brass); }
.dacomply-design-v2 .proj-sidebar-card,
.dacomply-design-v2 .proj-stat {
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
}
.dacomply-design-v2 .proj-gate-chip {
  border-radius: 4px;
  background: rgba(198, 144, 44, 0.13);
  border-color: rgba(198, 144, 44, 0.34);
}
.dacomply-design-v2 .proj-progress-fill { background: var(--rebrand-brass); box-shadow: none; }
.dacomply-design-v2 .proj-nav-list { gap: 4px; }
.dacomply-design-v2 .proj-nav-btn {
  min-height: 39px;
  border-radius: 6px;
  font-size: 13px;
  color: rgba(247, 246, 242, 0.67);
}
.dacomply-design-v2 .proj-nav-btn.active {
  border-color: transparent;
  border-left: 2px solid var(--rebrand-brass);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.dacomply-design-v2 .proj-nav-icon,
.dacomply-design-v2 .proj-nav-btn.active .proj-nav-icon {
  width: 28px;
  height: 24px;
  border: 0;
  background: transparent;
  color: var(--rebrand-brass);
  font-size: 9px;
}
.dacomply-design-v2 .proj-action-btn { border-radius: 5px; }
.dacomply-design-v2 .proj-action-btn.proj-action-primary {
  background: var(--rebrand-brass);
  border-color: var(--rebrand-brass);
  box-shadow: none;
}

.dacomply-design-v2 .output-panel { background: var(--bg); }
.dacomply-design-v2 .results {
  gap: 0;
  padding: 38px 46px 80px;
}

.workspace-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 22px;
}
.workspace-page-eyebrow {
  margin-bottom: 8px;
  color: var(--rebrand-brass-deep);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.workspace-page-header h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.045em;
}
.workspace-page-header p {
  max-width: 720px;
  margin-top: 9px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}
.workspace-sequence-btn {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--border-medium);
  border-radius: 5px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.dacomply-design-v2 .summary-bar {
  margin-bottom: 22px;
  border-radius: 8px;
  box-shadow: none;
}
.dacomply-design-v2 .summary-eyebrow { color: var(--rebrand-brass-deep); }
.dacomply-design-v2 .summary-info h3 { font-size: 19px; }
.dacomply-design-v2 .summary-action-btn { border-radius: 5px; }
.dacomply-design-v2 .summary-action-btn.summary-action-primary {
  background: var(--rebrand-ink);
  border-color: var(--rebrand-ink);
  color: #fff;
}
.dacomply-design-v2 .stat-value { font-weight: 600; }
.dacomply-design-v2 .output-tabs { display: none; }

/* ── Dashboard / Due Next ───────────────────────────────────────────────── */
.dacomply-design-v2 .command-centre { display: block; }
.dacomply-design-v2 .command-gate-header {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  box-shadow: none;
}
.dacomply-design-v2 .command-gate-name { color: var(--rebrand-brass-deep); }
.dacomply-design-v2 .command-gate-title { font-size: 24px; }
.dacomply-design-v2 .command-layout { gap: 18px; }
.dacomply-design-v2 .command-gates-rail,
.dacomply-design-v2 .command-gate-section,
.dacomply-design-v2 .command-next-gate,
.dacomply-design-v2 .command-action-card {
  border-radius: 7px;
  box-shadow: none;
}
.dacomply-design-v2 .command-gate-nav-item.is-current {
  border-left-color: var(--rebrand-brass);
  background: var(--amber-dim);
}
.dacomply-design-v2 .command-priority-label,
.dacomply-design-v2 .command-gates-label,
.dacomply-design-v2 .command-next-gate-label {
  color: var(--rebrand-brass-deep);
}

/* ── Conditions register and detail drawer ──────────────────────────────── */
.dacomply-design-v2 #filterBar {
  border-radius: 7px;
  box-shadow: none;
}
.dacomply-design-v2 .filter-chip,
.dacomply-design-v2 .filter-dropdown,
.dacomply-design-v2 .filter-clear-btn { border-radius: 5px; }
.dacomply-design-v2 .filter-chip.active {
  background: var(--rebrand-ink);
  border-color: var(--rebrand-ink);
  color: #fff;
}
.dacomply-design-v2 .conditions-grid { gap: 18px; }
.condition-timing-group {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-card);
}
.condition-timing-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-section);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.condition-timing-count {
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.condition-timing-rows { display: flex; flex-direction: column; }
.dacomply-design-v2 .condition-card {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
.dacomply-design-v2 .condition-card:last-child { border-bottom: 0; }
.dacomply-design-v2 .condition-card:hover { border-color: var(--border); box-shadow: none; background: #fdfdfb; }
[data-theme="dark"] .dacomply-design-v2 .condition-card:hover { background: var(--bg-hover); }
.dacomply-design-v2 .condition-card.status-complete { opacity: 1; }
.dacomply-design-v2 .condition-card.status-complete .card-title { text-decoration: none; }
.dacomply-design-v2 .card-header {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 108px;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  padding: 10px 16px;
}
.dacomply-design-v2 .card-risk-bar { display: none; }
.dacomply-design-v2 .card-number {
  justify-content: flex-start;
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
}
.dacomply-design-v2 .card-title { margin: 0; font-size: 13px; font-weight: 600; }
.dacomply-design-v2 .card-row-meta { margin-top: 4px; }
.dacomply-design-v2 .risk-pill { display: none; }
.dacomply-design-v2 .card-chevron { display: none; }
.dacomply-design-v2 .condition-card:not(.drawer-open) > .status-row { display: none; }
.dacomply-design-v2 .condition-card:not(.drawer-open) .card-header::after {
  justify-self: end;
  min-width: 82px;
  padding: 5px 8px;
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.dacomply-design-v2 .condition-card[data-status="not_started"] .card-header::after { content: "Not started"; }
.dacomply-design-v2 .condition-card[data-status="in_progress"] .card-header::after { content: "In progress"; color: var(--rebrand-brass-deep); background: var(--amber-dim); border-color: var(--amber-border); }
.dacomply-design-v2 .condition-card[data-status="submitted"] .card-header::after { content: "Submitted"; color: #4f6681; background: #edf1f6; }
.dacomply-design-v2 .condition-card[data-status="complete"] .card-header::after { content: "Complete"; color: var(--rebrand-green); background: #e9f1ed; border-color: #c8dbd1; }

.condition-drawer-backdrop {
  position: fixed;
  inset: 64px 0 0;
  z-index: 8990;
  display: none;
  background: rgba(10, 17, 30, 0.32);
  backdrop-filter: blur(1px);
}
.condition-drawer-backdrop.active { display: block; }
.dacomply-design-v2.condition-drawer-open { overflow: hidden; }
.dacomply-design-v2.condition-drawer-open .app { z-index: auto; }
.dacomply-design-v2 .condition-card.drawer-open {
  position: fixed;
  top: 64px;
  right: 0;
  bottom: 0;
  z-index: 9000;
  display: flex !important;
  width: min(540px, 94vw);
  flex-direction: column;
  overflow-y: auto;
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: -24px 0 64px rgba(10, 17, 30, 0.2);
}
.dacomply-design-v2 .condition-card.drawer-open .card-header {
  order: 1;
  grid-template-columns: 72px minmax(0, 1fr) 36px;
  min-height: 88px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.dacomply-design-v2 .condition-card.drawer-open .card-header::after {
  content: "×";
  justify-self: end;
  color: var(--text-secondary);
  font-size: 24px;
  font-weight: 400;
}
.dacomply-design-v2 .condition-card.drawer-open .card-number {
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.dacomply-design-v2 .condition-card.drawer-open .card-title { font-size: 20px; }
.dacomply-design-v2 .condition-card.drawer-open .card-row-meta { margin-top: 8px; }
.dacomply-design-v2 .condition-card.drawer-open > .status-row {
  order: 2;
  display: flex;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-section);
}
.dacomply-design-v2 .condition-card.drawer-open .card-body {
  order: 3;
  display: block;
  padding: 10px 22px 34px;
  border: 0;
}
.dacomply-design-v2 .condition-card.drawer-open .status-btn,
.dacomply-design-v2 .condition-card.drawer-open .card-section,
.dacomply-design-v2 .condition-card.drawer-open .card-reasoning-details { border-radius: 5px; }

/* ── Plans, evidence, team and risk registers ───────────────────────────── */
.dacomply-design-v2 #approvedPlansTabRoot > *,
.dacomply-design-v2 #evidenceRegisterContent > *,
.dacomply-design-v2 .party-card,
.dacomply-design-v2 .risk-item,
.dacomply-design-v2 .risk-alert {
  border-radius: 7px;
  box-shadow: none;
}
.dacomply-design-v2 .approved-plan-workspace,
.dacomply-design-v2 .approved-plan-viewer { border-color: var(--border); }
.dacomply-design-v2 .party-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-card);
}
.dacomply-design-v2 .party-card {
  min-height: 120px;
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.dacomply-design-v2 .party-card:nth-child(2n) { border-right: 0; }
.dacomply-design-v2 .party-name { font-size: 15px; }
.dacomply-design-v2 .party-count {
  border-radius: 4px;
  color: var(--rebrand-brass-deep);
}
.dacomply-design-v2 .risk-item {
  padding: 19px 21px;
  border-left-width: 2px;
}
.dacomply-design-v2 .risk-item-title { font-size: 16px; }
.dacomply-design-v2 .risk-item-reason {
  border: 0;
  border-left: 2px solid var(--rebrand-brass);
  border-radius: 0;
  background: #faf8f2;
  color: var(--text-muted);
}
[data-theme="dark"] .dacomply-design-v2 .risk-item-reason { background: var(--bg-section); }
.dacomply-design-v2 .timeline-item { border-radius: 5px; box-shadow: none; }

/* ── New analysis ───────────────────────────────────────────────────────── */
.dacomply-design-v2 .input-panel.sidebar-mode-analyser { padding: 30px 24px; }
.dacomply-design-v2 .input-header h2 { font-size: 23px; }
.dacomply-design-v2 .field-group input,
.dacomply-design-v2 .field-group textarea,
.dacomply-design-v2 .filter-dropdown,
.dacomply-design-v2 .upload-zone,
.dacomply-design-v2 .type-btn,
.dacomply-design-v2 .input-mode-tab { border-radius: 5px; }
.dacomply-design-v2 .analyse-btn {
  border-radius: 5px;
  background: var(--rebrand-brass);
  box-shadow: none;
}
.dacomply-design-v2 .empty-state { min-height: calc(100vh - 64px); }
.dacomply-design-v2 .empty-cap { border-radius: 7px; box-shadow: none; }

/* ── Responsive behaviour ───────────────────────────────────────────────── */
@media (max-width: 1120px) {
  .dacomply-design-v2 .logo { width: 210px; flex-basis: 210px; }
  .dacomply-design-v2 .dash-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .dacomply-design-v2 .app { grid-template-columns: 286px minmax(0, 1fr); }
  .dacomply-design-v2 .app:has(.input-panel.sidebar-mode-project) { grid-template-columns: 210px minmax(0, 1fr); }
  .dacomply-design-v2 .results { padding-inline: 30px; }
  .dacomply-design-v2 .dash-workspace { padding-inline: 30px; }
  .dacomply-design-v2 .command-layout { grid-template-columns: 190px minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .dacomply-design-v2 header { padding-right: 12px; gap: 12px; }
  .dacomply-design-v2 .logo { width: 72px; flex-basis: 72px; padding: 0 16px; }
  .dacomply-design-v2 .brand-lockup { display: none; }
  .dacomply-design-v2 .brand-mark-mobile { display: block; width: 36px; height: 36px; }
  .dacomply-design-v2 .header-env { display: none; }
  .dacomply-design-v2 .dash-shell { grid-template-columns: 72px minmax(0, 1fr); }
  .dacomply-design-v2 .dash-sidebar { padding-inline: 9px; }
  .dacomply-design-v2 .dash-sidebar-head { text-align: center; padding-inline: 0; }
  .dacomply-design-v2 .dash-sidebar-item { justify-content: center; padding-inline: 8px; }
  .dacomply-design-v2 .dash-sidebar-item span,
  .dacomply-design-v2 .dash-sidebar-note { display: none; }
  .dacomply-design-v2 .app { grid-template-columns: 238px minmax(0, 1fr); }
  .dacomply-design-v2 .app:has(.input-panel.sidebar-mode-project) { grid-template-columns: 238px minmax(0, 1fr); }
  .dacomply-design-v2 .dash-grid,
  .dacomply-design-v2 .party-grid { grid-template-columns: 1fr; }
  .dacomply-design-v2 .party-card { border-right: 0; }
  .dacomply-design-v2 .summary-row-top { display: block; }
  .dacomply-design-v2 .summary-controls { align-items: flex-start; margin-top: 14px; }
  .dacomply-design-v2 .command-layout { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .dacomply-design-v2 .header-context { display: none; }
  .dacomply-design-v2 .header-actions { margin-left: auto; }
  .dacomply-design-v2 .header-projects-btn { padding-inline: 12px; }
  .dacomply-design-v2 #dacSignOut { padding-inline: 9px; }
  .dacomply-design-v2 #dacSignOut .dac-signout-label { display: inline; }
  .dacomply-design-v2 #dacSignOut .dac-signout-label-short { display: none; }
  .dacomply-design-v2 .dash-shell,
  .dacomply-design-v2 .app,
  .dacomply-design-v2 .app:has(.input-panel.sidebar-mode-project) { grid-template-columns: 1fr; }
  .dacomply-design-v2 .dash-sidebar { display: none; }
  .dacomply-design-v2 .input-panel {
    position: relative;
    top: 0;
    width: 100%;
    height: auto;
  }
  .dacomply-design-v2 .input-panel.sidebar-mode-project {
    position: sticky;
    top: 64px;
    z-index: 35;
    padding: 8px 10px;
    overflow-x: auto;
  }
  .dacomply-design-v2 .input-panel.sidebar-mode-project .proj-sidebar-block > :not(.proj-sidebar-card):not(.proj-action-list),
  .dacomply-design-v2 .input-panel.sidebar-mode-project .proj-sidebar-card:not(:last-of-type),
  .dacomply-design-v2 .input-panel.sidebar-mode-project .proj-action-list { display: none; }
  .dacomply-design-v2 .input-panel.sidebar-mode-project .proj-sidebar-card { padding: 0; border: 0; background: transparent; }
  .dacomply-design-v2 .input-panel.sidebar-mode-project .proj-section-label { display: none; }
  .dacomply-design-v2 .input-panel.sidebar-mode-project .proj-nav-list { flex-direction: row; min-width: max-content; }
  .dacomply-design-v2 .input-panel.sidebar-mode-project .proj-nav-btn { width: auto; min-height: 38px; padding-inline: 11px; }
  .dacomply-design-v2 .results,
  .dacomply-design-v2 .dash-workspace { padding: 26px 17px 64px; }
  .workspace-page-header { align-items: flex-start; }
  .workspace-page-header h1,
  .dacomply-design-v2 .dash-title { font-size: 31px; }
  .workspace-sequence-btn { display: none; }
  .dacomply-design-v2 .summary-stats { grid-template-columns: repeat(2, 1fr); }
  .dacomply-design-v2 .stat:nth-child(2) { border-right: 0; }
  .dacomply-design-v2 .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .dacomply-design-v2 .card-header { grid-template-columns: 46px minmax(0, 1fr) 86px; gap: 9px; padding-inline: 11px; }
  .dacomply-design-v2 .card-row-meta { display: none; }
  .dacomply-design-v2 .condition-card.drawer-open { top: 64px; width: 100vw; }
}

/* ── Functional workspace layer ─────────────────────────────────────────── */
.dacomply-design-v2 .dash-sidebar-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  stroke: currentColor;
}

.task-notification-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
}
.task-notification-btn:hover,
.task-notification-btn:focus-visible {
  color: var(--rebrand-brass-deep);
  border-color: var(--rebrand-brass);
}
.task-notification-btn svg { width: 18px; height: 18px; }
.task-notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding-inline: 4px;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg-card);
  border-radius: 999px;
  background: var(--rebrand-red);
  color: #fff;
  font: 700 10px/1 var(--font-sans);
}
.task-notification-panel {
  position: fixed;
  z-index: 210;
  top: 58px;
  right: 18px;
  width: min(360px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 80px));
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-card);
  box-shadow: 0 18px 45px rgba(10, 17, 30, 0.2);
}
.task-notification-panel[hidden],
.task-notification-count[hidden],
.task-notification-btn[hidden] { display: none !important; }
.task-notification-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
}
.task-notification-head strong { color: var(--text); font-size: 14px; }
.task-notification-head span { color: var(--text-muted); font-size: 11px; }
.task-notification-item {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 13px 16px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.task-notification-item:hover,
.task-notification-item:focus-visible { background: var(--bg-hover); }
.task-notification-item small { color: var(--text-muted); }
.task-notification-item.notification-overdue { border-left-color: var(--rebrand-red); }
.task-notification-item.notification-due_soon { border-left-color: var(--rebrand-brass); }
.task-notification-empty { padding: 22px 16px; color: var(--text-muted); font-size: 13px; }

.workspace-dashboard { display: grid; gap: 20px; }
.dashboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.dashboard-summary-card {
  min-width: 0;
  padding: 18px 20px;
  border-right: 1px solid var(--border);
}
.dashboard-summary-card:last-child { border-right: 0; }
.dashboard-summary-card span,
.dashboard-summary-card small { display: block; color: var(--text-muted); }
.dashboard-summary-card span {
  margin-bottom: 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.dashboard-summary-card strong {
  display: block;
  color: var(--text);
  font: 500 31px/1.1 var(--font-display);
}
.dashboard-summary-card small { margin-top: 5px; font-size: 11px; }
.dashboard-summary-card.summary-complete { box-shadow: inset 0 3px 0 var(--rebrand-green); }
.dashboard-summary-card.summary-attention { box-shadow: inset 0 3px 0 var(--rebrand-red); }
.dashboard-primary-grid,
.dashboard-secondary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 20px;
  align-items: start;
}
.workspace-dashboard-panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  overflow: hidden;
}
.dashboard-panel-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.dashboard-panel-head span:first-child {
  display: block;
  color: var(--rebrand-brass-deep);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.dashboard-panel-head h2 { margin: 3px 0 0; color: var(--text); font: 500 21px/1.2 var(--font-display); }
.dashboard-panel-head button,
.condition-add-task {
  border: 1px solid var(--rebrand-brass);
  border-radius: 4px;
  padding: 7px 10px;
  background: transparent;
  color: var(--rebrand-brass-deep);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.dashboard-panel-head button:hover,
.dashboard-panel-head button:focus-visible,
.condition-add-task:hover,
.condition-add-task:focus-visible { background: color-mix(in srgb, var(--rebrand-brass) 12%, transparent); }
.dashboard-panel-note { margin: 0; padding: 12px 18px; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: 11px; }
.dashboard-panel-count {
  display: grid !important;
  place-items: center;
  min-width: 27px;
  height: 27px;
  border-radius: 999px;
  background: var(--bg-section);
  color: var(--text-secondary) !important;
  font-size: 12px !important;
  letter-spacing: 0 !important;
}
.workspace-dashboard-empty { padding: 28px 18px; color: var(--text-muted); font-size: 13px; text-align: center; }

.timing-progress-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(80px, 1.25fr) 42px;
  gap: 14px;
  align-items: center;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}
.timing-progress-row:last-child { border-bottom: 0; }
.timing-progress-copy strong,
.timing-progress-copy span { display: block; }
.timing-progress-copy strong { color: var(--text); font-size: 13px; }
.timing-progress-copy span { margin-top: 3px; color: var(--text-muted); font-size: 10px; }
.timing-progress-track { height: 6px; overflow: hidden; background: var(--bg-section); }
.timing-progress-track span { display: block; height: 100%; background: var(--rebrand-green); }
.timing-progress-value { color: var(--text-secondary); font-size: 11px; text-align: right; }

.workspace-task-card {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: start;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
}
.workspace-task-card.due-overdue { border-left-color: var(--rebrand-red); }
.workspace-task-card.due-due_soon { border-left-color: var(--rebrand-brass); }
.workspace-task-card.task-completed { opacity: .7; }
.workspace-task-check {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
}
.task-completed .workspace-task-check { border-color: var(--rebrand-green); background: var(--rebrand-green); }
.workspace-task-title { color: var(--text); font-size: 13px; font-weight: 700; }
.workspace-task-description { margin-top: 4px; color: var(--text-secondary); font-size: 11px; line-height: 1.45; }
.workspace-task-meta { display: flex; flex-wrap: wrap; gap: 7px 11px; margin-top: 7px; color: var(--text-muted); font-size: 10px; }
.workspace-task-due.due-overdue { color: var(--rebrand-red); font-weight: 800; }
.workspace-task-due.due-due_soon { color: var(--rebrand-brass-deep); font-weight: 800; }
.workspace-task-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.workspace-task-action {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 5px 7px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 10px;
  cursor: pointer;
}
.workspace-task-action:hover,
.workspace-task-action:focus-visible { border-color: var(--rebrand-brass); color: var(--rebrand-brass-deep); }
.workspace-task-action.task-complete-action { color: var(--rebrand-green); }
.workspace-task-action.task-remove-action:hover,
.workspace-task-action.task-remove-action:focus-visible { border-color: var(--rebrand-red); color: var(--rebrand-red); }
.undated-task-list summary { padding: 12px 18px; color: var(--text-secondary); font-size: 11px; cursor: pointer; }

.recent-activity-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: start;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}
.recent-activity-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--rebrand-brass); }
.recent-activity-dot.activity-task { background: var(--rebrand-steel); }
.recent-activity-dot.activity-evidence { background: var(--rebrand-green); }
.recent-activity-row strong,
.recent-activity-row span { display: block; }
.recent-activity-row strong { color: var(--text); font-size: 12px; }
.recent-activity-row span { margin-top: 3px; color: var(--text-muted); font-size: 10px; }
.recent-activity-row time { color: var(--text-muted); font-size: 9px; }
.needs-review-row {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 13px 18px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.needs-review-row:hover,
.needs-review-row:focus-visible { background: var(--bg-hover); }
.needs-review-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 4px; background: var(--bg-section); color: var(--text-secondary); font-size: 11px; }
.needs-review-row strong,
.needs-review-row small { display: block; }
.needs-review-row strong { font-size: 12px; }
.needs-review-row small { margin-top: 3px; color: var(--text-muted); font-size: 10px; }

.condition-group-control {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  width: 100%;
  margin-bottom: 12px;
  padding: 13px 15px;
  border: 1px solid var(--rebrand-brass);
  border-radius: 5px;
  background: color-mix(in srgb, var(--rebrand-brass) 8%, var(--bg-card));
}
.condition-group-control > span {
  flex: 1 1 320px;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}
.condition-group-toggle {
  flex: 0 0 auto;
  min-width: 170px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--rebrand-brass);
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--rebrand-brass);
  color: #101722;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.condition-group-toggle svg { width: 16px; height: 16px; flex: 0 0 16px; }
.condition-group-toggle[aria-pressed="false"] { background: transparent; color: var(--rebrand-brass-deep); }
.conditions-grid.conditions-ungrouped { display: grid; gap: 10px; }
.conditions-grid.conditions-ungrouped > .condition-card { border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }

.condition-task-section { background: color-mix(in srgb, var(--rebrand-brass) 4%, var(--bg-card)); }
.condition-task-heading { display: flex; justify-content: space-between; gap: 15px; align-items: start; }
.condition-task-heading p { margin: 3px 0 0; color: var(--text-muted); font-size: 10px; }
.condition-task-list { margin-top: 12px; border: 1px solid var(--border); background: var(--bg-card); }
.condition-task-empty { margin-top: 10px; color: var(--text-muted); font-size: 11px; }
.subcondition-add-task {
  border: 0;
  background: transparent;
  color: var(--rebrand-brass-deep);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.task-editor-dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100vh - 44px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-card);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(10, 17, 30, .28);
}
.task-editor-dialog::backdrop { background: rgba(8, 15, 27, .58); }
.task-editor-head { display: flex; justify-content: space-between; gap: 20px; padding: 19px 22px; border-bottom: 1px solid var(--border); }
.task-editor-head h2 { margin: 3px 0 0; font: 500 24px/1.15 var(--font-display); }
.task-editor-eyebrow { color: var(--rebrand-brass-deep); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.task-editor-close { border: 0; background: transparent; color: var(--text-muted); font-size: 24px; cursor: pointer; }
.task-editor-dialog form { display: grid; gap: 14px; padding: 20px 22px 22px; }
.task-editor-dialog label { display: grid; gap: 6px; color: var(--text-secondary); font-size: 10px; font-weight: 700; }
.task-editor-dialog input,
.task-editor-dialog textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 11px;
  background: var(--bg-input);
  color: var(--text);
  font: 400 13px/1.4 var(--font-sans);
}
.task-editor-dialog textarea { resize: vertical; }
.task-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.task-editor-context { padding: 8px 10px; border-left: 2px solid var(--rebrand-brass); background: var(--bg-section); color: var(--text-secondary); font-size: 11px; }
.task-editor-note { margin: 0; color: var(--text-muted); font-size: 10px; }
.task-editor-actions { display: flex; justify-content: flex-end; gap: 8px; }
.task-editor-actions button { border-radius: 4px; padding: 9px 14px; font-size: 11px; font-weight: 800; cursor: pointer; }
.task-editor-cancel { border: 1px solid var(--border); background: transparent; color: var(--text-secondary); }
.task-editor-save { border: 1px solid var(--rebrand-brass); background: var(--rebrand-brass); color: #101722; }

@media (max-width: 1120px) {
  .dashboard-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-summary-card:nth-child(2) { border-right: 0; }
  .dashboard-summary-card:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}

@media (max-width: 860px) {
  .dashboard-primary-grid,
  .dashboard-secondary-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .task-notification-panel { top: 58px; right: 8px; width: calc(100vw - 16px); }
  .dashboard-summary-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-summary-card { padding: 14px; }
  .timing-progress-row { grid-template-columns: minmax(0, 1fr) 42px; }
  .timing-progress-track { grid-column: 1 / -1; grid-row: 2; }
  .workspace-task-card { grid-template-columns: 22px minmax(0, 1fr); }
  .workspace-task-actions { grid-column: 2; justify-content: flex-start; }
  .task-editor-grid { grid-template-columns: 1fr; }
  .condition-group-control {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .condition-group-control > span {
    flex: none;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .dacomply-design-v2 .header-projects-btn { display: none; }
  .dacomply-design-v2 .header-actions { gap: 6px; }
  .dacomply-design-v2 #dacSignOut { white-space: nowrap; }
}

@media print {
  .workspace-page-header,
  .condition-drawer-backdrop { display: none !important; }
}
