/* Refined operations workspace. Loaded after the canonical layout stylesheet. */
:root {
  --dm-bg: #0c111a;
  --dm-bg-elevated: #101722;
  --dm-surface: #141d29;
  --dm-surface-soft: #1a2635;
  --dm-surface-muted: #233144;
  --dm-line: #2a384b;
  --dm-line-strong: #536882;
  --dm-text: #eff4fc;
  --dm-muted: #aab8cb;
  --dm-text-inverse: #101a2a;
  --dm-accent: #83adff;
  --dm-accent-strong: #bad1ff;
  --dm-accent-soft: #1c304d;
  --dm-shadow: 0 18px 48px rgba(3, 8, 15, .3);
  --dm-shadow-soft: 0 3px 12px rgba(3, 8, 15, .12);
  --dm-radius-xl: 16px;
  --dm-radius-lg: 12px;
  --dm-radius-md: 8px;
}

:is(.app-shell, .access-shell) {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
.app-shell .app-sidebar {
  background: var(--dm-bg-elevated);
  padding-top: 30px;
  gap: 36px;
}
.app-shell .sidebar-brand { gap: 11px; }
.app-shell .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--dm-accent);
  color: var(--dm-text-inverse);
  border-color: var(--dm-accent);
  letter-spacing: -.05em;
}
.app-shell .brand-title { font-weight: 800; letter-spacing: -.045em; }
.app-shell .sidebar-nav { gap: 7px; }
.app-shell .sidebar-nav .nav-link {
  min-height: 46px;
  border: 1px solid transparent;
  font-weight: 600;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.app-shell .sidebar-nav .nav-link:hover {
  background: var(--dm-surface-soft);
  color: var(--dm-text);
}
.app-shell .sidebar-nav .nav-link.is-active {
  background: var(--dm-accent-soft);
  border-color: color-mix(in srgb, var(--dm-accent) 21%, var(--dm-line));
  color: var(--dm-accent-strong);
  box-shadow: inset 3px 0 var(--dm-accent);
}
.app-shell .sidebar-footer { gap: 16px; line-height: 1.6; }
.app-shell .app-main { padding-top: 34px; }
.app-shell .page-shell { gap: 26px; }
.app-shell .page-header { gap: 18px; }
.app-shell .page-title-block { gap: 10px; }
.app-shell .page-title {
  font-weight: 800;
  font-size: clamp(25px, 2.25vw, 32px);
  line-height: 1.22;
  letter-spacing: -.04em;
}
.app-shell .workspace-event-context { font-size: 13px; gap: 10px; }
.app-shell .workspace-event-state {
  border-color: var(--dm-line);
  background: var(--dm-surface);
  border-radius: 5px;
  padding: 3px 8px;
  color: var(--dm-text);
  font-size: 12px;
}
.app-shell .workspace-metrics { gap: 10px 24px; }
.app-shell .workspace-metric {
  padding: 0;
  border: 0;
  border-radius: 0;
  font-weight: 400;
  color: var(--dm-muted);
}
.app-shell .workspace-metric-value { font-weight: 750; font-variant-numeric: tabular-nums; }
.app-shell .context-navigation { gap: 16px; }
.app-shell .context-nav { gap: 26px; }
.app-shell .context-link {
  min-height: 48px;
  padding-bottom: 13px;
  font-weight: 600;
  transition: color .15s ease, border-color .15s ease;
}
.app-shell .context-link:hover { text-decoration: none; color: var(--dm-text); }
.app-shell .context-link.is-active { color: var(--dm-accent-strong); }
.app-shell .context-extras > summary { min-height: 44px; }
.app-shell .context-extra-links {
  padding: 6px;
  min-width: 210px;
  border-radius: 10px;
  background: var(--dm-surface-soft);
}
.app-shell .context-extra-links .context-link { min-height: 44px; border-radius: 6px; }
.app-shell .context-extra-links .context-link:hover { background: var(--dm-surface-muted); }
.app-shell .context-extra-links .context-link.is-active { background: var(--dm-accent-soft); }

.app-shell .panel:not(.map-workspace-panel) { padding: 24px; box-shadow: none; }
.app-shell .panel-header { margin-bottom: 20px; gap: 6px; }
.app-shell .panel-title { font-size: 17px; line-height: 1.4; letter-spacing: -.02em; font-weight: 750; }
.app-shell .panel-body { gap: 18px; }
:is(.app-shell, .access-shell) :is(.field-hint, .panel-copy, .page-subtitle) {
  color: var(--dm-muted);
  line-height: 1.6;
}
:is(.app-shell, .access-shell) .field { min-width: 0; gap: 8px; }
:is(.app-shell, .access-shell) .field-label { font-size: 13px; font-weight: 650; }
:is(.app-shell, .access-shell) .form-stack { gap: 20px; }
:is(.app-shell, .access-shell) :is(.field input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]), .field select, .field textarea) {
  min-height: 46px;
  padding: 11px 13px;
  background: var(--dm-bg-elevated);
  color: var(--dm-text);
  border: 1px solid var(--dm-line-strong);
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.4;
  box-shadow: none;
}
:is(.app-shell, .access-shell) .field :is(input, textarea)::placeholder { color: var(--dm-muted); opacity: .8; }
:is(.app-shell, .access-shell) .field :is(input, select, textarea):focus-visible {
  border-color: var(--dm-accent);
  outline: 2px solid var(--dm-accent);
  outline-offset: 2px;
  box-shadow: none;
}
:is(.app-shell, .access-shell) .checkbox-row {
  min-height: 44px;
  padding: 12px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  align-items: center;
}
:is(.app-shell, .access-shell) .checkbox-row input { accent-color: var(--dm-accent); flex: 0 0 auto; }
:is(.app-shell, .access-shell) :is(.button-link, .button-primary, .button-secondary, .button-ghost, .button-danger) {
  min-height: 44px;
  padding: 11px 15px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  box-shadow: none;
}
:is(.app-shell, .access-shell) :is(.button-link, .button-primary, .button-secondary, .button-ghost, .button-danger):hover { transform: none; }
:is(.app-shell, .access-shell) .button-primary {
  background: var(--dm-accent);
  border-color: var(--dm-accent);
  color: var(--dm-text-inverse);
}
:is(.app-shell, .access-shell) .button-primary:hover:not(:disabled) { background: var(--dm-accent-strong); border-color: var(--dm-accent-strong); }
:is(.app-shell, .access-shell) .button-secondary { background: var(--dm-surface-soft); border-color: var(--dm-line-strong); color: var(--dm-text); }
:is(.app-shell, .access-shell) .button-secondary:hover:not(:disabled) { background: var(--dm-surface-muted); border-color: var(--dm-muted); }
:is(.app-shell, .access-shell) .button-ghost { background: transparent; border-color: var(--dm-line); color: var(--dm-muted); }
:is(.app-shell, .access-shell) .button-ghost:hover:not(:disabled) { background: var(--dm-surface-soft); border-color: var(--dm-line-strong); color: var(--dm-text); }
:is(.app-shell, .access-shell) .button-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--dm-danger) 18%, var(--dm-surface)); border-color: var(--dm-danger); }
:is(.app-shell, .access-shell) :is(a, button, summary):focus-visible { outline: 2px solid var(--dm-accent); outline-offset: 3px; }
:is(.app-shell, .access-shell) .notice {
  padding: 15px 18px;
  border-radius: 8px;
  box-shadow: inset 3px 0 currentColor;
  font-size: 14px;
  line-height: 1.6;
}
.app-shell :is(.status-badge, .meta-pill) {
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}
.app-shell .meta-list { gap: 0; }
.app-shell .meta-row { padding: 11px 0; border-bottom: 1px solid var(--dm-line); font-size: 13px; }
.app-shell .meta-row:last-child { border-bottom: 0; }
.app-shell .meta-label { color: var(--dm-muted); font-weight: 500; }
.app-shell .meta-value { overflow-wrap: anywhere; }
.app-shell .empty-state { background: transparent; padding: 32px 20px; gap: 12px; }
.app-shell .broadcast-row.entity-card { padding: 22px 0; gap: 20px; }
.app-shell .broadcast-row-main .entity-title { font-weight: 700; letter-spacing: -.02em; }
.app-shell .auxiliary-library-list > .entity-card { padding: 20px 0; }
.app-shell .action-panel { background: transparent; border-color: var(--dm-line); }
.app-shell .action-panel > summary { padding: 14px 16px; font-weight: 650; color: var(--dm-accent-strong); }
.app-shell .action-panel > summary:hover { background: var(--dm-surface-soft); }
.app-shell .action-panel[open] > summary { border-bottom: 1px solid var(--dm-line); }
.app-shell .action-panel > .action-panel-content { padding: 20px; }
.app-shell .action-panel-content > .panel:not(.map-workspace-panel) { padding: 0; border: 0; background: transparent; }
.app-shell .workspace-dialog { background: var(--dm-surface); padding: 30px; }
.app-shell .workspace-dialog::backdrop { background: rgba(4, 9, 17, .75); }
.app-shell .workspace-dialog-header { margin-bottom: 26px; padding-bottom: 22px; }
.app-shell .workspace-dialog-header h2 { font-weight: 750; letter-spacing: -.03em; }
.app-shell .workspace-dialog > .action-panel-content { padding: 0; }
.app-shell .event-publication { background: var(--dm-bg-elevated); }
.app-shell .readiness-next { padding: 16px; border-left: 2px solid var(--dm-accent); border-radius: 0 8px 8px 0; }
.app-shell .readiness-step-number { font-family: var(--dm-font-code); font-size: 12px; }
.app-shell .readiness-step-title { font-size: 14px; font-weight: 700; }
.app-shell .participant-row-name { font-weight: 700; letter-spacing: -.015em; }
.app-shell table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.5; }
.app-shell :is(th, td) { padding: 14px 12px; border-bottom: 1px solid var(--dm-line); text-align: left; }
.app-shell th { color: var(--dm-muted); font-weight: 600; background: var(--dm-bg-elevated); }
.app-shell td { font-variant-numeric: tabular-nums; }

/* Streams share one reading plane: role, title, access state, then actions. */
.app-shell .stream-group { min-width: 0; }
.app-shell .stream-group + .stream-group { margin-top: 12px; }
.app-shell .stream-list { display: grid; gap: 0; min-width: 0; }
.app-shell .stream-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
  padding: 22px 0;
  border: 0;
  border-top: 1px solid var(--dm-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.app-shell .stream-row-copy { display: grid; gap: 8px; flex: 1; min-width: 0; }
.app-shell .stream-row-title { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; font-size:16px; line-height:1.45; overflow-wrap:anywhere; }
.app-shell .stream-row-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; font-size: 13px; color: var(--dm-muted); }
.app-shell .stream-row-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; flex: 0 1 auto; }
.app-shell .stream-row-actions form { margin: 0; }
.app-shell .stream-role { margin:0; color:var(--dm-text); font-size:15px; font-weight:700; line-height:1.5; }
.app-shell .stream-visibility { display:inline-flex; align-items:center; padding:3px 8px; border-radius:6px; background:var(--dm-accent-soft); color:var(--dm-accent-strong); font-size:11px; font-weight:600; }
.app-shell .stream-visibility[data-hidden="true"] { background:var(--dm-surface-soft); color:var(--dm-muted); }
.app-shell .stream-page-hint { color:var(--dm-muted); font-size:14px; line-height:1.6; }
.app-shell .stream-help { color:var(--dm-muted); font-size:13px; line-height:1.6; }
.app-shell .stream-help>summary { cursor:pointer; padding-block:8px; }
.app-shell .stream-help>p { max-width:80ch; padding-block:8px; }
.app-shell .stream-primary-hint { color:var(--dm-accent-strong); font-size:12px; }
.app-shell .stream-technical { color: var(--dm-muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }

.access-shell { background: var(--dm-bg); padding: 40px 20px; min-height: 100dvh; }
.access-shell .access-frame { width: min(100%, 460px); }
.access-shell .access-card {
  padding: 36px;
  gap: 28px;
  border: 1px solid var(--dm-line);
  border-radius: 16px;
  background: var(--dm-surface);
}
.access-shell .access-card::before { height: 2px; background: var(--dm-accent); }
.access-shell .access-header { gap: 14px; }
.access-shell .kicker { color: var(--dm-accent-strong); font-size: 11px; letter-spacing: .12em; }
.access-shell .access-title { font-size: clamp(28px, 6vw, 36px); font-weight: 800; line-height: 1.15; letter-spacing: -.045em; }
.access-shell .access-subtitle { font-size: 14px; line-height: 1.7; }
.access-shell .form-actions > :is(button, .button-link) { width: 100%; }
.access-shell .access-links { gap: 12px; font-size: 13px; }
.access-shell .access-links a { min-height: 44px; display: inline-flex; align-items: center; }

@media (max-width: 1100px) {
  .app-shell .app-main { padding-top: 28px; }
  .app-shell .stream-row { align-items: flex-start; gap: 16px; }
  .app-shell .stream-row-actions { max-width: 46%; }
}
@media (max-width: 960px) {
  .app-shell .app-main { padding: 24px 20px 36px; }
  .app-shell .page-shell { gap: 20px; }
  .app-shell .workspace-mobile-nav { background: var(--dm-bg-elevated); }
  .app-shell .workspace-mobile-nav > summary { min-height: 56px; padding: 14px 20px; letter-spacing: -.02em; }
  .app-shell .workspace-mobile-nav nav { padding: 8px; background: var(--dm-surface-soft); }
  .app-shell .workspace-mobile-nav nav a { min-height: 46px; border-radius: 6px; font-size: 14px; }
  .app-shell .workspace-mobile-nav nav a:hover { background: var(--dm-surface-muted); text-decoration: none; }
  .app-shell .context-nav { gap: 22px; }
}
@media (max-width: 600px) {
  .app-shell .app-main { padding: 22px 16px 32px; }
  .app-shell .page-shell { gap: 18px; }
  .app-shell .page-header { gap: 14px; }
  .app-shell .page-title { font-size: 25px; }
  .app-shell .panel:not(.map-workspace-panel) { padding: 18px 16px; }
  .app-shell .panel-header { margin-bottom: 16px; }
  .app-shell .panel-title { font-size: 16px; }
  .app-shell .context-nav { gap: 18px; }
  .app-shell .context-link { font-size: 13px; min-height: 46px; padding-bottom: 12px; }
  .app-shell .context-extras > summary { min-width: 44px; text-align: center; }
  .app-shell .context-extra-links { min-width: 190px; }
  .app-shell .action-panel > .action-panel-content { padding: 16px; }
  .app-shell .action-panel-content > .panel:not(.map-workspace-panel) { padding: 0; }
  .app-shell .workspace-dialog { padding: 24px 16px; }
  .app-shell .workspace-dialog-header { gap: 12px; margin-bottom: 22px; }
  .app-shell .workspace-dialog-header h2 { font-size: 20px; }
  .app-shell .broadcast-row.entity-card { gap: 12px; padding: 18px 0; }
  .app-shell .stream-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px 0; }
  .app-shell .stream-row-copy { gap: 7px; }
  .app-shell .stream-row-title { font-size: 15px; }
  .app-shell .stream-row-actions { width: 100%; max-width: none; justify-content: flex-start; }
  .app-shell .stream-row-actions > :is(a, button, form) { flex: 1 1 100%; width: 100%; }
  .app-shell .stream-row-actions form > button { width: 100%; }
  .app-shell :is(th, td) { padding: 12px 8px; }
  .access-shell { padding: 24px 16px; }
  .access-shell .access-card { padding: 28px 22px; gap: 24px; }
  .access-shell .access-links { align-items: stretch; }
}
@media (max-width: 360px) {
  .app-shell .app-main { padding-inline: 12px; }
  .app-shell .panel:not(.map-workspace-panel) { padding-inline: 12px; }
  .app-shell .page-header .action-bar { align-items: stretch; }
  .app-shell .page-header .action-bar .button-link { flex-basis: 100%; }
  .access-shell .access-card { padding: 24px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  :is(.app-shell, .access-shell) :is(.button-link, .button-primary, .button-secondary, .button-ghost, .button-danger, .nav-link, .context-link) { transition: none; }
}

/* All Leaflet tile layers currently use OSM. Uploaded raster maps and GPS overlays
   live in separate panes and must retain their original colors. */
html[data-theme="dark"] .leaflet-container { background:var(--dm-surface-soft); }
html[data-theme="dark"] .leaflet-tile-pane {
 filter:invert(.92) hue-rotate(180deg) saturate(.65) brightness(.85) contrast(.92);
}
