/* ═══════════════════════════════════════════════════════════════════════
   DNRC APPLICATIONS HUB (.dah-*)
   Permit applications tracker — filings, status, timelines, documents.
   Accent: var(--guide-color-action) (blue)
   Shared structural rules live in hub-base.css via [data-hub] selectors.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Root ── */
.dah-root {
  --hub-accent: var(--guide-color-action);
  padding: 0 0 8px;
}

/* ── Hero Stats ── */
.dah-hero-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

/* ── KPI Strip ── */
.dah-conditions {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
}
.dah-conditions-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--guide-fs-xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.8px;
  color: var(--text-secondary, #4A4A52);
  margin-bottom: 8px;
}
.dah-conditions-title i { width: 14px; height: 14px; color: var(--guide-color-lake); }
.dah-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 6px;
}
.dah-kpi {
  background: var(--bg-1, #f5f0e8);
  border: 1px solid var(--border-subtle, #e2e0d8);
  border-radius: var(--radius-md, 10px);
  padding: 8px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
}
.dah-kpi:hover {
  box-shadow: var(--guide-shadow-raised);
}
.dah-kpi-icon { flex-shrink: 0; }
.dah-kpi-icon i { width: 28px; height: 28px; }
.dah-kpi-data { min-width: 0; overflow: hidden; }
.dah-kpi-val {
  font-size: var(--guide-fs-md);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dah-kpi-label {
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #8A8A95);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.5px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Missed-deadline tracker — the sub-line says WHICH question the bars answer,
   and the exclusions line says who is not in the denominator. Both are part of
   the chart, not footnotes: the chart is wrong without them. */
.dah-missed-sub {
  font-size: var(--guide-fs-2xs);
  line-height: 1.45;
  color: var(--text-tertiary, #6B6B73);
  margin-bottom: 10px;
}
.dah-missed-excl {
  font-size: var(--guide-fs-2xs);
  line-height: 1.45;
  color: var(--text-tertiary, #6B6B73);
  margin-top: 8px;
}
.dah-missed-excl:empty { display: none; }

/* Snapshot-age stamp beside the LIVE eyebrow. */
.dah-fetched {
  margin-left: 10px;
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: var(--guide-label-case, uppercase);
  color: var(--text-tertiary, #6B6B73);
}
.dah-fetched.is-stale {
  color: var(--guide-color-status-crit);
}

/* ── View chips ───────────────────────────────────────────────────────────
   Was a ten-row stack of full-width cards — icon tile, label, sub-label each —
   roughly 660px of vertical space before you reached the filters, for what is
   one choice among seven. One wrapping row of chips now, inside the sticky
   filter block, each carrying its own live count. */
.dah-views {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: center;
  padding: 3px;
  background: var(--guide-color-paper-2);
  border: 1px solid var(--guide-color-line);
  border-radius: var(--guide-radius-md, 8px);
}
.dah-view-wrap { position: relative; display: inline-flex; }
.dah-view-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 9px;
  border-radius: var(--guide-radius-sm, 6px);
  border: 0;
  background: transparent;
  color: var(--guide-color-ink-soft);
  font: inherit;
  font-size: var(--guide-fs-xs);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--guide-dur-fast, 140ms) var(--guide-ease-out),
    border-color var(--guide-dur-fast, 140ms) var(--guide-ease-out),
    color var(--guide-dur-fast, 140ms) var(--guide-ease-out);
}
.dah-view-chip i { width: 13px; height: 13px; flex-shrink: 0; }
.dah-view-chip:hover {
  color: var(--guide-color-ink);
}
.dah-view-chip:focus-visible {
  outline: 2px solid var(--guide-color-action);
  outline-offset: 2px;
}
/* The segmented control: the chosen view is a raised sheet in ink. */
.dah-view-chip.is-active {
  background: var(--guide-color-raised);
  box-shadow: var(--guide-shadow-rest);
  color: var(--guide-color-ink);
}
/* An empty view still says so — reading "0" is an answer. */
.dah-view-chip.is-empty:not(.is-active) { opacity: 0.55; }

.dah-view-n {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: var(--guide-fs-2xs);
  padding: 2px 6px;
  border-radius: var(--guide-radius-pill, 999px);
  background: var(--guide-color-raised);
  color: var(--guide-color-ink-soft);
}
.dah-view-chip.is-active .dah-view-n {
  background: var(--guide-color-paper-2);
  color: var(--guide-color-ink);
}

/* Info button rides the chip's trailing edge. */
.dah-view-wrap .guide-info-btn {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 14px;
  height: 14px;
  z-index: 2;
}
.dah-view-wrap .guide-info-btn i { width: 9px; height: 9px; }

@media (max-width: 640px) {
  .dah-views { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .dah-view-label { display: none; }
  .dah-view-chip.is-active .dah-view-label { display: inline; }
}

/* ── Filter Bar ── */
.dah-filters {
  padding: 8px 12px;
  background: var(--bg-3, #F7F5F0);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: var(--radius-lg, 12px);
  margin-bottom: 10px;
}
.dah-filters-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.6px;
  color: var(--text-tertiary, #8A8A95);
  margin-bottom: 8px;
}
.dah-filters-title i { width: 13px; height: 13px; color: var(--guide-color-lake); }
.dah-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.dah-filter-select {
  padding: 5px 8px;
  font-size: var(--guide-fs-2xs);
  border-radius: 8px;
  border: 1px solid var(--border-default, #d4d4d8);
  background: var(--bg-2, #eee9df);
  color: var(--text-primary, #1A1A1F);
  outline: none;
  min-width: 100px;
  transition: border-color 0.15s ease;
  cursor: pointer;
}
.dah-filter-select:focus {
  border-color: var(--guide-color-action);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--guide-color-lake) 15%, transparent);
}
.dah-filter-search {
  padding: 5px 8px;
  font-size: var(--guide-fs-2xs);
  border-radius: 8px;
  border: 1px solid var(--border-default, #d4d4d8);
  background: var(--bg-2, #eee9df);
  color: var(--text-primary, #1A1A1F);
  outline: none;
  flex: 1;
  min-width: 100px;
  transition: border-color 0.15s ease;
}
.dah-filter-search:focus {
  border-color: var(--guide-color-action);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--guide-color-lake) 15%, transparent);
}
.dah-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.dah-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: var(--guide-fs-2xs);
  font-weight: 600;
  color: var(--guide-color-text-on-accent, #fff);
  background: var(--chip-color, var(--guide-color-action));
  transition: opacity 0.15s ease;
}
.dah-filter-chip:hover { opacity: 0.85; }
.dah-filter-chip-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(var(--guide-wash-rgb, 0, 0, 0), 0.08);
  border: none;
  color: var(--guide-color-text-secondary, #4A4A52);
  font-size: var(--guide-fs-2xs);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: background 0.15s ease;
}
.dah-filter-chip-x:hover { background: rgba(var(--guide-wash-rgb, 0, 0, 0), 0.15); }

/* ── Charts Area ── */
.dah-charts { margin-bottom: 10px; }
.dah-charts-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--guide-fs-xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.8px;
  color: var(--text-secondary, #4A4A52);
  margin-bottom: 8px;
}
.dah-charts-title i { width: 14px; height: 14px; color: var(--guide-color-lake); }
.dah-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.dah-chart-wide {
  grid-column: 1 / -1;
}
.dah-chart-card {
  background: var(--bg-2, #eee9df);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: var(--radius-lg, 12px);
  padding: 10px;
  min-height: 180px;
  transition: box-shadow 0.15s ease;
}
.dah-chart-card:hover {
  box-shadow: var(--guide-shadow-raised);
}
.dah-chart-head {
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.5px;
  color: var(--text-tertiary, #8A8A95);
  margin-bottom: 8px;
}
.dah-chart-area {
  width: 100%;
  overflow: hidden;
}
.dah-chart-area svg { width: 100%; display: block; }

/* ── Application List ── */
.dah-list-section { margin-bottom: 10px; }
.dah-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.dah-list-header span {
  font-size: var(--guide-fs-xs);
  font-weight: 600;
  color: var(--text-secondary, #4A4A52);
}
.dah-list-header select {
  padding: 4px 8px;
  font-size: var(--guide-fs-2xs);
  border-radius: 8px;
  border: 1px solid var(--border-default, #d4d4d8);
  background: var(--bg-2, #eee9df);
  color: var(--text-primary, #1A1A1F);
  cursor: pointer;
  outline: none;
}
.dah-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 480px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.dah-app-card {
  background: var(--bg-3, #F7F5F0);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: var(--radius-lg, 12px);
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}
.dah-app-card:hover {
  background: color-mix(in srgb, var(--guide-color-lake) 3%, var(--bg-3, #F7F5F0));
  box-shadow: var(--guide-shadow-raised);
}
.dah-app-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.dah-app-num {
  font-family: var(--guide-font-mono);
  font-size: var(--guide-fs-xs);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
}
.dah-app-type-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.3px;
  color: var(--guide-color-text-on-accent, #fff);
  background: var(--badge-color, var(--guide-color-action));
  line-height: 1.4;
}
.dah-app-status-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.3px;
  line-height: 1.4;
  margin-left: auto;
}
.dah-app-body { margin-bottom: 4px; }
.dah-app-owner {
  font-size: var(--guide-fs-sm);
  font-weight: 600;
  color: var(--text-primary, #1A1A1F);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dah-app-meta {
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #8A8A95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dah-app-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}
.dah-app-stage {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #8A8A95);
}
.dah-app-stage i { width: 11px; height: 11px; }
.dah-app-days {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--guide-fs-2xs);
}
.dah-app-days i { width: 11px; height: 11px; }
.dah-app-days--ok { color: var(--guide-color-moss); }
.dah-app-days--warn { color: var(--guide-color-ochre); }
.dah-app-days--over { color: var(--guide-color-status-crit); }
.dah-app-docs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--guide-fs-2xs);
  color: var(--guide-color-action);
}
.dah-app-docs i { width: 11px; height: 11px; }
.dah-app-deadline {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--guide-fs-2xs);
  color: var(--guide-color-ochre);
}
.dah-app-deadline i { width: 11px; height: 11px; }
.dah-app-deadline--urgent {
  color: var(--guide-color-status-crit);
  animation: dah-pulse 1.5s ease-in-out infinite;
}

/* ── Pagination ── */
.dah-pag {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 10px;
}
.dah-pag button {
  padding: 4px 10px;
  font-size: var(--guide-fs-2xs);
  font-weight: 600;
  border: 1px solid var(--border-default, #d4d4d8);
  border-radius: 8px;
  background: var(--bg-3, #F7F5F0);
  color: var(--text-secondary, #4A4A52);
  cursor: pointer;
  transition: background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    opacity 0.15s ease;
}
.dah-pag button:hover {
  background: color-mix(in srgb, var(--guide-color-lake) 6%, var(--bg-3, #F7F5F0));
  border-color: var(--guide-color-action);
  color: var(--guide-color-action);
}
.dah-pag button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.dah-pag .active {
  background: var(--guide-color-action);
  color: var(--guide-color-text-on-accent, #fff);
  border-color: var(--guide-color-action);
}

/* ── Detail Overlay ── */
.dah-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: var(--guide-z-modal, 1000);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.dah-detail-overlay.active {
  display: flex;
  animation: dah-fade-in 0.2s ease;
}
.dah-detail-panel {
  background: var(--bg-1, #f5f0e8);
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--guide-shadow-overlay);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
  position: relative;
  animation: dah-slide-up 0.25s ease;
  scrollbar-width: thin;
}
.dah-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-default, #d4d4d8);
  background: var(--bg-2, #eee9df);
  color: var(--text-secondary, #4A4A52);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: var(--guide-fs-sm);
  transition: background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
  z-index: 1;
}
.dah-detail-close:hover {
  background: var(--bg-3, #F7F5F0);
  color: var(--text-primary, #1A1A1F);
  transform: scale(1.1);
}
.dah-detail-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-right: 36px;
}
.dah-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
  margin-bottom: 14px;
}
.dah-detail-label {
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.5px;
  color: var(--text-tertiary, #8A8A95);
  margin-bottom: 2px;
}
.dah-detail-val {
  font-size: var(--guide-fs-sm);
  font-weight: 600;
  color: var(--text-primary, #1A1A1F);
  overflow-wrap: anywhere;
}
.dah-detail-section {
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  margin-top: 12px;
}
.dah-detail-section h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--guide-fs-xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.5px;
  color: var(--text-tertiary, #8A8A95);
  margin: 0 0 10px;
}
.dah-detail-section h4 i { width: 14px; height: 14px; color: var(--guide-color-lake); }

/* ── Time Breakdown Bar ── */
.dah-time-bar {
  display: flex;
  height: 24px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}
.dah-time-bar > * {
  transition: width 0.3s ease;
  min-width: 2px;
}
.dah-time-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.dah-time-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--guide-fs-2xs);
  color: var(--text-secondary, #4A4A52);
}
.dah-time-legend > span::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--legend-color, var(--guide-color-action));
}

/* ── Stage Timeline ── */
.dah-timeline {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
}
.dah-timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-default, #d4d4d8);
}
.dah-tl-node {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
}
.dah-tl-dot {
  position: absolute;
  left: -20px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-default, #d4d4d8);
  border: 2px solid var(--bg-1, #f5f0e8);
  z-index: 1;
}
.dah-tl-done .dah-tl-dot {
  background: var(--guide-color-moss);
}
.dah-tl-current .dah-tl-dot {
  background: var(--guide-color-action);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--guide-color-lake) 25%, transparent);
  animation: dah-pulse 2s ease-in-out infinite;
}
.dah-tl-future .dah-tl-dot {
  background: var(--text-tertiary, #8A8A95);
  opacity: 0.4;
}
.dah-tl-content { flex: 1; min-width: 0; }
.dah-tl-label {
  font-size: var(--guide-fs-xs);
  font-weight: 600;
  color: var(--text-primary, #1A1A1F);
  line-height: 1.3;
}
.dah-tl-date {
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #8A8A95);
  line-height: 1.4;
}
.dah-tl-delta {
  font-size: var(--guide-fs-2xs);
  font-style: italic;
  color: var(--text-tertiary, #8A8A95);
  line-height: 1.4;
}

/* ── Documents ── */
.dah-doc-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--guide-fs-xs);
  color: var(--guide-color-action);
  text-decoration: none;
  padding: 4px 0;
  cursor: pointer;
  transition: color 0.15s ease;
}
.dah-doc-link:hover { text-decoration: underline; }
.dah-doc-link i { width: 14px; height: 14px; flex-shrink: 0; }
.dah-doc-link--ea {
  color: var(--guide-color-ochre);
  font-weight: 600;
}
.dah-doc-link--ea:hover { color: var(--guide-color-status-warn, #B45309); }

/* ── Action Buttons ── */
.dah-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.dah-act-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  font-size: var(--guide-fs-2xs);
  font-weight: 600;
  border: 1px solid var(--border-default, #d4d4d8);
  border-radius: 8px;
  background: var(--bg-3, #F7F5F0);
  color: var(--text-secondary, #4A4A52);
  cursor: pointer;
  transition: background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}
.dah-act-btn:hover {
  border-color: var(--guide-color-action);
  color: var(--guide-color-action);
  background: color-mix(in srgb, var(--guide-color-lake) 5%, var(--bg-3, #F7F5F0));
}
.dah-act-btn i { width: 13px; height: 13px; }

/* ── AI Button ── */
.dah-ai-row {
  padding: 8px 0;
  text-align: center;
}
.dah-ai-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 14px;
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--guide-color-line-strong);
  background: var(--guide-color-raised);
  color: var(--guide-color-action);
  font-size: var(--guide-fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
  white-space: normal;
  text-align: center;
}
.dah-ai-btn:hover {
  background: var(--guide-color-raised);
  border-color: var(--guide-color-ink-soft);
  box-shadow: none;
}
.dah-ai-btn i { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Loading ── */
.dah-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 16px;
  color: var(--text-tertiary, #8A8A95);
  font-size: var(--guide-fs-xs);
}
.dah-loading-spin {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border-default, #d4d4d8);
  border-top-color: var(--guide-color-action);
  border-radius: 50%;
  animation: dah-spin 0.7s linear infinite;
}

/* ── Animations ── */

/* ── Responsive ── */
@media (max-width: 500px) {
  .dah-chart-grid { grid-template-columns: 1fr; }
  .dah-detail-grid { grid-template-columns: 1fr; }
  .dah-kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .dah-detail-panel { padding: 14px; }
  .dah-filter-row { flex-direction: column; }
  .dah-filter-select,
  .dah-filter-search { min-width: unset; width: 100%; }
  .dah-hero-stats { flex-direction: column; }
}

/* ───────────────────────────────────────────────────────────────────────────
 *  DARK THEME OVERRIDES
 * ──────────────────────────────────────────────────────────────────────── */
[data-theme="dark"] .dah-kpi {
  background: #23232e;
  border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .dah-kpi-val { color: var(--guide-color-ink); }
[data-theme="dark"] .dah-kpi-label { color: #6B6B73; }
[data-theme="dark"] .dah-conditions-title,
[data-theme="dark"] .dah-charts-title { color: #a0a0b0; }
[data-theme="dark"] .dah-conditions { border-bottom-color: rgba(255,255,255,0.08); }
/* No dark block for the view chips: they are built from flipping tokens
   (--bg-3, --text-secondary, --border-subtle, --guide-color-mt-red), which is
   what the six `.dah-preset*` overrides deleted here were working around. */
[data-theme="dark"] .dah-filters {
  background: #23232e;
  border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .dah-filters-title { color: #6B6B73; }
[data-theme="dark"] .dah-filter-select,
[data-theme="dark"] .dah-filter-search {
  background: #1e1e28;
  border-color: rgba(255,255,255,0.12);
  color: var(--guide-color-ink);
}
[data-theme="dark"] .dah-filter-chip-x { color: #a0a0b0; }
[data-theme="dark"] .dah-chart-card {
  background: #23232e;
  border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .dah-chart-head { color: #6B6B73; }
[data-theme="dark"] .dah-list-header span { color: #a0a0b0; }
[data-theme="dark"] .dah-list-header select {
  background: #23232e;
  border-color: rgba(255,255,255,0.12);
  color: var(--guide-color-ink);
}
[data-theme="dark"] .dah-app-card {
  background: #23232e;
  border-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .dah-app-card:hover {
  background: color-mix(in srgb, var(--guide-color-lake) 6%, #23232e);
  box-shadow: var(--guide-shadow-raised);
}
[data-theme="dark"] .dah-app-num,
[data-theme="dark"] .dah-app-owner { color: var(--guide-color-ink); }
[data-theme="dark"] .dah-app-meta,
[data-theme="dark"] .dah-app-stage { color: #6B6B73; }
[data-theme="dark"] .dah-pag button {
  background: #23232e;
  border-color: rgba(255,255,255,0.12);
  color: #a0a0b0;
}
[data-theme="dark"] .dah-pag button:hover {
  background: color-mix(in srgb, var(--guide-color-lake) 10%, #23232e);
  border-color: var(--guide-color-action);
  color: var(--guide-color-action);
}
[data-theme="dark"] .dah-detail-panel {
  background: #1e1e28;
}
[data-theme="dark"] .dah-detail-close {
  background: #2a2a38;
  border-color: rgba(255,255,255,0.12);
  color: #a0a0b0;
}
[data-theme="dark"] .dah-detail-close:hover {
  background: #23232e;
  color: var(--guide-color-ink);
}
[data-theme="dark"] .dah-detail-header { border-bottom-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .dah-detail-section { border-top-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .dah-detail-section h4 { color: #6B6B73; }
[data-theme="dark"] .dah-detail-label { color: #6B6B73; }
[data-theme="dark"] .dah-detail-val { color: var(--guide-color-ink); }
[data-theme="dark"] .dah-timeline::before { background: rgba(255,255,255,0.12); }
[data-theme="dark"] .dah-tl-dot { background: rgba(255,255,255,0.15); border-color: #1e1e28; }
[data-theme="dark"] .dah-tl-label { color: var(--guide-color-ink); }
[data-theme="dark"] .dah-tl-date,
[data-theme="dark"] .dah-tl-delta { color: #6B6B73; }
[data-theme="dark"] .dah-time-legend > span { color: #a0a0b0; }
[data-theme="dark"] .dah-act-btn {
  background: #2a2a38;
  border-color: rgba(255,255,255,0.12);
  color: #a0a0b0;
}
[data-theme="dark"] .dah-act-btn:hover {
  border-color: var(--guide-color-action);
  color: var(--guide-color-action);
  background: color-mix(in srgb, var(--guide-color-lake) 8%, #2a2a38);
}
[data-theme="dark"] .dah-loading { color: #6B6B73; }
[data-theme="dark"] .dah-loading-spin { border-color: rgba(255,255,255,0.12); border-top-color: var(--guide-color-action); }
[data-theme="dark"] .dah-app-days--ok { color: #4ADE80; }
[data-theme="dark"] .dah-app-deadline { color: var(--guide-color-status-watch); }
