/* Reading hierarchy and touch navigation, shared by both palettes. */
.dashboard-application {
  --ds-sidebar-width: 280px;
  --ds-header-height: 64px;
  --ds-gutter: clamp(24px, 3vw, 56px);
  font-size: 14px;
}
.ds-brand { height: 64px; min-height: 64px; margin-bottom: 8px; }
.ds-brand > a { font-size: 18px; font-weight: 600; }
.ds-mobile-brand { display: none; }
.ds-header-actions { gap: 8px; }
.ds-header-actions .ds-icon-button { width: 40px; height: 40px; padding: 10px; border-radius: 10px; }
.ds-header .theme-control { min-height: 40px; }
.ds-header .theme-control select { min-height: 38px; }
.ds-main-nav { flex: 1; gap: 3px; overflow-x: auto; scrollbar-width: thin; }
.ds-main-nav > a { flex-shrink: 0; font-weight: 500; }
.ds-main-nav > a[aria-current="page"] { font-weight: 600; }
.ds-main-nav > a[aria-current="page"]:not(.ds-facegpt-link)::after { background: var(--ui-accent); height: 3px; }
.ds-history-item { min-height: 72px; padding: 10px 8px; }
.ds-history-title { display: block; }
.ds-history-title > strong { display: block; font-size: 12px; line-height: 1.5; }
.ds-history-title > time { display: block; margin-top: 2px; font-size: 10px; }
.ds-history-pillars { gap: 9px; font-size: 10px; }
.ds-history-heading > div > :is(a, button) { min-height: 32px; font-size: 10px; }
.ds-section-label, .ds-history-toggle { font-size: 11px; letter-spacing: .02em; }
.ds-explore a { min-height: 40px; font-size: 13px; }
.ds-new-analysis { min-height: 40px; font-size: 12px; border-radius: 10px; }
.ds-avatar { background: var(--ui-avatar); color: var(--ui-on-avatar) !important; }
.ds-sidebar-collapsed .ds-brand { min-height: 82px; }
.ds-sidebar-collapsed .ds-history-item { min-height: 58px; }

.dash-pillar { border-radius: 18px; }
.dash-pillar > span:first-child { font-size: 14px; }
.dash-pillar .dash-pillar-cta { font-size: 11px; color: var(--ui-secondary); }
.dash-pillar:hover { border-color: var(--ui-border-strong); box-shadow: var(--ui-shadow); }
.dash-pillar > svg { right: -12px; width: 47%; }
.dash-connectors { height: 24px; }
.dash-card { border-radius: 20px; box-shadow: none; }
.dash-card h2 { font-size: 22px; letter-spacing: -.4px; text-wrap: balance; }
.dash-section-heading > span { color: var(--ui-muted); font-size: 12px; }
.dash-overall-number > strong { font-size: 52px; font-weight: 500; letter-spacing: -1.6px; font-variant-numeric: tabular-nums; }
.dash-progress { padding: 20px; background: var(--ui-surface-subtle); }
.dash-progress-body > p { max-width: 60ch; }
.dash-progress-body > strong { font-size: 16px; }
.dash-progress-actions { gap: 12px; }
.dash-overview-grid .dash-segments { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.dash-overview-grid .dash-segments button { min-width: 0; padding: 8px 3px; font-size: 11px; }
.dash-segments { gap: 6px; }
.dash-card .dash-segments button { min-height: 36px; border: 1px solid transparent; color: var(--ui-muted); }
.dash-card .dash-segments button[aria-pressed="true"] { background: var(--ui-accent-soft); color: var(--ui-accent); border-color: color-mix(in srgb, var(--ui-accent) 25%, transparent); }
.dash-finding-list .dash-finding summary { min-height: 58px; font-size: 14px; }
.dash-finding-body { font-size: 12px; }
.dash-mini-card { background: var(--ui-surface-subtle); border-color: var(--ui-border); color: var(--ui-muted); }
.dash-mini-card > span:last-child b { color: var(--ui-text); }
.dash-before-after > span {
  padding: 5px 8px; border: 1px solid #ffffff40; border-radius: 7px;
  background: #111923e6; color: #ffffff; font-size: 11px; line-height: 1.35;
  letter-spacing: .02em; text-shadow: none;
}
.dash-card .dash-editor-photo .dash-editor-zoom :is(button, output),
.dash-card .dash-editor-photo .dash-editor-lines,
.dash-editor-tag {
  background: var(--ui-surface); color: var(--ui-text); border-color: var(--ui-border);
}
.dash-card .dash-editor-photo .dash-editor-lines[aria-pressed="true"] {
  background: var(--ui-action); color: var(--ui-on-action);
}
.dash-point-guide { background: var(--ui-surface-subtle); border-color: var(--ui-border); }
.dash-point-guide strong { color: var(--ui-text); }
.dash-point-guide > span { color: var(--ui-accent); }
.dash-point-guide p { color: var(--ui-muted); }
.rl-top { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.rl-sizes { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
.rl-sizes b { white-space: nowrap; }
.dash-card :is(input, textarea, select) { color: var(--ui-text); background-color: var(--ui-surface-subtle); border-color: var(--ui-border); }
.dash-dialog { background: var(--ui-surface); color: var(--ui-text); overscroll-behavior: contain; }
.dash-dialog :is(input, textarea, select) { color: var(--ui-text); background-color: var(--ui-surface-subtle); }
.ds-secondary { overflow-x: auto; scrollbar-width: thin; background: var(--ui-header); border-color: var(--ui-border); }
.ds-analysis-nav { flex-shrink: 0; }
.dash-distribution h3 { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.dash-distribution > p { margin: 0 0 14px; color: var(--ui-muted); font-size: 12px; line-height: 1.6; }
.dash-distribution svg line { stroke: var(--ui-border); }
.dash-distribution svg text { fill: var(--ui-muted); }
.dash-distribution svg stop { stop-color: var(--ui-accent); }
.dash-distribution svg :is(path[fill="none"], line[stroke-dasharray]) { stroke: var(--ui-accent); }
.dash-ratio-curve rect { fill: var(--ui-positive-soft); }
.dash-ratio-curve line[stroke="#e2e8ec"] { stroke: var(--ui-border); }
.dash-ratio-curve path { stroke: var(--ui-positive); }
.ds-main-nav > a, .ds-secondary a { scroll-margin-inline: 18px; }
.dashboard-application :is(h1, h2, h3, [id]) { scroll-margin-top: calc(var(--ds-header-height) + var(--ds-secondary-height) + 16px); }

@media (max-width: 980px) {
  .dashboard-application { --ds-gutter: 24px; }
  .ds-header .ds-mobile-toggle { width: 40px; height: 40px; }
  .ds-sidebar-collapsed .ds-brand { min-height: 64px; height: 64px; }
}
@media (max-width: 640px) {
  .dashboard-application { --ds-header-height: 100px; --ds-gutter: 16px; }
  .ds-header {
    display: grid; grid-template-columns: 36px minmax(0, 1fr) auto;
    grid-template-rows: 56px 44px; gap: 0 8px; padding-inline: 16px;
  }
  .ds-header .ds-mobile-toggle { grid-column: 1; grid-row: 1; width: 36px; height: 44px; }
  .ds-mobile-brand { display: inline-flex; grid-column: 2; grid-row: 1; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; white-space: nowrap; }
  .ds-header-actions { grid-column: 3; grid-row: 1; gap: 4px; }
  .ds-header-actions .ds-icon-button { width: 36px; height: 44px; padding: 9px; }
  .ds-header .theme-control { min-height: 42px; padding-inline: 6px; }
  .ds-header .theme-control > svg { display: none; }
  .ds-header .theme-control select { width: 73px; min-height: 40px; }
  .ds-main-nav { grid-column: 1 / -1; grid-row: 2; width: 100%; gap: 0; justify-content: space-between; }
  .ds-main-nav > a { min-height: 44px; padding: 0 5px; font-size: 12px; }
  .ds-main-nav .ds-facegpt-link { font-size: 11px; min-height: 30px; padding: 3px 8px; }
  .ds-main-nav > a[aria-current="page"]:not(.ds-facegpt-link)::after { bottom: 3px; }
  .dash-pillar { height: 150px; padding: 16px; }
  .dash-pillar > span:first-child { font-size: 13px; }
  .dash-pillar .dash-pillar-cta { font-size: 10px; }
  .dash-pillar > svg { opacity: .32; }
  .dash-card h2 { font-size: 20px; }
  .dash-overall-number { flex-direction: row; align-items: center; gap: 16px; }
  .dash-overall-number > strong { font-size: 46px; }
  .dash-progress { padding: 16px; }
  .dash-progress-body > p { font-size: 13px; line-height: 1.65; }
  .dash-progress-actions { align-items: flex-start; }
  .dash-card .dash-progress-cta { min-height: 44px; }
  .dash-card .dash-progress-secondary { display: inline-flex; align-items: center; min-height: 44px; }
  .dash-finding-list .dash-finding summary { padding-inline: 12px; font-size: 13px; }
}
@media (max-width: 360px) {
  .ds-mobile-brand span { display: none; }
  .ds-main-nav > a { padding-inline: 3px; font-size: 11px; }
  .ds-main-nav .ds-facegpt-link { padding-inline: 5px; }
}
