:root {
  --canvas-font-scale: 1.0;
  --canvas-pan-x: 0px;
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-card: #1c1c1c;
  --accent-cyan: #00ffcc;
  --accent-green: #00ff66;
  --accent-amber: #ffaa00;
  --accent-red: #ff3344;
  --text-main: #F1F5F9;
  --text-muted: #CBD5E1;
  --border-color: #2a2a2a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "JetBrains Mono", monospace;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  font-size: 16px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-container img {
  width: 36px;
  height: 36px;
}

h1 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-amber);
}

.status-dot.connected {
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  flex: 1;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

/* Entry Portal Card */
.entry-card {
  margin: 1.5rem auto;
  max-width: 560px;
  width: 100%;
  text-align: center;
  padding: 2.25rem 1.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.entry-header {
  margin-bottom: 1.25rem;
}

.welcome-avatar-vector {
  max-height: 150px;
  width: auto;
  margin: 0 auto 1rem auto;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(124, 58, 237, 0.35));
  transition: transform 0.2s ease;
}

.welcome-hero-box,
.welcome-hero-container {
  text-align: center;
  margin: 1rem 0 1.5rem 0;
}

.welcome-cat-img,
.welcome-cat-hero {
  max-height: 220px;
  width: auto;
  max-width: 90%;
  display: inline-block;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
  transition: transform 0.2s ease;
}

.welcome-cat-img:hover,
.welcome-cat-hero:hover {
  transform: scale(1.02);
}

.entry-icon {
  font-size: 2.75rem;
  margin-bottom: 0.5rem;
}

.entry-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 0.25rem;
  letter-spacing: 0.05em;
}

.entry-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
}

.entry-body {
  margin-bottom: 1.75rem;
}

.entry-claim {
  font-size: 1.15rem;
  line-height: 1.5;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.entry-callout {
  font-size: 1.05rem;
  line-height: 1.5;
  font-weight: 500;
  color: var(--accent-cyan);
  margin-bottom: 1.25rem;
}

.entry-benefits {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.entry-benefits li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.entry-benefits li strong {
  color: var(--text-main);
  font-weight: 600;
}

.benefit-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.entry-text {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-main);
}

.action-slot {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-action-primary {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #00ffcc, #00ff66);
  color: #000;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 16px rgba(0, 255, 150, 0.25);
}

.btn-action-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 255, 150, 0.4);
}

.btn-action-primary:active {
  transform: translateY(1px);
}

.btn-action-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.action-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  min-height: 1.2rem;
  margin-top: 0.5rem;
}

.personal-space {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
}

.card-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.pilot-id-display {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-cyan);
  font-family: "JetBrains Mono", monospace;
  word-break: break-all;
  margin-bottom: 0.5rem;
}

.pubkey-display {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
  word-break: break-all;
}

.button-group {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

button {
  background: var(--bg-card);
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

button:hover {
  background: var(--accent-cyan);
  color: #000;
}

button.btn-secondary {
  border-color: var(--border-color);
  color: var(--text-main);
}

button.btn-secondary:hover {
  background: var(--border-color);
}

.terminal-box {
  background: #000;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.75rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  min-height: 180px;
  max-height: 240px;
  overflow-y: auto;
  color: #00ff66;
}

.terminal-line {
  margin-bottom: 0.35rem;
  line-height: 1.4;
}

.terminal-line.error {
  color: var(--accent-red);
}

.terminal-line.info {
  color: var(--accent-cyan);
}

@keyframes mic-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 51, 68, 0.7); border-color: var(--accent-red); }
  70% { box-shadow: 0 0 0 10px rgba(255, 51, 68, 0); border-color: var(--accent-red); }
  100% { box-shadow: 0 0 0 0 rgba(255, 51, 68, 0); border-color: var(--accent-red); }
}

.mic-recording {
  border-color: var(--accent-red) !important;
  animation: mic-pulse 1.2s infinite;
  background-color: rgba(255, 51, 68, 0.25) !important;
}

/* Canvas Dashboard Header & Badge */
.canvas-header-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: linear-gradient(180deg, #181818 0%, #111111 100%);
  border: 1px solid #333333;
}

.canvas-hero-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.canvas-greeting {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.canvas-status-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--accent-green);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.pilot-pill-slot {
  display: flex;
  align-items: center;
}

.pilot-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #000;
  border: 1px solid #3a3a3a;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  color: var(--accent-cyan);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pilot-badge-pill:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.25);
  transform: translateY(-1px);
}

.pilot-badge-prefix {
  color: var(--text-muted);
  font-weight: 500;
}

.copy-badge-icon {
  font-size: 0.85rem;
  opacity: 0.75;
}

.canvas-toolbar-row {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #222;
  padding-top: 0.5rem;
}

.btn-subtle-toggle {
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed #3a3a3a;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-subtle-toggle:hover {
  color: var(--text-main);
  border-color: #666;
  background: #1c1c1c;
}

/* Canvas Viewport Geometry & Containers */
.canvas-container {
  touch-action: pan-y;
  overflow-x: hidden;
  position: relative;
  width: 100%;
}

.canvas-surface {
  transform: translateX(var(--canvas-pan-x));
  will-change: transform;
  width: 100%;
}

/* 4 Action Tiles Grid (2x2 Mobile) */
.action-tiles-grid,
.tiles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
}

@media (max-width: 640px) {
  .action-tiles-grid,
  .tiles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

@media (min-width: 641px) {
  .action-tiles-grid,
  .tiles-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

.action-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.1rem 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.action-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
  box-shadow: 0 6px 16px rgba(0, 255, 204, 0.15);
}

.action-tile:active {
  transform: translateY(1px);
}

.tile-icon {
  --base-size: 2rem;
  font-size: calc(var(--base-size) * var(--canvas-font-scale));
  margin-bottom: 0.4rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.tile-title {
  --base-size: 0.95rem;
  font-size: calc(var(--base-size) * var(--canvas-font-scale));
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.tile-desc {
  --base-size: 0.75rem;
  font-size: calc(var(--base-size) * var(--canvas-font-scale));
  color: var(--text-muted);
  line-height: 1.3;
}

/* Floating Context Menu */
.context-menu-card {
  position: fixed;
  background: #1c1c1c;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.35rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 190px;
}

.context-menu-item {
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-radius: 4px;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s ease;
}

.context-menu-item:hover, .context-menu-item:active {
  background: #2a2a2a;
  color: var(--accent-cyan);
}

.slot-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Note Modal Dialog */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  width: 100%;
  max-width: 420px;
  padding: 1.25rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.85rem;
}

.modal-textarea {
  width: 100%;
  box-sizing: border-box;
  background: #0d0d0d;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-main);
  padding: 0.75rem;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 1rem;
}

.modal-textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.modal-button-group {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Collapsible Diagnostics Drawer */
.diagnostics-drawer {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-color);
}

/* Universal Data Grid Container & Touch Scroll */
.grid-table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: #111111;
}

/* History Controls (Undo / Redo) */
.history-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-history {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.15s ease;
}

.btn-history:hover:not(:disabled) {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: #242424;
}

.btn-history:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: #222;
}

/* Info Modal Button in Header */
.info-icon-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  margin-left: 0.5rem;
  transition: all 0.15s ease;
}

.info-icon-btn:hover, .info-icon-btn:active {
  background: #222;
  border-color: var(--accent-cyan);
}

/* Info Modal Overlay and Card */
.info-modal-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 100%;
  max-width: 460px;
  padding: 1.5rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75);
}

.info-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: 6px;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  color: var(--accent-red);
  background: rgba(255, 51, 68, 0.15);
}

.version-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0.85rem;
  background: #141414;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
}

.badge-uptodate {
  background: rgba(0, 255, 102, 0.12);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-update-action {
  background: linear-gradient(135deg, #00ffcc, #00bb88);
  border: none;
  color: #000;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 255, 204, 0.3);
  transition: transform 0.1s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-update-action:active {
  transform: scale(0.97);
}

.btn-update-action:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Focus Note Canvas (P0 Ergonomie, Fail-Open, Režim soustředění) */
#focus-note-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #0c1017;
  overflow: hidden;
  z-index: 9999;
  box-sizing: border-box;
}

.focus-note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 48px;
  gap: 0.75rem;
}

.header-title-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary, #ffffff);
}

.header-icon-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.depth-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent-cyan, #00f0ff);
  background: rgba(0, 240, 255, 0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.clarity-badge {
  font-size: 1rem;
  cursor: default;
  user-select: none;
}

.header-close {
  background: transparent;
  border: none;
  color: var(--text-muted, #8e9bb0);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.5rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.header-close:hover {
  color: #ffffff;
}

.layout-hand-right .header-close {
  order: 2;
  margin-left: auto;
}

.layout-hand-left .header-close {
  order: 0;
  margin-right: auto;
}

#focus-canvas-textarea,
#note-input-area,
.focus-note-textarea {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  padding: 16px;
  overflow-y: auto;
  font-size: 18px;
  line-height: 1.6;
  font-family: inherit;
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  resize: none;
}

#focus-canvas-textarea::placeholder,
#note-input-area::placeholder {
  color: var(--text-muted, #55627a);
}

#canvas-action-dock,
.focus-note-footer {
  flex-shrink: 0;
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: #0c1017;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-input-mode {
  flex: 1;
  min-height: 48px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary, #ffffff);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-input-mode:active {
  background: rgba(255, 255, 255, 0.12);
}

.footer-submit {
  flex: 1;
  min-height: 48px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #00ffcc, #00bb88);
  color: #0b0f19;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-shadow: 0 4px 14px rgba(0, 255, 204, 0.35);
  transition: transform 0.1s ease, filter 0.15s ease;
}

.footer-submit:active {
  transform: scale(0.98);
}

.layout-hand-right .footer-submit {
  order: 2;
}

.layout-hand-left .footer-submit {
  order: 0;
}

/* Kognitivní semafor zanoření (depth indicator) */
.depth-indicator-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.1s ease, background 0.2s ease, border-color 0.2s ease;
  user-select: none;
}

.depth-indicator-badge:active {
  transform: scale(0.96);
}

.badge-green {
  background: rgba(0, 255, 102, 0.12);
  border-color: rgba(0, 255, 102, 0.4);
  color: #00ff66;
}

.badge-yellow {
  background: rgba(255, 187, 0, 0.15);
  border-color: rgba(255, 187, 0, 0.5);
  color: #ffbb00;
  box-shadow: 0 0 10px rgba(255, 187, 0, 0.25);
}

.badge-red {
  background: rgba(255, 51, 85, 0.2);
  border-color: rgba(255, 51, 85, 0.6);
  color: #ff3355;
  box-shadow: 0 0 14px rgba(255, 51, 85, 0.35);
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

/* Modální karta kognitivní hygieny */
#depth-hygiene-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 2500;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.hygiene-modal-card {
  background: #121824;
  border: 1px solid rgba(255, 187, 0, 0.4);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 1.5rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hygiene-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.75rem;
}

.hygiene-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffbb00;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hygiene-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hygiene-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan, #00f0ff);
}

.hygiene-section-text {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-primary, #ffffff);
  margin: 0;
}

.hygiene-preview-list {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.6rem 1rem 0.6rem 1.6rem;
  margin: 0.25rem 0 0 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted, #8e9bb0);
  max-height: 120px;
  overflow-y: auto;
}

.hygiene-modal-footer {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.btn-drain-inbox {
  flex: 1;
  min-height: 46px;
  background: linear-gradient(135deg, #ffbb00, #ff8800);
  color: #0b0f19;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-shadow: 0 4px 14px rgba(255, 187, 0, 0.35);
  transition: transform 0.1s ease;
}

.btn-drain-inbox:active {
  transform: scale(0.98);
}

/* Generic Agenda & Sticky Grid Styles */
.agenda-nav-bar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
  background: var(--bg-card);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.agenda-breadcrumb-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-subtle-back {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.agenda-breadcrumb-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agenda-action-dock {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-dock-action {
  flex: 1;
  min-width: 140px;
  padding: 0.55rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.agenda-table-scroll-container {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 60vh;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
}

.agenda-universal-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 320px;
}

.agenda-sticky-header th {
  position: sticky;
  top: 0;
  background: #181818;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.agenda-sticky-th {
  padding: 10px 12px;
  text-align: left;
  font-size: 0.82rem;
  color: var(--accent-cyan);
  border-bottom: 1px solid var(--border-color);
  user-select: none;
}

.header-cell-content {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.sort-arrow-badge {
  font-size: 0.75rem;
  color: var(--accent-amber);
}

.sort-pri {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.agenda-grid-row {
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.agenda-grid-row:hover {
  background: rgba(0, 255, 204, 0.05);
}

.agenda-grid-td {
  padding: 10px 12px;
  font-size: 0.85rem;
  color: var(--text-main);
}

/* Two-row item rendering */
.agenda-two-row-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.agenda-item-body {
  padding: 8px 12px;
}

.row-slot-primary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.cell-timestamp {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: normal;
}

.row-slot-secondary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.cell-status-tag {
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.08);
  font-family: 'JetBrains Mono', monospace;
}

.cell-status-tag.status-new {
  background: rgba(0, 255, 204, 0.15);
  color: var(--accent-cyan);
}

/* Config Modal Tabs */
.btn-tab {
  flex: 1;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
}

.btn-tab.active-tab {
  background: var(--accent-cyan);
  color: #000;
  font-weight: 600;
  border-color: var(--accent-cyan);
}

.btn-micro {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.2rem 0.4rem;
  font-size: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
}

/* UI-PAT-FILTER: Active green border for filter button and radio tabs */
#btn-agenda-config.active {
  border: 2px solid var(--accent-green, #00ff66) !important;
  color: var(--accent-green, #00ff66) !important;
  box-shadow: 0 0 8px rgba(0, 255, 102, 0.25);
}

.config-tabs-bar {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.tab-btn, .btn-config-tab {
  flex: 1;
  padding: 0.6rem 0.4rem;
  font-size: 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  transition: all 0.15s ease;
}

.tab-btn.active, .btn-config-tab.active {
  border: 2px solid var(--accent-green, #00ff66) !important;
  color: var(--accent-green, #00ff66) !important;
  background: rgba(0, 255, 102, 0.1) !important;
  font-weight: 700;
}

/* UI-PAT-FILTER: Fullscreen Canvas Geometry */
#agenda-filter-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  background: #0c1017;
  z-index: 9999;
}

.nav-breadcrumb-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #1f2937;
}

#config-panel-workspace {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  padding: 16px;
  overflow-y: auto;
}

.config-footer-bar {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  padding: 16px;
  background: #0c1017;
  border-top: 1px solid #1f2937;
}

/* UI-PAT-AGENDA: Canonical Fullscreen Layout */
.agenda-view-wrapper, #notes-agenda-container.agenda-view-wrapper {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #0c1017;
  z-index: 9000;
  overflow: hidden;
}

.canonical-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #1f2937;
  flex-shrink: 0;
}

.canonical-action-row {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: #111827;
  flex-shrink: 0;
}

.canonical-workspace-area {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  padding: 16px;
  overflow-y: auto;
}

/* UI-PAT-CANONICAL-TILE: Core Canonical 3-Zone Enclave */
.canonical-tile-root {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #0c1017;
  z-index: 9000;
  overflow: hidden;
}

.canonical-nav-row {
  height: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid #1f2937;
  flex-shrink: 0;
}

.canonical-action-row {
  height: 56px;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 16px;
  background: #111827;
  flex-shrink: 0;
}

.canonical-workspace-area {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  padding: 16px;
  overflow-y: auto;
}

/* UI-PAT-STATE-PICKER: Bottom Sheet State Transition Picker */
.state-picker-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
}

.state-picker-sheet {
  width: 100%;
  background: #111827;
  border-top: 1px solid #374151;
  padding: 20px 16px;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
}

.btn-state-action {
  min-height: 48px;
  background: #1f2937;
  color: #f3f4f6;
  border: 1px solid #374151;
  border-radius: 8px;
  font-size: 15px;
  text-align: left;
  padding: 0 16px;
  cursor: pointer;
}

.btn-state-action:hover {
  background: #374151;
  border-color: #4b5563;
}

#btn-prompt-warning { background: transparent; border: none; font-size: 18px; cursor: pointer; padding: 0 8px; }
.prompt-clarity-dialog { position: fixed; top: 52px; right: 16px; background: #1f2937; border: 1px solid #f59e0b; padding: 12px; border-radius: 8px; z-index: 9999; box-shadow: 0 4px 12px rgba(0,0,0,0.5); }
.clarity-option-btn { display: block; width: 100%; margin: 6px 0; background: #374151; color: #fff; border: none; padding: 8px 12px; border-radius: 4px; text-align: left; }

.col-shift-controls { display: inline-flex; gap: 2px; margin-left: 6px; }
.btn-shift-left, .btn-shift-right { background: #1f2937; color: #9ca3af; border: 1px solid #374151; border-radius: 3px; font-size: 11px; padding: 1px 4px; cursor: pointer; }
.btn-shift-left:hover, .btn-shift-right:hover { color: #f9fafb; border-color: #4b5563; }

/* AC-DEPLOY-FACTORY-WIP-TELEMETRY-MONITOR-P0 */
.wip-summary-banner { display: flex; justify-content: space-between; background: #0f172a; border: 1px solid #3b82f6; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; color: #93c5fd; }
.wip-view-toggle-bar { display: flex; gap: 8px; padding: 8px 16px; background: #0b0f17; border-bottom: 1px solid #1f2937; }
.btn-toggle-view { flex: 1; padding: 6px 10px; background: #1f2937; color: #9ca3af; border: 1px solid #374151; border-radius: 6px; font-size: 12px; cursor: pointer; text-align: center; }
.btn-toggle-view.active { background: #1e3a8a; color: #93c5fd; border-color: #3b82f6; font-weight: 600; }
.phase-badge { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; text-transform: uppercase; }
.phase-approved { background: #854d0e; color: #fef08a; }
.phase-production { background: #1e3a8a; color: #93c5fd; }
.phase-deployed { background: #065f46; color: #a7f3d0; }
.phase-factory { background: #581c87; color: #e9d5ff; }

/* Telemetry tree view styles */
.tree-step-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #1f2937; font-family: monospace; font-size: 12px; }
.step-actor { color: #60a5fa; font-weight: bold; }
.step-path { color: #d1d5db; }
.step-time { color: #34d399; font-weight: bold; }
.telemetry-tree-container { background: #111827; border: 1px solid #374151; padding: 12px; border-radius: 6px; margin-top: 10px; }

/* Telemetry drawer styles */
.telemetry-trigger-bar { margin-top: 8px; text-align: right; }
.btn-toggle-telemetry { background: #1f2937; border: 1px solid #374151; color: #93c5fd; font-size: 11px; padding: 3px 8px; border-radius: 4px; cursor: pointer; }
.telemetry-drawer { background: #0b0f17; border-top: 1px dashed #374151; padding: 8px; margin-top: 6px; border-radius: 4px; }
.telemetry-drawer.hidden, .hidden { display: none !important; }
.tree-step-line { display: flex; justify-content: space-between; font-size: 11px; padding: 2px 0; color: #cbd5e1; }
.badge-actor { color: #60a5fa; font-weight: bold; width: 90px; }
.badge-path { color: #94a3b8; flex: 1; }
.badge-time { color: #34d399; font-weight: bold; }
