/* ── APP SHELL ── */
html, body { height: 100%; overflow: hidden; font-size: 13px; }
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── HEADER ── */
#header { padding: 0 20px; height: 52px; }
.header-left { display: flex; align-items: center; gap: 12px; }
.logo-mark { font-size: 24px; filter: drop-shadow(0 0 8px var(--amber)); }

.header-center {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  justify-content: center;
}

.sim-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.sim-gen-display {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--amber);
  letter-spacing: 0.05em;
}

.time-controls { display: flex; align-items: center; gap: 8px; }

/* ── MAIN GRID ── */
#mainGrid {
  display: grid;
  grid-template-columns: 240px 1fr 260px;
  grid-template-rows: 1fr;
  gap: var(--panel-gap);
  padding: var(--panel-gap);
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── LEFT COL ── */
.left-col {
  display: flex;
  flex-direction: column;
  gap: var(--panel-gap);
  overflow-y: auto;
  min-height: 0;
}

/* related resource: theme-amber.css:127:1 */
.settings-tab {
  display: flex;
  flex: 1;
  min-height: 0;
}
.settings-panel { /* the element was .panel.settings-panel */
  min-height: 0px;
  overflow-y: scroll;
}

/* ── CENTER COL ── */
.center-col {
  display: flex;
  flex-direction: column;
  gap: var(--panel-gap);
  overflow: hidden;
  min-height: 0;
}

/* ── RIGHT COL ── */
.right-col {
  display: flex;
  flex-direction: column;
  gap: var(--panel-gap);
  overflow-y: auto;
  min-height: 0;
}

/* ── DASHBOARD CARDS ── */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 10px 14px;
}

.dash-card {
  background: var(--bg-panel2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  text-align: center;
}

.dash-card .dc-label {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.dash-card .dc-value {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--amber);
  line-height: 1.1;
}

.dash-card.dc-goal .dc-value { font-size: 11px; }
.dc-goal:hover {
  background: var(--bg-panel);
  cursor: pointer; /* Change mouse cursor */
}

/* ── VIZ CANVAS ── */
.viz-container {
  display: flex;
  flex-direction: column;
  min-height: 0px;
  flex: 1 1 0%;
}
.viz-wrap {
  flex: 1;
  position: relative;
  background: #080b10;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  min-height: 0;
}
.viz-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

/* ── PANEL BADGE VARIANT ── */
.badge-green {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--green);
  background: rgba(57, 224, 128, 0.1);
  border: 1px solid var(--green-dim);
  padding: 1px 6px;
  border-radius: 2px;
}
.badge-purple {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--purple);
  background: rgba(160, 128, 255, 0.1);
  border: 1px solid #604090;
  padding: 1px 6px;
  border-radius: 2px;
}

/* ── SCROLLBARS IN PANELS ── */
.left-col::-webkit-scrollbar,
.right-col::-webkit-scrollbar,
.pop-list-wrap::-webkit-scrollbar,
.event-log-wrap::-webkit-scrollbar {
  width: 3px;
}

/* ── BOTTOM STATUS BAR ── */
#statusBar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 16px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
#statusBar span { color: var(--text-dim); }

/* ── CODE EDITOR ── */
.code-editor {
  width: 100%;
  background: #060910;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  color: #abb2c0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  padding: 10px 12px;
  resize: vertical;
  outline: none;
  tab-size: 2;
  min-height: 160px;
}
.code-editor:focus { border-color: var(--amber-dim); }
.code-error {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--red);
  margin-top: 4px;
  min-height: 14px;
  line-height: 1.4;
}
.code-test-result {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  min-height: 14px;
  line-height: 1.4;
}

.field-code {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 4px;
  padding: 8px;
  font-size: 10px;
  color: #94a3b8;
  white-space: pre-wrap;
  overflow-x: auto;
  max-height: 120px;
}

/* ── TIMELINE ── */
.timeline-tab { /* the element was .tab-content */
  display: flex;
  flex-direction: column;
  min-height: 0px;
  flex: 1 1 0%;
}

.tl-container {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.tl-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0f172a;
  padding: 6px 0 8px;
  border-bottom: 1px solid #1e293b;
  margin-bottom: 6px;
}

.tl-filter-group {
  flex: 1;
  min-width: 0;
}

.tl-filter-input {
  width: 100%;
  box-sizing: border-box;
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 11px;
  font-family: monospace;
  padding: 3px 7px;
  border-radius: 4px;
  outline: none;
}

.tl-filter-input::placeholder { color: #475569; }

.tl-filter-input:focus {
  border-color: #3b82f6;
  color: #e2e8f0;
}

.tl-filter-clear {
  background: none;
  border: 1px solid #334155;
  color: #475569;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

.tl-filter-clear:hover { color: #f87171; border-color: #f87171; }

.tl-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px;
  display: block;
  min-height: 0;
}

.tl-empty {
  color: #64748b;
  text-align: center;
  margin-top: 40px;
  font-size: 13px;
}

.tl-date-group { margin-bottom: 4px; }

.tl-date-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: #1e293b;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  border-left: 3px solid #3b82f6;
}

.tl-date-hdr:hover { background: #273549; }

.tl-date-str { color: #93c5fd; font-weight: bold; }

.tl-chev { color: #64748b; font-size: 10px; width: 10px; flex-shrink: 0; }

.tl-badge {
  margin-left: auto;
  font-size: 10px;
  color: #64748b;
  background: #0f172a;
  padding: 1px 6px;
  border-radius: 10px;
}

.tl-evts { padding-left: 14px; padding-top: 2px; }

.tl-ev-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 2px 0;
}

.tl-pipe { color: #334155; flex-shrink: 0; padding-top: 5px; }

.tl-ev-inner { flex: 1; min-width: 0; }

.tl-ev-hdr {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 3px;
  cursor: pointer;
  user-select: none;
}

.tl-ev-hdr:hover { background: #1e293b; }

.tl-ev-type { color: #fbbf24; font-size: 11px; }

.tl-acts { padding-left: 12px; padding-top: 2px; }

.tl-act {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 11px;
}

.tl-act:hover { background: #1a2535; }

.tl-act-type { color: #a5b4fc; min-width: 180px; flex-shrink: 0; }

.tl-act-val { color: #34d399; flex-shrink: 0; }

.tl-act-reducer {
  color: #475569;
  font-size: 10px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-det {
  background: #1e293b;
  border: 1px solid #334155;
  color: #64748b;
  padding: 1px 6px;
  font-family: monospace;
  font-size: 10px;
  border-radius: 3px;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

.tl-det:hover { color: #93c5fd; border-color: #3b82f6; }

.tl-rewind {
  background: #1e293b;
  border: 1px solid #334155;
  color: #64748b;
  padding: 1px 5px;
  font-size: 10px;
  border-radius: 3px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
}

.tl-rewind:hover { color: #fbbf24; border-color: #f59e0b; }

/* ── DATA DISPLAY ── */
.data-section-title {
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 4px;
}
.data-list-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px;
  display: block;
}

.single-row {
  grid-column: 1 / -1;           /* Spans all columns of the parent grid */
}
.data-row {
  display: grid;
  grid-column: 1 / -1;           /* Spans all columns of the parent grid */
  grid-template-columns: subgrid; /* Inherits parent's column tracks */
  margin-bottom: 2px;
  border-radius: 2px;
  border: 1px solid transparent;
  font-size: 11px;
}

.data-row-header {
  display: grid;
  grid-column: 1 / -1;           /* Spans all columns of the parent grid */
  grid-template-columns: subgrid; /* Inherits parent's column tracks */
  margin-bottom: 2px;
  border-radius: 2px;
  border: 1px solid transparent;
  font-size: 11px;
  background: var(--bg-panel2);
}
.data-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  place-items: start;
}

.data-grid-center {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  place-items: center;
}

.data-grid-2 {
  grid-template-columns: 1fr 1fr;
}
.data-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.data-row:hover { background: var(--bg-panel2); }

/* ── DATA DIFF ── */
.diff-field  { color: #94a3b8; font-size: 10px; }
.diff-before { color: #64748b; }
.diff-after  { color: #e5e7eb; }
.diff-pos    { color: #34d399; margin-left: 6px; }
.diff-neg    { color: #f87171; margin-left: 6px; }
