/**
 * Panel Layout Styles
 * 
 * Three-pane layout structure, resize handles, and scrollbars.
 * refs: journal/05_ui_design_spec.md (Layout Architecture)
 */

/* ===========================================
   LAYOUT - 3 PANE STRUCTURE
   =========================================== */

.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  border-radius: 0;
}

.panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 0;
}

.panel-header {
  height: var(--header-height, 38px);
  min-height: var(--header-height, 38px);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  font-weight: 500;
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ===========================================
   SCROLLBAR STYLING
   =========================================== */

.panel-content::-webkit-scrollbar {
  width: 6px;
}

.panel-content::-webkit-scrollbar-track {
  background: transparent;
}

.panel-content::-webkit-scrollbar-thumb {
  background: var(--base1);
  border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
  background: var(--base01);
}

/* ===========================================
   RESIZE HANDLE
   =========================================== */

.resize-handle {
  width: 3px;
  background: var(--border-color);
  cursor: col-resize;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.resize-handle:hover,
.resize-handle.active {
  background: var(--blue);
}

/* Dark variant for left sidebar separator */
.resize-handle--dark {
  background: var(--base02);
}

.resize-handle--dark:hover,
.resize-handle--dark.active {
  background: var(--base01);
}

/* ===========================================
   THREADS PANEL (LEFT) - DARK SIDEBAR
   =========================================== */

.threads-panel {
  width: var(--threads-width, 180px);
  min-width: var(--threads-width, 180px);
  max-width: var(--threads-width, 180px);
  background: var(--base02);
  border-radius: 0;
}

.threads-panel .panel-header {
  background: var(--base03);
  border-color: rgba(255, 255, 255, 0.08);
  padding: 0 10px;
}

.threads-panel .panel-content {
  background: var(--base02);
}

/* Connection Status */
.connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--base2);
}

/* New Thread Button */
.new-thread-btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 4px;
  color: var(--base1);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  transition: all 0.15s ease;
}

.new-thread-btn:hover {
  background: var(--blue);
  color: white;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot--connected {
  background: var(--status-connected);
}

.status-dot--connected-executing {
  background: var(--cyan);
  animation: pulse 1s ease-in-out infinite;
}

.status-dot--disconnected {
  background: var(--status-disconnected);
}

.status-dot--reconnecting {
  background: var(--status-reconnecting);
  animation: pulse 1s ease-in-out infinite;
}

/* Thread List */
.thread-list {
  padding: 4px;
}

.thread-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  margin-bottom: 1px;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}

.thread-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.thread-item--active {
  background: rgba(38, 139, 210, 0.2);
}

.thread-item--open {
  /* Visual cue for open channels */
}

/* Thread item content (name + preview) */
.thread-item__content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.thread-item__name {
  font-weight: 500;
  font-size: 11px;
  color: var(--base2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.thread-item__preview {
  font-size: 10px;
  color: var(--base01);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Thread Status Indicators (Multiplexing)
   refs: journal/17_websocket_multiplexing.md */
.thread-item__status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
}

/* Background idle: ring */
.thread-item__status--idle {
  border: 2px solid var(--base01);
  background: transparent;
  width: 8px;
  height: 8px;
  box-sizing: border-box;
}

/* Background executing: white-ish pulsing ring
   Synced with main Galileo status dot (pulse animation, 1s) */
.thread-item__status--executing {
  border: 2px solid var(--base1);
  background: transparent;
  width: 8px;
  height: 8px;
  box-sizing: border-box;
  animation: pulse 1s ease-in-out infinite;
}

/* Done executing (unread): bright cyan solid */
.thread-item__status--done {
  background-color: var(--cyan);
}

/* Background awaiting: ring with badge */
.thread-item__status--awaiting {
  border: 2px solid var(--yellow);
  background: transparent;
  width: 8px;
  height: 8px;
  box-sizing: border-box;
  position: relative;
}

.thread-item__status--awaiting::after {
  content: '?';
  position: absolute;
  font-size: 7px;
  font-weight: bold;
  color: var(--yellow);
  top: -6px;
  right: -6px;
}

/* Background error: red ring */
.thread-item__status--error {
  border: 2px solid var(--red);
  background: transparent;
  width: 8px;
  height: 8px;
  box-sizing: border-box;
}

/* Closed: hidden */
.thread-item__status--closed {
  visibility: hidden;
}

/* Closeable status indicator (hover to show ×) */
.thread-item__status--closeable {
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.thread-item__status--closeable::before {
  content: '×';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: bold;
  line-height: 1;
  color: var(--base01);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.thread-item:hover .thread-item__status--closeable::before {
  opacity: 1;
}

/* Hide the ring/dot styling on hover when closeable */
.thread-item:hover .thread-item__status--closeable {
  border-color: transparent !important;
  background-color: transparent !important;
  animation: none !important;
}

.thread-item:hover .thread-item__status--closeable:hover::before {
  color: var(--red);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 6px;
  background: transparent;
  border: none;
  color: var(--base01);
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  transition: all 0.15s ease;
}

.sidebar-btn:hover {
  background: rgba(220, 50, 47, 0.15);
  color: var(--red);
}

/* ===========================================
   MAIN AREA (CENTER + RIGHT)
   =========================================== */

.main-area {
  flex: 1;
  display: flex;
  min-width: 0;
}

/* Chat Panel (Center) */
.chat-panel {
  flex: 3;
  min-width: 300px;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  border-radius: 0;
}

/* State Panel (Right) */
.state-panel {
  flex: 2;
  min-width: 280px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  border-radius: 0;
}

/* ===========================================
   CHAT PANEL HEADER
   =========================================== */

.chat-header {
  gap: 10px;
  background: var(--bg-secondary);
  padding: 0 10px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s ease;
}

.header-btn:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

/* Theme button variant */
.header-btn--theme {
  font-size: 13px;
  line-height: 1;
}

.header-btn--theme:hover {
  background: var(--bg-elevated);
  border-color: var(--interactive-primary);
  color: inherit;
}

.thread-title {
  font-weight: 500;
  font-size: 12px;
}

/* Execution Status Pill */
.execution-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  padding: 3px 8px;
  background: var(--bg-primary);
  border-radius: 10px;
  color: var(--text-muted);
}

.execution-status--active {
  background: rgba(42, 161, 152, 0.12);
  color: var(--cyan);
}

.execution-status--warning {
  background: rgba(181, 137, 0, 0.12);
  color: var(--yellow);
}

.execution-status--error {
  background: rgba(220, 50, 47, 0.12);
  color: var(--red);
}

/* ===========================================
   STATE PANEL TABS
   =========================================== */

.tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height, 38px);
  min-height: var(--header-height, 38px);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 4px;
  gap: 2px;
  margin-bottom: 5px !important;
}

.tabs-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.tab {
  padding: 6px 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  border-radius: 3px 3px 0 0;
}

.tab:hover {
  color: var(--text-secondary);
}

.tab--active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.tab--debug {
  color: var(--magenta);
}

.tab--debug.tab--active {
  border-bottom-color: var(--magenta);
}

.tab-content {
  padding: 0 6px 6px;
  flex: 1;
  overflow-y: auto;
}

/* ===========================================
   SUBTABS (within State and QA tabs)
   =========================================== */

.subtabs {
  display: flex;
  gap: 0;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.subtab {
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.subtab:hover {
  color: var(--text-secondary);
}

.subtab--active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

/* Sticky subtabs (for State and QA tabs) */
.subtabs--sticky {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 10;
  margin: 0 -6px;
  padding: 0 6px;
}

.subtab-content {
  padding-top: 4px;
}

/* ===========================================
   FETCHED TAB STYLES
   refs: specs/frontend/ui_inspect.md
   =========================================== */

.fetched-tab-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.fetched-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 10;
  margin: 0 -6px;
  padding: 6px;
}

.fetched-filter {
  font-size: 10px;
  padding: 4px 6px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  color: var(--text-primary);
  cursor: pointer;
  min-width: 80px;
}

.fetched-filter:focus {
  outline: none;
  border-color: var(--blue);
}

.fetched-btn {
  font-size: 10px;
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fetched-btn--clear {
  background: var(--bg-primary);
  color: var(--text-secondary);
}

.fetched-btn--clear:hover:not(:disabled) {
  background: rgba(220, 50, 47, 0.1);
  border-color: var(--red);
  color: var(--red);
}

.fetched-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.fetched-checkbox {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  margin-left: auto;
}

.fetched-checkbox input {
  width: 12px;
  height: 12px;
  margin: 0;
  cursor: pointer;
}

.fetched-content {
  flex: 1;
  overflow-y: auto;
  padding-top: 4px;
}

.fetched-empty {
  color: var(--text-muted);
  font-size: 11px;
  padding: 8px;
  text-align: center;
}

/* Pending section */
.pending-section {
  margin-bottom: 12px;
}

.pending-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--yellow);
  padding: 4px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 6px;
}

.pending-group {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 6px;
  overflow: hidden;
}

.pending-group-header {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 4px 8px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.pending-group-items {
  padding: 4px;
}

/* Fetched items */
.fetched-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  margin-bottom: 4px;
  overflow: hidden;
}

.fetched-item--pending {
  border-color: var(--yellow);
  border-left-width: 3px;
}

.fetched-item-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 10px;
}

.fetched-item-header:hover {
  background: var(--bg-elevated);
}

.fetched-item-toggle {
  color: var(--text-muted);
  font-size: 9px;
  width: 12px;
  flex-shrink: 0;
}

.fetched-item-type {
  color: var(--cyan);
  font-weight: 500;
  flex-shrink: 0;
}

.fetched-item-title {
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fetched-item-status {
  color: var(--text-muted);
  font-size: 9px;
  flex-shrink: 0;
}

.fetched-item-actions {
  display: flex;
  gap: 4px;
  padding: 0 8px 6px 26px;
}

.fetched-action-btn {
  font-size: 9px;
  padding: 3px 8px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
}

.fetched-action-btn--approve {
  background: var(--green);
  color: var(--base03);
}

.fetched-action-btn--approve:hover {
  background: var(--cyan);
}

.fetched-action-btn--reject {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.fetched-action-btn--reject:hover {
  background: rgba(220, 50, 47, 0.1);
  border-color: var(--red);
  color: var(--red);
}

.fetched-item-details {
  padding: 6px 8px 6px 26px;
  border-top: 1px solid var(--border-color);
  font-size: 10px;
}

.fetched-item-description {
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.fetched-item-meta {
  color: var(--text-muted);
  font-size: 9px;
}

/* Approved section */
.approved-section {
  padding-top: 4px;
}

/* State and QA tab content layout */
.state-tab-content,
.qa-tab-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ===========================================
   ANIMATIONS
   =========================================== */

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.spinner {
  width: 10px;
  height: 10px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--cyan);
  animation: blink 0.8s ease-in-out infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
}

/* ===========================================
   SNAPSHOT HISTORY UI
   refs: specs/frontend/ui_snapshots.md
   =========================================== */

/* Disabled button style */
.header-btn--disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.header-btn--disabled:hover {
  background: var(--bg-elevated);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

/* Primary button style (for Create) */
.header-btn--primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  padding: 0 10px;
  width: auto;
}

.header-btn--primary:hover {
  background: var(--violet);
  border-color: var(--violet);
}

/* Checkbox label in header */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 12px;
  height: 12px;
  margin: 0;
  cursor: pointer;
}

/* Snapshot List */
.snapshot-list {
  padding: 6px;
}

.snapshot-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 12px;
}

/* Snapshot Item */
.snapshot-item {
  padding: 8px 10px;
  margin-bottom: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.snapshot-item:hover {
  background: var(--bg-elevated);
  border-color: var(--base01);
}

.snapshot-item--selected {
  background: rgba(38, 139, 210, 0.1);
  border-color: var(--blue);
}

.snapshot-item__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
  gap: 8px;
}

.snapshot-item__title {
  font-weight: 500;
  font-size: 11px;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snapshot-item__time {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.snapshot-item__preview {
  font-size: 10px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Snapshot Actions (appear when selected) */
.snapshot-item__actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.snapshot-btn {
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 500;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.snapshot-btn--restore {
  background: var(--blue);
  color: white;
}

.snapshot-btn--restore:hover {
  background: var(--violet);
}

.snapshot-btn--cancel {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.snapshot-btn--cancel:hover {
  background: var(--bg-secondary);
  border-color: var(--base01);
}

/* ===========================================
   YAML VIEW COMPONENT
   refs: specs/frontend/yaml_formatting.md
   =========================================== */

.yaml-view {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
  font-size: 10px;
  line-height: 1.5;
  background: var(--bg-primary);
  padding: 6px;
  border-radius: 4px;
  overflow-x: auto;
}

/* Compact yaml view inside tool blocks */
.tool-section-content .yaml-view {
  padding: 4px 6px;
}

.yaml-view--empty {
  color: var(--text-muted);
}

.yaml-node {
  /* No padding for root */
}

.yaml-node--root {
  /* Root node has no indentation */
}

.yaml-node .yaml-node {
  padding-left: 14px;
}

.yaml-line {
  display: flex;
  align-items: flex-start;
  min-height: 18px;
}

.yaml-toggle {
  display: inline-block;
  width: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  font-size: 9px;
}

.yaml-toggle:hover {
  color: var(--blue);
}

.yaml-toggle--empty {
  cursor: default;
}

.yaml-key {
  color: var(--cyan);
  margin-right: 4px;
}

.yaml-key--collapsible {
  cursor: pointer;
}

.yaml-key--collapsible:hover {
  text-decoration: underline;
  color: var(--blue);
}

.yaml-hint {
  color: var(--text-muted);
  font-size: 9px;
  margin-left: 4px;
}

.yaml-value {
  color: var(--text-primary);
}

.yaml-value--string {
  color: var(--green);
}

.yaml-value--number {
  color: var(--magenta);
}

.yaml-value--boolean {
  color: var(--orange);
}

.yaml-value--null,
.yaml-value--undefined {
  color: var(--text-muted);
  font-style: italic;
}

.yaml-children {
  /* Children container */
}

.yaml-multiline {
  display: block;
  margin: 4px 0 4px 14px;
  padding: 4px 8px;
  background: var(--bg-secondary);
  border-radius: 3px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--green);
  font-size: 10px;
}

/* ===========================================
   TOOL BLOCK SECTIONS
   refs: specs/frontend/rendering_non_streaming.md
   =========================================== */

.tool-section {
  margin: 4px 0;
}

.tool-section-header {
  display: flex;
  align-items: center;
  padding: 2px 0;
  cursor: pointer;
  user-select: none;
}

.tool-section-header:hover .tool-section-label {
  text-decoration: underline;
}

.tool-section-toggle {
  display: inline-block;
  width: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 9px;
}

.tool-section-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
}

.tool-section-content {
  margin-top: 2px;
}

.delegation-section {
  border-left: 2px solid var(--base01);
  padding-left: 8px;
  margin-left: 4px;
}

/* ===========================================
   THREAD SWITCHING LOADING STATES
   =========================================== */

/* Chat Panel Loading Overlay */
.chat-loading-overlay {
  position: absolute;
  top: var(--header-height, 38px);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: chat-loading-fade-in 0.15s ease-out;
}

@keyframes chat-loading-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.chat-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: chat-loading-spin 0.8s linear infinite;
}

@keyframes chat-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Composite Panel Loading Curtain */
.panel-loading-curtain {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-secondary);
  z-index: 100;
  animation: curtain-fade-in 0.15s ease-out;
}

@keyframes curtain-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Ensure panels have position relative for overlay positioning */
.chat-panel {
  position: relative;
}

.state-panel {
  position: relative;
}
