/* ==========================================================================
   Motive & Method — performance dashboard
   Local-first app styles. Built on the site tokens in style.css.
   ========================================================================== */

:root {
  --dash-positive: #2f6b4f;
  --dash-positive-soft: #e7f0ea;
  --dash-negative: #a33a2f;
  --dash-negative-soft: #f7e7e4;
  --dash-warning: #8a5a12;
  --dash-warning-soft: #f7eeda;
  --dash-info: #2c5d7c;
  --dash-info-soft: #e5eef4;
  --dash-radius: 6px;
}

:root[data-theme="dark"] {
  --dash-positive: #8fcaaa;
  --dash-positive-soft: #17271f;
  --dash-negative: #f0a193;
  --dash-negative-soft: #2b1a17;
  --dash-warning: #e0b36a;
  --dash-warning-soft: #2b2316;
  --dash-info: #8fc6ee;
  --dash-info-soft: #16242d;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --dash-positive: #8fcaaa;
    --dash-positive-soft: #17271f;
    --dash-negative: #f0a193;
    --dash-negative-soft: #2b1a17;
    --dash-warning: #e0b36a;
    --dash-warning-soft: #2b2316;
    --dash-info: #8fc6ee;
    --dash-info-soft: #16242d;
  }
}

/* App shell ---------------------------------------------------------------- */

.dash {
  padding-bottom: clamp(2rem, 5vw, 4rem);
}

.dash-hero {
  padding-block: clamp(2.25rem, 5vw, 4rem);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--accent-soft) 45%, transparent), transparent 55%),
    var(--paper-2);
}

.dash-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.5fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: end;
}

.dash-hero h1 {
  margin-top: 0.55rem;
  font-size: clamp(2.4rem, 5.2vw, 4.2rem);
  line-height: 1.02;
}

.dash-hero .lede {
  margin-top: 1rem;
  max-width: 62ch;
}

.dash-status {
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
}

.dash-status p {
  margin-top: 0.55rem;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--muted);
}

.dash-status .dash-btn {
  margin-top: 0.85rem;
}

.dash-shell {
  padding-top: clamp(1rem, 2.5vw, 1.75rem);
}

.dash-tabs {
  position: sticky;
  top: var(--header-h);
  z-index: 30;
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  padding-block: 0.25rem;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.dash-tab {
  flex: none;
  padding: 0.75rem 0.9rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.dash-tab:hover {
  color: var(--ink);
}

.dash-tab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.dash-panel {
  padding-top: clamp(1.25rem, 3vw, 2rem);
}

.dash-panel[hidden] {
  display: none;
}

.dash-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
}

.dash-toolbar__right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.dash-meta {
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.dash-meta strong {
  font-weight: 600;
  color: var(--ink-2);
}

/* Buttons ------------------------------------------------------------------ */

.dash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.25rem;
  padding: 0.48rem 0.72rem;
  border: 1px solid var(--line-2);
  border-radius: var(--dash-radius);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.dash-btn:hover {
  border-color: var(--ink);
  background: var(--paper-2);
  color: var(--ink);
}

.dash-btn--primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.dash-btn--primary:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.dash-btn--quiet {
  border-color: transparent;
  color: var(--muted);
}

.dash-btn--quiet:hover {
  border-color: var(--line);
  color: var(--ink);
}

.dash-btn--danger {
  border-color: color-mix(in srgb, var(--dash-negative) 55%, transparent);
  color: var(--dash-negative);
}

.dash-btn--danger:hover {
  background: var(--dash-negative-soft);
  border-color: var(--dash-negative);
  color: var(--dash-negative);
}

.dash-btn--sm {
  min-height: 1.9rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.74rem;
}

.dash-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.dash-btn svg {
  width: 0.95rem;
  height: 0.95rem;
  flex: none;
}

.segmented {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: var(--dash-radius);
}

.segmented button {
  min-height: 2.25rem;
  padding: 0.45rem 0.7rem;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.segmented button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

/* Badges and chips --------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.45rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge--demo,
.badge--public {
  border-color: color-mix(in srgb, var(--dash-info) 45%, transparent);
  background: var(--dash-info-soft);
  color: var(--dash-info);
}

.badge--private,
.badge--imported {
  border-color: color-mix(in srgb, var(--dash-warning) 45%, transparent);
  background: var(--dash-warning-soft);
  color: var(--dash-warning);
}

.badge--ok {
  border-color: color-mix(in srgb, var(--dash-positive) 45%, transparent);
  background: var(--dash-positive-soft);
  color: var(--dash-positive);
}

.badge--breach {
  border-color: color-mix(in srgb, var(--dash-negative) 45%, transparent);
  background: var(--dash-negative-soft);
  color: var(--dash-negative);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.chip--high {
  background: var(--dash-negative-soft);
  border-color: color-mix(in srgb, var(--dash-negative) 35%, transparent);
  color: var(--dash-negative);
}

.chip--medium {
  background: var(--dash-warning-soft);
  border-color: color-mix(in srgb, var(--dash-warning) 35%, transparent);
  color: var(--dash-warning);
}

.chip--low,
.chip--good {
  background: var(--dash-positive-soft);
  border-color: color-mix(in srgb, var(--dash-positive) 35%, transparent);
  color: var(--dash-positive);
}

.chip--watch {
  background: var(--dash-warning-soft);
  border-color: color-mix(in srgb, var(--dash-warning) 35%, transparent);
  color: var(--dash-warning);
}

.chip--breach {
  background: var(--dash-negative-soft);
  border-color: color-mix(in srgb, var(--dash-negative) 35%, transparent);
  color: var(--dash-negative);
}

/* Layout blocks ------------------------------------------------------------ */

.dash-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.dash-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dash-grid--summary {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
}

.panel {
  min-width: 0;
  padding: clamp(1rem, 2.4vw, 1.5rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--dash-radius);
}

.panel--paper {
  background: var(--paper-2);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-head h2,
.panel-head h3 {
  font-size: clamp(1.3rem, 2.3vw, 1.7rem);
  line-height: 1.15;
}

.panel-head .eyebrow {
  margin-bottom: 0.35rem;
}

.panel-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.panel-sub {
  max-width: 62ch;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}

.panel + .panel {
  margin-top: 1rem;
}

.section-caption {
  margin-top: 0.65rem;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--muted);
}

/* KPI cards ---------------------------------------------------------------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.kpi-card {
  position: relative;
  padding: 1rem 1rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--line-2);
  border-radius: var(--dash-radius);
}

.kpi-card--accent {
  border-top-color: var(--accent);
}

.kpi-card--positive {
  border-top-color: var(--dash-positive);
}

.kpi-card--negative {
  border-top-color: var(--dash-negative);
}

.kpi-label {
  display: block;
  padding-right: 2.8rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi-value {
  display: block;
  margin-top: 0.45rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.3vw, 2.6rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.kpi-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.kpi-sub {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.18rem 0.4rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.delta--good {
  background: var(--dash-positive-soft);
  color: var(--dash-positive);
}

.delta--bad {
  background: var(--dash-negative-soft);
  color: var(--dash-negative);
}

.delta--neutral {
  background: var(--paper-2);
  color: var(--muted);
}

.kpi-note {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
}

.note-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 1.75rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid transparent;
  border-radius: var(--dash-radius);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
}

.note-link:hover {
  border-color: var(--line);
  background: var(--paper-2);
  color: var(--ink);
}

.note-link svg {
  width: 0.85rem;
  height: 0.85rem;
}

.note-link__count {
  min-width: 1.1rem;
  padding: 0.05rem 0.25rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.62rem;
  text-align: center;
}

/* Summary and recommendations --------------------------------------------- */

.summary-copy {
  font-size: 0.98rem;
  line-height: 1.68;
  color: var(--ink-2);
}

.summary-copy p + p {
  margin-top: 0.75rem;
}

.summary-copy strong {
  color: var(--ink);
}

.summary-callout {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
}

.summary-callout h3 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.summary-callout p {
  margin-top: 0.4rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.rec-list {
  display: grid;
  gap: 0.7rem;
}

.rec-card {
  min-width: 0;
  padding: 0.85rem 0.9rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--dash-radius);
}

.rec-card .dash-btn {
  min-width: 0;
}

.rec-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.rec-card h3 {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
}

.rec-card p {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--muted);
}

.rec-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.6rem;
}

.rec-meta .chip {
  min-width: 0;
  border-radius: var(--dash-radius);
  white-space: normal;
  line-height: 1.4;
  text-align: left;
}

/* Bar chart ---------------------------------------------------------------- */

.bar-chart {
  display: grid;
  gap: 0.75rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr) 4.2rem;
  gap: 0.65rem;
  align-items: center;
}

.bar-row__label {
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row__bars {
  display: grid;
  gap: 3px;
}

.bar-row__value {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--muted);
}

.bar-row progress,
.funnel-step progress {
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  appearance: none;
  -webkit-appearance: none;
}

.bar-row progress::-webkit-progress-bar,
.funnel-step progress::-webkit-progress-bar {
  background: var(--line);
  border-radius: 999px;
}

.bar-row progress::-webkit-progress-value,
.funnel-step progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 999px;
}

.bar-row progress::-moz-progress-bar,
.funnel-step progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 999px;
}

.bar-row .bar--spend::-webkit-progress-value {
  background: var(--line-2);
}

.bar-row .bar--spend::-moz-progress-bar {
  background: var(--line-2);
}

.bar-row .bar--revenue::-webkit-progress-value {
  background: var(--accent);
}

.bar-row .bar--revenue::-moz-progress-bar {
  background: var(--accent);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.85rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-swatch {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  background: var(--accent);
}

.legend-swatch--spend {
  background: var(--line-2);
}

.legend-swatch--revenue {
  background: var(--accent);
}

.legend-swatch--info {
  background: var(--dash-info);
}

/* Line chart --------------------------------------------------------------- */

.chart-card {
  margin: 0;
  padding: 0.8rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--dash-radius);
}

.chart-card svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-grid line {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-axis text {
  fill: var(--muted);
  font-family: var(--font-body);
  font-size: 10px;
}

.chart-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.chart-line--revenue {
  stroke: var(--accent);
}

.chart-line--spend {
  stroke: var(--dash-info);
}

.chart-area {
  fill: color-mix(in srgb, var(--accent) 12%, transparent);
  stroke: none;
}

.chart-dot {
  stroke: var(--paper-2);
  stroke-width: 2;
}

.chart-dot--revenue {
  fill: var(--accent);
}

.chart-dot--spend {
  fill: var(--dash-info);
}

.chart-caption {
  margin-top: 0.55rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
}

/* Data table --------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--dash-radius);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.data-table caption {
  padding: 0.7rem 0.75rem;
  text-align: left;
  font-size: 0.8rem;
  color: var(--muted);
}

.data-table th,
.data-table td {
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--paper-2);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: color-mix(in srgb, var(--paper-2) 70%, transparent);
}

.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.th-sort:hover {
  color: var(--ink);
}

.th-sort__mark {
  font-size: 0.68rem;
  color: var(--accent);
}

.channel-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.channel-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--line-2);
}

.channel-dot--paid {
  background: var(--accent);
}

.channel-dot--owned {
  background: var(--dash-positive);
}

.channel-dot--earned {
  background: var(--dash-info);
}

.channel-dot--brand {
  background: var(--dash-warning);
}

.table-note {
  margin-top: 0.6rem;
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--muted);
}

/* Guardrails --------------------------------------------------------------- */

.guardrail-list {
  display: grid;
  gap: 0.55rem;
}

.guardrail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 1rem;
  padding-block: 0.6rem;
  border-bottom: 1px solid var(--line);
}

.guardrail:last-child {
  border-bottom: 0;
}

.guardrail__label {
  font-size: 0.84rem;
  font-weight: 600;
}

.guardrail__note {
  font-size: 0.76rem;
  color: var(--muted);
}

.guardrail__value {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

/* Connectors --------------------------------------------------------------- */

.connector-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.connector {
  padding: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--dash-radius);
}

.connector__head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.source-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  flex: none;
  border: 1px solid var(--line);
  border-radius: var(--dash-radius);
  background: var(--paper-2);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.connector__head > div {
  min-width: 0;
  flex: 1;
}

.connector h3 {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}

.connector__source {
  margin-top: 0.2rem;
  font-size: 0.74rem;
  color: var(--muted);
}

.connector__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.connector__meta dt {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.connector__meta dd {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--ink-2);
}

.connector__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

/* Deep dives --------------------------------------------------------------- */

.deep-dive {
  margin-top: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--dash-radius);
}

.deep-dive summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  padding: 0.9rem 1rem;
  cursor: pointer;
  list-style: none;
}

.deep-dive summary::-webkit-details-marker {
  display: none;
}

.deep-dive summary::after {
  content: "+";
  margin-left: auto;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--muted);
}

.deep-dive[open] summary {
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}

.deep-dive[open] summary::after {
  content: "−";
}

.deep-dive__title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--ink);
}

.deep-dive__title .muted {
  font-family: var(--font-body);
  font-size: 0.76rem;
}

.deep-dive__metrics {
  font-size: 0.78rem;
  color: var(--muted);
}

.deep-dive__body {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.mini-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.mini-kpi {
  padding: 0.65rem 0.7rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
}

.mini-kpi__label {
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.mini-kpi__value {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.deep-dive__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 0.85rem;
}

.funnel {
  display: grid;
  gap: 0.55rem;
  padding: 0.8rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--dash-radius);
}

.funnel-step {
  display: grid;
  grid-template-columns: 5.4rem minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
}

.funnel-step__label {
  font-size: 0.74rem;
  color: var(--muted);
}

.funnel-step__value {
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--ink-2);
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  list-style: none;
}

.detail-metrics li {
  padding: 0.6rem 0.65rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
}

.detail-metrics strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.detail-metrics span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.deep-dive__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

/* Board -------------------------------------------------------------------- */

.board-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem 1rem;
  margin-bottom: 0.85rem;
}

.board-toolbar__right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.board-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: 1rem;
  padding: 1rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--dash-radius);
  margin-bottom: 1rem;
}

.board-summary h3 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.board-summary__text {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--ink-2);
}

.board-summary__text strong {
  color: var(--ink);
}

.board-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  align-content: start;
}

.board-stat {
  padding: 0.55rem 0.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
}

.board-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
}

.board-stat span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.board-stat--alert strong {
  color: var(--dash-negative);
}

.board-view {
  margin-bottom: 0.85rem;
}

.kanban-wrap {
  overflow-x: auto;
  padding-bottom: 0.35rem;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 0.75rem;
  min-width: 960px;
}

.kanban-col {
  padding: 0.65rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--dash-radius);
}

.kanban-col.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.kanban-col__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.kanban-col__head h3 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.kanban-col__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink-2);
}

.task-card {
  margin-top: 0.55rem;
  padding: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-2);
  border-radius: var(--dash-radius);
  cursor: grab;
}

.task-card:active {
  cursor: grabbing;
}

.task-card[data-priority="high"] {
  border-left-color: var(--dash-negative);
}

.task-card[data-priority="medium"] {
  border-left-color: var(--dash-warning);
}

.task-card[data-priority="low"] {
  border-left-color: var(--dash-positive);
}

.task-card.is-overdue {
  border-color: color-mix(in srgb, var(--dash-negative) 45%, var(--line));
}

.task-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.task-card h4 {
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
}

.task-card__open {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

.task-card__open:hover {
  color: var(--accent);
}

.task-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.45rem;
}

.task-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
}

.task-assignee {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  color: var(--muted);
}

.task-due {
  font-size: 0.68rem;
  color: var(--muted);
}

.task-due.is-overdue {
  color: var(--dash-negative);
  font-weight: 600;
}

/* Timeline ----------------------------------------------------------------- */

.timeline-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--dash-radius);
}

.timeline-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.timeline-table th,
.timeline-table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.timeline-table thead th {
  background: var(--paper-2);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.timeline-table tbody tr:last-child td {
  border-bottom: 0;
}

.timeline-table .tl-task {
  max-width: 15rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-table .tl-cell {
  text-align: center;
}

.timeline-table .tl-cell.is-active {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.timeline-table .tl-cell.is-milestone::after {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.55rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.timeline-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.timeline-key {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.timeline-key--milestone {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* Avatars ------------------------------------------------------------------ */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex: none;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.avatar--sm {
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.58rem;
}

.avatar--1 { background: #7b2d26; color: #fffaf4; }
.avatar--2 { background: #2f5d50; color: #f4fbf7; }
.avatar--3 { background: #3d4f7c; color: #f5f7ff; }
.avatar--4 { background: #6f4f18; color: #fffaf0; }
.avatar--5 { background: #6b3d6b; color: #fff6ff; }
.avatar--6 { background: #44403b; color: #fffaf4; }

.team-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.9rem;
}

.team-member {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.team-member__name {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink-2);
}

.team-member__role {
  font-size: 0.68rem;
  color: var(--muted);
}

/* Notes drawer ------------------------------------------------------------- */

.notes-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(460px, 100%);
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.notes-dialog::backdrop {
  background: rgba(25, 21, 18, 0.5);
}

.notes-dialog__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.notes-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}

.notes-dialog__head h2 {
  margin-top: 0.25rem;
  font-size: 1.45rem;
}

.notes-dialog__context {
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.notes-dialog__body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.1rem;
}

.notes-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.notes-toolbar .d-field input,
.notes-toolbar .d-field select {
  min-height: 2.2rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
}

.notes-list {
  display: grid;
  gap: 0.85rem;
}

.note-thread {
  padding: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--dash-radius);
}

.note-thread.is-resolved {
  background: var(--paper-2);
}

.note-head {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.note-head__who {
  min-width: 0;
  flex: 1;
}

.note-head__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}

.note-time {
  font-size: 0.67rem;
  font-weight: 400;
  color: var(--muted);
}

.note-context-label {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.68rem;
  color: var(--muted);
}

.note-body {
  margin-top: 0.55rem;
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.note-replies {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.65rem;
  padding-left: 0.7rem;
  border-left: 1px solid var(--line);
}

.note-reply {
  padding: 0.5rem 0.55rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--dash-radius);
}

.note-reply .note-body {
  margin-top: 0.35rem;
  font-size: 0.8rem;
}

.note-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.note-reply-form {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.65rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
}

.note-reply-form textarea {
  width: 100%;
  min-height: 4.5rem;
  padding: 0.5rem 0.55rem;
  border: 1px solid var(--line-2);
  border-radius: var(--dash-radius);
  background: var(--paper-2);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.5;
}

.note-reply-form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.note-compose {
  padding: 0.9rem 1.1rem 1.1rem;
  background: var(--paper-2);
  border-top: 1px solid var(--line);
}

.note-compose h3 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.note-compose .d-field {
  margin-top: 0.5rem;
}

.note-compose textarea {
  min-height: 4.5rem;
}

.note-compose__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.note-compose__identity {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: var(--muted);
}

.note-compose__identity select {
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--line-2);
  border-radius: var(--dash-radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.74rem;
}

/* Dialogs and forms -------------------------------------------------------- */

.dialog {
  width: min(720px, calc(100% - 2rem));
  max-height: min(88vh, 900px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}

.dialog--narrow {
  width: min(520px, calc(100% - 2rem));
}

.dialog::backdrop {
  background: rgba(25, 21, 18, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}

.dialog__head h2 {
  margin-top: 0.2rem;
  font-size: 1.5rem;
}

.dialog__context {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.dialog__body {
  max-height: 62vh;
  overflow-y: auto;
  padding: 1rem 1.1rem;
}

.dialog__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.8rem 1.1rem;
  background: var(--paper-2);
  border-top: 1px solid var(--line);
}

.dialog__foot--split {
  justify-content: space-between;
}

.d-field {
  display: grid;
  gap: 0.3rem;
}

.d-field + .d-field,
.d-field + .d-grid,
.d-grid + .d-field,
.d-grid + .d-grid {
  margin-top: 0.75rem;
}

.d-field label,
.d-field .d-label {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}

.d-field input,
.d-field select,
.d-field textarea {
  width: 100%;
  min-height: 2.4rem;
  padding: 0.52rem 0.6rem;
  border: 1px solid var(--line-2);
  border-radius: var(--dash-radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
}

.d-field textarea {
  min-height: 6.5rem;
  line-height: 1.55;
  resize: vertical;
}

.d-field input:focus-visible,
.d-field select:focus-visible,
.d-field textarea:focus-visible,
.note-reply-form textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.d-field .hint {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--muted);
}

.d-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.d-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-error {
  margin-top: 0.6rem;
  padding: 0.5rem 0.6rem;
  background: var(--dash-negative-soft);
  border-left: 2px solid var(--dash-negative);
  font-size: 0.78rem;
  color: var(--dash-negative);
}

.dialog-note {
  margin-top: 0.75rem;
  padding: 0.65rem 0.7rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--muted);
}

.dialog-note strong {
  color: var(--ink-2);
}

.checkline {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.checkline input {
  width: 1rem;
  height: 1rem;
  margin-top: 0.18rem;
  flex: none;
  accent-color: var(--accent);
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--dash-radius);
  background: var(--surface);
}

.radio-card + .radio-card {
  margin-top: 0.5rem;
}

.radio-card input {
  width: 1rem;
  height: 1rem;
  margin-top: 0.15rem;
  flex: none;
  accent-color: var(--accent);
}

.radio-card strong {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
}

.radio-card span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--muted);
}

.radio-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Glossary ----------------------------------------------------------------- */

.gloss-toolbar {
  display: grid;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.gloss-search {
  display: grid;
  gap: 0.3rem;
}

.gloss-search label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.gloss-search input {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line-2);
  border-radius: var(--dash-radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.filter-chip {
  padding: 0.32rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-chip:hover {
  border-color: var(--line-2);
  color: var(--ink);
}

.filter-chip[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.gloss-count {
  font-size: 0.78rem;
  color: var(--muted);
}

.gloss-group + .gloss-group {
  margin-top: 1.5rem;
}

.gloss-group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
}

.gloss-group__head h2 {
  font-size: 1.35rem;
}

.gloss-group__head span {
  font-size: 0.72rem;
  color: var(--muted);
}

.gloss-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.gloss-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--dash-radius);
}

.gloss-card h3 {
  font-family: var(--font-body);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.3;
}

.gloss-card__category {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.gloss-card p {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.gloss-formula {
  padding: 0.35rem 0.45rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.gloss-why,
.gloss-watch {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
}

.gloss-why strong,
.gloss-watch strong {
  color: var(--ink-2);
  font-weight: 600;
}

.gloss-watch {
  padding-left: 0.55rem;
  border-left: 2px solid var(--line-2);
}

.gloss-empty {
  padding: 2rem 1rem;
  border: 1px dashed var(--line-2);
  text-align: center;
  color: var(--muted);
}

/* Shared board view -------------------------------------------------------- */

.shared-shell {
  max-width: 1040px;
  margin-inline: auto;
  padding-block: clamp(2rem, 5vw, 4rem);
}

.shared-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.8rem 1rem;
  background: var(--dash-info-soft);
  border: 1px solid color-mix(in srgb, var(--dash-info) 35%, transparent);
  border-left: 3px solid var(--dash-info);
  border-radius: var(--dash-radius);
  margin-bottom: 1rem;
}

.shared-banner p {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.shared-head {
  margin-bottom: 1.25rem;
}

.shared-head h1 {
  margin-top: 0.4rem;
}

.shared-head .meta {
  margin-top: 0.75rem;
}

.shared-passphrase {
  max-width: 460px;
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: var(--dash-radius);
}

.shared-passphrase p {
  margin-bottom: 0.75rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
}

.shared-error {
  margin-top: 0.7rem;
  padding: 0.6rem 0.7rem;
  background: var(--dash-negative-soft);
  border-left: 2px solid var(--dash-negative);
  font-size: 0.8rem;
  color: var(--dash-negative);
}

/* Toast -------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  z-index: 1200;
  max-width: min(92vw, 34rem);
  padding: 0.7rem 0.9rem;
  border-radius: var(--dash-radius);
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  line-height: 1.45;
  transform: translateX(-50%);
}

.toast[hidden] {
  display: none;
}

/* Empty state -------------------------------------------------------------- */

.empty-state {
  padding: 1.5rem 1rem;
  border: 1px dashed var(--line-2);
  text-align: center;
  color: var(--muted);
  font-size: 0.84rem;
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 1100px) {
  .dash-hero__inner {
    grid-template-columns: 1fr;
  }

  .dash-status {
    max-width: 34rem;
  }

  .connector-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-grid--summary {
    grid-template-columns: 1fr;
  }

  .deep-dive__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-grid--2 {
    grid-template-columns: 1fr;
  }

  .board-summary {
    grid-template-columns: 1fr;
  }

  .mini-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gloss-grid {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 7.5rem minmax(0, 1fr) 3.8rem;
  }
}

@media (max-width: 640px) {
  .dash-tabs {
    top: 0;
  }

  .dash-tab {
    padding-inline: 0.65rem;
    font-size: 0.78rem;
  }

  .dash-toolbar {
    align-items: flex-start;
  }

  .dash-toolbar__right {
    width: 100%;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .connector-grid {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 6.8rem minmax(0, 1fr) 3.6rem;
    gap: 0.45rem;
  }

  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-head__actions {
    justify-content: flex-start;
  }

  .board-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .d-grid,
  .d-grid--3,
  .mini-kpi-grid,
  .detail-metrics {
    grid-template-columns: 1fr;
  }

  .notes-dialog {
    width: 100%;
  }

  .notes-toolbar {
    grid-template-columns: 1fr;
  }

  .dialog__body {
    max-height: 66vh;
  }

  .dialog__foot {
    justify-content: stretch;
  }

  .dialog__foot .dash-btn {
    flex: 1;
  }
}

@media (max-width: 420px) {
  .bar-row {
    grid-template-columns: 1fr auto;
  }

  .bar-row__bars {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .bar-row__value {
    grid-column: 2;
    grid-row: 1;
  }

  .deep-dive summary {
    align-items: flex-start;
  }

  .deep-dive__metrics {
    width: 100%;
  }

  .task-card__foot {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Workspace status and assorted app details --------------------------------- */

.dash-status__title {
  margin-top: 0.55rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.dash-status__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem 0.65rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.dash-status__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.dash-status select,
.dash-select {
  width: 100%;
  min-height: 2.15rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line-2);
  border-radius: var(--dash-radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
}

.dash-select {
  width: auto;
  min-width: 9rem;
}

.dash-status__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.dash-status__actions .dash-btn {
  margin-top: 0;
}

.dash-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
}

.board-toolbar__left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.dialog__foot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dash-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.dash-fieldset legend {
  margin-bottom: 0.45rem;
  padding: 0;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}

.d-field--spaced {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.share-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
}

.share-link-row input {
  min-height: 2.4rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line-2);
  border-radius: var(--dash-radius);
  background: var(--paper-2);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
}

.dash-btn--file {
  position: relative;
  overflow: hidden;
}

.task-status-select {
  width: 100%;
  margin-top: 0.55rem;
  padding: 0.28rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper-2);
  color: var(--muted);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
}

.task-status-select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.notice-noscript {
  margin-block: 1rem 2rem;
  padding: 1rem;
  border: 1px solid var(--line-2);
  background: var(--paper-2);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Shared snapshot ---------------------------------------------------------- */

.shared-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1rem;
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--dash-radius);
}

.shared-summary p {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.shared-summary strong {
  color: var(--ink);
}

.shared-status-group + .shared-status-group {
  margin-top: 1.5rem;
}

.shared-status-group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
}

.shared-status-group__head h2 {
  font-size: 1.35rem;
}

.shared-status-group__head span {
  font-size: 0.72rem;
  color: var(--muted);
}

.shared-task-list {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.shared-task {
  padding: 0.8rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-2);
  border-radius: var(--dash-radius);
}

.shared-task[data-priority="high"] {
  border-left-color: var(--dash-negative);
}

.shared-task[data-priority="medium"] {
  border-left-color: var(--dash-warning);
}

.shared-task[data-priority="low"] {
  border-left-color: var(--dash-positive);
}

.shared-task__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem 1rem;
}

.shared-task__head h3 {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
}

.shared-task__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.shared-task__desc {
  margin-top: 0.45rem;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.shared-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

/* Print -------------------------------------------------------------------- */

@media print {
  @page {
    margin: 12mm;
  }

  body {
    background: #fff;
    color: #191512;
    font-size: 10pt;
  }

  .site-header,
  .site-footer,
  .skip-link,
  .dash-tabs,
  .dash-toolbar,
  .dash-btn,
  .note-link,
  .dash-status,
  .toast,
  dialog,
  .notes-dialog {
    display: none !important;
  }

  .dash-hero {
    padding-block: 0 1rem;
    background: none;
  }

  .dash-hero h1 {
    font-size: 22pt;
  }

  .dash-panel {
    padding-top: 0;
  }

  .panel,
  .kpi-card,
  .connector,
  .deep-dive,
  .gloss-card,
  .task-card,
  .board-summary,
  .chart-card {
    background: #fff;
    border-color: #d8d0c5;
    box-shadow: none;
    break-inside: avoid;
  }

  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .dash-grid--2,
  .dash-grid--summary,
  .board-summary {
    grid-template-columns: 1fr 1fr;
  }

  .kanban-wrap,
  .timeline-wrap,
  .table-wrap {
    overflow: visible;
  }

  .kanban {
    min-width: 0;
    grid-template-columns: repeat(4, 1fr);
  }

  .data-table th,
  .data-table td,
  .timeline-table th,
  .timeline-table td {
    padding: 0.3rem;
    font-size: 8pt;
  }

  a {
    text-decoration: none;
    color: inherit;
  }
}
