/* Compact operations composition. Shared appearance tokens own both palettes. */
.app-shell .app-sidebar { padding: 24px 14px 16px; gap: 28px; background: var(--dm-surface); }
.app-shell .sidebar-nav { gap: 4px; }
.app-shell .sidebar-nav .nav-link { min-height: 44px; font-size: 13px; }
.app-shell .app-main { padding: 28px 32px 40px; }
.app-shell .page-shell { gap: 22px; }
.app-shell .page-header { gap: 12px; }
.app-shell .page-title-block { gap: 8px; }
.app-shell .page-title { font-size: 26px; line-height: 1.25; letter-spacing: -.045em; }
.app-shell .page-subtitle { font-size: 13px; max-width: 75ch; }
.app-shell .context-nav { gap: 24px; }
.app-shell .context-link { min-height: 44px; padding-bottom: 11px; }
.app-shell .panel:not(.map-workspace-panel) { padding: 22px 24px; }
.app-shell .panel-header { margin-bottom: 16px; }
.app-shell .panel-title { font-size: 16px; }
.app-shell .panel-body { gap: 16px; }
.app-shell .panel-copy { font-size: 13px; }
.app-shell .workspace-metric { font-size: 12px; }
.app-shell .workspace-metrics { gap: 8px 20px; }

/* A single reading plane, with native expandable GPS actions below each row. */
.app-shell .participant-workspace { min-width: 0; }
.app-shell .participant-workspace > .panel { background: var(--dm-surface); box-shadow: none; }
.app-shell .participant-roster-toolbar { display: flex; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.app-shell .participant-roster-toolbar .field { flex: 1; min-width: 180px; max-width: 400px; }
.app-shell .participant-roster-count { font-size: 12px; color: var(--dm-muted); margin: 0 0 12px; }
.app-shell .participant-toolbar-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.app-shell .participant-roster { display: grid; gap: 0; min-width: 0; }
.app-shell .participant-roster-columns,
.app-shell .participant-roster-row { display: grid; grid-template-columns: 44px minmax(140px, 1fr) 126px 112px 84px 108px; column-gap: 12px; align-items: center; min-width: 0; }
.app-shell .participant-roster-columns { min-height: 38px; border-bottom: 1px solid var(--dm-line); color: var(--dm-muted); font-size: 11px; }
.app-shell .participant-roster-columns > :last-child { grid-column: 5 / 7; text-align: right; }
.app-shell .participant-roster-row { min-height: 76px; padding: 12px 0; border-bottom: 1px solid var(--dm-line); }
.app-shell .participant-roster-row:last-child { border-bottom: 0; }
.app-shell .participant-roster-row[hidden],
.app-shell .participant-search-empty[hidden] { display: none; }
.app-shell .participant-row-heading { display: contents; }
.app-shell .participant-bib { grid-column: 1; grid-row: 1; font-size: 13px; font-weight: 700; color: var(--dm-muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.app-shell .participant-row-identity { grid-column: 2; grid-row: 1; min-width: 0; }
.app-shell .participant-row-name { font-size: 14px; line-height: 1.45; font-weight: 750; margin: 0; overflow-wrap: anywhere; }
.app-shell .participant-row-identity p { display: inline; margin: 3px 8px 0 0; font-size: 11px; line-height: 1.6; color: var(--dm-muted); overflow-wrap: anywhere; }
.app-shell .participant-row-identity .participant-managed-note { display: block; margin-right: 0; }
.app-shell .participant-row-meta { grid-column: 3; grid-row: 1; display: flex; flex-wrap: wrap; gap: 4px 7px; align-items: center; font-size: 11px; color: var(--dm-muted); }
.app-shell .participant-row-meta .status-badge { font-size: 11px; padding: 2px 7px; }
.app-shell .participant-row-source { grid-column: 4; grid-row: 1; min-width: 0; color: var(--dm-muted); font-size: 12px; overflow-wrap: anywhere; }
.app-shell .participant-row-source a { display: inline-flex; align-items: center; min-height: 44px; }
.app-shell .participant-row-actions { grid-column: 5; grid-row: 1; display: flex; justify-content: end; align-items: center; }
.app-shell .participant-row-actions .button-link { min-height: 44px; padding: 10px 8px; font-size: 12px; background: transparent; border-color: transparent; color: var(--dm-muted); }
.app-shell .participant-row-actions .button-link:hover { background: var(--dm-surface-soft); color: var(--dm-text); }
.app-shell .participant-roster-row > .action-panel { grid-column: 1 / -1; min-width: 0; }
.app-shell .participant-disclosure { min-width: 0; }
.app-shell .participant-disclosure:not([open]) { grid-column: 6; grid-row: 1; }
.app-shell .participant-disclosure > summary { display: flex; gap: 6px; align-items: center; justify-content: end; min-height: 44px; padding: 8px 0; font-size: 12px; color: var(--dm-accent); cursor: pointer; list-style: none; }
.app-shell .participant-disclosure > summary::-webkit-details-marker { display: none; }
.app-shell .participant-disclosure > summary::after { content: '⌄'; font-size: 15px; }
.app-shell .participant-disclosure[open] { grid-column: 1 / -1; margin-top: 10px; padding: 0 16px 16px; background: var(--dm-surface-soft); border-radius: 8px; }
.app-shell .participant-disclosure[open] > summary { justify-content: start; }
.app-shell .participant-disclosure[open] > summary::after { content: '⌃'; }
.app-shell .participant-disclosure-body { padding: 4px 0 12px; }
.app-shell .participant-secondary-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.app-shell .participant-secondary-actions form { margin: 0; }
.app-shell .participant-gpx-panel .panel-header { padding: 0; margin-top: 8px; }
.app-shell .participant-gpx-panel .panel-body { padding: 0; }
.app-shell .participant-source-section { margin-top: 16px; display: grid; gap: 0; }
.app-shell .participant-source-card { border: 0; border-top: 1px solid var(--dm-line); border-radius: 0; background: transparent; padding: 16px 0; box-shadow: none; }
.app-shell .participant-search-empty { padding: 20px 0; font-size: 13px; }

/* Fractal source groups retain their real state and POST actions. */
.app-shell .stream-page-hint { font-size: 13px; max-width: 85ch; }
.app-shell .stream-help { margin-top: -12px; }
.app-shell .stream-group.panel { padding: 0; border: 0; border-radius: 0; background: transparent; }
.app-shell .stream-group + .stream-group { margin-top: 0; }
.app-shell .stream-group-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; padding: 12px 0; }
.app-shell .stream-group-heading .panel-title { font-size: 14px; }
.app-shell .stream-group-count { font-size: 11px; color: var(--dm-muted); }
.app-shell .stream-row { padding: 14px 0; gap: 16px; }
.app-shell .stream-row-copy { gap: 4px; }
.app-shell .stream-row-title { gap: 6px 12px; }
.app-shell .stream-role { font-size: 13px; }
.app-shell .stream-row-meta { font-size: 12px; }
.app-shell .stream-technical { font-size: 11px; }
.app-shell .stream-technical summary { display: inline-flex; align-items: center; min-height: 28px; cursor: pointer; }
.app-shell .stream-row-actions { max-width: none; gap: 4px 8px; }
.app-shell .stream-row-actions .button-secondary { font-size: 12px; padding: 10px 12px; background: transparent; border-color: var(--dm-line); }
.app-shell .stream-row-actions .button-secondary:hover { background: var(--dm-surface-soft); border-color: var(--dm-line-strong); }
.app-shell .stream-primary-hint { color: var(--dm-muted); font-size: 11px; }
.app-shell .stream-row.is-hidden .stream-role { color: var(--dm-muted); }
.app-shell .stream-map-switch { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 8px 10px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--dm-muted); font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; box-shadow: none; cursor: pointer; }
.app-shell .stream-map-switch:hover:not(:disabled) { background: var(--dm-surface-soft); color: var(--dm-text); transform: none; }
.app-shell .stream-map-switch:focus-visible { outline: 2px solid var(--dm-accent); outline-offset: 2px; }
.app-shell .stream-switch-track { position: relative; display: inline-block; width: 32px; height: 18px; flex: 0 0 32px; border: 1px solid var(--dm-line-strong); border-radius: 12px; background: var(--dm-surface-muted); }
.app-shell .stream-switch-track::before { content: ''; position: absolute; width: 12px; height: 12px; top: 2px; left: 2px; border-radius: 50%; background: var(--dm-muted); }
.app-shell .stream-map-switch[aria-checked="true"] .stream-switch-track { background: var(--dm-accent); border-color: var(--dm-accent); }
.app-shell .stream-map-switch[aria-checked="true"] .stream-switch-track::before { left: 16px; background: var(--dm-text-inverse); }
.app-shell .stream-map-switch.is-locked { opacity: 1; cursor: default; }
.app-shell .stream-primary-control { display: grid; justify-items: end; gap: 0; }
.app-shell .stream-primary-control .stream-primary-hint { padding-inline: 10px; font-size: 10px; }
.app-shell .stream-control-description { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.app-shell .stream-actions-menu { position: relative; flex: 0 0 44px; }
.app-shell .stream-actions-menu > summary { display: flex; align-items: center; justify-content: center; width: 44px; min-height: 44px; padding: 0; border: 1px solid transparent; border-radius: 7px; color: var(--dm-muted); font-size: 24px; line-height: 1; cursor: pointer; list-style: none; }
.app-shell .stream-actions-menu > summary::-webkit-details-marker { display: none; }
.app-shell .stream-actions-menu > summary:hover,
.app-shell .stream-actions-menu[open] > summary { color: var(--dm-text); background: var(--dm-surface-soft); }
.app-shell .stream-actions-popover { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; width: 250px; max-width: calc(100vw - 48px); padding: 5px; border: 1px solid var(--dm-line); border-radius: 8px; background: var(--dm-surface); box-shadow: var(--dm-shadow); }
.app-shell .stream-primary-action { display: block; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 5px; background: transparent; color: var(--dm-text); font: inherit; font-size: 12px; line-height: 1.5; text-align: left; white-space: normal; box-shadow: none; cursor: pointer; }
.app-shell .stream-primary-action:hover { background: var(--dm-surface-soft); transform: none; }

@media (max-width: 1200px) {
  .app-shell .app-main { padding-inline: 24px; }
  .app-shell .participant-roster-columns,
  .app-shell .participant-roster-row { grid-template-columns: 36px minmax(0, 1fr) 102px 92px 76px 100px; gap: 10px; }
}
@media (max-width: 960px) {
  .app-shell .app-main { padding: 24px 20px 36px; }
  .app-shell .page-shell { gap: 20px; }
}
@media (max-width: 760px) {
  .app-shell .participant-roster-columns { display: none; }
  .app-shell .participant-roster-row { grid-template-columns: 32px minmax(0, 1fr) 98px; gap: 3px 8px; padding: 12px 0; border-top: 1px solid var(--dm-line); border-bottom: 0; }
  .app-shell .participant-row-meta { grid-column: 2; grid-row: 2; }
  .app-shell .participant-row-source { grid-column: 2; grid-row: 3; font-size: 11px; }
  .app-shell .participant-row-source a { min-height: 30px; }
  .app-shell .participant-row-actions { grid-column: 3; grid-row: 1; align-self: start; }
  .app-shell .participant-disclosure:not([open]) { grid-column: 3; grid-row: 2 / 4; align-self: start; }
  .app-shell .participant-disclosure > summary { text-align: right; font-size: 11px; }
  .app-shell .participant-disclosure[open] { margin-top: 8px; padding-inline: 12px; }
  .app-shell .participant-roster-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 8px; }
  .app-shell .participant-roster-toolbar .field { grid-column: 1 / -1; min-width: 0; max-width: none; }
  .app-shell .participant-roster-count { margin: 0; white-space: normal; align-self: center; }
  .app-shell .participant-toolbar-actions { margin-left: 0; flex-wrap: nowrap; }
  .app-shell .participant-toolbar-actions .button-link { padding: 10px 12px; font-size: 12px; }
}
@media (max-width: 600px) {
  .app-shell .app-main { padding: 20px 16px 32px; }
  .app-shell .page-shell { gap: 18px; }
  .app-shell .page-title { font-size: 23px; }
  .app-shell .panel:not(.map-workspace-panel) { padding: 18px 16px; }
  .app-shell .stream-group.panel { padding: 0; }
  .app-shell .participant-workspace > .panel > .panel-header { display: none; }
  .app-shell .participant-roster-toolbar .field-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .app-shell .stream-row { gap: 10px; padding: 12px 0; }
  .app-shell .stream-row-actions { justify-content: start; width: 100%; }
  .app-shell .stream-row-actions > :is(a, button, form) { flex: 0 1 auto; width: auto; }
  .app-shell .stream-row-actions form > button { width: auto; }
  .app-shell .stream-actions-menu { margin-left: auto; }
  .app-shell .stream-actions-popover form > .stream-primary-action { width: 100%; }
  .app-shell .stream-primary-control { justify-items: start; }
  .app-shell .stream-group-heading { padding-top: 8px; }
}
.app-shell .readiness-gps-status { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 20px; }
.app-shell .gps-freshness-counts { list-style: none; padding: 0; margin: 16px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.app-shell .gps-freshness-counts li { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.app-shell .gps-freshness-counts strong { font-variant-numeric: tabular-nums; font-size: 18px; }
.app-shell .gps-freshness-counts [data-gps-state="current"] strong { color: var(--success); }
.app-shell .gps-freshness-counts [data-gps-state="lost"] strong { color: var(--warning); }
.app-shell .diagnostics-picker { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 24px; }
.app-shell .diagnostics-picker label { display: grid; flex: 1 1 220px; min-width: 0; gap: 6px; font-size: 13px; color: var(--muted); }
.app-shell .diagnostics-picker select { width: 100%; min-width: 0; min-height: 44px; }
.app-shell .diagnostics-summary { padding: 20px 0; border-block: 1px solid var(--line); margin-bottom: 20px; }
.app-shell .diagnostics-summary-heading { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.app-shell .diagnostics-summary[data-gps-reception="current"] .panel-title { color: var(--success); }
.app-shell .diagnostics-summary[data-gps-reception="stale"] .panel-title { color: var(--warning); }
.app-shell .diagnostics-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 20px 0; }
.app-shell .diagnostics-facts dl { margin: 0; min-width: 0; }
.app-shell .diagnostics-facts dt { color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.app-shell .diagnostics-facts dd { margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.app-shell .diagnostics-decision { border-left: 2px solid var(--accent); padding-left: 14px; }
.app-shell .diagnostics-decision h3 { font-size: 13px; margin-bottom: 6px; }
.app-shell .diagnostics-decision p { font-size: 14px; }
.app-shell .diagnostics-statistics summary { min-height: 44px; padding-block: 10px; cursor: pointer; }
.app-shell .diagnostics-position { margin-block: 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.app-shell .diagnostics-position h3 { margin: 0 0 6px; font-size: 14px; }
.app-shell .diagnostics-position p { margin: 0; }
.app-shell .diagnostics-position[data-gps-position="current"] h3 { color: var(--success); }
.app-shell .diagnostics-position[data-gps-position="stale"] h3 { color: var(--warning); }
.app-shell .diagnostics-delivery { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; padding: 0; margin: 20px 0 12px; list-style: none; border-block: 1px solid var(--line); }
.app-shell .diagnostics-delivery li { display: grid; gap: 7px; padding: 16px 12px; min-width: 0; align-content: start; }
.app-shell .diagnostics-delivery span { font-size: 12px; color: var(--muted); }
.app-shell .diagnostics-delivery strong { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.app-shell .diagnostics-delivery small { font-size: 12px; color: var(--muted); }
.app-shell :is(.stream-gps-reception,.stream-gps-position) { margin: 4px 0; font-size: 12px; line-height: 1.5; }
.app-shell .stream-gps-position { color: var(--muted); }
.app-shell .stream-gps-reception[data-gps-reception="current"] { color: var(--success); }
.app-shell .stream-gps-reception[data-gps-reception="stale"] { color: var(--warning); }
.app-shell .stream-diagnostics-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; }
@media (max-width: 600px) {
  .app-shell .gps-freshness-counts, .app-shell .diagnostics-facts { grid-template-columns: minmax(0, 1fr); }
  .app-shell .diagnostics-picker { align-items: stretch; }
  .app-shell .diagnostics-picker label { flex-basis: 100%; }
}
@media (max-width: 360px) {
  .app-shell .app-main { padding-inline: 12px; }
  .app-shell .panel:not(.map-workspace-panel) { padding-inline: 12px; }
  .app-shell .stream-group.panel { padding-inline: 0; }
  .app-shell .participant-roster-row { grid-template-columns: 28px minmax(0, 1fr) 88px; column-gap: 6px; }
  .app-shell .participant-row-name { font-size: 13px; }
  .app-shell .participant-toolbar-actions { gap: 4px; }
  .app-shell .participant-toolbar-actions .button-link { padding-inline: 8px; }
}
.app-shell .battery-history { min-width: 0; max-width: 100%; }
.app-shell .battery-facts { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.app-shell .battery-facts dd.field-hint { margin-top: 6px; font-size: 12px; }
.app-shell .battery-chart { position: relative; padding-left: 26px; }
.app-shell .battery-chart svg { display: block; width: 100%; height: clamp(170px, 20vw, 240px); overflow: visible; }
.app-shell .battery-chart-level { position: absolute; left: 0; transform: translateY(-50%); color: var(--muted); font: 11px var(--dm-font-code); }
.app-shell .battery-grid { stroke: var(--line); stroke-width: 1; }
.app-shell .battery-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.app-shell .battery-dot { fill: var(--accent); }
.app-shell .battery-chart-times { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font: 11px/1.5 var(--dm-font-code); font-variant-numeric: tabular-nums; }
.app-shell .battery-chart-times span { min-width: 0; overflow-wrap: anywhere; }
.app-shell .battery-chart-times span:last-child { text-align: right; }
.app-shell .battery-table { max-width: 100%; max-height: 350px; overflow: auto; }
.app-shell .battery-table table { min-width: 0; width: 100%; }
.app-shell .diagnostic-battery { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font: 600 13px/1.4 var(--dm-font-code); font-variant-numeric: tabular-nums; }
.app-shell .diagnostic-battery-icon { position: relative; display: inline-block; flex: none; width: 23px; height: 13px; padding: 2px; border: 1.5px solid currentColor; border-radius: 3px; box-sizing: border-box; color: var(--success); }
.app-shell .diagnostic-battery-icon::after { content: ''; position: absolute; right: -4px; top: 3px; width: 2px; height: 4px; border-radius: 0 1px 1px 0; background: currentColor; }
.app-shell .diagnostic-battery-fill { display: block; height: 100%; width: var(--battery-level, 0%); background: currentColor; border-radius: 1px; }
.app-shell .diagnostic-battery[data-battery-tone='unknown'] { color: var(--muted); }
.app-shell .diagnostic-battery[data-battery-tone='unknown'] .diagnostic-battery-icon { color: var(--muted); border-style: dashed; }
.app-shell .diagnostic-battery[data-battery-tone='low'] { color: var(--warning); }
.app-shell .diagnostic-battery[data-battery-tone='critical'] { color: var(--danger); }
.app-shell .diagnostic-battery:is([data-battery-tone='low'], [data-battery-tone='critical']) .diagnostic-battery-icon { color: inherit; }
.app-shell .diagnostic-battery small { color: var(--muted); font-weight: 400; }
