/* ══ Current Event Page ══════════════════════════════════════════════════════ */

/* ── Mission Control Topbar ────────────────────────────────────────────────── */
.ce-topbar {
  display: flex; align-items: center; gap: 0;
  padding: 14px 0 12px;
  border-bottom: 1px solid #161e2c;
  margin-bottom: 20px;
  position: relative;
}

/* Context button (left) */
.ce-ctx-btn {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 1px solid transparent; border-radius: 10px;
  padding: 8px 12px 8px 10px; cursor: pointer; text-align: left;
  transition: background 0.15s, border-color 0.15s;
  min-width: 0; flex-shrink: 0;
}
.ce-ctx-btn:hover { background: rgba(255,255,255,0.028); border-color: #2a3545; }

.ce-ctx-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2a3545; flex-shrink: 0;
  transition: background 0.3s, box-shadow 0.3s;
}
.ce-ctx-dot.loaded {
  background: #4ac8a4;
  box-shadow: 0 0 8px rgba(74,200,164,0.45);
}

.ce-ctx-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ce-ctx-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 19px; font-weight: 800; color: #dce3ed;
  letter-spacing: 0.2px; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px;
}
.ce-ctx-name.idle { font-size: 15px; font-weight: 600; color: #4a5a6b; }
.ce-ctx-meta {
  font-family: 'Barlow', sans-serif;
  font-size: 11px; color: #4a5a6b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px;
}
.ce-ctx-chevron {
  font-size: 18px !important; color: #3a4555; flex-shrink: 0;
  transition: transform 0.2s, color 0.15s;
}
.ce-ctx-btn:hover .ce-ctx-chevron { color: #5a6a7b; }
.ce-ctx-btn.switcher-open .ce-ctx-chevron { transform: rotate(180deg); }

/* Center: car badge + schedule strip */
.ce-topbar-center {
  display: flex; align-items: center; gap: 8px;
  flex: 1; padding: 0 20px; min-width: 0; overflow: hidden;
}

.ce-car-tag {
  display: flex; flex-direction: column; gap: 0;
  background: rgba(9,11,14,0.72);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px; padding: 5px 10px;
  flex-shrink: 0; cursor: default;
}
.ce-car-tag:empty { display: none; }
.ce-car-tag-brand {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 8px; font-weight: 700; letter-spacing: 2.5px;
  text-transform: uppercase; color: #3a4a5a; line-height: 1.2;
}
.ce-car-tag-model {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 800;
  color: #eef2f7; letter-spacing: 0.3px; line-height: 1.2;
  white-space: nowrap;
}

.ce-sched-strip {
  display: flex; align-items: center; gap: 5px;
  overflow: hidden; flex-shrink: 1;
}
.ce-sched-item {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase;
  color: #3a4a5a; background: rgba(255,255,255,0.022);
  border-radius: 4px; padding: 3px 8px; white-space: nowrap;
}
.ce-sched-item.upcoming { color: #5a7aaa; background: rgba(59,130,246,0.07); }
.ce-sched-sep { font-size: 10px; color: #242e3a; flex-shrink: 0; }


/* ── Context Switcher Panel ─────────────────────────────────────────────────── */
.ce-sw-backdrop {
  position: fixed; inset: 0; z-index: 400;
  display: none;
}
.ce-sw-backdrop.open { display: block; }

.ce-switcher {
  position: fixed; z-index: 401;
  background: #0e1219; border: 1px solid #222c3c;
  border-radius: 12px; width: 320px;
  box-shadow: 0 20px 48px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.03);
  display: none; flex-direction: column;
  animation: ce-sw-in 0.15s ease;
}
.ce-switcher.open { display: flex; }

@keyframes ce-sw-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ce-sw-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid #1a2230;
}
.ce-sw-hdr-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: #5a6a7b;
}
.ce-sw-close-btn {
  background: none; border: none; color: #3a4555; cursor: pointer;
  border-radius: 6px; padding: 2px; display: flex; align-items: center;
  transition: color 0.15s, background 0.15s;
}
.ce-sw-close-btn:hover { color: #dce3ed; background: rgba(255,255,255,0.05); }
.ce-sw-close-btn .material-symbols-outlined { font-size: 17px !important; }

.ce-sw-fields {
  display: flex; flex-direction: column; gap: 0;
  padding: 8px 0 4px;
}
.ce-sw-field {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 14px;
}
.ce-sw-field + .ce-sw-field { border-top: 1px solid #141c28; }
.ce-sw-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: #3a4a5a;
}

/* Selects inside switcher panel */
.ce-filter-select,
.ce-event-select {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 600; color: #dce3ed;
  background: #131820; border: 1px solid #222c3c;
  border-radius: 7px; padding: 7px 30px 7px 10px;
  cursor: pointer; appearance: none; width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235a6a7b'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  transition: border-color 0.15s;
}
.ce-filter-select:focus,
.ce-event-select:focus  { outline: none; border-color: #4ac8a4; }
.ce-filter-select option,
.ce-event-select  option { background: #131820; color: #dce3ed; }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.ce-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 80px 20px; gap: 10px;
}
.ce-empty-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px; font-weight: 700; color: #5a6a7b;
}
.ce-empty-sub {
  font-family: 'Barlow', sans-serif;
  font-size: 12px; color: #3a4555; max-width: 340px; line-height: 1.5;
}

/* ── Content container ────────────────────────────────────────────────────── */
.ce-content {
  display: flex; flex-direction: column; gap: 16px;
  padding-bottom: 40px;
}

/* ── Grid layouts ─────────────────────────────────────────────────────────── */
.ce-grid { display: grid; gap: 16px; }
.ce-grid-top { grid-template-columns: 1fr 1fr; }

@media (max-width: 860px) {
  .ce-grid-top { grid-template-columns: 1fr; }
}

/* ── Card base ────────────────────────────────────────────────────────────── */
.ce-card {
  background: #111620; border: 1px solid #1a2230;
  border-radius: 14px; padding: 18px 20px;
  position: relative; overflow: hidden;
}
.ce-card-header {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 14px;
}
.ce-card-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #d4f542; flex-shrink: 0;
}
.ce-card-dot.green { background: #4ac8a4; }
.ce-card-dot.amber { background: #f59e0b; }
.ce-card-dot.blue  { background: #3b82f6; }
.ce-card-dot.red   { background: #ef4444; }
.ce-card-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: #7a8a9b;
  flex: 1;
}
.ce-btn-add {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: #d4f542;
  background: transparent; border: 1px solid rgba(212,245,66,0.25);
  border-radius: 6px; padding: 3px 10px; cursor: pointer;
  transition: all 0.15s;
}
.ce-btn-add:hover { background: rgba(212,245,66,0.08); border-color: #d4f542; }

/* ── Event Info Banner ────────────────────────────────────────────────────── */
.ce-event-banner {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 10px 14px;
  background: #111620; border: 1px solid #1a2230;
  border-radius: 10px;
}
.ce-banner-date {
  font-family: 'Barlow', sans-serif;
  font-size: 12px; color: #9aacbd;
}
.ce-banner-car {
  font-family: 'Barlow', sans-serif;
  font-size: 12px; color: #dce3ed;
}
.ce-banner-sep {
  font-size: 12px; color: #2a3545; flex-shrink: 0;
}
.ce-banner-notes {
  font-family: 'Barlow', sans-serif;
  font-size: 11px; color: #5a6a7b;
}
.ce-schedule-inline {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 0; flex-direction: row;
}
.ce-schedule-inline .ce-schedule-item {
  background: rgba(255,255,255,0.03); border-radius: 5px;
  padding: 2px 7px; font-size: 11px; gap: 5px;
}
.ce-schedule-inline .ce-schedule-time { min-width: unset; }
.ce-info-badge {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.6px;
  text-transform: uppercase; padding: 2px 8px; border-radius: 4px;
  background: rgba(74,200,164,0.09); color: #4ac8a4;
}

/* Team pills */
.ce-team-list {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-top: 2px;
}
.ce-team-pill {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 600; letter-spacing: 0.3px;
  padding: 2px 8px; border-radius: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid #1f2530; color: #8899aa;
}
.ce-team-pill.driver    { color: #4ac8a4; border-color: rgba(74,200,164,0.15); }
.ce-team-pill.mechanic  { color: #f59e0b; border-color: rgba(245,158,11,0.15); }
.ce-team-pill.engineer  { color: #3b82f6; border-color: rgba(59,130,246,0.15); }

/* Schedule items */
.ce-schedule-list {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 4px;
}
.ce-schedule-item {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Barlow', sans-serif; font-size: 12px; color: #7a8a9b;
}
.ce-schedule-time {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 600; color: #5a6a7b;
  min-width: 80px;
}

/* ── Setups / Tyre Sets Card ──────────────────────────────────────────────── */
.ce-setups-body,
.ce-tyresets-body {
  display: flex; flex-direction: column; gap: 6px;
}
.ce-setup-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  background: rgba(255,255,255,0.018);
  border: 1px solid #1c222c;
  transition: border-color 0.15s;
}
.ce-setup-item:hover { border-color: #2a3545; }
.ce-setup-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 700; color: #dce3ed;
  flex: 1;
}
.ce-setup-desc {
  font-family: 'Barlow', sans-serif;
  font-size: 11px; color: #5a6a7b;
  flex: 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ce-setup-actions {
  display: flex; gap: 4px; opacity: 0;
  transition: opacity 0.15s;
}
.ce-setup-item:hover .ce-setup-actions { opacity: 1; }
.ce-setup-action-btn {
  background: transparent; border: 1px solid transparent;
  border-radius: 4px; color: #4a5568; font-size: 11px;
  padding: 2px 6px; cursor: pointer; transition: all 0.15s;
}
.ce-setup-action-btn:hover { color: #dce3ed; border-color: #2a3545; }
.ce-setup-action-btn.delete:hover { color: #ef4444; border-color: rgba(239,68,68,0.3); }

/* ── Tyre Set Card with expandable entries ── */
.ce-ts-card { border-radius: 8px; overflow: hidden; }
.ce-ts-card .ce-setup-item {
  border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,0.04);
  border-color: #232d3e;
}
.ce-ts-card.expanded .ce-setup-item {
  border-radius: 8px 8px 0 0;
  border-bottom-color: #2e3d52;
  background: rgba(255,255,255,0.055);
}

.ce-ts-meta {
  font-family: 'Barlow', sans-serif; font-size: 10px; color: #5a6a7b;
  flex: 1; text-align: right; margin-right: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ce-ts-panel {
  max-height: 0; overflow: hidden;
  transition: max-height 0.25s ease;
  background: #0b0f18;
  border: 1px solid #232d3e; border-top: none;
  border-radius: 0 0 8px 8px;
}
.ce-ts-card.expanded .ce-ts-panel { max-height: 600px; }

/* individual entry row */
.ce-ts-entry {
  display: flex; align-items: flex-end; gap: 4px;
  padding: 5px 8px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.ce-ts-entry:first-child { padding-top: 6px; }

.ce-ts-entry-fields {
  display: flex; align-items: flex-end; gap: 4px; flex: 1; flex-wrap: nowrap;
}

.ce-ts-field {
  display: flex; flex-direction: column; gap: 2px;
}
.ce-ts-field-session { flex: 1 1 76px; min-width: 0; }
.ce-ts-field-time    { flex: 0 0 88px; }
.ce-ts-field-temp    { flex: 0 0 36px; }
.ce-ts-field-press   { flex: 0 0 33px; }

.ce-ts-field label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 8px; font-weight: 700; color: #f59e0b;
  letter-spacing: 0.07em; white-space: nowrap;
}

.ce-ts-input, .ce-ts-select {
  width: 100%; background: rgba(255,255,255,0.04);
  border: 1px solid #222c3a; border-radius: 4px;
  color: #c8d4e0; font-family: 'Barlow', sans-serif;
  font-size: 11px; text-align: center;
  padding: 2px 3px; outline: none;
  transition: border-color 0.15s;
}
.ce-ts-select { text-align: left; font-size: 10px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%235a6a7b'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 4px center; padding-right: 14px; }
.ce-ts-input:focus, .ce-ts-select:focus { border-color: #f59e0b; }
.ce-ts-input::-webkit-inner-spin-button,
.ce-ts-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.ce-ts-entry-unit {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px; color: #3a4a5a; padding-bottom: 3px; white-space: nowrap;
}

.ce-ts-entry-del {
  flex-shrink: 0; background: transparent; border: none;
  color: #2a3545; font-size: 10px; padding: 2px 4px;
  cursor: pointer; border-radius: 3px; transition: color 0.15s;
  align-self: flex-end; margin-bottom: 2px;
}
.ce-ts-entry-del:hover { color: #ef4444; }

.ce-ts-add-row {
  padding: 4px 8px 6px;
}
.ce-ts-add-btn {
  background: transparent; border: 1px dashed #2a3545;
  border-radius: 5px; color: #4a5a6a; font-size: 10px;
  font-family: 'Barlow', sans-serif; padding: 3px 10px;
  cursor: pointer; width: 100%; transition: all 0.15s;
}
.ce-ts-add-btn:hover { border-color: #f59e0b; color: #f59e0b; }

body.light-mode .ce-ts-panel { background: rgba(245,158,11,0.02); border-color: #e8ecf2; }
body.light-mode .ce-ts-entry { border-bottom-color: #f0f2f7; }
body.light-mode .ce-ts-input, body.light-mode .ce-ts-select { background: #fff; border-color: #dde2ec; color: #1a2030; }
body.light-mode .ce-ts-meta { color: #8a9ab0; }
body.light-mode .ce-ts-add-btn { border-color: #ccd4e0; color: #8a9ab0; }
body.light-mode .ce-ts-entry-del { color: #ccd4e0; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ══ RUN SHEET — Premium Pit Wall Redesign ══════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* ── Run Sheet card — edge-to-edge immersive layout ──────────────────────── */
.ce-card-runs {
  background: #0d1118;
  border-color: #182030;
  padding: 0;
  overflow: hidden;
}
.ce-card-runs .ce-card-header {
  padding: 14px 20px 12px;
  border-bottom: 1px solid #182030;
  margin-bottom: 0;
}
.ce-card-runs .ce-card-title {
  font-size: 11px;
  letter-spacing: 2px;
  color: #5a6a7b;
}
.ce-card-runs .ce-btn-add {
  font-size: 11px;
  padding: 5px 14px;
  background: rgba(212,245,66,0.04);
}

/* ── Live tracking indicator ─────────────────────────────────────────────── */
.ce-tracking-indicator {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 4px;
  background: rgba(34,197,94,0.06);
  border: 1px solid rgba(34,197,94,0.2);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.8px; text-transform: uppercase;
  color: #22c55e; margin-left: 8px;
}
.ce-tracking-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e; flex-shrink: 0;
  animation: ce-trk-pulse 2s ease-in-out infinite;
}
@keyframes ce-trk-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.ce-tracking-indicator.reconnecting {
  background: rgba(245,158,11,0.06);
  border-color: rgba(245,158,11,0.2);
  color: #f59e0b;
}
.ce-tracking-indicator.reconnecting .ce-tracking-dot { background: #f59e0b; }
.ce-tracking-indicator.disconnected {
  background: rgba(239,68,68,0.06);
  border-color: rgba(239,68,68,0.2);
  color: #ef4444;
}
.ce-tracking-indicator.disconnected .ce-tracking-dot {
  background: #ef4444; animation: none;
}
.ce-tracking-indicator.has-warnings {
  background: rgba(245,158,11,0.06);
  border-color: rgba(245,158,11,0.2);
}
.ce-tracking-indicator.has-warnings .ce-tracking-warn {
  color: #f59e0b; margin-left: 2px;
}
.ce-tracking-indicator.offline {
  background: rgba(90,106,123,0.06);
  border-color: rgba(90,106,123,0.2);
  color: #5a6a7b;
}
.ce-tracking-indicator.offline .ce-tracking-dot {
  background: #5a6a7b; animation: none;
}

/* ── 3-panel layout ──────────────────────────────────────────────────────── */
.ce-run-layout {
  display: flex; gap: 0; min-height: 420px;
}

/* ── Left: run list sidebar (operational control rail) ───────────────────── */
.ce-run-sidebar {
  width: 200px; flex-shrink: 0;
  border-right: 1px solid #182030;
  overflow-y: auto; padding: 0;
  background: #0a0e15;
}
.ce-run-list {
  display: flex; flex-direction: column; gap: 1px;
  padding: 8px 6px;
}
.ce-run-list-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 6px;
  cursor: pointer; transition: all 0.15s;
  border-left: 3px solid transparent;
  position: relative;
}
.ce-run-list-item:hover {
  background: rgba(255,255,255,0.025);
}
.ce-run-list-item.active {
  background: rgba(74,200,164,0.05);
  border-left-color: #4ac8a4;
}

/* Hide the old radio indicator */
.ce-run-list-radio { display: none; }

.ce-run-list-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 700; color: #7a8a9b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.2;
}
.ce-run-list-item.active .ce-run-list-name { color: #e0e7f1; }
.ce-run-list-sub {
  font-family: 'Barlow', sans-serif;
  font-size: 10px; color: #4a5568;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ce-run-list-item.active .ce-run-list-sub { color: #5a6a7b; }

/* Lap count badge */
.ce-run-list-laps {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700; color: #3a4555;
  background: rgba(255,255,255,0.03);
  padding: 2px 6px; border-radius: 4px;
  flex-shrink: 0; letter-spacing: 0.3px;
}
.ce-run-list-item:hover .ce-run-list-laps { color: #4a5568; }
.ce-run-list-item.active .ce-run-list-laps {
  color: #4ac8a4;
  background: rgba(74,200,164,0.08);
}

.ce-run-list-delete {
  background: transparent; border: none; color: #2a3545;
  font-size: 10px; cursor: pointer; padding: 2px 4px;
  border-radius: 4px; opacity: 0; transition: all 0.15s;
  flex-shrink: 0; line-height: 1;
}
.ce-run-list-item:hover .ce-run-list-delete { opacity: 0.5; }
.ce-run-list-delete:hover { opacity: 1 !important; color: #ef4444; background: rgba(239,68,68,0.1); }

/* ── Center + right area ─────────────────────────────────────────────────── */
.ce-run-detail {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  padding: 14px 16px 16px;
}
/* Info strip + laps (left) | tyre panel (right) */
.ce-run-body {
  display: flex; gap: 14px; flex: 1; min-height: 0;
}
.ce-run-left { flex: 1; min-width: 0; }

/* ── Run info panel — command bar + control modules ──────────────────────── */
.ce-run-info-panel {
  min-width: 0;
  margin-bottom: 12px;
}

/* Run name / number header — command bar feel */
.ce-run-info-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #182030;
}
.ce-run-info-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px; font-weight: 700; color: #dce3ed;
}
.ce-run-info-num {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; color: #4a5568;
}

/* Run name input — looks like a title, editable on interaction */
.ce-run-name-input {
  width: 140px !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px;
  background: transparent !important;
  border-color: transparent !important;
  color: #e0e7f1 !important;
  padding: 4px 8px !important;
}
.ce-run-name-input:hover { border-color: #1f2a38 !important; }
.ce-run-name-input:focus {
  border-color: #4ac8a4 !important;
  background: rgba(255,255,255,0.02) !important;
}

/* Run number — teal badge */
.ce-run-num-input {
  width: 44px !important;
  text-align: center !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  background: rgba(74,200,164,0.06) !important;
  border-color: rgba(74,200,164,0.15) !important;
  color: #4ac8a4 !important;
  border-radius: 6px !important;
  padding: 4px 6px !important;
}
.ce-run-num-input:focus {
  border-color: #4ac8a4 !important;
  background: rgba(74,200,164,0.1) !important;
}

/* Control module strips */
.ce-run-info-strip {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.ce-run-info-group {
  display: flex; align-items: center; gap: 8px;
  background: #0a0e15;
  border: 1px solid #182030; border-radius: 8px;
  padding: 6px 12px;
  position: relative;
}

/* Group label — vertical indicator */
.ce-run-group-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 8px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: #3a4858;
  writing-mode: vertical-lr; transform: rotate(180deg);
  white-space: nowrap; flex-shrink: 0;
}
.ce-run-group-fields {
  display: flex; flex-wrap: wrap; gap: 4px 8px;
  align-items: flex-end;
}

/* Field labels and inputs */
.ce-run-field {
  display: flex; flex-direction: column; gap: 1px;
  min-width: 0;
}
.ce-run-field-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: #4a5568;
}
.ce-run-field-input {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; font-weight: 600; color: #dce3ed;
  background: #0e1219;
  border: 1px solid #1a2230; border-radius: 5px;
  padding: 4px 7px; width: 100%;
  transition: border-color 0.15s, background 0.15s;
}
.ce-run-field-input:focus { outline: none; border-color: #4ac8a4; background: #101520; }
.ce-run-field-input:hover:not(:focus) { border-color: #222d3d; }
.ce-run-field-input::placeholder { color: #252d3d; }
select.ce-run-field-input { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%235a6a7b'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center;
  padding-right: 18px;
}
select.ce-run-field-input option { background: #111620; color: #dce3ed; }
.ce-run-field-row {
  display: flex; gap: 4px; align-items: center;
}

/* NOW button — quick-action control */
.ce-run-field-now {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: #d4f542;
  background: rgba(212,245,66,0.08); border: 1px solid rgba(212,245,66,0.3);
  border-radius: 4px; padding: 4px 10px; cursor: pointer;
  transition: all 0.15s; flex-shrink: 0;
}
.ce-run-field-now:hover {
  background: rgba(212,245,66,0.15);
  border-color: #d4f542;
  box-shadow: 0 0 8px rgba(212,245,66,0.12);
}

/* Section dividers in info panel (legacy) */
.ce-run-section-divider {
  grid-column: 1 / -1;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 8px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: #3a4555;
  padding: 8px 0 2px;
  border-top: 1px solid #1c222c;
  margin-top: 2px;
}
.ce-run-section-divider.first { border-top: none; margin-top: 0; padding-top: 0; }

/* Compact field inputs in module strips */
.ce-run-group-fields .ce-run-field-input {
  width: 80px; padding: 3px 6px; font-size: 11px;
}
.ce-run-group-fields select.ce-run-field-input { width: 90px; }
.ce-run-group-fields input[type="time"].ce-run-field-input { width: 85px; }
.ce-run-group-fields input[type="number"].ce-run-field-input { width: 55px; }

/* ── Right: tyre/pressure/temp panel (telemetry support panel) ───────────── */
.ce-run-tyre-panel {
  width: 380px; flex-shrink: 0;
  border: 1px solid #182030;
  border-left: 2px solid rgba(74,200,164,0.2);
  border-radius: 10px;
  padding: 12px 14px;
  background: #0a0e15;
  overflow-y: auto;
  align-self: flex-start;
}
.ce-tyre-section-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: #4a5a6b;
  margin-bottom: 6px; display: flex; align-items: center; gap: 6px;
}
.ce-tyre-section-title::before {
  content: '';
  width: 4px; height: 4px; border-radius: 50%;
  background: #2a3848; flex-shrink: 0;
}

/* Pressures row: cold | hot | bleed side by side */
.ce-tyre-pressures-row {
  display: flex; gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #151c28;
  margin-bottom: 12px;
}
.ce-tyre-pressure-block { flex: 1; min-width: 0; }
.ce-tyre-pressure-block .ce-tyre-section-title::before { display: none; }
.ce-tyre-grid-2x2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px;
}
/* Pressure input hues */
.ce-tyre-pressure-block:nth-child(1) .ce-tyre-input { background: rgba(56,120,180,0.12); }
.ce-tyre-pressure-block:nth-child(1) .ce-tyre-input:focus { background: rgba(56,120,180,0.20); }
.ce-tyre-pressure-block:nth-child(2) .ce-tyre-input { background: rgba(200,60,60,0.12); }
.ce-tyre-pressure-block:nth-child(2) .ce-tyre-input:focus { background: rgba(200,60,60,0.20); }
.ce-tyre-pressure-block:nth-child(3) .ce-tyre-input { background: rgba(160,130,50,0.12); }
.ce-tyre-pressure-block:nth-child(3) .ce-tyre-input:focus { background: rgba(160,130,50,0.20); }

/* Shared grid styles */
.ce-tyre-grid {
  display: grid; gap: 3px;
}
.ce-tyre-grid-header {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 8px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: #3a4858;
  text-align: center; padding: 2px 0;
}
.ce-tyre-grid-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700; color: #4a5a6b;
  display: flex; align-items: center;
}
.ce-tyre-input {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 600; color: #dce3ed;
  background: #0e1219;
  border: 1px solid #1a2230; border-radius: 4px;
  padding: 3px 4px; text-align: center; width: 100%;
  transition: border-color 0.15s, background 0.15s;
}
.ce-tyre-input:focus { outline: none; border-color: #4ac8a4; background: #101520; }
.ce-tyre-input:hover:not(:focus) { border-color: #222d3d; }
.ce-tyre-input::placeholder { color: #1f2838; }

/* Temp grid: label | out·mid·in (left) | sep | in·mid·out (right) */
.ce-tyre-temp-grid { grid-template-columns: 24px repeat(3, 1fr) 8px repeat(3, 1fr); }
.ce-tyre-temp-sep {
  border-left: 1px solid #1c2838;
  margin: 0 auto;
}

/* Section spacing for temp/brake sections */
.ce-tyre-pressures-row + .ce-tyre-section-title { margin-top: 0; }
.ce-tyre-section-title + .ce-tyre-grid { margin-bottom: 12px; }
.ce-tyre-grid + .ce-tyre-section-title {
  padding-top: 10px;
  border-top: 1px solid #151c28;
}

.ce-tyre-brake-grid { grid-template-columns: 24px repeat(4, 1fr); }

.ce-run-content { min-height: 100px; }
.ce-run-empty {
  font-family: 'Barlow', sans-serif;
  font-size: 12px; color: #3a4555; text-align: center;
  padding: 30px 0;
}

/* ── Responsive: detail panels ───────────────────────────────────────────── */
@media (max-width: 1100px) {
  .ce-run-body { flex-direction: column; }
  .ce-run-tyre-panel { width: 100%; border-left-width: 1px; }
}
@media (max-width: 860px) {
  .ce-run-layout { flex-direction: column; }
  .ce-run-sidebar {
    width: 100%; border-right: none;
    border-bottom: 1px solid #182030;
  }
  .ce-run-list {
    flex-direction: row; overflow-x: auto; flex-wrap: nowrap;
  }
  .ce-run-list-item {
    border-left: 3px solid transparent;
    border-bottom: 3px solid transparent;
    border-left-color: transparent !important;
  }
  .ce-run-list-item.active {
    border-bottom-color: #4ac8a4;
  }
  .ce-run-detail { padding: 14px 14px 16px; }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ══ LAP TABLE — Visual anchor / primary workspace ══════════════════════════ */
/* ═══════════════════════════════════════════════════════════════════════════ */

.ce-lap-table-wrap {
  overflow-x: auto; border-radius: 8px;
  border: 1px solid #1c2838;
  background: #080c12;
  box-shadow: inset 0 1px 0 0 rgba(74,200,164,0.1);
}
.ce-lap-table {
  width: 100%; border-collapse: collapse;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
}
.ce-lap-table th {
  font-size: 9px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: #5a7088;
  padding: 10px 8px; text-align: left;
  background: #0c1019;
  border-bottom: 2px solid #1c2838;
  white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.ce-lap-table td {
  padding: 8px 8px; color: #8899aa;
  border-bottom: 1px solid #141c28;
  white-space: nowrap;
}
.ce-lap-table tr:last-child td { border-bottom: none; }

/* Read-only lap/stint labels */
.ce-lap-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; color: #5a7088; font-weight: 600;
}

/* Subtle alternating rows */
.ce-lap-table tbody tr:nth-child(even) td {
  background: rgba(255,255,255,0.008);
}

/* Row hover — teal-tinted */
.ce-lap-table tr:hover td {
  background: rgba(74,200,164,0.03);
}

/* Active row — when any input is focused */
.ce-lap-table tr:focus-within td {
  background: rgba(74,200,164,0.04);
}

/* Lap time highlighting */
.ce-lap-best { color: #22c55e !important; font-weight: 700; }           /* green – fastest in this run */
.ce-lap-allbest { color: #38bdf8 !important; font-weight: 700; }        /* light blue – fastest across all runs */
.ce-lap-session-best { color: #a78bfa !important; font-weight: 700; }   /* purple – session best */
.ce-lap-worst { color: #e8a44a; }
.ce-lap-marker {
  width: 4px; height: 4px; border-radius: 50%;
  display: inline-block; margin-right: 4px;
}
.ce-lap-marker.green  { background: #22c55e; box-shadow: 0 0 4px rgba(34,197,94,0.4); }
.ce-lap-marker.yellow { background: #f59e0b; box-shadow: 0 0 4px rgba(245,158,11,0.4); }
.ce-lap-marker.red    { background: #ef4444; box-shadow: 0 0 4px rgba(239,68,68,0.4); }

/* Lap inline editing */
.ce-lap-input {
  background: transparent; border: none;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; color: #c0ccda;
  width: 70px; padding: 2px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: border-color 0.15s, color 0.15s;
}
.ce-lap-input:hover { border-bottom-color: rgba(255,255,255,0.1); }
.ce-lap-input:focus {
  outline: none;
  border-bottom: 2px solid #4ac8a4;
  color: #e0e7f1;
}
.ce-lap-input::placeholder { color: #1f2838; }
.ce-lap-input[type="number"]::-webkit-inner-spin-button,
.ce-lap-input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none; margin: 0;
}
.ce-lap-input[type="number"] { -moz-appearance: textfield; }

/* Add lap button row */
.ce-add-lap-row {
  display: flex; justify-content: center; padding: 10px 0;
}
.ce-add-lap-btn {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 0.6px;
  text-transform: uppercase; color: #4a5a6b;
  background: transparent; border: 1px dashed #1c2838;
  border-radius: 6px; padding: 5px 18px; cursor: pointer;
  transition: all 0.15s;
}
.ce-add-lap-btn:hover {
  color: #d4f542; border-color: rgba(212,245,66,0.3);
  background: rgba(212,245,66,0.03);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ══ NOTES & ISSUES — Secondary workspace ═══════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════════════════ */

.ce-comments-section { margin-top: 16px; }
.ce-comments-toggle {
  display: flex; align-items: center; gap: 6px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: #4a5a6b;
  cursor: pointer; padding: 6px 0;
  user-select: none; transition: color 0.15s;
}
.ce-comments-toggle:hover { color: #8899aa; }
.ce-comments-toggle-icon {
  transition: transform 0.2s; font-size: 12px; line-height: 1;
}
.ce-comments-section.collapsed .ce-comments-body { display: none; }
.ce-comments-section.collapsed .ce-comments-toggle-icon { transform: rotate(-90deg); }

/* Comments grid */
.ce-comments-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 14px;
}
@media (max-width: 700px) { .ce-comments-grid { grid-template-columns: 1fr; } }
.ce-comment-box {
  background: rgba(255,255,255,0.012);
  border: 1px solid #182030; border-radius: 8px;
  padding: 10px 12px;
}
.ce-comment-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: #3a4858;
  margin-bottom: 6px;
}
.ce-comment-text {
  font-family: 'Barlow', sans-serif;
  font-size: 12px; color: #8899aa; line-height: 1.5;
  white-space: pre-wrap; min-height: 40px;
}
.ce-comment-textarea {
  width: 100%; background: transparent; border: none;
  font-family: 'Barlow', sans-serif;
  font-size: 12px; color: #dce3ed; line-height: 1.5;
  resize: vertical; min-height: 50px; padding: 0;
}
.ce-comment-textarea:focus { outline: none; }
.ce-comment-textarea::placeholder { color: #252d3d; }

/* Issue list below comments */
.ce-issues-section { margin-top: 14px; }
.ce-issue-list {
  display: flex; flex-direction: column; gap: 4px;
}
.ce-issue-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px; border-radius: 6px;
  background: rgba(255,255,255,0.012);
}
.ce-issue-type {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; padding: 1.5px 7px;
  border-radius: 3px; min-width: 56px; text-align: center;
  background: rgba(239,68,68,0.08); color: #e8a44a;
}
.ce-issue-desc {
  font-family: 'Barlow', sans-serif;
  font-size: 12px; color: #8899aa; flex: 1;
}

/* ── Jobs Card ────────────────────────────────────────────────────────────── */
.ce-jobs-body {
  display: flex; flex-direction: column; gap: 6px;
}
.ce-job-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  background: rgba(255,255,255,0.018);
  border: 1px solid #1c222c;
  transition: border-color 0.15s;
}
.ce-job-item:hover { border-color: #2a3545; }

.ce-job-priority {
  width: 3px; height: 28px; border-radius: 2px;
  flex-shrink: 0;
}
.ce-job-priority.low      { background: #3a4555; }
.ce-job-priority.normal   { background: #3b82f6; }
.ce-job-priority.high     { background: #f59e0b; }
.ce-job-priority.critical { background: #ef4444; }

.ce-job-body { flex: 1; min-width: 0; }
.ce-job-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 700; color: #dce3ed;
}
.ce-job-detail {
  font-family: 'Barlow', sans-serif;
  font-size: 11px; color: #5a6a7b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ce-job-assignee {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 600; color: #5a6a7b;
  white-space: nowrap;
}

.ce-job-status-btn {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px; font-weight: 700; letter-spacing: 0.6px;
  text-transform: uppercase; padding: 3px 10px;
  border-radius: 4px; border: 1px solid; cursor: pointer;
  flex-shrink: 0; transition: all 0.15s;
}
.ce-job-status-btn.pending {
  color: #5a6a7b; border-color: #2a3545; background: transparent;
}
.ce-job-status-btn.pending:hover { color: #f59e0b; border-color: rgba(245,158,11,0.3); }
.ce-job-status-btn.acknowledged {
  color: #f59e0b; border-color: rgba(245,158,11,0.25);
  background: rgba(245,158,11,0.06);
}
.ce-job-status-btn.acknowledged:hover { color: #3b82f6; border-color: rgba(59,130,246,0.3); }
.ce-job-status-btn.in_progress {
  color: #3b82f6; border-color: rgba(59,130,246,0.25);
  background: rgba(59,130,246,0.06);
}
.ce-job-status-btn.in_progress:hover { color: #4ac8a4; border-color: rgba(74,200,164,0.3); }
.ce-job-status-btn.done {
  color: #4ac8a4; border-color: rgba(74,200,164,0.25);
  background: rgba(74,200,164,0.06);
}

.ce-job-del {
  background: transparent; border: 1px solid transparent;
  border-radius: 4px; color: #3a4555; font-size: 10px;
  padding: 2px 5px; cursor: pointer; opacity: 0;
  transition: all 0.15s;
}
.ce-job-item:hover .ce-job-del { opacity: 1; }
.ce-job-del:hover { color: #ef4444; border-color: rgba(239,68,68,0.3); }

/* ── Modals ───────────────────────────────────────────────────────────────── */
.ce-modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); z-index: 450;
}
.ce-modal-backdrop.open { display: block; }
.ce-modal {
  display: none; position: fixed;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(480px, calc(100vw - 40px));
  background: #0f1318; border: 1px solid #2a3040;
  border-radius: 16px; z-index: 451;
  flex-direction: column; overflow: hidden;
}
.ce-modal.open { display: flex; }
.ce-modal-lg { width: min(640px, calc(100vw - 40px)); }
.ce-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 14px; border-bottom: 1px solid #1f2530;
}
.ce-modal-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase; color: #dce3ed;
}
.ce-modal-body {
  padding: 16px 20px; overflow-y: auto;
  max-height: calc(100vh - 200px);
}
.ce-modal-section-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: #4a5568;
  margin: 14px 0 8px; padding-top: 10px;
  border-top: 1px solid #1f2530;
}
.ce-modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 20px; border-top: 1px solid #1f2530;
}

/* ── Run edit actions ─────────────────────────────────────────────────────── */
.ce-run-header-actions {
  display: flex; gap: 6px; margin-left: auto;
}
.ce-run-edit-btn {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px; font-weight: 700; letter-spacing: 0.6px;
  text-transform: uppercase; padding: 3px 10px;
  border-radius: 5px; border: 1px solid #2a3545;
  background: transparent; color: #5a6a7b; cursor: pointer;
  transition: all 0.15s;
}
.ce-run-edit-btn:hover { color: #dce3ed; border-color: #3a4555; }
.ce-run-edit-btn.delete { opacity: 0.3; border-color: transparent; }
.ce-run-edit-btn.delete:hover { opacity: 1; color: #ef4444; border-color: rgba(239,68,68,0.25); }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ══ LIGHT MODE ═════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════════════════ */

body.light-mode .ce-card     { background: #ffffff; border-color: #dde2ec; }
body.light-mode .ce-card-title { color: #6b7a8d; }
body.light-mode .ce-ctx-name  { color: #1a2030; }
body.light-mode .ce-ctx-meta  { color: #8899aa; }
body.light-mode .ce-ctx-btn:hover { background: rgba(0,0,0,0.04); border-color: #c8d0dc; }
body.light-mode .ce-switcher  { background: #ffffff; border-color: #dde2ec; box-shadow: 0 16px 40px rgba(0,0,0,0.15); }
body.light-mode .ce-sw-hdr    { border-bottom-color: #dde2ec; }
body.light-mode .ce-sw-field + .ce-sw-field { border-top-color: #eef0f5; }
body.light-mode .ce-filter-select,
body.light-mode .ce-event-select { background: #ffffff; border-color: #dde2ec; color: #1a2030; }
body.light-mode .ce-filter-select option,
body.light-mode .ce-event-select option { background: #ffffff; color: #1a2030; }
body.light-mode .ce-btn-add { color: #5a7a00; border-color: rgba(90,122,0,0.25); }
body.light-mode .ce-btn-add:hover { background: rgba(90,122,0,0.06); border-color: #5a7a00; }
body.light-mode .ce-event-banner { background: #ffffff; border-color: #dde2ec; }
body.light-mode .ce-banner-car { color: #1a2030; }
body.light-mode .ce-banner-date { color: #6b7a8d; }
body.light-mode .ce-banner-sep { color: #c8d0dc; }
body.light-mode .ce-setup-name { color: #1a2030; }
body.light-mode .ce-setup-item { background: #f8f9fc; border-color: #e8ecf2; }
body.light-mode .ce-setup-item:hover { border-color: #dde2ec; }
body.light-mode .ce-team-pill { background: rgba(0,0,0,0.03); border-color: #dde2ec; }
body.light-mode .ce-run-field-now { color: #5a7a00; background: rgba(90,122,0,0.06); border-color: rgba(90,122,0,0.25); }
body.light-mode .ce-run-field-now:hover { background: rgba(90,122,0,0.12); border-color: #5a7a00; box-shadow: none; }
body.light-mode .ce-run-group-label { color: #8899aa; }
body.light-mode .ce-run-field-label { color: #8899aa; }
body.light-mode .ce-run-field-input::placeholder { color: #b0b8c4; }
body.light-mode select.ce-run-field-input option { background: #ffffff; color: #1a2030; }

/* Run sheet card */
body.light-mode .ce-card-runs { background: #f7f8fb; border-color: #dde2ec; }
body.light-mode .ce-card-runs .ce-card-header { border-bottom-color: #dde2ec; }
body.light-mode .ce-tracking-indicator { background: rgba(34,197,94,0.08); }
body.light-mode .ce-tracking-indicator.reconnecting { background: rgba(245,158,11,0.08); }
body.light-mode .ce-tracking-indicator.disconnected { background: rgba(239,68,68,0.08); }
body.light-mode .ce-tracking-indicator.offline { background: rgba(90,106,123,0.08); }
body.light-mode .ce-run-sidebar { border-color: #dde2ec; background: #f0f2f7; }
body.light-mode .ce-run-list-item:hover { background: rgba(0,0,0,0.03); }
body.light-mode .ce-run-list-item.active { background: rgba(74,200,164,0.08); border-left-color: #4ac8a4; }
body.light-mode .ce-run-list-name { color: #4a5568; }
body.light-mode .ce-run-list-item.active .ce-run-list-name { color: #1a2030; }
body.light-mode .ce-run-list-laps { background: rgba(0,0,0,0.04); color: #8899aa; }
body.light-mode .ce-run-list-item.active .ce-run-list-laps { background: rgba(74,200,164,0.1); color: #4ac8a4; }

/* Run info */
body.light-mode .ce-run-info-header { border-bottom-color: #dde2ec; }
body.light-mode .ce-run-name-input { color: #1a2030 !important; }
body.light-mode .ce-run-name-input:hover { border-color: #ccd3de !important; }
body.light-mode .ce-run-info-group { background: #f0f2f7; border-color: #dde2ec; }
body.light-mode .ce-run-field-input { background: #ffffff; border-color: #dde2ec; color: #1a2030; }
body.light-mode .ce-run-section-divider { color: #8899aa; border-top-color: #dde2ec; }

/* Tyre panel */
body.light-mode .ce-run-tyre-panel { background: #f0f2f7; border-color: #dde2ec; border-left-color: rgba(74,200,164,0.3); }
body.light-mode .ce-tyre-input { background: #ffffff; border-color: #dde2ec; color: #1a2030; }
body.light-mode .ce-tyre-pressure-block:nth-child(1) .ce-tyre-input { background: rgba(56,120,180,0.08); }
body.light-mode .ce-tyre-pressure-block:nth-child(2) .ce-tyre-input { background: rgba(200,60,60,0.08); }
body.light-mode .ce-tyre-pressure-block:nth-child(3) .ce-tyre-input { background: rgba(160,130,50,0.08); }
body.light-mode .ce-tyre-section-title:not(:first-child) { border-top-color: #dde2ec; }

/* Lap table */
body.light-mode .ce-lap-table-wrap { border-color: #dde2ec; background: #ffffff; box-shadow: none; }
body.light-mode .ce-lap-table th { color: #6a7a8b; background: #f5f6f9; border-bottom-color: #dde2ec; }
body.light-mode .ce-lap-table td { border-bottom-color: #eef0f5; }
body.light-mode .ce-lap-table tbody tr:nth-child(even) td { background: rgba(0,0,0,0.01); }
body.light-mode .ce-lap-input { color: #1a2030; border-bottom-color: rgba(0,0,0,0.06); }
body.light-mode .ce-lap-input:hover { border-bottom-color: rgba(0,0,0,0.15); }

/* Comments */
body.light-mode .ce-comments-toggle { color: #8899aa; }
body.light-mode .ce-comment-box { background: #f5f6f9; border-color: #dde2ec; }

/* ── Session Groups (run list sidebar) ──────────────────────────────────────── */
.ce-session-group {
  margin-bottom: 4px;
}
.ce-session-group.unfocused {
  display: none;
}
.ce-session-group.collapsed .ce-session-runs {
  display: none;
}
.ce-session-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 8px 5px 10px;
  background: rgba(255,255,255,0.02);
  border-left: 2px solid #2a3545;
  margin-bottom: 2px;
  gap: 6px;
  user-select: none;
  transition: background 0.12s;
}
.ce-session-header:hover {
  background: rgba(255,255,255,0.04);
}
.ce-session-header-left {
  display: flex; align-items: center; gap: 7px; min-width: 0; flex: 1;
}
.ce-session-collapse-arrow {
  font-size: 7px; color: #4a5568; flex-shrink: 0;
  transition: color 0.12s;
}
.ce-session-header:hover .ce-session-collapse-arrow { color: #7a8a9b; }
.ce-session-type-dot {
  flex-shrink: 0;
  width: 7px; height: 7px; border-radius: 50%;
  background: #5a6678;
}
.ce-session-header-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: 0.6px;
  text-transform: uppercase; color: #7a8a9b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ce-session-header-actions {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.ce-session-focus-btn {
  background: transparent; border: 1px solid #2a3545;
  color: #4a5568; font-size: 11px;
  width: 20px; height: 20px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; line-height: 1;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ce-session-focus-btn:hover {
  background: rgba(99,102,241,0.12); border-color: #6366f1; color: #6366f1;
}
.ce-session-focus-btn.active {
  background: rgba(99,102,241,0.18); border-color: #6366f1; color: #6366f1;
}
.ce-session-add-run {
  flex-shrink: 0;
  background: transparent; border: 1px solid #2a3545;
  color: #7a8a9b; font-size: 14px; font-weight: 400;
  width: 20px; height: 20px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; line-height: 1;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ce-session-add-run:hover {
  background: rgba(212,245,66,0.1); border-color: #d4f542; color: #d4f542;
}
.ce-run-empty-small {
  padding: 6px 10px 8px;
  font-size: 10px; color: #3a4555; font-style: italic;
}

/* ── Light mode ── */
body.light-mode .ce-session-header { background: rgba(0,0,0,0.02); border-left-color: #dde2ec; }
body.light-mode .ce-session-header:hover { background: rgba(0,0,0,0.04); }
body.light-mode .ce-session-header-name { color: #8899aa; }
body.light-mode .ce-session-collapse-arrow { color: #c0c8d8; }
body.light-mode .ce-session-focus-btn { border-color: #dde2ec; color: #c0c8d8; }
body.light-mode .ce-session-focus-btn:hover, body.light-mode .ce-session-focus-btn.active { background: rgba(99,102,241,0.08); border-color: #6366f1; color: #6366f1; }
body.light-mode .ce-session-add-run { border-color: #dde2ec; color: #8899aa; }
body.light-mode .ce-session-add-run:hover { background: rgba(99,102,241,0.08); border-color: #6366f1; color: #6366f1; }
body.light-mode .ce-run-empty-small { color: #aab4c0; }

/* ── Half-width card ───────────────────────────────────────────────────────── */
.ce-half-card { max-width: 50%; }
@media (max-width: 860px) { .ce-half-card { max-width: 100%; } }

/* ── Tyre set entry: datetime-local, session width, new wide layout ─────────── */
input[type="datetime-local"].ce-ts-input {
  -webkit-appearance: none; appearance: none;
}
input[type="datetime-local"].ce-ts-input::-webkit-calendar-picker-indicator { display: none; }

.ce-ts-field-time    { flex: 0 0 88px; }
.ce-ts-field-session { flex: 0 0 76px; min-width: 0; }
.ce-ts-field-laps    { flex: 0 0 32px; }
.ce-ts-field-notes   { flex: 1 1 60px; min-width: 40px; }

.ce-ts-entry-sep {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; color: #2a3545; flex-shrink: 0;
  align-self: flex-end; padding-bottom: 4px;
}
.ce-ts-badge-cold, .ce-ts-badge-hot {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 8px; font-weight: 700; letter-spacing: 0.5px;
  padding: 1px 5px; border-radius: 3px;
  flex-shrink: 0; align-self: flex-end; margin-bottom: 4px;
  white-space: nowrap;
}
.ce-ts-badge-cold { background: rgba(56,120,180,0.15); color: #7ab0d8; }
.ce-ts-badge-hot  { background: rgba(200,60,60,0.15);  color: #e08080; }

.ce-ts-input-cold { background: rgba(56,120,180,0.13) !important; }
.ce-ts-input-cold:focus { background: rgba(56,120,180,0.22) !important; }
.ce-ts-input-hot  { background: rgba(200,60,60,0.13) !important; }
.ce-ts-input-hot:focus  { background: rgba(200,60,60,0.22) !important; }


/* ── Run info: narrow tyre set select ──────────────────────────────────────── */
.ce-group-tyre-fuel select.ce-run-field-input { width: 80px; }

/* ── Run tyre panel: pressure blocks (Cold / Hot / Bleed) ──────────────────── */
.ce-press-blocks {
  display: flex; gap: 8px; margin-bottom: 10px;
}
.ce-press-block {
  flex: 1; background: rgba(255,255,255,0.02);
  border: 1px solid #1a2434; border-radius: 5px; padding: 7px 8px;
}
.ce-press-block-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 8px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: #4a5a6b;
  margin-bottom: 6px; text-align: center;
}
.ce-press-block-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px 4px;
}
.ce-press-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 8px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: #3a4a5b; text-align: center;
}
.ce-press-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; font-weight: 700; text-align: center;
  padding: 3px 4px; border-radius: 3px;
  border: 1px solid transparent;
}
.ce-press-val.cold {
  color: #7ab0d8; background: rgba(56,120,180,0.12);
  border-color: rgba(56,120,180,0.18);
}
.ce-press-inp {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; font-weight: 700; color: #dce3ed;
  border: 1px solid #1e2a3a; border-radius: 3px;
  padding: 3px 4px; text-align: center; width: 100%;
  transition: border-color 0.15s, background 0.15s;
}
.ce-press-inp:focus { outline: none; border-color: #4ac8a4; }
.ce-press-inp::placeholder { color: #2a3848; }
.ce-press-inp::-webkit-inner-spin-button,
.ce-press-inp::-webkit-outer-spin-button { -webkit-appearance: none; }
.ce-press-inp.hot { background: rgba(200,60,60,0.08); color: #e08080; }
.ce-press-inp.hot:focus { background: rgba(200,60,60,0.15); }
.ce-press-inp.bleed { background: rgba(160,130,50,0.12); color: #d4b060; }
.ce-press-inp.bleed:focus { background: rgba(160,130,50,0.22); }

/* ── Tyre set card: hot measurement rows from runs ─────────────────────────── */
.ce-ts-entry-hot {
  background: rgba(200,60,60,0.06);
  border-top: 2px solid rgba(200,60,60,0.22);
}
.ce-ts-entry-hot .ce-ts-entry-fields {
  gap: 6px;
}
.ce-ts-field-run-name {
  flex: 0 0 auto; min-width: 60px;
}
.ce-ts-run-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 700; color: #dce3ed;
  white-space: nowrap;
}
.ce-ts-run-laps {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px; font-weight: 700; letter-spacing: 0.3px;
  color: #4a6080; margin-top: 1px;
}

/* Tyre set mileage in header row */
.ce-ts-mileage {
  display: inline-flex; align-items: center; gap: 0;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 0.3px;
  margin-left: 6px;
}
.ce-ts-mileage-pre {
  color: #3a4a5a;
}
.ce-ts-mileage-sep {
  color: #222c3a;
}
.ce-ts-mileage-evt {
  color: #4ac8a4;
}
.ce-ts-stat {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; font-weight: 700; text-align: center;
  display: block; padding: 2px 4px; border-radius: 3px;
  border: 1px solid transparent; color: #5a6a7b;
}
.ce-ts-stat.hot {
  color: #e08080; background: rgba(200,60,60,0.10);
  border-color: rgba(200,60,60,0.18);
}
.ce-ts-stat.bleed {
  color: #d4b060; background: rgba(160,130,50,0.12);
  border-color: rgba(160,130,50,0.20);
}
.ce-ts-badge-bleed {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 8px; font-weight: 700; letter-spacing: 0.5px;
  padding: 1px 5px; border-radius: 3px; white-space: nowrap; align-self: flex-end; margin-bottom: 2px;
  background: rgba(160,130,50,0.2); color: #d4b060;
}

/* ── Session picker overlay ──────────────────────────────────────────────────── */
.ce-session-picker-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55);
}
.ce-session-picker {
  background: #0d1520; border: 1px solid #1e2d40;
  border-radius: 8px; padding: 16px; min-width: 200px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.ce-session-picker-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: #4a6080;
  margin-bottom: 4px; text-align: center;
}
.ce-session-picker-btn {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 600; color: #c0ccd8;
  background: rgba(255,255,255,0.04); border: 1px solid #1e2d40;
  border-radius: 5px; padding: 7px 12px; cursor: pointer;
  text-align: left; transition: background 0.12s, border-color 0.12s;
}
.ce-session-picker-btn:hover { background: rgba(74,200,164,0.12); border-color: #4ac8a4; color: #4ac8a4; }
.ce-session-picker-none { color: #4a5a6b; border-style: dashed; }
.ce-session-picker-cancel {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 600; color: #3a4a5b;
  background: none; border: none; cursor: pointer;
  padding: 4px; text-align: center; margin-top: 2px;
  letter-spacing: 0.8px; text-transform: uppercase;
}
.ce-session-picker-cancel:hover { color: #e06060; }
